From 8784b8e5eef7fc3b44d569115df75a2f6e45cde0 Mon Sep 17 00:00:00 2001 From: kimi-agent-bot Date: Fri, 28 Aug 2026 05:13:34 +0000 Subject: [PATCH 1/2] chore: sync web dist from code-app code-app: 6bf27e160b628fa5feb2cc6373c0895cbc4dc155 --- .changeset/web-composer-placeholder-caret.md | 5 + ...-TQKPIcUp.js => CodeBlockNode-DiXk8vTC.js} | 4 +- ...ooltip-3Kylewm2.js => Tooltip-BI78FOq1.js} | 2 +- ...NF.js => abnfDiagram-VRR7QNED-4qTui6G_.js} | 2 +- .../{arc-C525Mmp6.js => arc-x24dd6EE.js} | 2 +- ... architectureDiagram-ZJ3FMSHR-DU8Ns-cR.js} | 2 +- ...z.js => blockDiagram-677ZJIJ3-CSXzh0NB.js} | 2 +- ...xvwh.js => c4Diagram-LMCZKHZV-DqXL2ZOL.js} | 2 +- .../dist-web/assets/channel-5_2atmZK.js | 1 - .../dist-web/assets/channel-C-YOi8lT.js | 1 + ...CldwFnN4.js => chunk-2Q5K7J3B-DoBgLSx1.js} | 2 +- ...0ImWpiFu.js => chunk-32BRIVSS-BXcVdJ-W.js} | 2 +- ...K_NNkrmw.js => chunk-5VM5RSS4-BV4ucc4y.js} | 2 +- ...Du5tJK2w.js => chunk-EX3LRPZG-DyuxL3R0.js} | 2 +- ...CnsTQcA8.js => chunk-JWPE2WC7-C3Ln9Diz.js} | 2 +- ...BWiH3s-c.js => chunk-MOJQB5TN-DfjF6X7a.js} | 2 +- ...Bg4GHN0V.js => chunk-RYQCIY6F-8FUQcOpv.js} | 2 +- ...5w7loxVR.js => chunk-V7JOEXUC-DD40RxNF.js} | 2 +- ...Cp8JVohH.js => chunk-VR4S4FIN-DXOr7Xkl.js} | 2 +- ...BwEKpC0s.js => chunk-XXDRQBXY-BLb3KbCy.js} | 2 +- .../assets/classDiagram-OUVF2IWQ-C0VBUqk7.js | 1 + .../assets/classDiagram-OUVF2IWQ-CNk36E8O.js | 1 - .../classDiagram-v2-EOCWNBFH-C0VBUqk7.js | 1 + .../classDiagram-v2-EOCWNBFH-CNk36E8O.js | 1 - ...S.js => cose-bilkent-JH36ORCC-bJETd0G9.js} | 2 +- ...8il_Gb.js => cynefin-VYW2F7L2-CjWbot6H.js} | 2 +- ...js => cynefinDiagram-TSTJHNR4-CMTHGHjI.js} | 2 +- ...BuaL-XNK.js => dagre-VKFMJZFB-BPvIVMQX.js} | 2 +- ...KGXolr.js => diagram-FQU43EPY-D74w020-.js} | 2 +- ...oHq3g9.js => diagram-G47NLZAW-BNySynrU.js} | 2 +- ...Pip_5t.js => diagram-NH7WQ7WH-DSv1qX00.js} | 2 +- ...8otT0J.js => diagram-OA4YK3LP-CBHxgtCp.js} | 2 +- ...hlXXXb.js => diagram-WEI45ONY-H-MqZGXv.js} | 2 +- ...zP.js => ebnfDiagram-CCIWWBDH-CEJoe0UD.js} | 2 +- ...mVdA.js => erDiagram-Q63AITRT-CythxxSO.js} | 2 +- ...wd.js => flowDiagram-23GEKE2U-CAiKF6Zk.js} | 2 +- ...2.js => ganttDiagram-NO4QXBWP-BZuybaxa.js} | 2 +- ...s => gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js} | 2 +- .../{index-BlRksujk.js => index-CLyK-bJw.js} | 2 +- .../{index-CvgiEu-R.js => index-ChnXJINq.js} | 556 +++++++++--------- .../{index-DuIqvsra.js => index-DzigsE_1.js} | 2 +- ...{index-BxiMZi52.css => index-QkzZp0Kk.css} | 2 +- .../{index-Dq61ZbBp.js => index-V9jHT2Qw.js} | 4 +- ...ndex10-C0TQjdWb.js => index10-DGuREUB3.js} | 2 +- ...ndex11-DNt97Omj.js => index11-ChlZyGAH.js} | 2 +- ...{index5-DPyXoDa2.js => index5-CfzaNIoE.js} | 2 +- ...{index6-RUyA_B9p.js => index6-CPKEqG-u.js} | 2 +- ...{index7-ClRJOaWc.js => index7-Dw6CHuX-.js} | 2 +- ...{index8-Dx-vzK_w.js => index8-6GF_RzW4.js} | 2 +- ...ZG.js => infoDiagram-FWYZ7A6U-CUw0bC3y.js} | 2 +- ...s => ishikawaDiagram-FXEZZL3T-BQLkKOjp.js} | 2 +- ...js => journeyDiagram-5HDEW3XC-D9J7zYIT.js} | 2 +- ...=> kanban-definition-HUTT4EX6-BFENhRSJ.js} | 2 +- ...{linear-Cu3jckud.js => linear-DZwFWlPa.js} | 2 +- ...e-CGrLstUA.js => mermaid.core-XMN3hSDH.js} | 8 +- ...> mindmap-definition-LN4V7U3C-DVXXLA72.js} | 2 +- ...xxE.js => pegDiagram-2B236MQR-C6WedOo8.js} | 2 +- ...nJ8.js => pieDiagram-ENE6RG2P-hsSQniWq.js} | 2 +- ...s => quadrantDiagram-ABIIQ3AL-DczKOfwA.js} | 2 +- ...s => railroadDiagram-RFXS5EU6-Bo3Qjwvx.js} | 2 +- ...> requirementDiagram-TGXJPOKE-BTUv_Oh8.js} | 2 +- ....js => sankeyDiagram-HTMAVEWB-lACUqAhA.js} | 2 +- ...s => sequenceDiagram-DBY2YBRQ-td3c-NEP.js} | 2 +- ...pZ.js => sizeCapture-X5ZJPWSS-C2SuSg-g.js} | 2 +- ...L.js => stateDiagram-2N3HPSRC-A7OvRFce.js} | 2 +- .../stateDiagram-v2-6OUMAXLB-D2Op2fy3.js | 1 - .../stateDiagram-v2-6OUMAXLB-DA4wVJGo.js | 1 + ...vHyU.js => swimlanes-5IMT3BWC-e4qfs0uW.js} | 4 +- .../swimlanesDiagram-G3AALYLV-Ou5HSK_e.js | 8 + .../swimlanesDiagram-G3AALYLV-gPkWeD2t.js | 8 - ... timeline-definition-FHXFAJF6-DTRr-LYc.js} | 2 +- ...4a.js => vennDiagram-L72KCM5P-CF_UwcSA.js} | 2 +- ...js => vue.runtime.esm-bundler-BMAq9omn.js} | 2 +- ...js => wardleyDiagram-EHGQE667-Dlkrf9qY.js} | 2 +- ...js => xychartDiagram-FW5EYKEG-OovywL2x.js} | 2 +- apps/kimi-code/dist-web/index.html | 4 +- 76 files changed, 366 insertions(+), 361 deletions(-) create mode 100644 .changeset/web-composer-placeholder-caret.md rename apps/kimi-code/dist-web/assets/{CodeBlockNode-TQKPIcUp.js => CodeBlockNode-DiXk8vTC.js} (99%) rename apps/kimi-code/dist-web/assets/{Tooltip-3Kylewm2.js => Tooltip-BI78FOq1.js} (98%) rename apps/kimi-code/dist-web/assets/{abnfDiagram-VRR7QNED-DZ5l2NNF.js => abnfDiagram-VRR7QNED-4qTui6G_.js} (86%) rename apps/kimi-code/dist-web/assets/{arc-C525Mmp6.js => arc-x24dd6EE.js} (98%) rename apps/kimi-code/dist-web/assets/{architectureDiagram-ZJ3FMSHR-DsZ4TpMi.js => architectureDiagram-ZJ3FMSHR-DU8Ns-cR.js} (99%) rename apps/kimi-code/dist-web/assets/{blockDiagram-677ZJIJ3-DHUznNgz.js => blockDiagram-677ZJIJ3-CSXzh0NB.js} (99%) rename apps/kimi-code/dist-web/assets/{c4Diagram-LMCZKHZV-BRKLxvwh.js => c4Diagram-LMCZKHZV-DqXL2ZOL.js} (99%) delete mode 100644 apps/kimi-code/dist-web/assets/channel-5_2atmZK.js create mode 100644 apps/kimi-code/dist-web/assets/channel-C-YOi8lT.js rename apps/kimi-code/dist-web/assets/{chunk-2Q5K7J3B-CldwFnN4.js => chunk-2Q5K7J3B-DoBgLSx1.js} (67%) rename apps/kimi-code/dist-web/assets/{chunk-32BRIVSS-0ImWpiFu.js => chunk-32BRIVSS-BXcVdJ-W.js} (96%) rename apps/kimi-code/dist-web/assets/{chunk-5VM5RSS4-K_NNkrmw.js => chunk-5VM5RSS4-BV4ucc4y.js} (83%) rename apps/kimi-code/dist-web/assets/{chunk-EX3LRPZG-Du5tJK2w.js => chunk-EX3LRPZG-DyuxL3R0.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-JWPE2WC7-CnsTQcA8.js => chunk-JWPE2WC7-C3Ln9Diz.js} (71%) rename apps/kimi-code/dist-web/assets/{chunk-MOJQB5TN-BWiH3s-c.js => chunk-MOJQB5TN-DfjF6X7a.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-RYQCIY6F-Bg4GHN0V.js => chunk-RYQCIY6F-8FUQcOpv.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-V7JOEXUC-5w7loxVR.js => chunk-V7JOEXUC-DD40RxNF.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-VR4S4FIN-Cp8JVohH.js => chunk-VR4S4FIN-DXOr7Xkl.js} (87%) rename apps/kimi-code/dist-web/assets/{chunk-XXDRQBXY-BwEKpC0s.js => chunk-XXDRQBXY-BLb3KbCy.js} (72%) create mode 100644 apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-C0VBUqk7.js delete mode 100644 apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-CNk36E8O.js create mode 100644 apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-C0VBUqk7.js delete mode 100644 apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-CNk36E8O.js rename apps/kimi-code/dist-web/assets/{cose-bilkent-JH36ORCC-CyvFRDuS.js => cose-bilkent-JH36ORCC-bJETd0G9.js} (99%) rename apps/kimi-code/dist-web/assets/{cynefin-VYW2F7L2-Ct8il_Gb.js => cynefin-VYW2F7L2-CjWbot6H.js} (99%) rename apps/kimi-code/dist-web/assets/{cynefinDiagram-TSTJHNR4-BP26cYtj.js => cynefinDiagram-TSTJHNR4-CMTHGHjI.js} (98%) rename apps/kimi-code/dist-web/assets/{dagre-VKFMJZFB-BuaL-XNK.js => dagre-VKFMJZFB-BPvIVMQX.js} (97%) rename apps/kimi-code/dist-web/assets/{diagram-FQU43EPY-BXKGXolr.js => diagram-FQU43EPY-D74w020-.js} (98%) rename apps/kimi-code/dist-web/assets/{diagram-G47NLZAW-DsoHq3g9.js => diagram-G47NLZAW-BNySynrU.js} (97%) rename apps/kimi-code/dist-web/assets/{diagram-NH7WQ7WH-l2Pip_5t.js => diagram-NH7WQ7WH-DSv1qX00.js} (93%) rename apps/kimi-code/dist-web/assets/{diagram-OA4YK3LP-DO8otT0J.js => diagram-OA4YK3LP-CBHxgtCp.js} (96%) rename apps/kimi-code/dist-web/assets/{diagram-WEI45ONY-tJhlXXXb.js => diagram-WEI45ONY-H-MqZGXv.js} (95%) rename apps/kimi-code/dist-web/assets/{ebnfDiagram-CCIWWBDH-DuVJXtzP.js => ebnfDiagram-CCIWWBDH-CEJoe0UD.js} (87%) rename apps/kimi-code/dist-web/assets/{erDiagram-Q63AITRT-q8LwmVdA.js => erDiagram-Q63AITRT-CythxxSO.js} (99%) rename apps/kimi-code/dist-web/assets/{flowDiagram-23GEKE2U-CSk8qFwd.js => flowDiagram-23GEKE2U-CAiKF6Zk.js} (99%) rename apps/kimi-code/dist-web/assets/{ganttDiagram-NO4QXBWP-BliHEJI2.js => ganttDiagram-NO4QXBWP-BZuybaxa.js} (99%) rename apps/kimi-code/dist-web/assets/{gitGraphDiagram-IHSO6WYX-DbTFMBma.js => gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js} (99%) rename apps/kimi-code/dist-web/assets/{index-BlRksujk.js => index-CLyK-bJw.js} (99%) rename apps/kimi-code/dist-web/assets/{index-CvgiEu-R.js => index-ChnXJINq.js} (57%) rename apps/kimi-code/dist-web/assets/{index-DuIqvsra.js => index-DzigsE_1.js} (99%) rename apps/kimi-code/dist-web/assets/{index-BxiMZi52.css => index-QkzZp0Kk.css} (73%) rename apps/kimi-code/dist-web/assets/{index-Dq61ZbBp.js => index-V9jHT2Qw.js} (99%) rename apps/kimi-code/dist-web/assets/{index10-C0TQjdWb.js => index10-DGuREUB3.js} (99%) rename apps/kimi-code/dist-web/assets/{index11-DNt97Omj.js => index11-ChlZyGAH.js} (99%) rename apps/kimi-code/dist-web/assets/{index5-DPyXoDa2.js => index5-CfzaNIoE.js} (95%) rename apps/kimi-code/dist-web/assets/{index6-RUyA_B9p.js => index6-CPKEqG-u.js} (98%) rename apps/kimi-code/dist-web/assets/{index7-ClRJOaWc.js => index7-Dw6CHuX-.js} (98%) rename apps/kimi-code/dist-web/assets/{index8-Dx-vzK_w.js => index8-6GF_RzW4.js} (99%) rename apps/kimi-code/dist-web/assets/{infoDiagram-FWYZ7A6U-Bge59IZG.js => infoDiagram-FWYZ7A6U-CUw0bC3y.js} (69%) rename apps/kimi-code/dist-web/assets/{ishikawaDiagram-FXEZZL3T-y8Y7SwAW.js => ishikawaDiagram-FXEZZL3T-BQLkKOjp.js} (99%) rename apps/kimi-code/dist-web/assets/{journeyDiagram-5HDEW3XC-B1mQtsyC.js => journeyDiagram-5HDEW3XC-D9J7zYIT.js} (98%) rename apps/kimi-code/dist-web/assets/{kanban-definition-HUTT4EX6-Bpgk0PjP.js => kanban-definition-HUTT4EX6-BFENhRSJ.js} (99%) rename apps/kimi-code/dist-web/assets/{linear-Cu3jckud.js => linear-DZwFWlPa.js} (98%) rename apps/kimi-code/dist-web/assets/{mermaid.core-CGrLstUA.js => mermaid.core-XMN3hSDH.js} (99%) rename apps/kimi-code/dist-web/assets/{mindmap-definition-LN4V7U3C-jRWZCKa4.js => mindmap-definition-LN4V7U3C-DVXXLA72.js} (98%) rename apps/kimi-code/dist-web/assets/{pegDiagram-2B236MQR-BBHHexxE.js => pegDiagram-2B236MQR-C6WedOo8.js} (87%) rename apps/kimi-code/dist-web/assets/{pieDiagram-ENE6RG2P-h3KzynJ8.js => pieDiagram-ENE6RG2P-hsSQniWq.js} (95%) rename apps/kimi-code/dist-web/assets/{quadrantDiagram-ABIIQ3AL-DFm-eCQb.js => quadrantDiagram-ABIIQ3AL-DczKOfwA.js} (99%) rename apps/kimi-code/dist-web/assets/{railroadDiagram-RFXS5EU6-Buc-7xRH.js => railroadDiagram-RFXS5EU6-Bo3Qjwvx.js} (84%) rename apps/kimi-code/dist-web/assets/{requirementDiagram-TGXJPOKE-CSxNTrK4.js => requirementDiagram-TGXJPOKE-BTUv_Oh8.js} (99%) rename apps/kimi-code/dist-web/assets/{sankeyDiagram-HTMAVEWB-Dd9T4UrJ.js => sankeyDiagram-HTMAVEWB-lACUqAhA.js} (99%) rename apps/kimi-code/dist-web/assets/{sequenceDiagram-DBY2YBRQ-Cr-Sj8Pb.js => sequenceDiagram-DBY2YBRQ-td3c-NEP.js} (99%) rename apps/kimi-code/dist-web/assets/{sizeCapture-X5ZJPWSS-Cl-kJspZ.js => sizeCapture-X5ZJPWSS-C2SuSg-g.js} (86%) rename apps/kimi-code/dist-web/assets/{stateDiagram-2N3HPSRC-BYfWdLSL.js => stateDiagram-2N3HPSRC-A7OvRFce.js} (96%) delete mode 100644 apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-D2Op2fy3.js create mode 100644 apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-DA4wVJGo.js rename apps/kimi-code/dist-web/assets/{swimlanes-5IMT3BWC-48M2vHyU.js => swimlanes-5IMT3BWC-e4qfs0uW.js} (99%) create mode 100644 apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-Ou5HSK_e.js delete mode 100644 apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-gPkWeD2t.js rename apps/kimi-code/dist-web/assets/{timeline-definition-FHXFAJF6-CsGFMDtB.js => timeline-definition-FHXFAJF6-DTRr-LYc.js} (99%) rename apps/kimi-code/dist-web/assets/{vennDiagram-L72KCM5P-B5PLrg4a.js => vennDiagram-L72KCM5P-CF_UwcSA.js} (99%) rename apps/kimi-code/dist-web/assets/{vue.runtime.esm-bundler-Ii2EKmOx.js => vue.runtime.esm-bundler-BMAq9omn.js} (98%) rename apps/kimi-code/dist-web/assets/{wardleyDiagram-EHGQE667-B6OLyL9l.js => wardleyDiagram-EHGQE667-Dlkrf9qY.js} (99%) rename apps/kimi-code/dist-web/assets/{xychartDiagram-FW5EYKEG-DfHxJPKU.js => xychartDiagram-FW5EYKEG-OovywL2x.js} (99%) diff --git a/.changeset/web-composer-placeholder-caret.md b/.changeset/web-composer-placeholder-caret.md new file mode 100644 index 00000000000..52046b208ff --- /dev/null +++ b/.changeset/web-composer-placeholder-caret.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Fix the web composer swallowing the first keystroke typed after clicking the empty-input placeholder — most visibly the first character of an IME composition. diff --git a/apps/kimi-code/dist-web/assets/CodeBlockNode-TQKPIcUp.js b/apps/kimi-code/dist-web/assets/CodeBlockNode-DiXk8vTC.js similarity index 99% rename from apps/kimi-code/dist-web/assets/CodeBlockNode-TQKPIcUp.js rename to apps/kimi-code/dist-web/assets/CodeBlockNode-DiXk8vTC.js index 4ba616436ec..9b11cb14e76 100644 --- a/apps/kimi-code/dist-web/assets/CodeBlockNode-TQKPIcUp.js +++ b/apps/kimi-code/dist-web/assets/CodeBlockNode-DiXk8vTC.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dq61ZbBp.js","assets/index-CvgiEu-R.js","assets/index-BxiMZi52.css"])))=>i.map(i=>d[i]); -import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-CvgiEu-R.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-Dq61ZbBp.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-V9jHT2Qw.js","assets/index-ChnXJINq.js","assets/index-QkzZp0Kk.css"])))=>i.map(i=>d[i]); +import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-ChnXJINq.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-V9jHT2Qw.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" diff --git a/apps/kimi-code/dist-web/assets/Tooltip-3Kylewm2.js b/apps/kimi-code/dist-web/assets/Tooltip-BI78FOq1.js similarity index 98% rename from apps/kimi-code/dist-web/assets/Tooltip-3Kylewm2.js rename to apps/kimi-code/dist-web/assets/Tooltip-BI78FOq1.js index 6b417a44997..c9d258734d5 100644 --- a/apps/kimi-code/dist-web/assets/Tooltip-3Kylewm2.js +++ b/apps/kimi-code/dist-web/assets/Tooltip-BI78FOq1.js @@ -1 +1 @@ -import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-CvgiEu-R.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; +import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-ChnXJINq.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; diff --git a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DZ5l2NNF.js b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-4qTui6G_.js similarity index 86% rename from apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DZ5l2NNF.js rename to apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-4qTui6G_.js index 2cd0a936db1..a1c4e67094e 100644 --- a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DZ5l2NNF.js +++ b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-4qTui6G_.js @@ -1 +1 @@ -import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-BWiH3s-c.js";import{p as f}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{_ as n,l as o}from"./mermaid.core-CGrLstUA.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; +import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DfjF6X7a.js";import{p as f}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as n,l as o}from"./mermaid.core-XMN3hSDH.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; diff --git a/apps/kimi-code/dist-web/assets/arc-C525Mmp6.js b/apps/kimi-code/dist-web/assets/arc-x24dd6EE.js similarity index 98% rename from apps/kimi-code/dist-web/assets/arc-C525Mmp6.js rename to apps/kimi-code/dist-web/assets/arc-x24dd6EE.js index 3101b9c2af5..947d84b18bf 100644 --- a/apps/kimi-code/dist-web/assets/arc-C525Mmp6.js +++ b/apps/kimi-code/dist-web/assets/arc-x24dd6EE.js @@ -1 +1 @@ -import{P as ln,Q as an,R as j,S,T as W,V as un,W as y,X as tn,Y as C,$ as _,a0 as rn,a1 as o,a2 as on,a3 as sn,a4 as fn}from"./mermaid.core-CGrLstUA.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,R,X,a){var I=E-l,i=q-h,n=X-v,d=a-R,u=d*I-n*i;if(!(u*ur*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` +import{p as ke}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as gt,D as Ze,ad as qe,l as Se,b as Qe,a as Je,n as Ke,o as je,g as _e,s as tr,p as er,A as rr,y as ir,B as ar,c as me,a$ as Ee,ai as ve,i as nr,d as or,q as sr,aj as hr,b7 as lr}from"./mermaid.core-XMN3hSDH.js";import{p as fr}from"./cynefin-VYW2F7L2-CjWbot6H.js";import{c as Fe}from"./cytoscape.esm-OyMbaexL.js";import{g as cr}from"./_commonjsHelpers-CqkleIqs.js";import"./index-ChnXJINq.js";var se={exports:{}},he={exports:{}},le={exports:{}},gr=le.exports,Me;function ur(){return Me||(Me=1,(function(L,b){(function(G,N){L.exports=N()})(gr,function(){return(function(A){var G={};function N(v){if(G[v])return G[v].exports;var h=G[v]={i:v,l:!1,exports:{}};return A[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=A,N.c=G,N.i=function(v){return v},N.d=function(v,h,i){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:i})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(A,G,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,A.exports=v}),(function(A,G,N){var v=N(2),h=N(8),i=N(9);function r(f,e,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var u=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(u.getOwner()==e)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},A.exports=r}),(function(A,G,N){function v(h){this.vGraphObject=h}A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(13),r=N(0),a=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var u in v)e[u]=v[u];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` .edge { stroke-width: ${L.archEdgeWidth}; stroke: ${L.archEdgeColor}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DHUznNgz.js b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CSXzh0NB.js similarity index 99% rename from apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DHUznNgz.js rename to apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CSXzh0NB.js index 88703a4666a..80c1835afd4 100644 --- a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DHUznNgz.js +++ b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CSXzh0NB.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-K_NNkrmw.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-CGrLstUA.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-5_2atmZK.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: +import{g as de}from"./chunk-5VM5RSS4-BV4ucc4y.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-XMN3hSDH.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-C-YOi8lT.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: `+O.showPosition()+` Expecting `+it.join(", ")+", got '"+(this.terminals_[P]||P)+"'":ft="Parse error on line "+(C+1)+": Unexpected "+(P==at?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[P]||P,line:O.yylineno,loc:dt,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+P);switch(H[0]){case 1:x.push(P),E.push(O.yytext),o.push(O.yylloc),x.push(H[1]),P=null,Z=O.yyleng,f=O.yytext,C=O.yylineno,dt=O.yylloc;break;case 2:if(G=this.productions_[H[1]][1],J.$=E[E.length-G],J._$={first_line:o[o.length-(G||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(G||1)].first_column,last_column:o[o.length-1].last_column},ge&&(J._$.range=[o[o.length-(G||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(J,[f,Z,C,j.yy,H[1],E,o].concat(gt)),typeof pt<"u")return pt;G&&(x=x.slice(0,-1*G*2),E=E.slice(0,-1*G),o=o.slice(0,-1*G)),x.push(this.productions_[H[1]][0]),E.push(J.$),o.push(J._$),It=F[x[x.length-2]][x[x.length-1]],x.push(It);break;case 3:return!0}}return!0},"parse")},N=(function(){var T={EOF:1,parseError:g(function(p,x){if(this.yy.parser)this.yy.parser.parseError(p,x);else throw new Error(p)},"parseError"),setInput:g(function(m,p){return this.yy=p||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var p=m.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:g(function(m){var p=m.length,x=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===L.length?this.yylloc.first_column:0)+L[L.length-x.length].length-x[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(m){this.unput(this.match.slice(m))},"less"),pastInput:g(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var m=this.pastInput(),p=new Array(m.length+1).join("-");return m+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BRKLxvwh.js b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DqXL2ZOL.js similarity index 99% rename from apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BRKLxvwh.js rename to apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DqXL2ZOL.js index db1d5769ab4..ef0d2526a31 100644 --- a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BRKLxvwh.js +++ b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DqXL2ZOL.js @@ -1,4 +1,4 @@ -import{g as Oe,d as Re}from"./chunk-32BRIVSS-0ImWpiFu.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-CGrLstUA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: +import{g as Oe,d as Re}from"./chunk-32BRIVSS-BXcVdJ-W.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-XMN3hSDH.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: `+D.showPosition()+` Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/channel-5_2atmZK.js b/apps/kimi-code/dist-web/assets/channel-5_2atmZK.js deleted file mode 100644 index 0d0fdbfbe4c..00000000000 --- a/apps/kimi-code/dist-web/assets/channel-5_2atmZK.js +++ /dev/null @@ -1 +0,0 @@ -import{U as a,O as n}from"./mermaid.core-CGrLstUA.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/channel-C-YOi8lT.js b/apps/kimi-code/dist-web/assets/channel-C-YOi8lT.js new file mode 100644 index 00000000000..1d0e8f8f3d5 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-C-YOi8lT.js @@ -0,0 +1 @@ +import{U as a,O as n}from"./mermaid.core-XMN3hSDH.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CldwFnN4.js b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DoBgLSx1.js similarity index 67% rename from apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CldwFnN4.js rename to apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DoBgLSx1.js index 23b8a59016e..698cda4ca4a 100644 --- a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CldwFnN4.js +++ b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DoBgLSx1.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-CGrLstUA.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; +import{_ as i}from"./mermaid.core-XMN3hSDH.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-0ImWpiFu.js b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BXcVdJ-W.js similarity index 96% rename from apps/kimi-code/dist-web/assets/chunk-32BRIVSS-0ImWpiFu.js rename to apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BXcVdJ-W.js index 87b50d0e3ab..e42076cb043 100644 --- a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-0ImWpiFu.js +++ b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BXcVdJ-W.js @@ -1 +1 @@ -import{_ as i,d as l,N as d,j as o}from"./mermaid.core-CGrLstUA.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; +import{_ as i,d as l,N as d,j as o}from"./mermaid.core-XMN3hSDH.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; diff --git a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-K_NNkrmw.js b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BV4ucc4y.js similarity index 83% rename from apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-K_NNkrmw.js rename to apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BV4ucc4y.js index 88a0ce744d1..fac41095430 100644 --- a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-K_NNkrmw.js +++ b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BV4ucc4y.js @@ -1,4 +1,4 @@ -import{_ as e}from"./mermaid.core-CGrLstUA.js";var l=e(()=>` +import{_ as e}from"./mermaid.core-XMN3hSDH.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Du5tJK2w.js b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DyuxL3R0.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Du5tJK2w.js rename to apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DyuxL3R0.js index 8f3a8377893..9ab37eed196 100644 --- a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Du5tJK2w.js +++ b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DyuxL3R0.js @@ -1,4 +1,4 @@ -import{g as te}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as ee}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-CGrLstUA.js";import{f as fe}from"./chunk-32BRIVSS-0ImWpiFu.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: +import{g as te}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as ee}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-XMN3hSDH.js";import{f as fe}from"./chunk-32BRIVSS-BXcVdJ-W.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: `+b.showPosition()+` Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(R[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,R[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[R[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(d,r){if(this.yy.parser)this.yy.parser.parseError(d,r);else throw new Error(d)},"parseError"),setInput:f(function(a,d){return this.yy=d||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var d=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CnsTQcA8.js b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C3Ln9Diz.js similarity index 71% rename from apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CnsTQcA8.js rename to apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C3Ln9Diz.js index 002892581eb..96837712c39 100644 --- a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CnsTQcA8.js +++ b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C3Ln9Diz.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-CGrLstUA.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; +import{_ as i}from"./mermaid.core-XMN3hSDH.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-BWiH3s-c.js b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DfjF6X7a.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-BWiH3s-c.js rename to apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DfjF6X7a.js index 29dd8606317..362375621c7 100644 --- a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-BWiH3s-c.js +++ b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DfjF6X7a.js @@ -1,4 +1,4 @@ -import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-CGrLstUA.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` +import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-XMN3hSDH.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` `),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` .railroad-diagram { font-family: ${i}; diff --git a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Bg4GHN0V.js b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-8FUQcOpv.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Bg4GHN0V.js rename to apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-8FUQcOpv.js index 06e693b4c39..9c64bbe6a82 100644 --- a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Bg4GHN0V.js +++ b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-8FUQcOpv.js @@ -1 +1 @@ -import{_ as u,l as i}from"./mermaid.core-CGrLstUA.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; +import{_ as u,l as i}from"./mermaid.core-XMN3hSDH.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; diff --git a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-5w7loxVR.js b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-DD40RxNF.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-5w7loxVR.js rename to apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-DD40RxNF.js index c07a52cacc7..767675c2091 100644 --- a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-5w7loxVR.js +++ b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-DD40RxNF.js @@ -1,4 +1,4 @@ -import{g as tt}from"./chunk-5VM5RSS4-K_NNkrmw.js";import{g as st}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as it}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-CGrLstUA.js";import{f as gt}from"./chunk-32BRIVSS-0ImWpiFu.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: +import{g as tt}from"./chunk-5VM5RSS4-BV4ucc4y.js";import{g as st}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as it}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-XMN3hSDH.js";import{f as gt}from"./chunk-32BRIVSS-BXcVdJ-W.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: `+D.showPosition()+` Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Cp8JVohH.js b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DXOr7Xkl.js similarity index 87% rename from apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Cp8JVohH.js rename to apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DXOr7Xkl.js index 8577ffba007..63ce20696b1 100644 --- a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Cp8JVohH.js +++ b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DXOr7Xkl.js @@ -1 +1 @@ -import{_ as a,e as w,l as x}from"./mermaid.core-CGrLstUA.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; +import{_ as a,e as w,l as x}from"./mermaid.core-XMN3hSDH.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BwEKpC0s.js b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BLb3KbCy.js similarity index 72% rename from apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BwEKpC0s.js rename to apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BLb3KbCy.js index 5112d162876..a5c0801e8c8 100644 --- a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BwEKpC0s.js +++ b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BLb3KbCy.js @@ -1 +1 @@ -import{_ as a,d as o}from"./mermaid.core-CGrLstUA.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{_ as a,d as o}from"./mermaid.core-XMN3hSDH.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-C0VBUqk7.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-C0VBUqk7.js new file mode 100644 index 00000000000..2afc4bc77ec --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-C0VBUqk7.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-DD40RxNF.js";import{_ as i}from"./mermaid.core-XMN3hSDH.js";import"./chunk-5VM5RSS4-BV4ucc4y.js";import"./chunk-XXDRQBXY-BLb3KbCy.js";import"./chunk-VR4S4FIN-DXOr7Xkl.js";import"./chunk-32BRIVSS-BXcVdJ-W.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-CNk36E8O.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-CNk36E8O.js deleted file mode 100644 index 9bbafb42417..00000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-CNk36E8O.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-5w7loxVR.js";import{_ as i}from"./mermaid.core-CGrLstUA.js";import"./chunk-5VM5RSS4-K_NNkrmw.js";import"./chunk-XXDRQBXY-BwEKpC0s.js";import"./chunk-VR4S4FIN-Cp8JVohH.js";import"./chunk-32BRIVSS-0ImWpiFu.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-C0VBUqk7.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-C0VBUqk7.js new file mode 100644 index 00000000000..2afc4bc77ec --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-C0VBUqk7.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-DD40RxNF.js";import{_ as i}from"./mermaid.core-XMN3hSDH.js";import"./chunk-5VM5RSS4-BV4ucc4y.js";import"./chunk-XXDRQBXY-BLb3KbCy.js";import"./chunk-VR4S4FIN-DXOr7Xkl.js";import"./chunk-32BRIVSS-BXcVdJ-W.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-CNk36E8O.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-CNk36E8O.js deleted file mode 100644 index 9bbafb42417..00000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-CNk36E8O.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-5w7loxVR.js";import{_ as i}from"./mermaid.core-CGrLstUA.js";import"./chunk-5VM5RSS4-K_NNkrmw.js";import"./chunk-XXDRQBXY-BwEKpC0s.js";import"./chunk-VR4S4FIN-Cp8JVohH.js";import"./chunk-32BRIVSS-0ImWpiFu.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-CyvFRDuS.js b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-bJETd0G9.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-CyvFRDuS.js rename to apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-bJETd0G9.js index 89672219db5..23a596cf63b 100644 --- a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-CyvFRDuS.js +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-bJETd0G9.js @@ -1 +1 @@ -import{_ as V,l as k,d as lt}from"./mermaid.core-CGrLstUA.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-CvgiEu-R.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; +import{_ as V,l as k,d as lt}from"./mermaid.core-XMN3hSDH.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-ChnXJINq.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; diff --git a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-Ct8il_Gb.js b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-CjWbot6H.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-Ct8il_Gb.js rename to apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-CjWbot6H.js index f7887cadd93..0e5ea3b36fe 100644 --- a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-Ct8il_Gb.js +++ b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-CjWbot6H.js @@ -1,4 +1,4 @@ -import{bR as et}from"./index-CvgiEu-R.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` +import{bR as et}from"./index-ChnXJINq.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` `,`\r `,"\r"],(function(e){function t(s,o,l,u){return new lh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` +import{p as xt}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,e as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaid.core-XMN3hSDH.js";import{p as Bt}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` .cynefinDomain { stroke: none; } diff --git a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BuaL-XNK.js b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BPvIVMQX.js similarity index 97% rename from apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BuaL-XNK.js rename to apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BPvIVMQX.js index 774d0e4b194..ecdf0e3c0bf 100644 --- a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BuaL-XNK.js +++ b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BPvIVMQX.js @@ -1,4 +1,4 @@ -import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-Bg4GHN0V.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-CGrLstUA.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX +import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-8FUQcOpv.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-XMN3hSDH.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX Node.id = `,d,` data=`,u.height,` Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,m,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,m);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),le=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),m=t.select("g");v(m,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),y=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},y.originalEdge=i,y.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,y.toCluster=r),y.id=r+"-cyclic-special-2",y.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,y,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(m,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,le as render}; diff --git a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BXKGXolr.js b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D74w020-.js similarity index 98% rename from apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BXKGXolr.js rename to apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D74w020-.js index 209d57bbb1e..b39dee786b4 100644 --- a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BXKGXolr.js +++ b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D74w020-.js @@ -1,3 +1,3 @@ -import{p as re}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-CGrLstUA.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +import{p as re}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-XMN3hSDH.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` `,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,Ue={parser:Ee,db:F,renderer:$e,styles:Ne};export{Ue as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DsoHq3g9.js b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-BNySynrU.js similarity index 97% rename from apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DsoHq3g9.js rename to apps/kimi-code/dist-web/assets/diagram-G47NLZAW-BNySynrU.js index 5359ecb28c6..bbb6618c507 100644 --- a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DsoHq3g9.js +++ b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-BNySynrU.js @@ -1,4 +1,4 @@ -import{p as me}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-CGrLstUA.js";import{s as Fe}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{p as Ne}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` +import{p as me}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-XMN3hSDH.js";import{s as Fe}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{p as Ne}from"./cynefin-VYW2F7L2-CjWbot6H.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-l2Pip_5t.js b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DSv1qX00.js similarity index 93% rename from apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-l2Pip_5t.js rename to apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DSv1qX00.js index b5ee9099596..93768380161 100644 --- a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-l2Pip_5t.js +++ b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DSv1qX00.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-CGrLstUA.js";import{p as _}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` +import{p as B}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-XMN3hSDH.js";import{p as _}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` .packetByte { font-size: ${e.byteFontSize}; } diff --git a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-DO8otT0J.js b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CBHxgtCp.js similarity index 96% rename from apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-DO8otT0J.js rename to apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CBHxgtCp.js index 47b5fa97417..ec6f797cd82 100644 --- a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-DO8otT0J.js +++ b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CBHxgtCp.js @@ -1,4 +1,4 @@ -import{I as X}from"./chunk-2Q5K7J3B-CldwFnN4.js";import{p as O}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-CGrLstUA.js";import{p as ne}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` +import{I as X}from"./chunk-2Q5K7J3B-DoBgLSx1.js";import{p as O}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-XMN3hSDH.js";import{p as ne}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` `),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:F,getDiagramTitle:j,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram `+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return` diff --git a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-tJhlXXXb.js b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-H-MqZGXv.js similarity index 95% rename from apps/kimi-code/dist-web/assets/diagram-WEI45ONY-tJhlXXXb.js rename to apps/kimi-code/dist-web/assets/diagram-WEI45ONY-H-MqZGXv.js index 55a84455361..56eace7864f 100644 --- a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-tJhlXXXb.js +++ b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-H-MqZGXv.js @@ -1,4 +1,4 @@ -import{p as k}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{s as R,g as E,o as I,n as _,a as D,b as F,_ as c,D as P,p as z,A as y,y as C,B as G,l as B,E as W,e as V}from"./mermaid.core-CGrLstUA.js";import{p as H}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;ry({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; +import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-DfjF6X7a.js";import{p}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as t,l as o}from"./mermaid.core-XMN3hSDH.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-q8LwmVdA.js b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-CythxxSO.js similarity index 99% rename from apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-q8LwmVdA.js rename to apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-CythxxSO.js index 575361c3fcd..ce96dd45753 100644 --- a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-q8LwmVdA.js +++ b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-CythxxSO.js @@ -1,4 +1,4 @@ -import{g as Mt}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as Bt}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-CGrLstUA.js";import{c as Jt}from"./channel-5_2atmZK.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: +import{g as Mt}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as Bt}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-XMN3hSDH.js";import{c as Jt}from"./channel-C-YOi8lT.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: `+_.showPosition()+` Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),Rt=Z[o[o.length-2]][o[o.length-1]],o.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=(function(){var I={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CSk8qFwd.js b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CAiKF6Zk.js similarity index 99% rename from apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CSk8qFwd.js rename to apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CAiKF6Zk.js index 498755f63f5..5157efafba7 100644 --- a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CSk8qFwd.js +++ b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CAiKF6Zk.js @@ -1,4 +1,4 @@ -import{g as He}from"./chunk-5VM5RSS4-K_NNkrmw.js";import{g as Xe}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as Qe}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-CGrLstUA.js";import{f as ft}from"./chunk-32BRIVSS-0ImWpiFu.js";import{c as gt}from"./channel-5_2atmZK.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` +import{g as He}from"./chunk-5VM5RSS4-BV4ucc4y.js";import{g as Xe}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as Qe}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-XMN3hSDH.js";import{f as ft}from"./chunk-32BRIVSS-BXcVdJ-W.js";import{c as gt}from"./channel-C-YOi8lT.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` `)?k=A+` `:k=`{ `+A+` diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BliHEJI2.js b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BZuybaxa.js similarity index 99% rename from apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BliHEJI2.js rename to apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BZuybaxa.js index 011ae5e7200..5f18e1ae0a9 100644 --- a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BliHEJI2.js +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BZuybaxa.js @@ -1,4 +1,4 @@ -import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-CGrLstUA.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-Cu3jckud.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-CvgiEu-R.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-XMN3hSDH.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-DZwFWlPa.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-ChnXJINq.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DbTFMBma.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js similarity index 99% rename from apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DbTFMBma.js rename to apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js index c569811fd2c..18192d625d1 100644 --- a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DbTFMBma.js +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js @@ -1,4 +1,4 @@ -import{I as le}from"./chunk-2Q5K7J3B-CldwFnN4.js";import{p as he}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-CGrLstUA.js";import{p as Ee}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` +import{I as le}from"./chunk-2Q5K7J3B-DoBgLSx1.js";import{p as he}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-XMN3hSDH.js";import{p as Ee}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` ${s-i/2-L/2},${x+R} ${s-i/2-L/2},${x-R} ${t.posWithOffset-i/2-L},${x-c-R} diff --git a/apps/kimi-code/dist-web/assets/index-BlRksujk.js b/apps/kimi-code/dist-web/assets/index-CLyK-bJw.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index-BlRksujk.js rename to apps/kimi-code/dist-web/assets/index-CLyK-bJw.js index 3a50a605553..d591edcd2e0 100644 --- a/apps/kimi-code/dist-web/assets/index-BlRksujk.js +++ b/apps/kimi-code/dist-web/assets/index-CLyK-bJw.js @@ -1,4 +1,4 @@ -import{t as pe,b as Ln,n as Or,c as Nr,a as Fr,d as zr,s as Ur,g as Vr,e as Br}from"./index-DuIqvsra.js";import{f as Ld}from"./index-DuIqvsra.js";import{bR as k}from"./index-CvgiEu-R.js";const Ei="diffs-container",$r=(()=>{try{return!1}catch{return!1}})(),Wr=/(?=^From [a-f0-9]+ .+$)/m,Ti=/(?=^diff --git)/gm,Ul=/(?=^---\s+\S)/gm,Vl=/(?=^@@ )/gm,Gr=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,jr=/(?<=\n)/,qr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yr=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Bl=/^<{7,}(?:\s.*)?$/,$l=/^\|{7,}(?:\s.*)?$/,Wl=/^={7,}$/,Gl=/^>{7,}(?:\s.*)?$/,on="header-prefix",sn="header-metadata",an="header-custom",_={dark:"pierre-dark",light:"pierre-light"},Ii="data-theme-css",Ri="data-unsafe-css",Qr="data-core-css",Jr="data-diffs-scrollbar-measure",Ai="--diffs-scrollbar-gutter-measured",jl=1,Zr=1e5,ln={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},_e={...ln,hunkLineCount:1},eo={paddingTop:8,paddingBottom:8,gap:8},to={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},no=Object.freeze({fromStart:0,fromEnd:0}),Ae={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Hi={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ie=new Set;let Re=null;function Y(e){Ie.add(e),Re??=requestAnimationFrame(Mi)}function io(e){Ie.delete(e),Ie.size===0&&Re!=null&&(cancelAnimationFrame(Re),Re=null)}function Mi(e){const t=new Set(Ie);Ie.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ie.size>0?Re=requestAnimationFrame(Mi):Re=null}function He(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function dn(e,t){const n=e?.theme??_,i=t?.theme??_,r=kn(e),o=kn(t);return De(n,i)&&He(e,t,["theme","parseDiffOptions"])&&He(r,o)}function kn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Wt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Gt({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const h=Math.max(e-r,0),c=Math.min(e+l,t);return{top:h,bottom:Math.max(c,h)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function ro(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function W(e){return{type:"text",value:e}}function A({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function pt({name:e,width:t=16,height:n=16,properties:i}){return A({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[A({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function oo(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ee(e){return A({tagName:"div",properties:{"data-gutter":""},children:e})}function Di(e,t,n,i={}){return A({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[A({tagName:"span",properties:{"data-line-number-content":""},children:[W(`${t}`)]})]:void 0})}function j(e,t,n){return A({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function so(){return A({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[pt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function ao(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Pi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||Wt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&et(e.composedPath())||(he(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(he(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(he(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){he(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();he(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);he(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Tt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Tt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(co(r)&&f!=null){f(r);break}if(ho(r)&&u!=null){u(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Tt(r))break;ut(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,b=g!=null,y=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||h!=null||c!=null||u||f||b;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,he(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const C=[];return(t==="both"||t==="click")&&(i!=null&&C.push("onLineClick"),r!=null&&C.push("onLineNumberClick"),h!=null&&C.push("expandable hunk separators"),c!=null&&C.push("merge conflict actions")),C})()),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const m=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&m||!b&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();et(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(ao(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=pe(so());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ve(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(Ze(r));if(Ve(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ve(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ve(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&et(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Ze(e);if(t&&et(n))return;const i=fo(e);return i!=null?Ze(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=go(po(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Ze(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=En(t)?t:En(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Wt(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,h=d.children.length;if(h!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let c=0;cs)break;if(g==null||gNumber.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Ke({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p},C,v,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:lo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:C,onMergeConflictActionClick:x,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:v}}function lo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ve(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function Tt(e){return Ve(e)||ut(e)}function ho(e){return"type"in e&&e.type==="line-info"}function co(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function wn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ze(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function po(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function go(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function En(e){return e!=null&&typeof e.elementFromPoint=="function"}function Tn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function In(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function et(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function he(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var _i=class ue{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ue.resizeObserver??new ResizeObserver(ue.handleSharedResizeEntries);return ue.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=ue.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let h=l.get(d);h==null&&(h=[],l.set(d,h)),h.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[h,c]=d,u=h.firstElementChild,f=c.firstElementChild;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(u);if(g!=null){this.observedNodes.set(u,g),this.observedNodes.set(f,g),o.delete(u),o.delete(f);continue}const b=u.getBoundingClientRect().height,y=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:h,child:u,childHeight:b},column2:{container:c,child:f,childHeight:y},currentHeight:"auto"},i.add({child1:u,child2:f,item:g,newHeight:Math.max(b,y)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?bo(l):Co(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=ue,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),ue.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=ue,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),ue.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},h=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=h:o===a.numberElement&&(d.numberInlineSize=h),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?vo(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function vo(e){return Math.max(Math.ceil(e),0)}function bo(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Co(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Se=new Map,It=new Map,jt=new Map,gt=new Set;function mt(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gt.has(t))return!1;return!0}function Rn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gt.has(n.name))continue;let i=Se.get(n.name);i==null&&(i=n,Se.set(n.name,i)),gt.add(i.name),t.loadLanguageSync(i.data)}}function So(){Se.clear(),gt.clear()}function Oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function Ni(e){if(Oi())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=It.get(e);if(t!=null)return t;try{let n=jt.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Ln,e)&&(n=Ln[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Se.has(e)||Se.set(e,o),o});return It.set(e,i),await i}finally{It.delete(e)}}function Fi(e){return Se.get(e)??Ni(e)}const vt=new Set;function Ye(e){const t=[],n=new Set;for(const c of yo(e.themes)){const u=zi(c)?c.getThemes():[c];for(const f of u){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function h(c){if(c==null)return i;const{colorScheme:u,collection:f}=c;return f==null?u==="light"?r:u==="dark"?o:i:i.filter(g=>g.collection!==f?!1:u==null||g.colorScheme===u)}return{getTheme(c){return s.get(c)},getThemes(c){return h(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:h(c).map(u=>u.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ye({themes:i.map((u,f)=>({descriptor:u,index:f})).sort((u,f)=>{const g=c(u.descriptor,f.descriptor);return g!==0?g:u.index-f.index}).map(u=>u.descriptor)})},pick(c){const u=[],f=new Set;for(const g of c){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const b=s.get(g);if(b==null)throw new Error(`Theme collection does not contain theme "${g}"`);u.push(b)}return Ye({themes:u})},registerInto(c){for(const u of i)c.registerThemeIfAbsent(u.name,u.load)}}}function yo(e){return xo(e)?[e]:e}function xo(e){return zi(e)||Lo(e)}function Lo(e){return typeof e.name=="string"&&typeof e.load=="function"}function zi(e){return typeof e.getThemes=="function"}function Ui(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Vi=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},ko=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(){const e=new Map,t=new Map,n=new Map;let i=0;function r(m,p){if(e.has(m))throw new Vi(m);e.set(m,p)}function o(m,p){return e.has(m)?!1:(e.set(m,p),!0)}function s(m){return e.has(m)}function l(m){const p=t.get(m);if(p!==void 0)return Promise.resolve(p);const C=n.get(m);if(C!==void 0)return C;const v=e.get(m);if(v===void 0)return Promise.reject(new ko(m));const x=i,S=v().then(L=>{const E=Ui(L);return x===i&&t.set(m,E),n.get(m)===S&&n.delete(m),E}).catch(L=>{throw n.get(m)===S&&n.delete(m),L});return n.set(m,S),S}function a(m){return Promise.all(m.map(p=>l(p)))}function d(m,p){t.set(m,p)}function h(m){for(const[p,C]of m)d(p,C)}function c(m){return t.get(m)}function u(m){const p=[];for(const C of m){const v=t.get(C);if(v===void 0)throw new wo(C);p.push(v)}return p}function f(m){return t.has(m)}function g(m){for(const p of m)if(!t.has(p))return!1;return!0}function b(m){const p=t.get(m);return p!==void 0?p:l(m)}function y(){i++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:b,getResolvedTheme:c,getResolvedThemes:u,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:h}}const X=Eo();function An(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=X.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,X.getResolvedTheme(n)==null&&X.seedResolvedTheme(n,i);vt.has(n)||(vt.add(n),t.loadThemeSync(i))}}function To(){X.clearResolvedThemes(),vt.clear()}function hn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Io(t)}}function Io(e){return async()=>Or(Ui(await e()))}const Ro="pierre",Ao=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Bi=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Ho=[...Bi,...Ao],Mo=new Set(Bi);function Do(e){return Mo.has(e)?"light":"dark"}const Po={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},_o={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function Oo(e){return hn({name:e,collection:Ro,colorScheme:Do(e),displayName:Po[e],load:_o[e]})}const $i=Ye({themes:Ho.map(e=>Oo(e))}),No="shiki",Wi=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Fo=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],zo=new Set(Wi);function Uo(e){return zo.has(e)?"light":"dark"}const Vo={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function Hn(e){return hn({name:e,collection:No,colorScheme:Uo(e),load:Vo[e]})}const Gi=Ye({themes:Object.freeze([...Wi.map(e=>Hn(e)),...Fo.map(e=>Hn(e))])});Ye({themes:[$i,Gi]});function ji(e){if(Oi())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(X.hasRegisteredTheme(e))return;const t=Gi.getTheme(e);if(t!=null){X.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Bo(e){ji(e);const t=await X.resolveTheme(e);return qi(e,t),t}function $o(e){return X.getResolvedTheme(e)??Bo(e)}let $;async function xt({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){$??=Nr({themes:[],langs:["text"],engine:n==="shiki-wasm"?Fr(k(()=>import("./wasm-CG6Dc4jp.js"),[])):zr()});const i=Wo($)?await $:$;$=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Fi(s);"then"in l?r.push(l):Rn(l,i)}const o=[];for(const s of e){const l=$o(s);"then"in l?o.push(l):An(l,$)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Rn(s,i)}),Promise.all(o).then(s=>{An(s,i)})]),i}function ql(e=$){return e!=null&&!("then"in e)}function Ki(){if($!=null&&!("then"in $))return $}function Wo(e=$){return e!=null&&"then"in e}function Kl(e=$){return e==null}async function Yl(e){await xt(e)}async function Xl(){$!=null&&((await $).dispose(),So(),To(),$=void 0)}for(const e of $i.getThemes())X.registerThemeIfAbsent(e.name,e.load);function cn(e=_){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Ge(e){for(const t of cn(e))if(!vt.has(t))return!1;return!0}function Go(e){return X.hasResolvedThemes(e)}function Oe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ae(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Lt(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function qt(e){return A({tagName:"div",children:[A({tagName:"div",children:e.annotations?.map(t=>A({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function jo(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Yi({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return A({tagName:"div",children:[t==="custom"?A({tagName:"slot",properties:{name:an}}):qo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ko(i)]],properties:r})}function qo({name:e,prevName:t,iconType:n}){const i=[A({tagName:"slot",properties:{name:on}}),pt({name:jo(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(t)]})],properties:{"data-prev-name":""}})),i.push(pt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(e)]})],properties:{"data-title":""}})),A({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ko(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(A({tagName:"span",children:[W(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(A({tagName:"span",children:[W(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(A({tagName:"slot",properties:{name:sn}})),A({tagName:"div",children:t,properties:{"data-metadata":""}})}function Xi(e){return A({tagName:"pre",properties:Yo(e)})}function Yo({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Z=new Map;let bt=0;const Ne={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Q(e){if(Z.has(e))return Z.get(e)??"text";if(Ne[e]!=null)return Ne[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Z.has(t[1]))return Z.get(t[1])??"text";if(Ne[t[1]]!=null)return Ne[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Z.has(n)?Z.get(n)??"text":Ne[n]??"text"}function Ql(e,t){if(e<=bt)return!1;Z.clear();for(const n in t){const i=t[n];i!=null&&Z.set(n,i)}return bt=e,!0}function Jl(){return bt}function Xo(e,t){const n=Z.get(e);return n===t?!1:(n!=null&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${n}" to "${t}"`),Z.set(e,t),bt++,!0)}function Zl(){return Object.fromEntries(Z)}function un(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:cn(t),preferredHighlighter:n}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function xe(e){return e.replace(/\n$|\r\n$/,"")}function Qo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(W(` +import{t as pe,b as Ln,n as Or,c as Nr,a as Fr,d as zr,s as Ur,g as Vr,e as Br}from"./index-DzigsE_1.js";import{f as Ld}from"./index-DzigsE_1.js";import{bR as k}from"./index-ChnXJINq.js";const Ei="diffs-container",$r=(()=>{try{return!1}catch{return!1}})(),Wr=/(?=^From [a-f0-9]+ .+$)/m,Ti=/(?=^diff --git)/gm,Ul=/(?=^---\s+\S)/gm,Vl=/(?=^@@ )/gm,Gr=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,jr=/(?<=\n)/,qr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yr=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Bl=/^<{7,}(?:\s.*)?$/,$l=/^\|{7,}(?:\s.*)?$/,Wl=/^={7,}$/,Gl=/^>{7,}(?:\s.*)?$/,on="header-prefix",sn="header-metadata",an="header-custom",_={dark:"pierre-dark",light:"pierre-light"},Ii="data-theme-css",Ri="data-unsafe-css",Qr="data-core-css",Jr="data-diffs-scrollbar-measure",Ai="--diffs-scrollbar-gutter-measured",jl=1,Zr=1e5,ln={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},_e={...ln,hunkLineCount:1},eo={paddingTop:8,paddingBottom:8,gap:8},to={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},no=Object.freeze({fromStart:0,fromEnd:0}),Ae={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Hi={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ie=new Set;let Re=null;function Y(e){Ie.add(e),Re??=requestAnimationFrame(Mi)}function io(e){Ie.delete(e),Ie.size===0&&Re!=null&&(cancelAnimationFrame(Re),Re=null)}function Mi(e){const t=new Set(Ie);Ie.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ie.size>0?Re=requestAnimationFrame(Mi):Re=null}function He(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function dn(e,t){const n=e?.theme??_,i=t?.theme??_,r=kn(e),o=kn(t);return De(n,i)&&He(e,t,["theme","parseDiffOptions"])&&He(r,o)}function kn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Wt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Gt({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const h=Math.max(e-r,0),c=Math.min(e+l,t);return{top:h,bottom:Math.max(c,h)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function ro(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function W(e){return{type:"text",value:e}}function A({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function pt({name:e,width:t=16,height:n=16,properties:i}){return A({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[A({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function oo(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ee(e){return A({tagName:"div",properties:{"data-gutter":""},children:e})}function Di(e,t,n,i={}){return A({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[A({tagName:"span",properties:{"data-line-number-content":""},children:[W(`${t}`)]})]:void 0})}function j(e,t,n){return A({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function so(){return A({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[pt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function ao(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Pi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||Wt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&et(e.composedPath())||(he(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(he(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(he(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){he(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();he(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);he(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Tt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Tt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(co(r)&&f!=null){f(r);break}if(ho(r)&&u!=null){u(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Tt(r))break;ut(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,b=g!=null,y=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||h!=null||c!=null||u||f||b;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,he(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const C=[];return(t==="both"||t==="click")&&(i!=null&&C.push("onLineClick"),r!=null&&C.push("onLineNumberClick"),h!=null&&C.push("expandable hunk separators"),c!=null&&C.push("merge conflict actions")),C})()),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const m=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&m||!b&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();et(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(ao(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=pe(so());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ve(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(Ze(r));if(Ve(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ve(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ve(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&et(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Ze(e);if(t&&et(n))return;const i=fo(e);return i!=null?Ze(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=go(po(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Ze(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=En(t)?t:En(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Wt(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,h=d.children.length;if(h!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let c=0;cs)break;if(g==null||gNumber.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Ke({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p},C,v,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:lo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:C,onMergeConflictActionClick:x,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:v}}function lo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ve(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function Tt(e){return Ve(e)||ut(e)}function ho(e){return"type"in e&&e.type==="line-info"}function co(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function wn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ze(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function po(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function go(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function En(e){return e!=null&&typeof e.elementFromPoint=="function"}function Tn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function In(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function et(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function he(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var _i=class ue{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ue.resizeObserver??new ResizeObserver(ue.handleSharedResizeEntries);return ue.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=ue.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let h=l.get(d);h==null&&(h=[],l.set(d,h)),h.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[h,c]=d,u=h.firstElementChild,f=c.firstElementChild;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(u);if(g!=null){this.observedNodes.set(u,g),this.observedNodes.set(f,g),o.delete(u),o.delete(f);continue}const b=u.getBoundingClientRect().height,y=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:h,child:u,childHeight:b},column2:{container:c,child:f,childHeight:y},currentHeight:"auto"},i.add({child1:u,child2:f,item:g,newHeight:Math.max(b,y)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?bo(l):Co(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=ue,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),ue.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=ue,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),ue.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},h=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=h:o===a.numberElement&&(d.numberInlineSize=h),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?vo(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function vo(e){return Math.max(Math.ceil(e),0)}function bo(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Co(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Se=new Map,It=new Map,jt=new Map,gt=new Set;function mt(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gt.has(t))return!1;return!0}function Rn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gt.has(n.name))continue;let i=Se.get(n.name);i==null&&(i=n,Se.set(n.name,i)),gt.add(i.name),t.loadLanguageSync(i.data)}}function So(){Se.clear(),gt.clear()}function Oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function Ni(e){if(Oi())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=It.get(e);if(t!=null)return t;try{let n=jt.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Ln,e)&&(n=Ln[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Se.has(e)||Se.set(e,o),o});return It.set(e,i),await i}finally{It.delete(e)}}function Fi(e){return Se.get(e)??Ni(e)}const vt=new Set;function Ye(e){const t=[],n=new Set;for(const c of yo(e.themes)){const u=zi(c)?c.getThemes():[c];for(const f of u){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function h(c){if(c==null)return i;const{colorScheme:u,collection:f}=c;return f==null?u==="light"?r:u==="dark"?o:i:i.filter(g=>g.collection!==f?!1:u==null||g.colorScheme===u)}return{getTheme(c){return s.get(c)},getThemes(c){return h(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:h(c).map(u=>u.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ye({themes:i.map((u,f)=>({descriptor:u,index:f})).sort((u,f)=>{const g=c(u.descriptor,f.descriptor);return g!==0?g:u.index-f.index}).map(u=>u.descriptor)})},pick(c){const u=[],f=new Set;for(const g of c){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const b=s.get(g);if(b==null)throw new Error(`Theme collection does not contain theme "${g}"`);u.push(b)}return Ye({themes:u})},registerInto(c){for(const u of i)c.registerThemeIfAbsent(u.name,u.load)}}}function yo(e){return xo(e)?[e]:e}function xo(e){return zi(e)||Lo(e)}function Lo(e){return typeof e.name=="string"&&typeof e.load=="function"}function zi(e){return typeof e.getThemes=="function"}function Ui(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Vi=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},ko=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(){const e=new Map,t=new Map,n=new Map;let i=0;function r(m,p){if(e.has(m))throw new Vi(m);e.set(m,p)}function o(m,p){return e.has(m)?!1:(e.set(m,p),!0)}function s(m){return e.has(m)}function l(m){const p=t.get(m);if(p!==void 0)return Promise.resolve(p);const C=n.get(m);if(C!==void 0)return C;const v=e.get(m);if(v===void 0)return Promise.reject(new ko(m));const x=i,S=v().then(L=>{const E=Ui(L);return x===i&&t.set(m,E),n.get(m)===S&&n.delete(m),E}).catch(L=>{throw n.get(m)===S&&n.delete(m),L});return n.set(m,S),S}function a(m){return Promise.all(m.map(p=>l(p)))}function d(m,p){t.set(m,p)}function h(m){for(const[p,C]of m)d(p,C)}function c(m){return t.get(m)}function u(m){const p=[];for(const C of m){const v=t.get(C);if(v===void 0)throw new wo(C);p.push(v)}return p}function f(m){return t.has(m)}function g(m){for(const p of m)if(!t.has(p))return!1;return!0}function b(m){const p=t.get(m);return p!==void 0?p:l(m)}function y(){i++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:b,getResolvedTheme:c,getResolvedThemes:u,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:h}}const X=Eo();function An(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=X.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,X.getResolvedTheme(n)==null&&X.seedResolvedTheme(n,i);vt.has(n)||(vt.add(n),t.loadThemeSync(i))}}function To(){X.clearResolvedThemes(),vt.clear()}function hn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Io(t)}}function Io(e){return async()=>Or(Ui(await e()))}const Ro="pierre",Ao=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Bi=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Ho=[...Bi,...Ao],Mo=new Set(Bi);function Do(e){return Mo.has(e)?"light":"dark"}const Po={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},_o={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function Oo(e){return hn({name:e,collection:Ro,colorScheme:Do(e),displayName:Po[e],load:_o[e]})}const $i=Ye({themes:Ho.map(e=>Oo(e))}),No="shiki",Wi=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Fo=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],zo=new Set(Wi);function Uo(e){return zo.has(e)?"light":"dark"}const Vo={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function Hn(e){return hn({name:e,collection:No,colorScheme:Uo(e),load:Vo[e]})}const Gi=Ye({themes:Object.freeze([...Wi.map(e=>Hn(e)),...Fo.map(e=>Hn(e))])});Ye({themes:[$i,Gi]});function ji(e){if(Oi())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(X.hasRegisteredTheme(e))return;const t=Gi.getTheme(e);if(t!=null){X.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Bo(e){ji(e);const t=await X.resolveTheme(e);return qi(e,t),t}function $o(e){return X.getResolvedTheme(e)??Bo(e)}let $;async function xt({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){$??=Nr({themes:[],langs:["text"],engine:n==="shiki-wasm"?Fr(k(()=>import("./wasm-CG6Dc4jp.js"),[])):zr()});const i=Wo($)?await $:$;$=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Fi(s);"then"in l?r.push(l):Rn(l,i)}const o=[];for(const s of e){const l=$o(s);"then"in l?o.push(l):An(l,$)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Rn(s,i)}),Promise.all(o).then(s=>{An(s,i)})]),i}function ql(e=$){return e!=null&&!("then"in e)}function Ki(){if($!=null&&!("then"in $))return $}function Wo(e=$){return e!=null&&"then"in e}function Kl(e=$){return e==null}async function Yl(e){await xt(e)}async function Xl(){$!=null&&((await $).dispose(),So(),To(),$=void 0)}for(const e of $i.getThemes())X.registerThemeIfAbsent(e.name,e.load);function cn(e=_){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Ge(e){for(const t of cn(e))if(!vt.has(t))return!1;return!0}function Go(e){return X.hasResolvedThemes(e)}function Oe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ae(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Lt(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function qt(e){return A({tagName:"div",children:[A({tagName:"div",children:e.annotations?.map(t=>A({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function jo(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Yi({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return A({tagName:"div",children:[t==="custom"?A({tagName:"slot",properties:{name:an}}):qo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ko(i)]],properties:r})}function qo({name:e,prevName:t,iconType:n}){const i=[A({tagName:"slot",properties:{name:on}}),pt({name:jo(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(t)]})],properties:{"data-prev-name":""}})),i.push(pt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(e)]})],properties:{"data-title":""}})),A({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ko(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(A({tagName:"span",children:[W(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(A({tagName:"span",children:[W(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(A({tagName:"slot",properties:{name:sn}})),A({tagName:"div",children:t,properties:{"data-metadata":""}})}function Xi(e){return A({tagName:"pre",properties:Yo(e)})}function Yo({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Z=new Map;let bt=0;const Ne={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Q(e){if(Z.has(e))return Z.get(e)??"text";if(Ne[e]!=null)return Ne[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Z.has(t[1]))return Z.get(t[1])??"text";if(Ne[t[1]]!=null)return Ne[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Z.has(n)?Z.get(n)??"text":Ne[n]??"text"}function Ql(e,t){if(e<=bt)return!1;Z.clear();for(const n in t){const i=t[n];i!=null&&Z.set(n,i)}return bt=e,!0}function Jl(){return bt}function Xo(e,t){const n=Z.get(e);return n===t?!1:(n!=null&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${n}" to "${t}"`),Z.set(e,t),bt++,!0)}function Zl(){return Object.fromEntries(Z)}function un(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:cn(t),preferredHighlighter:n}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function xe(e){return e.replace(/\n$|\r\n$/,"")}function Qo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(W(` `)),e}const tt=Symbol("no-token"),Rt=Symbol("multiple-tokens");function Qi(e){const t=Jo(e);if(t!=null)return t;let n=tt;const i=[];let r=[],o;const s=()=>{if(r.length===0||o==null){r=[],o=void 0;return}if(r.length===1){const a=r[0];if(a?.type==="element"){Zo(a,o);for(const d of a.children)ft(d)}else ft(a);i.push(a),r=[],o=void 0;return}for(const a of r)ft(a);i.push(A({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},l=a=>{if(a!==tt){if(a===Rt){n=Rt;return}if(n===tt){n=a;return}n!==a&&(n=Rt)}};for(const a of e.children){const d=a.type==="element"?Qi(a):tt;if(l(d),typeof d!="number"){s(),i.push(a);continue}o!=null&&o!==d&&s(),o??=d,r.push(a)}return s(),e.children=i,n}function Jo(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function ft(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)ft(t)}}function Zo(e,t){e.properties["data-char"]=t}function es(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=l=>l}=e,r=new Map;function o(l){return Object.entries(l).map(([a,d])=>`${a}:${d}`).join(";")}function s(l){let a=t+ts(typeof l=="string"?l:o(l))+n;return a=i(a),r.has(a)||r.set(a,typeof l=="string"?l:{...l}),a}return{name:"@shikijs/transformers:style-to-class",pre(l){if(!l.properties.style)return;const a=s(l.properties.style);delete l.properties.style,this.addClassToHast(l,a)},tokens(l){for(const a of l)for(const d of a){if(!d.htmlStyle)continue;const h=s(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${h}`:d.htmlAttrs.class=h}},getClassRegistry(){return r},getCSS(){let l="";for(const[a,d]of r.entries())l+=`.${a}{${typeof d=="string"?d:o(d)}}`;return l},clearRegistry(){r.clear()}}}function ts(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function Ji(e=!1,t=!1){const n={lineInfo:[]},i=[{line(r){return delete r.properties.class,r},pre(r){const o=oo(r),s=[];if(o!=null){let l=1;for(const a of o.children)a.type==="element"&&(e&&Qi(a),s.push(Qo(a,l,n)),l++);o.children=s}return r},...e?{tokens(r){for(const o of r){let s=0;for(const l of o){const a=l;a.__lineChar??=s,s+=l.content.length}}},preprocess(r,o){o.mergeWhitespaces="never"},span(r,o,s,l,a){if(a?.offset!=null&&a.content!=null){const d=a.__lineChar;return d!=null&&(r.properties["data-char"]=d),r}return r}}:null}];return t&&i.push(ns,Mn),{state:n,transformers:i,toClass:Mn}}const Mn=es({classPrefix:"hl-"}),ns={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function B(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const is=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,rs=/^0(?:\.0+)?%?$/;function os(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const r=i.lastIndexOf("/");if(r!==-1)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const o=i.split(",");if(o.length===4)return o[3]?.trim()}}function ss(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,r=1;return n.length===3?i=n.split("").map(o=>o+o).join(""):n.length===6?i=n:(i=n.slice(0,6),r=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),r]}function At(e){if(e==null)return null;const t=ss(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,r=t[2]/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function Dn(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||is.test(t))return!0;const n=os(t);return n!=null&&rs.test(n)}function as(e,t,n){if(t==null||n==null)return!1;const i=At(e),r=At(t),o=At(n);return i==null||r==null||o==null?!1:Math.abs(i-o){const s=e.at(-1);return s===""||s===` `||s===`\r `||s==="\r"?Math.max(0,e.length-2):e.length-1})();for(let s=t;s0||l<1/0,{state:h,transformers:c}=Ji(r),u=o?"text":e.lang??Q(e.name),f=typeof n=="string"?t.getTheme(n).type:void 0,g=fn({theme:n,highlighter:t});h.lineInfo=p=>({type:"context",lineIndex:p-1+s,lineNumber:p+s});const b=typeof n=="string"?{lang:u,theme:n,transformers:c,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}:{lang:u,themes:n,transformers:c,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0},y=Kt(t.codeToHast(d?cs(a??St(e.contents),s,l):xe(e.contents),b)),m=d?new Array(s):y;return d&&m.push(...y),{code:m,themeStyles:g,baseThemeType:f}}function cs(e,t,n){let i="";return Ct({lines:e,startingLine:t,totalLines:n,callback({content:r}){i+=r}}),i}const Zi="-1,-1";function Yt(e){return e?.some(t=>t.lineNumber===0)??!1}function Xt(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function kt(e){return e.startingLine===0&&e.totalLines>0}function er(e,t){return A({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Qt(e){return(e.lang??Q(e.name))==="text"}function tr(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}let us=-1;var fs=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++us}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:_},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Ge(e.theme??_)?Ki():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e),n=Pt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let i=this.workerManager?.getFileResultCache(e);i!=null&&!Oe(t,i.options)&&(i=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Qt(e),result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??Q(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:i=_,tokenizeMaxLineLength:r=1e3}=this.options;return{theme:i,useTokenTransformer:tr(this.options),tokenizeMaxLineLength:r}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!ae(e,n.file)||!Oe(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,St(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:St(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=Ae){if(e==null)return;let{options:n,forceHighlight:i}=this.getRenderOptions(e);const r=this.getMatchingWorkerResultCache(e,n);r!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...r},i=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const o=this.getOrCreateLineCache(e),s=e.contents.length>0,l=!s||Qt(e)||Pt(o.length,this.getTokenizeMaxLength()),a=!ae(e,this.renderCache.file),d=!Lt(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(l||this.renderCache.result==null||!this.renderCache.highlighted&&(a||d))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||a||d||i)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,o)),this.renderCache.renderRange=t),!l&&s&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Q(e.name);const h=this.highlighter!=null&&Ge(n.theme),c=this.highlighter!=null&&mt(this.computedLang),u=!l&&c;if(this.highlighter!=null&&h&&(i||l||!this.renderCache.highlighted&&u||this.renderCache.result==null)){const{result:f,options:g}=this.renderFileWithHighlighter(e,this.highlighter,l||!c);this.renderCache={file:e,options:g,highlighted:u,result:f,renderRange:void 0}}(!h||!l&&!c)&&this.asyncHighlight(e).then(({result:f,options:g})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,f,g,!l)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=Ae){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=Pt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Q(e.name);const n=this.highlighter!=null&&Go(cn(this.options.theme)),i=t||this.highlighter!=null&&mt(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e);return{result:hs(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){const{disableFileHeader:o=!1}=this.options,s=[],l=Ee(),a=this.getOrCreateLineCache(e);let d=0;const h=kt(t)?Xt(this.lineAnnotations):void 0;return h!=null&&(l.children.push(j("context","annotation",1)),s.push(qt({hunkIndex:-1,lineIndex:-1,annotations:h.map(c=>ge(c))})),d++),Ct({lines:a,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:c,lineNumber:u})=>{const f=n[c];if(f==null){const g="FileRenderer.processFileResult: Line doesnt exist";throw console.error(g,{name:e.name,lineIndex:c,lineNumber:u,lines:a}),new Error(g)}if(f!=null){l.children.push(Di("context",u,`${c}`)),s.push(f),d++;const g=this.lineAnnotations[u];g!=null&&(l.children.push(j("context","annotation",1)),s.push(qt({hunkIndex:0,lineIndex:u,annotations:g.map(b=>ge(b))})),d++)}}}),l.properties.style=`grid-row: span ${d}`,{gutterAST:l.children??[],contentAST:s,preAST:this.createPreElement(a.length),headerAST:o?void 0:this.renderHeader(e),totalLines:a.length,rowCount:d,themeStyles:i,baseThemeType:r,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return Yi({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return pe(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(A({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=Ee();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,er(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return t?pe(A({tagName:"code",children:e,properties:{"data-code":""}})):pe(e)}async initializeHighlighter(){return this.highlighter=await xt(un(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const r=!ae(e,this.renderCache.file)||!this.renderCache.highlighted||!Oe(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Oe(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&ae(e,n.file)&&Oe(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return Xi({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function Pt(e,t){return e>t}const nr=`
+`}function lI(e,t,n){const i=e.slice(t+n.length+2),o=/^\[/m.exec(i);return(o===null?i:i.slice(0,o.index)).trim()}function Voe(e){return e.endsWith(qoe)}function Koe(e){const t=Vf(e,"active_background_tasks");if(t===void 0)return!1;const n=Number(t);return Number.isFinite(n)?Q$(e,/^task_id: /gm)===n:!1}function Zoe(e,t){return[...e.matchAll(/^description: (.+)$/gm)].map(i=>i[1]??"").slice(0,Math.min(Woe,t))}function Goe(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` +`):e,n=/^\[/m.exec(t),i=n===null?t:t.slice(0,n.index),o=Vf(i,"wait_status");if(o!=="completed"&&o!=="timed_out"&&o!=="no_tasks")return null;const s=Number(Vf(i,"waited_ms")??0);let r,l=n?.index??t.length;o==="completed"&&n!==null&&t.slice(n.index).startsWith("[finished]")&&(r=lI(t,n.index,"finished"),l=n.index+10);let a=0,u=-1;for(const f of sI(t,"completed_during_wait",l)){if(!rI(t,f))continue;const h=lI(t,f,"completed_during_wait");Voe(h)&&(a=Q$(h,/^task_id: /gm),u=f)}let c=0,d=[];for(const f of sI(t,"still_running",l)){if(u>=0&&fc.replace(/\\/g,"/"),i=n(e);let o=n(t);o.length>1&&(o=o.replace(/\/+$/,""));const s=aI(o)||aI(i),r=s?o.toLowerCase():o,l=s?i.toLowerCase():i,a=r.endsWith("/")?r:`${r}/`;if(l!==r&&!l.startsWith(a))return null;const u=l===r?"":i.slice(a.length);return u.split("/").includes("..")?null:u||null}const Joe=50,Xoe=3,Y$=Joe*2;function ese(e){const t=(e??[]).filter(n=>typeof n=="number"&&Number.isFinite(n)&&n>0).slice(0,2);return t.length===0?Y$:Math.round(t.reduce((n,i)=>n+i,0))}function J$(e){return e==null||!Number.isFinite(e)||e<=0?Y$:Math.round(e)}const Sw=96;function tse(e,t,n){const i=e.filter(r=>r.visible),o=i[0],s=i[2];return{firstRowHeight:o?o.height:null,spanToThirdRow:s?s.viewportBottom-t+n:null}}function nse(e,t,n){const i=s=>s!=null&&Number.isFinite(s)&&s>0;return(s=>s!=null&&Number.isFinite(s)&&s>=0)(t)?i(e)?Math.round(e)+Math.round(t):i(n)?Math.round(n)*3+Math.round(t):Sw:Sw}function ise(e){return e>Xoe}function uI(e){return Math.round(e*.4)}function ose(e){return e==null||!Number.isFinite(e)||e<=0?Sw:Math.round(e)}function sse(e,t,n,i){const o=J$(n),s=ose(i),r=Math.max(o,Math.round(e*.6));if(t===void 0||!Number.isFinite(t))return r;const l=Math.round(t)-s;return Math.max(o,Math.min(r,l))}function M3(e,t,n){return t==null||!Number.isFinite(t)?e:Math.max(J$(n),Math.min(e,Math.round(t)))}function rse(e,t,n,i){return Math.max(Math.round(i),Math.min(Math.round(e+t),Math.round(n)))}function lse(e,t){return t===null||t===e}const N9="application/x-kimi-session-row";function ase(e,t){return e.includes(t)?e:[...e,t]}function use(e,t){return e.includes(t)?e.filter(n=>n!==t):e}function cse(e,t){const n=new Set(t),i=new Map,o=[];for(const r of e)n.has(r.id)?i.set(r.id,r):o.push(r);const s=[];for(const r of t){const l=i.get(r);l!==void 0&&s.push(l)}return{pinned:s,unpinned:o}}const dse={"&":"&","<":"<",">":">",'"':""","'":"'"};function cI(e){return e.replace(/[&<>"']/g,t=>dse[t]??t)}function fse(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hse(e,t,n=40){const i=e.replace(/\s+/g," ").trim();if(i.length===0)return"";const o=t.trim();if(o.length===0)return dI(i,n*2);const s=i.toLowerCase().indexOf(o.toLowerCase());if(s<0)return dI(i,n*2);const r=Math.max(0,s-n),l=Math.min(i.length,s+o.length+n),a=r>0,u=l`${s}`)}const pse=/([\s\S]*?)<\/kbd>/g;function fI(e){return e.replace(pse,"$1")}let mse=0;function gse(e,t){const n=++mse;return e.pendingPlanBySession[t]=n,n}function _w(e,t,n){return n===void 0||e.pendingPlanBySession[t]!==n?!1:(delete e.pendingPlanBySession[t],!0)}function Mw(e,t,n){e.pendingPlanBySession[t]===void 0&&(e.planModeBySession[t]=n)}function vse(e,t,n){return e.find(i=>i.window?.duration===t&&i.window?.unit===n)}const yse=30;function kse(e){return e!==void 0&&e0?(l.push(t("settings.planUsage.durationDay",{n:o})),l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):s>0?(l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):r>0?l.push(t("settings.planUsage.durationMinute",{n:r})):l.push(t("settings.planUsage.durationSecond",{n:i})),t("settings.planUsage.resetsIn",{duration:l.join(" ")})}function Iw(e,t){if(t<=0)return"ok";const n=e/t;return n>=.85?"danger":n>=.5?"warn":"ok"}function Sy(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}function bse(e,t){const n=(e/100).toFixed(2);switch(t.toUpperCase()){case"CNY":return{symbol:"¥",number:n};case"USD":return{symbol:"$",number:n};default:return{symbol:"",number:`${n} ${t}`}}}const wse=["kimi","openai","openai_responses","anthropic","google-genai","vertexai"];function w2(){return{model:"",maxContextSize:"",displayName:"",capabilities:["tool_use","thinking"],supportEfforts:[],adaptiveThinking:!0}}function Tw(e,t){const n=[];for(const i of Object.values(t??{})){if(i===null||typeof i!="object")continue;const o=i;o.provider===e.id&&n.push({model:typeof o.model=="string"?o.model:"",maxContextSize:typeof o.maxContextSize=="number"?String(o.maxContextSize):"",displayName:typeof o.displayName=="string"?o.displayName:"",capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(s=>typeof s=="string"):[],supportEfforts:Array.isArray(o.supportEfforts)?o.supportEfforts.filter(s=>typeof s=="string"):[],...typeof o.adaptiveThinking=="boolean"?{adaptiveThinking:o.adaptiveThinking}:{}})}return n}const tP=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function Cse(e,t={}){const n=e.id.trim();if(n==="")return"idRequired";if(!tP.test(n))return"idInvalid";if(t.requireApiKey===!0&&e.apiKey.trim()==="")return"apiKeyRequired";if(t.requireBaseUrl===!0&&e.baseUrl.trim()==="")return"baseUrlRequired";if(e.models.length===0)return"modelRequired";for(const i of e.models){if(i.model.trim()==="")return"modelRequired";const o=i.maxContextSize.trim();if(o==="")return"contextSizeRequired";if(!/^\d+$/.test(o)||Number(o)<1)return"contextSizeInvalid"}return null}function nP(e){return e.map(t=>{const n=t.displayName.trim();return{model:t.model.trim(),maxContextSize:Number(t.maxContextSize.trim()),...t.capabilities.length>0?{capabilities:[...t.capabilities]}:{},...t.supportEfforts.length>0?{supportEfforts:[...t.supportEfforts]}:{},...t.adaptiveThinking!==void 0?{adaptiveThinking:t.adaptiveThinking}:{},...n===""?{}:{displayName:n}}})}function Ase(e){const t=e.apiKey.trim(),n=e.baseUrl.trim();return{id:e.id.trim(),type:e.type,models:nP(e.models),...t===""?{}:{apiKey:t},...n===""?{}:{baseUrl:n}}}function xse(e,t,n){const i=nP(e.models),o=e.id.trim(),s=e.apiKey.trim(),r=e.baseUrl.trim(),l=n?.existingDefaultModel?.trim()??"",a=l.indexOf("/")>=0?l.slice(l.indexOf("/")+1):l;return{...t!==void 0&&o!==""&&o!==t.id?{newId:o}:{},type:e.type,models:i,...s===""&&n?.includeBlankApiKey!==!0?{}:{apiKey:s},...r===""?{}:{baseUrl:r},...a!==""&&i.some(u=>u.model===a)?{defaultModel:a}:{}}}function iP(e){return e.id==="managed:kimi-code"&&e.type==="kimi"}const D9="/devices/",oP="kimi-rc-device-id";function Sse(e){return new URLSearchParams(e.search).get("rc")==="1"}function sP(e){const{pathname:t}=e;if(!t.startsWith(D9))return;const n=t.slice(D9.length).split("/")[0];if(n)try{const i=decodeURIComponent(n);return i.length>0?i:void 0}catch{return}}function _se(e){if(sP({pathname:e})===void 0)return e;const t=e.slice(D9.length),n=t.indexOf("/");return n<0?"/":t.slice(n)}function Mse(e){return`${D9}${encodeURIComponent(e)}/`}function rP(e,t){const n=new URLSearchParams(t),i=n.get("rc"),o=n.get("from");if(i===null&&o===null)return e;const s=new URLSearchParams;return i!==null&&s.set("rc",i),o!==null&&s.set("from",o),`${e}?${s.toString()}`}function Ise(e){const t=sP(e);return t!==void 0?(Ese(t),t):Tse()}function Tse(){try{return window.sessionStorage.getItem(oP)??void 0}catch{return}}function Ese(e){try{window.sessionStorage.setItem(oP,e)}catch{}}const Lse=/^(\d+)\t(.*)$/;function Nse(e){const t=e.at(-1)===""?e.slice(0,-1):e;if(t.length===0)return null;const n=[],i=[];for(const o of t){const s=Lse.exec(o);if(!s)return null;i.push(Number(s[1])),n.push(s[2]??"")}return{contents:n,lineNumbers:i}}function hI(e,t){let n="",i=t;const o=/^((?:\\\\|\/\/)[^\\/]+[\\/][^\\/]+)/.exec(t),s=/^([a-zA-Z]:)[\\/]?/.exec(t);o?(n=o[1],i=t.slice(o[1].length)):t.startsWith("/")?(n="/",i=t.slice(1)):s&&(n=s[1],i=t.slice(s[0].length));const r=n!=="",l=i.split(/[\\/]+/).filter(Boolean);for(const u of e.split("/"))u===""||u==="."||(u===".."?l.length>0&&l[l.length-1]!==".."?l.pop():r||l.push(".."):l.push(u));const a=l.join("/");return n==="/"?`/${a}`:n!==""?a?`${n}/${a}`:`${n}/`:a}function lP(e,t){for(const n of e.stateMachineNames){const i=(e.stateMachineInputs(n)??[]).find(o=>o.name===t);if(i!==void 0)return i}return null}function Dse(e,t){const n=lP(e,t);return n!==null&&typeof n.fire=="function"?(n.fire(),!0):!1}function pI(e,t,n){const i=lP(e,t);return i!==null&&typeof i.value==typeof n?(i.value=n,!0):!1}const I3={isPageHidden:()=>typeof document<"u"&&document.hidden,onVisibilityChange:e=>typeof document>"u"?()=>{}:(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),observeIntersection:(e,t)=>{if(typeof IntersectionObserver!="function")return()=>{};const n=new IntersectionObserver(i=>{const o=i[0];o!==void 0&&t(o.isIntersecting)});return n.observe(e),()=>n.disconnect()}};function aP(e,t,n={}){const i=n.isPageHidden??I3.isPageHidden,o=n.onVisibilityChange??I3.onVisibilityChange,s=n.observeIntersection??I3.observeIntersection;let r=!i(),l=!0,a=!1;function u(){const f=!r||!l;f!==a&&(a=f,a?e.pause():e.play())}const c=o(()=>{r=!i(),u()}),d=s(t,f=>{l=f,u()});return u(),()=>{c(),d()}}const Xs="kimi-web.server-credential",Fse="token",Bse=10080*60*1e3;let Au;const Ew=new Set;function Rse(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Fse);if(!n)return;const i=new URL(window.location.href);return i.hash="",window.history.replaceState(window.history.state,"",`${i.pathname}${i.search}`),n}function Lw(e){return{version:1,credential:e,expiresAt:Date.now()+Bse}}function Ose(e){return JSON.stringify(e)}function T6(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Nw(e){globalThis.localStorage?.setItem(Xs,Ose(e))}function $se(){try{const e=globalThis.localStorage?.getItem(Xs);if(e){const n=T6(e);if(n===void 0){const i=Lw(e);let o=!1;try{Nw(i),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(Xs)===e&&globalThis.localStorage?.removeItem(Xs),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Xs)}catch{}return o?i:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Xs),globalThis.localStorage?.getItem(Xs)===e&&globalThis.localStorage?.removeItem(Xs);return}const t=globalThis.sessionStorage?.getItem(Xs);if(t){const n=Lw(t);let i=!1;try{Nw(n),i=!0}catch{}try{globalThis.sessionStorage?.removeItem(Xs),i=!0}catch{}return i?n:void 0}return}catch{return}}function Pse(){const e=Rse();return e?(uP(e),!0):(Au=$se(),Au!==void 0)}function zse(){if(Au!==void 0){if(Au.expiresAt<=Date.now()){jse(Au);return}return Au.credential}}function jse(e){Au=void 0;try{globalThis.sessionStorage?.removeItem(Xs);const t=globalThis.localStorage?.getItem(Xs),n=t==null?void 0:T6(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Xs)}catch{}}function uP(e){const t=Lw(e);Au=t;try{Nw(t)}catch{}try{globalThis.sessionStorage?.removeItem(Xs)}catch{}}function Hse(){const e=Au;Au=void 0;try{const t=globalThis.localStorage?.getItem(Xs),i=(t==null?void 0:T6(t))?.credential??t;e!==void 0&&i===e.credential&&globalThis.localStorage?.removeItem(Xs),globalThis.sessionStorage?.removeItem(Xs)}catch{}}function Wse(e){return Ew.add(e),()=>{Ew.delete(e)}}function qse(){Hse();for(const e of Ew)try{e()}catch{}}function hv(e){return e.approvalCount>0?"awaiting-approval":e.questionCount>0?"awaiting-question":e.pendingInteraction==="approval"?"awaiting-approval":e.pendingInteraction==="question"?"awaiting-question":e.busy?"running":e.lastTurnReason==="failed"?"aborted":e.unread?"unread":"idle"}function mI(e){let t=null;for(const n of e){const i=hv(n);if(i==="awaiting-approval")return"approval";i==="awaiting-question"?t="question":i==="aborted"?t!=="question"&&(t="aborted"):i==="unread"&&t===null&&(t="unread")}return t}let gI;function Use(e){if(typeof Intl.Segmenter=="function")return gI??=new Intl.Segmenter("und",{granularity:"grapheme"}),gI.segment(e)}const Vse=/\p{Emoji_Presentation}/u,Kse=/\p{Regional_Indicator}/u,Zse=/\p{Extended_Pictographic}/u,Gse="️";function Qse(e){return Vse.test(e)||Kse.test(e)?!0:Zse.test(e)&&e.includes(Gse)}function cP(e){const t=Use(e)?.[Symbol.iterator]().next().value;if(t===void 0||!Qse(t.segment))return{emoji:null,rest:e};const n=e.slice(t.index+t.segment.length).replace(/^\s+/,"");return{emoji:t.segment,rest:n}}function Yse(e,t){const{rest:n}=cP(e),i=t?.trim()??"";return i?n?`${i} ${n}`:i:n}function dP(e,t){const n=e.findIndex(s=>s.id===t.id);if(n!==-1&&e[n].updatedAt===t.updatedAt)return e.map(s=>s.id===t.id?t:s);const i=e.filter(s=>s.id!==t.id),o=i.findIndex(s=>s.updatedAt0?i:void 0}catch{return}}function Jse(e){return e===void 0||e.length===0?"/":`${Dw}${encodeURIComponent(e)}`}function hP(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function Xse(e,t=hP()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyA"||e.key.toLowerCase()==="a")&&!e.defaultPrevented}function ere(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement&&(e.isContentEditable||e.closest("input, textarea")!==null)}function tre(e,t){return typeof Element>"u"||!(e instanceof Element)?null:e.closest(t)}function kI(e){e.ownerDocument.getSelection()?.selectAllChildren(e)}function nre(e,t=hP()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyK"||e.key.toLowerCase()==="k")&&!e.defaultPrevented}const ire=[{pattern:/\brm\s+(?:-[a-zA-Z]*[rf][a-zA-Z]*|--recursive|--force)\b/,detail:"rm -rf"},{pattern:/\bsudo\b/,detail:"sudo"},{pattern:/\bmkfs(?:\.[a-z0-9]+)?\b/,detail:"mkfs"},{pattern:/\bdd\b[^|;&]*\bof=/,detail:"dd of=…"},{pattern:/>\s*\/dev\/(?:sd|nvme|disk|hd)/,detail:"> /dev/…"},{pattern:/:\(\)\s*\{/,detail:"fork bomb"},{pattern:/\bgit\s+push\b[^|;&]*(?:--force(?:-with-lease)?\b|\s-f\b)/,detail:"git push --force"},{pattern:/\bchmod\s+(?:-[a-zA-Z]+\s+)*777\b/,detail:"chmod 777"},{pattern:/\b(?:curl|wget)\b[^|;&]*\|\s*(?:sudo\s+)?(?:ba|z)?sh\b/,detail:"curl | sh"},{pattern:/\b(?:shutdown|reboot|poweroff|halt)\b/,detail:"shutdown / reboot"}];function ore(e){const t=e.replace(/"[^"]*"|'[^']*'/g," ");for(const{pattern:n,detail:i}of ire)if(n.test(t))return i}function tf(e){return Array.isArray?Array.isArray(e):mP(e)==="[object Array]"}function sre(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Fw(e){return e==null?"":sre(e)}function br(e){return typeof e=="string"}function _y(e){return typeof e=="number"}function rre(e){return e===!0||e===!1||lre(e)&&mP(e)=="[object Boolean]"}function pP(e){return typeof e=="object"}function lre(e){return pP(e)&&e!==null}function Dl(e){return e!=null}function C2(e){return!e.trim().length}function mP(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const are="Incorrect 'index' type",Bw="Invalid doc index: must be a non-negative integer within the bounds of the docs array",ure=e=>`Invalid value for key ${e}`,cre=e=>`Pattern length exceeds max of ${e}.`,dre=e=>`Missing ${e} property in key`,fre=e=>`Property 'weight' in key '${e}' must be a positive integer`,hre="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",bI=Object.prototype.hasOwnProperty;var pre=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const i=gP(n);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function gP(e){let t=null,n=null,i=null,o=1,s=null;if(br(e)||tf(e))i=e,t=wI(e),n=My(e);else{if(!bI.call(e,"name"))throw new Error(dre("name"));const r=e.name;if(i=r,bI.call(e,"weight")&&e.weight!==void 0&&(o=e.weight,o<=0))throw new Error(fre(My(r)));t=wI(r),n=My(r),s=e.getFn??null}return{path:t,id:n,weight:o,src:i,getFn:s}}function wI(e){return tf(e)?e:e.split(".")}function My(e){return tf(e)?e.join("."):e}function mre(e,t){const n=[];let i=!1;const o=(s,r,l,a)=>{if(Dl(s))if(!r[l])n.push(a!==void 0?{v:s,i:a}:s);else{const u=s[r[l]];if(!Dl(u))return;if(l===r.length-1&&(br(u)||_y(u)||rre(u)||typeof u=="bigint"))n.push(a!==void 0?{v:Fw(u),i:a}:Fw(u));else if(tf(u)){i=!0;for(let c=0,d=u.length;ce.score===t.score?e.idx=9&&e<=13||e===32||e===160}function wre(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(o){let s=0,r=!1;for(let a=0;a{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(br(this.docs[0]))for(let n=0;ne&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const i of e)Number.isInteger(i)&&i>=0&&t.add(i);if(t.size===0)return;this.records=this.records.filter(i=>!t.has(i.i));const n=Array.from(t).sort((i,o)=>i-o);for(const i of this.records){let o=0,s=n.length;for(;o>>1;n[r]t),records:this.records}}};function vP(e,t,{getFn:n=$n.getFn,fieldNormWeight:i=$n.fieldNormWeight}={}){const o=new E6({getFn:n,fieldNormWeight:i});return o.setKeys(e.map(gP)),o.setSources(t),o.create(),o}function Cre(e,{getFn:t=$n.getFn,fieldNormWeight:n=$n.fieldNormWeight}={}){const{keys:i,records:o}=e,s=new E6({getFn:t,fieldNormWeight:n});return s.setKeys(i),s.setIndexRecords(o),s}function Are(e=[],t=$n.minMatchCharLength){const n=[];let i=-1,o=-1,s=0;for(let r=e.length;s=t&&n.push([i,o]),i=-1)}return e[s-1]&&s-i>=t&&n.push([i,s-1]),n}function xre(e,t,n,{location:i=$n.location,distance:o=$n.distance,threshold:s=$n.threshold,findAllMatches:r=$n.findAllMatches,minMatchCharLength:l=$n.minMatchCharLength,includeMatches:a=$n.includeMatches,ignoreLocation:u=$n.ignoreLocation}={}){if(t.length>32)throw new Error(cre(32));const c=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let h=s,m=f;const g=(_,x)=>{const E=_/c;if(u)return E;const M=Math.abs(f-x);return o?E+M/o:M?1:E},v=l>1||a,y=v?Array(d):[];let b;for(;(b=e.indexOf(t,m))>-1;){const _=g(0,b);if(h=Math.min(_,h),m=b+c,v){let x=0;for(;x=M;z-=1){const $=z-1,B=n[e[$]];if(q[z]=(q[z+1]<<1|1)&B,_&&(q[z]|=(w[z+1]|w[z])<<1|1|w[z+1]),q[z]&I&&(C=g(_,$),C<=h)){if(h=C,m=$,T=_,m<=f)break;M=Math.max(1,2*f-m)}}if(g(_+1,f)>h)break;w=q}if(v&&m>=0){const _=Math.min(d-1,m+c-1+T);for(let x=m;x<=_;x+=1)n[e[x]]&&(y[x]=1)}const S={isMatch:m>=0,score:Math.max(.001,C)};if(v){const _=Are(y,l);_.length?a&&(S.indices=_):S.isMatch=!1}return S}function Sre(e){const t={};for(let n=0,i=e.length;nn[0]-i[0]||n[1]-i[1]);const t=[e[0]];for(let n=1,i=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(_re,t=>yP[t]):e=>e;var N6=class{constructor(e,{location:t=$n.location,threshold:n=$n.threshold,distance:i=$n.distance,includeMatches:o=$n.includeMatches,findAllMatches:s=$n.findAllMatches,minMatchCharLength:r=$n.minMatchCharLength,isCaseSensitive:l=$n.isCaseSensitive,ignoreDiacritics:a=$n.ignoreDiacritics,ignoreLocation:u=$n.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:o,findAllMatches:s,minMatchCharLength:r,isCaseSensitive:l,ignoreDiacritics:a,ignoreLocation:u},e=l?e:e.toLowerCase(),e=a?x0(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(f,h)=>{this.chunks.push({pattern:f,alphabet:Sre(f),startIndex:h})},d=this.pattern.length;if(d>32){let f=0;const h=d%32,m=d-h;for(;f{const{isMatch:y,score:b,indices:w}=xre(e,m,g,{location:o+v,distance:s,threshold:r,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});y&&(f=!0),d+=b,y&&w&&c.push(...w)});const h={isMatch:f,score:f?d/this.chunks.length:1};return f&&i&&(h.indices=L6(c)),h}};const Mre=new Set(["fuzzy","include"]);function Ire(e){return e.startsWith("inverse")}const Rw=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,i;const o=[],s=e.length;for(;(i=t.indexOf(e,n))>-1;)n=i+s,o.push([i,n-1]);const r=!!o.length;return{isMatch:r,score:r?0:1,indices:o}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new N6(e,{location:t.location??$n.location,threshold:t.threshold??$n.threshold,distance:t.distance??$n.distance,includeMatches:t.includeMatches??$n.includeMatches,findAllMatches:t.findAllMatches??$n.findAllMatches,minMatchCharLength:t.minMatchCharLength??$n.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??$n.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??$n.ignoreDiacritics,ignoreLocation:t.ignoreLocation??$n.ignoreLocation});return{type:"fuzzy",search(i){return n.searchIn(i)}}}}],CI=Rw.length,Tre="\0",Ere="|";function Lre(e){const t=[],n=e.length;let i=0;for(;i=n)break;let o=i;for(;o=n||e[s]===" "){o++;break}if(e[s]==="$"&&(s+1>=n||e[s+1]===" ")){o+=2;break}}o++}t.push(e.substring(i,o)),i=o}else{for(;o{const i=Lre(n.replace(/\u0000/g,"|").trim()).filter(s=>s&&!!s.trim()),o=[];for(let s=0,r=i.length;s!!(e[B9.AND]||e[B9.OR]),Fre=e=>!!e[$w.PATH],Bre=e=>!tf(e)&&pP(e)&&!Pw(e),xI=e=>({[B9.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function kP(e,t,{auto:n=!0}={}){const i=o=>{if(br(o)){const a={keyId:null,pattern:o};return n&&(a.searcher=F9(o,t)),a}const s=Object.keys(o),r=Fre(o);if(!r&&s.length>1&&!Pw(o))return i(xI(o));if(Bre(o)){const a=r?o[$w.PATH]:s[0],u=r?o[$w.PATTERN]:o[a];if(!br(u))throw new Error(ure(a));const c={keyId:My(a),pattern:u};return n&&(c.searcher=F9(u,t)),c}const l={children:[],operator:s[0]};return s.forEach(a=>{const u=o[a];tf(u)&&u.forEach(c=>{l.children.push(i(c))})}),l};return Pw(e)||(e=xI(e)),i(e)}function zw(e,{ignoreFieldNorm:t=$n.ignoreFieldNorm}){let n=1;return e.forEach(({key:i,norm:o,score:s})=>{const r=i?i.weight:null;n*=Math.pow(s===0&&r?Number.EPSILON:s,(r||1)*(t?1:o))}),n}function Rre(e,{ignoreFieldNorm:t=$n.ignoreFieldNorm}){e.forEach(n=>{n.score=zw(n.matches,{ignoreFieldNorm:t})})}var Ore=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const i=t[e];t[e]=t[n],t[n]=i,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let i=e;do{e=i;const o=2*e+1,s=2*e+2;if(o0&&(i=o),s0&&(i=s),i!==e){const r=t[e];t[e]=t[i],t[i]=r}}while(i!==e)}};function $re(e){const t=[];return e.matches.forEach(n=>{if(!Dl(n.indices)||!n.indices.length)return;const i={indices:n.indices,value:n.value};n.key&&(i.key=n.key.id),n.idx>-1&&(i.refIndex=n.idx),t.push(i)}),t}function Pre(e,t,{includeMatches:n=$n.includeMatches,includeScore:i=$n.includeScore}={}){return e.map(o=>{const{idx:s}=o,r={item:t[s],refIndex:s};return n&&(r.matches=$re(o)),i&&(r.score=o.score),r})}const zre=/[\p{L}\p{M}\p{N}_]+/gu,SI=new WeakSet;function jre(e){SI.has(e)||(SI.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Hre(e){if(typeof e=="function"){let t=!1;return n=>{const i=e(n);if(!t&&(t=!0,!Array.isArray(i)||i.some(o=>typeof o!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(i)?"array containing non-strings":typeof i}.`);return i}}return e instanceof RegExp?(e.global||jre(e),t=>t.match(e)||[]):t=>t.match(zre)||[]}function jw({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const i=Hre(n);return{tokenize(o){return e||(o=o.toLowerCase()),t&&(o=x0(o)),i(o)}}}var Wre=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=jw({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:i,fieldCount:o}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const s of n){this.termSearchers.push(new N6(s,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=i.get(s)||0,l=Math.log(1+(o-r+.5)/(r+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,i=0,o=0,s=0;const r=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u0?1-n/i:0,a={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(a.indices=L6(t)),this.combineAll&&(this.useMask?a.matchedMask=s:a.matchedTerms=r,a.termCount=this.numTerms),a}};function T3(e,t,n,i){const o=i.tokenize(t);if(!o.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const s=new Set(o);let r=e.docTermFieldHits.get(n);r||(r=new Map,e.docTermFieldHits.set(n,r));for(const l of s)r.set(l,(r.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function bP(e,t,n,i){const{i:o,v:s,$:r}=t;if(s!==void 0){T3(e,s,o,i);return}if(r)for(let l=0;ll-a);for(const l of n)Vre(e,l);const i=l=>{let a=0,u=n.length;for(;a>>1;n[c]o?i(l):l,a);e.docFieldCount=s;const r=new Map;for(const[l,a]of e.docTermFieldHits)r.set(l>o?i(l):l,a);e.docTermFieldHits=r}var nf=class{constructor(e,t,n){this.options={...$n,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new pre(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=F9(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof E6))throw new Error(are);if(this._myIndex=t||vP(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=jw({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=qre(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!Dl(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=jw({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Ure(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let i=0,o=this._docs.length;i!i.has(s)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(Bw);this._invertedIndex&&_I(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:i,includeScore:o,shouldSort:s,sortFn:r,ignoreFieldNorm:l}=this.options;if(br(e)&&!e.trim()){let f=this._docs.map((h,m)=>({item:h,refIndex:m}));return _y(n)&&n>-1&&(f=f.slice(0,n)),f}const a=s&&_y(n)&&n>0&&br(e),u=r,c=(f,h)=>u(f,h)||f.idx-h.idx;let d;if(a){const f=new Ore(n,c);br(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:l}),d=f.extractSorted()}else d=br(e)?br(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Rre(d,{ignoreFieldNorm:l}),s&&d.sort(br(e)?c:u),_y(n)&&n>-1&&(d=d.slice(0,n));return Pre(d,this._docs,{includeMatches:i,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=t?null:[];return s.forEach(({v:l,i:a,n:u})=>{if(!Dl(l))return;const c=i.searchIn(l);if(c.isMatch){const d={score:c.score,value:l,norm:u,indices:c.indices};o&&(d.matchedMask=c.matchedMask,d.matchedTerms=c.matchedTerms,d.termCount=c.termCount);const f=[d];if(!o||this._coversAllTokens(f)){const h={item:l,idx:a,matches:f};t?(h.score=zw(h.matches,{ignoreFieldNorm:n}),t.insert(h)):r.push(h)}}}),r}_searchLogical(e){const t=kP(e,this.options),n=this._normalizedKeys(),i=(l,a,u)=>{if(!("children"in l)){const{keyId:h,searcher:m}=l;let g;return h===null?(g=[],n.forEach((v,y)=>{g.push(...this._findMatches({key:v,value:a[y],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(a,h),searcher:m}),g&&g.length?[{idx:u,item:a,matches:g}]:[]}const{children:c,operator:d}=l,f=[];for(let h=0,m=c.length;h{if(Dl(l)){const u=i(t,l,a);u.length&&(s.has(a)||(s.set(a,{idx:a,item:l,matches:[]}),r.push(s.get(a))),u.forEach(({matches:c})=>{s.get(a).matches.push(...c)}))}}),r}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=this._normalizedKeys(),l=t?null:[];return s.forEach(({$:a,i:u})=>{if(!Dl(a))return;const c=[];let d=!1,f=!1;if(r.forEach((h,m)=>{const g=this._findMatches({key:h,value:a[m],searcher:i});g.length?(c.push(...g),g[0].hasInverse&&(f=!0)):d=!0}),!(f&&d)&&c.length&&(!o||this._coversAllTokens(c))){const h={idx:u,item:a,matches:c};t?(h.score=zw(h.matches,{ignoreFieldNorm:n}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!Dl(t))return[];const i=[];if(tf(t))t.forEach(({v:o,i:s,n:r})=>{if(!Dl(o))return;const l=n.searchIn(o);if(l.isMatch){const a={score:l.score,key:e,value:o,idx:s,norm:r,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(a.matchedMask=l.matchedMask,a.matchedTerms=l.matchedTerms,a.termCount=l.termCount),i.push(a)}});else{const{v:o,n:s}=t,r=n.searchIn(o);if(r.isMatch){const l={score:r.score,key:e,value:o,norm:s,indices:r.indices,hasInverse:r.hasInverse};r.termCount!==void 0&&(l.matchedMask=r.matchedMask,l.matchedTerms=r.matchedTerms,l.termCount=r.termCount),i.push(l)}}return i}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let i=0;for(let o=0;oD6(t))};var Kre=nf;const Zre=/^[\uD800-\uDBFF]$/,Gre=/^[\uDC00-\uDFFF]$/,Qre=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var MI;(function(e){e[e.Unknown=1e-13]="Unknown",e[e.Rule=1e-12]="Rule",e[e.DICT=2e-8]="DICT",e[e.Surname=1]="Surname",e[e.Custom=1]="Custom"})(MI||(MI={}));const Vl={Normal:1,Surname:10,Custom:100};function $a(e){var t;return e.length-(((t=e.match(Qre))===null||t===void 0?void 0:t.length)||0)}function Hw(e){const t=[];let n=0;for(;n1)return this.StringDICT.get(t);{const n=t.charCodeAt(0);return this.NumberDICT[n]}}set(t,n){if(t.length>1)this.StringDICT.set(t,n);else{const i=t.charCodeAt(0);this.NumberDICT[i]=n}}clear(){this.NumberDICT=[],this.StringDICT.clear()}}const Yre=["zh","ch","sh","z","c","s","b","p","m","f","d","t","n","l","g","k","h","j","q","x","r","y","w",""],Jre=["j","q","x"],Xre=["uān","uán","uǎn","uàn","uan","uē","ué","uě","uè","ue","ūn","ún","ǔn","ùn","un","ū","ú","ǔ","ù","u"],ele={uān:"üān",uán:"üán",uǎn:"üǎn",uàn:"üàn",uan:"üan",uē:"üē",ué:"üé",uě:"üě",uè:"üè",ue:"üe",ūn:"ǖn",ún:"ǘn",ǔn:"ǚn",ùn:"ǜn",un:"ün",ū:"ǖ",ú:"ǘ",ǔ:"ǚ",ù:"ǜ",u:"ü"},tle=["ia","ian","iang","iao","ie","iu","iong","ua","uai","uan","uang","ue","ui","uo","üan","üe","van","ve"],II={一:"yì",二:"èr",三:"sān",四:"sì",五:"wǔ",六:"liù",七:"qī",八:"bā",九:"jiǔ",十:"shí",百:"bǎi",千:"qiān",万:"wàn",亿:"yì",单:"dān",两:"liǎng",双:"shuāng",多:"duō",几:"jǐ",十一:"shí yī",零一:"líng yī",第一:"dì yī",一十:"yī shí",一十一:"yī shí yī"},TI={重:"chóng",行:"háng",斗:"dǒu",更:"gēng"};function nle(){const e={零一:"líng yī","〇一":"líng yī",十一:"shí yī",一十:"yī shí",第一:"dì yī",一十一:"yī shí yī"};for(let t in II)for(let n in TI){const i=`${t}${n}`,o=`${II[t]} ${TI[n]}`;e[i]=o}return e}const EI=nle(),ile=Object.keys(EI).map(e=>({zh:e,pinyin:EI[e],probability:1e-12,length:$a(e),priority:Vl.Normal,dict:Symbol("rule")})),CP={不:{bú:[4]},一:{yí:[4],yì:[1,2,3]}},ole={不:["的","而","之","后","也","还","地"],一:["的","而","之","后","也","还","是"]},sle=Object.keys(CP),Ww={南宫:"nán gōng",第五:"dì wǔ",万俟:"mò qí",司马:"sī mǎ",上官:"shàng guān",欧阳:"ōu yáng",夏侯:"xià hóu",诸葛:"zhū gě",闻人:"wén rén",东方:"dōng fāng",赫连:"hè lián",皇甫:"huáng fǔ",尉迟:"yù chí",公羊:"gōng yáng",澹台:"tán tái",公冶:"gōng yě",宗政:"zōng zhèng",濮阳:"pú yáng",淳于:"chún yú",太叔:"tài shū",申屠:"shēn tú",公孙:"gōng sūn",仲孙:"zhòng sūn",轩辕:"xuān yuán",令狐:"líng hú",钟离:"zhōng lí",宇文:"yǔ wén",长孙:"zhǎng sūn",慕容:"mù róng",鲜于:"xiān yú",闾丘:"lǘ qiū",司徒:"sī tú",司空:"sī kōng",亓官:"qí guān",司寇:"sī kòu",仉督:"zhǎng dū",子车:"zǐ jū",颛孙:"zhuān sūn",端木:"duān mù",巫马:"wū mǎ",公西:"gōng xī",漆雕:"qī diāo",乐正:"yuè zhèng",壤驷:"rǎng sì",公良:"gōng liáng",拓跋:"tuò bá",夹谷:"jiá gǔ",宰父:"zǎi fǔ",榖梁:"gǔ liáng",段干:"duàn gān",百里:"bǎi lǐ",东郭:"dōng guō",南门:"nán mén",呼延:"hū yán",羊舌:"yáng shé",梁丘:"liáng qiū",左丘:"zuǒ qiū",东门:"dōng mén",西门:"xī mén",句龙:"gōu lóng",毌丘:"guàn qiū",赵:"zhào",钱:"qián",孙:"sūn",李:"lǐ",周:"zhōu",吴:"wú",郑:"zhèng",王:"wáng",冯:"féng",陈:"chén",褚:"chǔ",卫:"wèi",蒋:"jiǎng",沈:"shěn",韩:"hán",杨:"yáng",朱:"zhū",秦:"qín",尤:"yóu",许:"xǔ",何:"hé",吕:"lǚ",施:"shī",张:"zhāng",孔:"kǒng",曹:"cáo",严:"yán",华:"huà",金:"jīn",魏:"wèi",陶:"táo",姜:"jiāng",戚:"qī",谢:"xiè",邹:"zōu",喻:"yù",柏:"bǎi",水:"shuǐ",窦:"dòu",章:"zhāng",云:"yún",苏:"sū",潘:"pān",葛:"gě",奚:"xī",范:"fàn",彭:"péng",郎:"láng",鲁:"lǔ",韦:"wéi",昌:"chāng",马:"mǎ",苗:"miáo",凤:"fèng",花:"huā",方:"fāng",俞:"yú",任:"rén",袁:"yuán",柳:"liǔ",酆:"fēng",鲍:"bào",史:"shǐ",唐:"táng",费:"fèi",廉:"lián",岑:"cén",薛:"xuē",雷:"léi",贺:"hè",倪:"ní",汤:"tāng",滕:"téng",殷:"yīn",罗:"luó",毕:"bì",郝:"hǎo",邬:"wū",安:"ān",常:"cháng",乐:"yuè",于:"yú",时:"shí",傅:"fù",皮:"pí",卞:"biàn",齐:"qí",康:"kāng",伍:"wǔ",余:"yú",元:"yuán",卜:"bǔ",顾:"gù",孟:"mèng",平:"píng",黄:"huáng",和:"hé",穆:"mù",萧:"xiāo",尹:"yǐn",姚:"yáo",邵:"shào",湛:"zhàn",汪:"wāng",祁:"qí",毛:"máo",禹:"yǔ",狄:"dí",米:"mǐ",贝:"bèi",明:"míng",臧:"zāng",计:"jì",伏:"fú",成:"chéng",戴:"dài",谈:"tán",宋:"sòng",茅:"máo",庞:"páng",熊:"xióng",纪:"jǐ",舒:"shū",屈:"qū",项:"xiàng",祝:"zhù",董:"dǒng",梁:"liáng",杜:"dù",阮:"ruǎn",蓝:"lán",闵:"mǐn",席:"xí",季:"jì",麻:"má",强:"qiáng",贾:"jiǎ",路:"lù",娄:"lóu",危:"wēi",江:"jiāng",童:"tóng",颜:"yán",郭:"guō",梅:"méi",盛:"shèng",林:"lín",刁:"diāo",钟:"zhōng",徐:"xú",邱:"qiū",骆:"luò",高:"gāo",夏:"xià",蔡:"cài",田:"tián",樊:"fán",胡:"hú",凌:"líng",霍:"huò",虞:"yú",万:"wàn",支:"zhī",柯:"kē",昝:"zǎn",管:"guǎn",卢:"lú",莫:"mò",经:"jīng",房:"fáng",裘:"qiú",缪:"miào",干:"gān",解:"xiè",应:"yīng",宗:"zōng",丁:"dīng",宣:"xuān",贲:"bēn",邓:"dèng",郁:"yù",单:"shàn",杭:"háng",洪:"hóng",包:"bāo",诸:"zhū",左:"zuǒ",石:"shí",崔:"cuī",吉:"jí",钮:"niǔ",龚:"gōng",程:"chéng",嵇:"jī",邢:"xíng",滑:"huá",裴:"péi",陆:"lù",荣:"róng",翁:"wēng",荀:"xún",羊:"yáng",於:"yū",惠:"huì",甄:"zhēn",曲:"qū",家:"jiā",封:"fēng",芮:"ruì",羿:"yì",储:"chǔ",靳:"jìn",汲:"jí",邴:"bǐng",糜:"mí",松:"sōng",井:"jǐng",段:"duàn",富:"fù",巫:"wū",乌:"wū",焦:"jiāo",巴:"bā",弓:"gōng",牧:"mù",隗:"wěi",山:"shān",谷:"gǔ",车:"chē",侯:"hóu",宓:"mì",蓬:"péng",全:"quán",郗:"xī",班:"bān",仰:"yǎng",秋:"qiū",仲:"zhòng",伊:"yī",宫:"gōng",宁:"nìng",仇:"qiú",栾:"luán",暴:"bào",甘:"gān",钭:"tǒu",厉:"lì",戎:"róng",祖:"zǔ",武:"wǔ",符:"fú",刘:"liú",景:"jǐng",詹:"zhān",束:"shù",龙:"lóng",叶:"yè",幸:"xìng",司:"sī",韶:"sháo",郜:"gào",黎:"lí",蓟:"jì",薄:"bó",印:"yìn",宿:"sù",白:"bái",怀:"huái",蒲:"pú",邰:"tái",从:"cóng",鄂:"è",索:"suǒ",咸:"xián",籍:"jí",赖:"lài",卓:"zhuó",蔺:"lìn",屠:"tú",蒙:"méng",池:"chí",乔:"qiáo",阴:"yīn",鬱:"yù",胥:"xū",能:"nài",苍:"cāng",双:"shuāng",闻:"wén",莘:"shēn",党:"dǎng",翟:"zhái",谭:"tán",贡:"gòng",劳:"láo",逄:"páng",姬:"jī",申:"shēn",扶:"fú",堵:"dǔ",冉:"rǎn",宰:"zǎi",郦:"lì",雍:"yōng",郤:"xì",璩:"qú",桑:"sāng",桂:"guì",濮:"pú",牛:"niú",寿:"shòu",通:"tōng",边:"biān",扈:"hù",燕:"yān",冀:"jì",郏:"jiá",浦:"pǔ",尚:"shàng",农:"nóng",温:"wēn",别:"bié",庄:"zhuāng",晏:"yàn",柴:"chái",瞿:"qú",阎:"yán",充:"chōng",慕:"mù",连:"lián",茹:"rú",习:"xí",宦:"huàn",艾:"ài",鱼:"yú",容:"róng",向:"xiàng",古:"gǔ",易:"yì",慎:"shèn",戈:"gē",廖:"liào",庾:"yǔ",终:"zhōng",暨:"jì",居:"jū",衡:"héng",步:"bù",都:"dū",耿:"gěng",满:"mǎn",弘:"hóng",匡:"kuāng",国:"guó",文:"wén",寇:"kòu",广:"guǎng",禄:"lù",阙:"quē",东:"dōng",欧:"ōu",殳:"shū",沃:"wò",利:"lì",蔚:"wèi",越:"yuè",夔:"kuí",隆:"lóng",师:"shī",巩:"gǒng",厍:"shè",聂:"niè",晁:"cháo",勾:"gōu",敖:"áo",融:"róng",冷:"lěng",訾:"zī",辛:"xīn",阚:"kàn",那:"nā",简:"jiǎn",饶:"ráo",空:"kōng",曾:"zēng",母:"mǔ",沙:"shā",乜:"niè",养:"yǎng",鞠:"jū",须:"xū",丰:"fēng",巢:"cháo",关:"guān",蒯:"kuǎi",相:"xiàng",查:"zhā",后:"hòu",荆:"jīng",红:"hóng",游:"yóu",竺:"zhú",权:"quán",逯:"lù",盖:"gě",益:"yì",桓:"huán",公:"gōng",牟:"móu",哈:"hǎ",言:"yán",福:"fú",肖:"xiāo",区:"ōu",覃:"qín",朴:"piáo",繁:"pó",员:"yùn",句:"gōu",要:"yāo",过:"guō",钻:"zuān",谌:"chén",折:"shé",召:"shào",郄:"qiè",撒:"sǎ",甯:"nìng",六:"lù",啜:"chuài",行:"xíng"},rle=Object.keys(Ww).map(e=>({zh:e,pinyin:Ww[e],probability:1+$a(e),length:$a(e),priority:Vl.Surname,dict:Symbol("surname")})),LI={"bǎng páng pāng":["膀"],líng:["〇","伶","凌","刢","囹","坽","夌","姈","婈","孁","岺","彾","掕","昤","朎","柃","棂","櫺","欞","泠","淩","澪","灵","燯","爧","狑","玲","琌","瓴","皊","砱","祾","秢","竛","笭","紷","綾","绫","羐","羚","翎","聆","舲","苓","菱","蓤","蔆","蕶","蛉","衑","裬","詅","跉","軨","輘","酃","醽","鈴","錂","铃","閝","陵","零","霊","霗","霛","霝","靈","駖","魿","鯪","鲮","鴒","鸰","鹷","麢","齡","齢","龄","龗","㥄"],yī:["一","乊","伊","依","医","吚","咿","噫","壱","壹","夁","嫛","嬄","弌","揖","撎","檹","毉","洢","渏","漪","瑿","畩","祎","禕","稦","繄","蛜","衤","譩","辷","郼","醫","銥","铱","鷖","鹥","黟","黳"],"dīng zhēng":["丁"],"kǎo qiǎo yú":["丂"],qī:["七","倛","僛","凄","嘁","墄","娸","悽","慼","慽","戚","捿","柒","桤","桼","棲","榿","欺","沏","淒","漆","紪","緀","萋","褄","諆","迉","郪","鏚","霋","魌","鶈"],shàng:["丄","尙","尚","恦","緔","绱"],xià:["丅","下","乤","圷","夏","夓","懗","梺","疜","睱","罅","鎼","鏬"],hǎn:["丆","喊","浫","罕","豃","㘎"],"wàn mò":["万"],zhàng:["丈","仗","墇","嶂","帐","帳","幛","扙","杖","涱","痮","瘬","瘴","瞕","粀","胀","脹","賬","账","障"],sān:["三","厁","叁","弎","毵","毶","毿","犙","鬖"],"shàng shǎng shang":["上"],"qí jī":["丌","其","奇"],"bù fǒu":["不"],"yǔ yù yú":["与"],miǎn:["丏","偭","免","冕","勉","勔","喕","娩","愐","汅","沔","湎","睌","緬","缅","腼","葂","靦","鮸","𩾃"],gài:["丐","乢","匃","匄","戤","概","槩","槪","溉","漑","瓂","葢","鈣","钙","𬮿"],chǒu:["丑","丒","侴","吜","杽","瞅","矁","醜","魗"],zhuān:["专","叀","嫥","専","專","瑼","甎","砖","磗","磚","蟤","諯","鄟","顓","颛","鱄","䏝"],"qiě jū":["且"],pī:["丕","伓","伾","噼","坯","岯","憵","批","披","炋","狉","狓","砒","磇","礔","礕","秛","秠","耚","豾","邳","鈚","鉟","銔","錃","錍","霹","駓","髬","魾","𬳵"],shì:["世","丗","亊","事","仕","侍","冟","势","勢","卋","呩","嗜","噬","士","奭","嬕","室","市","式","弑","弒","恀","恃","戺","拭","揓","是","昰","枾","柿","栻","澨","烒","煶","眂","眎","眡","睗","示","礻","筮","簭","舐","舓","襫","視","视","觢","試","誓","諡","謚","试","谥","貰","贳","軾","轼","逝","遾","釈","释","釋","鈰","鉃","鉽","铈","飾","餙","餝","饰","鰘","䏡","𬤊"],qiū:["丘","丠","坵","媝","恘","恷","楸","秋","秌","穐","篍","緧","萩","蘒","蚯","蝵","蟗","蠤","趥","邱","鞦","鞧","鰌","鰍","鳅","鶖","鹙","龝"],bǐng:["丙","屛","怲","抦","昞","昺","柄","棅","炳","禀","秉","稟","苪","蛃","邴","鈵","陃","鞆","餅","餠","饼"],yè:["业","亱","僷","墷","夜","嶪","嶫","抴","捙","擛","擪","擫","晔","曄","曅","曗","曳","曵","枼","枽","業","洂","液","澲","烨","燁","爗","璍","皣","瞱","瞸","礏","腋","葉","謁","谒","邺","鄴","鍱","鐷","靥","靨","頁","页","餣","饁","馌","驜","鵺","鸈"],cóng:["丛","从","叢","婃","孮","従","徔","徖","悰","樷","欉","淙","灇","爜","琮","藂","誴","賨","賩","錝"],dōng:["东","倲","冬","咚","埬","岽","崬","徚","昸","東","氡","氭","涷","笗","苳","菄","蝀","鮗","鯟","鶇","鶫","鸫","鼕","𬟽"],sī:["丝","俬","凘","厮","司","咝","嘶","噝","媤","廝","恖","撕","斯","楒","泀","澌","燍","禗","禠","私","糹","絲","緦","纟","缌","罳","蕬","虒","蛳","蜤","螄","蟖","蟴","鉰","銯","鍶","鐁","锶","颸","飔","騦","鷥","鸶","鼶","㟃"],chéng:["丞","呈","城","埕","堘","塍","塖","宬","峸","惩","懲","成","承","挰","掁","揨","枨","棖","橙","檙","洆","溗","澂","珵","珹","畻","程","窚","筬","絾","脭","荿","誠","诚","郕","酲","鋮","铖","騬","鯎"],diū:["丟","丢","銩","铥"],liǎng:["両","两","兩","唡","啢","掚","緉","脼","蜽","裲","魉","魎","𬜯"],yǒu:["丣","卣","友","梄","湵","牖","禉","羑","聈","苃","莠","蜏","酉","銪","铕","黝"],yán:["严","厳","啱","喦","嚴","塩","壛","壧","妍","姸","娫","娮","岩","嵒","嵓","巌","巖","巗","延","揅","昖","楌","檐","櫩","欕","沿","炎","炏","狿","琂","盐","碞","筵","簷","莚","蔅","虤","蜒","言","訁","訮","詽","讠","郔","閆","閻","闫","阎","顏","顔","颜","鹽","麣","𫄧"],bìng:["並","併","倂","傡","垪","摒","栤","病","窉","竝","誁","靐","鮩"],"sàng sāng":["丧"],gǔn:["丨","惃","滚","滾","磙","緄","绲","蓘","蔉","衮","袞","輥","辊","鮌","鯀","鲧"],jiū:["丩","勼","啾","揪","揫","朻","究","糾","纠","萛","赳","阄","鬏","鬮","鳩","鸠"],"gè gě":["个","個","各"],yā:["丫","圧","孲","庘","押","枒","桠","椏","錏","鐚","鴉","鴨","鵶","鸦","鸭"],pán:["丬","媻","幋","槃","洀","瀊","爿","盘","盤","磐","縏","蒰","蟠","蹒","蹣","鎜","鞶"],"zhōng zhòng":["中"],jǐ:["丮","妀","己","戟","挤","掎","撠","擠","橶","泲","犱","脊","虮","蟣","魢","鱾","麂"],jiè:["丯","介","借","唶","堺","屆","届","岕","庎","徣","戒","楐","犗","玠","琾","界","畍","疥","砎","蚧","蛶","衸","褯","誡","诫","鎅","骱","魪"],fēng:["丰","仹","偑","僼","凨","凬","凮","妦","寷","封","峯","峰","崶","枫","楓","檒","沣","沨","渢","灃","烽","犎","猦","琒","疯","瘋","盽","砜","碸","篈","蘴","蜂","蠭","豐","鄷","酆","鋒","鎽","鏠","锋","霻","靊","飌","麷"],"guàn kuàng":["丱"],chuàn:["串","汌","玔","賗","釧","钏"],chǎn:["丳","产","冁","剷","囅","嵼","旵","浐","滻","灛","產","産","簅","蒇","蕆","諂","譂","讇","谄","鏟","铲","閳","闡","阐","骣","𬊤"],lín:["临","冧","壣","崊","嶙","斴","晽","暽","林","潾","瀶","燐","琳","璘","瞵","碄","磷","粦","粼","繗","翷","臨","轔","辚","遴","邻","鄰","鏻","阾","隣","霖","驎","鱗","鳞","麐","麟","𬴊","𬭸"],zhuó:["丵","劅","卓","啄","圴","妰","娺","撯","擆","擢","斫","斮","斱","斲","斵","晫","椓","浊","浞","濁","灼","烵","琸","硺","禚","窡","籗","籱","罬","茁","蠗","蠿","諁","諑","謶","诼","酌","鐲","镯","鵫","鷟","䓬","𬸦"],zhǔ:["丶","主","劯","嘱","囑","宔","帾","拄","渚","濐","煑","煮","燝","瞩","矚","罜","詝","陼","鸀","麈","𬣞"],bā:["丷","仈","八","叭","哵","夿","岜","巴","捌","朳","玐","疤","笆","粑","羓","芭","蚆","豝","釟"],wán:["丸","刓","完","岏","抏","捖","汍","烷","玩","琓","笂","紈","纨","翫","芄","貦","頑","顽"],dān:["丹","勯","匰","単","妉","媅","殚","殫","甔","眈","砃","箪","簞","耼","耽","聃","聸","褝","襌","躭","郸","鄲","酖","頕"],"wèi wéi":["为"],"jǐng dǎn":["丼"],"lì lí":["丽"],jǔ:["举","弆","挙","擧","椇","榉","榘","櫸","欅","矩","筥","聥","舉","莒","蒟","襷","踽","齟","龃"],piě:["丿","苤","鐅","𬭯"],fú:["乀","伏","俘","凫","刜","匐","咈","哹","垘","孚","岪","巿","帗","幅","幞","弗","彿","怫","扶","柫","栿","桴","氟","泭","浮","涪","澓","炥","玸","甶","畉","癁","祓","福","稪","符","箙","紱","紼","絥","綍","绂","绋","罘","罦","翇","艀","芙","芣","苻","茀","茯","菔","葍","虙","蚨","蜉","蝠","袚","袱","襆","襥","諨","豧","踾","輻","辐","郛","鉘","鉜","韍","韨","颫","髴","鮄","鮲","鳧","鳬","鴔","鵩","黻"],"yí jí":["乁"],yì:["乂","义","亄","亦","亿","伇","伿","佾","俋","億","兿","刈","劓","劮","勚","勩","匇","呓","呭","呹","唈","囈","圛","坄","垼","埸","奕","嫕","嬑","寱","屹","峄","嶧","帟","帠","幆","廙","异","弈","弋","役","忆","怈","怿","悒","意","憶","懌","懿","抑","挹","敡","易","晹","曀","曎","杙","枍","棭","榏","槸","檍","歝","殔","殪","殹","毅","浂","浥","浳","湙","溢","潩","澺","瀷","炈","焲","熠","熤","熼","燚","燡","燱","獈","玴","異","疫","痬","瘗","瘞","瘱","癔","益","瞖","穓","竩","篒","縊","繶","繹","绎","缢","義","羿","翊","翌","翳","翼","耴","肄","肊","膉","臆","艗","艺","芅","苅","萟","蓺","薏","藙","藝","蘙","虉","蜴","螠","衪","袣","裔","裛","褹","襼","訲","訳","詍","詣","誼","譯","議","讛","议","译","诣","谊","豙","豛","豷","貖","贀","跇","轶","逸","邑","鄓","醷","釴","鈠","鎰","鐿","镒","镱","阣","隿","霬","饐","駅","驛","驿","骮","鮨","鶂","鶃","鶍","鷁","鷊","鷧","鷾","鸃","鹝","鹢","黓","齸","𬬩","㑊","𫄷","𬟁"],nǎi:["乃","倷","奶","嬭","廼","氖","疓","艿","迺","釢"],wǔ:["乄","五","仵","伍","侮","倵","儛","午","啎","妩","娬","嫵","庑","廡","忤","怃","憮","摀","武","潕","熓","牾","玝","珷","瑦","甒","碔","舞","躌","迕","逜","陚","鵡","鹉","𣲘"],jiǔ:["久","乆","九","乣","奺","杦","汣","灸","玖","紤","舏","酒","镹","韭","韮"],"tuō zhé":["乇","杔","馲"],"me mó ma yāo":["么"],zhī:["之","倁","卮","巵","搘","支","栀","梔","椥","榰","汁","泜","疷","祗","祬","秓","稙","綕","肢","胑","胝","脂","芝","蘵","蜘","衼","隻","鳷","鴲","鼅","𦭜"],"wū wù":["乌"],zhà:["乍","咤","宱","搾","榨","溠","痄","蚱","詐","诈","醡","霅","䃎"],hū:["乎","乯","匢","匫","呼","唿","嘑","垀","寣","幠","忽","惚","昒","歑","泘","淴","滹","烀","苸","虍","虖","謼","軤","轷","雐"],fá:["乏","伐","傠","坺","垡","墢","姂","栰","浌","瞂","笩","筏","罚","罰","罸","藅","閥","阀"],"lè yuè yào lào":["乐","樂"],yín:["乑","吟","噖","嚚","圁","垠","夤","婬","寅","峾","崟","崯","檭","殥","泿","淫","滛","烎","犾","狺","璌","硍","碒","荶","蔩","訔","訚","訡","誾","鄞","鈝","銀","银","霪","鷣","齦"],pīng:["乒","俜","娉","涄","甹","砯","聠","艵","頩"],pāng:["乓","滂","胮","膖","雱","霶"],qiáo:["乔","侨","僑","嫶","憔","桥","槗","樵","橋","櫵","犞","瞧","硚","礄","荍","荞","蕎","藮","譙","趫","鐈","鞒","鞽","顦"],hǔ:["乕","琥","萀","虎","虝","錿","鯱"],guāi:["乖"],"chéng shèng":["乗","乘","娍"],yǐ:["乙","乛","以","倚","偯","嬟","崺","已","庡","扆","攺","敼","旑","旖","檥","矣","礒","笖","舣","艤","苡","苢","蚁","螘","蟻","裿","踦","輢","轙","逘","酏","釔","鈘","鉯","钇","顗","鳦","齮","𫖮","𬺈"],"háo yǐ":["乚"],"niè miē":["乜"],qǐ:["乞","企","启","唘","啓","啔","啟","婍","屺","杞","棨","玘","盀","綺","绮","芑","諬","起","邔","闙"],yě:["也","冶","嘢","埜","壄","漜","野"],xí:["习","喺","媳","嶍","席","椺","檄","漝","習","蓆","袭","襲","覡","觋","謵","趘","郋","鎴","隰","霫","飁","騱","騽","驨","鰼","鳛","𠅤","𫘬"],xiāng:["乡","厢","廂","忀","楿","欀","湘","瓖","稥","箱","緗","缃","膷","芗","萫","葙","薌","襄","郷","鄉","鄊","鄕","鑲","镶","香","驤","骧","鱜","麘","𬙋"],shū:["书","倏","倐","儵","叔","姝","尗","抒","掓","摅","攄","書","枢","梳","樞","殊","殳","毹","毺","淑","瀭","焂","疎","疏","紓","綀","纾","舒","菽","蔬","踈","軗","輸","输","鄃","陎","鮛","鵨"],dǒu:["乧","抖","枓","蚪","鈄","阧","陡"],shǐ:["乨","使","兘","史","始","宩","屎","榁","矢","笶","豕","鉂","駛","驶"],jī:["乩","僟","击","刉","刏","剞","叽","唧","喞","嗘","嘰","圾","基","墼","姬","屐","嵆","嵇","撃","擊","朞","机","枅","樭","機","毄","激","犄","玑","璣","畸","畿","癪","矶","磯","积","積","笄","筓","箕","簊","緁","羁","羇","羈","耭","肌","芨","虀","覉","覊","譏","譤","讥","賫","賷","赍","跻","踑","躋","躸","銈","錤","鐖","鑇","鑙","隮","雞","鞿","韲","飢","饑","饥","魕","鳮","鶏","鶺","鷄","鸄","鸡","齎","齏","齑","𬯀","𫓯","𫓹","𫌀"],náng:["乪","嚢","欜","蠰","饢"],jiā:["乫","佳","傢","加","嘉","抸","枷","梜","毠","泇","浃","浹","犌","猳","珈","痂","笳","糘","耞","腵","葭","袈","豭","貑","跏","迦","鉫","鎵","镓","鴐","麚","𬂩"],jù:["乬","倨","倶","具","剧","劇","勮","埧","埾","壉","姖","屦","屨","岠","巨","巪","怇","惧","愳","懅","懼","拒","拠","昛","歫","洰","澽","炬","烥","犋","秬","窭","窶","簴","粔","耟","聚","虡","蚷","詎","讵","豦","距","踞","躆","遽","邭","醵","鉅","鐻","钜","颶","飓","駏","鮔"],shí:["乭","十","埘","塒","姼","实","実","寔","實","峕","嵵","时","旹","時","榯","湜","溡","炻","祏","竍","蚀","蝕","辻","遈","鉐","飠","饣","鮖","鰣","鲥","鼫","鼭"],mǎo:["乮","冇","卯","峁","戼","昴","泖","笷","蓩","鉚","铆"],mǎi:["买","嘪","荬","蕒","買","鷶"],luàn:["乱","亂","釠"],rǔ:["乳","擩","汝","肗","辱","鄏"],xué:["乴","学","學","峃","嶨","斈","泶","澩","燢","穴","茓","袕","踅","鷽","鸴"],yǎn:["䶮","乵","俨","偃","儼","兖","兗","厣","厴","噞","孍","嵃","巘","巚","弇","愝","戭","扊","抁","掩","揜","曮","椼","檿","沇","渷","演","琰","甗","眼","罨","萒","蝘","衍","褗","躽","遃","郾","隒","顩","魇","魘","鰋","鶠","黡","黤","黬","黭","黶","鼴","鼹","齴","龑","𬸘","𬙂","𪩘"],fǔ:["乶","俌","俛","俯","府","弣","抚","拊","撫","斧","椨","滏","焤","甫","盙","簠","腐","腑","蜅","輔","辅","郙","釜","釡","阝","頫","鬴","黼","㕮","𫖯"],shā:["乷","唦","杀","桬","殺","毮","猀","痧","砂","硰","紗","繺","纱","蔱","裟","鎩","铩","閷","髿","魦","鯊","鯋","鲨"],nǎ:["乸","雫"],qián:["乹","亁","仱","偂","前","墘","媊","岒","拑","掮","榩","橬","歬","潛","潜","濳","灊","箝","葥","虔","軡","鈐","鉗","銭","錢","鎆","钤","钱","钳","靬","騚","騝","鰬","黔","黚"],suǒ:["乺","唢","嗩","所","暛","溑","溹","琐","琑","瑣","索","褨","鎖","鎻","鏁","锁"],yú:["乻","于","亐","伃","余","堣","堬","妤","娛","娯","娱","嬩","崳","嵎","嵛","愚","扵","揄","旟","楡","楰","榆","欤","歈","歟","歶","渔","渝","湡","漁","澞","牏","狳","玗","玙","瑜","璵","盂","睮","窬","竽","籅","羭","腴","臾","舁","舆","艅","茰","萮","萸","蕍","蘛","虞","虶","蝓","螸","衧","褕","覦","觎","諛","謣","谀","踰","輿","轝","逾","邘","酑","鍝","隅","雓","雩","餘","馀","騟","骬","髃","魚","魣","鮽","鯲","鰅","鱼","鷠","鸆","齵"],zhù:["乼","伫","佇","住","坾","墸","壴","嵀","拀","杼","柱","樦","殶","注","炷","疰","眝","祝","祩","竚","筯","箸","篫","簗","紵","紸","纻","羜","翥","苎","莇","蛀","註","貯","贮","跓","軴","鉒","鋳","鑄","铸","馵","駐","驻"],zhě:["乽","者","褶","襵","赭","踷","鍺","锗"],"qián gān":["乾"],"zhì luàn":["乿"],guī:["亀","圭","妫","媯","嫢","嬀","帰","归","摫","椝","槻","槼","櫷","歸","珪","瑰","璝","瓌","皈","瞡","硅","茥","蘬","規","规","邽","郌","閨","闺","騩","鬶","鬹"],"lǐn lìn":["亃"],jué:["亅","决","刔","劂","匷","厥","噊","孒","孓","崛","崫","嶥","彏","憠","憰","戄","抉","挗","掘","攫","桷","橛","橜","欮","氒","決","灍","焳","熦","爑","爴","爵","獗","玃","玦","玨","珏","瑴","瘚","矍","矡","砄","絕","絶","绝","臄","芵","蕝","蕨","虳","蟨","蟩","觖","觮","觼","訣","譎","诀","谲","貜","赽","趉","蹷","躩","鈌","鐍","鐝","钁","镢","鴂","鴃","鷢","𫘝","㵐","𫔎"],"le liǎo":["了"],"gè mā":["亇"],"yǔ yú":["予","懙"],zhēng:["争","佂","凧","姃","媜","峥","崝","崢","征","徰","炡","烝","爭","狰","猙","癥","眐","睁","睜","筝","箏","篜","聇","脀","蒸","踭","鉦","錚","鏳","鬇"],èr:["二","刵","咡","弍","弐","樲","誀","貮","貳","贰","髶"],chù:["亍","傗","儊","怵","憷","搐","斶","歜","珿","琡","矗","竌","絀","绌","臅","触","觸","豖","鄐","閦","黜"],kuī:["亏","刲","岿","巋","盔","窥","窺","聧","虧","闚","顝"],yún:["云","伝","勻","匀","囩","妘","愪","抣","昀","橒","沄","涢","溳","澐","熉","畇","秐","筼","篔","紜","縜","纭","耘","芸","蒷","蕓","郧","鄖","鋆","雲"],hù:["互","冱","嗀","嚛","婟","嫭","嫮","岵","帍","弖","怙","戶","户","戸","戽","扈","护","昈","槴","沍","沪","滬","熩","瓠","祜","笏","簄","粐","綔","蔰","護","豰","鄠","鍙","頀","鱯","鳠","鳸","鸌","鹱"],qí:["亓","剘","埼","岐","岓","崎","嵜","愭","掑","斉","斊","旂","旗","棊","棋","檱","櫀","歧","淇","濝","猉","玂","琦","琪","璂","畦","疧","碁","碕","祁","祈","祺","禥","竒","簯","簱","籏","粸","綥","綦","肵","脐","臍","艩","芪","萁","萕","蕲","藄","蘄","蚑","蚚","蛴","蜝","蜞","螧","蠐","褀","軝","鄿","釮","錡","锜","陭","頎","颀","騎","騏","騹","骐","骑","鬐","鬿","鯕","鰭","鲯","鳍","鵸","鶀","麒","麡","𨙸","𬨂","䓫"],jǐng:["井","儆","刭","剄","坓","宑","幜","憬","暻","殌","汫","汬","澋","璄","璟","璥","穽","肼","蟼","警","阱","頚","頸"],sì:["亖","佀","価","儩","兕","嗣","四","姒","娰","孠","寺","巳","柶","榹","汜","泗","泤","洍","洠","涘","瀃","牭","祀","禩","竢","笥","耜","肂","肆","蕼","覗","貄","釲","鈶","鈻","飤","飼","饲","駟","騃","驷"],suì:["亗","嬘","岁","嵗","旞","檖","歲","歳","澻","煫","燧","璲","砕","碎","祟","禭","穂","穗","穟","繀","繐","繸","襚","誶","譢","谇","賥","邃","鐆","鐩","隧","韢","𫟦","𬭼"],gèn:["亘","亙","揯","搄","茛"],yà:["亚","亜","俹","冴","劜","圔","圠","埡","娅","婭","揠","氩","氬","犽","砑","稏","聐","襾","覀","訝","讶","迓","齾"],"xiē suò":["些"],"qí zhāi":["亝","齊"],"yā yà":["亞","压","垭","壓","铔"],"jí qì":["亟","焏"],tóu:["亠","投","頭","骰"],"wáng wú":["亡"],"kàng háng gāng":["亢"],dà:["亣","眔"],jiāo:["交","僬","娇","嬌","峧","嶕","嶣","憍","椒","浇","澆","焦","礁","穚","簥","胶","膠","膲","茭","茮","蕉","虠","蛟","蟭","跤","轇","郊","鐎","驕","骄","鮫","鲛","鵁","鷦","鷮","鹪","䴔"],hài:["亥","嗐","害","氦","餀","饚","駭","駴","骇"],"hēng pēng":["亨"],mǔ:["亩","姆","峔","拇","母","牡","牳","畂","畆","畒","畝","畞","畮","砪","胟","踇","鉧","𬭁","𧿹"],ye:["亪"],xiǎng:["享","亯","响","想","晑","蚃","蠁","響","飨","餉","饗","饷","鮝","鯗","鱶","鲞"],jīng:["京","亰","兢","坕","坙","婛","惊","旌","旍","晶","橸","泾","涇","猄","睛","秔","稉","粳","精","経","經","綡","聙","腈","茎","荆","荊","菁","葏","驚","鯨","鲸","鶁","鶄","麖","麠","鼱","䴖"],tíng:["亭","停","婷","嵉","庭","廷","楟","榳","筳","聤","莛","葶","蜓","蝏","諪","邒","霆","鼮","䗴"],liàng:["亮","喨","悢","晾","湸","諒","谅","輌","輛","辆","鍄"],"qīn qìng":["亲","親"],bó:["亳","仢","侼","僰","博","帛","愽","懪","挬","搏","欂","浡","淿","渤","煿","牔","狛","瓝","礴","秡","箔","簙","糪","胉","脖","膊","舶","艊","萡","葧","袯","襏","襮","謈","踣","郣","鈸","鉑","鋍","鎛","鑮","钹","铂","镈","餺","馎","馛","馞","駁","駮","驳","髆","鵓","鹁"],yòu:["亴","佑","佦","侑","又","右","哊","唀","囿","姷","宥","峟","幼","狖","祐","蚴","誘","诱","貁","迶","酭","釉","鼬"],xiè:["亵","伳","偞","偰","僁","卨","卸","噧","塮","夑","媟","屑","屧","廨","徢","懈","暬","械","榍","榭","泻","洩","渫","澥","瀉","瀣","灺","炧","炨","燮","爕","獬","祄","禼","糏","紲","絏","絬","繲","纈","绁","缷","薢","薤","蟹","蠏","褉","褻","謝","谢","躞","邂","靾","韰","齂","齘","齛","齥","𬹼","𤫉"],"dǎn dàn":["亶","馾"],lián:["亷","劆","匲","匳","嗹","噒","奁","奩","嫾","帘","廉","怜","憐","涟","漣","濂","濓","瀮","熑","燫","簾","籢","籨","縺","翴","联","聨","聫","聮","聯","臁","莲","蓮","薕","螊","蠊","裢","褳","覝","謰","蹥","连","連","鎌","鐮","镰","鬑","鰱","鲢"],duǒ:["亸","哚","嚲","埵","崜","朵","朶","綞","缍","趓","躱","躲","軃"],"wěi mén":["亹","斖"],rén:["人","亻","仁","壬","忈","忎","朲","秂","芢","魜","鵀"],jí:["亼","亽","伋","佶","偮","卙","即","卽","及","叝","吉","堲","塉","姞","嫉","岌","嵴","嶯","彶","忣","急","愱","戢","揤","极","棘","楫","極","槉","檝","殛","汲","湒","潗","疾","瘠","皍","笈","箿","籍","級","级","膌","艥","蒺","蕀","蕺","蝍","螏","襋","觙","谻","踖","蹐","躤","輯","轚","辑","郆","銡","鍓","鏶","集","雧","霵","鹡","㴔"],wáng:["亾","仼","兦","莣","蚟"],"shén shí":["什"],lè:["仂","叻","忇","氻","泐","玏","砳","簕","艻","阞","韷","餎","鰳","鱳","鳓"],dīng:["仃","叮","帄","玎","疔","盯","耵","虰","靪"],zè:["仄","崱","庂","捑","昃","昗","汄"],"jǐn jìn":["仅","僅","嫤"],"pú pū":["仆"],"chóu qiú":["仇"],zhǎng:["仉","幥","掌","礃"],jīn:["今","堻","巾","惍","斤","津","珒","琻","璡","砛","筋","荕","衿","襟","觔","金","釒","釿","钅","鹶","黅","𬬱"],bīng:["仌","仒","兵","冫","冰","掤","氷","鋲"],réng:["仍","礽","芿","辸","陾"],fó:["仏","坲","梻"],"jīn sǎn":["仐"],lún:["仑","伦","侖","倫","囵","圇","婨","崘","崙","棆","沦","淪","磮","腀","菕","蜦","踚","輪","轮","錀","陯","鯩","𬬭"],cāng:["仓","仺","倉","凔","嵢","沧","滄","濸","獊","舱","艙","苍","蒼","螥","鸧"],"zǎi zǐ zī":["仔"],tā:["他","塌","它","榙","溻","牠","祂","褟","趿","遢","闧"],fù:["付","偩","傅","冨","副","咐","坿","复","妇","婦","媍","嬔","富","復","椱","祔","禣","竎","緮","縛","缚","腹","萯","蕧","蚹","蛗","蝜","蝮","袝","複","覄","覆","訃","詂","讣","負","賦","賻","负","赋","赙","赴","輹","鍑","鍢","阜","附","馥","駙","驸","鮒","鰒","鲋","鳆","㳇"],xiān:["仙","仚","佡","僊","僲","先","嘕","奾","屳","廯","忺","憸","掀","暹","杴","氙","珗","祆","秈","籼","繊","纎","纖","苮","褼","襳","跹","蹮","躚","酰","鍁","锨","韯","韱","馦","鱻","鶱","𬸣"],"tuō chà duó":["仛"],hóng:["仜","吰","垬","妅","娂","宏","宖","弘","彋","汯","泓","洪","浤","渱","潂","玒","玜","竑","竤","篊","粠","紘","紭","綋","纮","翃","翝","耾","苰","荭","葒","葓","谹","谼","鈜","鉷","鋐","閎","闳","霐","霟","鞃","魟","鴻","鸿","黉","黌","𫟹","𬭎"],tóng:["仝","佟","哃","峂","峝","庝","彤","晍","曈","桐","氃","浵","潼","犝","獞","眮","瞳","砼","秱","童","粡","膧","茼","蚒","詷","赨","酮","鉖","鉵","銅","铜","餇","鮦","鲖","𫍣","𦒍"],rèn:["仞","仭","刃","刄","妊","姙","屻","岃","扨","牣","祍","紉","紝","絍","纫","纴","肕","腍","衽","袵","訒","認","认","讱","軔","轫","鈓","靭","靱","韌","韧","飪","餁","饪"],qiān:["仟","佥","僉","千","圲","奷","孯","岍","悭","愆","慳","扦","拪","搴","撁","攐","攑","攓","杄","櫏","汘","汧","牵","牽","竏","签","簽","籖","籤","粁","芊","茾","蚈","褰","諐","謙","谦","谸","迁","遷","釺","鈆","鉛","鏲","钎","阡","韆","顅","騫","骞","鬜","鬝","鵮","鹐"],"gǎn hàn":["仠"],"yì gē":["仡"],dài:["代","侢","叇","垈","埭","岱","帒","带","帯","帶","廗","怠","戴","曃","柋","殆","瀻","玳","瑇","甙","簤","紿","緿","绐","艜","蝳","袋","襶","貣","贷","蹛","軑","軚","軩","轪","迨","霴","靆","鴏","黛","黱"],"lìng líng lǐng":["令"],chào:["仦","耖","觘"],"cháng zhǎng":["仧","兏","長","长"],sā:["仨"],cháng:["仩","偿","償","嘗","嚐","嫦","尝","常","徜","瑺","瓺","甞","肠","腸","膓","苌","萇","镸","鱨","鲿"],yí:["仪","侇","儀","冝","匜","咦","圯","夷","姨","宐","宜","宧","寲","峓","嶬","嶷","巸","彛","彜","彝","彞","怡","恞","扅","暆","栘","椬","椸","沂","洟","熪","瓵","痍","移","簃","籎","羠","胰","萓","蛦","螔","觺","謻","貽","贻","跠","迻","遺","鏔","頉","頤","頥","顊","颐","饴","鮧","鴺"],mù:["仫","凩","募","墓","幕","幙","慔","慕","暮","暯","木","楘","毣","沐","炑","牧","狇","目","睦","穆","艒","苜","莯","蚞","鉬","钼","雮","霂"],"men mén":["们"],fǎn:["仮","反","橎","返"],"chào miǎo":["仯"],"yǎng áng":["仰"],zhòng:["仲","众","堹","妕","媑","狆","眾","祌","筗","茽","蚛","衆","衶","諥"],"pǐ pí":["仳"],wò:["仴","偓","卧","媉","幄","握","楃","沃","渥","濣","瓁","瞃","硪","肟","腛","臥","齷","龌"],jiàn:["件","俴","健","僭","剑","剣","剱","劍","劎","劒","劔","墹","寋","建","徤","擶","旔","楗","毽","洊","涧","澗","牮","珔","瞷","磵","礀","箭","糋","繝","腱","臶","舰","艦","荐","薦","覸","諓","諫","譛","谏","賎","賤","贱","趝","践","踐","踺","轞","鉴","鍳","鍵","鐱","鑑","鑒","鑬","鑳","键","間","餞","饯","𬣡"],"jià jiè jie":["价"],"yǎo fó":["仸"],"rèn rén":["任"],"fèn bīn":["份"],dī:["仾","低","啲","埞","堤","岻","彽","樀","滴","磾","秪","羝","袛","趆","隄","鞮","䃅"],fǎng:["仿","倣","旊","昉","昘","瓬","眆","紡","纺","舫","訪","访","髣","鶭"],zhōng:["伀","刣","妐","幒","彸","忠","柊","汷","泈","炂","盅","籦","終","终","舯","蔠","蜙","螤","螽","衳","衷","蹱","鈡","鍾","鐘","钟","锺","鴤","鼨"],pèi:["伂","佩","姵","帔","斾","旆","沛","浿","珮","蓜","轡","辔","配","霈","馷"],diào:["伄","吊","弔","掉","瘹","盄","窎","窵","竨","訋","釣","鈟","銱","鋽","鑃","钓","铞","雿","魡"],dùn:["伅","潡","炖","燉","盾","砘","碷","踲","逇","遁","遯","鈍","钝"],wěn:["伆","刎","吻","呅","抆","桽","稳","穏","穩","紊","肳","脗"],xǐn:["伈"],kàng:["伉","匟","囥","抗","炕","鈧","钪"],ài:["伌","僾","塧","壒","嫒","嬡","愛","懓","暧","曖","爱","瑷","璦","皧","瞹","砹","硋","碍","礙","薆","譺","賹","鑀","隘","靉","餲","馤","鱫","鴱"],"jì qí":["伎","薺"],"xiū xǔ":["休"],"jìn yín":["伒"],dǎn:["伔","刐","撢","玬","瓭","紞","胆","膽","衴","賧","赕","黕","𬘘"],fū:["伕","呋","娐","孵","尃","怤","懯","敷","旉","玞","砆","稃","筟","糐","綒","肤","膚","荂","荴","衭","趺","跗","邞","鄜","酜","鈇","麩","麬","麱","麸","𫓧"],tǎng:["伖","傥","儻","埫","戃","曭","爣","矘","躺","鎲","钂","镋"],yōu:["优","優","呦","嚘","峳","幽","忧","悠","憂","攸","櫌","滺","瀀","纋","羪","耰","逌","鄾","麀"],huǒ:["伙","夥","火","煷","邩","鈥","钬"],"huì kuài":["会","會","浍","璯"],yǔ:["伛","俁","俣","偊","傴","匬","噳","圄","圉","宇","寙","屿","嶼","庾","挧","敔","斞","楀","瑀","瘐","祤","禹","穥","窳","羽","與","萭","貐","鄅","頨","麌","齬","龉","㺄"],cuì:["伜","啛","忰","悴","毳","淬","焠","疩","瘁","竁","粋","粹","紣","綷","翆","翠","脃","脆","脺","膬","膵","臎","萃","襊","顇"],sǎn:["伞","傘","糤","繖","饊","馓"],wěi:["伟","伪","偉","偽","僞","儰","娓","寪","屗","崣","嶉","徫","愇","捤","暐","梶","洧","浘","渨","炜","煒","猥","玮","瑋","痿","緯","纬","腲","艉","芛","苇","荱","萎","葦","蒍","蔿","蜼","諉","诿","踓","鍡","韑","韙","韡","韪","頠","颹","骩","骪","骫","鮪","鲔","𫇭","𬀩","𬱟"],"chuán zhuàn":["传","傳"],"chē jū":["伡","俥","车"],"jū chē":["車"],yá:["伢","厑","厓","堐","岈","崕","崖","涯","漄","牙","玡","琊","睚","笌","芽","蚜","衙","齖"],qiàn:["伣","俔","倩","儙","刋","壍","嬱","悓","棈","椠","槧","欠","歉","皘","篏","篟","縴","芡","蒨","蔳","輤","𬘬"],shāng:["伤","傷","商","墒","慯","殇","殤","滳","漡","熵","蔏","螪","觞","觴","謪","鬺"],chāng:["伥","倀","娼","昌","椙","淐","猖","琩","菖","裮","錩","锠","閶","阊","鯧","鲳","鼚"],"chen cāng":["伧"],xùn:["伨","侚","卂","噀","巺","巽","徇","愻","殉","殾","汛","潠","狥","蕈","訊","訓","訙","训","讯","迅","迿","逊","遜","鑂","顨","馴","驯"],xìn:["伩","囟","孞","脪","舋","衅","訫","釁","阠","顖"],chǐ:["伬","侈","卶","叺","呎","垑","恥","歯","耻","肔","胣","蚇","裭","褫","豉","鉹","齒","齿"],"xián xuán":["伭"],"nú nǔ":["伮"],"bó bǎi":["伯"],"gū gù":["估"],nǐ:["伱","你","儞","孴","拟","擬","旎","晲","狔","苨","薿","隬"],"nì ní":["伲"],bàn:["伴","办","半","姅","怑","扮","瓣","秚","絆","绊","辦","鉡","靽"],xù:["伵","侐","勖","勗","卹","叙","垿","壻","婿","序","恤","敍","敘","旭","昫","朂","槒","欰","殈","汿","沀","洫","溆","漵","潊","烅","烼","煦","獝","珬","盢","瞁","稸","絮","続","緒","緖","續","绪","续","聓","聟","蓄","藚","訹","賉","酗","頊","鱮","㳚"],zhòu:["伷","僽","冑","呪","咒","咮","宙","昼","晝","甃","皱","皺","籀","籒","籕","粙","紂","縐","纣","绉","胄","荮","葤","詋","酎","駎","驟","骤","㤘","㑇"],shēn:["伸","侁","兟","呻","堔","妽","娠","屾","峷","扟","敒","曑","柛","氠","深","燊","珅","甡","甧","申","眒","砷","穼","籶","籸","糂","紳","绅","罙","罧","葠","蓡","蔘","薓","裑","訷","詵","诜","身","駪","鯓","鯵","鰺","鲹","鵢","𬳽"],qū:["伹","佉","匤","呿","坥","屈","岖","岴","嶇","憈","抾","敺","浀","煀","祛","筁","粬","胠","蛆","蛐","袪","覻","詘","诎","趍","躯","軀","阹","駆","駈","驅","驱","髷","魼","鰸","鱋","鶌","麯","麴","麹","黢","㭕","𪨰","䓛"],"sì cì":["伺"],bēng:["伻","嘣","奟","崩","嵭","閍"],"sì shì":["似"],"jiā qié gā":["伽"],"yǐ chì":["佁"],"diàn tián":["佃","钿"],"hān gàn":["佄"],mài:["佅","劢","勱","卖","唛","売","脈","衇","賣","迈","邁","霡","霢","麥","麦","鿏"],dàn:["但","僤","啖","啗","啿","噉","嚪","帎","憺","旦","柦","氮","沊","泹","淡","狚","疍","癚","禫","窞","腅","萏","蓞","蛋","蜑","觛","訑","誕","诞","贉","霮","餤","饏","駳","髧","鴠","𫢸"],bù:["佈","勏","吥","咘","埗","埠","布","廍","怖","悑","步","歨","歩","瓿","篰","荹","蔀","踄","部","郶","鈈","钚","餢"],bǐ:["佊","俾","匕","夶","妣","彼","朼","柀","比","毞","沘","疕","秕","笔","筆","粃","聛","舭","貏","鄙"],"zhāo shào":["佋"],cǐ:["佌","此","泚","皉","𫚖"],wèi:["位","卫","味","喂","墛","媦","慰","懀","未","渭","煟","熭","犚","猬","畏","緭","罻","胃","苿","菋","藯","蘶","蝟","螱","衛","衞","褽","謂","讆","讏","谓","躗","躛","軎","轊","鏏","霨","餧","餵","饖","魏","鮇","鳚"],zuǒ:["佐","左","繓"],yǎng:["佒","傟","养","坱","岟","慃","懩","攁","氧","氱","炴","痒","癢","礢","紻","蝆","軮","養","駚"],"tǐ tī":["体","體"],zhàn:["佔","偡","嶘","战","戦","戰","栈","桟","棧","湛","站","綻","绽","菚","蘸","虥","虦","譧","轏","驏"],"hé hē hè":["何"],bì:["佖","咇","哔","嗶","坒","堛","壁","奰","妼","婢","嬖","币","幣","幤","庇","庳","廦","弊","弻","弼","彃","必","怭","愊","愎","敝","斃","梐","毕","毖","毙","湢","滗","滭","潷","煏","熚","狴","獘","獙","珌","璧","畀","畢","疪","痹","痺","皕","睤","碧","筚","箅","箆","篦","篳","粊","綼","縪","繴","罼","腷","苾","荜","萆","萞","蓖","蓽","蔽","薜","蜌","袐","襅","襞","襣","觱","詖","诐","貱","贔","赑","跸","蹕","躃","躄","避","邲","鄨","鄪","鉍","鏎","鐴","铋","閇","閉","閟","闭","陛","韠","飶","饆","馝","駜","驆","髀","魓","鮅","鷝","鷩","鼊"],tuó:["佗","坨","堶","岮","槖","橐","沱","砣","砤","碢","紽","詑","跎","酡","阤","陀","陁","駝","駞","騨","驒","驝","驼","鮀","鴕","鸵","鼉","鼍","鼧","𬶍"],shé:["佘","舌","虵","蛥"],"yì dié":["佚","昳","泆","軼"],"fó fú bì bó":["佛"],"zuò zuō":["作"],gōu:["佝","沟","溝","痀","篝","簼","緱","缑","袧","褠","鈎","鉤","钩","鞲","韝"],nìng:["佞","侫","倿","寕","泞","澝","濘"],qú:["佢","劬","戵","斪","欋","欔","氍","淭","灈","爠","璖","璩","癯","磲","籧","絇","胊","臞","菃","葋","蕖","蘧","蟝","蠷","蠼","衐","衢","躣","軥","鑺","鴝","鸜","鸲","鼩"],"yōng yòng":["佣"],wǎ:["佤","咓","砙","邷"],kǎ:["佧","垰","胩","裃","鉲"],bāo:["佨","勹","包","孢","煲","笣","胞","苞","蕔","裦","褒","襃","闁","齙","龅"],"huái huí":["佪"],"gé hè":["佫"],lǎo:["佬","咾","恅","栳","狫","珯","硓","老","耂","荖","蛯","轑","銠","铑","鮱"],xiáng:["佭","庠","栙","祥","絴","翔","詳","跭"],gé:["佮","匌","呄","嗝","塥","愅","挌","搿","槅","櫊","滆","膈","臵","茖","觡","諽","輵","轕","閣","阁","隔","鞷","韐","韚","騔","骼","鮯"],yáng:["佯","劷","垟","崸","徉","扬","揚","敭","旸","昜","暘","杨","楊","洋","炀","珜","疡","瘍","眻","蛘","諹","輰","鍚","钖","阦","阳","陽","霷","颺","飏","鰑","鴹","鸉"],bǎi:["佰","捭","摆","擺","栢","百","竡","粨","襬"],fǎ:["佱","峜","法","灋","砝","鍅"],mǐng:["佲","凕","姳","慏","酩"],"èr nài":["佴"],hěn:["佷","很","狠","詪","𬣳"],huó:["佸","活"],guǐ:["佹","匦","匭","厬","垝","姽","宄","庋","庪","恑","晷","湀","癸","祪","簋","蛫","蟡","觤","詭","诡","軌","轨","陒","鬼"],quán:["佺","全","啳","埢","姾","峑","巏","拳","搼","权","楾","権","權","泉","洤","湶","牷","犈","瑔","痊","硂","筌","縓","荃","葲","蜷","蠸","觠","詮","诠","跧","踡","輇","辁","醛","銓","铨","闎","顴","颧","駩","騡","鬈","鰁","鳈","齤"],tiāo:["佻","庣","旫","祧","聎"],jiǎo:["佼","儌","孂","挢","搅","撟","撹","攪","敫","敽","敿","晈","暞","曒","灚","燞","狡","璬","皎","皦","絞","纐","绞","腳","臫","蟜","譑","賋","踋","鉸","铰","餃","饺","鱎","龣"],cì:["佽","刾","庛","朿","栨","次","絘","茦","莿","蛓","螆","賜","赐"],xíng:["侀","刑","哘","型","娙","形","洐","硎","蛵","邢","郉","鈃","鉶","銒","钘","铏","陉","陘","餳","𫰛"],tuō:["侂","咃","咜","圫","托","拕","拖","汑","脫","脱","莌","袥","託","讬","飥","饦","魠","鮵"],kǎn:["侃","偘","冚","坎","惂","砍","莰","輡","轗","顑"],zhí:["侄","値","值","埴","執","姪","嬂","戠","执","摭","植","樴","淔","漐","直","禃","絷","縶","聀","职","職","膱","蟙","跖","踯","蹠","躑","軄","釞","馽"],gāi:["侅","垓","姟","峐","晐","畡","祴","荄","該","该","豥","賅","賌","赅","陔"],lái:["來","俫","倈","崃","崍","庲","来","梾","棶","涞","淶","猍","琜","筙","箂","莱","萊","逨","郲","錸","铼","騋","鯠","鶆","麳"],kuǎ:["侉","咵","垮","銙"],gōng:["侊","公","功","匑","匔","塨","宫","宮","工","幊","弓","恭","攻","杛","碽","糼","糿","肱","觥","觵","躬","躳","髸","龔","龚","䢼"],lì:["例","俐","俪","傈","儮","儷","凓","利","力","励","勵","历","厉","厤","厯","厲","叓","吏","呖","唎","唳","嚦","囇","坜","塛","壢","娳","婯","屴","岦","悧","悷","慄","戾","搮","暦","曆","曞","朸","枥","栃","栗","栛","檪","櫔","櫪","欐","歴","歷","沥","沴","涖","溧","濿","瀝","爏","犡","猁","珕","瑮","瓅","瓑","瓥","疬","痢","癧","盭","睙","砅","砺","砾","磿","礪","礫","礰","禲","秝","立","笠","篥","粒","粝","糲","脷","苈","茘","荔","莅","莉","蒚","蒞","藶","蚸","蛎","蛠","蜧","蝷","蠇","蠣","詈","讈","赲","轢","轣","轹","酈","鉝","隶","隷","雳","靂","靋","鬁","鳨","鴗","鷅","麜","𫵷","𬍛"],yīn:["侌","凐","喑","噾","囙","因","垔","堙","姻","婣","愔","慇","栶","氤","洇","溵","濦","瘖","禋","秵","筃","絪","緸","茵","蒑","蔭","裀","諲","銦","铟","闉","阥","阴","陰","陻","隂","霒","霠","鞇","音","韾","駰","骃","齗","𬘡","𬤇","𬮱"],mǐ:["侎","孊","弭","敉","洣","渳","灖","米","粎","羋","脒","芈","葞","蔝","銤"],zhū:["侏","株","槠","橥","櫧","櫫","洙","潴","瀦","猪","珠","硃","秼","絑","茱","蕏","蛛","蝫","蠩","袾","誅","諸","诛","诸","豬","跦","邾","銖","铢","駯","鮢","鯺","鴸","鼄"],ān:["侒","偣","媕","安","峖","庵","桉","氨","盦","盫","腤","菴","萻","葊","蓭","誝","諳","谙","鞌","鞍","韽","馣","鮟","鵪","鶕","鹌","𩽾"],lù:["侓","僇","勎","勠","圥","坴","塶","娽","峍","廘","彔","录","戮","摝","椂","樚","淕","淥","渌","漉","潞","琭","璐","甪","盝","睩","硉","祿","禄","稑","穋","箓","簏","簬","簵","簶","籙","粶","蔍","蕗","虂","螰","賂","赂","趢","路","踛","蹗","輅","轆","辂","辘","逯","醁","錄","録","錴","鏴","陸","騄","騼","鯥","鴼","鵦","鵱","鷺","鹭","鹿","麓","𫘧"],móu:["侔","劺","恈","眸","蛑","謀","谋","踎","鍪","鴾","麰"],ér:["侕","儿","児","兒","峏","栭","洏","粫","而","胹","荋","袻","輀","轜","陑","隭","髵","鮞","鲕","鴯","鸸"],"dòng tǒng tóng":["侗"],chà:["侘","奼","姹","岔","汊","詫","诧"],chì:["侙","傺","勅","勑","叱","啻","彳","恜","慗","憏","懘","抶","敕","斥","杘","湁","灻","炽","烾","熾","痓","痸","瘛","翄","翅","翤","翨","腟","赤","趩","遫","鉓","雴","飭","饬","鶒","鷘"],"gòng gōng":["供","共"],zhōu:["侜","周","喌","州","徟","洲","淍","炿","烐","珘","矪","舟","謅","譸","诌","賙","赒","輈","輖","辀","週","郮","銂","霌","駲","騆","鵃","鸼"],rú:["侞","儒","嚅","如","嬬","孺","帤","曘","桇","渪","濡","筎","茹","蕠","薷","蝡","蠕","袽","襦","邚","醹","銣","铷","顬","颥","鱬","鴑","鴽"],"jiàn cún":["侟"],xiá:["侠","俠","匣","峡","峽","敮","暇","柙","炠","烚","狎","狭","狹","珨","瑕","硖","硤","碬","祫","筪","縖","翈","舝","舺","蕸","赮","轄","辖","遐","鍜","鎋","陜","陿","霞","騢","魻","鶷","黠"],lǚ:["侣","侶","儢","吕","呂","屡","屢","履","挔","捛","旅","梠","焒","祣","稆","穭","絽","縷","缕","膂","膐","褛","褸","郘","鋁","铝"],ta:["侤"],"jiǎo yáo":["侥","僥","徺"],zhēn:["侦","偵","寊","帧","帪","幀","搸","斟","桢","楨","榛","樼","殝","浈","湞","潧","澵","獉","珍","珎","瑧","甄","眞","真","砧","碪","祯","禎","禛","箴","胗","臻","葴","蒖","蓁","薽","貞","贞","轃","遉","酙","針","鉁","錱","鍼","针","鱵"],"cè zè zhāi":["侧","側"],kuài:["侩","儈","凷","哙","噲","圦","块","塊","巜","廥","快","旝","欳","狯","獪","筷","糩","脍","膾","郐","鄶","鱠","鲙"],chái:["侪","儕","喍","柴","犲","祡","豺"],nóng:["侬","儂","农","哝","噥","檂","欁","浓","濃","燶","禯","秾","穠","脓","膿","蕽","襛","譨","農","辳","醲","鬞","𬪩"],jǐn:["侭","儘","卺","厪","巹","槿","漌","瑾","紧","緊","菫","蓳","謹","谨","錦","锦","饉","馑"],"hóu hòu":["侯","矦"],jiǒng:["侰","僒","冏","囧","泂","澃","炯","烱","煚","煛","熲","燛","窘","綗","褧","迥","逈","顈","颎","䌹"],"chěng tǐng":["侱"],"zhèn zhēn":["侲","揕"],zuò:["侳","做","唑","坐","岝","岞","座","祚","糳","胙","葃","葄","蓙","袏","阼"],qīn:["侵","兓","媇","嵚","嶔","欽","衾","誛","钦","顉","駸","骎","鮼"],jú:["侷","啹","婅","局","巈","椈","橘","泦","淗","湨","焗","犑","狊","粷","菊","蘜","趜","跼","蹫","輂","郹","閰","駶","驧","鵙","鵴","鶪","鼰","鼳","䴗"],"shù dōu":["侸"],tǐng:["侹","圢","娗","挺","涏","烶","珽","脡","艇","誔","頲","颋"],shèn:["侺","愼","慎","昚","涁","渗","滲","瘆","瘮","眘","祳","肾","胂","脤","腎","蜃","蜄","鋠"],"tuì tuó":["侻"],nán:["侽","喃","娚","抩","暔","枏","柟","楠","男","畘","莮","萳","遖"],xiāo:["侾","哓","嘵","嚻","囂","婋","宯","宵","庨","彇","揱","枭","枵","梟","櫹","歊","毊","消","潇","瀟","灱","灲","烋","焇","猇","獢","痚","痟","硝","硣","窙","箫","簘","簫","綃","绡","翛","膮","萧","蕭","虈","虓","蟂","蟏","蟰","蠨","踃","逍","銷","销","霄","颵","驍","骁","髇","髐","魈","鴞","鴵","鷍","鸮"],"biàn pián":["便","緶","缏"],tuǐ:["俀","腿","蹆","骽"],xì:["係","匸","卌","呬","墍","屃","屓","屭","忥","怬","恄","椞","潝","潟","澙","熂","犔","磶","禊","細","綌","縘","细","绤","舃","舄","蕮","虩","衋","覤","赩","趇","郤","釳","阋","隙","隟","霼","餼","饩","鬩","黖"],cù:["促","媨","憱","猝","瘄","瘯","簇","縬","脨","蔟","誎","趗","踧","踿","蹙","蹴","蹵","醋","顣","鼀"],é:["俄","囮","娥","峉","峨","峩","涐","珴","皒","睋","磀","莪","訛","誐","譌","讹","迗","鈋","鋨","锇","頟","額","额","魤","鵝","鵞","鹅"],qiú:["俅","叴","唒","囚","崷","巯","巰","扏","梂","殏","毬","求","汓","泅","浗","湭","煪","犰","玌","球","璆","皳","盚","紌","絿","肍","芁","莍","虬","虯","蛷","裘","觓","觩","訄","訅","賕","赇","逎","逑","遒","酋","釚","釻","銶","頄","鮂","鯄","鰽","鼽","𨱇"],xú:["俆","徐","禑"],"guàng kuāng":["俇"],kù:["俈","喾","嚳","库","庫","廤","瘔","絝","绔","袴","裤","褲","酷"],wù:["俉","务","務","勿","卼","坞","塢","奦","婺","寤","屼","岉","嵨","忢","悞","悟","悮","戊","扤","晤","杌","溩","焐","熃","物","痦","矹","窹","粅","蘁","誤","误","鋈","阢","隖","雾","霚","霧","靰","騖","骛","鶩","鹜","鼿","齀"],jùn:["俊","儁","呁","埈","寯","峻","懏","捃","攟","晙","棞","燇","珺","畯","竣","箟","蜠","賐","郡","陖","餕","馂","駿","骏","鵔","鵕","鵘","䐃"],liáng:["俍","墚","梁","椋","樑","粮","粱","糧","良","輬","辌","𫟅"],zǔ:["俎","唨","爼","祖","組","组","詛","诅","鎺","阻","靻"],"qiào xiào":["俏"],yǒng:["俑","勇","勈","咏","埇","塎","嵱","彮","怺","恿","悀","惥","愑","愹","慂","柡","栐","永","泳","湧","甬","蛹","詠","踊","踴","鯒","鲬"],hùn:["俒","倱","圂","尡","慁","掍","溷","焝","睴","觨","諢","诨"],jìng:["俓","傹","境","妌","婙","婧","弪","弳","径","徑","敬","曔","桱","梷","浄","瀞","獍","痉","痙","竞","竟","竫","競","竸","胫","脛","莖","誩","踁","迳","逕","鏡","镜","靖","静","靜","鵛"],sàn:["俕","閐"],pěi:["俖"],sú:["俗"],xī:["俙","僖","兮","凞","卥","厀","吸","唏","唽","嘻","噏","嚱","夕","奚","嬆","嬉","屖","嵠","巇","希","徆","徯","息","悉","悕","惁","惜","昔","晞","晰","晳","曦","析","桸","榽","樨","橀","欷","氥","汐","浠","淅","渓","溪","烯","焁","焈","焟","熄","熈","熙","熹","熺","熻","燨","爔","牺","犀","犠","犧","琋","瘜","皙","睎","瞦","矽","硒","磎","礂","稀","穸","窸","粞","糦","緆","繥","羲","翕","翖","肸","肹","膝","舾","莃","菥","蒠","蜥","螅","蟋","蠵","西","觹","觽","觿","譆","谿","豀","豨","豯","貕","赥","邜","鄎","酅","醯","釸","錫","鏭","鐊","鑴","锡","隵","餏","饎","饻","鯑","鵗","鸂","鼷"],lǐ:["俚","娌","峢","峲","李","欚","浬","澧","理","礼","禮","粴","裏","裡","豊","逦","邐","醴","鋰","锂","鯉","鱧","鱱","鲤","鳢"],bǎo:["保","堢","媬","宝","寚","寳","寶","珤","緥","葆","藵","褓","賲","靌","飹","飽","饱","駂","鳵","鴇","鸨"],"yú shù yù":["俞"],"sì qí":["俟"],"xìn shēn":["信"],xiū:["俢","修","咻","庥","樇","烌","羞","脙","脩","臹","貅","銝","鎀","飍","饈","馐","髤","髹","鮴","鱃","鵂","鸺","䗛"],dì:["俤","偙","僀","埊","墑","墬","娣","帝","怟","旳","梊","焍","玓","甋","眱","睇","碲","祶","禘","第","締","缔","腣","菂","蒂","蔕","蝃","蝭","螮","諦","谛","踶","递","逓","遞","遰","鉪","𤧛","䗖"],chóu:["俦","儔","嬦","惆","愁","懤","栦","燽","畴","疇","皗","稠","筹","籌","絒","綢","绸","菗","詶","讎","讐","踌","躊","酧","酬","醻","雔","雠","雦"],zhì:["俧","偫","儨","制","劕","垁","娡","寘","帙","帜","幟","庢","庤","廌","彘","徏","徝","志","忮","懥","懫","挃","挚","掷","摯","擲","旘","晊","智","栉","桎","梽","櫍","櫛","治","洷","滍","滞","滯","潌","瀄","炙","熫","狾","猘","璏","瓆","痔","痣","礩","祑","秩","秷","稚","稺","穉","窒","紩","緻","置","翐","膣","至","致","芖","蛭","袟","袠","製","覟","觗","觯","觶","誌","豑","豒","貭","質","贄","质","贽","跱","踬","躓","輊","轾","郅","銍","鋕","鑕","铚","锧","陟","隲","雉","駤","騭","騺","驇","骘","鯯","鴙","鷙","鸷","𬃊"],"liǎ liǎng":["俩"],jiǎn:["俭","倹","儉","减","剪","堿","弿","彅","戩","戬","拣","挸","捡","揀","撿","枧","柬","梘","检","検","檢","減","湕","瀽","瑐","睑","瞼","硷","碱","礆","笕","筧","简","簡","絸","繭","翦","茧","藆","蠒","裥","襇","襉","襺","詃","謇","謭","譾","谫","趼","蹇","鐗","鬋","鰎","鹸","鹻","鹼"],huò:["俰","咟","嚯","嚿","奯","彠","惑","或","擭","旤","曤","檴","沎","湱","瀖","獲","癨","眓","矐","祸","禍","穫","窢","耯","臛","艧","获","蒦","藿","蠖","謋","貨","货","鍃","鑊","镬","雘","霍","靃","韄","㸌"],"jù jū":["俱","据","鋸","锯"],xiào:["俲","傚","効","咲","哮","啸","嘋","嘨","嘯","孝","效","斅","斆","歗","涍","熽","笑","詨","誟"],pái:["俳","徘","牌","犤","猅","簰","簲","輫"],biào:["俵","鰾","鳔"],"chù tì":["俶"],fèi:["俷","剕","厞","吠","屝","废","廃","廢","昲","曊","櫠","沸","濷","狒","癈","肺","萉","費","费","鐨","镄","陫","靅","鼣"],fèng:["俸","凤","奉","湗","焨","煈","賵","赗","鳯","鳳","鴌"],ǎn:["俺","唵","埯","揞","罯","銨","铵"],bèi:["俻","倍","偝","偹","備","僃","备","悖","惫","愂","憊","昁","梖","焙","牬","犕","狈","狽","珼","琲","碚","禙","糒","苝","蓓","蛽","褙","貝","贝","軰","輩","辈","邶","郥","鄁","鋇","鐾","钡","鞁","鞴","𬇙"],yù:["俼","儥","喅","喩","喻","域","堉","妪","嫗","寓","峪","嶎","庽","彧","御","愈","慾","戫","昱","棛","棜","棫","櫲","欎","欝","欲","毓","浴","淯","滪","潏","澦","灪","焴","煜","燏","燠","爩","狱","獄","玉","琙","瘉","癒","砡","硢","硲","礇","礖","礜","禦","秗","稢","稶","篽","籞","籲","粖","緎","罭","聿","肀","艈","芋","芌","茟","蒮","蓣","蓹","蕷","蘌","蜟","蜮","袬","裕","誉","諭","譽","谕","豫","軉","輍","逳","遇","遹","郁","醧","鈺","鋊","錥","鐭","钰","閾","阈","雤","霱","預","预","飫","饇","饫","馭","驈","驭","鬰","鬱","鬻","魊","鱊","鳿","鴥","鴧","鴪","鵒","鷸","鸒","鹆","鹬"],xīn:["俽","噺","妡","嬜","廞","心","忄","忻","惞","新","昕","杺","欣","歆","炘","盺","薪","訢","辛","邤","鈊","鋅","鑫","锌","馨","馫","䜣","𫷷"],"hǔ chí":["俿"],jiù:["倃","僦","匓","匛","匶","厩","咎","就","廄","廏","廐","慦","捄","救","旧","柩","柾","桕","欍","殧","疚","臼","舅","舊","鯦","鷲","鹫","麔","齨","㠇"],yáo:["倄","傜","嗂","垚","堯","姚","媱","尧","尭","峣","嶢","嶤","徭","揺","搖","摇","摿","暚","榣","烑","爻","猺","珧","瑤","瑶","磘","窑","窯","窰","肴","蘨","謠","謡","谣","軺","轺","遙","遥","邎","顤","颻","飖","餆","餚","鰩","鱙","鳐"],"cuì zú":["倅"],"liǎng liǎ":["倆"],wǎn:["倇","唍","婉","惋","挽","晚","晥","晩","晼","梚","椀","琬","畹","皖","盌","碗","綩","綰","绾","脘","萖","踠","輓","鋔"],zǒng:["倊","偬","傯","嵸","总","惣","捴","搃","摠","燪","総","緫","縂","總","蓗"],guān:["倌","关","官","棺","瘝","癏","窤","蒄","関","闗","關","鰥","鱞","鳏"],tiǎn:["倎","唺","忝","悿","晪","殄","淟","睓","腆","舔","覥","觍","賟","錪","餂"],mén:["們","扪","捫","璊","菛","虋","鍆","钔","門","閅","门","𫞩"],"dǎo dào":["倒"],"tán tàn":["倓","埮"],"juè jué":["倔"],chuí:["倕","垂","埀","捶","搥","桘","棰","槌","箠","腄","菙","錘","鎚","锤","陲","顀"],xìng:["倖","姓","婞","嬹","幸","性","悻","杏","涬","緈","臖","荇","莕","葕"],péng:["倗","傰","塜","塳","弸","憉","捀","朋","棚","椖","樥","硼","稝","竼","篷","纄","膨","芃","蓬","蘕","蟚","蟛","袶","輣","錋","鑝","韸","韼","騯","髼","鬅","鬔","鵬","鹏"],"tǎng cháng":["倘"],hòu:["候","厚","后","垕","堠","後","洉","茩","豞","逅","郈","鮜","鱟","鲎","鲘"],tì:["倜","剃","嚏","嚔","屉","屜","悌","悐","惕","惖","戻","掦","替","朑","歒","殢","涕","瓋","笹","籊","薙","褅","逖","逷","髰","鬀","鬄"],gàn:["倝","凎","幹","榦","檊","淦","灨","盰","紺","绀","詌","贑","赣","骭","㽏"],"liàng jìng":["倞","靓"],suī:["倠","哸","夊","滖","濉","眭","睢","芕","荽","荾","虽","雖","鞖"],"chàng chāng":["倡"],jié:["倢","偼","傑","刦","刧","刼","劫","劼","卩","卪","婕","媫","孑","岊","崨","嵥","嶻","巀","幯","截","捷","掶","擮","昅","杢","杰","桀","桝","楬","楶","榤","洁","滐","潔","狤","睫","礍","竭","節","羯","莭","蓵","蛣","蜐","蠘","蠞","蠽","衱","袺","訐","詰","誱","讦","踕","迼","鉣","鍻","镼","頡","鮚","鲒","㛃"],"kǒng kōng":["倥"],juàn:["倦","劵","奆","慻","桊","淃","狷","獧","眷","睊","睠","絭","絹","绢","罥","羂","腃","蔨","鄄","餋"],zōng:["倧","堫","宗","嵏","嵕","惾","朡","棕","椶","熧","猣","磫","緃","翪","腙","葼","蝬","豵","踨","踪","蹤","鍐","鑁","騌","騣","骔","鬃","鬉","鬷","鯮","鯼"],ní:["倪","坭","埿","尼","屔","怩","淣","猊","籾","聣","蚭","蜺","觬","貎","跜","輗","郳","鈮","铌","霓","馜","鯢","鲵","麑","齯","𫐐","𫠜"],zhuō:["倬","拙","捉","桌","梲","棁","棳","槕","涿","窧","鐯","䦃"],"wō wēi":["倭"],luǒ:["倮","剆","曪","瘰","癳","臝","蓏","蠃","裸","躶"],sōng:["倯","凇","娀","崧","嵩","庺","憽","松","枀","枩","柗","梥","檧","淞","濍","硹","菘","鬆"],lèng:["倰","堎","愣","睖","踜"],zì:["倳","剚","字","恣","渍","漬","牸","眥","眦","胔","胾","自","茡","荢"],bèn:["倴","坌","捹","撪","渀","笨","逩"],cǎi:["倸","啋","婇","彩","採","棌","毝","睬","綵","跴","踩"],zhài:["债","債","寨","瘵","砦"],yē:["倻","吔","噎","擨","暍","椰","歋","潱","蠮"],shà:["倽","唼","喢","歃","箑","翜","翣","萐","閯","霎"],qīng:["倾","傾","卿","圊","寈","氢","氫","淸","清","蜻","軽","輕","轻","郬","錆","鑋","靑","青","鯖"],yīng:["偀","嘤","噟","嚶","婴","媖","嫈","嬰","孆","孾","愥","撄","攖","朠","桜","樱","櫻","渶","煐","珱","瑛","璎","瓔","甇","甖","碤","礯","緓","纓","绬","缨","罂","罃","罌","膺","英","莺","蘡","蝧","蠳","褮","譻","賏","軈","鑍","锳","霙","韺","鴬","鶑","鶧","鶯","鷪","鷹","鸎","鸚","鹦","鹰","䓨"],"chēng chèn":["偁","爯"],ruǎn:["偄","朊","瑌","瓀","碝","礝","腝","軟","輭","软","阮"],"zhòng tóng":["偅"],chǔn:["偆","惷","睶","萶","蠢","賰"],"jiǎ jià":["假"],"jì jié":["偈"],"bǐng bìng":["偋"],ruò:["偌","叒","嵶","弱","楉","焫","爇","箬","篛","蒻","鄀","鰙","鰯","鶸"],tí:["偍","厗","啼","嗁","崹","漽","瑅","睼","禵","稊","緹","缇","罤","蕛","褆","謕","趧","蹄","蹏","醍","鍗","題","题","騠","鮷","鯷","鳀","鵜","鷤","鹈","𫘨"],wēi:["偎","危","喴","威","媙","嶶","巍","微","愄","揋","揻","椳","楲","溦","烓","煨","燰","癓","縅","葨","葳","薇","蜲","蝛","覣","詴","逶","隇","隈","霺","鰃","鰄","鳂"],piān:["偏","囨","媥","楄","犏","篇","翩","鍂"],yàn:["偐","厌","厭","唁","喭","嚈","嚥","堰","妟","姲","嬊","嬿","宴","彥","彦","敥","晏","暥","曕","曣","滟","灎","灔","灧","灩","焔","焰","焱","熖","燄","牪","猒","砚","硯","艳","艶","艷","覎","觃","觾","諺","讌","讞","谚","谳","豓","豔","贋","贗","赝","軅","酀","酽","醼","釅","雁","餍","饜","騐","験","騴","驗","驠","验","鬳","鳫","鴈","鴳","鷃","鷰","齞"],"tǎng dàng":["偒"],è:["偔","匎","卾","厄","呝","咢","噩","垩","堊","堮","岋","崿","廅","悪","愕","戹","扼","搤","搹","擜","櫮","歞","歺","湂","琧","砈","砐","硆","腭","苊","萼","蕚","蚅","蝁","覨","諤","讍","谔","豟","軛","軶","轭","遌","遏","遻","鄂","鈪","鍔","鑩","锷","阨","阸","頞","顎","颚","餓","餩","饿","鰐","鰪","鱷","鳄","鶚","鹗","齃","齶","𫫇","𥔲"],xié:["偕","勰","协","協","嗋","垥","奊","恊","愶","拹","携","撷","擕","擷","攜","斜","旪","熁","燲","綊","緳","縀","缬","翓","胁","脅","脇","脋","膎","蝢","衺","襭","諧","讗","谐","鞋","鞵","龤","㙦"],chě:["偖","扯","撦"],shěng:["偗","渻","眚"],chā:["偛","嗏","扠","挿","插","揷","疀","臿","艖","銟","鍤","锸","餷"],huáng:["偟","凰","喤","堭","墴","媓","崲","徨","惶","楻","湟","煌","獚","瑝","璜","癀","皇","磺","穔","篁","簧","艎","葟","蝗","蟥","諻","趪","遑","鍠","鐄","锽","隍","韹","餭","騜","鰉","鱑","鳇","鷬","黃","黄","𨱑"],yǎo:["偠","咬","婹","宎","岆","杳","柼","榚","溔","狕","窅","窈","舀","苭","闄","騕","鷕","齩"],"chǒu qiào":["偢"],yóu:["偤","尤","庮","怣","沋","油","浟","游","犹","猶","猷","由","疣","秞","肬","莜","莸","蕕","蚰","蝣","訧","輏","輶","逰","遊","邮","郵","鈾","铀","駀","魷","鮋","鱿","鲉","𬨎"],xū:["偦","墟","媭","嬃","楈","欨","歔","燸","疞","盱","綇","縃","繻","胥","蕦","虗","虚","虛","蝑","裇","訏","許","諝","譃","谞","鑐","需","須","须","顼","驉","鬚","魆","魖","𬣙","𦈡"],zhā:["偧","哳","抯","挓","揸","摣","樝","渣","皶","觰","譇","齄","齇"],cī:["偨","疵","蠀","趀","骴","髊","齹"],bī:["偪","屄","楅","毴","豍","逼","鰏","鲾","鵖"],xún:["偱","噚","寻","尋","峋","巡","廵","循","恂","揗","攳","旬","杊","栒","桪","樳","洵","浔","潯","燅","燖","珣","璕","畃","紃","荀","蟳","詢","询","鄩","鱏","鱘","鲟","𬘓","𬩽","𬍤","𬊈"],"cāi sī":["偲"],duān:["偳","媏","端","褍","鍴"],ǒu:["偶","吘","嘔","耦","腢","蕅","藕","𬉼","𠙶"],tōu:["偷","偸","鍮"],"zán zá zǎ":["偺"],"lǚ lóu":["偻","僂"],fèn:["偾","僨","奋","奮","弅","忿","愤","憤","瀵","瞓","秎","粪","糞","膹","鱝","鲼"],"kuǐ guī":["傀"],sǒu:["傁","叜","叟","嗾","櫢","瞍","薮","藪"],"zhì sī tí":["傂"],sù:["傃","僳","嗉","塐","塑","夙","嫊","愫","憟","榡","樎","樕","殐","泝","涑","溯","溸","潚","潥","玊","珟","璛","簌","粛","粟","素","縤","肃","肅","膆","蔌","藗","觫","訴","謖","诉","谡","趚","蹜","速","遡","遬","鋉","餗","驌","骕","鱐","鷫","鹔","𫗧"],xiā:["傄","煆","瞎","虲","谺","颬","鰕"],"yuàn yuán":["傆","媛"],rǒng:["傇","冗","宂","氄","軵"],nù:["傉","怒"],yùn:["傊","孕","恽","惲","愠","慍","枟","腪","蕴","薀","藴","蘊","褞","貟","运","運","郓","鄆","酝","醖","醞","韗","韞","韵","韻","餫"],"gòu jiǎng":["傋"],mà:["傌","嘜","榪","睰","祃","禡","罵","閁","駡","骂","鬕"],bàng:["傍","塝","棒","玤","稖","艕","蒡","蜯","謗","谤","鎊","镑"],diān:["傎","厧","嵮","巅","巓","巔","掂","攧","敁","槇","滇","癫","癲","蹎","顚","顛","颠","齻"],táng:["傏","唐","啺","坣","堂","塘","搪","棠","榶","溏","漟","煻","瑭","磄","禟","篖","糃","糖","糛","膅","膛","蓎","螗","螳","赯","踼","鄌","醣","鎕","隚","餹","饄","鶶","䣘"],hào:["傐","哠","恏","昊","昦","晧","暠","暤","暭","曍","浩","淏","澔","灏","灝","皓","皜","皞","皡","皥","耗","聕","薃","號","鄗","顥","颢","鰝"],"xī xì":["傒"],shān:["傓","删","刪","剼","圸","山","挻","搧","柵","檆","潸","澘","煽","狦","珊","笘","縿","羴","羶","脠","舢","芟","衫","跚","軕","邖","閊","鯅"],"qiàn jiān":["傔"],"què jué":["傕","埆"],"cāng chen":["傖"],róng:["傛","媶","嫆","嬫","容","峵","嵘","嶸","戎","搈","曧","栄","榕","榮","榵","毧","溶","瀜","烿","熔","狨","瑢","穁","絨","绒","羢","肜","茙","茸","荣","蓉","蝾","融","螎","蠑","褣","鎔","镕","駥"],"tà tàn":["傝"],suō:["傞","唆","嗍","嗦","娑","摍","桫","梭","睃","簑","簔","羧","莏","蓑","趖","鮻"],dǎi:["傣","歹"],zài:["傤","儎","再","在","扗","洅","載","酨"],gǔ:["傦","古","啒","尳","愲","榖","榾","汩","淈","濲","瀔","牯","皷","皼","盬","瞽","穀","罟","羖","股","脵","臌","薣","蛊","蠱","詁","诂","轂","逧","鈷","钴","餶","馉","鼓","鼔","𦙶"],bīn:["傧","宾","彬","斌","椕","滨","濒","濱","濵","瀕","繽","缤","虨","豩","豳","賓","賔","邠","鑌","镔","霦","顮"],chǔ:["储","儲","杵","椘","楚","楮","檚","濋","璴","础","礎","禇","處","齭","齼","𬺓"],nuó:["傩","儺","挪","梛","橠"],"cān càn":["傪"],lěi:["傫","儡","厽","垒","塁","壘","壨","櫐","灅","癗","矋","磊","礨","耒","蕌","蕾","藟","蘽","蠝","誄","讄","诔","鑸","鸓"],cuī:["催","凗","墔","崔","嵟","慛","摧","榱","獕","磪","鏙"],yōng:["傭","嗈","墉","壅","嫞","庸","廱","慵","拥","擁","滽","灉","牅","痈","癕","癰","臃","邕","郺","鄘","鏞","镛","雍","雝","饔","鱅","鳙","鷛"],"zāo cáo":["傮"],sǒng:["傱","嵷","怂","悚","愯","慫","竦","耸","聳","駷","㧐"],ào:["傲","坳","垇","墺","奡","嫯","岙","岰","嶴","懊","擙","澳","鏊","驁","骜"],"qī còu":["傶"],chuǎng:["傸","磢","闖","闯"],shǎ:["傻","儍"],hàn:["傼","垾","悍","憾","扞","捍","撖","撼","旱","晘","暵","汉","涆","漢","瀚","焊","猂","皔","睅","翰","莟","菡","蛿","蜭","螒","譀","輚","釬","銲","鋎","雗","頷","顄","颔","駻","鶾"],zhāng:["傽","嫜","张","張","彰","慞","暲","樟","漳","獐","璋","章","粻","蔁","蟑","遧","鄣","鏱","餦","騿","鱆","麞"],"yān yàn":["傿","墕","嬮"],"piào biāo":["僄","骠"],liàn:["僆","堜","媡","恋","戀","楝","殓","殮","湅","潋","澰","瀲","炼","煉","瑓","練","纞","练","萰","錬","鍊","鏈","链","鰊","𬶠"],màn:["㵘","僈","墁","幔","慢","曼","漫","澷","熳","獌","縵","缦","蔄","蘰","鄤","鏝","镘","𬜬"],"tàn tǎn":["僋"],yíng:["僌","営","塋","嬴","攍","楹","櫿","溁","溋","滢","潆","濙","濚","濴","瀅","瀛","瀠","瀯","灐","灜","熒","營","瑩","盁","盈","禜","籝","籯","縈","茔","荧","莹","萤","营","萦","萾","蓥","藀","蛍","蝇","蝿","螢","蠅","謍","贏","赢","迎","鎣"],dòng:["働","冻","凍","动","動","姛","戙","挏","栋","棟","湩","硐","胨","胴","腖","迵","霘","駧"],zhuàn:["僎","啭","囀","堟","撰","灷","瑑","篆","腞","蒃","襈","譔","饌","馔"],xiàng:["像","勨","向","嚮","姠","嶑","曏","橡","珦","缿","蟓","衖","襐","象","鐌","項","项","鱌"],shàn:["僐","善","墠","墡","嬗","擅","敾","椫","樿","歚","汕","灗","疝","磰","繕","缮","膳","蟮","蟺","訕","謆","譱","讪","贍","赡","赸","鄯","鐥","饍","騸","骟","鱓","鱔","鳝","𫮃"],"tuí tuǐ":["僓"],zǔn:["僔","噂","撙","譐"],pú:["僕","匍","圤","墣","濮","獛","璞","瞨","穙","莆","菐","菩","葡","蒱","蒲","贌","酺","鏷","镤"],láo:["僗","劳","労","勞","哰","崂","嶗","憥","朥","浶","牢","痨","癆","窂","簩","醪","鐒","铹","顟","髝","𫭼"],chǎng:["僘","厰","廠","敞","昶","氅","鋹","𬬮"],guāng:["僙","光","咣","垙","姯","洸","灮","炗","炚","炛","烡","珖","胱","茪","輄","銧","黆","𨐈"],liáo:["僚","嘹","嫽","寥","寮","尞","屪","嵺","嶚","嶛","廫","憀","敹","暸","橑","獠","璙","疗","療","竂","簝","繚","缭","聊","膋","膫","藔","蟟","豂","賿","蹘","辽","遼","飉","髎","鷯","鹩"],dèng:["僜","凳","墱","嶝","櫈","瞪","磴","覴","邓","鄧","隥"],"chán zhàn zhuàn":["僝"],bō:["僠","嶓","拨","撥","播","波","溊","玻","癶","盋","砵","碆","礡","缽","菠","袰","蹳","鉢","钵","餑","饽","驋","鱍","𬭛"],huì:["僡","匯","卉","喙","嘒","嚖","圚","嬒","寭","屶","屷","彗","彙","彚","徻","恚","恵","惠","慧","憓","懳","晦","暳","槥","橞","檅","櫘","汇","泋","滙","潓","烩","燴","獩","璤","瞺","硊","秽","穢","篲","絵","繪","绘","翙","翽","荟","蔧","蕙","薈","薉","蟪","詯","誨","諱","譓","譿","讳","诲","賄","贿","鐬","闠","阓","靧","頮","顪","颒","餯","𬤝","𬭬"],chuǎn:["僢","喘","舛","荈","踳"],"tiě jiàn":["僣"],sēng:["僧","鬙"],xiàn:["僩","僴","哯","垷","塪","姭","娊","宪","岘","峴","憲","撊","晛","橌","橺","涀","瀗","献","獻","现","現","県","睍","粯","糮","絤","綫","線","线","缐","羡","羨","腺","臔","臽","苋","莧","誢","豏","鋧","錎","限","陥","陷","霰","餡","馅","麲","鼸","𬀪","𪾢"],"yù jú":["僪"],"è wū":["僫"],"tóng zhuàng":["僮"],lǐn:["僯","凛","凜","廩","廪","懍","懔","撛","檁","檩","澟","癛","癝"],gù:["僱","凅","固","堌","崓","崮","故","梏","棝","牿","痼","祻","錮","锢","雇","顧","顾","鯝","鲴"],jiāng:["僵","壃","姜","橿","殭","江","畕","疅","礓","繮","缰","翞","茳","葁","薑","螀","螿","豇","韁","鱂","鳉"],mǐn:["僶","冺","刡","勄","悯","惽","愍","慜","憫","抿","敃","敏","敯","泯","潣","皿","笢","笽","簢","蠠","閔","閩","闵","闽","鰵","鳘","黽"],jìn:["僸","凚","噤","嚍","墐","壗","妗","嬧","搢","晉","晋","枃","殣","浕","浸","溍","濅","濜","烬","煡","燼","琎","瑨","璶","盡","祲","縉","缙","荩","藎","覲","觐","賮","贐","赆","近","进","進","靳","齽"],"jià jie":["價"],qiào:["僺","峭","帩","撬","殻","窍","竅","誚","诮","躈","陗","鞩","韒","髚"],pì:["僻","媲","嫓","屁","澼","甓","疈","譬","闢","鷿","鸊","䴙"],sài:["僿","簺","賽","赛"],"chán tǎn shàn":["儃"],"dāng dàng":["儅","当","闣"],xuān:["儇","喧","塇","媗","宣","愃","愋","揎","昍","暄","煊","煖","瑄","睻","矎","禤","箮","翧","翾","萱","萲","蓒","蕿","藼","蘐","蝖","蠉","諠","諼","譞","谖","軒","轩","鍹","駽","鰚","𫓶","𫍽"],"dān dàn":["儋","擔","瘅"],càn:["儏","澯","灿","燦","璨","粲","薒","謲"],"bīn bìn":["儐"],"án àn":["儑"],tái:["儓","坮","嬯","抬","擡","檯","炱","炲","籉","臺","薹","跆","邰","颱","鮐","鲐"],lán:["儖","兰","囒","婪","岚","嵐","幱","拦","攔","斓","斕","栏","欄","欗","澜","瀾","灆","灡","燣","燷","璼","篮","籃","籣","繿","葻","蓝","藍","蘫","蘭","褴","襕","襤","襴","襽","譋","讕","谰","躝","鑭","镧","闌","阑","韊","𬒗"],"nǐ yì ài yí":["儗"],méng:["儚","幪","曚","朦","橗","檬","氋","溕","濛","甍","甿","盟","礞","艨","莔","萌","蕄","虻","蝱","鄳","鄸","霿","靀","顭","饛","鯍","鸏","鹲","𫑡","㠓"],níng:["儜","凝","咛","嚀","嬣","柠","橣","檸","狞","獰","聍","聹","薴","鑏","鬡","鸋"],qióng:["儝","卭","宆","惸","憌","桏","橩","焪","焭","煢","熍","琼","瓊","睘","穷","穹","窮","竆","笻","筇","舼","茕","藑","藭","蛩","蛬","赹","跫","邛","銎","䓖"],liè:["儠","冽","列","劣","劽","埒","埓","姴","峛","巤","挒","捩","栵","洌","浖","烈","烮","煭","犣","猎","猟","獵","聗","脟","茢","蛚","趔","躐","迾","颲","鬛","鬣","鮤","鱲","鴷","䴕","𫚭"],kuǎng:["儣","夼","懭"],bào:["儤","勽","報","忁","报","抱","曓","爆","犦","菢","虣","蚫","豹","鉋","鑤","铇","骲","髱","鮑","鲍"],biāo:["儦","墂","幖","彪","标","標","滮","瀌","熛","爂","猋","瘭","磦","膘","臕","謤","贆","鏢","鑣","镖","镳","颮","颷","飆","飇","飈","飊","飑","飙","飚","驫","骉","髟"],zǎn:["儧","儹","噆","攅","昝","趱","趲"],háo:["儫","嗥","嘷","噑","嚎","壕","椃","毜","毫","濠","獆","獔","竓","籇","蚝","蠔","譹","豪"],qìng:["儬","凊","庆","慶","櫦","濪","碃","磬","罄","靘"],chèn:["儭","嚫","榇","櫬","疢","衬","襯","讖","谶","趁","趂","齓","齔","龀"],téng:["儯","幐","滕","漛","疼","籐","籘","縢","腾","藤","虅","螣","誊","謄","邆","駦","騰","驣","鰧","䲢"],"lǒng lóng lòng":["儱"],"chán chàn":["儳"],"ráng xiāng":["儴","勷"],"huì xié":["儶"],luó:["儸","攞","椤","欏","猡","玀","箩","籮","罗","羅","脶","腡","萝","蘿","螺","覼","逻","邏","鏍","鑼","锣","镙","饠","騾","驘","骡","鸁"],léi:["儽","嫘","檑","欙","瓃","畾","縲","纍","纝","缧","罍","羸","蔂","蘲","虆","轠","鐳","鑘","镭","雷","靁","鱩","鼺"],"nàng nāng":["儾"],"wù wū":["兀"],yǔn:["允","喗","夽","抎","殒","殞","狁","磒","荺","賱","鈗","阭","陨","隕","霣","馻","齫","齳"],zān:["兂","橵","簪","簮","糌","鐕","鐟","鵤"],yuán:["元","円","原","厡","厵","园","圆","圎","園","圓","垣","塬","媴","嫄","援","榞","榬","橼","櫞","沅","湲","源","溒","爰","猨","猿","笎","緣","縁","缘","羱","茒","薗","蝝","蝯","螈","袁","褤","謜","轅","辕","邍","邧","酛","鈨","鎱","騵","魭","鶢","鶰","黿","鼋","𫘪"],xiōng:["兄","兇","凶","匂","匈","哅","忷","恟","汹","洶","胷","胸","芎","訩","詾","讻"],chōng:["充","嘃","忡","憃","憧","摏","沖","浺","珫","罿","翀","舂","艟","茺","衝","蹖","㳘"],zhào:["兆","垗","旐","曌","枛","櫂","照","燳","狣","瞾","笊","罀","罩","羄","肁","肇","肈","詔","诏","赵","趙","鮡","𬶐"],"duì ruì yuè":["兊","兌","兑"],kè:["克","刻","勀","勊","堁","娔","客","恪","愙","氪","溘","碦","緙","缂","艐","衉","課","课","錁","锞","騍","骒"],tù:["兎","兔","堍","迌","鵵"],dǎng:["党","攩","欓","譡","讜","谠","黨","𣗋"],dōu:["兜","兠","唗","橷","篼","蔸"],huǎng:["兤","奛","幌","怳","恍","晄","炾","熀","縨","詤","謊","谎"],rù:["入","嗕","媷","扖","杁","洳","溽","縟","缛","蓐","褥","鳰"],nèi:["內","氝","氞","錗"],"yú shù":["兪"],"liù lù":["六"],han:["兯","爳"],tiān:["兲","天","婖","添","酟","靔","靝","黇"],"xīng xìng":["兴"],diǎn:["典","嚸","奌","婰","敟","椣","点","碘","蒧","蕇","踮","點"],"zī cí":["兹"],jiān:["兼","冿","囏","坚","堅","奸","姦","姧","尖","幵","惤","戋","戔","搛","椾","樫","櫼","歼","殱","殲","湔","瀐","瀸","煎","熞","熸","牋","瑊","睷","礛","礷","笺","箋","緘","縑","缄","缣","肩","艰","艱","菅","菺","葌","蒹","蔪","蕑","蕳","虃","譼","豜","鑯","雃","鞯","韀","韉","餰","馢","鰔","鰜","鰹","鲣","鳒","鵑","鵳","鶼","鹣","麉"],shòu:["兽","受","售","壽","夀","寿","授","狩","獣","獸","痩","瘦","綬","绶","膄"],jì:["兾","冀","剂","剤","劑","勣","坖","垍","塈","妓","季","寂","寄","廭","彑","徛","忌","悸","惎","懻","技","旡","既","旣","暨","暩","曁","梞","檕","檵","洎","漃","漈","瀱","痵","癠","禝","稩","稷","穄","穊","穧","紀","継","績","繋","繼","继","绩","罽","臮","芰","茍","茤","葪","蓟","蔇","薊","蘎","蘮","蘻","裚","襀","覬","觊","計","記","誋","计","记","跡","跽","蹟","迹","际","際","霁","霽","驥","骥","髻","鬾","魝","魥","鯚","鯽","鰶","鰿","鱀","鱭","鲚","鲫","鵋","鷑","齌","𪟝","𬶨","𬶭"],jiōng:["冂","冋","坰","埛","扃","蘏","蘔","駉","駫","𬳶"],mào:["冃","冐","媢","帽","愗","懋","暓","柕","楙","毷","瑁","皃","眊","瞀","耄","茂","萺","蝐","袤","覒","貌","貿","贸","鄚","鄮"],rǎn:["冄","冉","姌","媣","染","珃","苒","蒅","䎃"],"nèi nà":["内"],gāng:["冈","冮","刚","剛","堈","堽","岡","掆","摃","棡","牨","犅","疘","綱","纲","缸","罁","罡","肛","釭","鎠","㭎"],cè:["冊","册","厕","厠","夨","廁","恻","惻","憡","敇","测","測","笧","策","筞","筴","箣","荝","萗","萴","蓛"],guǎ:["冎","剐","剮","叧","寡"],"mào mò":["冒"],gòu:["冓","啂","坸","垢","够","夠","媾","彀","搆","撀","构","構","煹","覯","觏","訽","詬","诟","購","购","遘","雊"],xǔ:["冔","喣","暊","栩","珝","盨","糈","詡","諿","诩","鄦","醑"],mì:["冖","冪","嘧","塓","宻","密","峚","幂","幎","幦","怽","榓","樒","櫁","汨","淧","滵","漞","濗","熐","羃","蔤","蜜","覓","覔","覛","觅","謐","谧","鼏"],"yóu yín":["冘"],xiě:["写","冩","藛"],jūn:["军","君","均","桾","汮","皲","皸","皹","碅","莙","蚐","袀","覠","軍","鈞","銁","銞","鍕","钧","頵","鮶","鲪","麏"],mí:["冞","擟","瀰","爢","猕","獼","祢","禰","縻","蒾","藌","蘪","蘼","袮","詸","謎","迷","醚","醾","醿","釄","镾","鸍","麊","麋","麛"],"guān guàn":["冠","覌","観","觀","观"],měng:["冡","勐","懵","掹","猛","獴","艋","蜢","蠓","錳","锰","鯭","鼆"],zhǒng:["冢","塚","尰","歱","煄","瘇","肿","腫","踵"],zuì:["冣","嶵","晬","最","栬","槜","檇","檌","祽","絊","罪","蕞","辠","酔","酻","醉","錊"],yuān:["冤","剈","囦","嬽","寃","棩","淵","渁","渆","渊","渕","灁","眢","肙","葾","蒬","蜎","蜵","駌","鳶","鴛","鵷","鸢","鸳","鹓","鼘","鼝"],míng:["冥","名","明","暝","朙","榠","洺","溟","猽","眀","眳","瞑","茗","螟","覭","詺","鄍","銘","铭","鳴","鸣"],kòu:["冦","叩","宼","寇","扣","敂","滱","窛","筘","簆","蔲","蔻","釦","鷇"],tài:["冭","太","夳","忲","态","態","汰","汱","泰","溙","肽","舦","酞","鈦","钛"],"féng píng":["冯","馮"],"chōng chòng":["冲"],kuàng:["况","圹","壙","岲","懬","旷","昿","曠","框","況","爌","眖","眶","矿","砿","礦","穬","絋","絖","纊","纩","貺","贶","軦","邝","鄺","鉱","鋛","鑛","黋"],lěng:["冷"],pàn:["冸","判","叛","沜","泮","溿","炍","牉","畔","盼","聁","袢","襻","詊","鋬","鑻","頖","鵥"],fā:["冹","彂","沷","発","發"],xiǎn:["冼","尟","尠","崄","嶮","幰","攇","显","櫶","毨","灦","烍","燹","狝","猃","獫","獮","玁","禒","筅","箲","藓","蘚","蚬","蜆","譣","赻","跣","鍌","险","険","險","韅","顕","顯","㬎"],qià:["冾","圶","帢","恰","殎","洽","硈","胢","髂"],"jìng chēng":["净","凈","淨"],sōu:["凁","嗖","廀","廋","捜","搜","摉","溲","獀","艘","蒐","螋","鄋","醙","鎪","锼","颼","飕","餿","馊","騪"],měi:["凂","媄","媺","嬍","嵄","挴","毎","每","浼","渼","燘","美","躾","鎂","镁","黣"],tú:["凃","図","图","圖","圗","塗","屠","峹","嵞","庩","廜","徒","悇","揬","涂","瘏","筡","腯","荼","蒤","跿","途","酴","鈯","鍎","馟","駼","鵌","鶟","鷋","鷵","𬳿"],zhǔn:["准","凖","埻","準","𬘯"],"liáng liàng":["凉","涼","量"],diāo:["凋","刁","刟","叼","奝","弴","彫","汈","琱","碉","簓","虭","蛁","貂","錭","雕","鮉","鯛","鲷","鵰","鼦"],còu:["凑","湊","腠","輳","辏"],ái:["凒","啀","嘊","捱","溰","癌","皑","皚"],duó:["凙","剫","夺","奪","痥","踱","鈬","鐸","铎"],dú:["凟","匵","嬻","椟","櫝","殰","涜","牍","牘","犊","犢","独","獨","瓄","皾","裻","読","讀","讟","豄","贕","錖","鑟","韇","韣","韥","騳","髑","黩","黷"],"jǐ jī":["几"],fán:["凡","凢","凣","匥","墦","杋","柉","棥","樊","瀿","烦","煩","燔","璠","矾","礬","笲","籵","緐","羳","舤","舧","薠","蘩","蠜","襎","蹯","釩","鐇","鐢","钒","鷭","𫔍","𬸪"],jū:["凥","匊","娵","婮","居","崌","抅","挶","掬","梮","椐","檋","毩","毱","泃","涺","狙","琚","疽","砠","罝","腒","艍","蜛","裾","諊","跔","踘","躹","陱","雎","鞠","鞫","駒","驹","鮈","鴡","鶋","𬶋"],"chù chǔ":["処","处"],zhǐ:["凪","劧","咫","址","坧","帋","恉","扺","指","旨","枳","止","汦","沚","洔","淽","疻","砋","祉","秖","紙","纸","芷","藢","衹","襧","訨","趾","軹","轵","酯","阯","黹"],píng:["凭","凴","呯","坪","塀","岼","帡","帲","幈","平","慿","憑","枰","洴","焩","玶","瓶","甁","竮","箳","簈","缾","荓","萍","蓱","蚲","蛢","評","评","軿","輧","郱","鮃","鲆"],kǎi:["凯","凱","剀","剴","垲","塏","恺","愷","慨","暟","蒈","輆","鍇","鎧","铠","锴","闓","闿","颽"],gān:["凲","坩","尲","尴","尶","尷","柑","泔","漧","玕","甘","疳","矸","竿","筸","粓","肝","苷","迀","酐","魐"],"kǎn qiǎn":["凵"],tū:["凸","堗","嶀","捸","涋","湥","痜","禿","秃","突","葖","鋵","鵚","鼵","㻬"],"āo wā":["凹"],chū:["出","初","岀","摴","榋","樗","貙","齣","䢺","䝙"],dàng:["凼","圵","垱","壋","档","檔","氹","璗","瓽","盪","瞊","砀","碭","礑","簜","荡","菪","蕩","蘯","趤","逿","雼","𬍡"],hán:["函","凾","含","圅","娢","寒","崡","晗","梒","浛","涵","澏","焓","琀","甝","筨","蜬","邗","邯","鋡","韓","韩"],záo:["凿","鑿"],dāo:["刀","刂","忉","氘","舠","螩","釖","魛","鱽"],chuāng:["刅","摐","牎","牕","疮","瘡","窓","窗","窻"],"fēn fèn":["分"],"qiè qiē":["切"],kān:["刊","勘","堪","戡","栞","龕","龛"],cǔn:["刌","忖"],chú:["刍","厨","幮","廚","橱","櫉","櫥","滁","犓","篨","耡","芻","蒢","蒭","蜍","蟵","豠","趎","蹰","躇","躕","鉏","鋤","锄","除","雏","雛","鶵"],"huà huá":["划"],lí:["刕","剓","剺","劙","厘","喱","嚟","囄","嫠","孷","廲","悡","梨","梸","棃","漓","灕","犁","犂","狸","琍","璃","瓈","盠","睝","离","穲","竰","筣","篱","籬","糎","縭","缡","罹","艃","荲","菞","蓠","蔾","藜","蘺","蜊","蟍","蟸","蠫","褵","謧","貍","醨","鋫","錅","鏫","鑗","離","驪","骊","鯏","鯬","鱺","鲡","鵹","鸝","鹂","黎","黧","㰀"],yuè:["刖","嬳","岄","岳","嶽","恱","悅","悦","戉","抈","捳","月","樾","瀹","爚","玥","礿","禴","篗","籆","籥","籰","粤","粵","蘥","蚎","蚏","説","越","跀","跃","躍","軏","鈅","鉞","鑰","钺","閱","閲","阅","鸑","鸙","黦","龠","𫐄","𬸚"],liú:["刘","劉","嚠","媹","嵧","旈","旒","榴","橊","流","浏","瀏","琉","瑠","瑬","璢","畄","留","畱","疁","瘤","癅","硫","蒥","蓅","蟉","裗","鎏","鏐","鐂","镠","飀","飅","飗","駠","駵","騮","驑","骝","鰡","鶹","鹠","麍"],zé:["则","則","啧","嘖","嫧","帻","幘","択","樍","歵","沢","泎","溭","皟","瞔","矠","礋","箦","簀","舴","蔶","蠌","襗","謮","賾","赜","迮","鸅","齚","齰"],"chuàng chuāng":["创","創"],qù:["刞","厺","去","閴","闃","阒","麮","鼁"],"bié biè":["別","别"],"páo bào":["刨"],"chǎn chàn":["刬","剗","幝"],guā:["刮","劀","桰","歄","煱","瓜","胍","踻","颪","颳","騧","鴰","鸹"],gēng:["刯","庚","椩","浭","焿","畊","絚","羮","羹","耕","菮","賡","赓","鶊","鹒"],dào:["到","噵","悼","椡","檤","燾","瓙","盗","盜","稲","稻","纛","翿","艔","菿","衜","衟","軇","道"],chuàng:["刱","剏","剙","怆","愴"],kū:["刳","哭","圐","堀","枯","桍","矻","窟","跍","郀","骷","鮬"],duò:["刴","剁","墯","尮","惰","憜","挅","桗","舵","跥","跺","陊","陏","飿","饳","鵽"],"shuā shuà":["刷"],"quàn xuàn":["券"],"chà shā":["刹","剎"],"cì cī":["刺"],guì:["刽","刿","劊","劌","撌","攰","昋","桂","椢","槶","樻","櫃","猤","禬","筀","蓕","襘","貴","贵","跪","鐀","鑎","鞼","鱖","鱥"],lóu:["剅","娄","婁","廔","楼","樓","溇","漊","熡","耧","耬","艛","蒌","蔞","蝼","螻","謱","軁","遱","鞻","髅","髏","𪣻"],cuò:["剉","剒","厝","夎","挫","措","棤","莝","莡","蓌","逪","銼","錯","锉","错"],"xiāo xuē":["削"],"kēi kè":["剋","尅"],"là lá":["剌"],tī:["剔","梯","踢","銻","锑","鷈","鷉","䏲","䴘"],pōu:["剖"],wān:["剜","塆","壪","帵","弯","彎","湾","潫","灣","睕","蜿","豌"],"bāo bō":["剝","剥"],duō:["剟","咄","哆","嚉","多","夛","掇","毲","畓","裰","㙍"],qíng:["剠","勍","夝","情","擎","晴","暒","棾","樈","檠","氰","甠","硘","葝","黥"],"yǎn shàn":["剡"],"dū zhuó":["剢"],yān:["剦","嫣","崦","嶖","恹","懕","懨","樮","淊","淹","漹","烟","焉","焑","煙","珚","篶","胭","臙","菸","鄢","醃","閹","阉","黫"],huō:["剨","劐","吙","攉","秴","耠","锪","騞","𬴃"],shèng:["剩","剰","勝","圣","墭","嵊","晠","榺","橳","琞","聖","蕂","貹","賸"],"duān zhì":["剬"],wū:["剭","呜","嗚","圬","屋","巫","弙","杇","歍","汙","汚","污","洿","烏","窏","箼","螐","誈","誣","诬","邬","鄔","鎢","钨","鰞","鴮"],gē:["割","哥","圪","彁","戈","戓","戨","歌","滒","犵","肐","袼","謌","鎶","鴚","鴿","鸽"],"dá zhá":["剳"],chuán:["剶","暷","椽","篅","舡","舩","船","輲","遄"],"tuán zhuān":["剸","漙","篿"],"lù jiū":["剹"],pēng:["剻","匉","嘭","怦","恲","抨","梈","烹","砰","軯","駍"],piāo:["剽","勡","慓","旚","犥","翲","螵","飃","飄","飘","魒"],kōu:["剾","彄","抠","摳","眍","瞘","芤","𫸩"],"jiǎo chāo":["剿","劋","勦","摷"],qiāo:["劁","勪","墝","幧","敲","橇","毃","燆","硗","磽","繑","趬","跷","踍","蹺","蹻","郻","鄡","鄥","鍫","鍬","鐰","锹","頝"],"huá huà":["劃"],"zhā zhá":["劄"],"pī pǐ":["劈","悂"],tāng:["劏","嘡","羰","薚","蝪","蹚","鞺","鼞"],chán:["劖","嚵","壥","婵","嬋","巉","廛","棎","毚","湹","潹","潺","澶","瀍","瀺","煘","獑","磛","緾","纏","纒","缠","艬","蝉","蟐","蟬","蟾","誗","讒","谗","躔","鄽","酁","鋋","鑱","镵","饞","馋"],zuān:["劗","躜","躦","鉆","鑚"],mó:["劘","嫫","嬤","嬷","尛","摹","擵","橅","糢","膜","藦","蘑","謨","謩","谟","饃","饝","馍","髍","魔","魹"],zhú:["劚","斸","曯","欘","灟","炢","烛","燭","爥","瘃","竹","笁","笜","舳","茿","蓫","蠋","蠾","躅","逐","逫","钃","鱁"],quàn:["劝","勧","勸","牶","韏"],"jìn jìng":["劤","劲","勁"],kēng:["劥","坑","牼","硁","硜","誙","銵","鍞","鏗","铿","阬"],"xié liè":["劦"],"zhù chú":["助"],nǔ:["努","弩","砮","胬"],shào:["劭","卲","哨","潲","紹","綤","绍","袑","邵"],miǎo:["劰","杪","淼","渺","眇","秒","篎","緲","缈","藐","邈"],kǒu:["劶","口"],wā:["劸","娲","媧","屲","挖","攨","洼","溛","漥","瓾","畖","穵","窊","窪","蛙","韈","鼃"],kuāng:["劻","匡","匩","哐","恇","洭","筐","筺","誆","诓","軭","邼"],hé:["劾","咊","啝","姀","峆","敆","曷","柇","楁","毼","河","涸","渮","澕","熆","皬","盇","盉","盍","盒","禾","篕","籺","粭","翮","菏","萂","覈","訸","詥","郃","釛","鉌","鑉","閡","闔","阂","阖","鞨","頜","餄","饸","魺","鹖","麧","齕","龁","龢","𬌗"],gào:["勂","吿","告","峼","祮","祰","禞","筶","誥","诰","郜","鋯","锆"],"bó bèi":["勃"],láng:["勆","嫏","廊","斏","桹","榔","樃","欴","狼","琅","瑯","硠","稂","艆","蓈","蜋","螂","躴","郒","郞","鋃","鎯","锒"],xūn:["勋","勛","勲","勳","嚑","坃","埙","塤","壎","壦","曛","燻","獯","矄","纁","臐","薫","薰","蘍","醺","𫄸"],"juàn juān":["勌","瓹"],"lè lēi":["勒"],kài:["勓","炌","烗","鎎"],"wěng yǎng":["勜"],qín:["勤","嗪","噙","嶜","庈","懃","懄","捦","擒","斳","檎","澿","珡","琴","琹","瘽","禽","秦","耹","芩","芹","菦","螓","蠄","鈙","鈫","雂","靲","鳹","鵭"],jiàng:["勥","匞","匠","嵹","弜","弶","摾","櫤","洚","滰","犟","糡","糨","絳","绛","謽","酱","醤","醬"],fān:["勫","嬏","帆","幡","忛","憣","旙","旛","繙","翻","藩","轓","颿","飜","鱕"],juān:["勬","姢","娟","捐","涓","蠲","裐","鎸","鐫","镌","鹃"],"tóng dòng":["勭","烔","燑","狪"],lǜ:["勴","垏","嵂","律","慮","氯","滤","濾","爈","箻","綠","繂","膟","葎","虑","鑢"],chè:["勶","坼","彻","徹","掣","撤","澈","烢","爡","瞮","硩","聅","迠","頙","㬚"],sháo:["勺","玿","韶"],"gōu gòu":["勾"],cōng:["匆","囪","囱","忩","怱","悤","暰","樬","漗","瑽","璁","瞛","篵","繱","聡","聦","聪","聰","苁","茐","葱","蓯","蔥","蟌","鍯","鏓","鏦","騘","驄","骢"],"táo yáo":["匋","陶"],páo:["匏","咆","垉","庖","爮","狍","袍","褜","軳","鞄","麅"],dá:["匒","妲","怛","炟","燵","畣","笪","羍","荙","薘","蟽","詚","达","迏","迖","迚","逹","達","鐽","靼","鞑","韃","龖","龘","𫟼"],"huà huā":["化"],"běi bèi":["北"],nǎo:["匘","垴","堖","嫐","恼","悩","惱","瑙","碯","脑","脳","腦"],"chí shi":["匙"],fāng:["匚","堏","方","淓","牥","芳","邡","鈁","錺","钫","鴋"],zā:["匝","咂","帀","沞","臜","臢","迊","鉔","魳"],qiè:["匧","厒","妾","怯","悏","惬","愜","挈","穕","窃","竊","笡","箧","篋","籡","踥","鍥","锲","鯜"],"zāng cáng":["匨"],fěi:["匪","奜","悱","棐","榧","篚","翡","蕜","誹","诽"],"kuì guì":["匮","匱"],suǎn:["匴"],pǐ:["匹","噽","嚭","圮","庀","痞","癖","脴","苉","銢","鴄"],"qū ōu":["区","區"],"kē qià":["匼"],"yǎn yàn":["匽","棪"],biǎn:["匾","惼","揙","碥","稨","窆","藊","褊","貶","贬","鴘"],nì:["匿","堄","嫟","嬺","惄","愵","昵","暱","氼","眤","睨","縌","胒","腻","膩","逆","𨺙"],niàn:["卄","唸","埝","廿","念","惗","艌"],sà:["卅","櫒","脎","萨","蕯","薩","鈒","隡","颯","飒","馺"],zú:["卆","哫","崪","族","箤","足","踤","镞"],shēng:["升","呏","声","斘","昇","曻","枡","殅","泩","湦","焺","牲","珄","生","甥","竔","笙","聲","鉎","鍟","阩","陞","陹","鵿","鼪"],wàn:["卍","卐","忨","杤","瞣","脕","腕","萬","蟃","贎","輐","錽","𬇕"],"huá huà huā":["华","華"],bēi:["卑","悲","揹","杯","桮","盃","碑","藣","鵯","鹎"],"zú cù":["卒"],"dān shàn chán":["单","單"],"nán nā":["南"],"shuài lǜ":["卛"],"bǔ bo pú":["卜"],"kuàng guàn":["卝"],biàn:["卞","变","変","峅","弁","徧","忭","抃","昪","汳","汴","玣","艑","苄","覍","諚","變","辡","辧","辨","辩","辫","辮","辯","遍","釆","𨚕"],bǔ:["卟","哺","捕","补","補","鸔","𬷕"],"zhàn zhān":["占","覱"],"kǎ qiǎ":["卡"],lú:["卢","嚧","垆","壚","庐","廬","曥","枦","栌","櫨","泸","瀘","炉","爐","獹","玈","瓐","盧","矑","籚","纑","罏","胪","臚","舮","舻","艫","芦","蘆","蠦","轤","轳","鈩","鑪","顱","颅","馿","髗","魲","鱸","鲈","鸕","鸬","黸","𬬻"],lǔ:["卤","塷","掳","擄","樐","橹","櫓","氌","滷","澛","瀂","硵","磠","穞","艣","艪","蓾","虏","虜","鏀","鐪","鑥","镥","魯","鲁","鹵"],guà:["卦","啩","挂","掛","罣","褂","詿","诖"],"áng yǎng":["卬"],yìn:["印","垽","堷","廕","慭","憖","憗","懚","洕","湚","猌","癊","胤","茚","酳","鮣","䲟"],què:["却","卻","塙","崅","悫","愨","慤","搉","榷","燩","琷","皵","确","確","礭","闋","阕","鵲","鹊","𬒈"],luǎn:["卵"],"juàn juǎn":["卷","巻"],"chǎng ān hàn":["厂"],"wěi yán":["厃"],tīng:["厅","厛","听","庁","廰","廳","汀","烃","烴","綎","耓","聴","聼","聽","鞓","𬘩"],"zhé zhái":["厇"],"hàn àn":["厈","屽"],yǎ:["厊","唖","庌","痖","瘂","蕥"],shè:["厍","厙","弽","慑","慴","懾","摂","欇","涉","涻","渉","滠","灄","社","舎","蔎","蠂","設","设","赦","騇","麝"],dǐ:["厎","呧","坘","弤","抵","拞","掋","牴","砥","菧","觝","詆","诋","軧","邸","阺","骶","鯳"],"zhǎ zhǎi":["厏"],páng:["厐","嫎","庞","徬","舽","螃","逄","鰟","鳑","龎","龐"],"zhì shī":["厔"],máng:["厖","吂","哤","娏","忙","恾","杗","杧","汒","浝","牻","痝","盲","硭","笀","芒","茫","蘉","邙","釯","鋩","铓","駹"],zuī:["厜","樶","纗","蟕"],"shà xià":["厦","廈"],áo:["厫","嗷","嗸","廒","敖","滶","獒","獓","璈","翱","翶","翺","聱","蔜","螯","謷","謸","遨","鏖","隞","鰲","鳌","鷔","鼇"],"lán qiān":["厱"],"sī mǒu":["厶"],"gōng hóng":["厷"],"lín miǎo":["厸"],"qiú róu":["厹"],dū:["厾","嘟","督","醏"],"xiàn xuán":["县","縣"],"cān shēn cēn sān":["参","參","叄","叅"],"ài yǐ":["叆"],"chā chà chǎ chá":["叉"],shuāng:["双","孀","孇","欆","礵","艭","雙","霜","騻","驦","骦","鷞","鸘","鹴"],shōu:["収","收"],guái:["叏"],bá:["叐","妭","抜","拔","炦","癹","胈","茇","菝","詙","跋","軷","魃","鼥"],"fā fà":["发"],"zhuó yǐ lì jué":["叕"],qǔ:["取","娶","竬","蝺","詓","齲","龋"],"jiǎ xiá":["叚","徦"],"wèi yù":["叞","尉","蔚"],dié:["叠","垤","堞","峌","幉","恎","惵","戜","曡","殜","氎","牃","牒","瓞","畳","疂","疉","疊","碟","絰","绖","耊","耋","胅","艓","苵","蜨","蝶","褋","詄","諜","谍","跮","蹀","迭","镻","鰈","鲽","鴩","𫶇"],ruì:["叡","枘","汭","瑞","睿","芮","蚋","蜹","銳","鋭","锐"],"jù gōu":["句"],lìng:["另","呤","炩","蘦"],"dāo dáo tāo":["叨"],"zhī zhǐ":["只"],jiào:["叫","呌","嘂","嘦","噍","嬓","斍","斠","滘","漖","獥","珓","皭","窖","藠","訆","譥","趭","較","轎","轿","较","酵","醮","釂"],"zhào shào":["召"],"kě kè":["可"],"tái tāi":["台","苔"],pǒ:["叵","尀","笸","箥","鉕","钷","駊"],"yè xié":["叶"],"hào háo":["号"],tàn:["叹","嘆","探","歎","湠","炭","碳","舕"],"hōng hóng":["叿"],miē:["吀","咩","哶","孭"],"xū yū yù":["吁"],chī:["吃","哧","喫","嗤","噄","妛","媸","彨","彲","摛","攡","殦","瓻","痴","癡","眵","瞝","笞","粚","胵","蚩","螭","訵","魑","鴟","鵄","鸱","黐","齝","𫄨"],"xuān sòng":["吅"],yāo:["吆","喓","夭","妖","幺","楆","殀","祅","腰","葽","訞","邀","鴁","鴢","㙘"],zǐ:["吇","姉","姊","子","杍","梓","榟","橴","滓","矷","秭","笫","籽","紫","耔","虸","訿","釨"],"hé gě":["合","鲄"],"cùn dòu":["吋"],"tóng tòng":["同"],"tǔ tù":["吐","唋"],"zhà zhā":["吒","奓"],"xià hè":["吓"],"ā yā":["吖"],"ma má mǎ":["吗"],lìn:["吝","恡","悋","橉","焛","甐","膦","蔺","藺","賃","赁","蹸","躏","躙","躪","轥","閵"],tūn:["吞","暾","朜","焞"],"bǐ pǐ":["吡"],qìn:["吢","吣","唚","抋","揿","搇","撳","沁","瀙","菣","藽"],"jiè gè":["吤"],"fǒu pǐ":["否"],"ba bā":["吧"],dūn:["吨","噸","墩","墪","惇","撉","撴","犜","獤","礅","蜳","蹾","驐"],fēn:["吩","帉","昐","朆","梤","棻","氛","竕","紛","纷","翂","芬","衯","訜","躮","酚","鈖","雰","餴","饙","馚"],"é huā":["吪"],"kēng háng":["吭","妔"],shǔn:["吮"],"zhī zī":["吱"],"yǐn shěn":["吲"],wú:["吳","吴","呉","墲","峿","梧","橆","毋","洖","浯","無","珸","璑","祦","芜","茣","莁","蕪","蜈","蟱","譕","郚","鋙","铻","鯃","鵐","鷡","鹀","鼯"],"chǎo chāo":["吵"],"nà nè":["吶"],"xuè chuò jué":["吷"],chuī:["吹","炊","龡"],"dōu rú":["吺"],hǒu:["吼","犼"],"hōng hǒu ōu":["吽"],"wú yù":["吾"],"ya yā":["呀"],"è e":["呃"],dāi:["呆","懛","獃"],"mèn qǐ":["呇"],hōng:["呍","嚝","揈","灴","烘","焢","硡","薨","訇","谾","軣","輷","轟","轰","鍧"],nà:["呐","捺","笝","納","纳","肭","蒳","衲","豽","貀","軜","郍","鈉","钠","靹","魶"],"tūn tiān":["呑"],"fǔ ḿ":["呒","嘸"],"dāi tǎi":["呔"],"ǒu ōu òu":["呕"],"bài bei":["呗"],"yuán yún yùn":["员","員"],guō:["呙","啯","嘓","埚","堝","墎","崞","彉","彍","懖","猓","瘑","聒","蝈","蟈","郭","鈛","鍋","锅"],"huá qì":["呚"],"qiàng qiāng":["呛","跄"],shī:["呞","失","尸","屍","师","師","施","浉","湤","湿","溮","溼","濕","狮","獅","瑡","絁","葹","蒒","蓍","虱","蝨","褷","襹","詩","诗","邿","釃","鉇","鍦","鯴","鰤","鲺","鳲","鳾","鶳","鸤","䴓","𫚕"],juǎn:["呟","埍","臇","菤","錈","锩"],pěn:["呠","翸"],"wěn mǐn":["呡"],"ne ní":["呢"],"ḿ m̀ móu":["呣"],rán:["呥","嘫","然","燃","繎","肰","蚦","蚺","衻","袇","袡","髥","髯"],"tiè chè":["呫"],"qì zhī":["呮"],"zǐ cī":["呰"],"guā gū guǎ":["呱"],"cī zī":["呲"],"hǒu xǔ gòu":["呴"],"hē ā á ǎ à a":["呵"],náo:["呶","夒","峱","嶩","巎","挠","撓","猱","硇","蛲","蟯","詉","譊","鐃","铙"],"xiā gā":["呷"],pēi:["呸","怌","肧","胚","衃","醅"],"háo xiāo":["呺"],mìng:["命","掵"],"dá dàn":["呾"],"zuǐ jǔ":["咀"],"xián gān":["咁"],pǒu:["咅","哣","犃"],"yǎng yāng":["咉"],"zǎ zé zhā":["咋"],"hé hè huó huò hú":["和"],hāi:["咍"],dā:["咑","哒","噠","墶","搭","撘","耷","褡","鎝","𨱏"],"kǎ kā":["咔"],gū:["咕","唂","唃","姑","嫴","孤","巬","巭","柧","橭","沽","泒","稒","笟","箍","箛","篐","罛","苽","菇","菰","蓇","觚","軱","軲","轱","辜","酤","鈲","鮕","鴣","鸪"],"kā gā":["咖"],zuo:["咗"],lóng:["咙","嚨","嶐","巃","巄","昽","曨","朧","栊","槞","櫳","湰","滝","漋","爖","珑","瓏","癃","眬","矓","砻","礱","礲","窿","竜","聋","聾","胧","茏","蘢","蠪","蠬","襱","豅","鏧","鑨","霳","靇","驡","鸗","龍","龒","龙"],"xiàn xián":["咞"],qì:["咠","唭","噐","器","夡","弃","憇","憩","暣","棄","欫","气","気","氣","汔","汽","泣","湆","湇","炁","甈","盵","矵","碛","碶","磜","磧","罊","芞","葺","藒","蟿","訖","讫","迄","鐑"],"xì dié":["咥"],"liē liě lié lie":["咧"],zī:["咨","嗞","姕","姿","孜","孳","孶","崰","嵫","栥","椔","淄","湽","滋","澬","玆","禌","秶","粢","紎","緇","緕","纃","缁","茊","茲","葘","諮","谘","貲","資","赀","资","赼","趑","趦","輜","輺","辎","鄑","鈭","錙","鍿","鎡","锱","镃","頾","頿","髭","鯔","鰦","鲻","鶅","鼒","齍","齜","龇"],mī:["咪"],"jī xī qià":["咭"],"gē luò kǎ lo":["咯"],"shù xún":["咰"],"zán zá zǎ zan":["咱"],"hāi ké":["咳"],huī:["咴","噅","噕","婎","媈","幑","徽","恢","拻","挥","揮","晖","暉","楎","洃","瀈","灰","灳","烣","睳","禈","翚","翬","蘳","袆","褘","詼","诙","豗","輝","辉","鰴","麾","㧑"],"huài shì":["咶"],táo:["咷","啕","桃","檮","洮","淘","祹","綯","绹","萄","蜪","裪","迯","逃","醄","鋾","鞀","鞉","饀","駣","騊","鼗","𫘦"],xián:["咸","啣","娴","娹","婱","嫌","嫺","嫻","弦","挦","撏","涎","湺","澖","甉","痫","癇","癎","絃","胘","舷","藖","蚿","蛝","衔","衘","誸","諴","賢","贒","贤","輱","醎","銜","鑦","閑","闲","鷳","鷴","鷼","鹇","鹹","麙","𫍯"],"è àn":["咹"],"xuān xuǎn":["咺","烜"],"wāi hé wǒ guǎ guō":["咼"],"yàn yè yān":["咽"],āi:["哀","哎","埃","溾","銰","鎄","锿"],pǐn:["品","榀"],shěn:["哂","婶","嬸","审","宷","審","弞","曋","渖","瀋","瞫","矤","矧","覾","訠","諗","讅","谂","谉","邥","頣","魫"],"hǒng hōng hòng":["哄"],"wā wa":["哇"],"hā hǎ hà":["哈"],zāi:["哉","栽","渽","溨","災","灾","烖","睵","賳"],"dì diè":["哋"],pài:["哌","沠","派","渒","湃","蒎","鎃"],"gén hěn":["哏"],"yǎ yā":["哑","雅"],"yuě huì":["哕","噦"],nián:["哖","年","秊","秥","鮎","鯰","鲇","鲶","鵇","黏"],"huá huā":["哗","嘩"],"jì jiē zhāi":["哜","嚌"],mōu:["哞"],"yō yo":["哟","喲"],lòng:["哢","梇","贚"],"ò ó é":["哦"],"lī lǐ li":["哩"],"nǎ na nǎi né něi":["哪"],hè:["哬","垎","壑","寉","惒","焃","煂","燺","爀","癋","碋","翯","褐","謞","賀","贺","赫","靍","靎","靏","鶴","鸖","鹤"],"bō pò bā":["哱"],zhé:["哲","啠","喆","嚞","埑","悊","摺","晢","晣","歽","矺","砓","磔","籷","粍","虴","蛰","蟄","袩","詟","謫","謺","讁","讋","谪","輒","輙","轍","辄","辙","鮿"],"liàng láng":["哴"],"liè lǜ":["哷"],hān:["哻","憨","蚶","谽","酣","頇","顸","馠","魽","鼾"],"hēng hng":["哼"],gěng:["哽","埂","峺","挭","梗","綆","绠","耿","莄","郠","骾","鯁","鲠","𬒔"],"chuò yuè":["哾"],"gě jiā":["哿"],"bei bài":["唄"],"hán hàn":["唅"],chún:["唇","浱","湻","滣","漘","犉","純","纯","脣","莼","蒓","蓴","醇","醕","錞","陙","鯙","鶉","鹑","𬭚"],"ài āi":["唉"],"jiá qiǎn":["唊"],"yán dàn xián":["唌"],chē:["唓","砗","硨","莗","蛼"],"wú ńg ń":["唔"],zào:["唕","唣","噪","慥","梍","灶","煰","燥","皁","皂","竃","竈","簉","艁","譟","趮","躁","造","𥖨"],dí:["唙","啇","嘀","嚁","嫡","廸","敌","敵","梑","涤","滌","狄","笛","籴","糴","苖","荻","蔋","蔐","藡","覿","觌","豴","迪","靮","頔","馰","髢","鸐","𬱖"],"gòng hǒng gǒng":["唝","嗊"],dóu:["唞"],"lào láo":["唠","嘮","憦"],huàn:["唤","喚","奂","奐","宦","嵈","幻","患","愌","换","換","擐","攌","梙","槵","浣","涣","渙","漶","澣","烉","焕","煥","瑍","痪","瘓","睆","肒","藧","豢","轘","逭","鯇","鯶","鰀","鲩"],léng:["唥","塄","楞","碐","薐"],"wō wěi":["唩"],fěng:["唪","覂","諷","讽"],"yín jìn":["唫"],"hǔ xià":["唬"],wéi:["唯","围","圍","壝","峗","峞","嵬","帏","帷","幃","惟","桅","沩","洈","涠","湋","溈","潍","潙","潿","濰","犩","矀","維","维","蓶","覹","违","違","鄬","醀","鍏","闈","闱","韋","韦","鮠","𣲗","𬶏"],shuā:["唰"],chàng:["唱","怅","悵","暢","焻","畅","畼","誯","韔","鬯"],"ér wā":["唲"],qiàng:["唴","炝","熗","羻"],yō:["唷"],yū:["唹","淤","瘀","盓","箊","紆","纡","込","迂","迃","陓"],lài:["唻","濑","瀨","瀬","癞","癩","睐","睞","籁","籟","藾","賚","賴","赉","赖","頼","顂","鵣"],tuò:["唾","嶞","柝","毤","毻","箨","籜","萚","蘀","跅"],"zhōu zhāo tiào":["啁"],kěn:["啃","垦","墾","恳","懇","肎","肯","肻","豤","錹"],"zhuó zhào":["啅","濯"],"hēng hèng":["啈","悙"],"lín lán":["啉"],"a ā á ǎ à":["啊"],qiāng:["啌","嗴","嶈","戕","摤","斨","枪","槍","溬","牄","猐","獇","羌","羗","腔","蜣","謒","鏘","锖","锵"],"tūn zhūn xiāng duǐ":["啍"],wèn:["問","妏","揾","搵","璺","问","顐"],"cuì qi":["啐"],"dié shà jié tì":["啑"],"yuē wā":["啘"],"zǐ cǐ":["啙"],"bǐ tú":["啚"],"chuò chuài":["啜"],"yǎ yā è":["啞"],fēi:["啡","婓","婔","扉","暃","渄","猆","緋","绯","裶","霏","非","靟","飛","飝","飞","餥","馡","騑","騛","鯡","鲱","𬴂"],pí:["啤","壀","枇","毗","毘","焷","琵","疲","皮","篺","罴","羆","脾","腗","膍","蚍","蚽","蜱","螷","蠯","豼","貔","郫","鈹","阰","陴","隦","魮","鮍","鲏","鵧","鼙"],shá:["啥"],"lā la":["啦"],"yīng qíng":["啨"],pā:["啪","妑","舥","葩","趴"],"zhě shì":["啫"],sè:["啬","嗇","懎","擌","栜","歮","涩","渋","澀","澁","濇","濏","瀒","瑟","璱","瘷","穑","穡","穯","繬","譅","轖","銫","鏼","铯","飋"],niè:["啮","嗫","噛","嚙","囁","囓","圼","孼","孽","嵲","嶭","巕","帇","敜","枿","槷","櫱","涅","湼","痆","篞","籋","糱","糵","聂","聶","臬","臲","蘖","蠥","讘","踂","踗","踙","蹑","躡","錜","鎳","鑈","鑷","钀","镊","镍","闑","陧","隉","顳","颞","齧","𫔶"],"luō luó luo":["啰","囉"],"tān chǎn tuō":["啴"],bo:["啵","蔔"],dìng:["啶","定","椗","矴","碇","碠","磸","聢","腚","萣","蝊","訂","订","錠","锭","顁","飣","饤"],lāng:["啷"],"án ān":["啽"],kā:["喀","擖"],"yóng yú":["喁"],"lā lá lǎ":["喇"],jiē:["喈","喼","嗟","堦","媘","接","掲","擑","湝","煯","疖","痎","癤","皆","秸","稭","脻","蝔","街","謯","阶","階","鞂","鶛"],hóu:["喉","帿","猴","瘊","睺","篌","糇","翭","葔","鄇","鍭","餱","骺","鯸","𬭤"],"dié zhá":["喋"],wāi:["喎","歪","竵"],"nuò rě":["喏"],"xù huò guó":["喐"],zán:["喒"],"wō ō":["喔"],hú:["喖","嘝","囫","壶","壷","壺","媩","弧","搰","斛","楜","槲","湖","瀫","焀","煳","狐","猢","瑚","瓳","箶","絗","縠","胡","葫","蔛","蝴","螜","衚","觳","醐","鍸","頶","餬","鬍","魱","鰗","鵠","鶘","鶦","鹕"],"huàn yuán xuǎn hé":["喛"],xǐ:["喜","囍","壐","屣","徙","憙","枲","橲","歖","漇","玺","璽","矖","禧","縰","葈","葸","蓰","蟢","謑","蹝","躧","鈢","鉨","鉩","鱚","𬭳","𬶮"],"hē hè yè":["喝"],kuì:["喟","嘳","媿","嬇","愦","愧","憒","篑","簣","籄","聩","聭","聵","膭","蕢","謉","餽","饋","馈"],"zhǒng chuáng":["喠"],"wéi wèi":["喡","為","爲"],"duó zhà":["喥"],"sāng sàng":["喪"],"qiáo jiāo":["喬"],"pèn bēn":["喯"],"cān sūn qī":["喰"],"zhā chā":["喳"],miāo:["喵"],"pēn pèn":["喷"],kuí:["喹","夔","奎","巙","戣","揆","晆","暌","楏","楑","櫆","犪","睽","葵","藈","蘷","虁","蝰","躨","逵","鄈","鍨","鍷","頯","馗","騤","骙","魁"],"lou lóu":["喽"],"zào qiāo":["喿"],"hè xiāo xiào hù":["嗃"],"á shà":["嗄"],xiù:["嗅","岫","峀","溴","珛","琇","璓","秀","綉","繍","繡","绣","螑","袖","褎","褏","銹","鏥","鏽","锈","齅"],"qiāng qiàng":["嗆","戗","戧","蹌","蹡"],"ài yì":["嗌","艾"],"má mǎ ma":["嗎"],"kè kē":["嗑"],"dā tà":["嗒","鎉"],sǎng:["嗓","搡","磉","褬","鎟","顙","颡"],chēn:["嗔","抻","琛","瞋","諃","謓","賝","郴","𬘭"],"wā gǔ":["嗗"],"pǎng bēng":["嗙"],"xián qiǎn qiān":["嗛"],lào:["嗠","嫪","橯","涝","澇","耢","耮","躼","軂","酪"],wēng:["嗡","翁","聬","螉","鎓","鶲","鹟","𬭩"],wà:["嗢","腽","膃","袜","襪","韤"],"hēi hāi":["嗨"],hē:["嗬","欱","蠚","訶","诃"],zi:["嗭"],sǎi:["嗮"],"ǹg ńg ňg":["嗯"],gě:["嗰","舸"],ná:["嗱","拏","拿","鎿","镎"],diǎ:["嗲"],"ài ǎi āi":["嗳"],tōng:["嗵","樋","炵","蓪"],"zuī suī":["嗺"],"zhē zhè zhù zhe":["嗻"],mò:["嗼","圽","塻","墨","妺","嫼","寞","帞","昩","末","枺","歿","殁","沫","漠","爅","獏","瘼","皌","眽","眿","瞐","瞙","砞","礳","秣","絈","纆","耱","茉","莈","蓦","蛨","蟔","貃","貊","貘","銆","鏌","镆","陌","靺","驀","魩","默","黙","𬙊"],sòu:["嗽","瘶"],tǎn:["嗿","坦","忐","憳","憻","暺","毯","璮","菼","袒","襢","醓","鉭","钽"],"jiào dǎo":["嘄"],"kǎi gě":["嘅"],"shān càn":["嘇"],cáo:["嘈","嶆","曹","曺","槽","漕","艚","蓸","螬","褿","鏪","𥕢"],piào:["嘌","徱","蔈","驃"],"lóu lou":["嘍"],gǎ:["尕","玍"],"gǔ jiǎ":["嘏"],"jiāo xiāo":["嘐"],"xū shī":["嘘","噓"],pó:["嘙","嚩","婆","櫇","皤","鄱"],"dē dēi":["嘚"],"ma má":["嘛"],"lē lei":["嘞"],"gā gá gǎ":["嘠"],sāi:["嘥","噻","毢","腮","顋","鰓"],"zuō chuài":["嘬"],"cháo zhāo":["嘲","朝","鼂"],zuǐ:["嘴","噿","嶊","璻"],"qiáo qiào":["嘺","翹","谯"],"chù xù shòu":["嘼"],"tān chǎn":["嘽"],"dàn tán":["嘾","弾","彈","惔","澹"],"hēi mò":["嘿"],ě:["噁","砨","頋","騀","鵈"],"fān bo":["噃"],chuáng:["噇","床","牀"],"cù zā hé":["噈"],"tūn kuò":["噋"],"cēng chēng":["噌"],dēng:["噔","嬁","灯","燈","璒","登","竳","簦","艠","豋"],pū:["噗","扑","撲","攴","攵","潽","炇","陠"],juē:["噘","屩","屫","撧"],lū:["噜","嚕","撸","擼","謢"],zhān:["噡","岾","惉","旃","旜","枬","栴","毡","氈","氊","沾","瞻","薝","蛅","詀","詹","譫","谵","趈","邅","閚","霑","飦","饘","驙","魙","鱣","鸇","鹯","𫗴"],ō:["噢"],"zhòu zhuó":["噣"],"jiào qiào chī":["噭"],yuàn:["噮","妴","怨","愿","掾","瑗","禐","苑","衏","裫","褑","院","願"],"ǎi ài āi":["噯"],"yōng yǒng":["噰","澭"],"jué xué":["噱"],"pēn pèn fèn":["噴"],gá:["噶","尜","釓","錷","钆"],"xīn hěn hèn":["噷"],dāng:["噹","澢","珰","璫","筜","簹","艡","蟷","裆","襠"],làn:["嚂","滥","濫","烂","燗","爁","爛","爤","瓓","糷","钄"],tà:["嚃","嚺","崉","挞","搨","撻","榻","橽","毾","涾","澾","濌","禢","粏","誻","譶","蹋","蹹","躂","躢","遝","錔","闒","闥","闼","阘","鞜","鞳"],"huō huò ǒ":["嚄"],hāo:["嚆","茠","蒿","薅"],"hè xià":["嚇"],"xiù pì":["嚊"],"zhōu chóu":["嚋","盩","诪"],mē:["嚒"],"chā cā":["嚓"],"bó pào bào":["嚗"],"me mèi mò":["嚜"],"xié hái":["嚡"],"áo xiāo":["嚣"],mō:["嚤","摸"],pín:["嚬","娦","嫔","嬪","玭","矉","薲","蠙","貧","贫","顰","颦","𬞟"],mè:["嚰","濹"],"rǎng rāng":["嚷"],lá:["嚹","旯"],"jiáo jué jiào":["嚼"],chuò:["嚽","娖","擉","歠","涰","磭","踀","輟","辍","辵","辶","酫","鑡","餟","齪","龊"],"huān huàn":["嚾"],"zá cà":["囃"],chài:["囆","虿","蠆","袃","訍"],"náng nāng":["囊"],"zá zàn cān":["囋"],sū:["囌","櫯","甦","稣","穌","窣","蘇","蘓","酥","鯂"],zèng:["囎","熷","甑","贈","赠","鋥","锃"],"zá niè yàn":["囐"],nāng:["囔"],"luó luō luo":["囖"],"wéi guó":["囗"],huí:["囘","回","囬","廻","廽","恛","洄","痐","茴","蚘","蛔","蛕","蜖","迴","逥","鮰"],nín:["囜","您","脌"],"jiǎn nān":["囝"],nān:["囡"],tuán:["团","団","團","慱","抟","摶","檲","糰","鏄","鷒","鷻"],"tún dùn":["囤","坉"],guó:["囯","囶","囻","国","圀","國","帼","幗","慖","摑","漍","聝","腘","膕","蔮","虢","馘","𬇹"],kùn:["困","涃","睏"],"wéi tōng":["囲"],qūn:["囷","夋","逡"],rì:["囸","日","衵","鈤","馹","驲"],tāi:["囼","孡","胎"],pǔ:["圃","圑","擈","普","暜","樸","檏","氆","浦","溥","烳","諩","譜","谱","蹼","鐠","镨"],"quān juàn juān":["圈","圏"],"chuí chuán":["圌"],tuǎn:["圕","畽","疃"],lüè:["圙","掠","略","畧","稤","鋝","鋢","锊","䂮"],"huán yuán":["圜"],luán:["圝","圞","奱","娈","孌","孪","孿","峦","巒","挛","攣","曫","栾","欒","滦","灤","癴","癵","羉","脔","臠","虊","銮","鑾","鵉","鸞","鸾"],tǔ:["土","圡","釷","钍"],"xū wéi":["圩"],"dì de":["地","嶳"],"qiān sú":["圱"],zhèn:["圳","塦","挋","振","朕","栚","甽","眹","紖","絼","纼","誫","賑","赈","鋴","鎭","鎮","镇","阵","陣","震","鴆","鸩"],"chǎng cháng":["场","場","塲"],"qí yín":["圻"],jiá:["圿","忦","恝","戞","扴","脥","荚","莢","蛱","蛺","裌","跲","郏","郟","鋏","铗","頬","頰","颊","鴶","鵊"],"zhǐ zhì":["坁"],bǎn:["坂","岅","昄","板","版","瓪","粄","舨","蝂","鈑","钣","阪","魬"],qǐn:["坅","寑","寝","寢","昑","梫","笉","螼","赾","鋟","锓"],"méi fén":["坆"],"rǒng kēng":["坈"],"fāng fáng":["坊"],"fèn bèn":["坋"],tān:["坍","怹","摊","擹","攤","滩","灘","瘫","癱","舑","貪","贪"],"huài pēi pī péi":["坏"],"dì làn":["坔"],tán:["坛","墰","墵","壇","壜","婒","憛","昙","曇","榃","檀","潭","燂","痰","磹","罈","罎","藫","談","譚","譠","谈","谭","貚","郯","醰","錟","顃"],bà:["坝","垻","壩","弝","欛","灞","爸","矲","覇","霸","鮁","鲅"],fén:["坟","墳","妢","岎","幩","枌","棼","汾","焚","燌","燓","羒","羵","蒶","蕡","蚠","蚡","豮","豶","轒","鐼","隫","馩","魵","黂","鼖","鼢","𣸣"],zhuì:["坠","墜","惴","甀","畷","礈","綴","縋","缀","缒","腏","膇","諈","贅","赘","醊","錣","鑆"],pō:["坡","岥","泼","溌","潑","釙","鏺","钋","頗","颇","䥽"],"pǎn bàn":["坢"],kūn:["坤","堃","堒","崐","崑","昆","晜","潉","焜","熴","猑","琨","瑻","菎","蜫","裈","裩","褌","醌","錕","锟","騉","髠","髡","髨","鯤","鲲","鵾","鶤","鹍"],diàn:["坫","垫","墊","壂","奠","婝","店","惦","扂","橂","殿","淀","澱","玷","琔","电","癜","簟","蜔","鈿","電","靛","驔"],"mù mǔ":["坶"],"kē kě":["坷","軻"],xuè:["坹","岤","桖","瀥","狘","瞲","謔","谑","趐"],"dǐ chí":["坻","柢"],lā:["垃","柆","菈","邋"],lǒng:["垄","垅","壟","壠","拢","攏","竉","陇","隴","𬕂"],mín:["垊","姄","岷","崏","捪","旻","旼","民","珉","琘","琝","瑉","痻","盿","砇","緍","緡","缗","罠","苠","鈱","錉","鍲","鴖"],"dòng tóng":["垌","峒","洞"],cí:["垐","嬨","慈","柌","濨","珁","瓷","甆","磁","礠","祠","糍","茨","詞","词","辝","辞","辤","辭","雌","飺","餈","鴜","鶿","鷀","鹚"],duī:["垖","堆","塠","痽","磓","鐓","鐜","鴭"],"duò duǒ":["垛"],"duǒ duò":["垜","挆"],chá:["垞","察","嵖","搽","槎","檫","猹","茬","茶","詧","靫","𥻗"],shǎng:["垧","晌","樉","賞","贘","赏","鋿","鏛","鑜"],shǒu:["垨","守","手","扌","艏","首"],da:["垯","繨","跶"],háng:["垳","斻","杭","筕","絎","绗","航","苀","蚢","裄","貥","迒","頏","颃","魧"],"ān ǎn":["垵"],xīng:["垶","惺","星","曐","煋","猩","瑆","皨","篂","腥","興","觪","觲","謃","騂","骍","鮏","鯹"],"yuàn huán":["垸"],bāng:["垹","帮","幇","幚","幫","捠","梆","浜","邦","邫","鞤","𠳐"],"póu fú":["垺"],cén:["埁","岑","涔"],"běng fēng":["埄"],"dì fáng":["埅"],"xiá jiā":["埉"],"mái mán":["埋"],làng:["埌","崀","浪","蒗","閬","㫰"],"shān yán":["埏"],"qín jīn":["埐"],"pǔ bù":["埔"],huā:["埖","婲","椛","硴","糀","花","蒊","蘤","誮","錵"],"suì sù":["埣"],"pí pì":["埤"],"qīng zhēng":["埥","鲭"],"wǎn wān":["埦"],lǔn:["埨","稐","𫭢"],"zhēng chéng":["埩"],kōng:["埪","崆","箜","躻","錓","鵼"],"cǎi cài":["埰","寀","采"],"chù tòu":["埱"],běng:["埲","琫","菶","鞛"],"kǎn xiàn":["埳"],"yì shì":["埶","醳"],péi:["培","毰","裴","裵","賠","赔","錇","锫","阫","陪"],"sào sǎo":["埽"],"jǐn qīn jìn":["堇"],"péng bèng":["堋"],"qiàn zàn jiàn":["堑"],àn:["堓","屵","岸","按","暗","案","胺","荌","豻","貋","錌","闇","隌","黯"],"duò huī":["堕","墮"],huán:["堚","寏","寰","峘","桓","洹","澴","獂","环","環","糫","繯","缳","羦","荁","萈","萑","豲","鍰","鐶","锾","镮","闤","阛","雈","鬟","鹮","𬘫","𤩽"],"bǎo bǔ pù":["堡"],"máo móu wǔ":["堥"],ruán:["堧","壖","撋"],"ài è yè":["堨"],gèng:["堩","暅"],méi:["堳","塺","媒","嵋","徾","攗","枚","栂","梅","楣","楳","槑","湄","湈","煤","猸","玫","珻","瑂","眉","睂","禖","脄","脢","腜","苺","莓","葿","郿","酶","鎇","镅","霉","鶥","鹛","黴"],dǔ:["堵","琽","睹","笃","篤","覩","賭","赌"],féng:["堸","綘","艂","逢"],hèng:["堼"],chūn:["堾","媋","旾","春","暙","杶","椿","槆","橁","櫄","瑃","箺","萅","蝽","輴","鰆","鶞","䲠"],jiǎng:["塂","奖","奨","奬","桨","槳","獎","耩","膙","蒋","蔣","講","讲","顜"],huāng:["塃","巟","慌","肓","荒","衁"],duàn:["塅","断","斷","椴","段","毈","煅","瑖","碫","簖","籪","緞","缎","腶","葮","躖","鍛","锻"],tǎ:["塔","墖","獭","獺","鮙","鰨","鳎"],wěng:["塕","奣","嵡","攚","暡","瞈","蓊"],"sāi sài sè":["塞"],zàng:["塟","弉","臓","臟","葬","蔵","銺"],tián:["塡","屇","恬","沺","湉","璳","甛","甜","田","畋","畑","碵","磌","胋","闐","阗","鴫","鷆","鷏"],zhèng:["塣","幁","政","証","諍","證","证","诤","郑","鄭","靕","鴊"],"tián zhèn":["填"],wēn:["塭","昷","榲","殟","温","溫","瑥","瘟","蕰","豱","輼","轀","辒","鎾","饂","鰛","鰮","鳁"],liù:["塯","廇","磟","翏","雡","霤","餾","鬸","鷚","鹨"],hǎi:["塰","海","烸","酼","醢"],lǎng:["塱","朖","朗","朤","烺","蓢","㮾"],bèng:["塴","揼","泵","甏","綳","蹦","迸","逬","鏰","镚"],chén:["塵","宸","尘","忱","敐","敶","晨","曟","栕","樄","沉","煁","瘎","臣","茞","莀","莐","蔯","薼","螴","訦","諶","軙","辰","迧","鈂","陈","陳","霃","鷐","麎"],"ōu qiū":["塸"],"qiàn jiàn":["塹"],"zhuān tuán":["塼"],shuǎng:["塽","慡","漺","爽","縔","鏯"],shú:["塾","婌","孰","璹","秫","贖","赎"],lǒu:["塿","嵝","嶁","甊","篓","簍"],chí:["墀","弛","持","池","漦","竾","筂","箎","篪","茌","荎","蚳","謘","貾","赿","踟","迟","迡","遅","遟","遲","鍉","馳","驰"],shù:["墅","庶","庻","怷","恕","戍","束","树","樹","沭","漱","潄","濖","竖","竪","絉","腧","荗","蒁","虪","術","裋","豎","述","鉥","錰","鏣","霔","鶐","𬬸"],"dì zhì":["墆","疐"],kàn:["墈","崁","瞰","矙","磡","衎","鬫"],chěn:["墋","夦","硶","碜","磣","贂","趻","踸","鍖"],"zhǐ zhuó":["墌"],qiǎng:["墏","繈","繦","羥","襁"],zēng:["増","增","憎","璔","矰","磳","罾","譄","鄫","鱛","䎖"],qiáng:["墙","墻","嫱","嬙","樯","檣","漒","牆","艢","蔃","蔷","蘠"],"kuài tuí":["墤"],"tuǎn dǒng":["墥"],"qiáo què":["墧"],"zūn dūn":["墫"],"qiāo áo":["墽"],"yì tú":["墿"],"xué bó jué":["壆"],lǎn:["壈","嬾","孄","孏","懒","懶","揽","擥","攬","榄","欖","浨","漤","灠","纜","缆","罱","覧","覽","览","醂","顲"],huài:["壊","壞","蘾"],rǎng:["壌","壤","攘","爙"],"làn xiàn":["壏"],dǎo:["壔","导","導","岛","島","嶋","嶌","嶹","捣","搗","擣","槝","祷","禂","禱","蹈","陦","隝","隯"],ruǐ:["壡","桵","橤","繠","蕊","蕋","蘂","蘃"],san:["壭"],zhuàng:["壮","壯","壵","撞","焋","状","狀"],"ké qiào":["壳","殼"],kǔn:["壸","壼","悃","捆","梱","硱","祵","稇","稛","綑","裍","閫","閸","阃"],mǎng:["壾","漭","茻","莽","莾","蠎"],cún:["壿","存"],"zhǐ zhōng":["夂"],"gǔ yíng":["夃"],"jiàng xiáng":["夅","降"],"páng féng fēng":["夆"],zhāi:["夈","捚","摘","斋","斎","榸","粂","齋"],"xuàn xiòng":["夐"],wài:["外","顡"],"wǎn yuàn wān yuān":["夗"],"mǎo wǎn":["夘"],mèng:["夢","夣","孟","梦","癦","霥"],"dà dài":["大"],"fū fú":["夫","姇","枎","粰"],guài:["夬","怪","恠"],yāng:["央","姎","抰","殃","泱","秧","胦","鉠","鍈","雵","鴦","鸯"],"hāng bèn":["夯"],gǎo:["夰","搞","杲","槀","槁","檺","稁","稾","稿","縞","缟","菒","藁","藳"],"tāo běn":["夲"],"tóu tou":["头"],"yǎn tāo":["夵"],"kuā kuà":["夸","誇"],"jiá jiā gā xiá":["夹"],huà:["夻","婳","嫿","嬅","崋","摦","杹","枠","桦","槬","樺","澅","画","畫","畵","繣","舙","話","諙","譮","话","黊"],"jiā jiá gā xiá":["夾"],ēn:["奀","恩","蒽"],"dī tì":["奃"],"yǎn yān":["奄","渰"],pào:["奅","疱","皰","砲","礟","礮","靤","麭"],nài:["奈","柰","渿","耐","萘","褦","錼","鼐"],"quān juàn":["奍","弮","棬"],zòu:["奏","揍"],"qì qiè xiè":["契"],kāi:["奒","开","揩","鐦","锎","開"],"bēn bèn":["奔","泍"],tào:["套"],"zàng zhuǎng":["奘"],běn:["奙","本","楍","畚","翉","苯"],"xùn zhuì":["奞"],shē:["奢","檨","猞","畭","畲","賒","賖","赊","輋","𪨶"],"hǎ pò tǎi":["奤"],"ào yù":["奥","奧","澚"],yūn:["奫","氲","氳","蒀","蒕","蝹","贇","赟","𫖳"],"duǒ chě":["奲"],"nǚ rǔ":["女"],nú:["奴","孥","笯","駑","驽"],"dīng dǐng tiǎn":["奵"],"tā jiě":["她"],nuán:["奻"],"hǎo hào":["好"],fàn:["奿","嬎","梵","汎","泛","滼","瀪","犯","畈","盕","笵","範","范","訉","販","贩","軬","輽","飯","飰","饭"],shuò:["妁","搠","朔","槊","烁","爍","矟","蒴","鎙","鑠","铄"],"fēi pèi":["妃"],wàng:["妄","忘","旺","望","朢"],zhuāng:["妆","妝","娤","庄","庒","桩","梉","樁","粧","糚","荘","莊","装","裝"],mā:["妈","媽"],"fū yōu":["妋"],"hài jiè":["妎"],dù:["妒","妬","杜","殬","渡","秺","芏","荰","螙","蠧","蠹","鍍","镀","靯","𬭊"],miào:["妙","庙","庿","廟","玅","竗"],"fǒu pēi pī":["妚"],"yuè jué":["妜"],niū:["妞"],"nà nàn":["妠"],tuǒ:["妥","嫷","庹","椭","楕","橢","鬌","鰖","鵎"],"wàn yuán":["妧"],fáng:["妨","房","肪","防","魴","鲂"],nī:["妮"],zhóu:["妯","碡"],zhāo:["妱","巶","招","昭","釗","鉊","鍣","钊","駋","𬬿"],"nǎi nǐ":["妳"],tǒu:["妵","敨","紏","蘣","黈"],"xián xuán xù":["妶"],"zhí yì":["妷","秇"],ē:["妸","妿","婀","屙"],mèi:["妹","媚","寐","抺","旀","昧","沬","煝","痗","眛","睸","祙","篃","蝞","袂","跊","鬽","魅"],"qī qì":["妻"],"xū xǔ":["姁","稰"],"shān shàn":["姍","姗","苫","釤","钐"],mán:["姏","慲","樠","蛮","蠻","謾","饅","馒","鬗","鬘","鰻","鳗"],jiě:["姐","媎","檞","毑","飷"],"wěi wēi":["委"],pīn:["姘","拼","礗","穦","馪","驞"],"huá huó":["姡"],"jiāo xiáo":["姣"],"gòu dù":["姤"],"lǎo mǔ":["姥"],"nián niàn":["姩"],zhěn:["姫","屒","弫","抮","昣","枕","畛","疹","眕","稹","縝","縥","缜","聄","萙","袗","裖","覙","診","诊","軫","轸","辴","駗","鬒"],héng:["姮","恆","恒","烆","珩","胻","蘅","衡","鑅","鴴","鵆","鸻"],"jūn xún":["姰"],"kuā hù":["姱"],"è yà":["姶"],"xiān shēn":["姺"],wá:["娃"],"ráo rǎo":["娆","嬈"],"shào shāo":["娋"],xiē:["娎","揳","楔","歇","蝎","蠍"],"wǔ méi mǔ":["娒"],"chuò lài":["娕"],niáng:["娘","嬢","孃"],"nà nuó":["娜","𦰡"],"pōu bǐ":["娝"],"něi suī":["娞"],tuì:["娧","煺","蛻","蜕","退","駾"],mǎn:["娨","屘","満","满","滿","螨","蟎","襔","鏋"],"wú wù yú":["娪"],"xī āi":["娭"],"zhuì shuì":["娷"],"dōng dòng":["娻"],"ǎi ái è":["娾"],"ē ě":["娿"],mián:["婂","嬵","宀","杣","棉","檰","櫋","眠","矈","矊","矏","綿","緜","绵","芇","蝒"],"pǒu péi bù":["婄"],biǎo:["婊","脿","表","裱","褾","諘","錶"],"fù fàn":["婏"],wǒ:["婐","婑","我"],"ní nǐ":["婗","棿"],"quán juàn":["婘","惓"],hūn:["婚","昏","昬","棔","涽","睧","睯","碈","荤","葷","蔒","轋","閽","阍"],"qiān jǐn":["婜"],"wān wà":["婠"],"lái lài":["婡","徕","徠"],"zhōu chōu":["婤"],"chuò nào":["婥"],"nüè àn":["婩"],"hùn kūn":["婫"],"dàng yáng":["婸"],nàn:["婻"],"ruò chuò":["婼"],jiǎ:["婽","岬","斚","斝","榎","槚","檟","玾","甲","胛","鉀","钾"],"tōu yú":["婾","媮"],"yù yú":["媀"],"wéi wěi":["媁"],"dì tí":["媂","珶","苐"],róu:["媃","揉","柔","渘","煣","瑈","瓇","禸","粈","糅","脜","腬","葇","蝚","蹂","輮","鍒","鞣","騥","鰇","鶔","𫐓"],"ruǎn nèn":["媆"],miáo:["媌","嫹","描","瞄","苗","鶓","鹋"],"yí pèi":["媐"],"mián miǎn":["媔"],"tí shì":["媞","惿"],"duò tuó":["媠","沲"],ǎo:["媪","媼","艹","芺","袄","襖","镺"],"chú zòu":["媰"],yìng:["媵","映","暎","硬","膡","鱦"],"qín shēn":["嫀"],jià:["嫁","幏","架","榢","稼","駕","驾"],sǎo:["嫂"],"zhēn zhěn":["嫃"],"jiē suǒ":["嫅"],"míng mǐng":["嫇"],niǎo:["嫋","嬝","嬲","茑","蔦","袅","裊","褭","鸟"],tāo:["嫍","幍","弢","慆","掏","搯","槄","涛","滔","濤","瑫","絛","縚","縧","绦","詜","謟","轁","鞱","韜","韬","飸","饕"],biáo:["嫑"],"piáo piāo":["嫖","薸"],xuán:["嫙","悬","懸","暶","檈","漩","玄","璇","璿","痃","蜁","𫠊"],"màn mān":["嫚"],kāng:["嫝","嵻","康","慷","槺","漮","砊","穅","糠","躿","鏮","鱇","𡐓","𩾌"],"hān nǎn":["嫨"],nèn:["嫩","嫰"],zhē:["嫬","遮"],"mā má":["嫲"],piè:["嫳"],zhǎn:["嫸","展","搌","斩","斬","琖","盏","盞","輾","醆","颭","飐"],"xiān yǎn jìn":["嬐"],liǎn:["嬚","敛","斂","琏","璉","羷","脸","臉","蔹","蘝","蘞","裣","襝","鄻"],"qióng huán xuān":["嬛"],dǒng:["嬞","懂","箽","董","蕫","諌"],cān:["嬠","湌","爘","飡","餐","驂","骖"],tiǎo:["嬥","宨","晀","朓","窱","脁"],bí:["嬶","荸","鼻"],liǔ:["嬼","柳","栁","桞","桺","橮","熮","珋","綹","绺","罶","羀","鋶","锍"],"qiān xiān":["孅","欦"],"xié huī":["孈"],"huān quán":["孉"],"lí lì":["孋","麗"],"zhú chuò":["孎"],kǒng:["孔","恐"],"mā zī":["孖"],"sūn xùn":["孙","孫"],"bèi bó":["孛","誖"],"yòu niū":["孧"],zhuǎn:["孨","竱","轉"],hái:["孩","骸"],nāo:["孬"],"chán càn":["孱"],bò:["孹","檗","蘗","譒"],nái:["孻","腉"],"níng nìng":["宁","寍","寗","寜","寧","甯"],zhái:["宅"],"tū jiā":["宊"],sòng:["宋","訟","誦","讼","诵","送","鎹","頌","颂","餸"],ròu:["宍","肉","譳"],zhūn:["宒","窀","衠","諄","谆","迍"],"mì fú":["宓"],"dàng tàn":["宕"],"wǎn yuān":["宛"],chǒng:["宠","寵"],qún:["宭","峮","帬","羣","群","裙","裠"],zǎi:["宰","崽"],"bǎo shí":["宲"],"jiā jia jie":["家"],"huāng huǎng":["宺"],kuān:["宽","寛","寬","臗","鑧","髋","髖"],"sù xiǔ xiù":["宿"],"jié zǎn":["寁"],"bìng bǐng":["寎"],"jìn qǐn":["寖"],"lóu jù":["寠"],"xiě xiè":["寫"],"qīn qìn":["寴"],cùn:["寸","籿"],duì:["对","対","對","怼","憝","懟","濧","瀩","碓","祋","綐","薱","譈","譵","轛","队","陮"],"lüè luó":["寽"],"shè yè yì":["射"],"jiāng jiàng qiāng":["将"],"jiāng jiàng":["將","浆","漿","畺"],zūn:["尊","嶟","樽","罇","遵","鐏","鱒","鳟","鶎","鷷","𨱔"],"shù zhù":["尌","澍"],xiǎo:["小","晓","暁","曉","皛","皢","筱","筿","篠","謏","𫍲"],"jié jí":["尐","诘","鞊"],"shǎo shào":["少"],ěr:["尒","尓","尔","栮","毦","洱","爾","珥","耳","薾","衈","趰","迩","邇","鉺","铒","餌","饵","駬"],"wāng yóu":["尢"],wāng:["尣","尩","尪","尫","汪"],liào:["尥","尦","廖","撂","料","炓","窷","鐐","镣","𪤗"],"méng máng lóng páng":["尨"],gà:["尬","魀"],"kuì kuǐ":["尯"],tuí:["尵","弚","穨","蘈","蹪","隤","頹","頺","頽","颓","魋","𬯎"],yǐn:["尹","嶾","引","朄","檃","檼","櫽","淾","濥","瘾","癮","粌","蘟","蚓","螾","讔","赺","趛","輑","鈏","靷"],"chǐ chě":["尺"],kāo:["尻","髛"],"jìn jǐn":["尽"],"wěi yǐ":["尾"],"niào suī":["尿"],céng:["层","層","嶒","驓"],diǎo:["屌"],"píng bǐng bīng":["屏"],lòu:["屚","漏","瘘","瘺","瘻","鏤","镂","陋"],"shǔ zhǔ":["属","屬"],"xiè tì":["屟"],"chè cǎo":["屮"],"tún zhūn":["屯"],"nì jǐ":["屰"],"hóng lóng":["屸"],"qǐ kǎi":["岂","豈"],áng:["岇","昂","昻"],"gǎng gāng":["岗","崗"],kě:["岢","敤","渇","渴","炣"],gǒu:["岣","狗","玽","笱","耇","耈","耉","苟","豿"],tiáo:["岧","岹","樤","祒","笤","芀","萔","蓚","蓨","蜩","迢","鋚","鎥","鞗","髫","鯈","鰷","鲦","齠","龆"],"qū jū":["岨"],lǐng:["岭","嶺","領","领"],pò:["岶","敀","洦","湐","烞","珀","破","砶","粕","蒪","魄"],"bā kè":["峇"],luò:["峈","摞","洛","洜","犖","珞","笿","纙","荦","詻","雒","駱","骆","鵅"],"fù niè":["峊"],ěn:["峎"],"zhì shì":["峙","崻"],qiǎ:["峠","跒","酠","鞐"],"qiáo jiào":["峤","癄"],"xié yé":["峫"],bū:["峬","庯","晡","誧","逋","鈽","錻","钸","餔","鵏"],chóng:["崇","崈","爞","虫","蝩","蟲","褈","隀"],"zú cuì":["崒","椊"],"líng léng":["崚"],"dòng dōng":["崠"],xiáo:["崤","洨","淆","訤","誵"],"pí bǐ":["崥","芘"],"zhǎn chán":["崭","嶃","嶄"],"wǎi wēi":["崴"],"yáng dàng":["崵"],"shì dié":["崼"],yào:["崾","曜","熎","燿","矅","穾","窔","筄","耀","艞","药","葯","薬","藥","袎","覞","詏","讑","靿","鷂","鹞","鼼"],"kān zhàn":["嵁"],"hán dǎng":["嵅"],"qiàn kàn":["嵌"],"wù máo":["嵍"],"kě jié":["嵑","嶱"],"wēi wěi":["嵔"],kē:["嵙","柯","棵","榼","樖","牁","牱","犐","珂","疴","瞌","磕","礚","科","稞","窠","萪","薖","蚵","蝌","趷","轲","醘","鈳","钶","頦","顆","颗","髁"],"dàng táng":["嵣"],"róng yíng":["嵤","爃"],"ái kǎi":["嵦"],"kāo qiāo":["嵪"],cuó:["嵯","嵳","痤","矬","蒫","蔖","虘","鹺","鹾"],"qiǎn qīn":["嵰"],"dì dié":["嵽"],cēn:["嵾"],dǐng:["嵿","艼","薡","鐤","頂","顶","鼎","鼑"],"áo ào":["嶅"],"pǐ pèi":["嶏"],"jiào qiáo":["嶠","潐"],"jué guì":["嶡","鳜"],"zhān shàn":["嶦","鳣"],"xiè jiè":["嶰"],"guī xī juàn":["嶲"],rū:["嶿"],"lì liè":["巁","棙","爄","綟"],"xī guī juàn":["巂"],"yíng hōng":["巆"],yǐng:["巊","廮","影","摬","梬","潁","瘿","癭","矨","穎","郢","鐛","頴","颍","颕","颖"],chǎo:["巐","炒","煼","眧","麨"],cuán:["巑","櫕","欑"],chuān:["巛","川","氚","瑏","穿"],"jīng xíng":["巠"],cháo:["巢","巣","晁","漅","潮","牊","窲","罺","謿","轈","鄛","鼌"],qiǎo:["巧","愀","髜"],gǒng:["巩","廾","拱","拲","栱","汞","珙","輁","鞏"],"chà chā chāi cī":["差"],"xiàng hàng":["巷"],shuài:["帅","帥","蟀"],pà:["帊","帕","怕","袙"],"tǎng nú":["帑"],"mò wà":["帓"],"tiē tiě tiè":["帖"],zhǒu:["帚","晭","疛","睭","箒","肘","菷","鯞"],"juǎn juàn":["帣"],shuì:["帨","涗","涚","睡","稅","税","裞"],"chóu dào":["帱","幬"],"jiǎn jiān sàn":["帴"],"shà qiè":["帹"],"qí jì":["帺","荠"],"shān qiāo shēn":["幓"],"zhuàng chuáng":["幢"],"chān chàn":["幨"],miè:["幭","懱","搣","滅","灭","烕","礣","篾","蔑","薎","蠛","衊","鑖","鱴","鴓"],"gān gàn":["干"],"bìng bīng":["并","幷"],"jī jǐ":["幾"],"guǎng ān":["广"],guǎng:["広","廣","犷","獷"],me:["庅"],"dùn tún":["庉"],"bài tīng":["庍"],"yìng yīng":["应"],"dǐ de":["底"],"dù duó":["度"],"máng méng páng":["庬"],"bìng píng":["庰"],chěng:["庱","悜","睈","逞","騁","骋"],"jī cuò":["庴"],qǐng:["庼","廎","檾","漀","苘","請","謦","请","頃","顷"],"guī wěi huì":["廆"],"jǐn qín":["廑"],kuò:["廓","扩","拡","擴","濶","筈","萿","葀","蛞","闊","阔","霩","鞟","鞹","韕","頢","鬠"],"qiáng sè":["廧","薔"],"yǐn yìn":["廴","隐","隠","隱","飮","飲","饮"],"pò pǎi":["廹","迫"],"nòng lòng":["弄"],"dì tì tuí":["弟"],"jué zhāng":["弡"],"mí mǐ":["弥","彌","靡"],chāo:["弨","怊","抄","欩","訬","超","鈔","钞"],yi:["弬"],shāo:["弰","旓","烧","焼","燒","筲","艄","萷","蕱","輎","髾","鮹"],"xuān yuān":["弲"],"qiáng qiǎng jiàng":["強","强"],"tán dàn":["弹","醈"],biè:["彆"],"qiáng jiàng qiǎng":["彊"],"jì xuě":["彐"],tuàn:["彖","褖"],yuē:["彟","曰","曱","矱"],"shān xiǎn":["彡"],wén:["彣","文","炆","珳","瘒","繧","聞","芠","蚉","蚊","螡","蟁","閺","閿","闅","闦","闻","阌","雯","馼","駇","魰","鳼","鴍","鼤","𫘜"],"péng bāng":["彭"],"piāo piào":["彯"],"zhuó bó":["彴"],"tuǒ yí":["彵"],"páng fǎng":["彷"],wǎng:["彺","往","徃","惘","枉","棢","網","网","罒","罓","罔","罖","菵","蛧","蝄","誷","輞","辋","魍"],cú:["徂","殂"],"dài dāi":["待"],huái:["徊","怀","懐","懷","槐","淮","耲","蘹","褢","褱","踝"],"wā wàng jiā":["徍"],"chěng zhèng":["徎"],"dé děi de":["得"],"cóng zòng":["從"],"shì tǐ":["徥"],"tí chí":["徲","鶗","鶙"],dé:["徳","德","恴","悳","惪","淂","鍀","锝"],"zhǐ zhēng":["徴","徵"],bié:["徶","癿","莂","蛂","襒","蹩"],"chōng zhǒng":["徸"],"jiǎo jiào":["徼","笅","筊"],"lòng lǒng":["徿"],"qú jù":["忂","渠","瞿","螶"],"dìng tìng":["忊"],gǎi:["忋","改"],rěn:["忍","栠","栣","秹","稔","綛","荏","荵","躵"],chàn:["忏","懴","懺","硟","羼","韂","顫"],tè:["忑","慝","特","蟘","鋱","铽"],"tè tēi tuī":["忒"],"gān hàn":["忓","攼"],"yì qì":["忔"],"tài shì":["忕"],"xī liě":["忚"],"yīng yìng":["応","應","譍"],"mǐn wěn mín":["忞","忟"],"sōng zhōng":["忪"],"yù shū":["忬","悆"],"qí shì":["忯","耆"],"tún zhūn dùn":["忳"],"qián qín":["忴","扲"],hún:["忶","浑","渾","餛","馄","魂","鼲"],niǔ:["忸","扭","炄","狃","紐","纽","莥","鈕","钮","靵"],"kuáng wǎng":["忹"],"kāng hàng":["忼"],"kài xì":["忾","愾"],òu:["怄","慪"],"bǎo bào":["怉"],"mín mén":["怋"],"zuò zhà":["怍"],zěn:["怎"],yàng:["怏","恙","样","様","樣","漾","羕","詇"],"kòu jù":["怐"],"náo niú":["怓"],"zhēng zhèng":["怔","掙","钲","铮"],"tiē zhān":["怗"],"hù gù":["怘"],"cū jù zū":["怚"],"sī sāi":["思"],"yóu chóu":["怞"],"tū dié":["怢"],"yōu yào":["怮"],xuàn:["怰","昡","楦","泫","渲","炫","琄","眩","碹","絢","縼","繏","绚","蔙","衒","袨","贙","鉉","鏇","铉","镟","颴"],"xù xuè":["怴"],"bì pī":["怶"],"xī shù":["怸"],"nèn nín":["恁"],"tiāo yáo":["恌"],"xī qī xù":["恓"],"xiào jiǎo":["恔"],"hū kuā":["恗"],nǜ:["恧","朒","衂","衄"],hèn:["恨"],"dòng tōng":["恫"],"quán zhuān":["恮"],"è wù ě wū":["恶","惡"],tòng:["恸","慟","憅","痛","衕"],"yuān juàn":["悁"],"qiāo qiǎo":["悄"],"jiè kè":["悈"],"hào jiào":["悎"],huǐ:["悔","檓","毀","毁","毇","燬","譭"],"mán mèn":["悗","鞔"],"yī yì":["悘","衣"],quān:["悛","箞","鐉","𨟠"],"kuī lǐ":["悝"],"yì niàn":["悥"],"mèn mēn":["悶"],guàn:["悹","悺","惯","慣","掼","摜","樌","欟","泴","涫","潅","灌","爟","瓘","盥","礶","祼","罆","罐","貫","贯","躀","遦","鏆","鑵","鱹","鸛","鹳"],"kōng kǒng":["悾"],"lǔn lùn":["惀"],guǒ:["惈","果","椁","槨","粿","綶","菓","蜾","裹","褁","輠","餜","馃"],"yuān wǎn":["惌","箢"],"lán lín":["惏"],"yù xù":["惐","淢"],"chuò chuì":["惙"],"hūn mèn":["惛"],"chǎng tǎng":["惝"],"suǒ ruǐ":["惢"],cǎn:["惨","慘","憯","黪","黲","䅟"],cán:["惭","慙","慚","残","殘","蚕","蝅","蠶","蠺"],"dàn dá":["惮","憚"],rě:["惹"],"yú tōu":["愉"],"kài qì":["愒"],"dàng táng shāng yáng":["愓"],"chén xìn dān":["愖"],"kè qià":["愘"],nuò:["愞","懦","懧","掿","搦","榒","稬","穤","糑","糥","糯","諾","诺","蹃","逽","鍩","锘"],gǎn:["感","擀","敢","桿","橄","澉","澸","皯","秆","稈","笴","芉","衦","赶","趕","鱤","鳡"],"còng sōng":["愡"],"sāi sī sǐ":["愢"],"gōng gòng hǒng":["愩","慐"],"shuò sù":["愬","洬"],"yáo yào":["愮"],huàng:["愰","曂","榥","滉","皝","皩","鎤","㿠"],zhěng:["愸","抍","拯","整","晸"],cǎo:["愺","艸","草","騲"],"xì xié":["慀"],"cǎo sāo":["慅"],"xù chù":["慉"],"qiè qiàn":["慊"],"cáo cóng":["慒"],"ào áo":["慠"],"lián liǎn":["慩","梿","槤","櫣"],"jìn qín jǐn":["慬"],"dì chì":["慸"],"zhí zhé":["慹"],"lóu lǚ":["慺","鷜"],còng:["憁","謥"],"zhī zhì":["憄","知","織","织"],chēng:["憆","摚","撐","撑","晿","柽","棦","橕","檉","泟","浾","琤","瞠","碀","緽","罉","蛏","蟶","赪","赬","鏿","鐣","阷","靗","頳","饓"],biē:["憋","虌","鱉","鳖","鼈","龞"],"chéng dèng zhèng":["憕"],"xǐ xī":["憘"],"duì dùn tūn":["憞"],"xiāo jiāo":["憢"],"xián xiàn":["憪"],"liáo liǎo":["憭","燎","爎","爒"],shéng:["憴","縄","繉","繩","绳","譝"],"náo nǎo náng":["憹"],"jǐng jìng":["憼"],"jǐ jiǎo":["憿"],"xuān huān":["懁"],"cǎo sāo sào":["懆"],mèn:["懑","懣","暪","焖","燜"],"mèng méng měng":["懜"],"ài yì nǐ":["懝"],"méng měng":["懞","瞢","矒"],"qí jī jì":["懠"],mǒ:["懡"],"lán xiàn":["懢"],"yōu yǒu":["懮"],"liú liǔ":["懰","藰"],ràng:["懹","譲","讓","让"],huān:["懽","欢","歓","歡","獾","讙","貛","酄","驩","鴅","鵍"],nǎn:["戁","揇","湳","煵","腩","蝻","赧"],"mí mó":["戂"],"gàng zhuàng":["戅","戆"],"zhuàng gàng":["戇"],"xū qu":["戌"],"xì hū":["戏","戯","戲"],"jiá gā":["戛"],zéi:["戝","蠈","賊","贼","鰂","鱡","鲗"],děng:["戥","等"],"hū xì":["戱"],chuō:["戳","踔","逴"],"biǎn piān":["扁"],"shǎng jiōng":["扄"],"shàn shān":["扇"],cái:["才","材","纔","裁","財","财"],"zhā zā zhá":["扎"],"lè lì cái":["扐"],"bā pá":["扒"],"dǎ dá":["打"],rēng:["扔"],"fǎn fú":["払"],"diǎo dí yuē lì":["扚"],"káng gāng":["扛"],"yū wū":["扜"],"yū wū kū":["扝"],"tuō chǐ yǐ":["扡"],"gǔ jié xì gē":["扢"],dèn:["扥","扽"],"sǎo sào":["扫","掃"],rǎo:["扰","擾","隢"],"xī chā qì":["扱"],"bān pān":["扳"],"bā ào":["扷"],"xī zhé":["扸"],"zhì sǔn kǎn":["扻"],zhǎo:["找","沼","瑵"],"kuáng wǎng zài":["抂"],"hú gǔ":["抇","鹄","鹘"],"bǎ bà":["把"],"dǎn shěn":["抌"],"nè nì ruì nà":["抐"],zhuā:["抓","檛","簻","膼","髽"],póu:["抔","裒"],"zhé shé zhē":["折"],"póu pōu fū":["抙","捊"],pāo:["抛","拋","脬","萢"],"ǎo ào niù":["抝"],"lūn lún":["抡","掄"],"qiǎng qiāng chēng":["抢"],"zhǐ zhǎi":["抧"],"bù pū":["抪","柨"],"yǎo tāo":["抭"],"hē hè qiā":["抲"],"nǐ ní":["抳"],"pī pēi":["抷"],"mǒ mò mā":["抹"],chōu:["抽","犨","犫","瘳","篘"],"jiā yá":["拁"],"fú bì":["拂","畐","鶝"],zhǎ:["拃","眨","砟","鮺","鲝"],"dān dàn dǎn":["担"],"chāi cā":["拆"],niān:["拈","蔫"],"lā lá lǎ là":["拉"],"bàn pàn":["拌"],pāi:["拍"],līn:["拎"],guǎi:["拐","枴","柺"],"tuò tà zhí":["拓"],"ào ǎo niù":["拗"],"jū gōu":["拘"],"pīn pàn fān":["拚"],"bài bái":["拜"],bài:["拝","敗","稗","粺","薭","贁","败","韛"],qiá:["拤"],"nǐng níng nìng":["拧"],"zé zhái":["择","擇"],hén:["拫","痕","鞎"],"kuò guā":["括"],"jié jiá":["拮"],nǐn:["拰"],shuān:["拴","栓","閂","闩"],"cún zùn":["拵"],"zā zǎn":["拶","桚"],kǎo:["拷","攷","栲","烤","考"],"yí chǐ hài":["拸"],"cè sè chuò":["拺"],"zhuài zhuāi yè":["拽"],"shí shè":["拾"],bāi:["挀","掰"],"kuò guāng":["挄"],nòng:["挊","挵","齈"],"jiào jiāo":["挍","敎","教"],"kuà kū":["挎"],"ná rú":["挐"],"tiāo tiǎo":["挑"],"dié shè":["挕"],liě:["挘","毟"],"yà yǎ":["挜","掗"],"wō zhuā":["挝"],"xié jiā":["挟","挾"],"dǎng dàng":["挡","擋"],"zhèng zhēng":["挣","正","症"],"āi ái":["挨"],"tuō shuì":["挩","捝"],"tǐ tì":["挮"],"suō shā":["挱"],"sā shā suō":["挲"],"kēng qiān":["挳","摼"],"bàng péng":["挷"],"ruó ruá":["挼"],"jiǎo kù":["捁"],"wǔ wú":["捂"],tǒng:["捅","桶","筒","筩","統","綂","统","㛚"],"huò chì":["捇"],"tú shū chá":["捈"],"lǚ luō":["捋"],"shāo shào":["捎","稍"],niē:["捏","揑"],"shù sǒng sōu":["捒"],"yé yú":["捓"],"jué zhuó":["捔"],"bù pú zhì":["捗"],zùn:["捘","銌"],lāo:["捞","撈","粩"],sǔn:["损","損","榫","笋","筍","箰","鎨","隼"],"wàn wǎn wān yù":["捥"],pěng:["捧","淎","皏"],shě:["捨"],"fǔ fù bǔ":["捬"],dáo:["捯"],"luò luǒ wǒ":["捰"],"juǎn quán":["捲"],"chēn tiǎn":["捵"],"niǎn niē":["捻"],"ruó wěi ré":["捼"],zuó:["捽","昨","秨","稓","筰","莋","鈼"],"wò xiá":["捾"],"qìng qiàn":["掅"],"póu pǒu":["掊"],qiā:["掐","葜"],"pái pǎi":["排"],"qiān wàn":["掔"],"yè yē":["掖"],"niè nǐ yì":["掜"],"huò xù":["掝"],"yàn shàn yǎn":["掞"],"zhěng dìng":["掟"],kòng:["控","鞚"],tuī:["推","蓷","藬"],"zōu zhōu chōu":["掫"],tiàn:["掭","舚"],kèn:["掯","裉","褃"],pá:["掱","杷","潖","爬","琶","筢"],"guó guāi":["掴"],"dǎn shàn":["掸","撣"],"chān xiān càn shǎn":["掺"],sāo:["掻","搔","溞","繅","缫","螦","騒","騷","鰠","鱢","鳋"],pèng:["掽","椪","槰","碰","踫"],"zhēng kēng":["揁"],"jiū yóu":["揂"],"jiān jiǎn":["揃","籛"],"pì chè":["揊"],"sāi zǒng cāi":["揌"],"tí dī dǐ":["提"],"zǒng sōng":["揔"],"huáng yóng":["揘"],"zǎn zuàn":["揝"],"xū jū":["揟"],"ké qiā":["揢"],"chuāi chuǎi chuài tuán zhuī":["揣"],"dì tì":["揥"],"lá là":["揦"],là:["揧","楋","溂","瓎","瘌","翋","臘","蝋","蝲","蠟","辢","辣","鑞","镴","鬎","鯻","𬶟"],"jiē qì":["揭"],"chòng dǒng":["揰"],"dié shé yè":["揲"],"jiàn qián jiǎn":["揵"],yé:["揶","爷","爺","瑘","鋣","鎁","铘"],chān:["搀","摻","攙","裧","襜","覘","觇","辿","鋓"],"gē gé":["搁","擱"],"lǒu lōu":["搂","摟"],"chōu zǒu":["搊"],chuāi:["搋"],sūn:["搎","槂","狲","猻","荪","蓀","蕵","薞","飧","飱"],"róng náng nǎng":["搑"],"péng bàng":["搒"],cuō:["搓","瑳","磋","蹉","遳","醝"],"kē è":["搕"],"nù nuò nòu":["搙"],"lā xié xiàn":["搚"],qiǔ:["搝","糗"],"xiǎn xiān":["搟"],"jié zhé":["搩"],"pán bān pó":["搫"],bān:["搬","攽","斑","斒","班","瘢","癍","肦","螁","螌","褩","辬","頒","颁","𨭉"],"zhì nái":["搱"],"wā wǎ wà":["搲"],huá:["搳","撶","滑","猾","蕐","螖","譁","鏵","铧","驊","骅","鷨"],"qiāng qiǎng chēng":["搶"],"tián shēn":["搷"],"ná nuò":["搻"],èn:["摁"],"shè niè":["摄","攝"],bìn:["摈","擯","殡","殯","膑","臏","髌","髕","髩","鬂","鬓","鬢"],"shā sà shǎi":["摋"],"chǎn sùn":["摌"],"jiū liú liáo jiǎo náo":["摎"],"féng pěng":["摓"],shuāi:["摔"],"dì tú zhí":["摕"],"qì jì chá":["摖"],"sōu sǒng":["摗"],"liǎn liàn":["摙"],"gài xì":["摡"],"hù chū":["摢"],tàng:["摥","烫","燙","鐋"],"nái zhì":["摨"],"mó mā":["摩"],"jiāng qiàng":["摪"],"áo qiáo":["摮"],"niè chè":["摰"],"mán màn":["摱"],"chàn cán":["摲"],"sè mí sù":["摵"],"biāo biào":["摽"],"juē jué":["撅"],piē:["撆","暼","氕","瞥"],"piě piē":["撇"],"zǎn zān zēn qián":["撍"],"sā sǎ":["撒"],hòng:["撔","訌","讧","闀","鬨"],"héng guàng":["撗"],niǎn:["撚","撵","攆","涊","焾","碾","簐","蹍","蹨","躎","輦","辇"],"chéng zhěng":["撜"],"huī wéi":["撝"],cāo:["撡","操","糙"],"xiāo sōu":["撨"],"liáo liāo":["撩"],"cuō zuǒ":["撮"],"wěi tuǒ":["撱"],cuān:["撺","攛","汆","蹿","躥","鑹","镩"],"qiào yāo jī":["撽"],"zhuā wō":["撾"],"lèi léi":["擂"],nǎng:["擃","攮","曩","灢"],"qíng jǐng":["擏"],kuǎi:["擓","蒯","㧟"],"pǐ bò":["擗"],"bò bāi":["擘"],"jù jǐ":["據"],mēng:["擝"],"sǒu sòu":["擞"],xǐng:["擤","箵","醒"],cā:["擦"],"níng nǐng nìng":["擰"],"zhì jié":["擳"],"là liè":["擸","爉"],"sòu sǒu":["擻"],"lì luò yuè":["擽"],"tī zhāi zhì":["擿"],pān:["攀","潘","眅","萠"],lèi:["攂","泪","涙","淚","禷","类","纇","蘱","酹","銇","錑","頛","頪","類","颣"],"cā sǎ":["攃"],"jùn pèi":["攈"],"lì luò":["攊","躒"],"là lài":["攋","櫴"],"lú luó":["攎"],"zǎn cuán":["攒"],"xiān jiān":["攕"],"mí mǐ mó":["攠"],"zǎn cuán zàn zuān":["攢"],zuàn:["攥"],"lì shài":["攦"],"lì luǒ":["攭"],"guǐ guì":["攱"],"jī qī yǐ":["攲"],fàng:["放"],"wù móu":["敄"],"chù shōu":["敊"],"gé guó è":["敋"],"duó duì":["敓","敚"],"duō què":["敠","敪"],"sàn sǎn":["散"],"dūn duì":["敦","镦"],"qī yǐ jī":["敧"],"xiào xué":["敩"],"shù shǔ shuò":["数","數"],"ái zhú":["敱","敳"],"xiòng xuàn":["敻"],"zhuó zhú":["斀"],"yì dù":["斁"],"lí tái":["斄"],"fěi fēi":["斐"],"yǔ zhōng":["斔"],"dòu dǒu":["斗"],"wò guǎn":["斡"],"tǒu tiǎo":["斢"],dòu:["斣","梪","浢","痘","窦","竇","脰","荳","豆","逗","郖","酘","閗","闘","餖","饾","鬥","鬦","鬪","鬬","鬭"],"yín zhì":["斦"],"chǎn jiè":["斺"],"wū yū yú":["於"],"yóu liú":["斿"],"páng bàng":["旁"],"máo mào":["旄"],"pī bì":["旇"],"xuán xuàn":["旋"],"wú mó":["无"],zǎo:["早","枣","栆","棗","澡","璪","薻","藻","蚤"],gā:["旮"],"gàn hàn":["旰"],"tái yīng":["旲"],"xū xù":["旴"],"tūn zhùn":["旽"],"wù wǔ":["旿"],"pò pèi":["昢"],zòng:["昮","猔","疭","瘲","粽","糉","糭","縦"],ǎi:["昹","毐","矮","蔼","藹","譪","躷","霭","靄"],"huàng huǎng":["晃"],xuǎn:["晅","癣","癬","选","選"],"xù kuā":["晇"],hǒng:["晎"],shài:["晒","曬"],"yūn yùn":["晕","煴"],"shèng chéng":["晟","椉","盛"],"jǐng yǐng":["景"],shǎn:["晱","熌","睒","覢","閃","闪","陕","陝"],"qǐ dù":["晵"],"ǎn àn yǎn":["晻"],"wǎng wàng":["暀"],zàn:["暂","暫","瓉","瓒","瓚","禶","襸","讃","讚","賛","贊","赞","蹔","鄼","錾","鏨","饡"],"yùn yūn":["暈"],"mín mǐn":["暋"],"dǔ shǔ":["暏"],shǔ:["暑","曙","潻","癙","糬","署","薥","薯","藷","蜀","蠴","襡","襩","鱪","鱰","黍","鼠","鼡"],"jiǎn lán":["暕"],nuǎn:["暖","煗","餪"],"bào pù":["暴"],"xī xǐ":["暿"],"pù bào":["曝","瀑"],"qū qǔ":["紶"],"qǔ qū":["曲"],"gèng gēng":["更"],"hū hù":["曶","雽"],"zēng céng":["曽","橧"],"céng zēng":["曾","竲"],"cǎn qián jiàn":["朁"],"qiè hé":["朅"],"bì pí":["朇","禆","笓","裨"],"yǒu yòu":["有"],"bān fén":["朌","鳻"],"fú fù":["服","洑"],"fěi kū":["朏","胐"],"qú xù chǔn":["朐"],"juān zuī":["朘"],"huāng máng wáng":["朚"],"qī jī":["期"],"tóng chuáng":["朣","橦"],zhá:["札","牐","箚","蚻","譗","鍘","铡","閘","闸"],"zhú shù shú":["朮"],"shù shú zhú":["术"],"zhū shú":["朱"],"pǔ pò pō piáo":["朴"],"dāo tiáo mù":["朷"],"guǐ qiú":["朹"],xiǔ:["朽","滫","潃","糔"],"chéng chēng":["朾"],zá:["杂","沯","砸","襍","雑","雜","雥","韴"],"yú wū":["杅"],"gān gǎn":["杆"],"chā chà":["杈"],"shān shā":["杉"],cūn:["村","皴","竴","膥","踆","邨"],"rèn ér":["杒","梕"],"sháo biāo":["杓"],"dì duò":["杕","枤"],"gū gài":["杚"],"yí zhì lí duò":["杝"],"gàng gāng":["杠"],"tiáo tiāo":["条","條"],"mà mǎ":["杩"],"sì zhǐ xǐ":["杫"],"yuán wán":["杬","蚖"],"bèi fèi":["杮"],"shū duì":["杸"],"niǔ chǒu":["杻"],"wò yuè":["枂","臒"],máo:["枆","毛","氂","渵","牦","矛","罞","茅","茆","蝥","蟊","軞","酕","鉾","錨","锚","髦","鶜"],"pī mì":["枈"],àng:["枊","盎","醠"],"fāng bìng":["枋"],"hù dǐ":["枑"],xín:["枔","襑","鐔","鬵"],"yāo yǎo":["枖"],"ě è":["枙"],"zhī qí":["枝"],"cōng zōng":["枞","樅"],"xiān zhēn":["枮"],"tái sì":["枱"],"gǒu jǔ gōu":["枸"],"bāo fú":["枹"],"yì xiè":["枻","栧"],"tuó duò":["柁","馱","駄","驮"],"yí duò lí":["柂"],"nǐ chì":["柅"],"pán bàn":["柈","跘"],"yǎng yàng yāng yīng":["柍"],"fù fū fǔ":["柎"],"bǎi bó bò":["柏"],mǒu:["某"],"sháo shào":["柖"],zhè:["柘","樜","浙","淛","蔗","蟅","這","鷓","鹧","䗪"],"yòu yóu":["柚","櫾"],"guì jǔ":["柜"],"zhà zuò":["柞"],"dié zhì":["柣","眰"],"zhā zǔ zū":["柤"],"chá zhā":["查","査"],"āo ào":["柪","軪"],"bā fú pèi bó biē":["柭"],"duò zuó wù":["柮"],"bì bié":["柲"],"zhù chù":["柷"],"bēi pēi":["柸"],"shì fèi":["柹"],"shān zhà shi cè":["栅"],"lì yuè":["栎","櫟"],"qì qiè":["栔","砌"],"qī xī":["栖","蹊"],"guā kuò":["栝"],"bīng bēn":["栟"],"xiào jiào":["校"],"jiàn zùn":["栫","袸"],"yǒu yù":["栯"],"hé hú":["核"],gēn:["根","跟"],"zhī yì":["栺"],"gé gē":["格"],"héng háng":["桁"],"guàng guāng":["桄"],"yí tí":["桋","荑"],sāng:["桑","桒","槡"],"jú jié":["桔"],"yú móu":["桙"],"ráo náo":["桡","橈"],"guì huì":["桧","檜"],"chén zhèn":["桭"],"tīng yíng":["桯"],"bó po":["桲"],"bèn fàn":["桳"],"fēng fèng":["桻","葑"],"sù yìn":["梀"],"tǐng tìng":["梃"],"xuān juān xié":["梋"],"tú chá":["梌"],"āo yòu":["梎"],kuǎn:["梡","欵","款","歀"],"shāo sào":["梢"],"qín chén cén":["梣"],"lí sì qǐ":["梩"],"chān yán":["梴"],"bīn bīng":["梹","槟","檳"],"táo chóu dào":["梼"],"cōng sōng":["棇"],"gùn hùn":["棍"],"dé zhé":["棏"],"pái bèi pèi":["棑"],"bàng pǒu bèi bēi":["棓"],"dì dài tì":["棣"],sēn:["森","椮","槮","襂"],"rěn shěn":["棯"],"léng lēng líng":["棱"],"fú sù":["棴"],"zōu sǒu":["棷"],zōu:["棸","箃","緅","諏","诹","邹","郰","鄒","鄹","陬","騶","驺","鯫","鲰","黀","齱","齺"],"zhào zhuō":["棹"],"chēn shēn":["棽"],"jiē qiè":["椄"],"yǐ yī":["椅"],"chóu zhòu diāo":["椆"],"qiāng kōng":["椌"],"zhuī chuí":["椎"],"bēi pí":["椑"],mēn:["椚"],"quān juàn quán":["椦"],"duǒ chuán":["椯"],"wěi huī":["椲"],"jiǎ jiā":["椵"],"hán jiān":["椷"],"shèn zhēn":["椹"],"yàn yà":["椻"],"zhā chá":["楂"],"guō kuǎ":["楇"],"jí zhì":["楖"],"kǔ hù":["楛"],"yóu yǒu":["楢"],"sǒng cōng":["楤"],"yuán xuàn":["楥"],"yǎng yàng yīng":["楧"],pián:["楩","胼","腁","賆","蹁","駢","騈","骈","骿","㛹"],"dié yè":["楪"],"dùn shǔn":["楯"],"còu zòu":["楱"],"dì dǐ shì":["楴"],"kǎi jiē":["楷"],"róu ròu":["楺"],"lè yuè":["楽"],"wēn yùn":["榅","鞰"],lǘ:["榈","櫚","氀","膢","藘","閭","闾","驢","驴"],shén:["榊","神","鉮","鰰","𬬹"],"bī pi":["榌"],"zhǎn niǎn zhèn":["榐"],"fú fù bó":["榑"],"jiàn jìn":["榗"],"bǎng bàng":["榜"],"shā xiè":["榝","樧"],nòu:["槈","耨","鎒","鐞"],"qiǎn lián xiàn":["槏"],gàng:["槓","焵","焹","筻","鿍"],gāo:["槔","槹","橰","櫜","睾","篙","糕","羔","臯","韟","餻","高","髙","鷎","鷱","鼛"],"diān zhěn zhēn":["槙"],"kǎn jiàn":["槛"],"xí dié":["槢"],"jī guī":["槣"],"róng yōng":["槦"],"tuán shuàn quán":["槫"],"qì sè":["槭"],"cuī zhǐ":["槯"],"yǒu chǎo":["槱"],"màn wàn":["槾"],"lí chī":["樆"],"léi lěi":["樏","櫑","礌"],"cháo jiǎo chāo":["樔"],"chēng táng":["樘"],"jiū liáo":["樛"],"mó mú":["模"],"niǎo mù":["樢"],"héng hèng":["横","橫"],xuě:["樰","膤","艝","轌","雪","鱈","鳕"],"fá fèi":["橃"],rùn:["橍","润","潤","膶","閏","閠","闰"],"zhǎn jiǎn":["橏"],shùn:["橓","瞚","瞬","舜","蕣","順","顺","鬊"],"tuí dūn":["橔"],"táng chēng":["橖"],"sù qiū":["橚"],"tán diàn":["橝"],"fén fèn fèi":["橨"],"rǎn yān":["橪"],"cū chu":["橻"],"shū qiāo":["橾"],"píng bò":["檘"],"zhái shì tú":["檡"],"biǎo biāo":["檦"],"qiān lián":["檶"],"nǐ mí":["檷"],"jiàn kǎn":["檻"],"nòu ruǎn rú":["檽"],"jī jì":["櫅","禨"],"huǎng guǒ gǔ":["櫎"],"lǜ chū":["櫖"],"miè mèi":["櫗"],ōu:["櫙","欧","歐","殴","毆","瓯","甌","膒","藲","謳","讴","鏂","鴎","鷗","鸥"],"zhù zhuó":["櫡"],"jué jì":["櫭"],"huái guī":["櫰"],"chán zhàn":["欃"],"wéi zuì":["欈"],cáng:["欌","鑶"],"yù yì":["欥"],"chù qù xì":["欪"],"kài ài":["欬"],"yì yīn":["欭"],"xì kài":["欯"],"shuò sòu":["欶"],"ǎi ēi éi ěi èi ê̄ ế ê̌ ề":["欸"],"qī yī":["欹"],"chuā xū":["欻"],"chǐ chuài":["欼"],"kǎn qiàn":["欿"],"kǎn kè":["歁"],"chuǎn chuán":["歂"],"yīn yān":["歅"],"jìn qūn":["歏"],pēn:["歕"],"xū chuā":["歘"],"xī shè":["歙"],"liǎn hān":["歛"],"zhì chí":["歭"],"sè shà":["歰"],sǐ:["死"],"wěn mò":["歾"],piǎo:["殍","皫","瞟","醥","顠"],"qíng jìng":["殑"],"fǒu bó":["殕"],"zhí shi":["殖"],"yè yān yàn":["殗"],"hūn mèi":["殙"],chòu:["殠","臰","遚"],"kuì huì":["殨","溃","潰"],cuàn:["殩","熶","爨","窜","竄","篡","簒"],"yīn yān yǐn":["殷"],"qìng kēng shēng":["殸"],"yáo xiáo xiào":["殽"],"gū gǔ":["毂","蛄"],"guàn wān":["毌"],"dú dài":["毒"],"xún xùn":["毥"],mú:["毪","氁"],"dòu nuò":["毭"],"sāi suī":["毸"],lu:["氇"],sào:["氉","瘙","矂","髞"],"shì zhī":["氏"],"dī dǐ":["氐"],"máng méng":["氓"],"yáng rì":["氜"],shuǐ:["水","氵","氺","閖"],"zhěng chéng zhèng":["氶"],tǔn:["氽"],"fán fàn":["氾"],"guǐ jiǔ":["氿"],"bīn pà pā":["汃"],"zhuó què":["汋"],"dà tài":["汏"],pìn:["汖","牝","聘"],"hàn hán":["汗","馯"],tu:["汢"],"tāng shāng":["汤","湯"],"zhī jì":["汥"],"gàn hán cén":["汵"],"wèn mén":["汶"],"fāng pāng":["汸"],"hǔ huǎng":["汻"],"niú yóu":["汼"],hàng:["沆"],"shěn chén":["沈"],"dùn zhuàn":["沌"],"nǜ niǔ":["沑"],"méi mò":["沒","没"],"tà dá":["沓"],"mì wù":["沕"],"hóng pāng":["沗"],"shā shà":["沙"],"zhuǐ zǐ":["沝"],"ōu òu":["沤","漚"],"jǔ jù":["沮"],"tuō duó":["沰"],"mǐ lì":["沵"],"yí chí":["沶"],"xiè yì":["泄"],"bó pō":["泊"],"mì bì":["泌","秘"],"chù shè":["泏"],"yōu yòu āo":["泑"],"pēng píng":["泙","硑"],"pào pāo":["泡"],"ní nì":["泥","秜"],"yuè sà":["泧"],"jué xuè":["泬","疦"],"lóng shuāng":["泷","瀧"],"luò pō":["泺","濼"],"zé shì":["泽","澤"],"sǎ xǐ":["洒"],"sè qì zì":["洓"],"xǐ xiǎn":["洗"],"kǎo kào":["洘"],"àn yàn è":["洝"],"lěi lèi":["洡"],"qiè jié":["洯"],"qiǎn jiān":["浅"],"jì jǐ":["济","済","濟","纪"],"hǔ xǔ":["浒","滸"],"jùn xùn":["浚","濬"],"yǐng chéng yíng":["浧"],"liàn lì":["浰"],"féng hóng":["浲","溄"],"jiǒng jiōng":["浻"],"suī něi":["浽"],"yǒng chōng":["涌"],"tūn yūn":["涒"],"wō guō":["涡","渦"],hēng:["涥","脝"],"zhǎng zhàng":["涨","漲"],"shòu tāo":["涭"],shuàn:["涮","腨"],"kōng náng":["涳"],"wò wǎn yuān":["涴"],"tuō tuò":["涶"],wō:["涹","猧","窝","窩","莴","萵","蜗","蝸","踒"],"qiè jí":["淁"],"guǒ guàn":["淉"],"lín lìn":["淋","獜","疄"],"tǎng chǎng":["淌"],"nào chuò zhuō":["淖"],"péng píng":["淜"],féi:["淝","肥","腓","蜰"],"pì pèi":["淠"],"niǎn shěn":["淰"],"biāo hǔ":["淲"],"chún zhūn":["淳"],"hùn hún":["混"],qiǎn:["淺","繾","缱","肷","膁","蜸","譴","谴","遣","鑓"],"wèn mín":["渂"],"rè ruò luò":["渃"],"dú dòu":["渎","瀆","读"],"jiàn jiān":["渐","溅","漸","濺"],"miǎn shéng":["渑","澠"],"nuǎn nuán":["渜"],"qiú wù":["渞"],"tíng tīng":["渟"],"dì tí dī":["渧"],"gǎng jiǎng":["港"],"hōng qìng":["渹"],tuān:["湍","煓"],"huì mǐn xū":["湏"],"xǔ xù":["湑"],pén:["湓","瓫","盆","葐"],"mǐn hūn":["湣"],"tuàn nuǎn":["湪"],"qiū jiǎo":["湫","湬"],"yān yīn":["湮"],"bàn pán":["湴"],"zhuāng hún":["湷"],"yàn guì":["溎"],"lián liǎn nián xián xiàn":["溓"],"dá tǎ":["溚","鿎"],"liū liù":["溜","澑","蹓"],lùn:["溣"],mǎ:["溤","犸","獁","玛","瑪","码","碼","遤","鎷","馬","马","鰢","鷌"],"zhēn qín":["溱"],"nì niào":["溺"],"chù xù":["滀","畜"],"wěng wēng":["滃"],"hào xuè":["滈"],"qì xì xiē":["滊"],"xíng yíng":["滎"],"zé hào":["滜"],"piāo piào piǎo":["漂"],"cóng sǒng":["漎"],"féng péng":["漨"],"luò tà":["漯"],"pēng bēn":["漰"],"chóng shuāng":["漴"],"huǒ kuò huò":["漷"],"liáo liú":["漻"],"cuǐ cuī":["漼"],"cóng zǒng":["潀"],"cóng zōng":["潈"],"pì piē":["潎"],"dàng xiàng":["潒"],"huáng guāng":["潢"],"liáo lào lǎo":["潦"],"cōng zòng":["潨"],"zhí zhì":["潪"],"tān shàn":["潬"],"tú zhā":["潳"],"sàn sǎ":["潵"],hēi:["潶","黑","黒","𬭶"],"chéng dèng":["澄","瀓"],"cūn cún":["澊"],"péng pēng":["澎"],"hòng gǒng":["澒","銾"],"wàn màn":["澫"],"kuài huì":["澮"],"guō wō":["濄"],"pēn fén":["濆"],"jí shà":["濈"],"huì huò":["濊"],"dǐng tìng":["濎"],"mǐ nǐ":["濔"],"bì pì":["濞"],"cuì zuǐ":["濢"],"hù huò":["濩"],"ǎi kài kè":["濭"],"wěi duì":["濻","瀢"],"zàn cuán":["濽","灒"],"yǎng yàng":["瀁"],"wǎng wāng":["瀇"],"mò miè":["瀎","眜"],suǐ:["瀡","膸","髓"],"huái wāi":["瀤"],"zùn jiàn":["瀳"],"yīng yǐng yìng":["瀴"],"ráng ràng":["瀼"],shuàng:["灀"],"zhuó jiào zé":["灂"],sǎ:["灑","訯","靸"],"luán luàn":["灓"],"dǎng tǎng":["灙"],"xún quán quàn":["灥"],"huǒ biāo":["灬"],"zhà yù":["灹"],"fén bèn":["炃"],"jiǒng guì":["炅"],"pàng fēng":["炐"],quē:["炔","缺","缼","蒛"],biān:["炞","煸","甂","砭","笾","箯","籩","編","编","蝙","邉","邊","鍽","鞭","鯾","鯿","鳊"],"zhāo zhào":["炤"],"zhuō chù":["炪"],"pào páo bāo":["炮"],"páo fǒu":["炰"],"shǎn qián shān":["炶"],"zhà zhá":["炸"],"jiǎo yào":["烄"],quǎn:["烇","犬","犭","畎","綣","绻","虇"],"yàng yáng":["烊"],"lào luò":["烙"],"huí huǐ":["烠"],rè:["热","熱"],"fú páo":["烰"],"xiè chè":["烲","焎"],"yàn shān":["烻"],"hūn xūn":["焄"],kào:["焅","犒","銬","铐","靠","鮳","鯌","鲓","㸆"],"juān yè":["焆"],"jùn qū":["焌"],"tāo dào":["焘"],"chǎo jù":["焣"],"wò ài":["焥"],"zǒng cōng":["焧"],"xī yì":["焬"],"xìn xīn":["焮"],"chāo zhuō":["焯"],"xiǒng yīng":["焸","焽"],kuǐ:["煃","跬","蹞","頍","𫠆"],"huī yùn xūn":["煇"],"jiǎo qiāo":["煍"],"qián shǎn shān":["煔"],"xī yí":["煕"],"shà shā":["煞"],"yè zhá":["煠"],"yáng yàng":["煬"],"ēn yūn":["煾"],"yūn yǔn":["熅"],"hè xiāo":["熇"],xióng:["熊","熋","雄"],"xūn xùn":["熏","爋"],gòng:["熕","貢","贡"],liū:["熘"],"cōng zǒng":["熜"],"lù āo":["熝"],"shú shóu":["熟"],"fēng péng":["熢"],"cuǐ suī":["熣"],tēng:["熥","膯","鼟"],"yùn yù":["熨"],"áo āo":["熬"],"hàn rǎn":["熯"],"ōu ǒu":["熰"],"huáng huǎng":["熿"],"chǎn dǎn chàn":["燀"],"jiāo zhuó qiáo jué":["燋"],"yàn yān":["燕"],"tài liè":["燤"],āo:["爊"],"yàn xún":["爓"],"jué jiào":["爝","覐","覚","覺","觉"],"lǎn làn":["爦"],"zhuǎ zhǎo":["爪"],"zhǎo zhuǎ":["爫"],"fù fǔ":["父"],diē:["爹","褺","跌"],zāng:["牂","羘","臧","賍","賘","贓","贜","赃","髒"],"piàn piān":["片"],"biān miàn":["牑"],bǎng:["牓","綁","绑"],"yǒu yōng":["牗"],"chēng chèng":["牚","竀"],niú:["牛","牜"],"jiū lè":["牞"],"mù móu":["牟"],māng:["牤"],"gē qiú":["牫"],"yòu chōu":["牰"],"tè zhí":["犆"],bēn:["犇","錛","锛"],"jiān qián":["犍","玪"],má:["犘","痲","蔴","蟇","麻"],"máo lí":["犛"],"bá quǎn":["犮"],"zhuó bào":["犳"],"àn hān":["犴"],"kàng gǎng":["犺"],"pèi fèi":["犻"],"fān huān":["犿"],kuáng:["狂","狅","誑","诳","軖","軠","鵟","𫛭"],"yí quán chí":["狋"],"xīng shēng":["狌"],"tuó yí":["狏"],kǔ:["狜","苦"],"huán huān":["狟"],"hé mò":["狢"],"tà shì":["狧"],"máng dòu":["狵"],"xī shǐ":["狶"],suān:["狻","痠","酸"],"bài pí":["猈"],"jiān yàn":["猏","豣"],"yī yǐ":["猗"],"yá wèi":["猚"],cāi:["猜"],"māo máo":["猫","貓"],"chuàn chuān":["猭"],"tuān tuàn":["猯","貒"],"yà jiá qiè":["猰"],"hè xiē gé hài":["猲"],"biān piàn":["猵","獱"],"bó pò":["猼"],"háo gāo":["獋"],"fén fèn":["獖"],"yào xiāo":["獟"],"shuò xī":["獡"],"gé liè xiē":["獦"],"nòu rú":["獳"],"náo nǎo yōu":["獶"],ráng:["獽","瓤","禳","穣","穰","蘘","躟","鬤"],"náo yōu":["獿"],"lǜ shuài":["率"],"wáng wàng":["王"],"yáng chàng":["玚"],"mín wén":["玟"],"bīn fēn":["玢"],"mén yǔn":["玧"],"qiāng cāng":["玱","瑲","篬"],"án gān":["玵"],"xuán xián":["玹"],"cī cǐ":["玼","跐"],"yí tāi":["珆"],"zǔ jù":["珇"],fà:["珐","琺","蕟","髪","髮"],"yín kèn":["珢"],"huī hún":["珲"],"xuán qióng":["琁"],"fú fū":["琈"],"bǐng pín":["琕"],"cuì sè":["琗"],"yù wéi":["琟"],"tiǎn tiàn":["琠"],"zhuó zuó":["琢"],"běng pěi":["琣"],guǎn:["琯","璭","痯","筦","管","舘","輨","錧","館","馆","鳤"],"hún huī":["琿"],"xié jiē":["瑎"],"chàng dàng yáng":["瑒"],"tiàn zhèn":["瑱"],"bīn pián":["瑸","璸"],"tú shū":["瑹"],cuǐ:["璀","皠","趡"],"zǎo suǒ":["璅"],"jué qióng":["璚"],"lú fū":["璷"],"jì zī":["璾"],suí:["瓍","綏","绥","遀","随","隨","髄"],"mí xǐ":["瓕"],"qióng wěi wèi":["瓗"],"huán yè yà":["瓛"],"bó páo":["瓟"],"zhí hú":["瓡"],piáo:["瓢","闝"],"wǎ wà":["瓦"],"xiáng hóng":["瓨"],wèng:["瓮","甕","罋","蕹","齆"],"shèn shén":["甚"],ruí:["甤","緌","蕤"],yòng:["用","砽","苚","蒏","醟","㶲"],shuǎi:["甩"],béng:["甭","甮"],"yóu zhá":["甴"],"diàn tián shèng":["甸"],"tǐng dīng":["町","甼"],"zāi zī":["甾"],"bì qí":["畁"],"dá fú":["畗"],"cè jì":["畟"],"zāi zī tián":["畠"],"zhì chóu shì":["畤"],"fān pān":["畨","番"],"shē yú":["畬"],"dāng dàng dǎng":["當"],"jiāng qiáng":["疆"],"pǐ yǎ shū":["疋"],"jié qiè":["疌"],"yí nǐ":["疑"],nè:["疒","眲","訥","讷"],"gē yì":["疙"],"nüè yào":["疟","瘧"],"lì lài":["疠","癘"],"yǎ xiā":["疨"],xuē:["疶","蒆","薛","辥","辪","靴","鞾"],"dǎn da":["疸"],"fá biǎn":["疺"],"fèi féi":["疿","痱"],"shān diàn":["痁"],"téng chóng":["痋"],"tōng tóng":["痌"],"wěi yòu yù":["痏"],"tān shǐ":["痑"],"pū pù":["痡","鋪"],"bēng péng":["痭"],"má lìn":["痳"],"tiǎn diàn":["痶"],"ān yè è":["痷"],"kē ē":["痾"],"zhì chì":["瘈"],"jiǎ xiá xiā":["瘕"],"lěi huì":["瘣"],"chài cuó":["瘥"],"diān chēn":["瘨"],"da dá":["瘩"],"biě biē":["瘪"],qué:["瘸"],"dàn dān":["癉"],"guì wēi":["癐"],"nòng nóng":["癑"],"biē biě":["癟"],"bō bǒ":["癷"],bái:["白"],"jí bī":["皀"],"de dì dí dī":["的"],"pā bà":["皅"],"gāo háo":["皋"],"gāo yáo":["皐"],"lì luò bō":["皪"],"zhā cǔ":["皻"],"zhāo zhǎn dǎn":["皽"],"jiān jiàn":["监","監","鋻","间","鞬"],"gài gě hé":["盖"],"máng wàng":["盳"],yuǎn:["盶","逺","遠"],"tián xián":["盷"],"xiāng xiàng":["相"],dǔn:["盹","趸","躉"],"xì pǎn":["盻"],"shěng xǐng":["省"],"yún hùn":["眃"],"miǎn miàn":["眄"],"kàn kān":["看"],"yìng yāng yǎng":["眏"],"yǎo āo ǎo":["眑"],"jū xū kōu":["眗"],"yí chì":["眙"],"dié tì":["眣"],"bǐng fǎng":["眪"],"pàng pán":["眫"],"mī mí":["眯","瞇"],"xuàn shùn xún":["眴"],tiào:["眺","粜","糶","覜","趒"],"zhe zhuó zháo zhāo":["着"],"qiáo shào xiāo":["睄"],"cuó zhuài":["睉"],gùn:["睔","謴"],"suì zuì":["睟"],"pì bì":["睥","稫","辟"],"yì zé gāo":["睪"],"xǐng xìng":["睲"],"guì wèi kuì":["瞆"],"kòu jì":["瞉"],"qióng huán":["瞏"],"mán mén":["瞒","瞞"],"diāo dōu":["瞗"],"lou lóu lǘ":["瞜"],"shùn rún":["瞤"],"liào liǎo":["瞭","钌"],"jiàn xián":["瞯"],"wǔ mí":["瞴"],"guì kuì":["瞶"],"nǐng chēng":["矃"],"huò yuè":["矆"],"mēng méng":["矇"],"kuàng guō":["矌"],"guàn quán":["矔"],"mǎn mán":["矕"],"jīn guān qín":["矜"],"jīn qín guān":["矝"],"yù xù jué":["矞"],"jiǎo jiáo":["矫","矯"],duǎn:["短"],"shí dàn":["石"],"gāng qiāng kòng":["矼"],"huā xū":["砉"],"pīn bīn fēn":["砏"],"yán yàn":["研","硏"],"luǒ kē":["砢"],"fú fèi":["砩","笰"],"zhǔ zhù":["砫"],"lá lì lā":["砬"],"kuāng guāng":["硄"],"gè luò":["硌"],"shuò shí":["硕","碩"],"wèi wéi ái":["硙"],"què kè kù":["硞"],"mǎng bàng":["硥"],"luò lòng":["硦"],"yǒng tóng":["硧"],nüè:["硸","虐"],"kēng kěng":["硻"],"yān yǎn":["硽"],"zhuì chuí duǒ":["硾"],"kōng kòng":["硿"],"zòng cóng":["碂"],"jiān zhàn":["碊"],"lù liù":["碌","陆"],"què xī":["碏"],"lún lǔn lùn":["碖"],"náo gāng":["碙"],"jié yà":["碣"],"wèi wěi":["碨"],"tí dī":["碮"],"chá chā":["碴"],"qiāo què":["碻"],"sù xiè":["碿"],"liú liù":["磂","遛","鎦","馏"],"sī tí":["磃"],"bàng páng":["磅"],"huá kě gū":["磆"],"wěi kuǐ":["磈"],"xiá qià yà":["磍"],"lián qiān":["磏"],"wèi ái gài":["磑"],"lá lā":["磖"],"áo qiāo":["磝"],"pēng pèng":["磞","閛"],"yīn yǐn":["磤"],"lěi léi":["磥"],"mó mò":["磨"],"qì zhú":["磩"],"láo luò":["磱"],"pán bō":["磻"],"jí shé":["磼"],"hé qiāo qiào":["礉"],"kè huò":["礊"],"què hú":["礐"],"è qì":["礘"],cǎ:["礤","礸"],"xián xín":["礥"],"léi lěi lèi":["礧"],"yán yǎn":["礹"],"qí zhǐ":["祇","蚔"],"bēng fāng":["祊"],"bì mì":["祕"],suàn:["祘","笇","筭","算","蒜"],"piào piāo":["票"],"jì zhài":["祭"],"shuì lèi":["祱"],"jìn jīn":["禁"],"chán shàn":["禅"],"yáng shāng":["禓"],"zhī zhǐ tí":["禔"],"shàn chán":["禪"],"yú yù ǒu":["禺"],"zǐ zì":["秄"],"chá ná":["秅"],"zhǒng zhòng chóng":["种"],"hào mào":["秏"],"kù kū":["秙"],zū:["租","葅"],chèng:["秤","穪"],"huó kuò":["秮","秳"],"chēng chèn chèng":["称","稱"],"shì zhì":["秲","銴"],"fù pū":["秿"],"xùn zè":["稄"],"tú shǔ":["稌"],"zhùn zhǔn":["稕"],"jī qí":["稘","綨","觭"],"léng líng":["稜"],"zuì zú sū":["稡"],"xì qiè":["稧","郄"],"zhǒng zhòng":["種"],"zōng zǒng":["稯"],"xián jiān liàn":["稴"],"zī jiū":["稵"],"jī qǐ":["稽"],ròng:["穃"],"shān cǎn cēn":["穇"],"mén méi":["穈"],"jǐ jì":["穖"],"xiāo rào":["穘"],"zhuō bó":["穛"],"tóng zhǒng zhòng":["穜"],zuō:["穝"],"biāo pāo":["穮","藨"],"zhuō jué":["穱"],"cuán zàn":["穳"],"kōng kòng kǒng":["空"],"yū yǔ":["穻"],zhǎi:["窄","鉙"],báo:["窇","雹"],"kū zhú":["窋"],"jiào liáo liù":["窌"],"wā guī":["窐"],"tiǎo yáo":["窕"],"xūn yìn":["窨"],"yà yē":["窫"],"tián diān yǎn":["窴"],"chāo kē":["窼"],"kuǎn cuàn":["窽","窾"],"chù qì":["竐"],"qǔ kǒu":["竘"],"jìng zhěn":["竧"],"kǎn kàn":["竷"],"zhú dǔ":["竺"],"lè jīn":["竻"],"zhuì ruì":["笍"],"háng hàng":["笐"],"cén jìn hán":["笒"],"dā xiá nà":["笚"],"zé zuó":["笮"],"lóng lǒng":["笼","篭","籠","躘","龓"],"zhù zhú":["筑","築"],"dá dā":["答","荅"],shāi:["筛","篩","簁","籭"],"yún jūn":["筠"],"láng làng":["筤","郎","阆"],"zhì zhǐ":["筫"],o:["筽"],"póu bù fú pú":["箁"],"pái bēi":["箄"],gè:["箇","虼","鉻","铬"],"tái chí":["箈"],"guǎi dài":["箉"],"zhào dào":["箌"],"jīng qìng":["箐"],"lín lǐn":["箖"],"jùn qūn":["箘"],"shī yí":["箷","釶"],"yuē yào chuò":["箹"],"xiāo shuò qiào":["箾"],"gōng gǎn lǒng":["篢"],"páng péng":["篣"],"zhuó huò":["篧"],"jiǎn jiān":["篯"],"dí zhú":["篴"],"zān cēn cǎn":["篸"],"zhuàn suǎn zuàn":["篹"],"piǎo biāo":["篻"],"guó guì":["簂"],"cè jí":["簎"],"mì miè":["簚"],"shāi sī":["簛"],"sǔn zhuàn":["簨"],"gàn gǎn":["簳"],"bò bǒ":["簸"],"bó bù":["簿"],shi:["籂"],"zhēn jiān":["籈"],"zhuàn zuǎn":["籑"],"fān pān biān":["籓"],"sǒu shǔ":["籔"],zuǎn:["籫","繤","纂","纉","纘","缵"],nǚ:["籹","釹","钕"],"shā chǎo":["粆"],"kāng jīng":["粇"],fěn:["粉","黺"],cū:["粗","觕","麁","麄","麤"],"nián zhān":["粘"],"cè sè":["粣"],"zhōu yù":["粥"],"shēn sǎn":["糁"],"biān biǎn":["糄","萹"],miàn:["糆","面","靣","麪","麫","麵","麺"],"hú hū hù":["糊"],"gǔ gòu":["糓"],"mí méi":["糜"],"sǎn shēn":["糝","糣"],zāo:["糟","蹧","遭","醩"],"mì sī":["糸"],"jiū jiǔ":["糺"],"xì jì":["系","繫"],"zhēng zhěng":["糽"],"chà chǎ":["紁","衩"],"yuē yāo":["約","约"],"hóng gōng":["紅","红"],"hé gē":["紇","纥"],"wén wèn":["紋","纹"],fóu:["紑"],"jì jié jiè":["紒"],"pī pí bǐ":["紕","纰"],"jīn jìn":["紟"],"zhā zā":["紥","紮"],hā:["紦"],"fū fù":["紨"],"chōu chóu":["紬"],"lèi léi lěi":["累"],"bō bì":["紴"],"tiǎn zhěn":["紾"],"jiōng jiǒng":["絅"],"jié jiē":["結","结","节"],"guà kuā":["絓"],"bǎi mò":["絔"],"gēng huán":["絙"],"jié xié":["絜"],"quán shuān":["絟"],"gǎi ǎi":["絠"],"luò lào":["絡","络"],"bīng bēng pēng":["絣"],"gěi jǐ":["給","给"],"tóng tōng dòng":["絧"],"tiào diào dào":["絩"],"lěi lèi léi":["絫"],"gāi hài":["絯"],"chī zhǐ":["絺"],"wèn miǎn mán wàn":["絻"],"huán huàn wàn":["綄"],"qīn xiān":["綅"],"tì tí":["綈"],"yán xiàn":["綖"],"zōng zèng zòng":["綜"],"chēn lín":["綝"],"zhǔn zhùn":["綧"],"qiàn qīng zhēng":["綪"],"qìng qǐ":["綮"],"lún guān":["綸","纶"],"chuò chāo":["綽","绰"],"tián tǎn chān":["緂"],"lǜ lù":["緑","绿"],"ruǎn ruàn":["緛"],"jí qī":["緝"],"zhòng chóng":["緟","重"],"miáo máo":["緢"],"xiè yè":["緤"],huǎn:["緩","缓","㬊"],"gēng gèng":["緪","縆"],"tōu xū shū":["緰"],"zōng zòng":["緵","繌"],"yùn gǔn":["緷"],"guā wō":["緺"],"yùn yūn wēn":["緼","縕"],"bāng bàng":["縍"],"gǔ hú":["縎","鶻"],"cī cuò suǒ":["縒"],"cuī shuāi":["縗"],"róng rǒng ròng":["縙"],"zài zēng":["縡"],cài:["縩","菜","蔡"],"féng fèng":["縫"],"suō sù":["縮","缩"],"yǎn yǐn":["縯","酓"],"zòng zǒng":["縱","纵"],"zhuàn juàn":["縳"],"mò mù":["縸","莫"],"piǎo piāo":["縹","缥"],"fán pó":["繁"],"bēng bèng":["繃"],"móu miù miào liǎo":["繆"],"yáo yóu zhòu":["繇"],"zēng zèng":["繒","缯"],"jú jué":["繘"],"chuō chuò":["繛"],"zūn zǔn":["繜"],rào:["繞","绕","遶"],"chǎn chán":["繟"],"huì huí":["繢","缋","藱"],"qiāo sāo zǎo":["繰"],"jiǎo zhuó":["繳","缴"],"dàn tán chán":["繵"],nǒng:["繷"],"pú fú":["纀"],"yào lì":["纅"],"rǎng xiāng":["纕"],"lí sǎ xǐ lǐ":["纚"],"xiān qiàn":["纤"],"jīng jìng":["经"],"tí tì":["绨"],"bēng běng bèng":["绷"],"zōng zèng":["综"],"jī qī":["缉"],"wēn yùn yūn":["缊"],"fèng féng":["缝"],"shuāi cuī suī":["缞"],"miù móu liáo miào mù":["缪"],"qiāo sāo":["缲"],fǒu:["缶","缹","缻","雬","鴀"],"bà ba pí":["罢","罷"],"guà guǎi":["罫"],"yáng xiáng":["羊","羏"],"měi gāo":["羙"],"yì xī":["羛"],"qiǎng qiān":["羟"],"qiāng kòng":["羫"],"qián xián yán":["羬"],nóu:["羺"],"hóng gòng":["羾"],"pī bì pō":["翍"],"qú yù":["翑"],ké:["翗"],"qiào qiáo":["翘"],"zhái dí":["翟"],"dào zhōu":["翢"],"hóu qú":["翵"],shuǎ:["耍"],"ruǎn nuò":["耎"],"ér nài":["耏"],"zhuān duān":["耑"],"pá bà":["耙"],"chí sì":["耛"],"qù chú":["耝"],"lún lǔn":["耣"],"jí jiè":["耤"],"tāng tǎng":["耥"],pǎng:["耪","覫"],"zhá zé":["耫"],"yē yé":["耶"],"yún yíng":["耺"],"wà tuǐ zhuó":["聉"],"ér nǜ":["聏"],"tiē zhé":["聑"],"dǐ zhì":["聜"],qié:["聺"],"nǐ jiàn":["聻"],"lèi lē":["肋"],cào:["肏","襙","鄵","鼜"],"bó dí":["肑"],"xiào xiāo":["肖"],"dù dǔ":["肚"],chāi:["肞","釵","钗"],"hán qín hàn":["肣"],"pàng pán pàn":["肨","胖"],"zhūn chún":["肫"],āng:["肮","骯"],"yù yō":["育"],"pí bǐ bì":["肶"],"fèi bì":["胇"],"bèi bēi":["背"],"fèi zǐ":["胏"],"píng pēng":["胓","苹"],"fū fú zhǒu":["胕"],"shèng shēng":["胜"],kuà:["胯","跨","骻"],"gǎi hǎi":["胲"],"gē gé gā":["胳"],"néng nài":["能"],"guī kuì":["胿"],"mài mò":["脉"],"zāng zàng":["脏"],"jiǎo jué":["脚","角"],cuǒ:["脞"],"de te":["脦"],"zuī juān":["脧"],něi:["脮","腇","餒","馁","鮾","鯘"],"pú fǔ":["脯"],niào:["脲"],shuí:["脽"],guò:["腂","過","鐹"],"là xī":["腊"],"yān ā":["腌"],"gāo gào":["膏"],"lù biāo":["膔"],chuái:["膗"],"zhuān chuán chún zhuǎn":["膞"],chuài:["膪","踹"],"fán pán":["膰"],"wǔ hū":["膴"],"shān dàn":["膻"],tún:["臀","臋","蛌","豘","豚","軘","霕","飩","饨","魨","鲀","黗"],"bì bei":["臂"],"là gé":["臈"],"sào sāo":["臊"],nào:["臑","閙","闹","鬧"],"ní luán":["臡"],"qiān xián":["臤"],"guàng jiǒng":["臦"],"guǎng jiǒng":["臩"],"chòu xiù":["臭"],"mián biān":["臱"],"dié zhí":["臷"],"zhī jìn":["臸"],"shè shě":["舍"],pù:["舖","舗"],"bān bō pán":["般"],kuā:["舿"],"gèn gěn":["艮"],"sè shǎi":["色"],"fú bó":["艴"],"jiāo qiú":["艽"],"chāi chā":["芆"],"sháo què":["芍"],"hù xià":["芐"],"zì zǐ":["芓"],"huì hū":["芔"],"tún chūn":["芚"],"jiè gài":["芥"],"xù zhù":["芧"],"yuán yán":["芫"],"xīn xìn":["芯"],"lún huā":["芲"],"wù hū":["芴"],"gōu gǒu":["芶"],"mào máo":["芼"],"fèi fú":["芾"],"chán yín":["苂"],qiē:["苆"],"sū sù":["苏"],"tiáo sháo":["苕"],"lì jī":["苙"],"kē hē":["苛"],"jù qǔ":["苣"],"ruò rě":["若"],"zhù níng":["苧"],"pā bó":["苩"],xiú:["苬"],"zhǎ zuó":["苲"],"jū chá":["苴"],nié:["苶"],"shēng ruí":["苼"],"qié jiā":["茄"],"zǐ cí":["茈"],"qiàn xī":["茜"],chǎi:["茝"],"fá pèi":["茷"],ráo:["荛","蕘","襓","饒","饶"],"yíng xíng":["荥"],"qián xún":["荨","蕁"],"yìn yīn":["荫"],"hé hè":["荷"],"shā suō":["莎"],"péng fēng":["莑"],"shēn xīn":["莘"],"wǎn guān guǎn":["莞"],"yóu sù":["莤"],"shāo xiāo":["莦","蛸"],"làng liáng":["莨"],"piǎo fú":["莩"],"wèn wǎn miǎn":["莬"],"shì shí":["莳","蒔"],"tù tú":["莵"],"xiān liǎn":["莶","薟"],"wǎn yù":["菀"],"zōu chù":["菆"],"lù lǜ":["菉"],"jūn jùn":["菌"],"niè rěn":["菍"],"zī zì zāi":["菑"],"tú tù":["菟"],"jiē shà":["菨"],"qiáo zhǎo":["菬"],"tái zhī chí":["菭"],"fēi fěi":["菲","蜚"],"qín qīn jīn":["菳"],"zū jù":["菹","蒩"],"lǐn má":["菻"],"tián tiàn":["菾"],tiē:["萜","貼","贴"],"luò là lào luō":["落"],"zhù zhuó zhe":["著"],"shèn rèn":["葚"],"gě gé":["葛"],"jùn suǒ":["葰"],"kuì kuài":["蒉"],"rú ná":["蒘"],"méng mēng měng":["蒙"],"yuán huán":["蒝"],"xú shú":["蒣"],"xí xì":["蒵"],"mì míng":["蓂"],"sōu sǒu":["蓃"],"gài gě hé hài":["蓋"],"yǎo zhuó":["蓔"],"diào tiáo dí":["蓧"],"xū qiū fū":["蓲"],"zí jú":["蓻"],"liǎo lù":["蓼"],xu:["蓿"],"hàn hǎn":["蔊"],"màn wàn mán":["蔓"],"pó bò":["蔢"],"fān fán bō":["蕃"],"hóng hòng":["蕻"],"yù ào":["薁","隩"],"xí xiào":["薂"],"báo bó bò":["薄"],"cí zī":["薋"],"wàn luàn":["薍"],"kǎo hāo":["薧"],"yuǎn wěi":["薳"],"zhòu chóu":["薵"],"wō mái":["薶"],"xiāo hào":["藃"],"yù xù xū":["藇"],"jiè jí":["藉"],"diào zhuó":["藋"],"cáng zàng":["藏"],lǎ:["藞"],"chú zhū":["藸"],"pín píng":["蘋"],"gān hán":["虷"],"hóng jiàng":["虹"],"huī huǐ":["虺"],"xiā há":["虾"],"mǎ mà mā":["蚂"],"fāng bàng":["蚄"],"bàng bèng":["蚌"],"jué quē":["蚗"],"qín qián":["蚙"],"gōng zhōng":["蚣"],"fǔ fù":["蚥"],"dài dé":["蚮"],"gǒu qú xù":["蚼"],"bǒ pí":["蚾"],"shé yí":["蛇"],tiě:["蛈","鉄","銕","鐡","鐵","铁","驖"],"gé luò":["蛒"],"máng bàng":["蛖"],"yì xǔ":["蛡"],"há gé":["蛤"],"qiè ní":["蛪"],"é yǐ":["蛾"],"zhē zhé":["蜇"],"là zhà":["蜡"],suò:["蜶","逤"],"yóu qiú":["蝤"],"xiā hā":["蝦"],"xī qī":["螇"],"bī pí":["螕"],"nài něng":["螚"],"hé xiá":["螛"],"guì huǐ":["螝"],"mǎ mā mà":["螞"],"shì zhē":["螫"],"zhì dié":["螲"],"jiàn chán":["螹"],"ma má mò":["蟆"],"mǎng měng":["蟒"],"biē bié":["蟞"],"bēn fèi":["蟦"],"láo liáo":["蟧"],"yín xún":["蟫"],"lí lǐ":["蠡"],"xuè xiě":["血"],"xíng háng hàng héng":["行"],"shuāi cuī":["衰"],"tuó tuō":["袉"],"lǐng líng":["袊"],"bào páo pào":["袌"],"jù jiē":["袓"],"hè kè":["袔"],"yí yì":["袘","貤"],"nà jué":["袦"],"bèi pī":["被"],"chǐ nuǒ":["袲"],"chǐ qǐ duǒ nuǒ":["袳"],"jiá qiā jié":["袷"],"bó mò":["袹"],"guī guà":["袿"],"liè liě":["裂"],"chéng chěng":["裎"],"jiē gé":["裓"],"dāo chóu":["裯"],"shang cháng":["裳"],"yuān gǔn":["裷"],"yǎn ān":["裺"],"tì xī":["裼"],"fù fú":["褔"],"chǔ zhǔ":["褚"],"tuì tùn":["褪"],lǎi:["襰"],"yào yāo":["要"],"qín tán":["覃"],"jiàn xiàn":["見","见"],piǎn:["覑","諞","谝","貵","𡎚"],"piē miè":["覕"],"yíng yǐng":["覮"],"qù qū":["覰","覷","觑"],"jiàn biǎn":["覵"],"luó luǎn":["覶"],"zī zuǐ":["觜"],"huà xiè":["觟"],"jiě jiè xiè":["解","觧"],"xué hù":["觷"],"lì lù":["觻"],tǎo:["討","讨"],zhùn:["訰"],"zī zǐ":["訾"],"yí dài":["詒","诒"],xiòng:["詗","诇"],"diào tiǎo":["誂"],"yí chǐ chì":["誃"],"lǎng làng":["誏"],"ēi éi ěi èi xī":["誒","诶"],shuà:["誜"],"yǔ yù":["語","语","雨"],"shuō shuì yuè":["說","说"],"shuí shéi":["誰","谁"],"qū juè":["誳"],"chī lài":["誺"],"nì ná":["誽"],"diào tiáo":["調"],"pǐ bēi":["諀"],"jì jī":["諅"],"zé zuò zhǎ cuò":["諎"],"chù jí":["諔"],"háo xià":["諕"],"lùn lún":["論","论"],"shì dì":["諟"],"huà guā":["諣"],"xǐ shāi āi":["諰"],"nán nàn":["諵","難"],miù:["謬","谬"],zèn:["譖","谮"],"shí zhì":["識","识"],"juàn xuān":["讂"],"yí tuī":["讉"],zhán:["讝"],"xǔ hǔ":["许"],"xiáng yáng":["详"],"tiáo diào zhōu":["调"],"chén shèn":["谌"],"mí mèi":["谜"],"màn mán":["谩"],"gǔ yù":["谷"],"huō huò huá":["豁"],"zhì zhài":["豸"],"huān huán":["貆"],"kěn kūn":["貇"],"mò hé":["貈"],"mò hé háo":["貉"],"jù lóu":["貗"],"zé zhài":["責","责"],"dài tè":["貸"],"bì bēn":["賁"],"jiǎ gǔ jià":["賈"],"xiōng mín":["賯"],càng:["賶"],"zhuàn zuàn":["賺","赚"],"wàn zhuàn":["贃"],"gàn gòng zhuàng":["贛"],"yuán yùn":["贠"],"bēn bì":["贲"],"jiǎ gǔ":["贾"],zǒu:["走","赱","鯐"],"dié tú":["趃"],"jū qiè":["趄"],"qū cù":["趋","趨"],"jí jié":["趌"],"guā huó":["趏"],"què qì jí":["趞"],"tàng tāng":["趟"],"chuō zhuó":["趠"],"qù cù":["趣"],"yuè tì":["趯"],"bō bào":["趵"],"kuà wù":["趶"],"guì jué":["趹"],"fāng fàng páng":["趽"],"páo bà":["跁"],"qí qǐ":["跂"],"jiàn chén":["跈"],"pǎo páo":["跑"],"diǎn diē tiē":["跕"],"jū jù qiè":["跙"],bǒ:["跛"],"luò lì":["跞"],"dài duò duō chí":["跢"],zhuǎi:["跩"],"bèng pián":["跰"],"tiào táo":["跳"],"shū chōu":["跾"],"liàng liáng":["踉"],"tà tā":["踏"],chǎ:["蹅","鑔","镲"],"dí zhí":["蹢"],"dēng dèng":["蹬","鐙","镫"],cèng:["蹭"],"dūn cún":["蹲"],"juě jué":["蹶"],liāo:["蹽"],"xiè sǎ":["躠"],tǐ:["躰","軆","骵"],"yà zhá gá":["轧","軋"],"xìn xiàn":["軐"],"fàn guǐ":["軓"],"zhuàn zhuǎn":["転"],"zhóu zhòu":["軸","轴"],bú:["轐","醭","鳪"],"zhuǎn zhuàn zhuǎi":["转"],"zǎi zài":["载"],"niǎn zhǎn":["辗"],"biān bian":["边"],"dào biān":["辺"],"yǐ yí":["迆","迤","迱"],"guò guo guō":["过"],"wàng kuāng":["迋"],"hái huán":["还"],"zhè zhèi":["这"],"yuǎn yuàn":["远"],"zhì lì":["迣"],"zhù wǎng":["迬"],"zhuī duī":["追"],"shì kuò":["适"],tòu:["透"],"tōng tòng":["通"],guàng:["逛"],"dǎi dài":["逮"],"suì suí":["遂"],"tí dì":["遆"],"yí wèi":["遗"],"shì dí zhé":["適"],cà:["遪"],"huán hái":["還"],"lí chí":["邌"],"kàng háng":["邟"],"nà nèi nā":["那"],"xié yá yé yú xú":["邪"],"gāi hái":["郂"],"huán xún":["郇"],"chī xī":["郗"],hǎo:["郝"],"lì zhí":["郦"],"xiáo ǎo":["郩"],"dōu dū":["都"],liǎo:["曢","鄝","镽"],"zàn cuán cuó":["酂","酇"],"dīng dǐng":["酊"],"cù zuò":["酢"],"fā pō":["酦"],"shāi shī":["酾"],niàng:["酿","醸"],"qiú chōu":["醔"],"pō fā":["醗","醱"],"chǎn chěn":["醦"],"yàn liǎn xiān":["醶"],"niàng niáng":["釀"],"lǐ li":["里"],"lí xǐ xī":["釐"],"liǎo liào":["釕"],"dīng dìng":["釘","钉"],"qiǎo jiǎo":["釥"],"yú huá":["釪"],"huá wū":["釫"],"rì rèn jiàn":["釰","釼"],"dì dài":["釱"],"pī zhāo":["釽"],"yá yé":["釾"],"bǎ pá":["鈀","钯"],"tā tuó":["鉈","铊"],běi:["鉳"],"bǐng píng":["鉼"],"hā kē":["鉿","铪"],chòng:["銃","铳"],"xiǎng jiōng":["銄"],"yù sì":["銉"],"xù huì":["銊"],"rén rěn":["銋"],"shàn shuò":["銏"],"chì lì":["銐"],"xiǎn xǐ":["銑","铣"],"hóu xiàng":["銗"],"diào tiáo yáo":["銚"],"xiān kuò tiǎn guā":["銛","銽","铦"],"zhé niè":["銸"],"zhōng yōng":["銿"],"tōu tù dòu":["鋀"],"méi méng":["鋂"],"wàn jiǎn":["鋄","鎫"],"tǐng dìng":["鋌","铤"],"juān jiān cuān":["鋑"],"sī tuó":["鋖"],"juān xuān juàn":["鋗"],"wú huá wū":["鋘"],"zhuó chuò":["鋜"],"xíng xìng jīng":["鋞"],"jū jú":["鋦","锔"],"zuì niè":["鋷"],"yuān yuǎn wǎn wān":["鋺"],"gāng gàng":["鋼","钢"],zhuī:["錐","锥","騅","骓","鵻"],ā:["錒","锕"],"cuō chā":["鎈"],"suǒ sè":["鎍"],"yáo zú":["鎐"],"yè tà gé":["鎑"],"qiāng chēng":["鎗"],"gé lì":["鎘","镉","鬲"],"bī pī bì":["鎞"],"gǎo hào":["鎬"],"zú chuò":["鏃"],"xiū xiù":["鏅"],"shòu sōu":["鏉"],"dí dī":["鏑","镝"],"qiāo sǎn càn":["鏒"],"lù áo":["鏕"],"tāng táng":["鏜"],"jiàn zàn":["鏩"],"huì suì ruì":["鏸"],"qiǎng qiāng":["鏹","镪"],"sǎn xiàn sà":["鏾"],"jiǎn jiàn":["鐧","锏"],"dāng chēng":["鐺","铛"],"zuān zuàn":["鑽"],"sà xì":["钑"],"yào yuè":["钥"],"tǒu dǒu":["钭"],"zuàn zuān":["钻"],"qiān yán":["铅"],"pí pī":["铍"],"yáo diào tiáo":["铫"],"tāng tàng":["铴"],"pù pū":["铺"],"tán xiān":["锬"],"liù liú":["镏"],"hào gǎo":["镐"],"táng tāng":["镗"],"tán chán xín":["镡"],"huò shǎn":["閄"],"hàn bì":["閈","闬"],"kāng kàng":["閌","闶"],"xián jiàn jiān jiǎn":["閒"],"xiā xiǎ":["閕"],"xiǎ kě":["閜"],"biàn guān":["閞"],"hé gé":["閤","颌"],"hòng xiàng":["閧"],"sē xī":["閪"],"tíng tǐng":["閮"],"è yān":["閼","阏"],"hòng juǎn xiàng":["闂"],"bǎn pàn":["闆"],"dū shé":["闍","阇"],"què quē":["闕"],"tāng táng chāng":["闛"],"kàn hǎn":["闞","阚"],"xì sè tà":["闟"],"mēn mèn":["闷"],"quē què":["阙"],"yán diàn":["阽"],"ā ē":["阿"],"bēi pō pí":["陂"],"yàn yǎn":["隁"],"yú yáo shù":["隃"],"lóng lōng":["隆"],"duì zhuì":["隊"],"suí duò":["隋"],"gāi qí ái":["隑"],"huī duò":["隓","隳"],"wěi kuí":["隗"],"lì dài":["隸"],"zhuī cuī wéi":["隹"],"hè hú":["隺","鶮"],"jùn juàn":["隽","雋"],"nán nàn nuó":["难"],"què qiāo qiǎo":["雀"],"guàn huán":["雚"],"guī xī":["雟"],"sè xí":["雭"],án:["雸"],"wù méng":["雺"],tèng:["霯"],"lù lòu":["露"],mái:["霾"],"jìng liàng":["靚"],"gé jí":["革"],bǎ:["靶"],"yāng yàng":["鞅"],"gé tà sǎ":["鞈"],"biān yìng":["鞕"],"qiào shāo":["鞘"],"juān xuān":["鞙"],"shàng zhǎng":["鞝"],"pí bǐng bì bēi":["鞞"],la:["鞡"],"xiè dié":["鞢"],ēng:["鞥"],"móu mù":["鞪"],"bì bǐng":["鞸"],"mèi wà":["韎"],rǒu:["韖"],"shè xiè":["韘"],"yùn wēn":["韫"],"dùn dú":["頓","顿"],duǐ:["頧"],luō:["頱"],"bīn pín":["頻"],yóng:["顒","颙","鰫"],mān:["顢","颟"],"jǐng gěng":["颈"],"jié xié jiá":["颉"],"kē ké":["颏"],"pín bīn":["频"],"chàn zhàn":["颤"],"fēng fěng":["風","风"],"biāo diū":["颩"],"bá fú":["颰"],"sāo sōu":["颾"],"liù liáo":["飂"],"shí sì yì":["食"],"yǎng juàn":["飬"],"zhù tǒu":["飳"],"yí sì":["飴"],"zuò zé zhā":["飵"],tiè:["飻","餮"],"xiǎng náng":["饟"],"táng xíng":["饧"],"gē le":["饹"],"chā zha":["馇"],"náng nǎng":["馕"],"yūn wò":["馧"],"zhī shì":["馶"],"xìn jìn":["馸"],"kuài jué":["駃"],zǎng:["駔","驵"],"tái dài":["駘"],"xún xuān":["駨"],"liáng láng":["駺"],piàn:["騗","騙","骗","魸"],"dài tái":["骀"],"sāo sǎo":["骚"],"gǔ gū":["骨"],"bèi mó":["骳"],"xiāo qiāo":["骹"],"bǎng pǎng":["髈"],"bó jué":["髉"],"bì pǒ":["髲"],"máo méng":["髳"],"kuò yuè":["髺"],"bā bà":["魞","鲃"],"jì cǐ":["鮆"],"bó bà":["鮊"],"zhǎ zhà":["鮓","鲊"],"chóu dài":["鮘"],"luò gé":["鮥"],"guī xié wā kuí":["鮭"],"xiān xiǎn":["鮮","鲜"],"pū bū":["鯆"],"yì sī":["鯣"],"bà bó":["鲌"],"guī xié":["鲑"],"sāi xǐ":["鳃"],"niǎo diǎo":["鳥"],"diāo zhāo":["鳭"],"gān hàn yàn":["鳱"],"fū guī":["鳺"],"jiān qiān zhān":["鳽"],"hé jiè":["鶡"],"piān biǎn":["鶣"],"chuàn zhì":["鶨"],"cāng qiāng":["鶬"],"sǔn xùn":["鶽"],"biāo páo":["麃"],"zhù cū":["麆"],"jūn qún":["麇","麕"],chi:["麶"],"mó me":["麼"],"mó me ma":["麽"],"mí mǒ":["麿"],"dàn shèn":["黮"],"zhěn yān":["黰"],"dǎn zhǎn":["黵"],"miǎn mǐn měng":["黾"],hōu:["齁"],nàng:["齉"],"qí jì zī zhāi":["齐"],"yín kěn yǎn":["龂"],"yín kěn":["龈"],"gōng wò":["龏"],"guī jūn qiū":["龜","龟"],"kuí wā":["䖯"],lōu:["䁖"],"ōu qū":["𫭟"],"lóu lǘ":["𦝼"],"gǎ gā gá":["嘎"],"wā guà":["坬"],"zhǐ dǐ":["茋"],"gǒng hóng":["硔"],"yáo xiào":["滧"]},Rd=new wP;Object.keys(LI).forEach(e=>{const t=LI[e];for(let n of t)Rd.set(n,e)});const NI={这个:"zhè ge",成为:"chéng wéi",认为:"rèn wéi",作为:"zuò wéi",部分:"bù fen",要求:"yāo qiú",应该:"yīng gāi",增长:"zēng zhǎng",提供:"tí gōng",觉得:"jué de",任务:"rèn wu",那个:"nà ge",称为:"chēng wéi",为主:"wéi zhǔ",了解:"liǎo jiě",处理:"chǔ lǐ",皇上:"huáng shang",只要:"zhǐ yào",大量:"dà liàng",力量:"lì liàng",几乎:"jī hū",干部:"gàn bù",目的:"mù dì",行为:"xíng wéi",只见:"zhǐ jiàn",认识:"rèn shi",市长:"shì zhǎng",师父:"shī fu",调查:"diào chá",重新:"chóng xīn",分为:"fēn wéi",知识:"zhī shi",导弹:"dǎo dàn",质量:"zhì liàng",行款:"háng kuǎn",行列:"háng liè",行话:"háng huà",行业:"háng yè",隔行:"gé háng",在行:"zài háng",行家:"háng jia",内行:"nèi háng",外行:"wài háng",同行:"tóng háng",本行:"běn háng",行伍:"háng wǔ",洋行:"yáng háng",银行:"yín háng",商行:"shāng háng",支行:"zhī háng",总行:"zǒng háng",行情:"háng qíng",懂行:"dǒng háng",行规:"háng guī",行当:"háng dang",行货:"háng huò",太行:"tài háng",入行:"rù háng",中行:"zhōng háng",农行:"nóng háng",工行:"gōng háng",建行:"jiàn háng",各行:"gè háng",行号:"háng hào",行高:"háng gāo",行首:"háng shǒu",行尾:"háng wěi",行末:"háng mò",行长:"háng zhǎng",行距:"háng jù",换行:"huàn háng",行会:"háng huì",行辈:"háng bèi",行道:"háng dào",道行:"dào heng",参与:"cān yù",充分:"chōng fèn",尽管:"jǐn guǎn",生长:"shēng zhǎng",数量:"shù liàng",应当:"yīng dāng",院长:"yuàn zhǎng",强调:"qiáng diào",只能:"zhǐ néng",音乐:"yīn yuè",以为:"yǐ wéi",处于:"chǔ yú",部长:"bù zhǎng",蒙古:"měng gǔ",只有:"zhǐ yǒu",适当:"shì dàng",只好:"zhǐ hǎo",成长:"chéng zhǎng",高兴:"gāo xìng",不了:"bù liǎo",产量:"chǎn liàng",胖子:"pàng zi",显得:"xiǎn de",只是:"zhǐ shì",似的:"shì de",率领:"shuài lǐng",改为:"gǎi wéi",不禁:"bù jīn",成分:"chéng fèn",答应:"dā ying",少年:"shào nián",兴趣:"xìng qù",太监:"tài jian",休息:"xiū xi",校长:"xiào zhǎng",更新:"gēng xīn",合同:"hé tong",喝道:"hè dào",重庆:"chóng qìng",重建:"chóng jiàn",使得:"shǐ de",审查:"shěn chá",累计:"lěi jì",给予:"jǐ yǔ",极为:"jí wéi",冠军:"guàn jūn",仿佛:"fǎng fú",头发:"tóu fa",投降:"tóu xiáng",家长:"jiā zhǎng",仔细:"zǐ xì",要是:"yào shi",将领:"jiàng lǐng",含量:"hán liàng",更为:"gèng wéi",积累:"jī lěi",地处:"dì chǔ",县长:"xiàn zhǎng",少女:"shào nǚ",路上:"lù shang",只怕:"zhǐ pà",能量:"néng liàng",储量:"chǔ liàng",供应:"gōng yìng",挑战:"tiǎo zhàn",西藏:"xī zàng",记得:"jì de",总量:"zǒng liàng",当真:"dàng zhēn",将士:"jiàng shì",差别:"chā bié",较为:"jiào wéi",长老:"zhǎng lǎo",大夫:"dài fu",差异:"chā yì",懂得:"dǒng de",尽量:"jǐn liàng",模样:"mú yàng",的确:"dí què",为首:"wéi shǒu",便宜:"pián yi",更名:"gēng míng",石头:"shí tou",州长:"zhōu zhǎng",为止:"wéi zhǐ",漂亮:"piào liang",炮弹:"pào dàn",藏族:"zàng zú",角色:"jué sè",当作:"dàng zuò",尽快:"jǐn kuài",人为:"rén wéi",重复:"chóng fù",胡同:"hú tòng",差距:"chā jù",弟兄:"dì xiong",大将:"dà jiàng",睡觉:"shuì jiào",一觉:"yí jiào",团长:"tuán zhǎng",队长:"duì zhǎng",区长:"qū zhǎng",难得:"nán dé",丫头:"yā tou",会长:"huì zhǎng",弟弟:"dì di",王爷:"wáng ye",重量:"zhòng liàng",誉为:"yù wéi",家伙:"jiā huo",华山:"huà shān",椅子:"yǐ zi",流量:"liú liàng",长大:"zhǎng dà",勉强:"miǎn qiǎng",会计:"kuài jì",过分:"guò fèn",济南:"jǐ nán",调动:"diào dòng",燕京:"yān jīng",少将:"shào jiàng",中毒:"zhòng dú",晓得:"xiǎo de",变更:"biàn gēng",打更:"dǎ gēng",认得:"rèn de",苹果:"píng guǒ",念头:"niàn tou",挣扎:"zhēng zhá",三藏:"sān zàng",剥削:"bō xuē",丞相:"chéng xiàng",少量:"shǎo liàng",寻思:"xún si",夺得:"duó dé",干线:"gàn xiàn",呼吁:"hū yù",处罚:"chǔ fá",长官:"zhǎng guān",柏林:"bó lín",亲戚:"qīn qi",身分:"shēn fèn",胳膊:"gē bo",着手:"zhuó shǒu",炸弹:"zhà dàn",咳嗽:"ké sou",叶子:"yè zi",外长:"wài zhǎng",供给:"gōng jǐ",师长:"shī zhǎng",变量:"biàn liàng",应有:"yīng yǒu",下载:"xià zài",乐器:"yuè qì",间接:"jiàn jiē",底下:"dǐ xià",打扮:"dǎ bàn",子弹:"zǐ dàn",弹药:"dàn yào",热量:"rè liàng",削弱:"xuē ruò",骨干:"gǔ gàn",容量:"róng liàng",模糊:"mó hu",转动:"zhuàn dòng",称呼:"chēng hu",科长:"kē zhǎng",处置:"chǔ zhì",着重:"zhuó zhòng",着急:"zháo jí",强迫:"qiǎng pò",庭长:"tíng zhǎng",首相:"shǒu xiàng",喇嘛:"lǎ ma",镇长:"zhèn zhǎng",只管:"zhǐ guǎn",重重:"chóng chóng",免得:"miǎn de",着实:"zhuó shí",度假:"dù jià",真相:"zhēn xiàng",相貌:"xiàng mào",处分:"chǔ fèn",委屈:"wěi qu",为期:"wéi qī",伯伯:"bó bo",伯子:"bǎi zi",圈子:"quān zi",见识:"jiàn shi",笼罩:"lǒng zhào",与会:"yù huì",都督:"dū du",都市:"dū shì",成都:"chéng dū",首都:"shǒu dū",帝都:"dì dū",王都:"wáng dū",东都:"dōng dū",都护:"dū hù",都城:"dū chéng",建都:"jiàn dū",迁都:"qiān dū",故都:"gù dū",定都:"dìng dū",中都:"zhōng dū",六安:"lù ān",宰相:"zǎi xiàng",较量:"jiào liàng",对称:"duì chèn",总长:"zǒng zhǎng",相公:"xiàng gong",空白:"kòng bái",打量:"dǎ liang",水分:"shuǐ fèn",舌头:"shé tou",没收:"mò shōu",行李:"xíng li",判处:"pàn chǔ",散文:"sǎn wén",处境:"chǔ jìng",孙子:"sūn zi",拳头:"quán tou",打发:"dǎ fā",组长:"zǔ zhǎng",骨头:"gǔ tou",宁可:"nìng kě",更换:"gēng huàn",薄弱:"bó ruò",还原:"huán yuán",重修:"chóng xiū",重来:"chóng lái",只顾:"zhǐ gù",爱好:"ài hào",馒头:"mán tou",军长:"jūn zhǎng",首长:"shǒu zhǎng",厂长:"chǎng zhǎng",司长:"sī zhǎng",长子:"zhǎng zǐ",强劲:"qiáng jìng",恰当:"qià dàng",头儿:"tóu er",站长:"zhàn zhǎng",折腾:"zhē teng",相处:"xiāng chǔ",统率:"tǒng shuài",中将:"zhōng jiàng",命中:"mìng zhòng",名将:"míng jiàng",木头:"mù tou",动弹:"dòng tan",地壳:"dì qiào",干活:"gàn huó",少爷:"shào ye",水量:"shuǐ liàng",补给:"bǔ jǐ",尾巴:"wěi ba",来得:"lái de",好奇:"hào qí",钥匙:"yào shi",当做:"dàng zuò",沉着:"chén zhuó",哑巴:"yǎ ba",车子:"chē zi",上将:"shàng jiàng",恶心:"ě xīn",担子:"dàn zi",应届:"yīng jiè",主角:"zhǔ jué",运转:"yùn zhuǎn",兄长:"xiōng zhǎng",格式:"gé shì",正月:"zhēng yuè",营长:"yíng zhǎng",当成:"dàng chéng",女婿:"nǚ xu",咽喉:"yān hóu",重阳:"chóng yáng",化为:"huà wéi",吐蕃:"tǔ bō",钻进:"zuān jìn",乐队:"yuè duì",亮相:"liàng xiàng",被子:"bèi zi",舍得:"shě de",杉木:"shā mù",击中:"jī zhòng",排长:"pái zhǎng",假期:"jià qī",分量:"fèn liàng",数次:"shù cì",提防:"dī fáng",吆喝:"yāo he",查处:"chá chǔ",量子:"liàng zǐ",里头:"lǐ tou",调研:"diào yán",伺候:"cì hou",重申:"chóng shēn",枕头:"zhěn tou",拚命:"pīn mìng",社长:"shè zhǎng",归还:"guī huán",批量:"pī liàng",畜牧:"xù mù",点着:"diǎn zháo",甚为:"shèn wéi",小将:"xiǎo jiàng",着眼:"zhuó yǎn",处死:"chǔ sǐ",厌恶:"yàn wù",鼓乐:"gǔ yuè",树干:"shù gàn",秘鲁:"bì lǔ",大方:"dà fāng",外头:"wài tou",班长:"bān zhǎng",星宿:"xīng xiù",宁愿:"nìng yuàn",钦差:"qīn chāi",为数:"wéi shù",勾当:"gòu dàng",削减:"xuē jiǎn",间谍:"jiàn dié",埋怨:"mán yuàn",结实:"jiē shi",计量:"jì liáng",淹没:"yān mò",村长:"cūn zhǎng",连长:"lián zhǎng",自给:"zì jǐ",武将:"wǔ jiàng",温差:"wēn chā",直奔:"zhí bèn",供求:"gōng qiú",剂量:"jì liàng",道长:"dào zhǎng",泄露:"xiè lòu",王八:"wáng ba",切割:"qiē gē",间隔:"jiàn gé",一晃:"yì huǎng",长假:"cháng jià",令狐:"líng hú",为害:"wéi hài",句子:"jù zi",偿还:"cháng huán",疙瘩:"gē da",燕山:"yān shān",堵塞:"dǔ sè",夺冠:"duó guàn",扎实:"zhā shi",电荷:"diàn hè",看守:"kān shǒu",复辟:"fù bì",郁闷:"yù mèn",尽早:"jǐn zǎo",切断:"qiē duàn",指头:"zhǐ tou",为生:"wéi shēng",畜生:"chù sheng",切除:"qiē chú",着力:"zhuó lì",着想:"zhuó xiǎng",级差:"jí chā",投奔:"tóu bèn",棍子:"gùn zi",含糊:"hán hu",少妇:"shào fù",兴致:"xìng zhì",纳闷:"nà mèn",干流:"gàn liú",卷起:"juǎn qǐ",扇子:"shàn zi",更改:"gēng gǎi",笼络:"lǒng luò",喇叭:"lǎ ba",载荷:"zài hè",妥当:"tuǒ dàng",为难:"wéi nán",着陆:"zhuó lù",燕子:"yàn zi",干吗:"gàn má",白发:"bái fà",总得:"zǒng děi",夹击:"jiā jī",曝光:"bào guāng",曲调:"qǔ diào",相机:"xiàng jī",叫化:"jiào huà",角逐:"jué zhú",啊哟:"ā yō",载重:"zài zhòng",长辈:"zhǎng bèi",出差:"chū chāi",垛口:"duǒ kǒu",撇开:"piē kāi",厅长:"tīng zhǎng",组分:"zǔ fèn",误差:"wù chā",家当:"jiā dàng",传记:"zhuàn jì",个子:"gè zi",铺设:"pū shè",干事:"gàn shì",杆菌:"gǎn jūn",定量:"dìng liàng",运载:"yùn zài",会儿:"huì er",酋长:"qiú zhǎng",重返:"chóng fǎn",差额:"chā é",露面:"lòu miàn",钻研:"zuān yán",大城:"dài chéng",上当:"shàng dàng",销量:"xiāo liàng",作坊:"zuō fang",照相:"zhào xiàng",哎呀:"āi yā",调集:"diào jí",看中:"kàn zhòng",议长:"yì zhǎng",风筝:"fēng zheng",辟邪:"bì xié",空隙:"kòng xì",更迭:"gēng dié",偏差:"piān chā",声调:"shēng diào",适量:"shì liàng",屯子:"tún zi",无量:"wú liàng",空地:"kòng dì",调度:"diào dù",散射:"sǎn shè",创伤:"chuāng shāng",海参:"hǎi shēn",满载:"mǎn zài",重叠:"chóng dié",落差:"luò chā",单调:"dān diào",老将:"lǎo jiàng",人参:"rén shēn",间断:"jiàn duàn",重现:"chóng xiàn",夹杂:"jiā zá",调用:"diào yòng",萝卜:"luó bo",附着:"fù zhuó",应声:"yìng shēng",主将:"zhǔ jiàng",罪过:"zuì guo",咀嚼:"jǔ jué",为政:"wéi zhèng",过量:"guò liàng",乐曲:"yuè qǔ",负荷:"fù hè",枪弹:"qiāng dàn",悄然:"qiǎo rán",处方:"chǔ fāng",悄声:"qiǎo shēng",曲子:"qǔ zi",情调:"qíng diào",挑衅:"tiǎo xìn",代为:"dài wéi",了结:"liǎo jié",打中:"dǎ zhòng",酒吧:"jiǔ bā",懒得:"lǎn de",增量:"zēng liàng",衣着:"yī zhuó",部将:"bù jiàng",要塞:"yào sài",茶几:"chá jī",杠杆:"gàng gǎn",出没:"chū mò",鲜有:"xiǎn yǒu",间隙:"jiàn xì",重担:"zhòng dàn",重演:"chóng yǎn",重试:"chóng shì",应酬:"yìng chou",只当:"zhǐ dāng",毋宁:"wú nìng",包扎:"bāo zā",前头:"qián tou",卷烟:"juǎn yān",非得:"fēi děi",弹道:"dàn dào",杆子:"gān zi",门将:"mén jiàng",后头:"hòu tou",喝彩:"hè cǎi",暖和:"nuǎn huo",累积:"lěi jī",调遣:"diào qiǎn",倔强:"jué jiàng",宝藏:"bǎo zàng",丧事:"sāng shì",约莫:"yuē mo",纤夫:"qiàn fū",更替:"gēng tì",装载:"zhuāng zài",背包:"bēi bāo",帖子:"tiě zi",松散:"sōng sǎn",呼喝:"hū hè",可恶:"kě wù",自转:"zì zhuàn",供电:"gōng diàn",反省:"fǎn xǐng",坦率:"tǎn shuài",苏打:"sū dá",本分:"běn fèn",落得:"luò de",鄙薄:"bǐ bó",相间:"xiāng jiàn",单薄:"dān bó",混蛋:"hún dàn",贞观:"zhēn guān",附和:"fù hè",能耐:"néng nài",吓唬:"xià hu",未了:"wèi liǎo",引着:"yǐn zháo",抽调:"chōu diào",沙子:"shā zi",席卷:"xí juǎn",标的:"biāo dì",别扭:"biè niu",思量:"sī liang",喝采:"hè cǎi",论语:"lún yǔ",盖子:"gài zi",分外:"fèn wài",弄堂:"lòng táng",乐舞:"yuè wǔ",雨量:"yǔ liàng",毛发:"máo fà",差遣:"chāi qiǎn",背负:"bēi fù",转速:"zhuàn sù",声乐:"shēng yuè",夹攻:"jiā gōng",供水:"gōng shuǐ",主干:"zhǔ gàn",惩处:"chéng chǔ",长相:"zhǎng xiàng",公差:"gōng chāi",榴弹:"liú dàn",省得:"shěng de",条子:"tiáo zi",重围:"chóng wéi",阻塞:"zǔ sè",劲风:"jìng fēng",纠葛:"jiū gé",颠簸:"diān bǒ",点中:"diǎn zhòng",重创:"zhòng chuāng",姥姥:"lǎo lao",迷糊:"mí hu",公家:"gōng jia",几率:"jī lǜ",苦闷:"kǔ mèn",度量:"dù liàng",差错:"chā cuò",暑假:"shǔ jià",参差:"cēn cī",搭载:"dā zài",助长:"zhù zhǎng",相称:"xiāng chèn",红晕:"hóng yùn",舍命:"shě mìng",喜好:"xǐ hào",列传:"liè zhuàn",劲敌:"jìng dí",蛤蟆:"há ma",请假:"qǐng jià",钉子:"dīng zi",沉没:"chén mò",高丽:"gāo lí",休假:"xiū jià",无为:"wú wéi",巴结:"bā jie",了得:"liǎo dé",变相:"biàn xiàng",核弹:"hé dàn",亲家:"qìng jia",承载:"chéng zài",喝问:"hè wèn",还击:"huán jī",交还:"jiāo huán",将令:"jiàng lìng",单于:"chán yú",空缺:"kòng quē",绿林:"lù lín",胆量:"dǎn liàng",执着:"zhí zhuó",低调:"dī diào",闭塞:"bì sè",轻薄:"qīng bó",得当:"dé dàng",占卜:"zhān bǔ",扫帚:"sào zhou",龟兹:"qiū cí",年长:"nián zhǎng",外传:"wài zhuàn",头子:"tóu zi",裁缝:"cái feng",礼乐:"lǐ yuè",血泊:"xuè pō",散乱:"sǎn luàn",动量:"dòng liàng",倒腾:"dǎo teng",取舍:"qǔ shě",咱家:"zán jiā",长发:"cháng fà",爪哇:"zhǎo wā",弹壳:"dàn ké",省悟:"xǐng wù",嚷嚷:"rāng rang",连累:"lián lèi",应得:"yīng dé",族长:"zú zhǎng",柜子:"guì zi",擂鼓:"léi gǔ",眩晕:"xuàn yùn",调配:"tiáo pèi",躯干:"qū gàn",差役:"chāi yì",坎坷:"kǎn kě",少儿:"shào ér",乐团:"yuè tuán",养分:"yǎng fèn",退还:"tuì huán",格调:"gé diào",语调:"yǔ diào",音调:"yīn diào",乐府:"yuè fǔ",古朴:"gǔ pǔ",打点:"dǎ diǎn",差使:"chāi shǐ",匀称:"yún chèn",瘦削:"shòu xuē",膏药:"gāo yao",吞没:"tūn mò",调任:"diào rèn",散居:"sǎn jū",上头:"shàng tóu",风靡:"fēng mǐ",放假:"fàng jià",估量:"gū liang",失当:"shī dàng",中弹:"zhòng dàn",妄为:"wàng wéi",长者:"zhǎng zhě",起哄:"qǐ hòng",末了:"mò liǎo",相声:"xiàng sheng",校正:"jiào zhèng",劝降:"quàn xiáng",矢量:"shǐ liàng",沉闷:"chén mèn",给与:"jǐ yǔ",解法:"jiě fǎ",塞外:"sài wài",将校:"jiàng xiào",嗜好:"shì hào",没落:"mò luò",朴刀:"pō dāo",片子:"piān zi",切削:"qiē xiāo",弹丸:"dàn wán",稀薄:"xī bó",亏得:"kuī dé",间歇:"jiàn xiē",翘首:"qiáo shǒu",色调:"sè diào",处决:"chǔ jué",表率:"biǎo shuài",尺子:"chǐ zi",招降:"zhāo xiáng",称职:"chèn zhí",斗篷:"dǒu peng",铺子:"pù zi",底子:"dǐ zi",负载:"fù zài",干警:"gàn jǐng",倒数:"dào shǔ",将官:"jiàng guān",锄头:"chú tou",归降:"guī xiáng",疟疾:"nüè ji",唠叨:"láo dao",限量:"xiàn liàng",屏息:"bǐng xī",重逢:"chóng féng",器乐:"qì yuè",氢弹:"qīng dàn",脖颈:"bó gěng",妃子:"fēi zi",处事:"chǔ shì",参量:"cān liàng",轻率:"qīng shuài",缥缈:"piāo miǎo",中奖:"zhòng jiǎng",才干:"cái gàn",施舍:"shī shě",卷子:"juàn zi",游说:"yóu shuì",巷子:"xiàng zi",膀胱:"páng guāng",切勿:"qiè wù",看管:"kān guǎn",风头:"fēng tou",精干:"jīng gàn",高差:"gāo chā",恐吓:"kǒng hè",扁担:"biǎn dàn",给养:"jǐ yǎng",格子:"gé zi",供需:"gōng xū",反差:"fǎn chā",飞弹:"fēi dàn",微薄:"wēi bó",发型:"fà xíng",即兴:"jí xìng",攒动:"cuán dòng",间或:"jiàn huò",浅薄:"qiǎn bó",乐章:"yuè zhāng",顺差:"shùn chā",调子:"diào zi",相位:"xiàng wèi",转子:"zhuàn zǐ",劲旅:"jìng lǚ",咔嚓:"kā chā",了事:"liǎo shì",转悠:"zhuàn you",当铺:"dàng pù",爪子:"zhuǎ zi",单子:"dān zi",好战:"hào zhàn",燕麦:"yàn mài",只许:"zhǐ xǔ",干练:"gàn liàn",女将:"nǚ jiàng",酒量:"jiǔ liàng",划船:"huá chuán",伎俩:"jì liǎng",挑拨:"tiǎo bō",少校:"shào xiào",着落:"zhuó luò",憎恶:"zēng wù",刻薄:"kè bó",要挟:"yāo xié",用处:"yòng chu",还手:"huán shǒu",模具:"mú jù",执著:"zhí zhuó",喝令:"hè lìng",保长:"bǎo zhǎng",吸着:"xī zhe",症结:"zhēng jié",公转:"gōng zhuàn",校勘:"jiào kān",重提:"chóng tí",扫兴:"sǎo xìng",铺盖:"pū gài",长史:"zhǎng shǐ",差价:"chā jià",压根:"yà gēn",怔住:"zhèng zhù",应允:"yīng yǔn",切入:"qiē rù",战将:"zhàn jiàng",年少:"nián shào",舍身:"shě shēn",执拗:"zhí niù",处世:"chǔ shì",中风:"zhòng fēng",等量:"děng liàng",放量:"fàng liàng",腔调:"qiāng diào",老少:"lǎo shào",没入:"mò rù",瓜葛:"guā gé",将帅:"jiàng shuài",车载:"chē zài",窝囊:"wō nang",长进:"zhǎng jìn",可汗:"kè hán",并州:"bīng zhōu",供销:"gōng xiāo",切片:"qiē piàn",差事:"chāi shì",知会:"zhī hui",鹰爪:"yīng zhǎo",处女:"chǔ nǚ",切磋:"qiē cuō",日头:"rì tou",押解:"yā jiè",滋长:"zī zhǎng",道观:"dào guàn",脚色:"jué sè",当量:"dāng liàng",婆家:"pó jia",缘分:"yuán fèn",空闲:"kòng xián",好色:"hào sè",怒喝:"nù hè",笼统:"lǒng tǒng",边塞:"biān sài",何曾:"hé céng",重合:"chóng hé",零散:"líng sǎn",轰隆:"hōng lōng",化子:"huà zi",内蒙:"nèi měng",数落:"shǔ luò",逆差:"nì chā",牟利:"móu lì",栅栏:"zhà lan",中标:"zhòng biāo",调档:"diào dàng",佝偻:"gōu lóu",场子:"chǎng zi",甲壳:"jiǎ qiào",重温:"chóng wēn",炮制:"páo zhì",返还:"fǎn huán",自传:"zì zhuàn",高调:"gāo diào",殷红:"yān hóng",固着:"gù zhuó",强求:"qiǎng qiú",本相:"běn xiàng",骄横:"jiāo hèng",草率:"cǎo shuài",气闷:"qì mèn",着色:"zhuó sè",宁肯:"nìng kěn",兴头:"xìng tou",拘泥:"jū nì",夹角:"jiā jiǎo",发髻:"fà jì",猛将:"měng jiàng",约摸:"yuē mo",拖累:"tuō lěi",呢绒:"ní róng",钻探:"zuān tàn",夹层:"jiā céng",落魄:"luò pò",巷道:"hàng dào",运量:"yùn liàng",解闷:"jiě mèn",空儿:"kòng er",估摸:"gū mo",好客:"hào kè",钻孔:"zuān kǒng",糊弄:"hù nòng",荥阳:"xíng yáng",烦闷:"fán mèn",仓卒:"cāng cù",分叉:"fēn chà",厂子:"chǎng zi",小调:"xiǎo diào",少阳:"shào yáng",受降:"shòu xiáng",染坊:"rǎn fáng",胳臂:"gē bei",将门:"jiàng mén",模板:"mú bǎn",配给:"pèi jǐ",为伍:"wéi wǔ",跟头:"gēn tou",划算:"huá suàn",累赘:"léi zhui",哄笑:"hōng xiào",晕眩:"yūn xuàn",干掉:"gàn diào",缝制:"féng zhì",难处:"nán chù",着意:"zhuó yì",蛮横:"mán hèng",奇数:"jī shù",短发:"duǎn fà",生还:"shēng huán",还清:"huán qīng",看护:"kān hù",直率:"zhí shuài",奏乐:"zòu yuè",载客:"zài kè",专横:"zhuān hèng",湮没:"yān mò",空格:"kòng gé",铺垫:"pū diàn",良将:"liáng jiàng",哗啦:"huā lā",散漫:"sǎn màn",脱发:"tuō fà",送还:"sòng huán",埋没:"mái mò",累及:"lěi jí",薄雾:"bó wù",调离:"diào lí",舌苔:"shé tāi",机长:"jī zhǎng",栓塞:"shuān sè",配角:"pèi jué",切口:"qiē kǒu",创口:"chuāng kǒu",哈欠:"hā qian",实弹:"shí dàn",铺平:"pū píng",哈达:"hǎ dá",懒散:"lǎn sǎn",实干:"shí gàn",填空:"tián kòng",刁钻:"diāo zuān",乐师:"yuè shī",量变:"liàng biàn",诱降:"yòu xiáng",搪塞:"táng sè",征调:"zhēng diào",夹道:"jiā dào",干咳:"gān ké",止咳:"zhǐ ké",乐工:"yuè gōng",划过:"huá guò",着火:"zháo huǒ",更正:"gēng zhèng",给付:"jǐ fù",空子:"kòng zi",哪吒:"né zhā",正着:"zhèng zháo",刷子:"shuā zi",丧葬:"sāng zàng",夹带:"jiā dài",安分:"ān fèn",中意:"zhòng yì",长孙:"zhǎng sūn",校订:"jiào dìng",卷曲:"juǎn qū",载运:"zài yùn",投弹:"tóu dàn",柞蚕:"zuò cán",份量:"fèn liàng",调换:"diào huàn",了然:"liǎo rán",咧嘴:"liě zuǐ",典当:"diǎn dàng",寒假:"hán jià",长兄:"zhǎng xiōng",给水:"jǐ shuǐ",须发:"xū fà",枝干:"zhī gàn",属相:"shǔ xiàng",哄抢:"hōng qiǎng",刻划:"kè huà",塞子:"sāi zi",单干:"dān gàn",还乡:"huán xiāng",兆头:"zhào tou",寺观:"sì guàn",督率:"dū shuài",啊哈:"ā ha",割舍:"gē shě",抹布:"mā bù",好恶:"hào wù",下处:"xià chǔ",消长:"xiāo zhǎng",离间:"lí jiàn",准头:"zhǔn tou",校对:"jiào duì",什物:"shí wù",番禺:"pān yú",佛爷:"fó ye",吗啡:"mǎ fēi",盐分:"yán fèn",虎将:"hǔ jiàng",薄荷:"bò he",独处:"dú chǔ",空位:"kòng wèi",铺路:"pū lù",乌拉:"wū lā",调回:"diào huí",来头:"lái tou",闲散:"xián sǎn",胶卷:"jiāo juǎn",冒失:"mào shi",干劲:"gàn jìn",弦乐:"xián yuè",相国:"xiàng guó",丹参:"dān shēn",助兴:"zhù xìng",铺开:"pū kāi",次长:"cì zhǎng",发卡:"fà qiǎ",拮据:"jié jū",刹车:"shā chē",生发:"shēng fà",重播:"chóng bō",缝合:"féng hé",音量:"yīn liàng",少尉:"shào wèi",冲压:"chòng yā",苍劲:"cāng jìng",厚薄:"hòu báo",威吓:"wēi hè",外相:"wài xiàng",呼号:"hū háo",着迷:"zháo mí",挑担:"tiāo dàn",纹路:"wén lù",还俗:"huán sú",强横:"qiáng hèng",着数:"zhāo shù",降顺:"xiáng shùn",挑明:"tiǎo míng",眯缝:"mī feng",分内:"fèn nèi",更衣:"gēng yī",软和:"ruǎn huo",尽兴:"jìn xìng",号子:"hào zi",爪牙:"zhǎo yá",败将:"bài jiàng",猜中:"cāi zhòng",结扎:"jié zā",没空:"méi kòng",夹缝:"jiā fèng",拾掇:"shí duo",掺和:"chān huo",簸箕:"bò ji",电量:"diàn liàng",荷载:"hè zǎi",调式:"diào shì",处身:"chǔ shēn",打手:"dǎ shǒu",弹弓:"dàn gōng",横蛮:"hèng mán",能干:"néng gàn",校点:"jiào diǎn",加载:"jiā zài",干校:"gàn xiào",哄传:"hōng chuán",校注:"jiào zhù",淤塞:"yū sè",马扎:"mǎ zhá",月氏:"yuè zhī",高干:"gāo gàn",经传:"jīng zhuàn",曾孙:"zēng sūn",好斗:"hào dòu",关卡:"guān qiǎ",逃奔:"táo bèn",磨蹭:"mó ceng",牟取:"móu qǔ",颤栗:"zhàn lì",蚂蚱:"mà zha",撮合:"cuō he",趔趄:"liè qie",摔打:"shuāi dǎ",台子:"tái zi",分得:"fēn de",粘着:"nián zhuó",采邑:"cài yì",散装:"sǎn zhuāng",婀娜:"ē nuó",兴味:"xìng wèi",行头:"xíng tou",气量:"qì liàng",调运:"diào yùn",处治:"chǔ zhì",乐音:"yuè yīn",充塞:"chōng sè",恫吓:"dòng hè",论调:"lùn diào",相中:"xiāng zhòng",民乐:"mín yuè",炮仗:"pào zhang",丧服:"sāng fú",骁将:"xiāo jiàng",量刑:"liàng xíng",缝补:"féng bǔ",财会:"cái kuài",大干:"dà gàn",历数:"lì shǔ",校场:"jiào chǎng",塞北:"sài běi",识相:"shí xiàng",辱没:"rǔ mò",鲜亮:"xiān liàng",语塞:"yǔ sè",露脸:"lòu liǎn",凉快:"liáng kuai",腰杆:"yāo gǎn",溜达:"liū da",嘎嘎:"gā gā",公干:"gōng gàn",桔梗:"jié gěng",挑逗:"tiǎo dòu",看门:"kān mén",乐歌:"yuè gē",拓片:"tà piàn",挑动:"tiǎo dòng",准将:"zhǔn jiàng",遒劲:"qiú jìng",磨坊:"mò fáng",逶迤:"wēi yí",搅和:"jiǎo huo",摩挲:"mó suō",作弄:"zuò nòng",苗头:"miáo tou",打颤:"dǎ zhàn",大藏:"dà zàng",畜牲:"chù shēng",勾搭:"gōu da",树荫:"shù yīn",树杈:"shù chà",铁杆:"tiě gǎn",将相:"jiàng xiàng",份子:"fèn zi",视差:"shì chā",绿荫:"lǜ yīn",枪杆:"qiāng gǎn",缝纫:"féng rèn",愁闷:"chóu mèn",点将:"diǎn jiàng",华佗:"huà tuó",劲射:"jìng shè",箱笼:"xiāng lǒng",终了:"zhōng liǎo",鬓发:"bìn fà",结巴:"jiē ba",苦干:"kǔ gàn",看家:"kān jiā",正旦:"zhēng dàn",中肯:"zhòng kěn",厦门:"xià mén",东莞:"dōng guǎn",食量:"shí liàng",宫调:"gōng diào",间作:"jiàn zuò",弹片:"dàn piàn",差池:"chā chí",漂白:"piǎo bái",杠子:"gàng zi",调处:"tiáo chǔ",好动:"hào dòng",转炉:"zhuàn lú",屏气:"bǐng qì",夹板:"jiā bǎn",哀乐:"āi yuè",干道:"gàn dào",苦处:"kǔ chù",劈柴:"pǐ chái",长势:"zhǎng shì",天华:"tiān huá",共处:"gòng chǔ",校验:"jiào yàn",出塞:"chū sài",磨盘:"mò pán",萎靡:"wěi mǐ",奔丧:"bēn sāng",唱和:"chàng hè",大调:"dà diào",非分:"fēi fèn",钻营:"zuān yíng",夹子:"jiā zi",超载:"chāo zài",更始:"gēng shǐ",铃铛:"líng dang",披散:"pī sàn",发还:"fā huán",转轮:"zhuàn lún",横财:"hèng cái",泡桐:"pāo tóng",抛撒:"pāo sǎ",天呀:"tiān yā",糊糊:"hū hu",躯壳:"qū qiào",通量:"tōng liàng",奉还:"fèng huán",午觉:"wǔ jiào",闷棍:"mèn gùn",浪头:"làng tou",砚台:"yàn tái",油坊:"yóu fáng",学长:"xué zhǎng",过载:"guò zài",笔调:"bǐ diào",衣被:"yī bèi",畜产:"xù chǎn",调阅:"diào yuè",蛮干:"mán gàn",曾祖:"zēng zǔ",提干:"tí gàn",变调:"biàn diào",覆没:"fù mò",模子:"mú zi",乐律:"yuè lǜ",称心:"chèn xīn",木杆:"mù gān",重印:"chóng yìn",自省:"zì xǐng",提调:"tí diào",看相:"kàn xiàng",芋头:"yù tou",下切:"xià qiē",塞上:"sài shàng",铺张:"pū zhāng",藤蔓:"téng wàn",薄幸:"bó xìng",解数:"xiè shù",褪去:"tuì qù",霰弹:"xiàn dàn",柚木:"yóu mù",痕量:"hén liàng",雅乐:"yǎ yuè",号哭:"háo kū",诈降:"zhà xiáng",猪圈:"zhū juàn",咋舌:"zé shé",铣床:"xǐ chuáng",防弹:"fáng dàn",健将:"jiàn jiàng",丽水:"lí shuǐ",削发:"xuē fà",空当:"kòng dāng",多相:"duō xiàng",鲜见:"xiǎn jiàn",划桨:"huá jiǎng",载波:"zài bō",跳蚤:"tiào zao",俏皮:"qiào pí",吧嗒:"bā dā",结发:"jié fà",了断:"liǎo duàn",同调:"tóng diào",石磨:"shí mò",时差:"shí chā",鼻塞:"bí sè",挑子:"tiāo zi",推磨:"tuī mò",武侯:"wǔ hóu",抹煞:"mǒ shā",调转:"diào zhuǎn",籍没:"jí mò",还债:"huán zhài",调演:"diào yǎn",分划:"fēn huá",奇偶:"jī ǒu",断喝:"duàn hè",闷雷:"mèn léi",狼藉:"láng jí",饭量:"fàn liàng",还礼:"huán lǐ",转调:"zhuǎn diào",星相:"xīng xiàng",手相:"shǒu xiàng",配乐:"pèi yuè",盖头:"gài tou",连杆:"lián gǎn",簿记:"bù jì",刀把:"dāo bà",量词:"liàng cí",名角:"míng jué",步调:"bù diào",校本:"jiào běn",账簿:"zhàng bù",隽永:"juàn yǒng",稍为:"shāo wéi",易传:"yì zhuàn",乐谱:"yuè pǔ",牵累:"qiān lěi",答理:"dā li",喝斥:"hè chì",吟哦:"yín é",干渠:"gàn qú",海量:"hǎi liàng",精当:"jīng dàng",着床:"zhuó chuáng",月相:"yuè xiàng",庶几:"shù jī",宫观:"gōng guàn",论处:"lùn chǔ",征辟:"zhēng bì",厚朴:"hòu pò",介壳:"jiè qiào",吭哧:"kēng chī",咯血:"kǎ xiě",铺陈:"pū chén",重生:"chóng shēng",乐理:"yuè lǐ",哀号:"āi háo",藏历:"zàng lì",刚劲:"gāng jìng",削平:"xuē píng",浓荫:"nóng yīn",城垛:"chéng duǒ",当差:"dāng chāi",正传:"zhèng zhuàn",并处:"bìng chǔ",创面:"chuāng miàn",旦角:"dàn jué",薄礼:"bó lǐ",晃荡:"huàng dang",臊子:"sào zi",家什:"jiā shí",闷头:"mēn tóu",美发:"měi fà",度数:"dù shu",着凉:"zháo liáng",闯将:"chuǎng jiàng",几案:"jī àn",姘头:"pīn tou",差数:"chā shù",散碎:"sǎn suì",壅塞:"yōng sè",寒颤:"hán zhàn",牵强:"qiān qiǎng",无间:"wú jiàn",轮转:"lún zhuàn",号叫:"háo jiào",铺排:"pū pái",降伏:"xiáng fú",轧钢:"zhá gāng",东阿:"dōng ē",病假:"bìng jià",累加:"lěi jiā",梗塞:"gěng sè",弹夹:"dàn jiā",钻心:"zuān xīn",晃眼:"huǎng yǎn",魔爪:"mó zhǎo",标量:"biāo liàng",憋闷:"biē mèn",猜度:"cāi duó",处士:"chǔ shì",官差:"guān chāi",讨还:"tǎo huán",长门:"cháng mén",馏分:"liú fēn",里弄:"lǐ lòng",色相:"sè xiàng",雅兴:"yǎ xìng",角力:"jué lì",弹坑:"dàn kēng",枝杈:"zhī chà",夹具:"jiā jù",处刑:"chǔ xíng",悍将:"hàn jiàng",好学:"hào xué",好好:"hǎo hǎo",银发:"yín fà",扫把:"sào bǎ",法相:"fǎ xiàng",贵干:"guì gàn",供气:"gōng qì",空余:"kòng yú",捆扎:"kǔn zā",瘠薄:"jí bó",浆糊:"jiàng hu",嘎吱:"gā zhī",调令:"diào lìng",法帖:"fǎ tiè",淋病:"lìn bìng",调派:"diào pài",转盘:"zhuàn pán",供稿:"gōng gǎo",差官:"chāi guān",忧闷:"yōu mèn",教长:"jiào zhǎng",重唱:"chóng chàng",酒兴:"jiǔ xìng",乐坛:"yuè tán",花呢:"huā ní",叱喝:"chì hè",膀臂:"bǎng bì",得空:"dé kòng",转圈:"zhuàn quān",横暴:"hèng bào",哄抬:"hōng tái",引吭:"yǐn háng",载货:"zài huò",中计:"zhòng jì",官长:"guān zhǎng",相面:"xiàng miàn",看头:"kàn tou",盼头:"pàn tou",意兴:"yì xìng",军乐:"jūn yuè",累次:"lěi cì",骨嘟:"gǔ dū",燕赵:"yān zhào",报丧:"bào sāng",弥撒:"mí sa",挨斗:"ái dòu",扁舟:"piān zhōu",丑角:"chǒu jué",吊丧:"diào sāng",强将:"qiáng jiàng",重奏:"chóng zòu",发辫:"fà biàn",着魔:"zháo mó",着法:"zhāo fǎ",盛放:"shèng fàng",填塞:"tián sè",凶横:"xiōng hèng",稽首:"qǐ shǒu",碑帖:"bēi tiè",冲量:"chōng liàng",发菜:"fà cài",假发:"jiǎ fà",翻卷:"fān juǎn",小量:"xiǎo liàng",胶着:"jiāo zhuó",里子:"lǐ zi",调调:"diào diao",散兵:"sǎn bīng",高挑:"gāo tiǎo",播撒:"bō sǎ",夹心:"jiā xīn",扇动:"shān dòng",叨扰:"tāo rǎo",霓裳:"ní cháng",捻子:"niǎn zi",弥缝:"mí féng",撒布:"sǎ bù",场院:"cháng yuàn",省亲:"xǐng qīn",提拉:"tí lā",惯量:"guàn liàng",强逼:"qiáng bī",强征:"qiáng zhēng",晕车:"yùn chē",数道:"shù dào",带累:"dài lèi",拓本:"tà běn",嫌恶:"xián wù",宿将:"sù jiàng",龟裂:"jūn liè",缠夹:"chán jiā",发式:"fà shì",隔扇:"gé shàn",天分:"tiān fèn",癖好:"pǐ hào",四通:"sì tōng",白术:"bái zhú",划伤:"huá shāng",角斗:"jué dòu",听差:"tīng chāi",岁差:"suì chā",丧礼:"sāng lǐ",脉脉:"mò mò",削瘦:"xuē shòu",撒播:"sǎ bō",莎草:"suō cǎo",犍为:"qián wéi",调头:"diào tóu",龙卷:"lóng juǎn",外调:"wài diào",字帖:"zì tiè",卷发:"juǎn fà",揣度:"chuǎi duó",洋相:"yáng xiàng",散光:"sǎn guāng",骨碌:"gū lu",薄命:"bó mìng",笼头:"lóng tóu",咽炎:"yān yán",碌碡:"liù zhou",片儿:"piàn er",纤手:"qiàn shǒu",散体:"sǎn tǐ",内省:"nèi xǐng",强留:"qiáng liú",解送:"jiè sòng",反间:"fǎn jiàn",少壮:"shào zhuàng",留空:"liú kōng",告假:"gào jià",咳血:"ké xuè",薄暮:"bó mù",铺轨:"pū guǐ",磨削:"mó xuē",治丧:"zhì sāng",叉子:"chā zi",哄动:"hōng dòng",蛾子:"é zi",出落:"chū luò",股长:"gǔ zhǎng",贵处:"guì chù",还魂:"huán hún",例假:"lì jià",刹住:"shā zhù",身量:"shēn liàng",同好:"tóng hào",模量:"mó liàng",更生:"gēng shēng",服丧:"fú sāng",率直:"shuài zhí",字模:"zì mú",散架:"sǎn jià",答腔:"dā qiāng",交恶:"jiāo wù",薄情:"bó qíng",眼泡:"yǎn pāo",袅娜:"niǎo nuó",草垛:"cǎo duò",冲劲:"chòng jìn",呢喃:"ní nán",切中:"qiè zhòng",挑灯:"tiǎo dēng",还愿:"huán yuàn",激将:"jī jiàng",更鼓:"gēng gǔ",没药:"mò yào",败兴:"bài xìng",切面:"qiē miàn",散户:"sǎn hù",累进:"lěi jìn",背带:"bēi dài",秤杆:"chèng gǎn",碾坊:"niǎn fáng",簿子:"bù zi",扳手:"bān shǒu",铅山:"yán shān",儒将:"rú jiàng",重光:"chóng guāng",剪发:"jiǎn fà",长上:"zhǎng shàng",小传:"xiǎo zhuàn",压轴:"yā zhòu",弱冠:"ruò guàn",花卷:"huā juǎn",横祸:"hèng huò",夹克:"jiā kè",光晕:"guāng yùn",披靡:"pī mǐ",对调:"duì diào",夹持:"jiā chí",空额:"kòng é",平调:"píng diào",铺床:"pū chuáng",丧钟:"sāng zhōng",作乐:"zuò lè",少府:"shào fǔ",数数:"shuò shuò",奔头:"bèn tou",进给:"jìn jǐ",率性:"shuài xìng",乐子:"lè zi",绑扎:"bǎng zā",挑唆:"tiǎo suō",漂洗:"piǎo xǐ",夹墙:"jiā qiáng",咳喘:"ké chuǎn",乜斜:"miē xie",错处:"cuò chù",闷酒:"mèn jiǔ",时调:"shí diào",重孙:"chóng sūn",经幢:"jīng chuáng",圩场:"xū chǎng",调门:"diào mén",花头:"huā tóu",划拉:"huá la",套色:"tào shǎi",粗率:"cū shuài",相率:"xiāng shuài",款识:"kuǎn zhì",吁请:"yù qǐng",荫蔽:"yīn bì",文蛤:"wén gé",嘀嗒:"dī dā",调取:"diào qǔ",交差:"jiāo chāi",落子:"luò zǐ",相册:"xiàng cè",絮叨:"xù dao",落发:"luò fà",异相:"yì xiàng",浸没:"jìn mò",角抵:"jué dǐ",卸载:"xiè zài",春卷:"chūn juǎn",扎挣:"zhá zheng",畜养:"xù yǎng",吡咯:"bǐ luò",垛子:"duò zi",恶少:"è shào",发际:"fà jì",红苕:"hóng sháo",糨糊:"jiàng hu",哭丧:"kū sāng",稍息:"shào xī",晕船:"yùn chuán",校样:"jiào yàng",外差:"wài chā",脚爪:"jiǎo zhǎo",铺展:"pū zhǎn",芫荽:"yán sui",夹紧:"jiā jǐn",尿泡:"suī pào",丧乱:"sāng luàn",凶相:"xiōng xiàng",华发:"huá fà",打场:"dǎ cháng",云量:"yún liàng",正切:"zhèng qiē",划拳:"huá quán",划艇:"huá tǐng",评传:"píng zhuàn",拉纤:"lā qiàn",句读:"jù dòu",散剂:"sǎn jì",骨殖:"gǔ shi",塞音:"sè yīn",铺叙:"pū xù",阏氏:"yān zhī",冷颤:"lěng zhàn",煞住:"shā zhù",少男:"shào nán",管乐:"guǎn yuè",号啕:"háo táo",纳降:"nà xiáng",拥塞:"yōng sè",万乘:"wàn shèng",杆儿:"gǎn ér",葛藤:"gé téng",簿籍:"bù jí",皮夹:"pí jiā",校准:"jiào zhǔn",允当:"yǔn dàng",器量:"qì liàng",选调:"xuǎn diào",扮相:"bàn xiàng",干才:"gàn cái",基干:"jī gàn",割切:"gē qiē",国乐:"guó yuè",卡壳:"qiǎ ké",辟谷:"bì gǔ",磨房:"mò fáng",咿呀:"yī yā",芥末:"jiè mo",薄技:"bó jì",产假:"chǎn jià",诗兴:"shī xìng",重出:"chóng chū",转椅:"zhuàn yǐ",酌量:"zhuó liang",簿册:"bù cè",藏青:"zàng qīng",的士:"dī shì",调人:"diào rén",解元:"jiè yuán",茎干:"jīng gàn",巨量:"jù liàng",榔头:"láng tou",率真:"shuài zhēn",喷香:"pèn xiāng",锁钥:"suǒ yuè",虾蟆:"há má",相图:"xiàng tú",兴会:"xìng huì",灶头:"zào tóu",重婚:"chóng hūn",钻洞:"zuān dòng",忖度:"cǔn duó",党参:"dǎng shēn",调温:"diào wēn",杆塔:"gān tǎ",葛布:"gé bù",拱券:"gǒng xuàn",夹生:"jiā shēng",露馅:"lòu xiàn",恰切:"qià qiè",散见:"sǎn jiàn",哨卡:"shào qiǎ",烫发:"tàng fà",体量:"tǐ liàng",挺括:"tǐng kuò",系带:"jì dài",相士:"xiàng shì",羊圈:"yáng juàn",转矩:"zhuàn jǔ",吧台:"bā tái",苍术:"cāng zhú",菲薄:"fěi bó",蛤蚧:"gé jiè",蛤蜊:"gé lí",瓜蔓:"guā wàn",怪相:"guài xiàng",临帖:"lín tiè",女红:"nǚ gōng",刨床:"bào chuáng",翘楚:"qiáo chǔ",数九:"shǔ jiǔ",谈兴:"tán xìng",雄劲:"xióng jìng",扎染:"zā rǎn",遮荫:"zhē yīn",周正:"zhōu zhèng",赚头:"zhuàn tou",扒手:"pá shǒu",搀和:"chān huo",诚朴:"chéng pǔ",肚量:"dù liàng",干结:"gān jié",工尺:"gōng chě",家累:"jiā lěi",曲水:"qū shuǐ",沙参:"shā shēn",挑花:"tiǎo huā",阿门:"ā mén",背篓:"bēi lǒu",瘪三:"biē sān",裁处:"cái chǔ",创痛:"chuāng tòng",福相:"fú xiàng",更动:"gēng dòng",豪兴:"háo xìng",还阳:"huán yáng",还嘴:"huán zuǐ",借调:"jiè diào",卷云:"juǎn yún",流弹:"liú dàn",想头:"xiǎng tou",削价:"xuē jià",校阅:"jiào yuè",雅量:"yǎ liàng",别传:"bié zhuàn",薄酒:"bó jiǔ",春假:"chūn jià",发妻:"fà qī",哗哗:"huā huā",宽绰:"kuān chuo",了悟:"liǎo wù",切花:"qiē huā",审度:"shěn duó",应许:"yīng xǔ",转台:"zhuàn tái",仔猪:"zǐ zhū",裁量:"cái liáng",藏戏:"zàng xì",乘兴:"chéng xìng",绸缪:"chóu móu",摧折:"cuī zhé",调经:"tiáo jīng",调职:"diào zhí",缝缀:"féng zhuì",骨朵:"gū duǒ",核儿:"hú er",恒量:"héng liàng",还价:"huán jià",浑朴:"hún pǔ",苦差:"kǔ chāi",面糊:"miàn hù",煞车:"shā chē",省视:"xǐng shì",什锦:"shí jǐn",信差:"xìn chāi",余切:"yú qiē",攒眉:"cuán méi",炸糕:"zhá gāo",钻杆:"zuàn gǎn",扒灰:"pá huī",拌和:"bàn huò",长调:"cháng diào",大溜:"dà liù",抖搂:"dǒu lōu",飞转:"fēi zhuàn",干仗:"gàn zhàng",好胜:"hào shèng",画片:"huà piàn",搅混:"jiǎo hún",螺杆:"luó gǎn",木模:"mù mú",怒号:"nù háo",频数:"pín shù",无宁:"wú níng",遗少:"yí shào",邮差:"yóu chāi",占卦:"zhān guà",占星:"zhān xīng",重审:"chóng shěn",自量:"zì liàng",调防:"diào fáng",发廊:"fà láng",反调:"fǎn diào",缝子:"fèng zi",更夫:"gēng fū",骨子:"gǔ zi",光杆:"guāng gǎn",夹棍:"jiā gùn",居丧:"jū sāng",巨贾:"jù gǔ",看押:"kān yā",空转:"kōng zhuàn",量力:"liàng lì",炮烙:"páo luò",赔还:"péi huán",扑扇:"pū shān",散记:"sǎn jì",散件:"sǎn jiàn",删削:"shān xuē",射干:"shè gàn",条几:"tiáo jī",偷空:"tōu kòng",削壁:"xuē bì",校核:"jiào hé",阴干:"yīn gān",择菜:"zhái cài",重九:"chóng jiǔ",主调:"zhǔ diào",自禁:"zì jīn",吧唧:"bā jī",便溺:"biàn niào",词调:"cí diào",叨咕:"dáo gu",落枕:"lào zhěn",铺砌:"pū qì",刷白:"shuà bái",委靡:"wěi mǐ",系泊:"xì bó",相马:"xiàng mǎ",熨帖:"yù tiē",转筋:"zhuàn jīn",棒喝:"bàng hè",傧相:"bīn xiàng",镐头:"gǎo tóu",间苗:"jiàn miáo",乐池:"yuè chí",卖相:"mài xiàng",屏弃:"bǐng qì",铅弹:"qiān dàn",切变:"qiē biàn",请调:"qǐng diào",群氓:"qún méng",散板:"sǎn bǎn",省察:"xǐng chá",事假:"shì jià",纤绳:"qiàn shéng",重影:"chóng yǐng",耕种:"gēng zhòng",种地:"zhòng dì",种菜:"zhòng cài",栽种:"zāi zhòng",接种:"jiē zhòng",垦种:"kěn zhòng",种殖:"zhòng zhí",种瓜:"zhòng guā",种豆:"zhòng dòu",种树:"zhòng shù",睡着:"shuì zháo",笼子:"lóng zi",重启:"chóng qǐ",重整:"chóng zhěng",重弹:"chóng tán",重足:"chóng zú",重山:"chóng shān",重游:"chóng yóu",重峦:"chóng luán",爷爷:"yé ye",奶奶:"nǎi nai",姥爷:"lǎo ye",爸爸:"bà ba",妈妈:"mā ma",婶婶:"shěn shen",舅舅:"jiù jiu",姑姑:"gū gu",叔叔:"shū shu",姨夫:"yí fu",舅母:"jiù mu",姑父:"gū fu",姐夫:"jiě fu",婆婆:"pó po",公公:"gōng gong",舅子:"jiù zi",姐姐:"jiě jie",哥哥:"gē ge",妹妹:"mèi mei",妹夫:"mèi fu",姨子:"yí zi",宝宝:"bǎo bao",娃娃:"wá wa",孩子:"hái zi",日子:"rì zi",样子:"yàng zi",狮子:"shī zi",身子:"shēn zi",架子:"jià zi",嫂子:"sǎo zi",鼻子:"bí zi",亭子:"tíng zi",折子:"zhé zi",面子:"miàn zi",脖子:"bó zi",辈子:"bèi zi",帽子:"mào zi",拍子:"pāi zi",柱子:"zhù zi",辫子:"biàn zi",鸽子:"gē zi",房子:"fáng zi",丸子:"wán zi",摊子:"tān zi",牌子:"pái zi",胡子:"hú zi",鬼子:"guǐ zi",矮子:"ǎi zi",鸭子:"yā zi",小子:"xiǎo zi",影子:"yǐng zi",屋子:"wū zi",对子:"duì zi",点子:"diǎn zi",本子:"běn zi",种子:"zhǒng zi",儿子:"ér zi",兔子:"tù zi",骗子:"piàn zi",院子:"yuàn zi",猴子:"hóu zi",嗓子:"sǎng zi",侄子:"zhí zi",柿子:"shì zi",钳子:"qián zi",虱子:"shī zi",瓶子:"píng zi",豹子:"bào zi",筷子:"kuài zi",篮子:"lán zi",绳子:"shéng zi",嘴巴:"zuǐ ba",耳朵:"ěr duo",茄子:"qié zi",蚌埠:"bèng bù",崆峒:"kōng tóng",琵琶:"pí pa",蘑菇:"mó gu",葫芦:"hú lu",狐狸:"hú li",桔子:"jú zi",盒子:"hé zi",桌子:"zhuō zi",竹子:"zhú zi",师傅:"shī fu",衣服:"yī fu",袜子:"wà zi",杯子:"bēi zi",刺猬:"cì wei",麦子:"mài zi",队伍:"duì wu",知了:"zhī liǎo",鱼儿:"yú er",馄饨:"hún tun",灯笼:"dēng long",庄稼:"zhuāng jia",聪明:"cōng ming",镜子:"jìng zi",银子:"yín zi",盘子:"pán zi",了却:"liǎo què",力气:"lì qi",席子:"xí zi",林子:"lín zi",朝霞:"zhāo xiá",朝夕:"zhāo xī",朝气:"zhāo qì",翅膀:"chì bǎng",省长:"shěng zhǎng",臧否:"zāng pǐ",否泰:"pǐ tài",变得:"biàn de",丈夫:"zhàng fu",豆腐:"dòu fu",笔杆:"bǐ gǎn",枞阳:"zōng yáng",行人:"xíng rén",打着:"dǎ zhe",第一:"dì yī",万一:"wàn yī",之一:"zhī yī",得之:"dé zhī",统一:"tǒng yī",唯一:"wéi yī",专一:"zhuān yī",单一:"dān yī",如一:"rú yī",其一:"qí yī",合一:"hé yī",逐一:"zhú yī",周一:"zhōu yī",初一:"chū yī",研一:"yán yī",归一:"guī yī",假一:"jiǎ yī",闻一:"wén yī",了了:"liǎo liǎo",公了:"gōng liǎo",私了:"sī liǎo",一月:"yī yuè",一号:"yī hào",一级:"yī jí",一等:"yī děng",一哥:"yī gē",月一:"yuè yī",一一:"yī yī",二一:"èr yī",三一:"sān yī",四一:"sì yī",五一:"wǔ yī",六一:"liù yī",七一:"qī yī",八一:"bā yī",九一:"jiǔ yī","一〇":"yī líng",一零:"yī líng",一二:"yī èr",一三:"yī sān",一四:"yī sì",一五:"yī wǔ",一六:"yī liù",一七:"yī qī",一八:"yī bā",一九:"yī jiǔ",一又:"yī yòu",一饼:"yī bǐng",一楼:"yī lóu",为例:"wéi lì",为准:"wéi zhǔn",沧海:"cāng hǎi",难为:"nán wéi",责难:"zé nàn",患难:"huàn nàn",磨难:"mó nàn",大难:"dà nàn",刁难:"diāo nàn",殉难:"xùn nàn",落难:"luò nàn",罹难:"lí nàn",灾难:"zāi nàn",难民:"nàn mín",苦难:"kǔ nàn",危难:"wēi nàn",发难:"fā nàn",逃难:"táo nàn",避难:"bì nàn",遇难:"yù nàn",阻难:"zǔ nàn",厄难:"è nàn",徇难:"xùn nàn",空难:"kōng nàn",喜欢:"xǐ huan",朝朝:"zhāo zhāo",不行:"bù xíng",轧轧:"yà yà",弯曲:"wān qū",扭曲:"niǔ qū",曲直:"qū zhí",委曲:"wěi qū",酒曲:"jiǔ qū",曲径:"qū jìng",曲解:"qū jiě",歪曲:"wāi qū",曲线:"qū xiàn",曲阜:"qū fù",九曲:"jiǔ qū",曲折:"qū zhé",曲肱:"qū gōng",曲意:"qū yì",仡佬:"gē lǎo"},lle=Object.keys(NI).map(e=>({zh:e,pinyin:NI[e],probability:2e-8,length:2,priority:Vl.Normal,dict:Symbol("dict2")})),DI={为什么:"wèi shén me",实际上:"shí jì shang",检察长:"jiǎn chá zhǎng",干什么:"gàn shén me",这会儿:"zhè huì er",尽可能:"jǐn kě néng",董事长:"dǒng shì zhǎng",了不起:"liǎo bù qǐ",参谋长:"cān móu zhǎng",朝鲜族:"cháo xiǎn zú",海内外:"hǎi nèi wài",禁不住:"jīn bú zhù",柏拉图:"bó lā tú",不在乎:"bú zài hu",洛杉矶:"luò shān jī",有点儿:"yǒu diǎn er",迫击炮:"pǎi jī pào",不得了:"bù dé liǎo",马尾松:"mǎ wěi sōng",运输量:"yùn shū liàng",发脾气:"fā pí qi",士大夫:"shì dà fū",鸭绿江:"yā lù jiāng",压根儿:"yà gēn er",对得起:"duì de qǐ",那会儿:"nà huì er",自个儿:"zì gě er",物理量:"wù lǐ liàng",怎么着:"zěn me zhāo",明晃晃:"míng huǎng huǎng",节假日:"jié jià rì",心里话:"xīn lǐ huà",发行量:"fā xíng liàng",兴冲冲:"xìng chōng chōng",分子量:"fēn zǐ liàng",国子监:"guó zǐ jiàn",老大难:"lǎo dà nán",党内外:"dǎng nèi wài",这么着:"zhè me zhāo",少奶奶:"shào nǎi nai",暗地里:"àn dì lǐ",更年期:"gēng nián qī",工作量:"gōng zuò liàng",背地里:"bèi dì lǐ",山里红:"shān li hóng",好好儿:"hǎo hāo er",交响乐:"jiāo xiǎng yuè",好意思:"hǎo yì si",吐谷浑:"tǔ yù hún",没意思:"méi yì si",理发师:"lǐ fà shī",塔什干:"tǎ shí gān",充其量:"chōng qí liàng",靠得住:"kào de zhù",车行道:"chē xíng dào",人行道:"rén xíng dào",中郎将:"zhōng láng jiàng",照明弹:"zhào míng dàn",烟幕弹:"yān mù dàn",没奈何:"mò nài hé",乱哄哄:"luàn hōng hōng",惠更斯:"huì gēng sī",载重量:"zài zhòng liàng",瞧得起:"qiáo de qǐ",纪传体:"jì zhuàn tǐ",阿房宫:"ē páng gōng",卷心菜:"juǎn xīn cài",戏班子:"xì bān zi",过得去:"guò de qù",花岗石:"huā gāng shí",外甥女:"wài sheng nǚ",团团转:"tuán tuán zhuàn",大堡礁:"dà bǎo jiāo",燃烧弹:"rán shāo dàn",劳什子:"láo shí zi",摇滚乐:"yáo gǔn yuè",夹竹桃:"jiā zhú táo",闹哄哄:"nào hōng hōng",三连冠:"sān lián guàn",重头戏:"zhòng tóu xì",二人转:"èr rén zhuàn",节骨眼:"jiē gǔ yǎn",知识面:"zhī shi miàn",护士长:"hù shi zhǎng",信号弹:"xìn hào dàn",干电池:"gān diàn chí",枪杆子:"qiāng gǎn zi",哭丧棒:"kū sāng bàng",鼻咽癌:"bí yān ái",瓦岗军:"wǎ gāng jūn",买得起:"mǎi de qǐ",癞蛤蟆:"lài há ma",脊梁骨:"jǐ liang gǔ",子母弹:"zǐ mǔ dàn",开小差:"kāi xiǎo chāi",女强人:"nǚ qiáng rén",英雄传:"yīng xióng zhuàn",爵士乐:"jué shì yuè",说笑话:"shuō xiào hua",碰头会:"pèng tóu huì",玻璃钢:"bō li gāng",曳光弹:"yè guāng dàn",少林拳:"shào lín quán",咏叹调:"yǒng tàn diào",少先队:"shào xiān duì",灵长目:"líng zhǎng mù",对着干:"duì zhe gàn",蒙蒙亮:"méng méng liàng",软骨头:"ruǎn gǔ tou",铺盖卷:"pū gài juǎn",和稀泥:"huò xī ní",背黑锅:"bēi hēi guō",红彤彤:"hóng tōng tōng",武侯祠:"wǔ hóu cí",打哆嗦:"dǎ duō suo",户口簿:"hù kǒu bù",马尾藻:"mǎ wěi zǎo",夜猫子:"yè māo zi",打手势:"dǎ shǒu shì",龙王爷:"lóng wáng yé",气头上:"qì tóu shang",糊涂虫:"hú tu chóng",笔杆子:"bǐ gǎn zi",占便宜:"zhàn pián yi",打主意:"dǎ zhǔ yì",多弹头:"duō dàn tóu",露一手:"lòu yì shǒu",堰塞湖:"yàn sè hú",保得住:"bǎo de zhù",趵突泉:"bào tū quán",奥得河:"ào de hé",司务长:"sī wù zhǎng",禁不起:"jīn bù qǐ",什刹海:"shí chà hǎi",莲花落:"lián huā lào",见世面:"jiàn shì miàn",豁出去:"huō chū qù",电位差:"diàn wèi chā",挨个儿:"āi gè er",那阵儿:"nà zhèn er",肺活量:"fèi huó liàng",大师傅:"dà shī fu",掷弹筒:"zhì dàn tǒng",打呼噜:"dǎ hū lu",广渠门:"ān qú mén",未见得:"wèi jiàn dé",大婶儿:"dà shěn er",谈得来:"tán de lái",脚丫子:"jiǎo yā zi",空包弹:"kōng bāo dàn",窝里斗:"wō li dòu",弹着点:"dàn zhuó diǎn",个头儿:"gè tóu er",看得起:"kàn de qǐ",糊涂账:"hú tu zhàng",大猩猩:"dà xīng xing",禁得起:"jīn de qǐ",法相宗:"fǎ xiàng zōng",可怜相:"kě lián xiàng",吃得下:"chī de xià",汉堡包:"hàn bǎo bāo",闹嚷嚷:"nào rāng rāng",数来宝:"shǔ lái bǎo",合得来:"hé de lái",干性油:"gān xìng yóu",闷葫芦:"mèn hú lu",呱呱叫:"guā guā jiào",西洋参:"xī yáng shēn",林荫道:"lín yīn dào",拉家常:"lā jiā cháng",卷铺盖:"juǎn pū gài",过得硬:"guò de yìng",飞将军:"fēi jiāng jūn",挑大梁:"tiǎo dà liáng",哈巴狗:"hǎ ba gǒu",过家家:"guò jiā jiā",催泪弹:"cuī lèi dàn",雨夹雪:"yǔ jiā xuě",敲竹杠:"qiāo zhú gàng",列车长:"liè chē zhǎng",华达呢:"huá dá ní",犯得着:"fàn de zháo",土疙瘩:"tǔ gē da",煞风景:"shā fēng jǐng",轻量级:"qīng liàng jí",羞答答:"xiū dā dā",石子儿:"shí zǐ er",达姆弹:"dá mǔ dàn",科教片:"kē jiào piān",侃大山:"kǎn dà shān",丁点儿:"dīng diǎn er",吃得消:"chī de xiāo",捋虎须:"luō hǔ xū",高丽参:"gāo lí shēn",众生相:"zhòng shēng xiàng",咽峡炎:"yān xiá yán",禁得住:"jīn de zhù",吃得开:"chī de kāi",柞丝绸:"zuò sī chóu",应声虫:"yìng shēng chóng",数得着:"shǔ de zháo",傻劲儿:"shǎ jìn er",铅玻璃:"qiān bō li",可的松:"kě dì sōng",划得来:"huá de lái",晕乎乎:"yūn hū hū",屎壳郎:"shǐ ke làng",尥蹶子:"liào juě zi",藏红花:"zàng hóng huā",闷罐车:"mèn guàn chē",卡脖子:"qiǎ bó zi",红澄澄:"hóng deng deng",赶得及:"gǎn de jí",当间儿:"dāng jiàn er",露马脚:"lòu mǎ jiǎo",鸡内金:"jī nèi jīn",犯得上:"fàn de shàng",钉齿耙:"dīng chǐ bà",饱和点:"bǎo hé diǎn",龙爪槐:"lóng zhǎo huái",喝倒彩:"hè dào cǎi",定冠词:"dìng guàn cí",担担面:"dàn dan miàn",吃得住:"chī de zhù",爪尖儿:"zhuǎ jiān er",支着儿:"zhī zhāo er",折跟头:"zhē gēn tou",阴着儿:"yīn zhāo er",烟卷儿:"yān juǎn er",宣传弹:"xuān chuán dàn",信皮儿:"xìn pí er",弦切角:"xián qiē jiǎo",缩砂密:"sù shā mì",说得来:"shuō de lái",水漂儿:"shuǐ piāo er",耍笔杆:"shuǎ bǐ gǎn",数得上:"shǔ de shàng",数不着:"shǔ bù zháo",数不清:"shǔ bù qīng",什件儿:"shí jiàn er",生死簿:"shēng sǐ bù",扇风机:"shān fēng jī",撒呓挣:"sā yì zheng",日记簿:"rì jì bù",热得快:"rè de kuài",亲家公:"qìng jia gōng",奇函数:"jī hán shù",拍纸簿:"pāi zhǐ bù",努劲儿:"nǔ jìn er",泥娃娃:"ní wá wa",内切圆:"nèi qiē yuán",哪会儿:"nǎ huì er",闷头儿:"mēn tóu er",没谱儿:"méi pǔ er",铆劲儿:"mǎo jìn er",溜肩膀:"liū jiān bǎng",了望台:"liào wàng tái",老来少:"lǎo lái shào",坤角儿:"kūn jué er",考勤簿:"kǎo qín bù",卷笔刀:"juǎn bǐ dāo",进给量:"jìn jǐ liàng",划不来:"huá bù lái",汗褂儿:"hàn guà er",鼓囊囊:"gǔ nāng nāng",够劲儿:"gòu jìn er",公切线:"gōng qiē xiàn",搁得住:"gé de zhù",赶浪头:"gǎn làng tóu",赶得上:"gǎn de shàng",干酵母:"gān jiào mǔ",嘎渣儿:"gā zhā er",嘎嘣脆:"gā bēng cuì",对得住:"duì de zhù",逗闷子:"dòu mèn zi",顶呱呱:"dǐng guā guā",滴溜儿:"dī liù er",大轴子:"dà zhòu zi",打板子:"dǎ bǎn zi",寸劲儿:"cùn jìn er",醋劲儿:"cù jìn er",揣手儿:"chuāi shǒu er",冲劲儿:"chòng jìn er",吃得来:"chī de lái",不更事:"bù gēng shì",奔头儿:"bèn tou er",百夫长:"bǎi fū zhǎng",娃娃亲:"wá wa qīn",死劲儿:"sǐ jìn er",骨朵儿:"gū duǒ er",功劳簿:"gōng láo bù",都江堰:"dū jiāng yàn",一担水:"yí dàn shuǐ",否极泰:"pǐ jí tài",泰来否:"tài lái pǐ",咳特灵:"ké tè líng",开户行:"kāi hù háng",郦食其:"lì yì jī",花事了:"huā shì liǎo",一更更:"yì gēng gēng",一重山:"yì chóng shān",风一更:"fēng yì gēng",雪一更:"xuě yì gēng",归一码:"guī yì mǎ",星期一:"xīng qī yī",礼拜一:"lǐ bài yī",一季度:"yī jì dù",一月一:"yī yuè yī",一字马:"yī zì mǎ",一是一:"yī shì yī",一次方:"yī cì fāng",一阳指:"yī yáng zhǐ",一字决:"yī zì jué",一年级:"yī nián jí",一不做:"yī bú zuò",屈戌儿:"qū qu ér",难为水:"nán wéi shuǐ",难为情:"nán wéi qíng",行一行:"xíng yì háng",别别的:"biè bié de",干哪行:"gàn nǎ háng",干一行:"gàn yì háng",曲别针:"qū bié zhēn"},ale=Object.keys(DI).map(e=>({zh:e,pinyin:DI[e],probability:2e-8,length:3,priority:Vl.Normal,dict:Symbol("dict3")})),FI={成吉思汗:"chéng jí sī hán",四通八达:"sì tōng bā dá",一模一样:"yì mú yí yàng",青藏高原:"qīng zàng gāo yuán",阿弥陀佛:"ē mí tuó fó",解放思想:"jiè fàng sī xiǎng",所作所为:"suǒ zuò suǒ wéi",迷迷糊糊:"mí mí hu hū",荷枪实弹:"hè qiāng shí dàn",兴高采烈:"xìng gāo cǎi liè",无能为力:"wú néng wéi lì",布鲁塞尔:"bù lǔ sài ěr",为所欲为:"wéi suǒ yù wéi",克什米尔:"kè shí mǐ ěr",没完没了:"méi wán méi liǎo",不为人知:"bù wéi rén zhī",结结巴巴:"jiē jiē bā bā",前仆后继:"qián pū hòu jì",铺天盖地:"pū tiān gài dì",直截了当:"zhí jié liǎo dàng",供不应求:"gōng bú yìng qiú",御史大夫:"yù shǐ dà fū",不为瓦全:"bù wéi wǎ quán",不可收拾:"bù kě shōu shi",胡作非为:"hú zuò fēi wéi",分毫不差:"fēn háo bú chà",模模糊糊:"mó mó hu hū",不足为奇:"bù zú wéi qí",悄无声息:"qiǎo wú shēng xī",了如指掌:"liǎo rú zhǐ zhǎng",深恶痛绝:"shēn wù tòng jué",高高兴兴:"gāo gāo xìng xìng",唉声叹气:"āi shēng tàn qì",汉藏语系:"hàn zàng yǔ xì",处心积虑:"chǔ xīn jī lǜ",泣不成声:"qì bù chéng shēng",半夜三更:"bàn yè sān gēng",失魂落魄:"shī hún luò pò",二十八宿:"èr shí bā xiù",转来转去:"zhuàn lái zhuàn qù",数以万计:"shǔ yǐ wàn jì",相依为命:"xiāng yī wéi mìng",恋恋不舍:"liàn liàn bù shě",屈指可数:"qū zhǐ kě shǔ",神出鬼没:"shén chū guǐ mò",结结实实:"jiē jiē shí shí",有的放矢:"yǒu dì fàng shǐ",叽哩咕噜:"jī lǐ gū lū",调兵遣将:"diào bīng qiǎn jiàng",载歌载舞:"zài gē zài wǔ",转危为安:"zhuǎn wēi wéi ān",踏踏实实:"tā tā shi shí",桑给巴尔:"sāng jǐ bā ěr",装模作样:"zhuāng mú zuò yàng",见义勇为:"jiàn yì yǒng wéi",相差无几:"xiāng chā wú jǐ",叹为观止:"tàn wéi guān zhǐ",闷闷不乐:"mèn mèn bú lè",喜怒哀乐:"xǐ nù āi lè",鲜为人知:"xiǎn wéi rén zhī",张牙舞爪:"zhāng yá wǔ zhǎo",为非作歹:"wéi fēi zuò dǎi",含糊其辞:"hán hú qí cí",疲于奔命:"pí yú bēn mìng",勉为其难:"miǎn wéi qí nán",依依不舍:"yī yī bù shě",顶头上司:"dǐng tóu shàng si",不着边际:"bù zhuó biān jì",大模大样:"dà mú dà yàng",寻欢作乐:"xún huān zuò lè",一走了之:"yì zǒu liǎo zhī",字里行间:"zì lǐ háng jiān",含含糊糊:"hán hán hu hū",恰如其分:"qià rú qí fèn",破涕为笑:"pò tì wéi xiào",深更半夜:"shēn gēng bàn yè",千差万别:"qiān chā wàn bié",数不胜数:"shǔ bú shèng shǔ",据为己有:"jù wéi jǐ yǒu",天旋地转:"tiān xuán dì zhuàn",养尊处优:"yǎng zūn chǔ yōu",玻璃纤维:"bō li xiān wéi",吵吵闹闹:"chāo chao nào nào",晕头转向:"yūn tóu zhuàn xiàng",土生土长:"tǔ shēng tǔ zhǎng",宁死不屈:"nìng sǐ bù qū",不省人事:"bù xǐng rén shì",尽力而为:"jìn lì ér wéi",精明强干:"jīng míng qiáng gàn",唠唠叨叨:"láo lao dāo dāo",叽叽喳喳:"jī ji zhā zhā",功不可没:"gōng bù kě mò",锲而不舍:"qiè ér bù shě",排忧解难:"pái yōu jiě nàn",稀里糊涂:"xī li hú tú",各有所长:"gè yǒu suǒ cháng",的的确确:"dí dí què què",哄堂大笑:"hōng táng dà xiào",听而不闻:"tīng ér bù wén",刀耕火种:"dāo gēng huǒ zhòng",内分泌腺:"nèi fèn mì xiàn",化险为夷:"huà xiǎn wéi yí",百发百中:"bǎi fā bǎi zhòng",重见天日:"chóng jiàn tiān rì",反败为胜:"fǎn bài wéi shèng",一了百了:"yì liǎo bǎi liǎo",大大咧咧:"dà da liē liē",心急火燎:"xīn jí huǒ liǎo",粗心大意:"cū xīn dà yi",鸡皮疙瘩:"jī pí gē da",夷为平地:"yí wéi píng dì",日积月累:"rì jī yuè lěi",设身处地:"shè shēn chǔ dì",投其所好:"tóu qí suǒ hào",间不容发:"jiān bù róng fà",人满为患:"rén mǎn wéi huàn",穷追不舍:"qióng zhuī bù shě",为时已晚:"wéi shí yǐ wǎn",如数家珍:"rú shǔ jiā zhēn",心里有数:"xīn lǐ yǒu shù",以牙还牙:"yǐ yá huán yá",神不守舍:"shén bù shǒu shě",孟什维克:"mèng shí wéi kè",各自为战:"gè zì wéi zhàn",怨声载道:"yuàn shēng zài dào",救苦救难:"jiù kǔ jiù nàn",好好先生:"hǎo hǎo xiān sheng",怪模怪样:"guài mú guài yàng",抛头露面:"pāo tóu lù miàn",游手好闲:"yóu shǒu hào xián",无所不为:"wú suǒ bù wéi",调虎离山:"diào hǔ lí shān",步步为营:"bù bù wéi yíng",好大喜功:"hào dà xǐ gōng",众矢之的:"zhòng shǐ zhī dì",长生不死:"cháng shēng bù sǐ",蔚为壮观:"wèi wéi zhuàng guān",不可胜数:"bù kě shèng shǔ",鬼使神差:"guǐ shǐ shén chāi",洁身自好:"jié shēn zì hào",敢作敢为:"gǎn zuò gǎn wéi",茅塞顿开:"máo sè dùn kāi",走马换将:"zǒu mǎ huàn jiàng",为时过早:"wéi shí guò zǎo",为人师表:"wéi rén shī biǎo",阴差阳错:"yīn chā yáng cuò",油腔滑调:"yóu qiāng huá diào",重蹈覆辙:"chóng dǎo fù zhé",骂骂咧咧:"mà ma liē liē",絮絮叨叨:"xù xù dāo dāo",如履薄冰:"rú lǚ bó bīng",损兵折将:"sǔn bīng zhé jiàng",拐弯抹角:"guǎi wān mò jiǎo",像模像样:"xiàng mú xiàng yàng",供过于求:"gōng guò yú qiú",开花结果:"kāi huā jiē guǒ",仔仔细细:"zǐ zǐ xì xì",川藏公路:"chuān zàng gōng lù",河北梆子:"hé běi bāng zi",长年累月:"cháng nián lěi yuè",正儿八经:"zhèng er bā jīng",不识抬举:"bù shí tái ju",重振旗鼓:"chóng zhèn qí gǔ",气息奄奄:"qì xī yān yān",紧追不舍:"jǐn zhuī bù shě",服服帖帖:"fú fu tiē tiē",强词夺理:"qiǎng cí duó lǐ",噼里啪啦:"pī li pā lā",人才济济:"rén cái jǐ jǐ",发人深省:"fā rén shēn xǐng",不足为凭:"bù zú wéi píng",为富不仁:"wéi fù bù rén",连篇累牍:"lián piān lěi dú",呼天抢地:"hū tiān qiāng dì",落落大方:"luò luò dà fāng",自吹自擂:"zì chuī zì léi",乐善好施:"lè shàn hào shī",以攻为守:"yǐ gōng wéi shǒu",磨磨蹭蹭:"mó mó cèng cèng",削铁如泥:"xuē tiě rú ní",助纣为虐:"zhù zhòu wéi nüè",以退为进:"yǐ tuì wéi jìn",嘁嘁喳喳:"qī qī chā chā",枪林弹雨:"qiāng lín dàn yǔ",令人发指:"lìng rén fà zhǐ",转败为胜:"zhuǎn bài wéi shèng",转弯抹角:"zhuǎn wān mò jiǎo",在劫难逃:"zài jié nán táo",正当防卫:"zhèng dàng fáng wèi",不足为怪:"bù zú wéi guài",难兄难弟:"nàn xiōng nàn dì",咿咿呀呀:"yī yī yā yā",弹尽粮绝:"dàn jìn liáng jué",阿谀奉承:"ē yú fèng chéng",稀里哗啦:"xī li huā lā",返老还童:"fǎn lǎo huán tóng",好高骛远:"hào gāo wù yuǎn",鹿死谁手:"lù sǐ shéi shǒu",差强人意:"chā qiáng rén yì",大吹大擂:"dà chuī dà léi",成家立业:"chéng jiā lì yè",自怨自艾:"zì yuàn zì yì",负债累累:"fù zhài lěi lěi",古为今用:"gǔ wéi jīn yòng",入土为安:"rù tǔ wéi ān",下不为例:"xià bù wéi lì",一哄而上:"yì hōng ér shàng",没头苍蝇:"méi tóu cāng ying",天差地远:"tiān chā dì yuǎn",风卷残云:"fēng juǎn cán yún",多灾多难:"duō zāi duō nàn",乳臭未干:"rǔ xiù wèi gān",行家里手:"háng jiā lǐ shǒu",狼狈为奸:"láng bèi wéi jiān",处变不惊:"chǔ biàn bù jīng",一唱一和:"yí chàng yí hè",一念之差:"yí niàn zhī chā",金蝉脱壳:"jīn chán tuō qiào",滴滴答答:"dī dī dā dā",硕果累累:"shuò guǒ léi léi",好整以暇:"hào zhěng yǐ xiá",红得发紫:"hóng de fā zǐ",传为美谈:"chuán wéi měi tán",富商大贾:"fù shāng dà gǔ",四海为家:"sì hǎi wéi jiā",了若指掌:"liǎo ruò zhǐ zhǎng",大有可为:"dà yǒu kě wéi",出头露面:"chū tóu lù miàn",鼓鼓囊囊:"gǔ gu nāng nāng",窗明几净:"chuāng míng jī jìng",泰然处之:"tài rán chǔ zhī",怒发冲冠:"nù fà chōng guān",有机玻璃:"yǒu jī bō li",骨头架子:"gǔ tou jià zi",义薄云天:"yì bó yún tiān",一丁点儿:"yī dīng diǎn er",时来运转:"shí lái yùn zhuǎn",陈词滥调:"chén cí làn diào",化整为零:"huà zhěng wéi líng",火烧火燎:"huǒ shāo huǒ liǎo",干脆利索:"gàn cuì lì suǒ",吊儿郎当:"diào er láng dāng",广种薄收:"guǎng zhòng bó shōu",种瓜得瓜:"zhòng guā dé guā",种豆得豆:"zhòng dòu dé dòu",难舍难分:"nán shě nán fēn",歃血为盟:"shà xuè wéi méng",奋发有为:"fèn fā yǒu wéi",阴错阳差:"yīn cuò yáng chā",东躲西藏:"dōng duǒ xī cáng",烟熏火燎:"yān xūn huǒ liǎo",钻牛角尖:"zuān niú jiǎo jiān",乔装打扮:"qiáo zhuāng dǎ bàn",改弦更张:"gǎi xián gēng zhāng",河南梆子:"hé nán bāng zi",好吃懒做:"hào chī lǎn zuò",何乐不为:"hé lè bù wéi",大出风头:"dà chū fēng tóu",攻城掠地:"gōng chéng lüè dì",漂漂亮亮:"piào piào liang liang",折衷主义:"zhé zhōng zhǔ yì",大马哈鱼:"dà mǎ hǎ yú",绿树成荫:"lǜ shù chéng yīn",率先垂范:"shuài xiān chuí fàn",家长里短:"jiā cháng lǐ duǎn",宽大为怀:"kuān dà wéi huái",左膀右臂:"zuǒ bǎng yòu bì",一笑了之:"yí xiào liǎo zhī",天下为公:"tiān xià wéi gōng",还我河山:"huán wǒ hé shān",何足为奇:"hé zú wéi qí",好自为之:"hǎo zì wéi zhī",风姿绰约:"fēng zī chuò yuē",大雨滂沱:"dà yǔ pāng tuó",传为佳话:"chuán wéi jiā huà",吃里扒外:"chī lǐ pá wài",重操旧业:"chóng cāo jiù yè",小家子气:"xiǎo jiā zi qì",少不更事:"shào bù gēng shì",难分难舍:"nán fēn nán shě",添砖加瓦:"tiān zhuān jiā wǎ",是非分明:"shì fēi fēn míng",舍我其谁:"shě wǒ qí shuí",偏听偏信:"piān tīng piān xìn",量入为出:"liàng rù wéi chū",降龙伏虎:"xiáng lóng fú hǔ",钢化玻璃:"gāng huà bō li",正中下怀:"zhèng zhòng xià huái",以身许国:"yǐ shēn xǔ guó",一语中的:"yì yǔ zhòng dì",丧魂落魄:"sàng hún luò pò",三座大山:"sān zuò dà shān",济济一堂:"jǐ jǐ yì táng",好事之徒:"hào shì zhī tú",干净利索:"gàn jìng lì suǒ",出将入相:"chū jiàng rù xiàng",袅袅娜娜:"niǎo niǎo nuó nuó",狐狸尾巴:"hú li wěi ba",好逸恶劳:"hào yì wù láo",大而无当:"dà ér wú dàng",打马虎眼:"dǎ mǎ hu yǎn",板上钉钉:"bǎn shàng dìng dīng",吆五喝六:"yāo wǔ hè liù",虾兵蟹将:"xiā bīng xiè jiàng",水调歌头:"shuǐ diào gē tóu",数典忘祖:"shǔ diǎn wàng zǔ",人事不省:"rén shì bù xǐng",曲高和寡:"qǔ gāo hè guǎ",屡教不改:"lǚ jiào bù gǎi",互为因果:"hù wéi yīn guǒ",互为表里:"hù wéi biǎo lǐ",厚此薄彼:"hòu cǐ bó bǐ",过关斩将:"guò guān zhǎn jiàng",疙疙瘩瘩:"gē ge dā dā",大腹便便:"dà fù pián pián",走为上策:"zǒu wéi shàng cè",冤家对头:"yuān jia duì tóu",有隙可乘:"yǒu xì kě chèng",一鳞半爪:"yì lín bàn zhǎo",片言只语:"piàn yán zhǐ yǔ",开花结实:"kāi huā jié shí",经年累月:"jīng nián lěi yuè",含糊其词:"hán hú qí cí",寡廉鲜耻:"guǎ lián xiǎn chǐ",成年累月:"chéng nián lěi yuè",不徇私情:"bú xùn sī qíng",不当人子:"bù dāng rén zǐ",膀大腰圆:"bǎng dà yāo yuán",指腹为婚:"zhǐ fù wéi hūn",这么点儿:"zhè me diǎn er",意兴索然:"yì xīng suǒ rán",绣花枕头:"xiù huā zhěn tou",无的放矢:"wú dì fàng shǐ",望闻问切:"wàng wén wèn qiè",舍己为人:"shě jǐ wèi rén",穷年累月:"qióng nián lěi yuè",排难解纷:"pái nàn jiě fēn",处之泰然:"chǔ zhī tài rán",指鹿为马:"zhǐ lù wéi mǎ",危如累卵:"wēi rú lěi luǎn",天兵天将:"tiān bīng tiān jiàng",舍近求远:"shě jìn qiú yuǎn",南腔北调:"nán qiāng běi diào",苦中作乐:"kǔ zhōng zuò lè",厚积薄发:"hòu jī bó fā",臭味相投:"xiù wèi xiāng tóu",长幼有序:"zhǎng yòu yǒu xù",逼良为娼:"bī liáng wéi chāng",悲悲切切:"bēi bēi qiè qiē",败军之将:"bài jūn zhī jiàng",欺行霸市:"qī háng bà shì",削足适履:"xuē zú shì lǚ",先睹为快:"xiān dǔ wéi kuài",啼饥号寒:"tí jī háo hán",疏不间亲:"shū bú jiàn qīn",神差鬼使:"shén chāi guǐ shǐ",敲敲打打:"qiāo qiāo dǎ dǎ",平铺直叙:"píng pū zhí xù",没头没尾:"méi tóu mò wěi",寥寥可数:"liáo liáo kě shǔ",哼哈二将:"hēng hā èr jiàng",鹤发童颜:"hè fà tóng yán",各奔前程:"gè bèn qián chéng",弹无虚发:"dàn wú xū fā",大人先生:"dà rén xiān sheng",与民更始:"yǔ mín gēng shǐ",树碑立传:"shù bēi lì zhuàn",是非得失:"shì fēi dé shī",实逼处此:"shí bī chǔ cǐ",塞翁失马:"sài wēng shī mǎ",日薄西山:"rì bó xī shān",切身体会:"qiè shēn tǐ huì",片言只字:"piàn yán zhǐ zì",跑马卖解:"pǎo mǎ mài xiè",宁折不弯:"nìng zhé bù wān",零零散散:"líng líng sǎn sǎn",量体裁衣:"liàng tǐ cái yī",连中三元:"lián zhòng sān yuán",礼崩乐坏:"lǐ bēng yuè huài",不为已甚:"bù wéi yǐ shèn",转悲为喜:"zhuǎn bēi wéi xǐ",以眼还眼:"yǐ yǎn huán yǎn",蔚为大观:"wèi wéi dà guān",未为不可:"wèi wéi bù kě",童颜鹤发:"tóng yán hè fà",朋比为奸:"péng bǐ wéi jiān",莫此为甚:"mò cǐ wéi shèn",夹枪带棒:"jiā qiāng dài bàng",富商巨贾:"fù shāng jù jiǎ",淡然处之:"dàn rán chǔ zhī",箪食壶浆:"dān shí hú jiāng",创巨痛深:"chuāng jù tòng shēn",草长莺飞:"cǎo zhǎng yīng fēi",坐视不救:"zuò shī bú jiù",以己度人:"yǐ jǐ duó rén",随行就市:"suí háng jiù shì",文以载道:"wén yǐ zài dào",文不对题:"wén bú duì tí",铁板钉钉:"tiě bǎn dìng dīng",身体发肤:"shēn tǐ fà fū",缺吃少穿:"quē chī shǎo chuān",目无尊长:"mù wú zūn zhǎng",吉人天相:"jí rén tiān xiàng",毁家纾难:"huǐ jiā shū nàn",钢筋铁骨:"gāng jīn tiě gǔ",丢卒保车:"diū zú bǎo jū",丢三落四:"diū sān là sì",闭目塞听:"bì mù sè tīng",削尖脑袋:"xuē jiān nǎo dài",为非作恶:"wéi fēi zuò è",人才难得:"rén cái nán dé",情非得已:"qíng fēi dé yǐ",切中要害:"qiè zhòng yào hài",火急火燎:"huǒ jí huǒ liǎo",画地为牢:"huà dì wéi láo",好酒贪杯:"hào jiǔ tān bēi",长歌当哭:"cháng gē dàng kū",载沉载浮:"zài chén zài fú",遇难呈祥:"yù nàn chéng xiáng",榆木疙瘩:"yú mù gē da",以邻为壑:"yǐ lín wéi hè",洋为中用:"yáng wéi zhōng yòng",言为心声:"yán wéi xīn shēng",言必有中:"yán bì yǒu zhòng",图穷匕见:"tú qióng bǐ xiàn",滂沱大雨:"páng tuó dà yǔ",目不暇给:"mù bù xiá jǐ",量才录用:"liàng cái lù yòng",教学相长:"jiào xué xiāng zhǎng",悔不当初:"huǐ bù dāng chū",呼幺喝六:"hū yāo hè liù",不足为训:"bù zú wéi xùn",不拘形迹:"bù jū xíng jī",傍若无人:"páng ruò wú rén",罪责难逃:"zuì zé nán táo",自我吹嘘:"zì wǒ chuī xū",转祸为福:"zhuǎn huò wéi fú",勇冠三军:"yǒng guàn sān jūn",易地而处:"yì dì ér chǔ",卸磨杀驴:"xiè mò shā lǘ",玩儿不转:"wán ér bú zhuàn",天道好还:"tiān dào hǎo huán",身单力薄:"shēn dān lì bó",撒豆成兵:"sǎ dòu chéng bīng",片纸只字:"piàn zhǐ zhī zì",宁缺毋滥:"nìng quē wú làn",没没无闻:"mò mò wú wén",量力而为:"liàng lì ér wéi",历历可数:"lì lì kě shǔ",口碑载道:"kǒu bēi zài dào",君子好逑:"jūn zǐ hǎo qiú",好为人师:"hào wéi rén shī",豪商巨贾:"háo shāng jù jiǎ",各有所好:"gè yǒu suǒ hào",度德量力:"duó dé liàng lì",指天为誓:"zhǐ tiān wéi shì",逸兴遄飞:"yì xìng chuán fēi",心宽体胖:"xīn kuān tǐ pán",为德不卒:"wéi dé bù zú",天下为家:"tiān xià wéi jiā",视为畏途:"shì wéi wèi tú",三灾八难:"sān zāi bā nàn",沐猴而冠:"mù hóu ér guàn",哩哩啦啦:"lī li lā lā",见缝就钻:"jiàn fèng jiù zuān",夹层玻璃:"jiā céng bō li",急公好义:"jí gōng hào yì",积年累月:"jī nián lěi yuè",划地为牢:"huá dì wéi láo",更名改姓:"gēng míng gǎi xìng",奉为圭臬:"fèng wéi guī niè",多难兴邦:"duō nàn xīng bāng",不破不立:"bú pò bú lì",坐地自划:"zuò dì zì huá",坐不重席:"zuò bù chóng xí",坐不窥堂:"zuò bù kuī táng",作嫁衣裳:"zuò jià yī shang",左枝右梧:"zuǒ zhī yòu wú",左宜右有:"zuǒ yí yòu yǒu",钻头觅缝:"zuān tóu mì fèng",钻天打洞:"zuān tiān dǎ dòng",钻皮出羽:"zuān pí chū yǔ",钻火得冰:"zuān huǒ dé bīng",钻洞觅缝:"zuàn dòng mì féng",钻冰求火:"zuān bīng qiú huǒ",子为父隐:"zǐ wéi fù yǐn",擢发难数:"zhuó fà nán shǔ",着人先鞭:"zhuó rén xiān biān",斫雕为朴:"zhuó diāo wéi pǔ",锥处囊中:"zhuī chǔ náng zhōng",椎心饮泣:"chuí xīn yǐn qì",椎心泣血:"chuí xīn qì xuè",椎牛飨士:"chuí niú xiǎng shì",椎牛歃血:"chuí niú shà xuè",椎牛发冢:"chuí niú fà zhǒng",椎埋屠狗:"chuí mái tú gǒu",椎埋狗窃:"chuí mái gǒu qiè",壮发冲冠:"zhuàng fā chōng guàn",庄严宝相:"zhuāng yán bǎo xiàng",转愁为喜:"zhuǎn chóu wéi xǐ",转嗔为喜:"zhuǎn chēn wéi xǐ",拽巷啰街:"zhuài xiàng luó jiē",拽耙扶犁:"zhuāi pá fú lí",拽布拖麻:"zhuài bù tuō má",箸长碗短:"zhù cháng wǎn duǎn",铸剑为犁:"zhù jiàn wéi lí",杼柚其空:"zhù yòu qí kōng",杼柚空虚:"zhù yòu kōng xū",助天为虐:"zhù tiān wéi nüè",属垣有耳:"zhǔ yuán yǒu ěr",属毛离里:"zhǔ máo lí lǐ",属辞比事:"zhǔ cí bǐ shì",逐物不还:"zhú wù bù huán",铢量寸度:"zhū liáng cùn duó",铢两悉称:"zhū liǎng xī chèn",侏儒观戏:"zhū rú guān xì",朱轓皁盖:"zhū fān zào gài",昼度夜思:"zhòu duó yè sī",诪张为幻:"zhōu zhāng wéi huàn",重明继焰:"chóng míng jì yàn",众啄同音:"zhòng zhuó tóng yīn",众毛攒裘:"zhòng máo cuán qiú",众好众恶:"zhòng hào zhòng wù",擿埴索涂:"zhāi zhí suǒ tú",稚齿婑媠:"zhì chǐ wǒ tuó",至当不易:"zhì dàng bú yì",指皂为白:"zhǐ zào wéi bái",指雁为羹:"zhǐ yàn wéi gēng",指树为姓:"zhǐ shù wéi xìng",指山说磨:"zhǐ shān shuō mò",止戈为武:"zhǐ gē wéi wǔ",枝干相持:"zhī gàn xiāng chí",枝大于本:"zh dà yú běn",支吾其词:"zhī wú qí cí",正身率下:"zhèng shēn shuài xià",正冠李下:"zhèng guàn lǐ xià",整冠纳履:"zhěng guān nà lǚ",整躬率物:"zhěng gōng shuài wù",整顿干坤:"zhěng dùn gàn kūn",针头削铁:"zhēn tóu xuē tiě",贞松劲柏:"zhēn sōng jìng bǎi",赭衣塞路:"zhě yī sè lù",折箭为誓:"shé jiàn wéi shì",折而族之:"zhé ér zú zhī",昭德塞违:"zhāo dé sè wéi",章句小儒:"zhāng jù xiǎo rú",湛恩汪濊:"zhàn ēn wāng huì",占风望气:"zhān fēng wàng qì",斩将搴旗:"zhǎn jiàng qiān qí",曾母投杼:"zēng mǔ tóu zhù",曾参杀人:"zēng shēn shā rén",造谣中伤:"zào yáo zhòng shāng",早占勿药:"zǎo zhān wù yào",凿龟数策:"záo guī shǔ cè",攒三聚五:"cuán sān jù wǔ",攒眉蹙额:"cuán mei cù é",攒零合整:"cuán líng hé zhěng",攒锋聚镝:"cuán fēng jù dí",载笑载言:"zài xiào zài yán",载酒问字:"zài jiǔ wèn zì",殒身不恤:"yǔn shēn bú xù",云舒霞卷:"yún shū xiá juǎn",月中折桂:"yuè zhōng shé guì",月落参横:"yuè luò shēn héng",鬻驽窃价:"yù nú qiè jià",鬻鸡为凤:"yù jī wéi fèng",遇难成祥:"yù nàn chéng xiáng",郁郁累累:"yù yù lěi lěi",玉卮无当:"yù zhī wú dàng",语笑喧阗:"yǔ xiào xuān tián",与世沉浮:"yǔ shì chén fú",与时消息:"yǔ shí xiāo xi",逾墙钻隙:"yú qiáng zuān xì",渔夺侵牟:"yú duó qīn móu",杅穿皮蠹:"yú chuān pí dù",余勇可贾:"yú yǒng kě gǔ",予智予雄:"yú zhì yú xióng",予取予求:"yú qǔ yú qiú",于家为国:"yú jiā wéi guó",有借无还:"yǒu jiè wú huán",有加无已:"yǒu jiā wú yǐ",有国难投:"yǒu guó nán tóu",游必有方:"yóu bì yǒu fāng",油干灯尽:"yóu gàn dēng jìn",尤云殢雨:"yóu yún tì yǔ",庸中皦皦:"yōng zhōng jiǎo jiǎo",郢书燕说:"yǐng shū yān shuō",营蝇斐锦:"yíng yíng fēi jǐn",鹰心雁爪:"yīng xīn yàn zhǎo",莺吟燕儛:"yīng yín yàn wǔ",应天顺时:"yīng tiān shùn shí",印累绶若:"yìn léi shòu ruò",隐占身体:"yǐn zhàn shēn tǐ",饮犊上流:"yìn dú shàng liú",引绳切墨:"yǐn shéng qiē mò",龈齿弹舌:"yín chǐ dàn shé",因缘为市:"yīn yuán wéi shì",因树为屋:"yīn shù wéi wū",溢美溢恶:"yì měi yì wù",抑塞磊落:"yì sè lěi luò",倚闾望切:"yǐ lǘ wàng qiē",以意为之:"yǐ yì wéi zhī",以言为讳:"yǐ yán wéi huì",以疏间亲:"yǐ shū jiàn qīn",以水济水:"yǐ shuǐ jǐ shuǐ",以书为御:"yǐ shū wéi yù",以守为攻:"yǐ shǒu wéi gōng",以升量石:"yǐ shēng liáng dàn",以慎为键:"yǐ shèn wéi jiàn",以筌为鱼:"yǐ quán wéi yú",以利累形:"yǐ lì lěi xíng",以毁为罚:"yǐ huǐ wéi fá",以黑为白:"yǐ hēi wéi bái",以规为瑱:"yǐ guī wéi tiàn",以古为鉴:"yǐ gǔ wéi jiàn",以宫笑角:"yǐ gōng xiào jué",以法为教:"yǐ fǎ wéi jiào",以大恶细:"yǐ dà wù xì",遗世忘累:"yí shì wàng lěi",遗寝载怀:"yí qǐn zài huái",移的就箭:"yí dì jiù jiàn",依头缕当:"yī tóu lǚ dàng",衣租食税:"yì zū shí shuì",衣轻乘肥:"yì qīng chéng féi",衣裳之会:"yī shang zhī huì",衣单食薄:"yī dān shí bó",一还一报:"yì huán yí bào",叶公好龙:"yè gōng hào lóng",野调无腔:"yě diào wú qiāng",瑶池女使:"yáo chí nǚ shǐ",幺麽小丑:"yāo mó xiǎo chǒu",养精畜锐:"yǎng jīng xù ruì",卬首信眉:"áng shǒu shēn méi",洋洋纚纚:"yáng yáng sǎ sǎ",羊羔美酒:"yáng gāo měi jiǔ",扬风扢雅:"yáng fēng jié yǎ",燕昭市骏:"yān zhāo shì jùn",燕昭好马:"yān zhāo hǎo mǎ",燕石妄珍:"yān shí wàng zhēn",燕骏千金:"yān jùn qiān jīn",燕金募秀:"yān jīn mù xiù",燕驾越毂:"yān jià yuè gǔ",燕歌赵舞:"yān gē zhào wǔ",燕岱之石:"yān dài zhī shí",燕处危巢:"yàn chǔ wēi cháo",掞藻飞声:"shàn zǎo fēi shēng",偃革为轩:"yǎn gé wéi xuān",妍蚩好恶:"yán chī hǎo è",压良为贱:"yā liáng wéi jiàn",搀行夺市:"chān háng duó shì",泣数行下:"qì shù háng xià",当行出色:"dāng háng chū sè",秀出班行:"xiù chū bān háng",儿女成行:"ér nǚ chéng háng",大行大市:"dà háng dà shì",寻行数墨:"xún háng shǔ mò",埙篪相和:"xūn chí xiāng hè",血债累累:"xuè zhài lěi lěi",炫玉贾石:"xuàn yù gǔ shí",炫石为玉:"xuàn shí wéi yù",悬石程书:"xuán dàn chéng shū",悬狟素飡:"xuán huán sù cān",悬龟系鱼:"xuán guī xì yú",揎拳捋袖:"xuān quán luō xiù",轩鹤冠猴:"xuān hè guàn hóu",畜妻养子:"xù qī yǎng zǐ",羞人答答:"xiū rén dā dā",修鳞养爪:"xiū lín yǎng zhǎo",熊据虎跱:"xióng jù hǔ zhì",兄死弟及:"xiōng sǐ dì jí",腥闻在上:"xīng wén zài shàng",兴文匽武:"xīng wén yǎn wǔ",兴观群怨:"xìng guān qún yuàn",兴高彩烈:"xìng gāo cǎi liè",心手相应:"xīn shǒu xiāng yìng",心口相应:"xīn kǒu xiāng yīng",挟势弄权:"xié shì nòng quán",胁肩累足:"xié jiān lěi zú",校短量长:"jiào duǎn liáng cháng",小眼薄皮:"xiǎo yǎn bó pí",硝云弹雨:"xiāo yún dàn yǔ",鸮鸣鼠暴:"xiāo míng shǔ bào",削株掘根:"xuē zhū jué gēn",削铁无声:"xuē tiě wú shēng",削职为民:"xuē zhí wéi mín",削木为吏:"xuē mù wéi lì",想望风褱:"xiǎng wàng fēng huái",香培玉琢:"xiang pei yu zhuó",相鼠有皮:"xiàng shǔ yǒu pí",相时而动:"xiàng shí ér dòng",相切相磋:"xiāng qiē xiāng cuō",相女配夫:"xiàng nǚ pèi fū",相门有相:"xiàng mén yǒu xiàng",挦章撦句:"xián zhāng chě jù",先我着鞭:"xiān wǒ zhuó biān",习焉不察:"xí yān bù chá",歙漆阿胶:"shè qī ē jiāo",晰毛辨发:"xī máo biàn fà",悉索薄赋:"xī suǒ bó fù",雾鳞云爪:"wù lín yún zhǎo",物稀为贵:"wù xī wéi guì",碔砆混玉:"wǔ fū hùn yù",武断专横:"wǔ duàn zhuān héng",五石六鹢:"wǔ shí liù yì",五色相宣:"wǔ sè xiāng xuān",五侯七贵:"wǔ hóu qī guì",五侯蜡烛:"wǔ hòu là zhú",五羖大夫:"wǔ gǔ dà fū",吾自有处:"wú zì yǒu chǔ",无下箸处:"wú xià zhù chǔ",无伤无臭:"wú shāng wú xiù",无能为役:"wú néng wéi yì",无寇暴死:"wú kòu bào sǐ",无孔不钻:"wú kǒng bú zuàn",无间可乘:"wú jiān kě chéng",无间冬夏:"wú jiān dōng xià",无恶不为:"wú è bù wéi",无动为大:"wú dòng wéi dà",诬良为盗:"wū liáng wéi dào",握拳透爪:"wò quán tòu zhǎo",文武差事:"wén wǔ chāi shì",委委佗佗:"wēi wēi tuó tuó",惟日为岁:"wéi rì wéi suì",帷薄不修:"wéi bó bù xiū",为善最乐:"wéi shàn zuì lè",为山止篑:"wéi shān zhǐ kuì",为仁不富:"wéi rén bú fù",为裘为箕:"wéi qiú wéi jī",为民父母:"wéi mín fù mǔ",为虺弗摧:"wéi huǐ fú cuī",为好成歉:"wéi hǎo chéng qiàn",为鬼为蜮:"wéi guǐ wéi yù",望风响应:"wàng fēng xiǎng yīng",望尘僄声:"wàng chén piào shēng",往渚还汀:"wǎng zhǔ huán tīng",王贡弹冠:"wáng gòng dàn guàn",亡国大夫:"wáng guó dà fū",万贯家私:"wàn guàn jiā sī",晚食当肉:"wǎn shí dàng ròu",晚节不保:"wǎn jié bù bǎo",玩岁愒时:"wán suì kài shí",蛙蟆胜负:"wā má shèng fù",吞言咽理:"tūn yán yàn lǐ",颓垣断堑:"tuí yuán duàn qiàn",推干就湿:"tuī gàn jiù shī",剸繁决剧:"tuán fán jué jù",团头聚面:"tuán tóu jù miàn",兔丝燕麦:"tù sī yàn mài",兔头麞脑:"tù tóu zhāng nǎo",兔葵燕麦:"tù kuí yàn mài",吐哺握发:"tǔ bǔ wò fà",投传而去:"tóu zhuàn ér qù",头没杯案:"tóu mò bēi àn",头昏脑闷:"tóu hūn nǎo mèn",头会箕敛:"tóu kuài jī liǎn",头出头没:"tóu chū tóu mò",痛自创艾:"tòng zì chuāng yì",同恶相助:"tóng wù xiāng zhù",同恶相恤:"tóng wù xiāng xù",痌瘝在抱:"tōng guān zài bào",通文调武:"tōng wén diào wǔ",停留长智:"tíng liú zhǎng zhì",铁树开华:"tiě shù kāi huā",条贯部分:"tiáo guàn bù fēn",挑牙料唇:"tiǎo yá liào chún",挑么挑六:"tiāo yāo tiāo liù",挑唇料嘴:"tiǎo chún liào zuǐ",恬不为意:"tián bù wéi yì",恬不为怪:"tián bù wéi guài",天下为笼:"tiān xià wéi lóng",天台路迷:"tiān tái lù mí",天年不遂:"tiān nián bú suì",探囊胠箧:"tàn náng qū qiè",谭言微中:"tán yán wēi zhòng",谈言微中:"tán yán wēi zhòng",狧穅及米:"shì kāng jí mǐ",随物应机:"suí wù yīng jī",搜岩采干:"sōu yán cǎi gàn",宋斤鲁削:"sòng jīn lǔ xuē",松筠之节:"sōng yún zhī jié",四亭八当:"sì tíng bā dàng",四马攒蹄:"sì mǎ cuán tí",四不拗六:"sì bú niù liù",思所逐之:"sī suǒ zhú zhī",丝恩发怨:"sī ēn fà yuàn",硕望宿德:"shuò wàng xiǔ dé",铄古切今:"shuò gǔ qiē jīn",顺风而呼:"shùn fēng ér hū",顺风吹火:"shùn fēng chuī huǒ",水中著盐:"shuǐ zhōng zhuó yán",双柑斗酒:"shuāng gān dǒu jiǔ",数米而炊:"shǔ mǐ ér chuī",数米量柴:"shǔ mǐ liáng chái",数理逻辑:"shù lǐ luó ji",数黑论黄:"shǔ hēi lùn huáng",数白论黄:"shǔ bái lùn huáng",束缊还妇:"shù yūn huán fù",束蒲为脯:"shù pú wéi pú",束椽为柱:"shù chuán wéi zhù",书缺有间:"shū quē yǒu jiàn",手足重茧:"shǒu zú chóng jiǎn",手足异处:"shǒu zú yì chǔ",手脚干净:"shǒu jiǎo gàn jìng",手不应心:"shǒu bù yīng xīn",螫手解腕:"shì shǒu jiě wàn",释知遗形:"shì zhī yí xíng",适时应务:"shì shí yīng wù",适情率意:"shì qíng shuài yì",适当其冲:"shì dāng qí chōng",视为知己:"shì wéi zhī jǐ",使羊将狼:"shǐ yáng jiàng láng",食为民天:"shí wéi mín tiān",拾掇无遗:"shí duō wú yí",实与有力:"shí yù yǒu lì",石英玻璃:"shí yīng bō li",石室金匮:"shí shì jīn guì",什袭珍藏:"shí xí zhēn cáng",什伍东西:"shí wǔ dōng xī",什围伍攻:"shí wéi wǔ gōng",十魔九难:"shí mó jiǔ nàn",诗书发冢:"shī shū fà zhǒng",虱处裈中:"shī chǔ kūn zhōng",师直为壮:"shī zhí wéi zhuàng",尸居龙见:"shī jū lóng xiàn",圣经贤传:"shèng jīng xián zhuàn",圣君贤相:"shèng jūn xián xiàng",生拖死拽:"shēng tuō sǐ zhuài",审己度人:"shěn jǐ duó rén",神武挂冠:"shén wǔ guà guàn",神龙失埶:"shén lóng shī shì",深文曲折:"shēn wén qǔ shé",深厉浅揭:"shēn lì qiǎn qì",深谷为陵:"shēn gǔ wéi líng",深恶痛疾:"shēn wù tòng jí",深仇宿怨:"shēn chóu xiǔ yuàn",舍己为公:"shě jǐ wèi gōng",舍短取长:"shě duǎn qǔ cháng",舍策追羊:"shě cè zhuī yáng",蛇蝎为心:"shé xiē wéi xīn",少成若性:"shào chéng ruò xìng",上当学乖:"shàng dàng xué guāi",赏不当功:"shǎng bù dāng gōng",善自为谋:"shàn zì wéi móu",善为说辞:"shàn wéi shuō cí",善善恶恶:"shàn shàn wù è",善财难舍:"shàn cái nán shě",苫眼铺眉:"shān yǎn pū méi",讪牙闲嗑:"shàn yá xián kē",山阴乘兴:"shān yīn chéng xīng",山殽野湋:"shān yáo yě wéi",山溜穿石:"shān liù chuān shí",山节藻棁:"shān jié zǎo zhuō",杀鸡为黍:"shā jī wéi shǔ",色厉胆薄:"sè lì dǎn bó",桑荫未移:"sāng yīn wèi yí",桑荫不徙:"sāng yīn bù xǐ",桑土绸缪:"sāng tǔ chóu miù",桑户棬枢:"sāng hù juàn shū",三战三北:"sān zhàn sān běi",三瓦两舍:"sān wǎ liǎng shě",三人为众:"sān rén wèi zhòng",三差两错:"sān chā liǎng cuò",塞井焚舍:"sāi jǐng fén shě",洒心更始:"sǎ xīn gèng shǐ",洒扫应对:"sǎ sǎo yìng duì",软红香土:"ruǎn hóng xiāng tǔ",入吾彀中:"rù wú gòu zhōng",入铁主簿:"rù tiě zhǔ bù",入理切情:"rù lǐ qiē qíng",汝成人耶:"rǔ chéng rén yé",如水投石:"rú shuǐ tóu shí",如切如磋:"rú qiē rú cuō",如登春台:"rú dēng chūn tái",肉薄骨并:"ròu bó gǔ bìng",柔情绰态:"róu qíng chuò tài",戎马劻勷:"róng mǎ kuāng ráng",日中为市:"rì zhōng wéi shì",日月参辰:"rì yuè shēn chén",日省月修:"rì xǐng yuè xiū",日削月割:"rì xuē yuè gē",日省月试:"rì xǐng yuè shì",任达不拘:"rèn dá bù jū",人言藉藉:"rén yán jí jí",人模狗样:"rén mú gǒu yàng",人莫予毒:"rén mò yú dú",热熬翻饼:"rè áo fān bǐng",圈牢养物:"juàn láo yǎng wù",取予有节:"qǔ yǔ yǒu jié",诎要桡腘:"qū yāo ráo guó",穷形尽相:"qióng xíng jìn xiàng",情凄意切:"qíng qī yì qiè",情见势屈:"qíng xiàn shì qū",情见乎辞:"qíng xiàn hū cí",清都绛阙:"qīng dōu jiàng què",倾肠倒肚:"qīng cháng dào dǔ",青紫被体:"qīng zǐ pī tǐ",青林黑塞:"qīng lín hēi sài",螓首蛾眉:"qín shǒu é méi",琴瑟之好:"qín sè zhī hào",且住为佳:"qiě zhù wéi jiā",切树倒根:"qiē shù dǎo gēn",切理餍心:"qiē lǐ yàn xīn",切近的当:"qiē jìn de dāng",翘足引领:"qiáo zú yǐn lǐng",巧发奇中:"qiǎo fā qí zhòng",强嘴拗舌:"jiàng zuǐ niù shé",强直自遂:"qiáng zhí zì suí",强死强活:"qiǎng sǐ qiǎng huó",强食自爱:"qiǎng shí zì ài",强食靡角:"qiǎng shí mí jiǎo",强弓劲弩:"qiáng gōng jìng nǔ",强聒不舍:"qiǎng guō bù shě",强凫变鹤:"qiáng fú biàn hè",强而后可:"qiǎng ér hòu kě",强得易贫:"qiǎng dé yì pín",遣兴陶情:"qiǎn xìng táo qíng",牵羊担酒:"qiān yáng dān jiǔ",千了百当:"qiān liǎo bǎi dàng",泣下如雨:"qì xià rú yǔ",起偃为竖:"qǐ yǎn wéi shù",岂弟君子:"kǎi tì jūn zǐ",綦溪利跂:"qí xī lì qí",棋输先著:"qí shū xiān zhuó",齐王舍牛:"qí wáng shě niú",欺天诳地:"qī tiān kuáng dì",普天率土:"pǔ tiān shuài tǔ",铺胸纳地:"pū xiōng nà dì",铺锦列绣:"pū jǐn liè xiù",破家为国:"pò jiā wèi guó",破觚为圜:"pò gū wéi yuán",萍飘蓬转:"píng piāo péng zhuàn",帡天极地:"píng tiān jí dì",屏声息气:"bǐng shēng xī qì",凭几据杖:"píng jī jù zhàng",贫嘴薄舌:"pín zuǐ bó shé",片语只辞:"piàn yǔ zhī cí",披发文身:"pī fà wén shēn",烹龙炮凤:"pēng lóng páo fèng",炰鳖脍鲤:"fǒu biē kuài lǐ",庞眉皓发:"páng méi hào fà",攀花折柳:"pān huā zhé liǔ",攀蟾折桂:"pān chán shé guì",女大难留:"nǚ dà nán liú",弄玉吹箫:"nòng yù chuī xiāo",弄管调弦:"nòng guǎn tiáo xián",弄粉调朱:"nòng fěn diào zhū",浓抹淡妆:"nóng mò dàn zhuāng",捻土为香:"niǎn tǔ wéi xiāng",年谊世好:"nián yì shì hǎo",年华垂暮:"nián huá chuí mù",儗不于伦:"nǐ bù yú lún",泥而不滓:"ní ér bù zǐ",能者为师:"néng zhě wéi shī",能不称官:"néng bú chèn guān",挠直为曲:"náo zhí wéi qū",难进易退:"nán jìn yì tuì",难得糊涂:"nán dé hú tú",南蛮鴂舌:"nán mán jué shé",南贩北贾:"nán fàn běi gǔ",牧猪奴戏:"mù zhū nú xì",目眢心忳:"mù yuān xīn tún",目挑心招:"mù tiǎo xīn zhāo",目量意营:"mù liàng yì yíng",木头木脑:"mù tóu mù nǎo",木干鸟栖:"mù gàn niǎo qī",侔色揣称:"móu sè chuǎi chèn",莫予毒也:"mò yú dú yě",抹粉施脂:"mò fěn shī zhī",磨砻镌切:"mó lóng juān qiē",磨棱刓角:"mó léng wán jiǎo",摸门不着:"mō mén bù zháo",摸不着边:"mō bù zhuó biān",命中注定:"mìng zhōng zhù dìng",鸣鹤之应:"míng hè zhī yìng",明效大验:"míng xiào dà yàn",名我固当:"míng wǒ gù dāng",邈处欿视:"miǎo chǔ kǎn shì",黾穴鸲巢:"měng xué qú cháo",绵里薄材:"mián lǐ bó cái",靡有孑遗:"mǐ yǒu jié yí",靡衣偷食:"mǐ yī tōu shí",迷恋骸骨:"mí liàn hái gǔ",扪参历井:"mén shēn lì jǐng",门单户薄:"mén dān hù bó",昧旦晨兴:"mèi dàn chén xīng",冒名接脚:"mào míng jiē jiǎo",毛遂堕井:"máo suí duò jǐng",毛发倒竖:"máo fā dǎo shù",卖文为生:"mài wén wéi shēng",卖李钻核:"mài lǐ zuān hé",买椟还珠:"mǎi dú huán zhū",埋三怨四:"mán sān yuàn sì",马入华山:"mǎ rù huá shān",落魄江湖:"luò pò jiāng hú",落落难合:"luò luò nán hé",落草为寇:"luò cǎo wéi kòu",罗织构陷:"luó zhī gòu xiàn",鸾凤和鸣:"luán fèng hè míng",率由旧章:"shuài yóu jiù zhāng",率土同庆:"shuài tǔ tóng qìng",率兽食人:"shuài shòu shí rén",率土归心:"shuài tǔ guī xīn",率马以骥:"shuài mǎ yǐ jì",率尔成章:"shuài ěr chéng zhāng",鲁斤燕削:"lǔ jīn yàn xuē",漏尽更阑:"lòu jìn gēng lán",笼鸟槛猿:"lóng niǎo jiàn yuán",笼鸟池鱼:"lóng niǎo chí yú",龙游曲沼:"lóng yóu qū zhǎo",龙血玄黄:"lóng xuè xuán huáng",龙雕凤咀:"lóng diāo fèng jǔ",六尺之讬:"liù chǐ zhī tuō",令原之戚:"líng yuán zhī qī",令人捧腹:"lìng rén pěng fù",陵劲淬砺:"líng jìng cuì lì",临敌易将:"lín dí yì jiàng",裂裳衣疮:"liè shang yī chuāng",裂冠毁冕:"liè guàn huǐ miǎn",了无惧色:"liǎo wú jù sè",了身达命:"liǎo shēn dá mìng",了然无闻:"liǎo rán wú wén",了不可见:"liǎo bù kě jiàn",了不长进:"liǎo bù zhǎng jìn",燎发摧枯:"liǎo fà cuī kū",审时度势:"shěn shí duó shì",量小力微:"liàng xiǎo lì wēi",相时度力:"xiāng shí duó lì",量枘制凿:"liàng ruì zhì záo",量如江海:"liàng rú jiāng hǎi",量金买赋:"liàng jīn mǎi fù",量己审分:"liàng jǐ shěn fēn",敛骨吹魂:"liǎn gǔ chuī hún",詈夷为跖:"lì yí wéi zhí",利令志惛:"lì lìng zhì hūn",李广不侯:"lǐ guǎng bú hòu",礼为情貌:"lǐ wéi qíng mào",礼让为国:"lǐ ràng wéi guó",犁生骍角:"lí shēng xīng jiǎo",离本徼末:"lí běn jiǎo mò",楞眉横眼:"léng méi hèng yǎn",擂天倒地:"léi tiān dǎo dì",累足成步:"lěi zú chéng bù",累瓦结绳:"lěi wǎ jié shéng",累土至山:"lěi tǔ zhì shān",累土聚沙:"lěi tǔ jù shā",累卵之危:"lěi luǎn zhī wēi",累累如珠:"lěi lěi rú zhū",累块积苏:"lěi kuài jī sū",乐山乐水:"lè shān lè shuǐ",潦原浸天:"lǎo yuán jìn tiān",老师宿儒:"lǎo shī xiǔ rú",牢什古子:"láo shí gǔ zi",琅嬛福地:"láng huán fú dì",揆情度理:"kuí qíng duó lǐ",旷日累时:"kuàng rì lěi shí",匡救弥缝:"kuāng jiù mí fèng",枯树生华:"kū shù shēng huā",口轻舌薄:"kǒu qīng shé bó",口角生风:"kǒu jiǎo shēng fēng",口角春风:"kǒu jiǎo chūn fēng",口角风情:"kǒu jiǎo fēng qíng",口干舌焦:"kǒu gān shé jiāo",口腹之累:"kǒu fù zhī lěi",空腹便便:"kōng fù pián pián",嗑牙料嘴:"kē yá liào zuǐ",刻木为鹄:"kè mù wéi hú",咳珠唾玉:"ké zhū tuò yù",咳唾成珠:"ké tuò chéng zhū",抗颜为师:"kàng yán wéi shī",开华结果:"kāi huā jié guǒ",峻阪盐车:"jùn bǎn yán chē",嚼铁咀金:"jiáo tiě jǔ jīn",嚼墨喷纸:"jué mò pēn zhǐ",倔头强脑:"juè tóu jiàng nǎo",倔头倔脑:"juè tóu juè nǎo",倦鸟知还:"juàn niǎo zhī huán",卷席而葬:"juǎn xí ér zàng",卷甲倍道:"juǎn jiǎ bèi dào",聚米为山:"jù mǐ wéi shān",举手相庆:"jǔ shǒu xiāng qìng",举世混浊:"jǔ shì hún zhuó",鞠为茂草:"jū wéi mào cǎo",拘神遣将:"jū shén qiǎn jiàng",居下讪上:"jū xià shàn shàng",久要不忘:"jiǔ yāo bú wàng",九转功成:"jiǔ zhuǎn gōng chéng",九蒸三熯:"jiǔ zhēng sān hàn",敬业乐群:"jìng yè lè qún",井底虾蟆:"jǐng dǐ xiā má",旌旗卷舒:"jīng qí juǎn shū",荆棘载途:"jīng jí zài tú",禁舍开塞:"jìn shě kāi sāi",祲威盛容:"jìn wēi shèng róng",进退消长:"jìn tuì xiāo cháng",进退应矩:"jìn tuì yīng jǔ",进退触籓:"jìn tuì chù fān",进退跋疐:"jìn tuì bá zhì",尽多尽少:"jǐn duō jǐn shǎo",锦囊还矢:"jǐn náng huán shǐ",矜己自饰:"jīn jǐ zì shì",矜功负气:"jīn gōng fù qì",津关险塞:"jīn guān xiǎn sài",金吾不禁:"jīn wú bú jìn",金翅擘海:"jīn chì bāi hǎi",解衣衣人:"jiě yī yī rén",解人难得:"jiě rén nán dé",解铃系铃:"jiě líng xì líng",解发佯狂:"jiě fà yáng kuáng",诘屈磝碻:"jié qū áo qiāo",教猱升木:"jiāo náo shēng mù",较瘦量肥:"jiào shòu liàng féi",角立杰出:"jiǎo lì jié chū",焦沙烂石:"jiāo shā làn shí",骄儿騃女:"jiāo ér sì nǚ",浇风薄俗:"jiāo fēng bó sú",降妖捉怪:"xiáng yāo zhuō guài",将取固予:"jiāng qǔ gù yǔ",将门有将:"jiàng mén yǒu jiàng",将夺固与:"jiāng duó gù yǔ",槛花笼鹤:"jiàn huā lóng hè",鉴影度形:"jiàn yǐng duó xíng",渐不可长:"jiàn bù kě zhǎng",见素抱朴:"xiàn sù bào pǔ",见弃于人:"jiàn qì yú rén",简丝数米:"jiǎn sī shǔ mǐ",俭不中礼:"jiǎn bú zhòng lǐ",间见层出:"jiàn xiàn céng chū",尖嘴薄舌:"jiān zuǐ bó shé",甲冠天下:"jiǎ guàn tiān xià",葭莩之亲:"jiā fú zhī qīn",家累千金:"jiā lèi qiān jīn",家给人足:"jiā jǐ rén zú",家道从容:"jiā dào cóng róng",夹袋人物:"jiā dài rén wù",霁风朗月:"jì fēng lǎng yuè",寄兴寓情:"jì xìng yù qíng",计深虑远:"jì shēn lǜ yuǎn",计功量罪:"jì gōng liàng zuì",掎裳连襼:"jǐ shang lián yì",虮虱相吊:"jǐ shī xiāng diào",疾不可为:"jí bù kě wéi",极深研几:"jí shēn yán jī",及宾有鱼:"jí bīn yǒu yú",激薄停浇:"jī bó tíng jiāo",积素累旧:"jī sù lěi jiù",积时累日:"jī shí lěi rì",积露为波:"jī lù wéi bō",积德累功:"jī dé lěi gōng",积谗糜骨:"jī chán méi gǔ",击排冒没:"jī pái mào mò",祸为福先:"huò wéi fú xiān",祸福相依:"huò fú xiāng yī",获隽公车:"huò jùn gōng chē",混应滥应:"hùn yīng làn yīng",毁舟为杕:"huǐ zhōu wéi duò",毁钟为铎:"huǐ zhōng wéi duó",毁冠裂裳:"huǐ guān liè cháng",晦盲否塞:"huì máng pǐ sè",回船转舵:"huí chuán zhuàn duò",潢池盗弄:"huáng chí dào nòng",黄冠草履:"huáng guàn cǎo lǚ",黄发儿齿:"huáng fà ér chǐ",黄发垂髫:"huáng fà chuí tiáo",还珠返璧:"huán zhū fǎn bì",还年驻色:"huán nián zhù sè",还年却老:"huán nián què lǎo",坏裳为裤:"huài shang wéi kù",画荻和丸:"huà dí huò wán",化枭为鸠:"huà xiāo wéi jiū",化腐为奇:"huà fǔ wéi qí",化鸱为凤:"huà chī wéi fèng",花不棱登:"huā bu lēng dēng",户限为穿:"hù xiàn wéi chuān",呼卢喝雉:"hū lú hè zhì",呼来喝去:"hū lái hè qù",呼不给吸:"hū bù jǐ xī",厚味腊毒:"hòu wèi xī dú",厚德载物:"hòu dé zài wù",鸿渐于干:"hóng jiàn yú gàn",洪炉燎发:"hóng lú liáo fà",红绳系足:"hóng shéng jì zú",红不棱登:"hóng bu lēng dēng",横抢硬夺:"hèng qiǎng yìng duó",横恩滥赏:"hèng ēn làn shǎng",恨海难填:"hèn hǎi nán tián",鹤发鸡皮:"hè fà jī pí",涸思干虑:"hé sī gān lǜ",河涸海干:"hé hé hǎi gān",和颜说色:"hé yán yuè sè",合从连衡:"hé zòng lián héng",浩浩汤汤:"hào hào shāng shāng",好勇斗狠:"hào yǒng dòu hěn",好问则裕:"hào wèn zé yù",好为事端:"hào wéi shì duān",好问决疑:"hào wèn jué yí",好生之德:"hào shēng zhī dé",好奇尚异:"hǎo qí shàng yì",好恶不同:"hǎo è bù tóng",好丹非素:"hào dān fēi sù",豪干暴取:"háo gàn bào qǔ",毫发不爽:"háo fà bù shuǎng",寒酸落魄:"hán suān luò pò",含英咀华:"hán yīng jǔ huá",含糊不明:"hán hú bù míng",过为已甚:"guò wéi yǐ shèn",桂折兰摧:"guì shé lán cuī",规旋矩折:"guī xuán jǔ shé",广文先生:"guǎng wén xiān sheng",广陵散绝:"guǎng líng sǎn jué",冠山戴粒:"guàn shān dài lì",冠屦倒施:"guàn jù dǎo shī",挂席为门:"guà xí wéi mén",寡见鲜闻:"guǎ jiàn xiǎn wén",瓜葛相连:"guā gé xiāng lián",鼓吻奋爪:"gǔ wěn fèn zhǎo",古调单弹:"gǔ diào dān tán",古调不弹:"gǔ diào bù tán",姑射神人:"gū yè shén rén",苟合取容:"gǒu hé qǔ róng",狗续侯冠:"gǒu xù hòu guàn",钩爪锯牙:"gōu zhǎo jù yá",共枝别干:"gòng zhī bié gàn",共为唇齿:"gòng wéi chún chǐ",拱手而降:"gǒng shǒu ér xiáng",拱肩缩背:"gǒng jiān suō bèi",功薄蝉翼:"gōng bó chán yì",弓调马服:"gōng diào mǎ fú",更姓改物:"gēng xìng gǎi wù",更仆难数:"gēng pú nán shǔ",更令明号:"gēng lìng míng hào",更待干罢:"gèng dài gàn bà",更唱迭和:"gēng chàng dié hé",更长梦短:"gēng cháng mèng duǎn",各色名样:"gè sè míng yàng",格格不纳:"gé gé bú nà",格格不吐:"gé gé bù tǔ",告朔饩羊:"gù shuò xì yáng",膏车秣马:"gào chē mò mǎ",高义薄云:"gāo yì bó yún",岗头泽底:"gāng tóu zé dǐ",敢为敢做:"gǎn wéi gǎn zuò",甘分随时:"gān fèn suí shí",甘处下流:"gān chǔ xià liú",干啼湿哭:"gàn tí shī kū",干名犯义:"gàn míng fàn yì",干将莫邪:"gān jiāng mò yé",干城之将:"gān chéng zhī jiàng",腹载五车:"fù zài wǔ chē",父债子还:"fù zhài zǐ huán",父为子隐:"fù wéi zǐ yǐn",辅世长民:"fǔ shì zhǎng mín",福为祸始:"fú wéi huò shǐ",符号逻辑:"fú hào luó jí",浮收勒折:"fú shōu lè shé",肤受之愬:"fū shòu zhī sù",否终则泰:"pǐ zhōng zé tài",佛头著粪:"fó tóu zhuó fèn",奉为楷模:"fèng wéi kǎi mó",凤靡鸾吪:"fèng mǐ luán é",封豨修蛇:"fēng xī xiū shé",风影敷衍:"fēng yǐng fū yǎn",丰屋蔀家:"fēng wū bù jiā",粪土不如:"fèn tǔ bù rú",分风劈流:"fēn fēng pǐ liú",沸沸汤汤:"fèi fèi shāng shāng",菲食薄衣:"fěi shí bó yī",飞将数奇:"fēi jiàng shù qí",放辟邪侈:"fàng pì xié chǐ",方领圆冠:"fāng lǐng yuán guàn",犯而不校:"fàn ér bú jiào",返本还源:"fǎn běn huán yuán",反劳为逸:"fǎn láo wéi yì",法轮常转:"fǎ lún cháng zhuàn",罚不当罪:"fá bù dāng zuì",发引千钧:"fà yǐn qiān jūn",发奸擿伏:"fā jiān tī fú",发短心长:"fà duǎn xīn cháng",二竖为虐:"èr shù wéi nüè",儿女心肠:"ér nǚ xīn cháng",儿女亲家:"ér nǚ qìng jiā",遏恶扬善:"è wù yáng shàn",饿殍枕藉:"è piǎo zhěn jí",饿殍载道:"è piǎo zài dào",恶醉强酒:"wù zuì qiǎng jiǔ",恶意中伤:"è yì zhòng shāng",恶湿居下:"wù shī jū xià",恶居下流:"wù jū xià liú",恶不去善:"wù bú qù shàn",扼吭夺食:"è háng duó shí",扼襟控咽:"è jīn kòng yān",峨峨汤汤:"é é shāng shāng",屙金溺银:"ē jīn niào yín",朵颐大嚼:"duǒ yí dà jiáo",夺人所好:"duó rén suǒ hào",多言数穷:"duō yán shuò qióng",多文为富:"duō wén wéi fù",多端寡要:"duō duān guǎ yào",多财善贾:"duō cái shàn gǔ",遁世无闷:"dùn shì wú mèn",遁迹黄冠:"dùn jì huáng guàn",堆案盈几:"duī àn yíng jī",断还归宗:"duàn huán guī zōng",短见薄识:"duǎn jiàn bó shí",蠹居棊处:"dù jū qí chǔ",度己以绳:"duó jǐ yǐ shéng",杜默为诗:"dù mò wéi shī",杜鹃啼血:"dù juān tí xuè",笃近举远:"dǔ jìn jǔ yuǎn",独有千秋:"dú yǒu qiān qiū",读书得间:"dú shū dé jiàn",斗转参横:"dǒu zhuǎn shēn héng",兜肚连肠:"dōu dǔ lián cháng",洞见症结:"dòng jiàn zhèng jié",恫疑虚喝:"dòng yí xū hè",动中窾要:"dòng zhōng kuǎn yào",东鸣西应:"dōng míng xī yīng",东鳞西爪:"dōng lín xī zhǎo",东量西折:"dōng liàng xī shé",东家西舍:"dōng jiā xī shè",东扯西拽:"dōng chě xī zhuāi",鼎铛有耳:"dǐng chēng yǒu ěr",鼎铛玉石:"dǐng chēng yù shí",钉头磷磷:"dīng tóu lín lín",跌宕不羁:"diē dàng bù jī",跌弹斑鸠:"diē dàn bān jiū",雕心雁爪:"diāo xīn yàn zhǎo",颠倒衣裳:"diān dǎo yī cháng",德薄能鲜:"dé bó néng xiǎn",得马折足:"dé mǎ shé zú",蹈其覆辙:"dǎo qí fù zhé",捣虚撇抗:"dǎo xū piē kàng",倒载干戈:"dào zài gān gē",倒裳索领:"dào cháng suǒ lǐng",倒果为因:"dào guǒ wéi yīn",叨在知己:"tāo zài zhī jǐ",叨陪末座:"tāo péi mò zuò",党豺为虐:"dǎng chái wéi nüè",当轴处中:"dāng zhóu chǔ zhōng",当着不着:"dāng zhuó bù zhuó",当务始终:"dāng wù shǐ zhōng",淡汝浓抹:"dàn rǔ nóng mǒ",弹丸脱手:"tán wán tuō shǒu",弹铗无鱼:"dàn jiá wú yú",箪食瓢饮:"dān sì piáo yǐn",大璞不完:"dà pú bù wán",大明法度:"dà míng fǎ dù",大车以载:"dà chē yǐ zài",打闷葫芦:"dǎ mèn hú lu",沓来踵至:"tà lái zhǒng zhì",厝火燎原:"cuò huǒ liǎo yuán",撮科打哄:"cuō kē dǎ hòng",寸积铢累:"cùn jī zhū lěi",啛啛喳喳:"cuì cuì chā chā",摧折豪强:"cuī zhé háo qiáng",摧刚为柔:"cuī gāng wéi róu",从俗就简:"cóng sú jiù jiǎn",此发彼应:"cǐ fā bǐ yīng",此唱彼和:"cǐ chàng bǐ hè",慈悲为本:"cí bēi wéi běn",纯属骗局:"chún shǔ piàn jú",春笋怒发:"chūn sǔn nù fā",垂头搨翼:"chuí tóu tà yì",传为笑谈:"chuán wéi xiào tán",传风扇火:"chuán fēng shān huǒ",穿红着绿:"chuān hóng zhuó lǜ",触处机来:"chù chǔ jī lái",处尊居显:"chǔ zūn jū xiǎn",处堂燕雀:"chǔ táng yàn què",处实效功:"chǔ shí xiào gōng",处高临深:"chǔ gāo lín shēn",出入无间:"chū rù wú jiān",出门应辙:"chū mén yīng zhé",出处语默:"chū chǔ yǔ mò",出处殊途:"chū chǔ shū tú",出处进退:"chū chǔ jìn tuì",愁山闷海:"chóu shān mèn hǎi",冲冠眦裂:"chōng guàn zì liè",齿牙为祸:"chǐ yá wéi huò",尺二冤家:"chǐ èr yuān jia",尺短寸长:"chǐ duǎn cùn cháng",尺寸之功:"chǐ cùn zhī gōng",城北徐公:"chéng běi xú gōng",成败兴废:"chéng bài xīng fèi",趁水和泥:"chèn shuǐ huò ní",称雨道晴:"chēng yǔ dào qíng",称体载衣:"chēng tǐ zài yī",称体裁衣:"chèn tǐ cái yī",称家有无:"chèn jiā yǒu wú",称德度功:"chēng dé duó gōng",沉吟章句:"chén yín zhāng jù",沉吟不决:"chén yín bù jué",沉疴宿疾:"chén kē sù jí",扯纤拉烟:"chě qiàn lā yān",扯顺风旗:"chě shùn fēng qí",车载船装:"chē zǎi chuán zhuāng",朝升暮合:"zhāo shēng mù gě",朝攀暮折:"zhāo pān mù shé",超今冠古:"chāo jīn guàn gǔ",倡而不和:"chàng ér bú hè",畅所欲为:"chàng suǒ yù wéi",苌弘碧血:"cháng hóng bì xiě",长幼尊卑:"zhǎng yòu zūn bēi",长绳系日:"cháng shéng jì rì",长年三老:"zhǎng nián sān lǎo",长春不老:"cháng chūn bù lǎo",长傲饰非:"zhǎng ào shì fēi",昌亭旅食:"chāng tíng lǚ shí",禅絮沾泥:"chán xù zhān ní",差三错四:"chā sān cuò sì",层台累榭:"céng tái lěi xiè",层见迭出:"céng xiàn dié chū",藏踪蹑迹:"cáng zōng niè jì",苍蝇见血:"cāng yíng jiàn xiě",餐松啖柏:"cān sōng dàn bó",骖风驷霞:"cān fēng sì xiá",参伍错综:"cēn wǔ cuò zōng",参辰卯酉:"shēn chén mǎo yǒu",材优干济:"cái yōu gān jǐ",材薄质衰:"cái bó zhì shuāi",才大难用:"cái dà nán yòng",才薄智浅:"cái bó zhì qiǎn",不足为意:"bù zú wéi yì",不足为据:"bù zú wéi jù",不足为法:"bù zú wéi fǎ",不足齿数:"bù zú chǐ shǔ",不着疼热:"bù zhuó téng rè",不知薡蕫:"bù zhī dǐng dǒng",不越雷池:"bú yuè léi chí",不相为谋:"bù xiāng wéi móu",不贪为宝:"bù tān wéi bǎo",不了而了:"bù liǎo ér liǎo",不可揆度:"bù kě kuí duó",不遑启处:"bù huáng qǐ chǔ",不当不正:"bù dāng bú zhèng",不差什么:"bú chà shén me",不差累黍:"bù chā lěi shǔ",擘两分星:"bò liǎng fēn xīng",簸土扬沙:"bǒ tǔ yáng shā",薄物细故:"bó wù xì gù",薄寒中人:"bó hán zhòng rén",博文约礼:"bó wén yuē lǐ",播糠眯目:"bō kāng mí mù",剥皮抽筋:"bō pí chōu jīn",剥肤椎髓:"bō fū chuí suǐ",波属云委:"bō zhǔ yún wěi",波骇云属:"bō hài yún zhǔ",兵微将寡:"bīng wēi jiàng guǎ",兵强将勇:"bīng qiáng jiàng yǒng",兵多将广:"bīng duō jiàng guǎng",兵不由将:"bīng bù yóu jiàng",冰解的破:"bīng jiě dì pò",彬彬济济:"bīn bīn jǐ jǐ",摽梅之年:"biào méi zhī nián",表里为奸:"biǎo lǐ wéi jiān",飙发电举:"biāo fā diàn jǔ",变贪厉薄:"biàn tān lì bó",敝盖不弃:"bì gài bú qì",秕言谬说:"bǐ yán miù shuō",比物属事:"bǐ wù zhǔ shì",被山带河:"pī shān dài hé",被甲枕戈:"pī jiǎ zhěn gē",被甲据鞍:"pī jiǎ jù ān",被褐怀玉:"pī hè huái yù",被发缨冠:"pī fà yīng guàn",背曲腰躬:"bèi qǔ yāo gōng",北窗高卧:"běi chuāng gāo wò",北辰星拱:"běi chén xīng gǒng",北鄙之音:"běi bǐ zhī yīn",卑宫菲食:"bēi gōng fěi shí",暴衣露冠:"pù yī lù guàn",暴腮龙门:"pù sāi lóng mén",暴露文学:"bào lù wén xué",暴虎冯河:"bào hǔ píng hé",抱蔓摘瓜:"bào wàn zhāi guā",抱法处势:"bào fǎ chǔ shì",褒贬与夺:"bāo biǎn yǔ duó",帮闲钻懒:"bāng xián zuān lǎn",拜将封侯:"bài jiàng fēng hóu",百兽率舞:"bǎi shòu shuài wǔ",百孔千创:"bǎi kǒng qiān chuāng",白衣卿相:"bái yī qīng xiàng",白首为郎:"bái shǒu wéi láng",白首相知:"bái shǒu xiāng zhī",把玩无厌:"bǎ wán wú yàn",拔锅卷席:"bá guō juǎn xí",拔本塞源:"bá běn sè yuán",傲不可长:"ào bù kě zhǎng",熬更守夜:"áo gēng shǒu yè",安时处顺:"ān shí chǔ shùn",安身为乐:"ān shēn wéi lè",安老怀少:"ān lǎo huái shào",安步当车:"ān bù dàng chē",爱人好士:"ài rén hào shì",矮人观场:"ǎi rén guān chǎng",捱风缉缝:"ái fēng jī fèng",挨山塞海:"āi shān sè hǎi",阿家阿翁:"ā jiā ā wēng",阿党相为:"ē dǎng xiāng wéi",追亡逐北:"zhuī wáng zhú běi",竹篮打水:"zhú lán dá shuǐ",知疼着热:"zhī téng zháo rè",语不惊人:"yǔ bù jīng rén",于今为烈:"yú jīn wéi liè",一日三省:"yí rì sān xǐng",穴居野处:"xué jū yě chǔ",五脊六兽:"wǔ jǐ liù shòu",无声无臭:"wú shēng wú xiù",谓予不信:"wèi yú bú xìn",舍身为国:"shě shēn wéi guó",杀妻求将:"shā qī qiú jiàng",强作解人:"qiǎng zuò jiě rén",气冲斗牛:"qì chōng dǒu niú",临深履薄:"lín shēn lǚ bó",钧天广乐:"jūn tiān guǎng yuè",艰难竭蹶:"jiān nán jié jué",夹七夹八:"jiā qī jiā bā",混混噩噩:"hún hún è è",厚古薄今:"hòu gǔ bó jīn",鬼怕恶人:"guǐ pà è rén",伽马射线:"gā mǎ shè xiàn",佛头着粪:"fó tóu zhuó fèn",奉为至宝:"fèng wéi zhì bǎo",登坛拜将:"dēng tán bài jiàng",晨昏定省:"chén hūn dìng xǐng",察察为明:"chá chá wéi míng",博闻强识:"bó wén qiáng zhì",避难就易:"bì nán jiù yì",了无生机:"liǎo wú shēng jī",有一说一:"yǒu yī shuō yī",独一无二:"dú yī wú èr",说一不二:"shuō yī bù èr",举一反三:"jǔ yī fǎn sān",数一数二:"shǔ yī shǔ èr",杀一儆百:"shā yī jǐng bǎi",丁一卯二:"dīng yī mǎo èr",丁一确二:"dīng yī què èr",不一而止:"bù yī ér zhǐ",无一幸免:"wú yī xìng miǎn",表里不一:"biǎo lǐ bù yī",良莠不一:"liáng yǒu bù yī",心口不一:"xīn kǒu bù yī",言行不一:"yán xíng bù yī",政令不一:"zhèng lìng bù yī",参差不一:"cēn cī bù yī",纷纷不一:"fēn fēn bù yī",毁誉不一:"huǐ yù bù yī",不一而三:"bù yī ér sān",百不一遇:"bǎi bù yī yù",言行抱一:"yán xíng bào yī",瑜百瑕一:"yú bǎi xiá yī",背城借一:"bèi chéng jiè yī",凭城借一:"píng chéng jiè yī",劝百讽一:"quàn bǎi fěng yī",群居和一:"qún jū hé yī",百不获一:"bǎi bù huò yī",百不失一:"bǎi bù shī yī",百无失一:"bǎi wú shī yī",万不失一:"wàn bù shī yī",万无失一:"wàn wú shī yī",合而为一:"hé ér wéi yī",合两为一:"hé liǎng wéi yī",合二为一:"hé èr wéi yī",天下为一:"tiān xià wéi yī",相与为一:"xiāng yǔ wéi yī",较若画一:"jiào ruò huà yī",较如画一:"jiào rú huà yī",斠若画一:"jiào ruò huà yī",言行若一:"yán xíng ruò yī",始终若一:"shǐ zhōng ruò yī",终始若一:"zhōng shǐ ruò yī",惟精惟一:"wéi jīng wéi yī",众多非一:"zhòng duō fēi yī",不能赞一:"bù néng zàn yī",问一答十:"wèn yī dá shí",一不扭众:"yī bù niǔ zhòng",一以贯之:"yī yǐ guàn zhī",一以当百:"yī yǐ dāng bǎi",百不当一:"bǎi bù dāng yī",十不当一:"shí bù dāng yī",以一警百:"yǐ yī jǐng bǎi",以一奉百:"yǐ yī fèng bǎi",以一持万:"yǐ yī chí wàn",以一知万:"yǐ yī zhī wàn",百里挑一:"bǎi lǐ tiāo yī",整齐划一:"zhěng qí huà yī",一来二去:"yī lái èr qù",一路公交:"yī lù gōng jiāo",一路汽车:"yī lù qì chē",一路巴士:"yī lù bā shì",朝朝朝落:"zhāo cháo zhāo luò",曲意逢迎:"qū yì féng yíng",一行不行:"yì háng bù xíng",行行不行:"háng háng bù xíng"},ule=Object.keys(FI).map(e=>({zh:e,pinyin:FI[e],probability:2e-8,length:4,priority:Vl.Normal,dict:Symbol("dict4")})),BI={巴尔干半岛:"bā ěr gàn bàn dǎo",巴尔喀什湖:"bā ěr kā shí hú",不幸而言中:"bú xìng ér yán zhòng",布尔什维克:"bù ěr shí wéi kè",何乐而不为:"hé lè ér bù wéi",苛政猛于虎:"kē zhèng měng yú hǔ",蒙得维的亚:"méng dé wéi dì yà",民以食为天:"mín yǐ shí wéi tiān",事后诸葛亮:"shì hòu zhū gě liàng",物以稀为贵:"wù yǐ xī wéi guì",先下手为强:"xiān xià shǒu wéi qiáng",行行出状元:"háng háng chū zhuàng yuan",亚得里亚海:"yà dé lǐ yà hǎi",眼不见为净:"yǎn bú jiàn wéi jìng",竹筒倒豆子:"zhú tǒng dào dòu zi"},cle=Object.keys(BI).map(e=>({zh:e,pinyin:BI[e],probability:2e-8,length:5,priority:Vl.Normal,dict:Symbol("dict5")}));function RI(e,t){return e&&(e.decimalt.probability)?e:t}function OI(e){e.probability<1e-300&&(e.probability*=1e300,e.decimal+=1)}function dle(e){return e.priority===Vl.Custom?-(e.length*e.length*100):e.priority===Vl.Surname?-(e.length*e.length*10):0}function fle(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{probability:1,decimal:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={probability:o.probability*r.probability,decimal:r.decimal+dle(o),patterns:r.patterns,concatPattern:o};OI(u),n[a]=RI(n[a],u),o=e[--i]}const l={probability:1e-13*r.probability,decimal:0,patterns:r.patterns};OI(l),n[s]=RI(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function $I(e,t){return e&&e.count<=t.count?e:t}function hle(e){return e.priority===Vl.Custom?-(e.length*e.length*1e5):e.priority===Vl.Surname?-(e.length*e.length*100):1}function ple(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{count:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={count:hle(o)+r.count,patterns:r.patterns,concatPattern:o};n[a]=$I(n[a],u),o=e[--i]}const l={count:1+r.count,patterns:r.patterns};n[s]=$I(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function mle(e,t){return!(t.index+t.length<=e.index||t.priority>e.priority||t.priority===e.priority&&t.length>e.length)}function gle(e){const t=[];for(let n=e.length-1;n>=0;){const{index:i}=e[n];let o=n-1;for(;o>=0&&mle(e[n],e[o]);)o--;(o<0||e[o].index+e[o].length<=i)&&t.push(e[n]),n=o}return t.reverse()}var PI;(function(e){e[e.ReverseMaxMatch=1]="ReverseMaxMatch",e[e.MaxProbability=2]="MaxProbability",e[e.MinTokenization=3]="MinTokenization"})(PI||(PI={}));class zI{constructor(t,n="",i=""){this.children=new Map,this.fail=null,this.patterns=[],this.parent=t,this.prefix=n,this.key=i}}class vle{constructor(){this.dictMap=new Map,this.queues=[],this.root=new zI(null)}build(t){this.buildTrie(t),this.buildFailPointer()}buildTrie(t){for(let n of t){const i=Hw(n.zh);let o=this.root;for(let s=0;s{t=t.concat(i)}),this.queues=[];t.length>n;){let i=t[n++],o=i.parent&&i.parent.fail,s=i.key;for(;o&&!o.children.has(s);)o=o.fail;o?i.fail=o.children.get(s):i.fail=this.root}}addPatternToDictMap(t){this.dictMap.has(t.dict)||this.dictMap.set(t.dict,new Set),this.dictMap.get(t.dict).add(t)}addNodeToQueues(t){this.queues[$a(t.prefix)]||(this.queues[$a(t.prefix)]=[]),this.queues[$a(t.prefix)].push(t)}insertPattern(t,n){for(let i=t.length-1;i>=0;i--){const o=t[i];if(n.priority===o.priority&&n.probability>=o.probability)t[i+1]=o;else if(n.priority>o.priority)t[i+1]=o;else{t[i+1]=n;return}}t[0]=n}removeDict(t){this.dictMap.has(t)&&(this.dictMap.get(t).forEach(i=>{i.node.patterns=i.node.patterns.filter(o=>o!==i)}),this.dictMap.delete(t))}match(t,n){let i=this.root,o=[];const s=Hw(t);for(let r=0;rn==="off"?c.priority!==Vl.Surname:n==="head"?c.length-1-r===0:!0);a&&o.push(Object.assign(Object.assign({},a),{index:r-a.length+1}));let u=i.fail;for(;u!==null;){const c=u.patterns.find(d=>n==="off"?d.priority!==Vl.Surname:n==="head"?d.length-1-r===0:!0);c&&o.push(Object.assign(Object.assign({},c),{index:r-c.length+1})),u=u.fail}}}return o}search(t,n,i=2){const o=this.match(t,n);return i===1?gle(o):i===3?ple(o,$a(t)):fle(o,$a(t))}}const yle=[...cle,...ule,...ale,...lle,...ile,...rle],AP=new vle;AP.build(yle);const kle=new wP,ble=()=>kle,wle=[];function Cle(){return wle}const og=e=>{const t=Rd.get(e);return t?t.split(" ")[0]:e},Ale=e=>{const t=[],n=Cle();for(let i=0;i{const s=o?Ale(e):e,r=AP.search(s,n,i);let l=0;const a=Hw(e);for(let u=0;ue.replace(/(ā|á|ǎ|à)/g,"a").replace(/(ō|ó|ǒ|ò)/g,"o").replace(/(ē|é|ě|è)/g,"e").replace(/(ī|í|ǐ|ì)/g,"i").replace(/(ū|ú|ǔ|ù)/g,"u").replace(/(ǖ|ǘ|ǚ|ǜ)/g,"ü").replace(/(n̄|ń|ň|ǹ)/g,"n").replace(/(m̄|ḿ|m̌|m̀)/g,"m").replace(/(ê̄|ế|ê̌|ề)/g,"ê"),xP=(e,t="off")=>{const n=ble();let i=Rd.get(e)?Rd.get(e).split(" "):[];if(n.get(e))i=n.get(e).split(" ");else if(t!=="off"){const o=Ww[e];o&&(i=[o].concat(i.filter(s=>s!==o)))}return i},Sle=(e,t="off")=>{let n=xP(e,t);return n.length>0?n.map(i=>({origin:e,result:i,isZh:!0,originPinyin:i})):[{origin:e,result:e,isZh:!1,originPinyin:e}]},R9=(e,t)=>{const n=e.split(" "),i=[],o=[];for(let s of n)for(let r of Yre)if(s.startsWith(r)){let l=s.slice(r.length);Jre.indexOf(r)!==-1&&Xre.indexOf(l)!==-1&&(l=ele[l]),i.push(r),o.push(l);break}return t==="standard"&&i.forEach((s,r)=>{(s==="y"||s==="w")&&(i[r]="")}),{final:o.join(" "),initial:i.join(" ")}},Iy=e=>{const{final:t}=R9(e);let n="",i="",o="";return tle.indexOf(Ak(t))!==-1?(n=t[0],i=t[1],o=t.slice(2)):(i=t[0]||"",o=t.slice(1)||""),{head:n,body:i,tail:o}},xk=e=>{const t=/(ā|ō|ē|ī|ū|ǖ|n̄|m̄|ê̄)/,n=/(á|ó|é|í|ú|ǘ|ń|ḿ|ế)/,i=/(ǎ|ǒ|ě|ǐ|ǔ|ǚ|ň|m̌|ê̌)/,o=/(à|ò|è|ì|ù|ǜ|ǹ|m̀|ề)/,s=/(a|o|e|i|u|ü|ê)/,r=/(n|m)$/,l=[];return e.split(" ").forEach(u=>{t.test(u)?l.push("1"):n.test(u)?l.push("2"):i.test(u)?l.push("3"):o.test(u)?l.push("4"):s.test(u)||r.test(u)?l.push("0"):l.push("")}),l.join(" ")},_le=(e,t)=>{const n=Ak(e).split(" "),i=xk(t).split(" "),o=[];return n.forEach((s,r)=>{o.push(`${s}${i[r]}`)}),o.join(" ")},SP=(e,t)=>{const n=[];return e.split(" ").forEach(o=>{n.push(t?o[0]:o)}),n.join(" ")};function Mle(e,t,n){if(sle.indexOf(e)===-1)return og(e);if(t===n&&t&&og(t)!==t)return Ak(og(e));if(n&&!ole[e].includes(n)){const i=og(n);if(i!==n){const o=xk(i),s=CP[e];for(let r in s)if(s[r].indexOf(Number(o))!==-1)return r}}}function Ile(e,t){if(e==="了"&&(!t||!Rd.get(t)))return"liǎo"}function Tle(e,t){if(e==="々")return!t||!Rd.get(t)?"tóng":Rd.get(t).split(" ")[0]}function jI(e,t,n){return Tle(e,t)||Ile(e,t)||Mle(e,t,n)||og(e)}const Ele=e=>typeof e!="string"?(console.error("The first param of pinyin is error: "+e+' is not assignable to type "string".'),!1):!0;function E3(e,t){return t instanceof RegExp?t.test(e):!0}const Lle=(e,t)=>{let n=t.nonZh;if(n==="removed")return e.filter(i=>i.isZh||!E3(i.origin,t.nonZhScope));if(n==="consecutive"){for(let i=e.length-2;i>=0;i--){const o=e[i],s=e[i+1];!o.isZh&&!s.isZh&&E3(o.origin,t.nonZhScope)&&E3(s.origin,t.nonZhScope)&&(o.origin+=s.origin,o.result+=s.result,s.delete=!0)}return e.filter(i=>!i.delete)}else return e},HI=(e,t)=>$a(e)===1&&t.multiple?Sle(e,t.surname):!1,Nle=(e,t)=>{switch(t.pattern){case"pinyin":break;case"num":e.forEach(n=>{n.result=n.isZh?xk(n.result):""});break;case"initial":e.forEach(n=>{n.result=n.isZh?R9(n.result,t.initialPattern).initial:""});break;case"final":e.forEach(n=>{n.result=n.isZh?R9(n.result,t.initialPattern).final:""});break;case"first":e.forEach(n=>{n.result=SP(n.result,n.isZh)});break;case"finalHead":e.forEach(n=>{n.result=n.isZh?Iy(n.result).head:""});break;case"finalBody":e.forEach(n=>{n.result=n.isZh?Iy(n.result).body:""});break;case"finalTail":e.forEach(n=>{n.result=n.isZh?Iy(n.result).tail:""});break}},Dle=(e,t)=>{switch(t.toneType){case"symbol":break;case"none":e.forEach(n=>{n.isZh&&(n.result=Ak(n.result))});break;case"num":{e.forEach(n=>{n.isZh&&(n.result=_le(n.result,n.originPinyin))});break}}},Fle=(e,t)=>{t.v&&e.forEach(n=>{n.isZh&&(n.result=n.result.replace(/ü/g,typeof t.v=="string"?t.v:"v"))})},Ble=(e,t,n)=>{if(t.multiple&&$a(n)===1){let i="";e=e.filter(o=>{const s=o.result!==i;return i=o.result,s})}return t.type==="array"?e.map(i=>i.result):t.type==="all"?e.map(i=>{const o=i.isZh?i.result:"",{initial:s,final:r}=R9(o,t.initialPattern),{head:l,body:a,tail:u}=Iy(o);let c=[];return o!==""&&(c=[o].concat(xP(i.origin,t.surname).filter(d=>d!==o))),{origin:i.origin,pinyin:o,initial:s,final:r,first:SP(i.result,i.isZh),finalHead:l,finalBody:a,finalTail:u,num:Number(xk(i.originPinyin)),isZh:i.isZh,polyphonic:c,inZhRange:!!Rd.get(i.origin),result:i.result}}):e.map(i=>i.result).join(t.separator)},Rle=(e,t)=>(t===!1&&e.forEach(n=>{n.origin==="一"?n.result=n.originPinyin="yī":n.origin==="不"&&(n.result=n.originPinyin="bù")}),e),Ole={pattern:"pinyin",toneType:"symbol",type:"string",multiple:!1,mode:"normal",removeNonZh:!1,nonZh:"spaced",v:!1,separator:" ",toneSandhi:!0,segmentit:2};function O9(e,t){if(t=Object.assign(Object.assign({},Ole),t||{}),!Ele(e))return e;if(e==="")return t.type==="array"||t.type==="all"?[]:"";t.surname===void 0&&(t.mode==="surname"?t.surname="all":t.surname="off"),t.type==="all"&&(t.pattern="pinyin"),t.pattern==="num"&&(t.toneType="none"),t.removeNonZh&&(t.nonZh="removed");let i=Array($a(e)),{list:o}=xle(e,i,t.surname,t.segmentit,t.traditional);return o=Rle(o,t.toneSandhi),o=Lle(o,t),HI(e,t)&&(o=HI(e,t)),Nle(o,t),Dle(o,t),Fle(o,t),Ble(o,t,e)}var qw;(function(e){e[e.AllSegment=1]="AllSegment",e[e.AllArray=2]="AllArray",e[e.AllString=3]="AllString",e[e.PinyinSegment=4]="PinyinSegment",e[e.PinyinArray=5]="PinyinArray",e[e.PinyinString=6]="PinyinString",e[e.ZhSegment=7]="ZhSegment",e[e.ZhArray=8]="ZhArray",e[e.ZhString=9]="ZhString"})(qw||(qw={}));qw.AllSegment;const _P=[{name:"/new",desc:"commands.new.desc",noArgs:!0},{name:"/clear",desc:"commands.clear.desc",noArgs:!0},{name:"/login",desc:"commands.login.desc",noArgs:!0},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc"},{name:"/goal",desc:"commands.goal.desc"},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc",noArgs:!0},{name:"/fork",desc:"commands.fork.desc",noArgs:!0},{name:"/export",desc:"commands.export.desc",noArgs:!0},{name:"/status",desc:"commands.status.desc",noArgs:!0}];function WI(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const vc="skill:";function $le(e,t){const n=e.find(r=>r.name===t);if(n!==void 0)return n;const i=`/${vc}${t.slice(1)}`,o=e.find(r=>r.name===i);if(o!==void 0)return o;if(!t.startsWith(`/${vc}`))return;const s=t.slice(1+vc.length);if(!(s.length===0||s.includes(" ")))return e.find(r=>r.isSkill===!0&&F6(r.name)===s)}function F6(e){const t=e.startsWith("/")?e.slice(1):e;return t.startsWith(vc)?t.slice(vc.length):t}function Ple(e,t,n){for(const i of[`/${vc}${t}`,`/${t}`]){if(e===i)return;if(e.startsWith(`${i} `))return e.slice(i.length+1).trim()||void 0}return(n??"").trim()||void 0}function MP(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${vc}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[..._P,...t]}const qI=new Map;function IP(e){let t=qI.get(e);if(!t){const n=O9(e,{toneType:"none",type:"array"}),i=O9(e,{pattern:"first",toneType:"none",type:"array"});t=zle(e,n,i),qI.set(e,t)}return t}const UI={full:[],first:[],offsets:[],literal:[]};function zle(e,t,n){if(t.length!==n.length)return UI;const i=[],o=[];let s=0;for(let r=0;r0&&e.slice(s,s+l.length).toLowerCase()===l.toLowerCase()?(o.push(!0),s+=l.length):(o.push(!1),s+=Array.from(e.slice(s))[0]?.length??0)}return i.push(s),s!==e.length?UI:{full:t,first:n,offsets:i,literal:o}}function Uw(e,t,n,i){const o=e[t];let s=0,r=-1,l=-1,a=0,u=0;for(let f=0;f=0)return Uw(i,"first",o,o+t.length);const s=i.full.join("").indexOf(t);if(!(s<0))return Uw(i,"full",s,s+t.length)}function Ule(e,t,n){const i=e.trim().replace(/^\//,"").toLowerCase();if(i==="")return{};const o=Wle(t,i),s=qle(n,i);return{name:o?[o]:void 0,desc:s?[s]:void 0}}const Vle={keys:[{name:"name",weight:3},{name:"desc",weight:1},{name:"pinyinFull",weight:1},{name:"pinyinFirst",weight:1}],includeScore:!0,includeMatches:!0,ignoreLocation:!0,threshold:.4};function Kle(e,t){const n=e.toLowerCase(),i=t.toLowerCase();return n===i?0:n.startsWith(i)?1:2}function KI(e){const t=[...e].sort((i,o)=>i[0]-o[0]),n=[];for(const i of t){const o=n[n.length-1];o&&i[0]<=o[1]?o[1]=Math.max(o[1],i[1]):n.push([...i])}return n}function Zle(e,t){const n=[],i=[];for(const o of t??[])for(const[s,r]of o.indices)if(o.key==="name")n.push([s+1,r+2]);else if(o.key==="desc")i.push([s,r+1]);else if(o.key==="pinyinFirst"||o.key==="pinyinFull"){const l=Uw(IP(e.desc),o.key==="pinyinFirst"?"first":"full",s,r+1);l&&i.push(l)}return{name:n.length>0?KI(n):void 0,desc:i.length>0?KI(i):void 0}}function Gle(e,t=_P,n=i=>i.desc){const i=e.trim().replace(/^\//,"");if(i==="")return t.map(s=>({item:s,ranges:{}}));const o=t.map((s,r)=>{const l=n(s),a=jle(l);return{index:r,item:s,name:s.name.replace(/^\//,""),desc:l,pinyinFull:a.full,pinyinFirst:a.first}});return new Kre(o,Vle).search(i).map(({item:s,score:r,matches:l})=>({doc:s,score:r??1,rank:Kle(s.name,i),ranges:Zle(s,l)})).sort((s,r)=>s.rank!==r.rank?s.rank-r.rank:s.score!==r.score?s.score-r.score:s.doc.index-r.doc.index).map(({doc:s,ranges:r})=>({item:s.item,ranges:r}))}const xn={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",planArmed:"kimi-web.plan-armed",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",fontScale:"kimi-web.font-scale",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceSort:"kimi-web.workspace-sort",workspaceRecencyFloor:"kimi-web.workspace-recency-floor",pinnedSessions:"kimi-web.pinned-sessions",pinnedCollapsed:"kimi-web.pinned-collapsed",workspaceNameOverrides:"kimi-web.workspace-name-overrides",notifyEnabled:"kimi-web.notify-enabled",notifySound:"kimi-web.notify-sound",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInDefaultTarget:"kimi-web.open-in.default-target",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",sidebarViewMode:"kimi-web.sidebar-view-mode",mobileSwitcherViewMode:"kimi-web.mobile-switcher-view-mode",sidebarPinnedHeight:"kimi-web.sidebar-pinned-height",shortcutOverrides:"kimi-web.shortcut-overrides",dockIconChoice:"kimi-web.dock-icon-choice",updateSkippedVersion:"kimi-web.update-skipped-version",canarySkippedVersion:"kimi-web.canary-skipped-version",planMode:"kimi-web.plan-mode",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking",accent:"kimi-web.accent",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete"},ad="__new__";function ZI(e){return`kimi-web.draft.${e&&e.length>0?e:ad}`}function GI(e){return`kimi-web.attachment-draft.${e&&e.length>0?e:ad}`}function QI(e){return`kimi-web.draft-atts.${e&&e.length>0?e:ad}`}function ps(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ds(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function xr(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Tc(e){const t=ps(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Ec(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function B6(){const e=ps(xn.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[i,o]of Object.entries(t))o===!0&&(n[i]=!0);return n}catch{return{}}}function R6(e){const n={...B6()};for(const[i,o]of Object.entries(e))o?n[i]=!0:delete n[i];ds(xn.unread,JSON.stringify(n))}function Qle(){const e=Tc(xn.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function L3(e){Ec(xn.collapsedWorkspaces,Array.from(e))}function Yle(){return Tc(xn.pinnedCollapsed)===!0}function Vw(e){Ec(xn.pinnedCollapsed,e)}function Jle(){return ps(xn.sidebarViewMode)==="flat"?"flat":"grouped"}function Xle(e){ds(xn.sidebarViewMode,e)}function eae(){return ps(xn.mobileSwitcherViewMode)==="grouped"?"grouped":"flat"}function tae(e){ds(xn.mobileSwitcherViewMode,e)}function nae(){const e=Tc(xn.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function EP(e){Ec(xn.workspaceOrder,Array.from(e))}function iae(){return ps(xn.workspaceSort)==="recent"?"recent":"manual"}function oae(e){ds(xn.workspaceSort,e)}function sae(){const e=Tc(xn.workspaceRecencyFloor);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="number"&&Number.isFinite(i)&&(t[n]=i);return t}function LP(e){Ec(xn.workspaceRecencyFloor,e)}function NP(){const e=Tc(xn.pinnedSessions);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function N3(e){Ec(xn.pinnedSessions,Array.from(e))}function A2(){const e=Tc(xn.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="string"&&(t[n]=i);return t}function YI(e){Ec(xn.workspaceNameOverrides,e)}function rae(e,t,n,i,o){const s=n-o-(t.right+i),r=t.left-i-o,l=e>s&&r>s,a=Math.min(e,l?r:s);return{left:l?t.left-i-a:t.right+i,maxWidth:a,flipped:l}}let lae=0;function aae(e,t){const n=++lae;return e.pendingSwarmBySession[t]=n,n}function Kw(e,t,n){return n===void 0||e.pendingSwarmBySession[t]!==n?!1:(delete e.pendingSwarmBySession[t],!0)}function Zw(e,t,n){e.pendingSwarmBySession[t]===void 0&&(e.swarmModeBySession[t]=n)}function JI(e,t){const n=new Set(e.map(u=>u.id)),i=t.filter(u=>u.kind==="subagent"&&!n.has(u.id));if(i.length===0)return e;const o=new Map(e.map(u=>[u.id,u])),s=new Map(e.filter(u=>u.kind==="subagent"&&u.agentId!==void 0).map(u=>[u.agentId,u])),r=new Set,l=i.map(u=>{const c=u.backgroundTaskId!==void 0?o.get(u.backgroundTaskId):void 0,d=s.get(u.agentId??u.id),f=(d?.status==="running"&&c?.status!=="running"?d:c)??d;if(f===void 0)return u;r.add(f.id);const h=u.status==="running"&&f.status!=="running";return{...u,status:u.status==="running"?f.status:u.status,subagentPhase:h?f.status==="completed"?"completed":"failed":u.subagentPhase,completedAt:f.completedAt??u.completedAt,completedAtEstimated:f.completedAt!==void 0?void 0:u.completedAtEstimated,outputPreview:f.outputPreview??u.outputPreview,outputBytes:f.outputBytes??u.outputBytes,model:u.model??f.model,thinkingEffort:u.thinkingEffort??f.thinkingEffort,backgroundTaskId:f.id}});return[...e.filter(u=>!r.has(u.id)),...l]}function uae(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function cae(e,t=uae()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyF"||e.key.toLowerCase()==="f")&&!e.defaultPrevented}const dae=new Map([["ς","σ"],["ß","ss"],["ſ","s"],["ff","ff"],["fi","fi"],["fl","fl"],["ffi","ffi"],["ffl","ffl"],["ſt","st"],["st","st"],["ʼn","ʼn"],["µ","μ"],["K","k"],["Å","å"],["Ω","ω"]]);function fae(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function hae(e,t){if(t==="preserve")return{text:e,map:Array.from({length:e.length},(r,l)=>l)};const n=t==="collapse"?/[\t\n\f\r ]/:/[\t ]/;let i="";const o=[];let s=!1;for(let r=0;rXI(c.text)),i="\0";let o="";const s=[];for(let c=0;c0&&e[c].gapBefore&&(o+=i),s[c]=o.length,o+=n[c].folded;const r=gae(XI(t).folded);if(r===null)return;const l=new RegExp(r,"g");function a(c){let d=0,f=s.length-1,h=0;for(;d<=f;){const m=d+f>>1;s[m]<=c?(h=m,d=m+1):f=m-1}return h}let u;for(;;){const c=l.exec(o);if(c===null)return;const d=c.index,f=d+c[0].length-1,h=a(d),m=a(f),g=n[h].map[d-s[h]],v=n[m].map[f-s[m]],y={startSeg:h,startOffset:g.start,endSeg:m,endOffset:v.start+v.length};u!==void 0&&u.startSeg===y.startSeg&&u.startOffset===y.startOffset&&u.endSeg===y.endSeg&&u.endOffset===y.endOffset||(u=y,yield y)}}const mae=/[.*+?^${}()|[\]\\]/g;function gae(e){const t=[];let n=0;for(;n=wae)return{ranges:a,truncated:!0};a.push(f)}}return{ranges:a,truncated:!1}}const DP="kimi-transcript-search",Gw="kimi-transcript-search-current";function FP(){return globalThis.CSS?.highlights??null}function D3(e,t){const n=FP(),i=globalThis.Highlight;if(!n||!i)return;if(e.length===0){Qw();return}const o=new i;for(const r of e)o.add(r);n.set(DP,o);const s=e[t];if(s!==void 0){const r=new i;r.add(s),n.set(Gw,r)}else n.delete(Gw)}function Qw(){const e=FP();e?.delete(DP),e?.delete(Gw)}let BP=null;function Aae(e){e!==null&&(BP=e)}let tT=0,x2=null;async function Yw(e){const t=++tT,n=(async()=>{const o=await e();t===tT&&Aae(o)})(),i=(async()=>{await n,x2!==null&&x2.seq>t&&await x2.promise})();return x2={seq:t,promise:i},i}let RP=null;function xae(e){RP=e}const Sae=5e3;function _ae(e){return Promise.race([e(),new Promise(t=>{setTimeout(()=>t(null),Sae)})])}function S2(){return`${BP==="global"?"https://www.kimi.ai":"https://www.kimi.com"}/code?from=${qh?"kimi_code_desktop":"kimi_code_web"}`}function pv(){const e=RP;if(e===null){window.open(S2(),"_blank","noopener");return}const t=()=>_ae(e);if(qh){Yw(t).then(()=>{window.open(S2(),"_blank","noopener")});return}const n=window.open("","_blank");if(n===null){window.open(S2(),"_blank","noopener");return}try{n.opener=null}catch{}Yw(t).then(()=>{try{n.location.href=S2()}catch{}})}function Mae(e,t,n){if(e.length===0)return null;const i=new Set(e),o=t.filter(r=>i.has(r)),s=e.filter(r=>!t.includes(r));return s.length===0&&o.length===t.length?null:t.length===0&&n!==void 0?s.toSorted((r,l)=>(n.get(l)??Number.NEGATIVE_INFINITY)-(n.get(r)??Number.NEGATIVE_INFINITY)):[...s,...o]}function Iae(e,t){const n=new Map(t.map((i,o)=>[i,o]));return e.toSorted((i,o)=>(n.get(i.id)??-1)-(n.get(o.id)??-1))}function Tae(e,t,n,i="before"){const o=e.indexOf(t),s=e.indexOf(n);if(o===-1||s===-1||o===s)return e;const r=[...e];r.splice(o,1);const l=o(t.get(i.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}function Lae(e,t){let n=!1;const i={...e};for(const[o,s]of t)s>(i[o]??Number.NEGATIVE_INFINITY)&&(i[o]=s,n=!0);return{next:i,changed:n}}function Nae(e,t){const n=new Map;for(const i of e){if(i.parentSessionId||i.archived)continue;const o=new Date(i.updatedAt).getTime();if(Number.isNaN(o))continue;const s=t(i);o>(n.get(s)??Number.NEGATIVE_INFINITY)&&n.set(s,o)}return n}function Dae(e,t){const n=new Map;for(const i of e){const o=t[i.id]??Number.NEGATIVE_INFINITY,s=i.lastOpenedAt?Date.parse(i.lastOpenedAt):Number.NaN,r=Number.isNaN(s)?Number.NEGATIVE_INFINITY:s;n.set(i.id,Math.max(o,r))}return n}function Fae(e,t){const n=Object.keys(e);if(!n.some(o=>!t.has(o)))return{next:e,changed:!1};const i={};for(const o of n)t.has(o)&&(i[o]=e[o]);return{next:i,changed:!0}}const Bae=5;function Rae(e,t,n,i=Bae){if(e.length<=i)return e;const o=e.slice(0,i);if(t&&!o.some(s=>s.id===t)){const s=e.find(r=>r.id===t);s&&(o[i-1]=s)}return o}const Oae={class:"error-boundary-title"},$ae=rt({__name:"ErrorBoundary",props:{closable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const n=t,{t:i}=Ut(),o=V(!1);rO(()=>{o.value=!0});function s(){o.value=!1}return(r,l)=>o.value?(k(),L("div",{key:1,class:Re(["error-boundary",{fullscreen:e.fullscreen}]),role:"alert"},[e.closable?(k(),de(p(an),{key:0,class:"error-boundary-close",size:"sm",label:p(i)("common.close"),tooltip:p(i)("common.close"),onClick:l[0]||(l[0]=a=>n("close"))},{default:ue(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(Ce),{class:"error-boundary-icon",name:"alert-triangle",size:"lg"}),A("p",Oae,F(p(i)("common.errorBoundaryTitle")),1),U(p(rn),{size:"sm",onClick:s},{default:ue(()=>[Oe(F(p(i)("common.errorBoundaryRetry")),1)]),_:1})],2)):Wn(r.$slots,"default",{key:0},void 0,!0)}}),OP=St($ae,[["__scopeId","data-v-3c47f494"]]);var Pae=Object.create,O6=Object.defineProperty,zae=Object.getOwnPropertyDescriptor,$P=Object.getOwnPropertyNames,jae=Object.getPrototypeOf,Hae=Object.prototype.hasOwnProperty,PP=(e,t)=>function(){return t||(0,e[$P(e)[0]])((t={exports:{}}).exports,t),t.exports},Wae=e=>{let t={};for(var n in e)O6(t,n,{get:e[n],enumerable:!0});return t},qae=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=$P(t),s=0,r=o.length,l;st[a]).bind(null,l),enumerable:!(i=zae(t,l))||i.enumerable});return e},zP=(e,t,n)=>(n=e!=null?Pae(jae(e)):{},qae(O6(n,"default",{value:e,enumerable:!0}),e));function Uae(e,t,n,i){const o=Number(e[t].meta.id+1).toString();let s="";return typeof i.docId=="string"&&(s=`-${i.docId}-`),s+o}function Vae(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Kae(e,t,n,i,o){const s=o.rules.footnote_anchor_name(e,t,n,i,o),r=o.rules.footnote_caption(e,t,n,i,o);let l=s;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`${r}`}function Zae(e,t,n){return(n.xhtmlOut?`
`:`
`)+`
    -`}function Qae(){return`
+`}function Gae(){return`
-`}function Yae(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
  • `}function Jae(){return`
  • -`}function Xae(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),` ↩︎`}function eue(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Zae,e.renderer.rules.footnote_block_open=Gae,e.renderer.rules.footnote_block_close=Qae,e.renderer.rules.footnote_open=Yae,e.renderer.rules.footnote_close=Jae,e.renderer.rules.footnote_anchor=Xae,e.renderer.rules.footnote_caption=Kae,e.renderer.rules.footnote_anchor_name=Vae;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const v=l.bMarks[a],y=l.tShift[a],b=l.sCount[a],w=l.parentType,C=h,T=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let N=T;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let w=0;w?@[\]^_`{|}~-])/g;function oue(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,v){v=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},v),g.core.ruler.after("inline","github-task-lists",function(y){for(var b=y.tokens,w=0,C=2;C=0;b--)if(g[b].level===y)return b;return-1}function o(g,v){return d(g[v])&&f(g[v-1])&&h(g[v-2])&&m(g[v])}function s(g,v,y,b){var w=y.idPrefix+v;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(w,b)),g.children.push(a(b)),g.children.unshift(r(g,w,y,b)),y.divWrap&&(g.children.unshift(u(y,b)),g.children.push(c(b)))}function r(g,v,y,b){var w=new b("checkbox_input","input",0);return w.attrs=[["type","checkbox"],["id",v]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&w.attrs.push(["checked","true"]),y.disabled===!0&&w.attrs.push(["disabled","true"]),w}function l(g,v){var y=new v("label_open","label",1);return y.attrs=[["for",g]],y}function a(g){return new g("label_close","label",-1)}function u(g,v){var y=new v("checkbox_open","div",0);return y.attrs=[["class",g.divClass]],y}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const lue=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function aue(e){return e>=55296&&e<=57343||e>1114111?65533:lue.get(e)??e}function uue(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=Eo.ZERO&&e<=Eo.NINE}function due(e){return e>=Eo.UPPER_A&&e<=Eo.UPPER_F||e>=Eo.LOWER_A&&e<=Eo.LOWER_F}function fue(e){return e>=Eo.UPPER_A&&e<=Eo.UPPER_Z||e>=Eo.LOWER_A&&e<=Eo.LOWER_Z||Xw(e)}function hue(e){return e===Eo.EQUALS||fue(e)}var $s;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})($s||($s={}));var ud;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ud||(ud={}));var pue=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=$s.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=ud.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=$s.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case $s.EntityStart:return e.charCodeAt(t)===Eo.NUM?(this.state=$s.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=$s.NamedEntity,this.stateNamedEntity(e,t));case $s.NumericStart:return this.stateNumericStart(e,t);case $s.NumericDecimal:return this.stateNumericDecimal(e,t);case $s.NumericHex:return this.stateNumericHex(e,t);case $s.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|tT)===Eo.LOWER_X?(this.state=$s.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=$s.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&Br.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&Br.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===Eo.SEMI&&o!==0&&(i&Br.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=gue(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===ud.Attribute&&(o===0||hue(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&Br.VALUE_LENGTH)>>14,o!==0){if(s===Eo.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ud.Strict&&(i&Br.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&Br.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(Br.VALUE_LENGTH|Br.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case $s.NamedEntity:return this.result!==0&&(this.decodeMode!==ud.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $s.NumericDecimal:return this.emitNumericEntity(0,2);case $s.NumericHex:return this.emitNumericEntity(0,3);case $s.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $s.EntityStart:return 0}}};function mue(e){let t="";const n=new pue(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function gue(e,t,n,i){const o=(t&Br.BRANCH_LENGTH)>>7,s=t&Br.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const vue=mue(cue);function P6(e,t=ud.Legacy){return vue(e,t)}var yue=zP(rue());const nT={};function kue(e){let t=nT[e];if(t)return t;t=nT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}_k.defaultChars=";/?:@&=+$,#";_k.componentChars="";var eC=_k;const iT={};function bue(e){let t=iT[e];if(t)return t;t=iT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=bue(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}Mk.defaultChars=";/?:@&=+$,-_.!~*'()#";Mk.componentChars="-_.!~*'()";var jP=Mk;function z6(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function P9(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const wue=/^([a-z0-9.+-]+:)/i,Cue=/:[0-9]*$/,Aue=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,xue=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` -`," "]),Sue=["'"].concat(xue),oT=["%","/","?",";","#"].concat(Sue),sT=["/","?","#"],_ue=255,rT=/^[+a-z0-9A-Z_-]{0,63}$/,Mue=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,lT={javascript:!0,"javascript:":!0},aT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Iue(e,t){if(e&&e instanceof P9)return e;const n=new P9;return n.parse(e,t),n}P9.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Aue.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=wue.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&lT[r])&&(s=s.substr(2),this.slashes=!0)),!lT[r]&&(o||r&&!aT[r])){let u=-1;for(let m=0;m127?b+="x":b+=y[w];if(!b.match(rT)){const w=m.slice(0,g),C=m.slice(g+1),T=y.match(Mue);T&&(w.push(T[1]),C.unshift(T[2])),C.length&&(s=C.join(".")+s),this.hostname=w.join(".");break}}}}this.hostname.length>_ue&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),aT[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};P9.prototype.parseHost=function(e){let t=Cue.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var j6=Iue,HP=qae({decode:()=>eC,encode:()=>jP,format:()=>z6,parse:()=>j6}),Tue=Object.defineProperty,WP=e=>{let t={};for(var n in e)Tue(t,n,{get:e[n],enumerable:!0});return t},Is=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Eue=WP({arrayReplaceAt:()=>$ue,assign:()=>Bue,countLines:()=>Oo,escapeHtml:()=>Vue,escapeRE:()=>Zue,fromCodePoint:()=>M0,has:()=>Fue,isMdAsciiPunct:()=>H9,isPunctChar:()=>j9,isPunctCode:()=>tC,isSpace:()=>Rue,isString:()=>Nue,isValidEntityCode:()=>Tk,isWhiteSpace:()=>_0,lib:()=>Gue,mdurl:()=>HP,normalizeReference:()=>Ik,ucmicro:()=>z9,unescapeAll:()=>I0,unescapeMd:()=>jue});const z9={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Lue(e){return Object.prototype.toString.call(e)}function Nue(e){return Lue(e)==="[object String]"}const Due=Object.prototype.hasOwnProperty;function Fue(e,t){return Due.call(e,t)}function Bue(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function Rue(e){return e===9||e===32}function _0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function j9(e){return z9.P.test(e)||z9.S.test(e)}const uT=new Map;function tC(e){if(H9(e))return!0;if(e>=0&&e<128)return!1;const t=uT.get(e);if(t!==void 0)return t;const n=j9(String.fromCharCode(e));return uT.set(e,n),n}function H9(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ik(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function $ue(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Tk(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function M0(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const qP=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Oue=new RegExp(`${qP.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Pue=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function zue(e,t){if(t.charCodeAt(0)===35&&Pue.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Tk(i)?M0(i):e}const n=P6(e);return n!==e?n:e}function jue(e){return e.includes("\\")?e.replace(qP,"$1"):e}function I0(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Oue,(t,n,i)=>n||zue(t,i))}const Hue=/[&<>"]/,Wue=/[&<>"]/g,que={"&":"&","<":"<",">":">",'"':"""};function Uue(e){return que[e]}function Vue(e){return Hue.test(e)?e.replace(Wue,Uue):e}const Kue=/[.?*+^$[\]\\(){}|-]/g;function Zue(e){return e.replace(Kue,"\\$&")}const Gue={mdurl:HP,ucmicro:z9};function Oo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` -`,n+1))!==-1;)t++;return t}const Que=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Yue=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Jue=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,H6=["references","footnotes","abbreviations","abbr","abbrs"],W6=Symbol.for("markdown-it-ts.global-state"),q6=Object.prototype.hasOwnProperty;function cT(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $a(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ad(e){if(Array.isArray(e))return e.map(t=>Ad(t));if($a(e)){const t={};for(const n of Object.keys(e))t[n]=Ad(e[n]);return t}return e}function W9(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$a(e)?Object.keys(e):[]}function nC(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!nC(o[r],UP(i.value,r)):!0)}}function xc(e){const t=U6(e);if(t){for(const n of H6){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){ece(e,n,i);continue}i.existed?e[n]=Xue(e[n],i.value):delete e[n]}delete e[W6]}}function B3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const iC=Symbol.for("markdown-it-ts.diagnostics");function vv(e,t){if(e)try{const n=e[iC];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[iC]=i,i}catch{return}}function ec(e){return vv(e,!1)}function nce(e){if(e)try{const t=e[iC];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Rr(e){nce(e)}function $m(e,t){const n=vv(e,!0);n&&(n.stockFast=t)}function is(e,t){const n=vv(e,!0);n&&(n.strategy=t)}function R3(e,t){const n=vv(e,!0);n&&(n.chunk=t)}function VP(e,t){const n=vv(e,!0);n&&(n.unbounded=t)}const ice=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,oce=/[\0-\x1F\x7F-\x9F]/,sce=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,rce=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var lce=class{src_Any=ice.source;src_Cc=oce.source;src_Z=rce.source;src_P=sce.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},$3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},ace={"http:":$3,"https:":$3,"ftp:":$3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},uce="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",cce="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function dce(){const e=cce.split("|");return uce.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var fce={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:dce(),urlAuth:!1,maxLength:1e4},dT=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},KP=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...fce,...n},this.__schemas__={...ace},this.re=t||new lce,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const b=a;a=void 0;const w=this.testSchemaAt(e,b.schema,b.lastIndex);if(w){g={schema:b.schema,index:b.index,lastIndex:b.lastIndex+w};break}}let v=g;if((!v||l&&(l.indexv.lastIndex))&&(v=l),(!v||r&&(r.indexv.lastIndex))&&(v=r),!v)break;v===l?l=void 0:v===r&&(r=void 0);const y=new dT(e,v.schema,v.index,v.lastIndex);y.schema?this.__schemas__[y.schema].normalize(y,this):this.normalize(y),t.push(y),f=v.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new dT(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},hce=PP({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,v=Math.floor,y=String.fromCharCode;function b(z){throw new RangeError(m[z])}function w(z,O){const B=[];let P=z.length;for(;P--;)B[P]=O(z[P]);return B}function C(z,O){const B=z.split("@");let P="";B.length>1&&(P=B[0]+"@",z=B[1]),z=z.replace(h,".");const H=w(z.split("."),O).join(".");return P+H}function T(z){const O=[];let B=0;const P=z.length;for(;B=55296&&H<=56319&&BString.fromCodePoint(...z),I=function(z){return z>=48&&z<58?26+(z-48):z>=65&&z<91?z-65:z>=97&&z<123?z-97:36},S=function(z,O){return z+22+75*(z<26)-((O!=0)<<5)},_=function(z,O,B){let P=0;for(z=B?v(z/700):z>>1,z+=v(z/O);z>g*26>>1;P+=36)z=v(z/g);return v(P+(g+1)*z/(z+38))},x=function(z){const O=[],B=z.length;let P=0,H=128,j=72,Z=z.lastIndexOf("-");Z<0&&(Z=0);for(let ie=0;ie=128&&b("not-basic"),O.push(z.charCodeAt(ie));for(let ie=Z>0?Z+1:0;ie=B&&b("invalid-input");const ge=I(z.charCodeAt(ie++));ge>=36&&b("invalid-input"),ge>v((2147483647-P)/te)&&b("overflow"),P+=ge*te;const ue=X<=j?1:X>=j+26?26:X-j;if(gev(2147483647/se)&&b("overflow"),te*=se}const Q=O.length+1;j=_(P-W,Q,W==0),v(P/Q)>2147483647-H&&b("overflow"),H+=v(P/Q),P%=Q,O.splice(P++,0,H)}return String.fromCodePoint(...O)},E=function(z){const O=[];z=T(z);const B=z.length;let P=128,H=0,j=72;for(const W of z)W<128&&O.push(y(W));const Z=O.length;let ie=Z;for(Z&&O.push("-");ie=P&&tev((2147483647-H)/Q)&&b("overflow"),H+=(W-P)*Q,P=W;for(const te of z)if(te2147483647&&b("overflow"),te===P){let X=H;for(let ge=36;;ge+=36){const ue=ge<=j?1:ge>=j+26?26:ge-j;if(X32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=I0(e.slice(t,o)),s.pos=o,s.ok=!0),s}var GP=Z6;const Ey=-2;function pce(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=pce(l,t,a,n);if(f!==Ey)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function vce(e,t,n){const i=Ek(e,t);i<0?Y6(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var yce=WP({attrGet:()=>gce,attrIndex:()=>Ek,attrJoin:()=>vce,attrPush:()=>Y6,attrSet:()=>mce,parseLinkDestination:()=>Z6,parseLinkLabel:()=>G6,parseLinkTitle:()=>Q6});function kce(e){return e.includes("\r")||e.includes("\0")}function YP(e){return typeof e=="string"?e:e.toString()}function bce(e){if(e.inlineMode){const t=new Is("inline","",0);t.content=YP(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const wce=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Cce=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Ace(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(Cce.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(wce.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var JP=Ace;function xce(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var XP=xce;function fT(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function Sce(e){const t=e.tokens_meta,n=e.tokens_meta.length;fT(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?ez:tz,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function Ice(e){const t=e.tokens_meta,n=e.tokens_meta.length;hT(e,e.delimiters);for(let i=0;i=48&&e<=57}function Tce(e){const t=e|32;return J6(e)||t>=97&&t<=102}function iz(e){const t=e|32;return t>=97&&t<=122}function Ece(e){return iz(e)||J6(e)}function Lce(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function Nce(e,t,n){let i=t+1;if(i>=n||!iz(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return nz(o)!==o?o:null}function Dce(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=Lce(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=Tk(s)?M0(s):M0(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=Nce(e.src,n,i);if(o){const s=nz(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var oz=Dce;const sz=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),sC=new Array(128),rz=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);sC[e]=`\\${t}`,rz[e]=sz[e]?t:sC[e]}function pT(e,t,n){e.pending&&e.pushPending();const i=new Is("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function Fce(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return pT(e,s<256&&sz[s]?r:l,l),e.pos=n+1,!0}var lz=Fce;function Bce(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,uz="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",$ce=new RegExp(`^(?:${az}|${uz}||<\\?[\\s\\S]*?\\?>|]*>|)`),Oce=new RegExp(`^(?:${az}|${uz})`);function cz(e){return e===32||e===9||e===10||e===12||e===13}function Pce(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||cz(t)}function zce(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function Hce(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!jce(s))return!1;const r=o.slice(i).match($ce);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,Pce(l)&&e.linkLevel++,zce(l)&&e.linkLevel--}return e.pos+=l.length,!0}var dz=Hce;function Wce(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=q9(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=GP(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[Ik(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const v=e.push("image","img",0);v.attrs=[["src",c],["alt",""]],v.children=g,v.content=i,a&&v.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var fz=Wce;function O3(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[Ik(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var hz=qce;function pz(e){const t=e|32;return t>=97&&t<=122}function Uce(e){return e>=48&&e<=57}function Vce(e){return pz(e)||Uce(e)||e===43||e===45||e===46}function Kce(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&Vce(e.charCodeAt(t));)t--;return t++,t>=e.length||!pz(e.charCodeAt(t))?null:e.slice(t)}function Zce(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=Kce(e.pending);if(!o)return!1;const s=Zce(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Gce(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||gT(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function ede(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function yz(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:X6(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function o1(e,t,n,i,o,s){const r=yz(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=ede(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=X6()}function tde(e){const t=yz(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},kz=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Is("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Is(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Is(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function yT(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return gz(e,t);case 33:return fz(e,t);case 38:return oz(e,t);case 42:case 95:return oC.tokenize(e,t);case 58:return e.md.options.linkify&&mz(e,t);case 60:return JP(e,t)||dz(e,t);case 91:return hz(e,t);case 92:return lz(e,t);case 96:return XP(e,t);case 126:return rC.tokenize(e,t);default:return vz(e,t)}}function bz(e){return!nde.test(e)}var ide=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new vT,this.ruler2=new vT,this.ruler.push("text",vz),this.ruler.push("linkify",mz),this.ruler.push("newline",gz),this.ruler.push("escape",lz),this.ruler.push("backticks",XP),this.ruler.push("strikethrough",rC.tokenize),this.ruler.push("emphasis",oC.tokenize),this.ruler.push("link",hz),this.ruler.push("image",fz),this.ruler.push("autolink",JP),this.ruler.push("html_inline",dz),this.ruler.push("entity",oz),this.ruler2.push("balance_pairs",_ce),this.ruler2.push("strikethrough",rC.postProcess),this.ruler2.push("emphasis",oC.postProcess),this.ruler2.push("fragments_join",Rce),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=yT(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&bz(e)){const a=new Is("text","",0);a.content=e,i.push(a);return}const o=new kz(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&bz(s.content)){const r=new Is("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const sde=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,rde=/[0-9a-z]/i;function lde(e){return/^\s]/i.test(e)}function ade(e){return/^<\/a\s*>/i.test(e)}function ude(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(lde(l.content)&&s>0&&s--,ade(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>ude(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const T=new Is("text","",0);T.content=a.slice(f,y),T.level=d,c.push(T)}const b=new Is("link_open","a",1);b.attrs=[["href",g]],b.level=d++,b.markup="linkify",b.info="auto",c.push(b);const w=new Is("text","",0);w.content=v,w.level=d,c.push(w);const C=new Is("link_close","a",-1);C.level=--d,C.markup="linkify",C.info="auto",c.push(C),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(mde,vde)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function kde(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&wz.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function bde(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");pde.test(i)&&yde(n.children||[]),wz.test(i)&&kde(n.children||[])}}var wde=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const Cde=/['"]/,kT=/['"]/g,bT="’";function M2(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Ade(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=y,h=b),!f&&!h){m&&(r.content=M2(r.content,d.index,bT));continue}if(h)for(n=i.length-1;n>=0;n--){let T=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!Cde.test(i)||!n.children||Ade(n.children,e)}}function Sde(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],v=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let w=!1,C;for(C=t;C=d)break;if(o.charCodeAt(c++)===62&&!_){let E=a[C]+1,M,R;o.charCodeAt(c)===32?(c++,E++,R=!1,M=!0):o.charCodeAt(c)===9?(M=!0,(u[C]+E)%4===3?(c++,E++,R=!1):R=!0):M=!1;let q=E;for(h.push(s[C]),s[C]=c;c=d,m.push(u[C]),u[C]=a[C]+1+(M?1:0),g.push(a[C]),a[C]=q-E,v.push(l[C]),l[C]=c-s[C];continue}if(w)break;let x=!1;for(let E=0,M=y.length;E";const I=[t,0];N.map=I,e.md.block.tokenize(e,t,C);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=f,e.parentType=b,I[1]=e.line;for(let _=0;_=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} -`,s.map=[t,e.line],!0}function Lde(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&AT(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",wT[d],1);h.markup=CT[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",wT[d],-1);return g.markup=CT[d],!0}function Dde(e){switch(e){case 9:case 32:return!0}return!1}function Fde(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Oce.source}\\s*$`),/^$/,!1]];function Bde(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var _z=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,v=this.bsCount,y=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};_z.prototype.Token=Is;function $de(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:$de(n,i,o)}const ST=["","h1","h2"];function Ode(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=Mz(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=T)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(C),h===45||h===61)){let I=C+1,S=I;for(;I=T){f=h===61?1:2;break}if(S-C>1)continue}if(a[m]<0||c&&!Iz(e,m,o,C,T))continue;let N=!1;for(let I=0,S=i.length;IC;){const N=o.charCodeAt(T-1);if(N!==9&&N!==32)break;T--}g=o.slice(C,T)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const v=h===61?"=":"-",y=e.push("heading_open",ST[f],1);y.markup=v,y.map=[t,e.line];const b=e.push("inline","",0);b.content=g,b.map=[t,e.line-1],b.children=[];const w=e.push("heading_close",ST[f],-1);return w.markup=v,e.parentType=d,!0}function Tz(e){switch(e){case 9:case 32:return!0}return!1}function _T(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,v=e.eMarks,y=e.sCount,b=e.bsCount,w=m[l]+g[l];if(w>=v[l])return!1;const C=h.charCodeAt(w);if(C>=48&&C<=57){if(f=MT(e,l),f<0||(c=!0,r=w,d=Pde(e,l,f),u&&d!==1))return!1}else if(C===42||C===45||C===43){if(f=_T(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=v[l])return!1;if(i)return!0;const T=h.charCodeAt(f-1),N=String.fromCharCode(T);if(c){const M=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(M.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const I=[l,0];e.tokens[e.tokens.length-1].map=I,e.tokens[e.tokens.length-1].markup=N;let S=!1;const _=e.tokens.length-1,x=e.md.block.ruler.getRulesForState(e,"list"),E=e.parentType;for(e.parentType="list";l=o?z=1:z=R-M,z>4&&(z=1);const O=M+z,B=e.push("list_item_open","li",1);B.markup=N;const P=[l,0];B.map=P,c&&(B.info=f-r-1===1?zde[h.charCodeAt(r)-48]:h.slice(r,f-1));const H=e.tight,j=e.tShift[l],Z=e.sCount[l],ie=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=O,e.tight=!0,e.tShift[l]=q-m[l],e.sCount[l]=R,q>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ie,e.tShift[l]=j,e.sCount[l]=Z,e.tight=H,e.push("list_item_close","li",-1).markup=N,l=e.line,P[1]=l,l>=n||e.sCount[l]=4)break;let W=!1;for(let Q=0,te=x.length;Q3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const w=r[f]+l[f],C=a[f];if(w=C||IT(s.charCodeAt(w+1)))break}else if(T>=48&&T<=57&&w+1=C){N=-1;break}const I=s.charCodeAt(N++);if(I>=48&&I<=57){if(N-w>=10){N=-1;break}continue}if((I===41||I===46)&&(N>=C||IT(s.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const v=r[f]+l[f],y=a[f];if(d&&!Iz(e,f,s,v,y))continue;let b=!1;for(let w=0,C=i.length;w=4||e.src.charCodeAt(o)!==91)return!1;function a(w){const C=e.lineMax;if(w>=C||e.isEmpty(w))return null;let T=!1;if(e.sCount[w]-e.blkIndent>3&&(T=!0),e.sCount[w]<0&&(T=!0),!T){const S=e.parentType;e.parentType="reference";let _=!1;for(let x=0,E=l.length;x"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:y,href:f}),e.line=r),!0):!1}function P3(e){switch(e){case 9:case 32:return!0}return!1}const Ude=65536;function z3(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Vde(e,t){if(e.lineFlags)return(e.lineFlags[t]&Bg.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!P3(l)||r===45&&P3(l)||!Vde(e,t))return!1;for(;s=4)return!1;u=TT(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let C=0;C=4||(u=TT(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=d-u.length,w>Ude))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=b=[t+2,0]}const T=e.push("tr_open","tr",1);T.map=[o,o+1];for(let N=0;Nr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return o1(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const T2=[["table",Kde,["paragraph","reference"]],["code",Ede],["fence",Lde,["paragraph","reference","blockquote","list"]],["blockquote",Tde,["paragraph","reference","blockquote","list"]],["hr",Fde,["paragraph","reference","blockquote","list"]],["list",Hde,["paragraph","reference","blockquote"]],["reference",qde],["html_block",Bde,["paragraph","reference","blockquote"]],["heading",Nde,["paragraph","reference","blockquote"]],["lheading",Ode],["paragraph",Wde]];var Gde=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Zde;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new _z(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Ez=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};Ez.prototype.Token=Is;const ET=[["normalize",hde],["block",bce],["inline",ode],["linkify",cde],["replacements",bde],["smartquotes",xde],["text_join",Sde]],Qde={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Yde={parseLinkLabel:G6,parseLinkDestination:Z6,parseLinkTitle:Q6};function Jde(){return{...Qde}}function Xde(){return{...Yde}}var efe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Gde,this.inline=new ide,this.ruler=new wde;for(let e=0;e@[\]\\^_`{}~]/;function U9(e){return!tfe.test(e)}function rg(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function Ly(e,t,n){for(let i=t;i3)return U9(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!U9(c))return!1;const d=ife[s],f=ofe[s],h=da("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(e7(c,o,1));const m=da("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function rfe(e,t,n){const i=da("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(e7(t,n,1)),e.push(da("paragraph_close","p",-1,0))}function lfe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function q3(e,t){for(;t=1e5?NT:W3,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,DT=/[&<>"]/g,pfe=/&/g,mfe=/[<>"]/g,gfe={"&":"&","<":"<",">":">",'"':"""};function U3(e){return gfe[e]||e}function Ui(e){if(e.length===0)return"";if(e.length<32)return hfe.test(e)?e.replace(DT,U3):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(pfe,"&"):t?e.replace(DT,U3):e.replace(mfe,U3)}const vfe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),yfe=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Lz(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(vfe,(t,n,i)=>{if(n)return n;if(yfe.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return Tk(s)?M0(s):"�"}const o=P6(t);return o!==t?o:t})}const kfe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,bfe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,wfe=/"/g;function Op(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function V9(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!V9(e,t,Op(e,t))}function FT(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=t7(e.slice(s,r));return a===null?null:`${a} -`}function BT(e,t,n){return t+1" +`}function Qae(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
  • `}function Yae(){return`
  • +`}function Jae(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),` ↩︎`}function Xae(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Kae,e.renderer.rules.footnote_block_open=Zae,e.renderer.rules.footnote_block_close=Gae,e.renderer.rules.footnote_open=Qae,e.renderer.rules.footnote_close=Yae,e.renderer.rules.footnote_anchor=Jae,e.renderer.rules.footnote_caption=Vae,e.renderer.rules.footnote_anchor_name=Uae;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const v=l.bMarks[a],y=l.tShift[a],b=l.sCount[a],w=l.parentType,C=h,T=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let N=T;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let w=0;w?@[\]^_`{|}~-])/g;function iue(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,v){v=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},v),g.core.ruler.after("inline","github-task-lists",function(y){for(var b=y.tokens,w=0,C=2;C=0;b--)if(g[b].level===y)return b;return-1}function o(g,v){return d(g[v])&&f(g[v-1])&&h(g[v-2])&&m(g[v])}function s(g,v,y,b){var w=y.idPrefix+v;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(w,b)),g.children.push(a(b)),g.children.unshift(r(g,w,y,b)),y.divWrap&&(g.children.unshift(u(y,b)),g.children.push(c(b)))}function r(g,v,y,b){var w=new b("checkbox_input","input",0);return w.attrs=[["type","checkbox"],["id",v]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&w.attrs.push(["checked","true"]),y.disabled===!0&&w.attrs.push(["disabled","true"]),w}function l(g,v){var y=new v("label_open","label",1);return y.attrs=[["for",g]],y}function a(g){return new g("label_close","label",-1)}function u(g,v){var y=new v("checkbox_open","div",0);return y.attrs=[["class",g.divClass]],y}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const rue=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function lue(e){return e>=55296&&e<=57343||e>1114111?65533:rue.get(e)??e}function aue(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=To.ZERO&&e<=To.NINE}function cue(e){return e>=To.UPPER_A&&e<=To.UPPER_F||e>=To.LOWER_A&&e<=To.LOWER_F}function due(e){return e>=To.UPPER_A&&e<=To.UPPER_Z||e>=To.LOWER_A&&e<=To.LOWER_Z||Jw(e)}function fue(e){return e===To.EQUALS||due(e)}var Ps;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ps||(Ps={}));var ud;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ud||(ud={}));var hue=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=Ps.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=ud.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=Ps.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ps.EntityStart:return e.charCodeAt(t)===To.NUM?(this.state=Ps.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ps.NamedEntity,this.stateNamedEntity(e,t));case Ps.NumericStart:return this.stateNumericStart(e,t);case Ps.NumericDecimal:return this.stateNumericDecimal(e,t);case Ps.NumericHex:return this.stateNumericHex(e,t);case Ps.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|nT)===To.LOWER_X?(this.state=Ps.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ps.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&Fr.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&Fr.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===To.SEMI&&o!==0&&(i&Fr.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=mue(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===ud.Attribute&&(o===0||fue(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&Fr.VALUE_LENGTH)>>14,o!==0){if(s===To.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ud.Strict&&(i&Fr.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&Fr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(Fr.VALUE_LENGTH|Fr.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case Ps.NamedEntity:return this.result!==0&&(this.decodeMode!==ud.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ps.NumericDecimal:return this.emitNumericEntity(0,2);case Ps.NumericHex:return this.emitNumericEntity(0,3);case Ps.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ps.EntityStart:return 0}}};function pue(e){let t="";const n=new hue(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function mue(e,t,n,i){const o=(t&Fr.BRANCH_LENGTH)>>7,s=t&Fr.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const gue=pue(uue);function $6(e,t=ud.Legacy){return gue(e,t)}var vue=zP(sue());const iT={};function yue(e){let t=iT[e];if(t)return t;t=iT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}Sk.defaultChars=";/?:@&=+$,#";Sk.componentChars="";var Xw=Sk;const oT={};function kue(e){let t=oT[e];if(t)return t;t=oT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=kue(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}_k.defaultChars=";/?:@&=+$,-_.!~*'()#";_k.componentChars="-_.!~*'()";var jP=_k;function P6(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function $9(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const bue=/^([a-z0-9.+-]+:)/i,wue=/:[0-9]*$/,Cue=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Aue=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),xue=["'"].concat(Aue),sT=["%","/","?",";","#"].concat(xue),rT=["/","?","#"],Sue=255,lT=/^[+a-z0-9A-Z_-]{0,63}$/,_ue=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,aT={javascript:!0,"javascript:":!0},uT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Mue(e,t){if(e&&e instanceof $9)return e;const n=new $9;return n.parse(e,t),n}$9.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Cue.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=bue.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&aT[r])&&(s=s.substr(2),this.slashes=!0)),!aT[r]&&(o||r&&!uT[r])){let u=-1;for(let m=0;m127?b+="x":b+=y[w];if(!b.match(lT)){const w=m.slice(0,g),C=m.slice(g+1),T=y.match(_ue);T&&(w.push(T[1]),C.unshift(T[2])),C.length&&(s=C.join(".")+s),this.hostname=w.join(".");break}}}}this.hostname.length>Sue&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),uT[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};$9.prototype.parseHost=function(e){let t=wue.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var z6=Mue,HP=Wae({decode:()=>Xw,encode:()=>jP,format:()=>P6,parse:()=>z6}),Iue=Object.defineProperty,WP=e=>{let t={};for(var n in e)Iue(t,n,{get:e[n],enumerable:!0});return t},Ts=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Tue=WP({arrayReplaceAt:()=>Rue,assign:()=>Fue,countLines:()=>Po,escapeHtml:()=>Uue,escapeRE:()=>Kue,fromCodePoint:()=>_0,has:()=>Due,isMdAsciiPunct:()=>j9,isPunctChar:()=>z9,isPunctCode:()=>eC,isSpace:()=>Bue,isString:()=>Lue,isValidEntityCode:()=>Ik,isWhiteSpace:()=>S0,lib:()=>Zue,mdurl:()=>HP,normalizeReference:()=>Mk,ucmicro:()=>P9,unescapeAll:()=>M0,unescapeMd:()=>zue});const P9={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Eue(e){return Object.prototype.toString.call(e)}function Lue(e){return Eue(e)==="[object String]"}const Nue=Object.prototype.hasOwnProperty;function Due(e,t){return Nue.call(e,t)}function Fue(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function Bue(e){return e===9||e===32}function S0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function z9(e){return P9.P.test(e)||P9.S.test(e)}const cT=new Map;function eC(e){if(j9(e))return!0;if(e>=0&&e<128)return!1;const t=cT.get(e);if(t!==void 0)return t;const n=z9(String.fromCharCode(e));return cT.set(e,n),n}function j9(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Mk(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Rue(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Ik(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function _0(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const qP=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Oue=new RegExp(`${qP.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),$ue=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Pue(e,t){if(t.charCodeAt(0)===35&&$ue.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Ik(i)?_0(i):e}const n=$6(e);return n!==e?n:e}function zue(e){return e.includes("\\")?e.replace(qP,"$1"):e}function M0(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Oue,(t,n,i)=>n||Pue(t,i))}const jue=/[&<>"]/,Hue=/[&<>"]/g,Wue={"&":"&","<":"<",">":">",'"':"""};function que(e){return Wue[e]}function Uue(e){return jue.test(e)?e.replace(Hue,que):e}const Vue=/[.?*+^$[\]\\(){}|-]/g;function Kue(e){return e.replace(Vue,"\\$&")}const Zue={mdurl:HP,ucmicro:P9};function Po(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` +`,n+1))!==-1;)t++;return t}const Gue=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Que=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Yue=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,j6=["references","footnotes","abbreviations","abbr","abbrs"],H6=Symbol.for("markdown-it-ts.global-state"),W6=Object.prototype.hasOwnProperty;function dT(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function ja(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ad(e){if(Array.isArray(e))return e.map(t=>Ad(t));if(ja(e)){const t={};for(const n of Object.keys(e))t[n]=Ad(e[n]);return t}return e}function H9(e){return Array.isArray(e)?e.map((t,n)=>String(n)):ja(e)?Object.keys(e):[]}function tC(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!tC(o[r],UP(i.value,r)):!0)}}function Sc(e){const t=q6(e);if(t){for(const n of j6){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Xue(e,n,i);continue}i.existed?e[n]=Jue(e[n],i.value):delete e[n]}delete e[H6]}}function F3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const nC=Symbol.for("markdown-it-ts.diagnostics");function gv(e,t){if(e)try{const n=e[nC];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[nC]=i,i}catch{return}}function tc(e){return gv(e,!1)}function tce(e){if(e)try{const t=e[nC];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Br(e){tce(e)}function Rm(e,t){const n=gv(e,!0);n&&(n.stockFast=t)}function ns(e,t){const n=gv(e,!0);n&&(n.strategy=t)}function B3(e,t){const n=gv(e,!0);n&&(n.chunk=t)}function VP(e,t){const n=gv(e,!0);n&&(n.unbounded=t)}const nce=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ice=/[\0-\x1F\x7F-\x9F]/,oce=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,sce=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var rce=class{src_Any=nce.source;src_Cc=ice.source;src_Z=sce.source;src_P=oce.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},R3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},lce={"http:":R3,"https:":R3,"ftp:":R3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},ace="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",uce="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function cce(){const e=uce.split("|");return ace.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var dce={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:cce(),urlAuth:!1,maxLength:1e4},fT=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},KP=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...dce,...n},this.__schemas__={...lce},this.re=t||new rce,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const b=a;a=void 0;const w=this.testSchemaAt(e,b.schema,b.lastIndex);if(w){g={schema:b.schema,index:b.index,lastIndex:b.lastIndex+w};break}}let v=g;if((!v||l&&(l.indexv.lastIndex))&&(v=l),(!v||r&&(r.indexv.lastIndex))&&(v=r),!v)break;v===l?l=void 0:v===r&&(r=void 0);const y=new fT(e,v.schema,v.index,v.lastIndex);y.schema?this.__schemas__[y.schema].normalize(y,this):this.normalize(y),t.push(y),f=v.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new fT(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},fce=PP({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,v=Math.floor,y=String.fromCharCode;function b(z){throw new RangeError(m[z])}function w(z,$){const B=[];let P=z.length;for(;P--;)B[P]=$(z[P]);return B}function C(z,$){const B=z.split("@");let P="";B.length>1&&(P=B[0]+"@",z=B[1]),z=z.replace(h,".");const H=w(z.split("."),$).join(".");return P+H}function T(z){const $=[];let B=0;const P=z.length;for(;B=55296&&H<=56319&&BString.fromCodePoint(...z),I=function(z){return z>=48&&z<58?26+(z-48):z>=65&&z<91?z-65:z>=97&&z<123?z-97:36},S=function(z,$){return z+22+75*(z<26)-(($!=0)<<5)},_=function(z,$,B){let P=0;for(z=B?v(z/700):z>>1,z+=v(z/$);z>g*26>>1;P+=36)z=v(z/g);return v(P+(g+1)*z/(z+38))},x=function(z){const $=[],B=z.length;let P=0,H=128,j=72,G=z.lastIndexOf("-");G<0&&(G=0);for(let ne=0;ne=128&&b("not-basic"),$.push(z.charCodeAt(ne));for(let ne=G>0?G+1:0;ne=B&&b("invalid-input");const ve=I(z.charCodeAt(ne++));ve>=36&&b("invalid-input"),ve>v((2147483647-P)/te)&&b("overflow"),P+=ve*te;const ce=X<=j?1:X>=j+26?26:X-j;if(vev(2147483647/se)&&b("overflow"),te*=se}const Q=$.length+1;j=_(P-W,Q,W==0),v(P/Q)>2147483647-H&&b("overflow"),H+=v(P/Q),P%=Q,$.splice(P++,0,H)}return String.fromCodePoint(...$)},E=function(z){const $=[];z=T(z);const B=z.length;let P=128,H=0,j=72;for(const W of z)W<128&&$.push(y(W));const G=$.length;let ne=G;for(G&&$.push("-");ne=P&&tev((2147483647-H)/Q)&&b("overflow"),H+=(W-P)*Q,P=W;for(const te of z)if(te2147483647&&b("overflow"),te===P){let X=H;for(let ve=36;;ve+=36){const ce=ve<=j?1:ve>=j+26?26:ve-j;if(X32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=M0(e.slice(t,o)),s.pos=o,s.ok=!0),s}var GP=K6;const Ty=-2;function hce(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=hce(l,t,a,n);if(f!==Ty)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function gce(e,t,n){const i=Tk(e,t);i<0?Q6(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var vce=WP({attrGet:()=>mce,attrIndex:()=>Tk,attrJoin:()=>gce,attrPush:()=>Q6,attrSet:()=>pce,parseLinkDestination:()=>K6,parseLinkLabel:()=>Z6,parseLinkTitle:()=>G6});function yce(e){return e.includes("\r")||e.includes("\0")}function YP(e){return typeof e=="string"?e:e.toString()}function kce(e){if(e.inlineMode){const t=new Ts("inline","",0);t.content=YP(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const bce=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,wce=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Cce(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(wce.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(bce.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var JP=Cce;function Ace(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var XP=Ace;function hT(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function xce(e){const t=e.tokens_meta,n=e.tokens_meta.length;hT(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?ez:tz,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function Mce(e){const t=e.tokens_meta,n=e.tokens_meta.length;pT(e,e.delimiters);for(let i=0;i=48&&e<=57}function Ice(e){const t=e|32;return Y6(e)||t>=97&&t<=102}function iz(e){const t=e|32;return t>=97&&t<=122}function Tce(e){return iz(e)||Y6(e)}function Ece(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function Lce(e,t,n){let i=t+1;if(i>=n||!iz(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return nz(o)!==o?o:null}function Nce(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=Ece(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=Ik(s)?_0(s):_0(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=Lce(e.src,n,i);if(o){const s=nz(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var oz=Nce;const sz=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),oC=new Array(128),rz=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);oC[e]=`\\${t}`,rz[e]=sz[e]?t:oC[e]}function mT(e,t,n){e.pending&&e.pushPending();const i=new Ts("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function Dce(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return mT(e,s<256&&sz[s]?r:l,l),e.pos=n+1,!0}var lz=Dce;function Fce(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,uz="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Rce=new RegExp(`^(?:${az}|${uz}||<\\?[\\s\\S]*?\\?>|]*>|)`),Oce=new RegExp(`^(?:${az}|${uz})`);function cz(e){return e===32||e===9||e===10||e===12||e===13}function $ce(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||cz(t)}function Pce(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function jce(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!zce(s))return!1;const r=o.slice(i).match(Rce);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,$ce(l)&&e.linkLevel++,Pce(l)&&e.linkLevel--}return e.pos+=l.length,!0}var dz=jce;function Hce(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=W9(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=GP(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[Mk(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const v=e.push("image","img",0);v.attrs=[["src",c],["alt",""]],v.children=g,v.content=i,a&&v.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var fz=Hce;function O3(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[Mk(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var hz=Wce;function pz(e){const t=e|32;return t>=97&&t<=122}function qce(e){return e>=48&&e<=57}function Uce(e){return pz(e)||qce(e)||e===43||e===45||e===46}function Vce(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&Uce(e.charCodeAt(t));)t--;return t++,t>=e.length||!pz(e.charCodeAt(t))?null:e.slice(t)}function Kce(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=Vce(e.pending);if(!o)return!1;const s=Kce(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Zce(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||vT(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function Xce(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function yz(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:J6(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function o1(e,t,n,i,o,s){const r=yz(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Xce(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=J6()}function ede(e){const t=yz(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},kz=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Ts("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Ts(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Ts(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function kT(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return gz(e,t);case 33:return fz(e,t);case 38:return oz(e,t);case 42:case 95:return iC.tokenize(e,t);case 58:return e.md.options.linkify&&mz(e,t);case 60:return JP(e,t)||dz(e,t);case 91:return hz(e,t);case 92:return lz(e,t);case 96:return XP(e,t);case 126:return sC.tokenize(e,t);default:return vz(e,t)}}function bz(e){return!tde.test(e)}var nde=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new yT,this.ruler2=new yT,this.ruler.push("text",vz),this.ruler.push("linkify",mz),this.ruler.push("newline",gz),this.ruler.push("escape",lz),this.ruler.push("backticks",XP),this.ruler.push("strikethrough",sC.tokenize),this.ruler.push("emphasis",iC.tokenize),this.ruler.push("link",hz),this.ruler.push("image",fz),this.ruler.push("autolink",JP),this.ruler.push("html_inline",dz),this.ruler.push("entity",oz),this.ruler2.push("balance_pairs",Sce),this.ruler2.push("strikethrough",sC.postProcess),this.ruler2.push("emphasis",iC.postProcess),this.ruler2.push("fragments_join",Bce),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=kT(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&bz(e)){const a=new Ts("text","",0);a.content=e,i.push(a);return}const o=new kz(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&bz(s.content)){const r=new Ts("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const ode=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,sde=/[0-9a-z]/i;function rde(e){return/^\s]/i.test(e)}function lde(e){return/^<\/a\s*>/i.test(e)}function ade(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(rde(l.content)&&s>0&&s--,lde(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>ade(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const T=new Ts("text","",0);T.content=a.slice(f,y),T.level=d,c.push(T)}const b=new Ts("link_open","a",1);b.attrs=[["href",g]],b.level=d++,b.markup="linkify",b.info="auto",c.push(b);const w=new Ts("text","",0);w.content=v,w.level=d,c.push(w);const C=new Ts("link_close","a",-1);C.level=--d,C.markup="linkify",C.info="auto",c.push(C),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(pde,gde)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function yde(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&wz.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function kde(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");hde.test(i)&&vde(n.children||[]),wz.test(i)&&yde(n.children||[])}}var bde=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const wde=/['"]/,bT=/['"]/g,wT="’";function _2(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Cde(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=y,h=b),!f&&!h){m&&(r.content=_2(r.content,d.index,wT));continue}if(h)for(n=i.length-1;n>=0;n--){let T=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!wde.test(i)||!n.children||Cde(n.children,e)}}function xde(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],v=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let w=!1,C;for(C=t;C=d)break;if(o.charCodeAt(c++)===62&&!_){let E=a[C]+1,M,R;o.charCodeAt(c)===32?(c++,E++,R=!1,M=!0):o.charCodeAt(c)===9?(M=!0,(u[C]+E)%4===3?(c++,E++,R=!1):R=!0):M=!1;let q=E;for(h.push(s[C]),s[C]=c;c=d,m.push(u[C]),u[C]=a[C]+1+(M?1:0),g.push(a[C]),a[C]=q-E,v.push(l[C]),l[C]=c-s[C];continue}if(w)break;let x=!1;for(let E=0,M=y.length;E";const I=[t,0];N.map=I,e.md.block.tokenize(e,t,C);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=f,e.parentType=b,I[1]=e.line;for(let _=0;_=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} +`,s.map=[t,e.line],!0}function Ede(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&xT(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",CT[d],1);h.markup=AT[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",CT[d],-1);return g.markup=AT[d],!0}function Nde(e){switch(e){case 9:case 32:return!0}return!1}function Dde(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Oce.source}\\s*$`),/^$/,!1]];function Fde(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var _z=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,v=this.bsCount,y=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};_z.prototype.Token=Ts;function Rde(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:Rde(n,i,o)}const _T=["","h1","h2"];function Ode(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=Mz(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=T)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(C),h===45||h===61)){let I=C+1,S=I;for(;I=T){f=h===61?1:2;break}if(S-C>1)continue}if(a[m]<0||c&&!Iz(e,m,o,C,T))continue;let N=!1;for(let I=0,S=i.length;IC;){const N=o.charCodeAt(T-1);if(N!==9&&N!==32)break;T--}g=o.slice(C,T)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const v=h===61?"=":"-",y=e.push("heading_open",_T[f],1);y.markup=v,y.map=[t,e.line];const b=e.push("inline","",0);b.content=g,b.map=[t,e.line-1],b.children=[];const w=e.push("heading_close",_T[f],-1);return w.markup=v,e.parentType=d,!0}function Tz(e){switch(e){case 9:case 32:return!0}return!1}function MT(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,v=e.eMarks,y=e.sCount,b=e.bsCount,w=m[l]+g[l];if(w>=v[l])return!1;const C=h.charCodeAt(w);if(C>=48&&C<=57){if(f=IT(e,l),f<0||(c=!0,r=w,d=$de(e,l,f),u&&d!==1))return!1}else if(C===42||C===45||C===43){if(f=MT(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=v[l])return!1;if(i)return!0;const T=h.charCodeAt(f-1),N=String.fromCharCode(T);if(c){const M=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(M.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const I=[l,0];e.tokens[e.tokens.length-1].map=I,e.tokens[e.tokens.length-1].markup=N;let S=!1;const _=e.tokens.length-1,x=e.md.block.ruler.getRulesForState(e,"list"),E=e.parentType;for(e.parentType="list";l=o?z=1:z=R-M,z>4&&(z=1);const $=M+z,B=e.push("list_item_open","li",1);B.markup=N;const P=[l,0];B.map=P,c&&(B.info=f-r-1===1?Pde[h.charCodeAt(r)-48]:h.slice(r,f-1));const H=e.tight,j=e.tShift[l],G=e.sCount[l],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=$,e.tight=!0,e.tShift[l]=q-m[l],e.sCount[l]=R,q>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ne,e.tShift[l]=j,e.sCount[l]=G,e.tight=H,e.push("list_item_close","li",-1).markup=N,l=e.line,P[1]=l,l>=n||e.sCount[l]=4)break;let W=!1;for(let Q=0,te=x.length;Q3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const w=r[f]+l[f],C=a[f];if(w=C||TT(s.charCodeAt(w+1)))break}else if(T>=48&&T<=57&&w+1=C){N=-1;break}const I=s.charCodeAt(N++);if(I>=48&&I<=57){if(N-w>=10){N=-1;break}continue}if((I===41||I===46)&&(N>=C||TT(s.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const v=r[f]+l[f],y=a[f];if(d&&!Iz(e,f,s,v,y))continue;let b=!1;for(let w=0,C=i.length;w=4||e.src.charCodeAt(o)!==91)return!1;function a(w){const C=e.lineMax;if(w>=C||e.isEmpty(w))return null;let T=!1;if(e.sCount[w]-e.blkIndent>3&&(T=!0),e.sCount[w]<0&&(T=!0),!T){const S=e.parentType;e.parentType="reference";let _=!1;for(let x=0,E=l.length;x"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:y,href:f}),e.line=r),!0):!1}function $3(e){switch(e){case 9:case 32:return!0}return!1}const qde=65536;function P3(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Ude(e,t){if(e.lineFlags)return(e.lineFlags[t]&Dg.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!$3(l)||r===45&&$3(l)||!Ude(e,t))return!1;for(;s=4)return!1;u=ET(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let C=0;C=4||(u=ET(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=d-u.length,w>qde))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=b=[t+2,0]}const T=e.push("tr_open","tr",1);T.map=[o,o+1];for(let N=0;Nr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return o1(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const I2=[["table",Vde,["paragraph","reference"]],["code",Tde],["fence",Ede,["paragraph","reference","blockquote","list"]],["blockquote",Ide,["paragraph","reference","blockquote","list"]],["hr",Dde,["paragraph","reference","blockquote","list"]],["list",jde,["paragraph","reference","blockquote"]],["reference",Wde],["html_block",Fde,["paragraph","reference","blockquote"]],["heading",Lde,["paragraph","reference","blockquote"]],["lheading",Ode],["paragraph",Hde]];var Zde=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Kde;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new _z(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Ez=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};Ez.prototype.Token=Ts;const LT=[["normalize",fde],["block",kce],["inline",ide],["linkify",ude],["replacements",kde],["smartquotes",Ade],["text_join",xde]],Gde={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Qde={parseLinkLabel:Z6,parseLinkDestination:K6,parseLinkTitle:G6};function Yde(){return{...Gde}}function Jde(){return{...Qde}}var Xde=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Zde,this.inline=new nde,this.ruler=new bde;for(let e=0;e@[\]\\^_`{}~]/;function q9(e){return!efe.test(e)}function sg(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function Ey(e,t,n){for(let i=t;i3)return q9(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!q9(c))return!1;const d=nfe[s],f=ife[s],h=ga("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(X6(c,o,1));const m=ga("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function sfe(e,t,n){const i=ga("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(X6(t,n,1)),e.push(ga("paragraph_close","p",-1,0))}function rfe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function W3(e,t){for(;t=1e5?DT:H3,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,FT=/[&<>"]/g,hfe=/&/g,pfe=/[<>"]/g,mfe={"&":"&","<":"<",">":">",'"':"""};function q3(e){return mfe[e]||e}function Ui(e){if(e.length===0)return"";if(e.length<32)return ffe.test(e)?e.replace(FT,q3):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(hfe,"&"):t?e.replace(FT,q3):e.replace(pfe,q3)}const gfe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),vfe=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Lz(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(gfe,(t,n,i)=>{if(n)return n;if(vfe.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return Ik(s)?_0(s):"�"}const o=$6(t);return o!==t?o:t})}const yfe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,kfe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,bfe=/"/g;function Pp(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function U9(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!U9(e,t,Pp(e,t))}function BT(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=e7(e.slice(s,r));return a===null?null:`${a} +`}function RT(e,t,n){return t+1" `;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
  • ${e[t]}
  • -`}function _fe(e,t,n){const i=t+2;if(n===i+1)return Sfe(e,i);const o=t7(e.slice(t+2,n));return o===null?null:`
  • ${o}
  • -`}function Mfe(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
    ",i.lang=s,i.open=d),{html:`${d}${Ui(c)}
    -`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n -`;C -`,l=y,a=b}let w=E2(e,v);for(;w${v}

    -`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=Ny(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Dfe(r,o.maxChunks)),Dy(t,r))return R3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),i1(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return R3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),i1(n,s,()=>{for(let u=0;u=3&&(c?c.marker===w&&T>=c.length&&(c=null):c={marker:w,length:T})}}const v=m-f;o+=v,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=v);const y=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(y)d(m);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),w=Math.max(t.maxChunkChars,8e3);(a>=b||u>=w)&&d(m)}f=m}return n&&d(e.length),i}function Dy(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Nfe(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Hc(e){return e.length===0?0:Oo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function zfe(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function Hfe(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return zfe(e,n+1,e.length-1)?!jfe(e,t):!1}function Wfe(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??$fe:e.options.fullChunkSizeChars??Bfe),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Ofe:e.options.fullChunkSizeLines??Rfe);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var yv=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Hc(this.pending);if(this.pending.length=i||n>=o}function $z(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Dz))return"yes";const i=e.options.autoUnboundedThresholdLines??Fz;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new yv(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){Bz(s,l)}});if(o&&V6(n,o),r.feed(t),r.flushForce(n),o&&(K6(n),i.fallbackOnGlobalState===!1)){const l=ec(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const s1=(e,t,n)=>en?n:e;function Oz(e){return e.experimental?{...e,...e.experimental}:e}const OT=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],PT=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function Pz(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Zfe(e,t=Math.max(0,e/40|0),n={}){const i=Oz(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:s1(Math.ceil(e/s),8e3,64e3),maxChunkLines:s1(Math.ceil(t/s),150,700),maxChunks:s1(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function zT(e,t=Math.max(0,e/40|0),n={}){const i=Oz(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:s1(Math.ceil(e/s),8e3,64e3),maxChunkLines:s1(Math.ceil(t/s),150,700),maxChunks:s1(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var Gfe={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},Qfe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Yfe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Lk(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Fy(e,t){if(Lk(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const jT=e=>Lk(e)?e:Promise.resolve(e);function $g(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Ui(e)}}function $d(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${$g(t[0])}="${Ui(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${o} +`}function _fe(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
    ",i.lang=s,i.open=d),{html:`${d}${Ui(c)}
    +`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n +`;C +`,l=y,a=b}let w=T2(e,v);for(;w${v}

    +`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=Ly(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Nfe(r,o.maxChunks)),Ny(t,r))return B3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),i1(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return B3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),i1(n,s,()=>{for(let u=0;u=3&&(c?c.marker===w&&T>=c.length&&(c=null):c={marker:w,length:T})}}const v=m-f;o+=v,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=v);const y=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(y)d(m);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),w=Math.max(t.maxChunkChars,8e3);(a>=b||u>=w)&&d(m)}f=m}return n&&d(e.length),i}function Ny(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Lfe(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Hc(e){return e.length===0?0:Po(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Pfe(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function jfe(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return Pfe(e,n+1,e.length-1)?!zfe(e,t):!1}function Hfe(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??Rfe:e.options.fullChunkSizeChars??Ffe),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Ofe:e.options.fullChunkSizeLines??Bfe);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var vv=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Hc(this.pending);if(this.pending.length=i||n>=o}function Oz(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Dz))return"yes";const i=e.options.autoUnboundedThresholdLines??Fz;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new vv(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){Bz(s,l)}});if(o&&U6(n,o),r.feed(t),r.flushForce(n),o&&(V6(n),i.fallbackOnGlobalState===!1)){const l=tc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const s1=(e,t,n)=>en?n:e;function $z(e){return e.experimental?{...e,...e.experimental}:e}const PT=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],zT=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function Pz(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Kfe(e,t=Math.max(0,e/40|0),n={}){const i=$z(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:s1(Math.ceil(e/s),8e3,64e3),maxChunkLines:s1(Math.ceil(t/s),150,700),maxChunks:s1(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function jT(e,t=Math.max(0,e/40|0),n={}){const i=$z(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:s1(Math.ceil(e/s),8e3,64e3),maxChunkLines:s1(Math.ceil(t/s),150,700),maxChunks:s1(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var Zfe={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},Gfe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Qfe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Ek(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Dy(e,t){if(Ek(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const HT=e=>Ek(e)?e:Promise.resolve(e);function Bg(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Ui(e)}}function Od(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Bg(t[0])}="${Ui(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} -`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
    ${t}
    -`}return`
    ${t}
    -`}function T0(e){return!e.attrs||e.attrs.length===0?`${Ui(e.content)}`:`${Ui(e.content)}`}function lC(e){const t=Ui(e.content);return e.attrs?`${t} +`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
    ${t}
    +`}return`
    ${t}
    +`}function I0(e){return!e.attrs||e.attrs.length===0?`${Ui(e.content)}`:`${Ui(e.content)}`}function rC(e){const t=Ui(e.content);return e.attrs?`${t} `:`
    ${t}
    -`}function Jfe(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

    `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function HT(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function Xfe(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function WT(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function Z9(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const ehe={langPrefix:"language-",xhtmlOut:!1,breaks:!1},L2=Object.prototype.hasOwnProperty,Si={code_inline(e,t){return T0(e[t])},code_block(e,t){return lC(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?Lz(s.info).trim():"",{langName:l,langAttrs:a}=zz(r),u=n.highlight,c=Ui(s.content);if(!u)return Og(s,c,r,l,n);const d=u(s.content,l,a);return Lk(d)?d.then(f=>Og(s,f||c,r,l,n)):Og(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],Z9(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
    +`}function Yfe(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

    `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function WT(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function Jfe(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function qT(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function K9(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const Xfe={langPrefix:"language-",xhtmlOut:!1,breaks:!1},E2=Object.prototype.hasOwnProperty,Ai={code_inline(e,t){return I0(e[t])},code_block(e,t){return rC(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?Lz(s.info).trim():"",{langName:l,langAttrs:a}=zz(r),u=n.highlight,c=Ui(s.content);if(!u)return Rg(s,c,r,l,n);const d=u(s.content,l,a);return Ek(d)?d.then(f=>Rg(s,f||c,r,l,n)):Rg(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],K9(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
    `:`
    `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
    `:`
    `:` -`},text(e,t){return Ui(e[t].content)},text_special(e,t){return Ui(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function qT(e,t,n){const i=e.info?Lz(e.info).trim():"",{langName:o,langAttrs:s}=zz(i),r=t.highlight,l=Ui(e.content);if(!r)return Og(e,l,i,o,t);const a=r(e.content,o,s);if(Lk(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Og(e,a||l,i,o,t)}function V3(e,t,n,i){switch(e.type){case"text":return t.text===Si.text?e.content.length===0?"":Ui(e.content):null;case"text_special":return t.text_special===Si.text_special?e.content.length===0?"":Ui(e.content):null;case"softbreak":return t.softbreak===Si.softbreak?i:null;case"hardbreak":return t.hardbreak===Si.hardbreak?n:null;case"html_inline":return t.html_inline===Si.html_inline?e.content:null;case"code_inline":return t.code_inline===Si.code_inline?T0(e):null;default:return null}}function the(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===Si.text)return s.content.length===0?"":Ui(s.content);break;case"text_special":if(o.text_special===Si.text_special)return s.content.length===0?"":Ui(s.content);break;case"softbreak":if(o.softbreak===Si.softbreak)return t.breaks?t.xhtmlOut?`
    +`},text(e,t){return Ui(e[t].content)},text_special(e,t){return Ui(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function UT(e,t,n){const i=e.info?Lz(e.info).trim():"",{langName:o,langAttrs:s}=zz(i),r=t.highlight,l=Ui(e.content);if(!r)return Rg(e,l,i,o,t);const a=r(e.content,o,s);if(Ek(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Rg(e,a||l,i,o,t)}function U3(e,t,n,i){switch(e.type){case"text":return t.text===Ai.text?e.content.length===0?"":Ui(e.content):null;case"text_special":return t.text_special===Ai.text_special?e.content.length===0?"":Ui(e.content):null;case"softbreak":return t.softbreak===Ai.softbreak?i:null;case"hardbreak":return t.hardbreak===Ai.hardbreak?n:null;case"html_inline":return t.html_inline===Ai.html_inline?e.content:null;case"code_inline":return t.code_inline===Ai.code_inline?I0(e):null;default:return null}}function ehe(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===Ai.text)return s.content.length===0?"":Ui(s.content);break;case"text_special":if(o.text_special===Ai.text_special)return s.content.length===0?"":Ui(s.content);break;case"softbreak":if(o.softbreak===Ai.softbreak)return t.breaks?t.xhtmlOut?`
    `:`
    `:` -`;break;case"hardbreak":if(o.hardbreak===Si.hardbreak)return t.xhtmlOut?`
    +`;break;case"hardbreak":if(o.hardbreak===Ai.hardbreak)return t.xhtmlOut?`
    `:`
    -`;break;case"html_inline":if(o.html_inline===Si.html_inline)return s.content;break;case"code_inline":if(o.code_inline===Si.code_inline)return T0(s);break}const r=o[s.type];if(!r)return Z9(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:Fy(l,s.type)}var nhe=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Si}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,v="";for(let y=0;y0&&e[y-1].hidden?` -`:"";if(w==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&y+3${this.renderInlineTokens(S.children||[],i,o)}`,y+=3;continue}}if(y+2 +`;break;case"html_inline":if(o.html_inline===Ai.html_inline)return s.content;break;case"code_inline":if(o.code_inline===Ai.code_inline)return I0(s);break}const r=o[s.type];if(!r)return K9(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:Dy(l,s.type)}var the=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Ai}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,v="";for(let y=0;y0&&e[y-1].hidden?` +`:"";if(w==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&y+3${this.renderInlineTokens(S.children||[],i,o)}`,y+=3;continue}}if(y+2 `,y+=2;continue}}}if(w==="inline"){const I=b.children||[];if(I.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
    `:`
    `,m=i.breaks?h:` -`,g=!0);const S=I[0];switch(S.type){case"text":if(l===Si.text){v+=Ui(S.content);continue}break;case"text_special":if(a===Si.text_special){v+=Ui(S.content);continue}break;case"softbreak":if(u===Si.softbreak){v+=m;continue}break;case"hardbreak":if(c===Si.hardbreak){v+=h;continue}break;case"html_inline":if(d===Si.html_inline){v+=S.content;continue}break;case"code_inline":if(f===Si.code_inline){v+=T0(S);continue}break}}v+=this.renderInlineTokens(I,i,o);continue}const T=s[w];if(!T){const I=b.attrs;if(!b.hidden){if(!I||I.length===0)switch(w){case"hr":v+=r?`


    +`,g=!0);const S=I[0];switch(S.type){case"text":if(l===Ai.text){v+=Ui(S.content);continue}break;case"text_special":if(a===Ai.text_special){v+=Ui(S.content);continue}break;case"softbreak":if(u===Ai.softbreak){v+=m;continue}break;case"hardbreak":if(c===Ai.hardbreak){v+=h;continue}break;case"html_inline":if(d===Ai.html_inline){v+=S.content;continue}break;case"code_inline":if(f===Ai.code_inline){v+=I0(S);continue}break}}v+=this.renderInlineTokens(I,i,o);continue}const T=s[w];if(!T){const I=b.attrs;if(!b.hidden){if(!I||I.length===0)switch(w){case"hr":v+=r?`
    `:`
    `;continue;case"heading_open":v+=`<${b.tag}>`;continue;case"heading_close":v+=` `;continue;case"paragraph_open":v+=`${C}

    `;continue;case"paragraph_close":v+=`

    @@ -107,122 +107,122 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK `;continue;case"td_open":v+=`${C}`;continue;case"td_close":v+=` `;continue;case"th_open":v+=`${C}`;continue;case"th_close":v+=` `;continue}else if(I.length===1){const S=I[0];if(w==="ordered_list_open"&&S[0]==="start"){v+=`${C}
      -`;continue}if(w==="td_open"&&S[0]==="style"){v+=`${C}`;continue}if(w==="th_open"&&S[0]==="style"){v+=`${C}`;continue}}}v+=this.renderToken(e,y,i);continue}if(w==="code_block"&&T===Si.code_block){v+=lC(b);continue}if(w==="fence"&&T===Si.fence){v+=qT(b,i);continue}if(w==="html_block"&&T===Si.html_block){v+=b.content;continue}const N=T(e,y,i,o,this);typeof N=="string"?v+=N:v+=Fy(N,b.type)}return v}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` +`;continue}if(w==="td_open"&&S[0]==="style"){v+=`${C}`;continue}if(w==="th_open"&&S[0]==="style"){v+=`${C}`;continue}}}v+=this.renderToken(e,y,i);continue}if(w==="code_block"&&T===Ai.code_block){v+=rC(b);continue}if(w==="fence"&&T===Ai.fence){v+=UT(b,i);continue}if(w==="html_block"&&T===Ai.html_block){v+=b.content;continue}const N=T(e,y,i,o,this);typeof N=="string"?v+=N:v+=Dy(N,b.type)}return v}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` `:"",c=a?`> -`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(L2.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),L2.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(L2.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(L2.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...ehe,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===Si.code_block)return lC(t);if(s==="html_block"&&o.html_block===Si.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):Z9(t,r.xhtmlOut===!0);if(s==="fence"&&a===Si.fence)return qT(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:Fy(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return the(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
      +`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(E2.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),E2.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(E2.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(E2.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...Xfe,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===Ai.code_block)return rC(t);if(s==="html_block"&&o.html_block===Ai.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):K9(t,r.xhtmlOut===!0);if(s==="fence"&&a===Ai.fence)return UT(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:Dy(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return ehe(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
      `:`
      `,r=t.breaks?s:` -`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,v=i.em_close,y=i.strong_open,b=i.strong_close;let w="";for(let C=0;C`;if(u===Si.softbreak&&C+3`,C+=1;continue}if(T.type==="em_open"&&!g&&!v&&C+2${_}`,C+=2;continue}}}if(T.type==="strong_open"&&!y&&!b&&C+2${_}`,C+=2;continue}}}switch(T.type){case"text":if(l===Si.text){const S=T.content.length===0?"":Ui(T.content);if(d===Si.html_inline&&C+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=ue,!G&&se!==void 0&&(fe=Oo(e),G=fe>=se)),G){const K=this.parseFullDocument(e,R,n,fe,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!ec(R)?.unbounded}),K.tokens}else if(P){const K=(ye,Ae,_e)=>ye_e?_e:ye;fe===void 0&&(fe=Oo(e));const re=te&&!Q?zT(e.length,fe,n.options):null,be=re?.maxChunkChars??(H?K(Math.ceil(e.length/j),8e3,64e3):Z??1e4),ke=re?.maxChunkLines??(H?K(Math.ceil(fe/j),150,700):ie??200),we=re?.maxChunks??(H?K(Math.ceil(e.length/64e3),j,32):W),oe=e.length>0&&e.charCodeAt(e.length-1)===10,le=B&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&re?.strategy!=="plain";if((O||le)&&(e.length>=be*2||fe>=ke*2)&&oe){const ye=K9(n,e,R,{maxChunkChars:be,maxChunkLines:ke,fenceAware:re?.fenceAware??X,maxChunks:we});return this.cache={src:e,tokens:ye,env:R,lineCount:fe,lastSegment:void 0,globalStateReason:il(e)},this.updateCacheLineCount(this.cache,fe),this.recordChunkedParseResult(R,O?"explicit-initial-large-doc":"default-initial-large-doc"),ye}}const ae=this.parseFullDocument(e,R,n,fe);return fe=ae.lineCount,this.cache={src:e,tokens:ae.tokens,env:R,lineCount:fe,lastSegment:void 0,globalStateReason:il(e)},this.updateCacheLineCount(this.cache,fe),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!ec(R)?.unbounded}),ae.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",is(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=il(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):il(e),a=r||l;if(a){const R=i??o.env;xc(R);const q=il(e),z=this.parseFullDocument(e,R,n),O=z.tokens,B=z.lineCount;return this.cache={src:e,tokens:O,env:R,lineCount:B,lastSegment:void 0,globalStateReason:q},this.updateCacheLineCount(this.cache,B),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(R,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!ec(R)?.unbounded}),O}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?q=8:c.length>1e3?q=6:c.length>200&&(q=4),q=Math.min(q,R);let z=null;const O=n.options?.streamContextParseStrategy??"chars",B=n.options?.streamContextParseMinChars??200,P=n.options?.streamContextParseMinLines??2;let H;const j=()=>(H===void 0&&(H=Oo(c)),H),Z=this.canDirectlyParseAppend(o),ie=Z&&this.shouldUseUnboundedAppend(e,o,c);let W=!1;if(!Z)switch(O){case"lines":W=j()>=P;break;case"constructs":if(c.length>=B){W=!0;break}if(she(c)){W=!0;break}W=j()>=P;break;case"chars":default:W=c.length>=B}if(q>0&&W){const X=this.getTailLines(o.src,q)+c;try{const ge=this.core.parse(X,o.env,n).tokens,ue=ge.findIndex(se=>se.map&&typeof se.map[1]=="number"&&se.map[1]>q);if(ue!==-1){const se=ge.slice(ue),fe=R-q;fe!==0&&this.shiftTokenLines(se,fe),z={tokens:se}}}catch{z=null}}else z=null;if(!z){const X=R;if(ie)z={tokens:Rg(n,c,o.env,{mode:"stream"})},X>0&&this.shiftTokenLines(z.tokens,X);else{const ge=this.core.parse(c,o.env,n);X>0&&this.shiftTokenLines(ge.tokens,X),z=ge}}let Q=0;if(o.tokens.length>0&&z.tokens.length>0){const X=o.tokens[o.tokens.length-1],ge=z.tokens[0];try{X.type==="inline"&&ge.type==="inline"&&(ge.children&&ge.children.length>0&&(X.children||(X.children=[]),this.appendTokens(X.children,ge.children)),X.content=(X.content||"")+(ge.content||""),Q=1)}catch{Q=0}}const te=o.tokens.length;if(z.tokens.length>Q){const X=o.tokens,ge=z.tokens,ue=Math.min(X.length,ge.length-Q);let se=0;for(let fe=ue;fe>0;fe--){let G=!0;for(let ae=0;ae0&&(Q+=se),ge.length>Q&&this.appendTokens(o.tokens,ge,Q)}if(o.src=e,o.globalStateReason=null,o.lineCount=R+(H??j()),o.tokens.length>te){const X=this.getLastSegment(o.tokens,e,te,o.tokens.length,e.length-c.length,R);X?o.lastSegment=X:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ie&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",is(o.env,{area:"stream",path:ie?"stream-unbounded-append":"stream-append",reason:ie?"large-delta":"safe-append",unbounded:ie}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",is(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,v=!h&&!c&&m,y=g||v,b=n.options?.streamChunkAdaptive!==!1,w=n.options?.streamChunkTargetChunks??8,C=n.options?.streamChunkSizeChars,T=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,_=n.options?.streamChunkFenceAware??!0;let x=c&&o.lineCount!==void 0?o.lineCount+Oo(c):void 0;if(y){x===void 0&&(x=Oo(e));const R=(j,Z,ie)=>jie?ie:j,q=S&&!I?zT(e.length,x,n.options):null,z=q?.maxChunkChars??(b?R(Math.ceil(e.length/w),8e3,64e3):C??1e4),O=q?.maxChunkLines??(b?R(Math.ceil(x/w),150,700):T??200),B=q?.maxChunks??(b?R(Math.ceil(e.length/64e3),w,32):N),P=e.length>0&&e.charCodeAt(e.length-1)===10,H=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&q?.strategy!=="plain";if((g||H)&&(e.length>=z*2||x>=O*2)&&P){const j=K9(n,e,d,{maxChunkChars:z,maxChunkLines:O,fenceAware:q?.fenceAware??_,maxChunks:B});return this.cache={src:e,tokens:j,env:d,lineCount:x,lastSegment:void 0,globalStateReason:il(e)},this.updateCacheLineCount(this.cache,x),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),j}}const E=this.parseFullDocument(e,d,n,x),M=E.tokens;return x=E.lineCount,this.cache={src:e,tokens:M,env:d,lineCount:x,lastSegment:void 0,globalStateReason:il(e)},this.updateCacheLineCount(this.cache,x),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!ec(d)?.unbounded}),M}recordChunkedParseResult(e,t){const n=ec(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",is(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!ec(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",is(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=il(e);gv(t)&&xc(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?$z(n,e.length,i):"no";if(r==="yes"){const a=Rg(n,e,t);return is(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?Oo(e):0)}}let l=i;if(r==="need-lines"&&(l=Oo(e),Rz(n,e.length,l))){const a=Rg(n,e,t);return is(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Oo(e):0),{tokens:i1(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:Oo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` +`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,v=i.em_close,y=i.strong_open,b=i.strong_close;let w="";for(let C=0;C`;if(u===Ai.softbreak&&C+3`,C+=1;continue}if(T.type==="em_open"&&!g&&!v&&C+2${_}`,C+=2;continue}}}if(T.type==="strong_open"&&!y&&!b&&C+2${_}`,C+=2;continue}}}switch(T.type){case"text":if(l===Ai.text){const S=T.content.length===0?"":Ui(T.content);if(d===Ai.html_inline&&C+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=ce,!Z&&se!==void 0&&(pe=Po(e),Z=pe>=se)),Z){const K=this.parseFullDocument(e,R,n,pe,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!tc(R)?.unbounded}),K.tokens}else if(P){const K=(ye,Ae,Me)=>yeMe?Me:ye;pe===void 0&&(pe=Po(e));const re=te&&!Q?jT(e.length,pe,n.options):null,we=re?.maxChunkChars??(H?K(Math.ceil(e.length/j),8e3,64e3):G??1e4),be=re?.maxChunkLines??(H?K(Math.ceil(pe/j),150,700):ne??200),ke=re?.maxChunks??(H?K(Math.ceil(e.length/64e3),j,32):W),oe=e.length>0&&e.charCodeAt(e.length-1)===10,le=B&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&re?.strategy!=="plain";if(($||le)&&(e.length>=we*2||pe>=be*2)&&oe){const ye=V9(n,e,R,{maxChunkChars:we,maxChunkLines:be,fenceAware:re?.fenceAware??X,maxChunks:ke});return this.cache={src:e,tokens:ye,env:R,lineCount:pe,lastSegment:void 0,globalStateReason:ol(e)},this.updateCacheLineCount(this.cache,pe),this.recordChunkedParseResult(R,$?"explicit-initial-large-doc":"default-initial-large-doc"),ye}}const ae=this.parseFullDocument(e,R,n,pe);return pe=ae.lineCount,this.cache={src:e,tokens:ae.tokens,env:R,lineCount:pe,lastSegment:void 0,globalStateReason:ol(e)},this.updateCacheLineCount(this.cache,pe),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!tc(R)?.unbounded}),ae.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ns(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=ol(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):ol(e),a=r||l;if(a){const R=i??o.env;Sc(R);const q=ol(e),z=this.parseFullDocument(e,R,n),$=z.tokens,B=z.lineCount;return this.cache={src:e,tokens:$,env:R,lineCount:B,lastSegment:void 0,globalStateReason:q},this.updateCacheLineCount(this.cache,B),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(R,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!tc(R)?.unbounded}),$}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?q=8:c.length>1e3?q=6:c.length>200&&(q=4),q=Math.min(q,R);let z=null;const $=n.options?.streamContextParseStrategy??"chars",B=n.options?.streamContextParseMinChars??200,P=n.options?.streamContextParseMinLines??2;let H;const j=()=>(H===void 0&&(H=Po(c)),H),G=this.canDirectlyParseAppend(o),ne=G&&this.shouldUseUnboundedAppend(e,o,c);let W=!1;if(!G)switch($){case"lines":W=j()>=P;break;case"constructs":if(c.length>=B){W=!0;break}if(ohe(c)){W=!0;break}W=j()>=P;break;case"chars":default:W=c.length>=B}if(q>0&&W){const X=this.getTailLines(o.src,q)+c;try{const ve=this.core.parse(X,o.env,n).tokens,ce=ve.findIndex(se=>se.map&&typeof se.map[1]=="number"&&se.map[1]>q);if(ce!==-1){const se=ve.slice(ce),pe=R-q;pe!==0&&this.shiftTokenLines(se,pe),z={tokens:se}}}catch{z=null}}else z=null;if(!z){const X=R;if(ne)z={tokens:Fg(n,c,o.env,{mode:"stream"})},X>0&&this.shiftTokenLines(z.tokens,X);else{const ve=this.core.parse(c,o.env,n);X>0&&this.shiftTokenLines(ve.tokens,X),z=ve}}let Q=0;if(o.tokens.length>0&&z.tokens.length>0){const X=o.tokens[o.tokens.length-1],ve=z.tokens[0];try{X.type==="inline"&&ve.type==="inline"&&(ve.children&&ve.children.length>0&&(X.children||(X.children=[]),this.appendTokens(X.children,ve.children)),X.content=(X.content||"")+(ve.content||""),Q=1)}catch{Q=0}}const te=o.tokens.length;if(z.tokens.length>Q){const X=o.tokens,ve=z.tokens,ce=Math.min(X.length,ve.length-Q);let se=0;for(let pe=ce;pe>0;pe--){let Z=!0;for(let ae=0;ae0&&(Q+=se),ve.length>Q&&this.appendTokens(o.tokens,ve,Q)}if(o.src=e,o.globalStateReason=null,o.lineCount=R+(H??j()),o.tokens.length>te){const X=this.getLastSegment(o.tokens,e,te,o.tokens.length,e.length-c.length,R);X?o.lastSegment=X:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ne&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ns(o.env,{area:"stream",path:ne?"stream-unbounded-append":"stream-append",reason:ne?"large-delta":"safe-append",unbounded:ne}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ns(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,v=!h&&!c&&m,y=g||v,b=n.options?.streamChunkAdaptive!==!1,w=n.options?.streamChunkTargetChunks??8,C=n.options?.streamChunkSizeChars,T=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,_=n.options?.streamChunkFenceAware??!0;let x=c&&o.lineCount!==void 0?o.lineCount+Po(c):void 0;if(y){x===void 0&&(x=Po(e));const R=(j,G,ne)=>jne?ne:j,q=S&&!I?jT(e.length,x,n.options):null,z=q?.maxChunkChars??(b?R(Math.ceil(e.length/w),8e3,64e3):C??1e4),$=q?.maxChunkLines??(b?R(Math.ceil(x/w),150,700):T??200),B=q?.maxChunks??(b?R(Math.ceil(e.length/64e3),w,32):N),P=e.length>0&&e.charCodeAt(e.length-1)===10,H=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&q?.strategy!=="plain";if((g||H)&&(e.length>=z*2||x>=$*2)&&P){const j=V9(n,e,d,{maxChunkChars:z,maxChunkLines:$,fenceAware:q?.fenceAware??_,maxChunks:B});return this.cache={src:e,tokens:j,env:d,lineCount:x,lastSegment:void 0,globalStateReason:ol(e)},this.updateCacheLineCount(this.cache,x),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),j}}const E=this.parseFullDocument(e,d,n,x),M=E.tokens;return x=E.lineCount,this.cache={src:e,tokens:M,env:d,lineCount:x,lastSegment:void 0,globalStateReason:ol(e)},this.updateCacheLineCount(this.cache,x),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!tc(d)?.unbounded}),M}recordChunkedParseResult(e,t){const n=tc(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",ns(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!tc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ns(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=ol(e);mv(t)&&Sc(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?Oz(n,e.length,i):"no";if(r==="yes"){const a=Fg(n,e,t);return ns(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?Po(e):0)}}let l=i;if(r==="need-lines"&&(l=Po(e),Rz(n,e.length,l))){const a=Fg(n,e,t);return ns(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Po(e):0),{tokens:i1(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:Po(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` `))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` -`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+Oo(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` -`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??ohe}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;oK3?n.slice(n.length-K3):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` +`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+Po(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` +`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??ihe}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;oV3?n.slice(n.length-V3):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` `,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` -`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+Oo(s);t.lineCount=g;const v=this.getDocLineCount(e,g);return r.map&&(r.map[1]=v),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const v=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,y=t.lineCount??Oo(t.src);t.tokens.splice(v,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const b=y+Oo(s);t.lineCount=b;const w=this.getDocLineCount(e,b);if(r.map&&(r.map[1]=w),h.tbodyOpenIndex>=0){const C=t.tokens[h.tbodyOpenIndex];C?.map&&(C.map[1]=w)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:w,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` +`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+Po(s);t.lineCount=g;const v=this.getDocLineCount(e,g);return r.map&&(r.map[1]=v),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const v=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,y=t.lineCount??Po(t.src);t.tokens.splice(v,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const b=y+Po(s);t.lineCount=b;const w=this.getDocLineCount(e,b);if(r.map&&(r.map[1]=w),h.tbodyOpenIndex>=0){const C=t.tokens[h.tbodyOpenIndex];C?.map&&(C.map[1]=w)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:w,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` `);if(t<0)return null;const n=e.indexOf(` -`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=Oo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const VT={default:Qfe,zero:Yfe,commonmark:Gfe};function uhe(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function che(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function KT(e){return e.experimental?{...e,...e.experimental}:e}function ia(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function ZT(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=ZT(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=ZT(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=GT(s?.options,o,"fullChunkedFallback"),u=GT(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new efe;let m=null;const g=()=>(m||(m=new ihe(n)),m);let v=null;const y=()=>(v||(v=new ahe(h)),v);let b=null;const w=()=>(b||(b=new KP({fuzzyLink:!0})),b),C=S=>!c&&!!d&&!che(S,d),T=(S,_)=>i==="default"&&!c&&m===null&&f!==null&&S.parse===f&&C(S)&&!S.stream.enabled&&_<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.xhtmlOut===!1&&S.options.breaks===!1&&S.options.langPrefix==="language-"&&S.options.linkify===!1&&S.options.typographer===!1&&S.options.highlight===null,N=(S,_)=>i==="default"&&!c&&C(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&_<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,I={core:h,block:h.block,inline:h.inline,get linkify(){const S=w();return Object.defineProperty(this,"linkify",{value:S,writable:!0,configurable:!0}),S},get renderer(){const S=g();return Object.defineProperty(this,"renderer",{value:S,writable:!0,configurable:!0}),S},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return C(this)},set(S){const _=KT(S);return this.options={...this.options,..._},(ia(S,"fullChunkSizeChars")||ia(S,"fullChunkSizeLines")||ia(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ia(S,"streamChunkSizeChars")||ia(S,"streamChunkSizeLines")||ia(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ia(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ia(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(_),typeof _.stream=="boolean"&&(this.stream.enabled=_.stream,v&&(v.reset(),v.resetStats())),this},configure(S){const _=typeof S=="string"?VT[S]:S;if(!_)throw new Error("Wrong `markdown-it` preset, can't be empty");if(_.options&&this.set(_.options),_.components){const x=_.components;x.core?.rules&&this.core.ruler.enableOnly(x.core.rules),x.block?.rules&&this.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&this.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&this.inline.ruler2.enableOnly(x.inline2.rules)}return this},enable(S,_){const x=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const R of E){if(!R)continue;const q=R.enable(x,!0);for(let z=0;z!M.has(q));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},disable(S,_){const x=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const R of E){if(!R)continue;const q=R.disable(x,!0);for(let z=0;z!M.has(q));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},use(S,..._){const x=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!x)throw new TypeError("MarkdownIt.use: plugin must be a function");const E=[this,..._],M=S;return c=!0,x.apply(M,E),this},render(S,_){let x;if(T(this,S.length)){_!==void 0&&(Rr(_),x=B3("render"));const R=x?hp():0,q=x?$T(S,x):RT(S);if(x&&(x.attemptMs=hp()-R,q===null&&(x.fallbackReason="unsupported-stock-subset"),$m(_,x)),q!==null)return _!==void 0&&is(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),q}const E=_??{},M=this.parse(S,E);return x&&$m(E,x),g().render(M,this.options,E)},async renderAsync(S,_){let x;if(T(this,S.length)){_!==void 0&&(Rr(_),x=B3("render"));const R=x?hp():0,q=x?$T(S,x):RT(S);if(x&&(x.attemptMs=hp()-R,q===null&&(x.fallbackReason="unsupported-stock-subset"),$m(_,x)),q!==null)return _!==void 0&&is(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),q}const E=_??{},M=this.parse(S,E);return x&&$m(E,x),g().renderAsync(M,this.options,E)},renderIterable(S,_={}){const x=this.parseIterable(S,_);return g().render(x,this.options,_)},async renderAsyncIterable(S,_={}){const x=await this.parseAsyncIterable(S,_);return g().renderAsync(x,this.options,_)},renderInline(S,_={}){const x=this.parseInline(S,_);return g().render(x,this.options,_)},validateLink:Az,normalizeLink:xz,normalizeLinkText:Sz,utils:Eue,helpers:{...yce},parse(S,_){if(typeof S!="string")throw new TypeError("Input data should be a String");if(_!==void 0&&Rr(_),N(this,S.length)){const R=_===void 0?void 0:B3("parse"),q=R?hp():0,z=ffe(S,R);if(R&&(R.attemptMs=hp()-q,z===null&&(R.fallbackReason="unsupported-stock-subset"),$m(_,R)),z!==null)return _!==void 0&&is(_,{area:"parse",path:"stock-fast",reason:"stock-subset"}),z}const x=_??{};let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&C(this)){const R=$z(this,S.length);if(R==="yes"){const q=Rg(this,S,x);return is(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),q}R==="need-lines"&&(E=Oo(S))}if(!this.stream.enabled){const R=S.length,q=this.options.autoTuneChunks!==!1,z=r,O=!a&&C(this),B=!!this.options.fullChunkedFallback,P=O&&R>=2e5;let H;(B||P||E!==void 0)&&(H=E??Oo(S));const j=(B||P)&&q&&!z?Zfe(R,H,this.options):null;if(B||P){const Z=H??0;if(B?R>=(this.options.fullChunkThresholdChars??2e4)||Z>=(this.options.fullChunkThresholdLines??400):P){if(j&&j.strategy!=="plain"){const ie=K9(this,S,x,{maxChunkChars:j.maxChunkChars,maxChunkLines:j.maxChunkLines,fenceAware:j.fenceAware,maxChunks:j.maxChunks});return _&&QT(_,B?"explicit-full-chunk":"default-large-string"),ie}if(B){const ie=(G,ae,K)=>GK?K:G,W=this.options.fullChunkAdaptive!==!1,Q=this.options.fullChunkTargetChunks??8,te=ie(Math.ceil(R/Q),8e3,64e3),X=ie(Math.ceil(Z/Q),150,700),ge=W?te:this.options.fullChunkSizeChars??1e4,ue=W?X:this.options.fullChunkSizeLines??200,se=W?ie(Math.ceil(R/64e3),Q,32):this.options.fullChunkMaxChunks,fe=K9(this,S,x,{maxChunkChars:ge,maxChunkLines:ue,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:se});return _&&QT(_,"explicit-full-chunk"),fe}}}if(E!==void 0&&C(this)&&Rz(this,R,H??E)){const Z=Rg(this,S,x);return is(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),Z}}const M=il(S);return is(_,{area:"parse",path:"plain",reason:"default-plain"}),i1(x,M,()=>h.parse(S,x,this).tokens)},parseIterable(S,_={}){return Rr(_),qfe(this,S,_)},parseAsyncIterable(S,_={}){return Rr(_),Ufe(this,S,_)},parseIterableToSink(S,_,x={}){return Rr(x),Vfe(this,S,_,x)},parseAsyncIterableToSink(S,_,x={}){return Rr(x),Kfe(this,S,_,x)},parseInline(S,_={}){if(typeof S!="string")throw new TypeError("Input data should be a String");Rr(_),gv(_)&&xc(_);const x=h.createState(S,_,this);return x.inlineMode=!0,h.process(x),x.tokens}};if(I.stream={enabled:!!n.stream,parse(S,_){return I.stream.enabled?y().parse(S,_,I):I.parse(S,_??{})},reset(){y().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},s?.components){const S=s.components;S.core?.rules&&I.core.ruler.enableOnly(S.core.rules),S.block?.rules&&I.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&I.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&I.inline.ruler2.enableOnly(S.inline2.rules)}return d=uhe(I),f=I.parse,I}var fhe=dhe;const Hz=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],hhe=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],Wz=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],phe=["svg","g","path"],mhe=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],ghe=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],vhe=["action","data","href","src","srcset","poster","xlink:href","formaction"],yhe=["script"],khe=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Od=new Set(Hz),qz=new Set(Wz),E0=new Set([...Hz,...hhe,...Wz,...phe]),Uz=new Set([...E0,...mhe]),bhe=new Set(ghe),whe=new Set(vhe),kv=new Set(yhe),Vz=new Set(khe);function Kz(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const Che={amp:"&",bsol:"\\",colon:":",newline:` -`,sol:"/",tab:" "};function Zz(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return Che[String(o??"").toLowerCase()]??t})}const N2=new Set(["http","https","mailto","tel"]),Ahe=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Mf=new Set(["http","https"]);function Gz(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const xhe=/^https?:\/\//i;function She(e){if(!xhe.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function _he(e,t,n){if(!Pg(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function Pg(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function Mhe(e,t){return t==="href"||t==="xlink:href"?Pg(e,t)?N2:Mf:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Mf:(Pg(e,t),N2)}function hh(e,t={}){if(She(e))return!1;const n=Kz(Zz(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=Gz(n);return s?s==="file"?!_he(n,i,o):Pg(i,o)?Ahe.has(s):!Mhe(i,o).has(s):!1}function Ihe(e){const t=Zz(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Gz(Kz(t).toLowerCase());return n==="http"||n==="https"}function The(e,t={}){const n=String(e??"").trim();return n?hh(n,t)?"":n:""}function YT(e){return The(e,{tagName:"img",attrName:"src"})}function Ehe(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,v){return f[h].nesting===1&&f[h].attrJoin("class",t),v.renderToken(f,h,m,g,v)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let v,y=!1,b=f.bMarks[h]+f.tShift[h],w=f.eMarks[h];if(l!==f.src.charCodeAt(b))return!1;for(v=b+1;v<=w&&r[(v-b)%a]===f.src[v];v++);const C=Math.floor((v-b)/a);if(C=m||(b=f.bMarks[I]+f.tShift[I],w=f.eMarks[I],b=4)){for(v=b+1;v<=w&&r[(v-b)%a]===f.src[v];v++);if(!(Math.floor((v-b)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&Qz(o.children,t,n)}}function Nhe(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(Ehe,t,{render(n,i){return n[i].nesting===1?`
      `:`
      -`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let N=0,I=-1;for(let S=0;S0&&(h=g.slice(0,I))}h||(f=d||void 0)}if(o)return!0;const v=!!s.env.__markstreamFinal;let y=n+1,b=!1;for(;y<=i;){const N=s.bMarks[y]+s.tShift[y],I=s.eMarks[y];if(s.src.slice(N,I).trim()===":::"){b=!0;break}y++}b||(y=i);const w=s.push("vmr_container_open","div",1);if(w.attrSet("class",`vmr-container vmr-container-${c}`),w.map=[n,b?y:i],w.meta={...w.meta??{},unclosed:!b&&!v},f&&w.attrSet("data-args",f),h)try{const N=JSON.parse(h);for(const[I,S]of Object.entries(N)){const _=S!=null&&typeof S=="object";w.attrSet(`data-${I}`,_?JSON.stringify(S):String(S))}}catch{const N=Lhe(h);if(N)for(const[I,S]of Object.entries(N)){const _=S!=null&&typeof S=="object";w.attrSet(`data-${I}`,_?JSON.stringify(S):String(S))}else w.attrSet("data-attrs",h)}const C=[];for(let N=n+1;NN.trim().length>0)){let N=C.join(` +`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=Po(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const KT={default:Gfe,zero:Qfe,commonmark:Zfe};function ahe(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function uhe(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function ZT(e){return e.experimental?{...e,...e.experimental}:e}function aa(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function GT(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=GT(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=GT(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=QT(s?.options,o,"fullChunkedFallback"),u=QT(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Xde;let m=null;const g=()=>(m||(m=new nhe(n)),m);let v=null;const y=()=>(v||(v=new lhe(h)),v);let b=null;const w=()=>(b||(b=new KP({fuzzyLink:!0})),b),C=S=>!c&&!!d&&!uhe(S,d),T=(S,_)=>i==="default"&&!c&&m===null&&f!==null&&S.parse===f&&C(S)&&!S.stream.enabled&&_<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.xhtmlOut===!1&&S.options.breaks===!1&&S.options.langPrefix==="language-"&&S.options.linkify===!1&&S.options.typographer===!1&&S.options.highlight===null,N=(S,_)=>i==="default"&&!c&&C(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&_<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,I={core:h,block:h.block,inline:h.inline,get linkify(){const S=w();return Object.defineProperty(this,"linkify",{value:S,writable:!0,configurable:!0}),S},get renderer(){const S=g();return Object.defineProperty(this,"renderer",{value:S,writable:!0,configurable:!0}),S},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return C(this)},set(S){const _=ZT(S);return this.options={...this.options,..._},(aa(S,"fullChunkSizeChars")||aa(S,"fullChunkSizeLines")||aa(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(aa(S,"streamChunkSizeChars")||aa(S,"streamChunkSizeLines")||aa(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),aa(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),aa(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(_),typeof _.stream=="boolean"&&(this.stream.enabled=_.stream,v&&(v.reset(),v.resetStats())),this},configure(S){const _=typeof S=="string"?KT[S]:S;if(!_)throw new Error("Wrong `markdown-it` preset, can't be empty");if(_.options&&this.set(_.options),_.components){const x=_.components;x.core?.rules&&this.core.ruler.enableOnly(x.core.rules),x.block?.rules&&this.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&this.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&this.inline.ruler2.enableOnly(x.inline2.rules)}return this},enable(S,_){const x=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const R of E){if(!R)continue;const q=R.enable(x,!0);for(let z=0;z!M.has(q));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},disable(S,_){const x=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const R of E){if(!R)continue;const q=R.disable(x,!0);for(let z=0;z!M.has(q));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},use(S,..._){const x=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!x)throw new TypeError("MarkdownIt.use: plugin must be a function");const E=[this,..._],M=S;return c=!0,x.apply(M,E),this},render(S,_){let x;if(T(this,S.length)){_!==void 0&&(Br(_),x=F3("render"));const R=x?pp():0,q=x?$T(S,x):OT(S);if(x&&(x.attemptMs=pp()-R,q===null&&(x.fallbackReason="unsupported-stock-subset"),Rm(_,x)),q!==null)return _!==void 0&&ns(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),q}const E=_??{},M=this.parse(S,E);return x&&Rm(E,x),g().render(M,this.options,E)},async renderAsync(S,_){let x;if(T(this,S.length)){_!==void 0&&(Br(_),x=F3("render"));const R=x?pp():0,q=x?$T(S,x):OT(S);if(x&&(x.attemptMs=pp()-R,q===null&&(x.fallbackReason="unsupported-stock-subset"),Rm(_,x)),q!==null)return _!==void 0&&ns(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),q}const E=_??{},M=this.parse(S,E);return x&&Rm(E,x),g().renderAsync(M,this.options,E)},renderIterable(S,_={}){const x=this.parseIterable(S,_);return g().render(x,this.options,_)},async renderAsyncIterable(S,_={}){const x=await this.parseAsyncIterable(S,_);return g().renderAsync(x,this.options,_)},renderInline(S,_={}){const x=this.parseInline(S,_);return g().render(x,this.options,_)},validateLink:Az,normalizeLink:xz,normalizeLinkText:Sz,utils:Tue,helpers:{...vce},parse(S,_){if(typeof S!="string")throw new TypeError("Input data should be a String");if(_!==void 0&&Br(_),N(this,S.length)){const R=_===void 0?void 0:F3("parse"),q=R?pp():0,z=dfe(S,R);if(R&&(R.attemptMs=pp()-q,z===null&&(R.fallbackReason="unsupported-stock-subset"),Rm(_,R)),z!==null)return _!==void 0&&ns(_,{area:"parse",path:"stock-fast",reason:"stock-subset"}),z}const x=_??{};let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&C(this)){const R=Oz(this,S.length);if(R==="yes"){const q=Fg(this,S,x);return ns(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),q}R==="need-lines"&&(E=Po(S))}if(!this.stream.enabled){const R=S.length,q=this.options.autoTuneChunks!==!1,z=r,$=!a&&C(this),B=!!this.options.fullChunkedFallback,P=$&&R>=2e5;let H;(B||P||E!==void 0)&&(H=E??Po(S));const j=(B||P)&&q&&!z?Kfe(R,H,this.options):null;if(B||P){const G=H??0;if(B?R>=(this.options.fullChunkThresholdChars??2e4)||G>=(this.options.fullChunkThresholdLines??400):P){if(j&&j.strategy!=="plain"){const ne=V9(this,S,x,{maxChunkChars:j.maxChunkChars,maxChunkLines:j.maxChunkLines,fenceAware:j.fenceAware,maxChunks:j.maxChunks});return _&&YT(_,B?"explicit-full-chunk":"default-large-string"),ne}if(B){const ne=(Z,ae,K)=>ZK?K:Z,W=this.options.fullChunkAdaptive!==!1,Q=this.options.fullChunkTargetChunks??8,te=ne(Math.ceil(R/Q),8e3,64e3),X=ne(Math.ceil(G/Q),150,700),ve=W?te:this.options.fullChunkSizeChars??1e4,ce=W?X:this.options.fullChunkSizeLines??200,se=W?ne(Math.ceil(R/64e3),Q,32):this.options.fullChunkMaxChunks,pe=V9(this,S,x,{maxChunkChars:ve,maxChunkLines:ce,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:se});return _&&YT(_,"explicit-full-chunk"),pe}}}if(E!==void 0&&C(this)&&Rz(this,R,H??E)){const G=Fg(this,S,x);return ns(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),G}}const M=ol(S);return ns(_,{area:"parse",path:"plain",reason:"default-plain"}),i1(x,M,()=>h.parse(S,x,this).tokens)},parseIterable(S,_={}){return Br(_),Wfe(this,S,_)},parseAsyncIterable(S,_={}){return Br(_),qfe(this,S,_)},parseIterableToSink(S,_,x={}){return Br(x),Ufe(this,S,_,x)},parseAsyncIterableToSink(S,_,x={}){return Br(x),Vfe(this,S,_,x)},parseInline(S,_={}){if(typeof S!="string")throw new TypeError("Input data should be a String");Br(_),mv(_)&&Sc(_);const x=h.createState(S,_,this);return x.inlineMode=!0,h.process(x),x.tokens}};if(I.stream={enabled:!!n.stream,parse(S,_){return I.stream.enabled?y().parse(S,_,I):I.parse(S,_??{})},reset(){y().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},s?.components){const S=s.components;S.core?.rules&&I.core.ruler.enableOnly(S.core.rules),S.block?.rules&&I.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&I.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&I.inline.ruler2.enableOnly(S.inline2.rules)}return d=ahe(I),f=I.parse,I}var dhe=che;const Hz=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],fhe=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],Wz=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],hhe=["svg","g","path"],phe=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],mhe=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],ghe=["action","data","href","src","srcset","poster","xlink:href","formaction"],vhe=["script"],yhe=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],$d=new Set(Hz),qz=new Set(Wz),T0=new Set([...Hz,...fhe,...Wz,...hhe]),Uz=new Set([...T0,...phe]),khe=new Set(mhe),bhe=new Set(ghe),yv=new Set(vhe),Vz=new Set(yhe);function Kz(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const whe={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function Zz(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return whe[String(o??"").toLowerCase()]??t})}const L2=new Set(["http","https","mailto","tel"]),Che=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),If=new Set(["http","https"]);function Gz(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const Ahe=/^https?:\/\//i;function xhe(e){if(!Ahe.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function She(e,t,n){if(!Og(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function Og(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function _he(e,t){return t==="href"||t==="xlink:href"?Og(e,t)?L2:If:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?If:(Og(e,t),L2)}function ph(e,t={}){if(xhe(e))return!1;const n=Kz(Zz(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=Gz(n);return s?s==="file"?!She(n,i,o):Og(i,o)?Che.has(s):!_he(i,o).has(s):!1}function Mhe(e){const t=Zz(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Gz(Kz(t).toLowerCase());return n==="http"||n==="https"}function Ihe(e,t={}){const n=String(e??"").trim();return n?ph(n,t)?"":n:""}function JT(e){return Ihe(e,{tagName:"img",attrName:"src"})}function The(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,v){return f[h].nesting===1&&f[h].attrJoin("class",t),v.renderToken(f,h,m,g,v)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let v,y=!1,b=f.bMarks[h]+f.tShift[h],w=f.eMarks[h];if(l!==f.src.charCodeAt(b))return!1;for(v=b+1;v<=w&&r[(v-b)%a]===f.src[v];v++);const C=Math.floor((v-b)/a);if(C=m||(b=f.bMarks[I]+f.tShift[I],w=f.eMarks[I],b=4)){for(v=b+1;v<=w&&r[(v-b)%a]===f.src[v];v++);if(!(Math.floor((v-b)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&Qz(o.children,t,n)}}function Lhe(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(The,t,{render(n,i){return n[i].nesting===1?`
      `:`
      +`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let N=0,I=-1;for(let S=0;S0&&(h=g.slice(0,I))}h||(f=d||void 0)}if(o)return!0;const v=!!s.env.__markstreamFinal;let y=n+1,b=!1;for(;y<=i;){const N=s.bMarks[y]+s.tShift[y],I=s.eMarks[y];if(s.src.slice(N,I).trim()===":::"){b=!0;break}y++}b||(y=i);const w=s.push("vmr_container_open","div",1);if(w.attrSet("class",`vmr-container vmr-container-${c}`),w.map=[n,b?y:i],w.meta={...w.meta??{},unclosed:!b&&!v},f&&w.attrSet("data-args",f),h)try{const N=JSON.parse(h);for(const[I,S]of Object.entries(N)){const _=S!=null&&typeof S=="object";w.attrSet(`data-${I}`,_?JSON.stringify(S):String(S))}}catch{const N=Ehe(h);if(N)for(const[I,S]of Object.entries(N)){const _=S!=null&&typeof S=="object";w.attrSet(`data-${I}`,_?JSON.stringify(S):String(S))}else w.attrSet("data-attrs",h)}const C=[];for(let N=n+1;NN.trim().length>0)){let N=C.join(` `);N.endsWith(` `)||(N+=` `),N.endsWith(` `)||(N+=` -`);const I=s.tokens[s.tokens.length-1];I&&(I.raw=N);const S=[];s.md.block.parse(N,s.md,s.env,S),Qz(S,n+1,n+1+C.length),s.tokens.push(...S)}const T=s.push("vmr_container_close","div",-1);return b||(T.hidden=!0,T.map=[i,i]),s.line=b?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ua(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ho(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function Nk(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const Dhe=/^[a-z][a-z0-9_-]*$/;function JT(e){return Dhe.test(String(e??"").trim().toLowerCase())}function va(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return JT(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":JT(o)?o:""}function qh(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=va(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function Fhe(...e){const t=new Set,n=[];for(const i of e)for(const o of qh(i))t.has(o)||(t.add(o),n.push(o));return n}function Bhe(e){const t=qh(e);return{key:t.join(","),tags:t}}function Yz(e){return va(e)}function Rhe(e,t){const n=String(e??""),i=va(t);if(!i)return!1;const o=Ua(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Jz(e,t){const n=va(t);return!!n&&!E0.has(n)&&!Rhe(e,n)}function $he(e,t){const n=String(e??""),i=va(t);if(!i)return n;const o=Ua(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const Xz=Od,Ohe=E0,ej=new Set(qz);ej.delete("details");const Phe=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,zhe=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,aC=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,jhe=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function G9(e){return(e.match(aC)?.[1]??"").toLowerCase()}function n7(e){return/^\s*<\s*\//.test(e)}function i7(e,t){return Xz.has(t)||/\/\s*>\s*$/.test(e)}function Hhe(e,t){let n=0;for(let i=0;i0&&n--;continue}i7(o,s)||n++}}return n}function XT(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Ua(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function qhe(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ua(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function Q9(e){const t=e;return String(t.raw??t.content??t.markup??"")}function Uhe(e){const t=e;return t.meta||(t.meta={}),t.meta}function Z3(e,t,n){const i=Uhe(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function Vhe(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ua(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` -`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Ua(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const v=g??(h.type==="html_inline"?G9(m):"");if(!(v&&t.has(v))){r(m);return}const y=n7(m),b=!y&&i7(m,v);if(y){if(!i.length||i[i.length-1].tag!==v){r(m);return}u(m);return}if(r(m),b){Z3(h,m,"");return}i.push({tag:v,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,v=!0;for(const y of h.children){const b=Q9(y),w=y.type==="html_inline"?G9(b):"",C=w&&t.has(w);let T=b;if(v&&m&&b&&(i.length||C)){const N=m.indexOf(b,g);if(N!==-1)a(m.slice(g,N)),T=m.slice(N,N+b.length),g=N+b.length;else{if(i.length&&!C)continue;v=!1}}f(y,T,w)}v&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=Q9(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` -`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)Z3(h.token,h.raw,h.inner)}function Khe(e){return/^\s*<\s*[!?]/.test(e)}function Zhe(e){const t=new Set(Ohe);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function eE(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Ghe(e,t){let n=null;for(const s of e.matchAll(Phe)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();eE(l,t)&&Ho(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const w of g){const C=va(String(w??""));C&&m.add(C)}const v=Zhe(Array.from(m)),y=new Set(Jhe);for(const w of m)y.add(w);return{autoCloseInlineTagSet:y,commonHtmlTags:v,customTagSet:m,shouldMergeHtmlBlockTag:w=>m.has(w)||!v.has(w)||ej.has(w)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const v={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},v,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[v]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const v of h){const y=v;if(y.type!=="inline"||!Array.isArray(y.children))continue;const b=String(y.content??""),w=y.children.length?y.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(w)try{const C=Yhe(w,m);if(y.children=C.children,C.pendingBuffer){const T=b.lastIndexOf(C.pendingBuffer);if(T!==-1){const N=b.slice(0,T);y.content=N,typeof y.raw=="string"&&(y.raw=N)}}}catch(C){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",C)}}Vhe(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:v}=i(f),y=[];for(let b=0;b0){const[T,N]=y[y.length-1];if(b!==N){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(b,1),b--;continue}const I=String(w.content??w.raw??"");if(I){const S=h[N],_=`${String(S.content||"")} -${I}`,x=Ho(_),E=x===-1?null:XT(_,T,x+1);if(E){const M=_.slice(0,E.end),R=_.slice(E.end);S.content=M,S.loading=!1,h.splice(b,1),y.pop();const q=d(S,R)?[]:u(R,c(h,b,"paragraph"));q.length&&h.splice(b,0,...q),b--;continue}S.content=_,S.loading!==!1&&(S.loading=!0)}h.splice(b,1),b--;continue}}const C=o(w);if(C){if(Khe(C))continue;const T=(C.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(C);if(!T||!v(T))continue;if(s(w,C),!N)T&&!new RegExp(`^\\s*<\\s*${T}\\b[^>]*\\/\\s*>`,"i").test(C)&&qhe(C,T)>0&&y.push([T,b]);else if(y.length>0&&T&&y[y.length-1][0]===T){const[,I]=y[y.length-1],S=h[I];S.content=`${String(S.content||"")} +`);const I=s.tokens[s.tokens.length-1];I&&(I.raw=N);const S=[];s.md.block.parse(N,s.md,s.env,S),Qz(S,n+1,n+1+C.length),s.tokens.push(...S)}const T=s.push("vmr_container_close","div",-1);return b||(T.hidden=!0,T.map=[i,i]),s.line=b?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ga(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wo(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function Lk(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const Nhe=/^[a-z][a-z0-9_-]*$/;function XT(e){return Nhe.test(String(e??"").trim().toLowerCase())}function Ca(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return XT(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":XT(o)?o:""}function Uh(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=Ca(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function Dhe(...e){const t=new Set,n=[];for(const i of e)for(const o of Uh(i))t.has(o)||(t.add(o),n.push(o));return n}function Fhe(e){const t=Uh(e);return{key:t.join(","),tags:t}}function Yz(e){return Ca(e)}function Bhe(e,t){const n=String(e??""),i=Ca(t);if(!i)return!1;const o=Ga(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Jz(e,t){const n=Ca(t);return!!n&&!T0.has(n)&&!Bhe(e,n)}function Rhe(e,t){const n=String(e??""),i=Ca(t);if(!i)return n;const o=Ga(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const Xz=$d,Ohe=T0,ej=new Set(qz);ej.delete("details");const $he=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,Phe=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,lC=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,zhe=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Z9(e){return(e.match(lC)?.[1]??"").toLowerCase()}function t7(e){return/^\s*<\s*\//.test(e)}function n7(e,t){return Xz.has(t)||/\/\s*>\s*$/.test(e)}function jhe(e,t){let n=0;for(let i=0;i0&&n--;continue}n7(o,s)||n++}}return n}function eE(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Ga(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function Whe(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ga(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function G9(e){const t=e;return String(t.raw??t.content??t.markup??"")}function qhe(e){const t=e;return t.meta||(t.meta={}),t.meta}function K3(e,t,n){const i=qhe(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function Uhe(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ga(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` +`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Ga(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const v=g??(h.type==="html_inline"?Z9(m):"");if(!(v&&t.has(v))){r(m);return}const y=t7(m),b=!y&&n7(m,v);if(y){if(!i.length||i[i.length-1].tag!==v){r(m);return}u(m);return}if(r(m),b){K3(h,m,"");return}i.push({tag:v,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,v=!0;for(const y of h.children){const b=G9(y),w=y.type==="html_inline"?Z9(b):"",C=w&&t.has(w);let T=b;if(v&&m&&b&&(i.length||C)){const N=m.indexOf(b,g);if(N!==-1)a(m.slice(g,N)),T=m.slice(N,N+b.length),g=N+b.length;else{if(i.length&&!C)continue;v=!1}}f(y,T,w)}v&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=G9(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` +`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)K3(h.token,h.raw,h.inner)}function Vhe(e){return/^\s*<\s*[!?]/.test(e)}function Khe(e){const t=new Set(Ohe);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function tE(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Zhe(e,t){let n=null;for(const s of e.matchAll($he)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();tE(l,t)&&Wo(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const w of g){const C=Ca(String(w??""));C&&m.add(C)}const v=Khe(Array.from(m)),y=new Set(Yhe);for(const w of m)y.add(w);return{autoCloseInlineTagSet:y,commonHtmlTags:v,customTagSet:m,shouldMergeHtmlBlockTag:w=>m.has(w)||!v.has(w)||ej.has(w)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const v={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},v,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[v]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const v of h){const y=v;if(y.type!=="inline"||!Array.isArray(y.children))continue;const b=String(y.content??""),w=y.children.length?y.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(w)try{const C=Qhe(w,m);if(y.children=C.children,C.pendingBuffer){const T=b.lastIndexOf(C.pendingBuffer);if(T!==-1){const N=b.slice(0,T);y.content=N,typeof y.raw=="string"&&(y.raw=N)}}}catch(C){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",C)}}Uhe(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:v}=i(f),y=[];for(let b=0;b0){const[T,N]=y[y.length-1];if(b!==N){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(b,1),b--;continue}const I=String(w.content??w.raw??"");if(I){const S=h[N],_=`${String(S.content||"")} +${I}`,x=Wo(_),E=x===-1?null:eE(_,T,x+1);if(E){const M=_.slice(0,E.end),R=_.slice(E.end);S.content=M,S.loading=!1,h.splice(b,1),y.pop();const q=d(S,R)?[]:u(R,c(h,b,"paragraph"));q.length&&h.splice(b,0,...q),b--;continue}S.content=_,S.loading!==!1&&(S.loading=!0)}h.splice(b,1),b--;continue}}const C=o(w);if(C){if(Vhe(C))continue;const T=(C.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(C);if(!T||!v(T))continue;if(s(w,C),!N)T&&!new RegExp(`^\\s*<\\s*${T}\\b[^>]*\\/\\s*>`,"i").test(C)&&Whe(C,T)>0&&y.push([T,b]);else if(y.length>0&&T&&y[y.length-1][0]===T){const[,I]=y[y.length-1],S=h[I];S.content=`${String(S.content||"")} ${C}`,S.loading=!1,y.pop(),h.splice(b,1),b--}continue}else if(y.length>0){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(b,1),b--;continue}const T=w.content||"",N=new RegExp(`<\\s*\\/\\s*${y[y.length-1][0]}\\s*>`,"i").test(T);if(T){const[,I]=y[y.length-1],S=h[I];S.content=`${S.content||""} -${T}`,S.loading!==!1&&(S.loading=!N)}N&&y.pop(),h.splice(b,1),b--}else continue}if(g.size>0){const b=new Map,w=new Map,C=I=>{let S=b.get(I);return S||(S=new RegExp(`<\\s*${I}\\b`,"i"),b.set(I,S)),S},T=I=>{let S=w.get(I);return S||(S=new RegExp(`<\\s*\\/\\s*${I}\\s*>`,"i"),w.set(I,S)),S},N=[];for(let I=0;I0){const E=N[N.length-1],M=h[E.index],R=S.type==="html_block"?T(E.tag).exec(_):null;if(R){const O=R.index+R[0].length,B=_.slice(0,O),P=_.slice(O);M.content=`${String(M.content??"")} -${B}`,Array.isArray(M.children)&&M.children.push({type:"html_inline",content:``,raw:``}),N.pop();const H=d(M,P)?[]:u(P,c(h,I,"paragraph"));H.length?h.splice(I,1,...H):(h.splice(I,1),I--);continue}if(S.type!=="inline")continue;const q=Array.isArray(S.children)?S.children:[],z=Hhe(q,E.tag);if(z!==-1){const O=q.slice(0,z+1),B=q.slice(z+1),P=O.map(H=>String(H?.content??H?.raw??"")).join("");if(M.content=`${String(M.content??"")} -${P}`,Array.isArray(M.children)&&M.children.push(...O),B.length){const H=B.map(j=>String(j.content??j.raw??"")).join("");if(H.trim()){const j=H.replace(/^\s+/,"");if(d(M,H))h.splice(I,1),I--;else if(j.startsWith("<"))h.splice(I,1,{type:"html_block",content:j});else{const Z=u(H,c(h,I,"paragraph"));h.splice(I,1,...Z)}}else h.splice(I,1),I--}else h.splice(I,1),I--;N.pop();continue}M.content=`${String(M.content??"")} -${_}`,Array.isArray(M.children)&&M.children.push(...q),h.splice(I,1),I--;continue}if(S.type!=="inline")continue;const x=Array.isArray(S.children)?S.children:[];for(const E of g)if((x.length?Whe(x,E):C(E).test(_)&&!T(E).test(_)?1:0)>0){N.push({tag:E,index:I});break}}}{let b=0;for(let w=0;w0?b--:(h.splice(w,1),w--))}}for(let b=0;b/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){w.loading=!1;continue}if(g.has(S)){const z=String(w.content??""),O=Ho(z),B=O===-1?null:XT(z,S,O+1);w.loading=B?!1:w.loading!==void 0?w.loading:!0;const P=B?.start??-1,H=B?B.end-B.start:0;if(P!==-1){const j=z.slice(0,P+H);let Z="";O!==-1&&O]+)))?/g;let x;for(;(x=_.exec(w.content||""))!==null;)x[1],x[2]||x[3]||x[4];const E=String(w.content??""),M=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(E),R=M?M.index:-1,q=M?M[0].length:0;if(R!==-1){const z=E.slice(0,R+q),O=(E.slice(R+q)||"").replace(/^\s+/,"");w.children=[{type:"html_block",content:z,tag:S,loading:!1}],w.content=z,w.raw=z,O&&h.splice(b+1,0,O.startsWith("<")?{type:"html_block",content:O}:{type:"text",content:O,raw:O})}else w.children=[{type:"html_block",content:w.content,tag:S,loading:!0}];continue}if(!w||w.type!=="inline")continue;if(w.children.length===2&&w.children[0].type==="html_inline"){const S=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),_=w.children[1],x=String(_?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(_?.type==="html_inline"&&x===S)continue;m.has(S)?(w.children[0].loading=!0,w.children[0].tag=S,w.children.push({type:"html_inline",tag:S,loading:!0,content:``})):w.children=[{type:"html_block",loading:!0,tag:S,content:String(w.children[0]?.content??"")+String(w.children[1]?.content??"")}];continue}else if(w.children.length===3&&w.children[0].type==="html_inline"&&w.children[2].type==="html_inline"){const S=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(S))continue;w.children=[{type:"html_block",loading:!1,tag:S,content:w.children.map(_=>_.content).join("")}];continue}if(!w.content?.startsWith("<")||w.children?.length!==1)continue;const C=String(w.content),T=w,N=T.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(C)&&(T.children.length=0);continue}const I=String(N.content??C).match(jhe)?.[1]?.toLowerCase()??"";if(I){if(/\/\s*>\s*$/.test(C)||Xz.has(I)){T.children=[{type:"html_inline",content:C}];continue}T.children.length=0}}})}function epe(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function tpe(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!epe(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const tj=/\.([a-z0-9]{1,15})$/i,npe=/[_()[\]{}<>]/u,ipe=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,ope=/[?#@]/u,spe=/[\\/]/u,rpe=/^[\p{L}\p{N}./\\-]+$/u,lpe=/^[A-Za-z0-9-]{1,63}$/u,ape=/^xn--[a-z0-9-]{2,59}$/i,upe=/^(?:[A-Z]{1,6}|\d{1,8})$/u,cpe=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,dpe=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,fpe=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,hpe=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,ppe=2e3,mpe=512,gpe={},vpe=new Set(["ai","md","py","rs","sh","zip"]),nj=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),ype=new Set([...nj,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),kpe=new Set(["com","dev","io","page","site"]),bpe=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),wpe=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),Xf=new Map;function tE(e,t){if(!e||e.length>mpe)return t;for(Xf.set(e,t);Xf.size>ppe;){const n=Xf.keys().next().value;if(!n)break;Xf.delete(n)}return t}function L0(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function G3(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return L0(n)?n:void 0}function nE(e,t){if(!L0(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function iE(e){const t=bv(e);return L0(t)?t:void 0}function Cpe(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function oE(e,t){if(!L0(t))return;const n=String(e??"").trim().split(/\s+/u).map(Cpe).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>Y9(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>Y9(o,{marketTicker:!0}))&&(i.marketTicker=!0),L0(i)?i:void 0}function of(e,t=!1){let n;return{options(i){return t||i==null?nE(e,n):nE(e,G3(iE(i),oE(i,n)))},remember(i){const o=iE(i);n=t?G3(n,o):G3(o,oE(i,n))},reset(){n=void 0}}}function sE(e){return lpe.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function Ape(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return sE(n)||ape.test(n)?t.every(sE):!1}function ij(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function xpe(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function Spe(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function oj(e,t,n){const i=xpe(t);return ij(e)&&Spe(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function _pe(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function bv(e){const t=String(e??""),n=Xf.get(t);return n?(Xf.delete(t),Xf.set(t,n),n):_pe(t)?tE(t,{explicitFilename:dpe.test(t),filename:fpe.test(t),marketTicker:hpe.test(t)}):tE(t,gpe)}function Mpe(e){return Ape(e.split(/[\\/]/)[0]??"")}function Ipe(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function Tpe(e){if(npe.test(e)||!rpe.test(e))return!0;if(spe.test(e))return!Mpe(e);const t=e.replace(tj,"");return ij(t)?!0:t.split(".").filter(Boolean).some(Ipe)}function Epe(e,t,n){if(!(n?ype:nj).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?cpe:upe).test(i)}function Y9(e,t={}){if(!e||ipe.test(e)||ope.test(e))return!1;const n=e.match(tj);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return Epe(e,i,t.marketTicker===!0)?!0:wpe.has(i)?!vpe.has(i)||t.filename?!0:Tpe(e):!!(t.explicitFilename&&kpe.has(i)||t.filename&&bpe.has(i))}const sj=new WeakMap,rj=new WeakSet;function uC(e,t){return sj.set(e,t),e}function Lpe(e){return sj.get(e)}function Npe(e){rj.add(e)}function Dpe(e){return e===void 0||rj.has(e)}const rE=["!"];function lE(e){return e==="linkify"||e==="autolink"?e:"recovery"}function el(e){return{type:"text",content:e,raw:e}}function If(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Tf(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Wc(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return uC({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function Fpe(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(el(t))}}function aE(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function Rpe(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function uE(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?cE(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=bv(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=cE(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const v=g.content[h],y=g.content.slice(0,h);let b=g.content.slice(h);for(let T=m+1;T0&&(e.splice(m+1,w),a=m+1);let C=c;if(v==="!"&&f!==-1)C=c.slice(0,f);else if(b){const T=encodeURI(b);if(T&&c.endsWith(T))C=c.slice(0,c.length-T.length);else{const N=v?encodeURI(v):"",I=N?c.indexOf(N):-1;I!==-1&&(C=c.slice(0,I))}}C!==c&&Rpe(l,C),b&&e.splice(a+1,0,el(b));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Wc(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(el(h)),e.splice(r-4,8,...a)}else a.push(uC({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(y=>y[0]==="href")?.[1]||"",d=u.find(y=>y[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const y=m[1].length;If(g,y)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let y=r+1;yv[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Wc(d,f,m)),Tf(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];If(d,2),d.push(Wc(u,c,!1)),Tf(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v{const n=t;try{const i=Ype(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function dE(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function fE(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function hE(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function lj(e,t){if(!e.startsWith("|")||e.includes(` -`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function Q3(e){return lj(e)!==null}function aj(e){return/^:?-+:?$/.test(e.trim())}function Vpe(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(aj)}function Kpe(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Zpe(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(aj)&&Kpe(n)}function Gpe(e){return e==="|"||e==="|:"}function Qpe(e){const t=lj(e);return t!==null&&t.every(n=>!n.includes(":"))}function Ype(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` +${T}`,S.loading!==!1&&(S.loading=!N)}N&&y.pop(),h.splice(b,1),b--}else continue}if(g.size>0){const b=new Map,w=new Map,C=I=>{let S=b.get(I);return S||(S=new RegExp(`<\\s*${I}\\b`,"i"),b.set(I,S)),S},T=I=>{let S=w.get(I);return S||(S=new RegExp(`<\\s*\\/\\s*${I}\\s*>`,"i"),w.set(I,S)),S},N=[];for(let I=0;I0){const E=N[N.length-1],M=h[E.index],R=S.type==="html_block"?T(E.tag).exec(_):null;if(R){const $=R.index+R[0].length,B=_.slice(0,$),P=_.slice($);M.content=`${String(M.content??"")} +${B}`,Array.isArray(M.children)&&M.children.push({type:"html_inline",content:``,raw:``}),N.pop();const H=d(M,P)?[]:u(P,c(h,I,"paragraph"));H.length?h.splice(I,1,...H):(h.splice(I,1),I--);continue}if(S.type!=="inline")continue;const q=Array.isArray(S.children)?S.children:[],z=jhe(q,E.tag);if(z!==-1){const $=q.slice(0,z+1),B=q.slice(z+1),P=$.map(H=>String(H?.content??H?.raw??"")).join("");if(M.content=`${String(M.content??"")} +${P}`,Array.isArray(M.children)&&M.children.push(...$),B.length){const H=B.map(j=>String(j.content??j.raw??"")).join("");if(H.trim()){const j=H.replace(/^\s+/,"");if(d(M,H))h.splice(I,1),I--;else if(j.startsWith("<"))h.splice(I,1,{type:"html_block",content:j});else{const G=u(H,c(h,I,"paragraph"));h.splice(I,1,...G)}}else h.splice(I,1),I--}else h.splice(I,1),I--;N.pop();continue}M.content=`${String(M.content??"")} +${_}`,Array.isArray(M.children)&&M.children.push(...q),h.splice(I,1),I--;continue}if(S.type!=="inline")continue;const x=Array.isArray(S.children)?S.children:[];for(const E of g)if((x.length?Hhe(x,E):C(E).test(_)&&!T(E).test(_)?1:0)>0){N.push({tag:E,index:I});break}}}{let b=0;for(let w=0;w0?b--:(h.splice(w,1),w--))}}for(let b=0;b/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){w.loading=!1;continue}if(g.has(S)){const z=String(w.content??""),$=Wo(z),B=$===-1?null:eE(z,S,$+1);w.loading=B?!1:w.loading!==void 0?w.loading:!0;const P=B?.start??-1,H=B?B.end-B.start:0;if(P!==-1){const j=z.slice(0,P+H);let G="";$!==-1&&$]+)))?/g;let x;for(;(x=_.exec(w.content||""))!==null;)x[1],x[2]||x[3]||x[4];const E=String(w.content??""),M=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(E),R=M?M.index:-1,q=M?M[0].length:0;if(R!==-1){const z=E.slice(0,R+q),$=(E.slice(R+q)||"").replace(/^\s+/,"");w.children=[{type:"html_block",content:z,tag:S,loading:!1}],w.content=z,w.raw=z,$&&h.splice(b+1,0,$.startsWith("<")?{type:"html_block",content:$}:{type:"text",content:$,raw:$})}else w.children=[{type:"html_block",content:w.content,tag:S,loading:!0}];continue}if(!w||w.type!=="inline")continue;if(w.children.length===2&&w.children[0].type==="html_inline"){const S=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),_=w.children[1],x=String(_?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(_?.type==="html_inline"&&x===S)continue;m.has(S)?(w.children[0].loading=!0,w.children[0].tag=S,w.children.push({type:"html_inline",tag:S,loading:!0,content:``})):w.children=[{type:"html_block",loading:!0,tag:S,content:String(w.children[0]?.content??"")+String(w.children[1]?.content??"")}];continue}else if(w.children.length===3&&w.children[0].type==="html_inline"&&w.children[2].type==="html_inline"){const S=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(S))continue;w.children=[{type:"html_block",loading:!1,tag:S,content:w.children.map(_=>_.content).join("")}];continue}if(!w.content?.startsWith("<")||w.children?.length!==1)continue;const C=String(w.content),T=w,N=T.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(C)&&(T.children.length=0);continue}const I=String(N.content??C).match(zhe)?.[1]?.toLowerCase()??"";if(I){if(/\/\s*>\s*$/.test(C)||Xz.has(I)){T.children=[{type:"html_inline",content:C}];continue}T.children.length=0}}})}function Xhe(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function epe(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!Xhe(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const tj=/\.([a-z0-9]{1,15})$/i,tpe=/[_()[\]{}<>]/u,npe=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,ipe=/[?#@]/u,ope=/[\\/]/u,spe=/^[\p{L}\p{N}./\\-]+$/u,rpe=/^[A-Za-z0-9-]{1,63}$/u,lpe=/^xn--[a-z0-9-]{2,59}$/i,ape=/^(?:[A-Z]{1,6}|\d{1,8})$/u,upe=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,cpe=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,dpe=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,fpe=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,hpe=2e3,ppe=512,mpe={},gpe=new Set(["ai","md","py","rs","sh","zip"]),nj=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),vpe=new Set([...nj,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),ype=new Set(["com","dev","io","page","site"]),kpe=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),bpe=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),eh=new Map;function nE(e,t){if(!e||e.length>ppe)return t;for(eh.set(e,t);eh.size>hpe;){const n=eh.keys().next().value;if(!n)break;eh.delete(n)}return t}function E0(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Z3(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return E0(n)?n:void 0}function iE(e,t){if(!E0(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function oE(e){const t=kv(e);return E0(t)?t:void 0}function wpe(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function sE(e,t){if(!E0(t))return;const n=String(e??"").trim().split(/\s+/u).map(wpe).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>Q9(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>Q9(o,{marketTicker:!0}))&&(i.marketTicker=!0),E0(i)?i:void 0}function of(e,t=!1){let n;return{options(i){return t||i==null?iE(e,n):iE(e,Z3(oE(i),sE(i,n)))},remember(i){const o=oE(i);n=t?Z3(n,o):Z3(o,sE(i,n))},reset(){n=void 0}}}function rE(e){return rpe.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function Cpe(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return rE(n)||lpe.test(n)?t.every(rE):!1}function ij(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function Ape(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function xpe(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function oj(e,t,n){const i=Ape(t);return ij(e)&&xpe(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function Spe(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function kv(e){const t=String(e??""),n=eh.get(t);return n?(eh.delete(t),eh.set(t,n),n):Spe(t)?nE(t,{explicitFilename:cpe.test(t),filename:dpe.test(t),marketTicker:fpe.test(t)}):nE(t,mpe)}function _pe(e){return Cpe(e.split(/[\\/]/)[0]??"")}function Mpe(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function Ipe(e){if(tpe.test(e)||!spe.test(e))return!0;if(ope.test(e))return!_pe(e);const t=e.replace(tj,"");return ij(t)?!0:t.split(".").filter(Boolean).some(Mpe)}function Tpe(e,t,n){if(!(n?vpe:nj).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?upe:ape).test(i)}function Q9(e,t={}){if(!e||npe.test(e)||ipe.test(e))return!1;const n=e.match(tj);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return Tpe(e,i,t.marketTicker===!0)?!0:bpe.has(i)?!gpe.has(i)||t.filename?!0:Ipe(e):!!(t.explicitFilename&&ype.has(i)||t.filename&&kpe.has(i))}const sj=new WeakMap,rj=new WeakSet;function aC(e,t){return sj.set(e,t),e}function Epe(e){return sj.get(e)}function Lpe(e){rj.add(e)}function Npe(e){return e===void 0||rj.has(e)}const lE=["!"];function aE(e){return e==="linkify"||e==="autolink"?e:"recovery"}function tl(e){return{type:"text",content:e,raw:e}}function Tf(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Ef(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Wc(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return aC({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function Dpe(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(tl(t))}}function uE(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function Bpe(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function cE(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?dE(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=kv(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=dE(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const v=g.content[h],y=g.content.slice(0,h);let b=g.content.slice(h);for(let T=m+1;T0&&(e.splice(m+1,w),a=m+1);let C=c;if(v==="!"&&f!==-1)C=c.slice(0,f);else if(b){const T=encodeURI(b);if(T&&c.endsWith(T))C=c.slice(0,c.length-T.length);else{const N=v?encodeURI(v):"",I=N?c.indexOf(N):-1;I!==-1&&(C=c.slice(0,I))}}C!==c&&Bpe(l,C),b&&e.splice(a+1,0,tl(b));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Wc(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(tl(h)),e.splice(r-4,8,...a)}else a.push(aC({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(y=>y[0]==="href")?.[1]||"",d=u.find(y=>y[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const y=m[1].length;Tf(g,y)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let y=r+1;yv[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Wc(d,f,m)),Ef(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];Tf(d,2),d.push(Wc(u,c,!1)),Ef(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v{const n=t;try{const i=Qpe(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function fE(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function hE(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function pE(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function lj(e,t){if(!e.startsWith("|")||e.includes(` +`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function G3(e){return lj(e)!==null}function aj(e){return/^:?-+:?$/.test(e.trim())}function Upe(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(aj)}function Vpe(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Kpe(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(aj)&&Vpe(n)}function Zpe(e){return e==="|"||e==="|:"}function Gpe(e){const t=lj(e);return t!==null&&t.every(n=>!n.includes(":"))}function Qpe(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` `)[0]??"",[a="",u="",...c]=r.split(` `),d=!t&&!r.includes(` -`)&&/\r?\n$/.test(n)&&Q3(r);if(!t&&(r.includes(` -`)&&c.length===0&&Q3(a)&&Zpe(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>hE(m)),h=[...dE(),...f,...fE()];i.splice(o-1,3,...h)}else if(r.includes(` -`)&&c.length===0&&Q3(a)&&Vpe(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>hE(m)),h=[...dE(),...f,...fE()];i.splice(o-1,3,...h)}else r.includes(` -`)&&c.length===0&&Qpe(a)&&Gpe(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Jpe(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var Xpe=Jpe;const e1e=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],J9=e1e.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),t1e=/\\[a-z]+/i,uj="(?:\\\\|\\u0008)",n1e=new RegExp(String.raw`${uj}(?:${J9})\s*\{[^}]+\}`,"i"),i1e=new RegExp(String.raw`(?:${uj})?(?:${J9})\s*\{`,"i"),o1e=/\\(?:text|frac|left|right|times)/,s1e=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,r1e=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,l1e=/[A-Z]+\s*\([^)]+\)/i,a1e=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,u1e=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,c1e=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,d1e={"\b":"\\b","\v":"\\v","\f":"\\f"};function f1e(e){let t="";for(const n of e)t+=d1e[n]??n;return t}function cd(e){if(!e)return!1;const t=f1e(e),n=t.trim();if(c1e.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=t1e.test(t),o=n1e.test(t),s=i1e.test(t),r=o1e.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=s1e.test(t)&&!r1e.test(t),u=l1e.test(t),c=a1e.test(n),d=u1e.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const cj="__markstreamMathPluginApplied",cC=80,dj=2e4,pE=dj+4096;function o7(e){return!!e[cj]}function h1e(e){e[cj]=!0}const fj=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],p1e=["cdot","mathbf{","partial","mu_{"],hj=fj.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pj="[ \r\b\f\v]",m1e=new RegExp(`([^\\\\])(${p1e.map(e=>e).join("|")})+`,"g"),g1e=/span\{([^}]+)\}/,v1e=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,y1e=/(^|[^\\])\\\r?\n/g,k1e=/(^|[^\\])\\$/g,b1e=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,w1e=new RegExp(`(${pj})|(${hj})\\b`,"g"),mE=new Map,gE=new Map;function C1e(e){if(!e)return w1e;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=mE.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${pj})|(${o})\\b`,"g");return mE.set(n,s),s}function A1e(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=gE.get(i);if(o)return o;const s=e?[J9,hj].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),J9].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return gE.set(i,r),r}const vE={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function yE(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function x1e(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&b1e.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function kE(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function qc(e,t){const n=t?.commands??fj,i=t?.escapeExclamation??!0,o=t?.commands==null,s=C1e(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&vE[c]!==void 0)return`\\${vE[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=x1e(r));let l=r;const a=A1e(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(g1e,"span\\{$1\\}").replace(v1e,"\\operatorname{span}\\{$1\\}"),l=l.replace(y1e,`$1\\\\ -`),l=l.replace(k1e,"$1\\\\"),l=l.replace(m1e,"$1\\$2"),l}function bE(e){const t=e.trim();return!(!cd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function mj(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function dC(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=X9(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}wv(e,a)||s++,r=a+Math.max(1,t.length)}return s}function s7(e,t,n){const i=D0(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!D0(i.slice(0,o)).trim()||wv(i,o))return-1;const s=mj(i);if(X9(s,o))return-1;const r=wE(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>wE(i,n,0,o,s))return-1;return o}function N0(e){return e===" "||e===" "}function D0(e){let t=e.length;for(;t>0&&N0(e[t-1]);)t--;return e.slice(0,t)}function CE(e){let t=0;for(let n=0;n=48&&t<=57}function _1e(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function M1e(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function I1e(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(M1e)}function T1e(e){let t=0;if(!AE(e[t]))return!1;for(;AE(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:N0(e[t+1])}function gj(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&N0(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&N0(t[1])||T1e(t)||_1e(t)||I1e(t))}function xE(e,t){return e?t?`${e} -${t}`:e:t}function fC(e){const t=String(e??"").trim();return t?cd(t):!1}function SE(e){let t=0;for(let n=0;ncC){h=!0;break}const g=o[m],v=Ip(g,c);if(v!==-1){const y=xE(f,g.slice(0,v));if(!fC(y)){h=!0;break}const b=g.slice(v+c.length),w=b.trim()?`suffix:${SE(b)}`:"nosuffix";return["closed",u,i+l,d,i+m,v,SE(y),w].join(":")}if(gj(g)){h=!0;break}if(f=xE(f,g),f.length>dj){h=!0;break}}if(!h&&fC(f))return["pending",u,i+l,d].join(":")}}return null}function J3(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function L1e(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function X3(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function N1e(e,t){h1e(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(b,w)=>{let C=w;for(;Cm.trim()).flatMap(m=>pE(m)),h=[...fE(),...f,...hE()];i.splice(o-1,3,...h)}else if(r.includes(` +`)&&c.length===0&&G3(a)&&Upe(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>pE(m)),h=[...fE(),...f,...hE()];i.splice(o-1,3,...h)}else r.includes(` +`)&&c.length===0&&Gpe(a)&&Zpe(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Ype(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var Jpe=Ype;const Xpe=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Y9=Xpe.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),e1e=/\\[a-z]+/i,uj="(?:\\\\|\\u0008)",t1e=new RegExp(String.raw`${uj}(?:${Y9})\s*\{[^}]+\}`,"i"),n1e=new RegExp(String.raw`(?:${uj})?(?:${Y9})\s*\{`,"i"),i1e=/\\(?:text|frac|left|right|times)/,o1e=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,s1e=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,r1e=/[A-Z]+\s*\([^)]+\)/i,l1e=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,a1e=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,u1e=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,c1e={"\b":"\\b","\v":"\\v","\f":"\\f"};function d1e(e){let t="";for(const n of e)t+=c1e[n]??n;return t}function cd(e){if(!e)return!1;const t=d1e(e),n=t.trim();if(u1e.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=e1e.test(t),o=t1e.test(t),s=n1e.test(t),r=i1e.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=o1e.test(t)&&!s1e.test(t),u=r1e.test(t),c=l1e.test(n),d=a1e.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const cj="__markstreamMathPluginApplied",uC=80,dj=2e4,mE=dj+4096;function i7(e){return!!e[cj]}function f1e(e){e[cj]=!0}const fj=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],h1e=["cdot","mathbf{","partial","mu_{"],hj=fj.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pj="[ \r\b\f\v]",p1e=new RegExp(`([^\\\\])(${h1e.map(e=>e).join("|")})+`,"g"),m1e=/span\{([^}]+)\}/,g1e=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,v1e=/(^|[^\\])\\\r?\n/g,y1e=/(^|[^\\])\\$/g,k1e=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,b1e=new RegExp(`(${pj})|(${hj})\\b`,"g"),gE=new Map,vE=new Map;function w1e(e){if(!e)return b1e;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=gE.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${pj})|(${o})\\b`,"g");return gE.set(n,s),s}function C1e(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=vE.get(i);if(o)return o;const s=e?[Y9,hj].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Y9].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return vE.set(i,r),r}const yE={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function kE(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function A1e(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&k1e.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function bE(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function qc(e,t){const n=t?.commands??fj,i=t?.escapeExclamation??!0,o=t?.commands==null,s=w1e(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&yE[c]!==void 0)return`\\${yE[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=A1e(r));let l=r;const a=C1e(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(m1e,"span\\{$1\\}").replace(g1e,"\\operatorname{span}\\{$1\\}"),l=l.replace(v1e,`$1\\\\ +`),l=l.replace(y1e,"$1\\\\"),l=l.replace(p1e,"$1\\$2"),l}function wE(e){const t=e.trim();return!(!cd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function mj(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function cC(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=J9(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}bv(e,a)||s++,r=a+Math.max(1,t.length)}return s}function o7(e,t,n){const i=N0(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!N0(i.slice(0,o)).trim()||bv(i,o))return-1;const s=mj(i);if(J9(s,o))return-1;const r=CE(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>CE(i,n,0,o,s))return-1;return o}function L0(e){return e===" "||e===" "}function N0(e){let t=e.length;for(;t>0&&L0(e[t-1]);)t--;return e.slice(0,t)}function AE(e){let t=0;for(let n=0;n=48&&t<=57}function S1e(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function _1e(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function M1e(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(_1e)}function I1e(e){let t=0;if(!xE(e[t]))return!1;for(;xE(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:L0(e[t+1])}function gj(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&L0(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&L0(t[1])||I1e(t)||S1e(t)||M1e(t))}function SE(e,t){return e?t?`${e} +${t}`:e:t}function dC(e){const t=String(e??"").trim();return t?cd(t):!1}function _E(e){let t=0;for(let n=0;nuC){h=!0;break}const g=o[m],v=Tp(g,c);if(v!==-1){const y=SE(f,g.slice(0,v));if(!dC(y)){h=!0;break}const b=g.slice(v+c.length),w=b.trim()?`suffix:${_E(b)}`:"nosuffix";return["closed",u,i+l,d,i+m,v,_E(y),w].join(":")}if(gj(g)){h=!0;break}if(f=SE(f,g),f.length>dj){h=!0;break}}if(!h&&dC(f))return["pending",u,i+l,d].join(":")}}return null}function Y3(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function E1e(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function J3(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function L1e(e,t){f1e(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(b,w)=>{let C=w;for(;C=3&&(!C||/\s/.test(C))){const T=a.push("text","",0);return T.content=a.src.slice(a.pos,b),a.pos=b,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,v=m;const y=m;for(const[b,w]of f){const C=a.src,T=mj(C),N=S1e(C,c);let I=!1;b==="$$"&&g!==y&&(g=y);let S=-1,_=-1,x=0;const E=M=>{if((M==="undefined"||M==null)&&(M=""),M==="\\"){a.pos=a.pos+M.length,g=a.pos;return}if(M==="\\)"||M==="\\("){const z=a.push("text_special","",0);z.content=M==="\\)"?")":"(",z.markup=M,a.pos=a.pos+M.length,g=a.pos;return}if(!M)return;if(b==="$$"&&M.includes("$")){let z=0;for(;z0&&M[O-1]==="$"||O+10){const B=M.slice(0,R),P=a.push("text","",0);P.content=B,a.pos=a.pos+B.length,g=a.pos}const z=M.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(z){const[,B,P]=z,H=P.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),j=H?H[1]:P,Z=H&&H[2]?H[2]:null,ie=a.push("image","img",0);ie.attrs=[["src",j],["alt",B]],Z&&ie.attrs.push(["title",Z]),ie.content=B,ie.children=[{type:"text",content:B,tag:""}],a.pos=a.pos+z[0].length,g=a.pos;const W=M.slice(R+z[0].length);W&&E(W);return}const O=a.push("text","",0);O.content=M,a.pos=a.pos+M.length,g=a.pos;return}const q=a.push("text","",0);q.content=M,a.pos=a.pos+M.length,g=a.pos};for(;!(g>=C.length);){const M=C.indexOf(b,g);if(M===-1)break;if(wv(C,M)){g=M+Math.max(1,b.length);continue}const R=X9(T,M);if(R){g=R[1];continue}const q=X9(N,M);if(q){g=q[1];continue}if(M===S&&g===_){if(x++,x>2){g=M+Math.max(1,b.length);continue}}else x=0,S=M,_=g;if(b==="("&&M>0){let W=M-1;for(;W>=0&&C[W]===" ";)W--;if(W>=0&&C[W]==="]"){g=M+b.length;continue}}if(b==="$"&&M>0&&C[M-1]==="$"){g=M+1;continue}if(b==="$"&&M=C.length);){const R=dC(C,M);if(R===-1)break;if(R+10&&C[R-1]==="$"){M=R+1;continue}const q=Y3(C,R+1);if(q===-1)break;const z=C.slice(R+1,q),O=z.includes("`"),B=!z||!z.trim(),P=C[q+1],H=J3(z,P),j=X3(z);if(!O&&!B&&!H&&!j){const Z=C.slice(g,R);Z&&E(Z);const ie=a.push("math_inline","math",0);ie.content=qc(z,t),ie.markup="$",ie.raw=`$${z}$`,ie.loading=!1,g=q+1,M=q+1}else E("$"),M=R+1}M{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),v=!1,y="",b="",w=!1,C="",T=!1;for(const[Z,ie]of h)if(g.startsWith(Z))if(Z.includes("[")){const W=Z==="\\["?g.slice(Z.length):"";if(Z==="\\["&&Ip(W,ie)===-1&&!/^\s*!\[/.test(W)&&!W.includes("`")&&cd(W)){v=!0,y=Z,b=ie;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":b,x=S>=0?S:Ip(g,b,I);if(!w&&x>y.length){const Z=g.slice(N+y.length,x),ie=c.push("math_block","math",0);ie.content=qc(Z),ie.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",ie.map=[l,l+1],ie.raw=`${y}${Z}${_}`,ie.block=!0,ie.loading=!1,c.line=l+1;const W=g.slice(x+_.length);return W.trim()&&n(c,W,l),!0}let E=l,M="",R=!1,q="",z=l;const O=w?g:g===y?"":g.slice(y.length),B=!f&&y==="\\["?"]":"",P=Ip(O,b);if(P!==-1){const Z=P;M=O.slice(0,Z),q=O.slice(Z+b.length),z=w?l+1:l,R=!0,E=z}else for(O&&!w&&(M=O),E=l+1;E=3&&(!C||/\s/.test(C))){const T=a.push("text","",0);return T.content=a.src.slice(a.pos,b),a.pos=b,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,v=m;const y=m;for(const[b,w]of f){const C=a.src,T=mj(C),N=x1e(C,c);let I=!1;b==="$$"&&g!==y&&(g=y);let S=-1,_=-1,x=0;const E=M=>{if((M==="undefined"||M==null)&&(M=""),M==="\\"){a.pos=a.pos+M.length,g=a.pos;return}if(M==="\\)"||M==="\\("){const z=a.push("text_special","",0);z.content=M==="\\)"?")":"(",z.markup=M,a.pos=a.pos+M.length,g=a.pos;return}if(!M)return;if(b==="$$"&&M.includes("$")){let z=0;for(;z0&&M[$-1]==="$"||$+10){const B=M.slice(0,R),P=a.push("text","",0);P.content=B,a.pos=a.pos+B.length,g=a.pos}const z=M.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(z){const[,B,P]=z,H=P.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),j=H?H[1]:P,G=H&&H[2]?H[2]:null,ne=a.push("image","img",0);ne.attrs=[["src",j],["alt",B]],G&&ne.attrs.push(["title",G]),ne.content=B,ne.children=[{type:"text",content:B,tag:""}],a.pos=a.pos+z[0].length,g=a.pos;const W=M.slice(R+z[0].length);W&&E(W);return}const $=a.push("text","",0);$.content=M,a.pos=a.pos+M.length,g=a.pos;return}const q=a.push("text","",0);q.content=M,a.pos=a.pos+M.length,g=a.pos};for(;!(g>=C.length);){const M=C.indexOf(b,g);if(M===-1)break;if(bv(C,M)){g=M+Math.max(1,b.length);continue}const R=J9(T,M);if(R){g=R[1];continue}const q=J9(N,M);if(q){g=q[1];continue}if(M===S&&g===_){if(x++,x>2){g=M+Math.max(1,b.length);continue}}else x=0,S=M,_=g;if(b==="("&&M>0){let W=M-1;for(;W>=0&&C[W]===" ";)W--;if(W>=0&&C[W]==="]"){g=M+b.length;continue}}if(b==="$"&&M>0&&C[M-1]==="$"){g=M+1;continue}if(b==="$"&&M=C.length);){const R=cC(C,M);if(R===-1)break;if(R+10&&C[R-1]==="$"){M=R+1;continue}const q=Q3(C,R+1);if(q===-1)break;const z=C.slice(R+1,q),$=z.includes("`"),B=!z||!z.trim(),P=C[q+1],H=Y3(z,P),j=J3(z);if(!$&&!B&&!H&&!j){const G=C.slice(g,R);G&&E(G);const ne=a.push("math_inline","math",0);ne.content=qc(z,t),ne.markup="$",ne.raw=`$${z}$`,ne.loading=!1,g=q+1,M=q+1}else E("$"),M=R+1}M{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),v=!1,y="",b="",w=!1,C="",T=!1;for(const[G,ne]of h)if(g.startsWith(G))if(G.includes("[")){const W=G==="\\["?g.slice(G.length):"";if(G==="\\["&&Tp(W,ne)===-1&&!/^\s*!\[/.test(W)&&!W.includes("`")&&cd(W)){v=!0,y=G,b=ne;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":b,x=S>=0?S:Tp(g,b,I);if(!w&&x>y.length){const G=g.slice(N+y.length,x),ne=c.push("math_block","math",0);ne.content=qc(G),ne.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",ne.map=[l,l+1],ne.raw=`${y}${G}${_}`,ne.block=!0,ne.loading=!1,c.line=l+1;const W=g.slice(x+_.length);return W.trim()&&n(c,W,l),!0}let E=l,M="",R=!1,q="",z=l;const $=w?g:g===y?"":g.slice(y.length),B=!f&&y==="\\["?"]":"",P=Tp($,b);if(P!==-1){const G=P;M=$.slice(0,G),q=$.slice(G+b.length),z=w?l+1:l,R=!0,E=z}else for($&&!w&&(M=$),E=l+1;E{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function D1e(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
      ${e.utils.escapeHtml(String(o.content??""))}
      `})}const F1e=/^\s]/i,B1e=/^<\/a\s*>/i;function R1e(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");F1e.test(r)&&i>0&&i--,B1e.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function $1e(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>R1e(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function O1e(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function P1e(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new fhe({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!hh(l,{tagName:"a",attrName:"href"});Npe(r),s.set({validateLink:r})}return O1e(s),$1e(s),(e.enableMath??!0)&&N1e(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&Nhe(s),e.enableFixIndentedCodeBlock!==!1&&tpe(s),$pe(s),jpe(s),Ppe(s),Upe(s),D1e(s),Xhe(s,{customHtmlTags:e.customHtmlTags}),s}function ph(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>ph(n))),t}function z1e(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function j1e(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function H1e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function D2(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function _E(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function ME(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function V1e(e,t){const n=[],i=[],o=[],s=[],r=e.split(q1e),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!kj.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(ME(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(ME(g,a))}else{_E(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&_E(n,i,o,s);const d=n.join(` +`:""}${b}`,j.map=[l,E+1],j.block=!0,j.loading=!R,c.line=E+1,q.trim()&&n(c,q,z),!0},s=(r,l,a,u)=>{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function N1e(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
      ${e.utils.escapeHtml(String(o.content??""))}
      `})}const D1e=/^\s]/i,F1e=/^<\/a\s*>/i;function B1e(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");D1e.test(r)&&i>0&&i--,F1e.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function R1e(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>B1e(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function O1e(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function $1e(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new dhe({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!ph(l,{tagName:"a",attrName:"href"});Lpe(r),s.set({validateLink:r})}return O1e(s),R1e(s),(e.enableMath??!0)&&L1e(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&Lhe(s),e.enableFixIndentedCodeBlock!==!1&&epe(s),Rpe(s),zpe(s),$pe(s),qpe(s),N1e(s),Jhe(s,{customHtmlTags:e.customHtmlTags}),s}function mh(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>mh(n))),t}function P1e(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function z1e(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function j1e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function N2(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function ME(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function IE(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function U1e(e,t){const n=[],i=[],o=[],s=[],r=e.split(W1e),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!kj.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(IE(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(IE(g,a))}else{ME(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&ME(n,i,o,s);const d=n.join(` `),f=i.join(` `);return{original:t&&l&&d?`${d} `:d,updated:t&&l&&f?`${f} -`:f}}function r7(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=W1e(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=V1e(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function K1e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function Z1e(){return{type:"hardbreak",raw:`\\ -`}}function G1e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||Od.has(e)}function Q1e(e){if(!e||e.length===0)return IE();const t=t8.get(e);if(t)return t;const n=e.map(va).filter(Boolean);if(!n.length){const o=IE();return t8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:Rk({customHtmlTags:e})};return t8.set(e,i),i}function Aj(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function Y1e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function e4(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function J1e(e,t,n){const i=e.slice();return e4(i,"href")||i.push(["href",t]),n!=null&&!e4(i,"title")&&i.push(["title",n]),i}function hC(e){return e.map(Aj).join("")}function By(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:By(i.children)});continue}t.push(i)}return t}function X1e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(T.toLowerCase())||(g+=T),y=!0,v=!0}const b=[],w=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let C;for(;(C=w.exec(l))!==null;){const T=C[1],N=C[2]||C[3]||C[4]||"";b.push([T,N])}if(u?.has(a)){const T=Y1e(e);return[{type:a,tag:a,attrs:b,content:T?T.inner:h.innerTokens.length?hC(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:T?.raw??g,loading:e.loading||v,autoClosed:y},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:g,children:m,raw:g,loading:v,autoClosed:y},h.nextIndex]}function xj(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>xj(t)).join(""):String(e.content??"")}function tme(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>xj(t)).join("")}function TE(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=tme(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function nme(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function ime(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function sme(e,t,n){const i=e.slice();return t4(i,"href")||i.push(["href",t]),n!=null&&!t4(i,"title")&&i.push(["title",n]),i}function F2(e,t,n){const i=e[t],o=ome(i.attrs),s=String(t4(o,"href")??""),r=t4(o,"title"),l=r==null?null:String(r),a=sme(o,s,l);let u=t+1;const c=[];let d=!0;for(;uv.type==="strong_open")){const v=String(h.content??""),y=String(h.raw??v),b=ph(h);b.content=v.slice(0,-2),b.raw=y.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=b}const m=Lo(f,void 0,void 0,n),g=m.map(v=>{const y=v;return"content"in v?String(y.content??""):String(y.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,yme=/\p{P}/u,kme=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,bme=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,wme=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,Cme=/:\/\//,pC=1,Sj=2,Ame=4,xme=8,_j=16,Qc=32,Ry=64,lg=128,Mj=256,Sme=512,ag=1024,_me=1982;function B2(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Pd(e){return!!e&&gme.test(e)}function zd(e){return!!e&&(vme.test(e)||yme.test(e))}function Tj(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&kme.test(e)}function Ej(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&bme.test(e)}function Ime(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||Pd(i)?!1:!(zd(i)&&!Tj(i,n)&&n&&!Pd(n)&&!zd(n))}function Tme(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||Pd(n)?!1:!(zd(n)&&!Ej(n,i)&&i&&!Pd(i)&&!zd(i))}function Eme(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||Pd(i)?!1:!(zd(i)&&!Tj(i,n)&&n&&!Pd(n)&&!zd(n))}function Nme(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||Pd(n)?!1:!(zd(n)&&!Ej(n,i)&&i&&!Pd(i)&&!zd(i))}function Dme(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const $me=/[\p{L}\p{N}]/u,Ome=/^[\p{L}\p{N}]+$/u;function mC(e){return e?$me.test(e):!1}function Lj(e){return e?Ome.test(e):!1}function zg(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function Hme(e){return e?wme.test(e)||Cme.test(e):!1}function Wme(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Lo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=bv(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(G,ae){const K=e.length===1?t:String(ae.content??""),re=[],be=Pme(G);if(be!==-1){T(G.slice(0,be),G.slice(0,be));const we=G.slice(be);return we&&(E({type:"text",content:we,raw:we}),c--),c++,!0}if(fme.test(G)){const we=G.indexOf("~~");we!==-1&&re.push({type:"strikethrough",index:we})}if(hme.test(G)){const we=G.indexOf("**");we!==-1&&re.push({type:"strong",index:we})}if(/[^*]*\*[^*]+/.test(G)){const we=K?Ij(K,0):G.indexOf("*");if(K&&we===-1)return!1;we!==-1&&re.push({type:"emphasis",index:we})}re.sort((we,oe)=>we.index!==oe.index?we.index-oe.index:we.type===oe.type?0:we.type==="strong"?-1:oe.type==="strong"?1:0);const ke=re[0];if(!ke)return!1;if(ke.type==="strikethrough"){const we=ke.index,oe=we>-1?G.slice(0,we):"";if(oe&&T(oe,oe),we===-1)return c++,!0;const le=G.indexOf("~~",we+2),ye=le===-1?G.slice(we+2):G.slice(we+2,le),Ae=le===-1?"":G.slice(le+2),{node:_e}=LE([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ye,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),C(_e),Ae&&(E({type:"text",content:Ae,raw:Ae}),c--),c++,!0}if(ke.type==="strong"){const we=ke.index,oe=we>-1?G.slice(0,we):"";if(oe&&T(oe,oe),we===-1)return c++,!0;if(t&&we===0){let ne=!1,Ee=0;for(;Ee=2)return T(G,G),c++,!0}}if(t&&(G.match(/\*/g)||[]).length>Mme(t))return T(G.slice(oe.length),G.slice(oe.length)),c++,!0;const le=zg(G,we);if(le.len>=3){const ne=jme(G,we+le.len);if(ne!==-1){const Ee=G.slice(we+le.len,ne);if(zme(Ee)){const{node:qe}=Om([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ee,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),C(qe);const ze=G.slice(ne+3);return ze&&(E({type:"text",content:ze,raw:ze}),c--),c++,!0}}}if(!Lme(G,we)){const ne=G.slice(we,we+le.len);T(ne,ne);const Ee=G.slice(we+le.len);return Ee&&(E({type:"text",content:Ee,raw:Ee}),c--),c++,!0}const ye=Dme(G,we+2);let Ae="",_e="";if(ye.index!==-1){Ae=G.slice(we+2,ye.index),_e=G.slice(ye.index+2);const ne=ye.index,Ee=zg(G,ne);if(le.intraword&&Ee.intraword&&!Lj(Ae)||!Ae&&le.len>=4&&le.intraword)return T(G.slice(oe.length),G.slice(oe.length)),c++,!0}else{if(d||ye.sawInvalidClose||le.intraword)return T(G.slice(oe.length),G.slice(oe.length)),c++,!0;Ae=G.slice(we+2),_e=""}if(!Ae&&/^\*+$/.test(_e))return T(G,G),c++,!0;const{node:pe}=Om([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:Ae,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),C(pe),_e&&(E({type:"text",content:_e,raw:_e}),c--),c++,!0}if(ke.type==="emphasis"){let we=ke.index;we===-1&&(we=0);const oe=G.slice(0,we);if(oe&&T(oe,oe),!Ime(G,we)){T(G[we],G[we]);const ne=G.slice(we+1);return ne&&(E({type:"text",content:ne,raw:ne}),c--),c++,!0}const le=zg(G,we),ye=Eme(K,G,we+1),Ae=ye.index,_e=e[c+1];if(i?.final&&_e?.type==="em_open"&&Ae!==-1&&G.slice(we+1,Ae).trim()!==G.slice(we+1,Ae)||Ae===-1&&(ye.sawInvalidClose||i?.final||le.intraword||!mC(G[we+1])))return T(G.slice(we),G.slice(we)),c++,!0;const{node:pe}=D2([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ae>-1?G.slice(we+1,Ae):G.slice(we+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),C(pe),Ae!==-1&&Ae{for(let pe=0;pe<_e.length;pe++){if(_e[pe]!=="`")continue;let ne=0;for(let Ee=pe-1;Ee>=0&&_e[Ee]==="\\";Ee--)ne++;if(ne%2===0)return pe}return-1})(G);if(re===-1)return!1;let be=1;for(let _e=re+1;_eke?.type==="math_inline")||!pme.test(G))return null;const K=ae.parseInline(G,{__markstreamFinal:!!i?.final});if(!Array.isArray(K)||K.length===0)return null;const re=(K.find(ke=>ke?.type==="inline")?.children??[]).filter(ke=>!(ke?.type==="text"&&String(ke.content??"")===""));if(!re.length||!re.some(ke=>ke?.type!=="text")||re.length===1&&re[0]?.type==="text"&&String(re[0].content??"")===G)return null;const be=Lo(re,G,n,i);return be.length?be:null}function b(G){m(),a.push(G)}function w(G){m();const ae=ph(G);a.push(ae)}function C(G){b(G)}function T(G,ae){u?(u.content+=G,u.raw+=ae??G):(u={type:"text",content:String(G??""),raw:String(ae??G??"")},a.push(u))}function N(G,ae){if(!G)return;const K=Lo([{...ae,type:"text",content:G,raw:G}],G,n,i);if(K.length===1&&K[0]?.type==="text"){const re=K[0];T(String(re.content??""),String(re.raw??re.content??""));return}for(const re of K)C(re)}function I(G,ae){return String(G.markup??"").startsWith(ae)}function S(G){if(!u||G.loading!==!0||G.markup!=="\\(\\)")return;const ae=e[c-1];!ae||ae.type!=="text"||!I(ae,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function _(G){return G.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function x(G,ae,K=B2(G)){let re=G;const be=String(ae.content??"");return(K&pC)!==0&&re.endsWith("\\")&&!I(ae,"\\\\")&&!be.endsWith("\\\\")&&(re=re.slice(0,-1)),(K&ag)!==0&&re.endsWith("(")&&!I(ae,"\\(")&&!be.endsWith("\\(")&&(re=re.slice(0,-1)),(K&Sj)!==0&&/\*+$/.test(re)&&!I(ae,"\\*")&&!be.endsWith("\\*")&&(re=re.replace(/\*+$/,"")),re}for(;c{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=H1e(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=U1e(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function V1e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function K1e(){return{type:"hardbreak",raw:`\\ +`}}function Z1e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||$d.has(e)}function G1e(e){if(!e||e.length===0)return TE();const t=e8.get(e);if(t)return t;const n=e.map(Ca).filter(Boolean);if(!n.length){const o=TE();return e8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:Bk({customHtmlTags:e})};return e8.set(e,i),i}function Aj(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function Q1e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function X9(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function Y1e(e,t,n){const i=e.slice();return X9(i,"href")||i.push(["href",t]),n!=null&&!X9(i,"title")&&i.push(["title",n]),i}function fC(e){return e.map(Aj).join("")}function Fy(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:Fy(i.children)});continue}t.push(i)}return t}function J1e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(T.toLowerCase())||(g+=T),y=!0,v=!0}const b=[],w=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let C;for(;(C=w.exec(l))!==null;){const T=C[1],N=C[2]||C[3]||C[4]||"";b.push([T,N])}if(u?.has(a)){const T=Q1e(e);return[{type:a,tag:a,attrs:b,content:T?T.inner:h.innerTokens.length?fC(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:T?.raw??g,loading:e.loading||v,autoClosed:y},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:g,children:m,raw:g,loading:v,autoClosed:y},h.nextIndex]}function xj(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>xj(t)).join(""):String(e.content??"")}function eme(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>xj(t)).join("")}function EE(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=eme(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function tme(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function nme(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function ome(e,t,n){const i=e.slice();return e4(i,"href")||i.push(["href",t]),n!=null&&!e4(i,"title")&&i.push(["title",n]),i}function D2(e,t,n){const i=e[t],o=ime(i.attrs),s=String(e4(o,"href")??""),r=e4(o,"title"),l=r==null?null:String(r),a=ome(o,s,l);let u=t+1;const c=[];let d=!0;for(;uv.type==="strong_open")){const v=String(h.content??""),y=String(h.raw??v),b=mh(h);b.content=v.slice(0,-2),b.raw=y.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=b}const m=Eo(f,void 0,void 0,n),g=m.map(v=>{const y=v;return"content"in v?String(y.content??""):String(y.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,vme=/\p{P}/u,yme=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,kme=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,bme=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,wme=/:\/\//,hC=1,Sj=2,Cme=4,Ame=8,_j=16,Qc=32,By=64,rg=128,Mj=256,xme=512,lg=1024,Sme=1982;function F2(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Pd(e){return!!e&&mme.test(e)}function zd(e){return!!e&&(gme.test(e)||vme.test(e))}function Tj(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&yme.test(e)}function Ej(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&kme.test(e)}function Mme(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||Pd(i)?!1:!(zd(i)&&!Tj(i,n)&&n&&!Pd(n)&&!zd(n))}function Ime(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||Pd(n)?!1:!(zd(n)&&!Ej(n,i)&&i&&!Pd(i)&&!zd(i))}function Tme(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||Pd(i)?!1:!(zd(i)&&!Tj(i,n)&&n&&!Pd(n)&&!zd(n))}function Lme(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||Pd(n)?!1:!(zd(n)&&!Ej(n,i)&&i&&!Pd(i)&&!zd(i))}function Nme(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const Rme=/[\p{L}\p{N}]/u,Ome=/^[\p{L}\p{N}]+$/u;function pC(e){return e?Rme.test(e):!1}function Lj(e){return e?Ome.test(e):!1}function $g(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function jme(e){return e?bme.test(e)||wme.test(e):!1}function Hme(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Eo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=kv(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(Z,ae){const K=e.length===1?t:String(ae.content??""),re=[],we=$me(Z);if(we!==-1){T(Z.slice(0,we),Z.slice(0,we));const ke=Z.slice(we);return ke&&(E({type:"text",content:ke,raw:ke}),c--),c++,!0}if(dme.test(Z)){const ke=Z.indexOf("~~");ke!==-1&&re.push({type:"strikethrough",index:ke})}if(fme.test(Z)){const ke=Z.indexOf("**");ke!==-1&&re.push({type:"strong",index:ke})}if(/[^*]*\*[^*]+/.test(Z)){const ke=K?Ij(K,0):Z.indexOf("*");if(K&&ke===-1)return!1;ke!==-1&&re.push({type:"emphasis",index:ke})}re.sort((ke,oe)=>ke.index!==oe.index?ke.index-oe.index:ke.type===oe.type?0:ke.type==="strong"?-1:oe.type==="strong"?1:0);const be=re[0];if(!be)return!1;if(be.type==="strikethrough"){const ke=be.index,oe=ke>-1?Z.slice(0,ke):"";if(oe&&T(oe,oe),ke===-1)return c++,!0;const le=Z.indexOf("~~",ke+2),ye=le===-1?Z.slice(ke+2):Z.slice(ke+2,le),Ae=le===-1?"":Z.slice(le+2),{node:Me}=NE([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ye,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),C(Me),Ae&&(E({type:"text",content:Ae,raw:Ae}),c--),c++,!0}if(be.type==="strong"){const ke=be.index,oe=ke>-1?Z.slice(0,ke):"";if(oe&&T(oe,oe),ke===-1)return c++,!0;if(t&&ke===0){let ie=!1,Ee=0;for(;Ee=2)return T(Z,Z),c++,!0}}if(t&&(Z.match(/\*/g)||[]).length>_me(t))return T(Z.slice(oe.length),Z.slice(oe.length)),c++,!0;const le=$g(Z,ke);if(le.len>=3){const ie=zme(Z,ke+le.len);if(ie!==-1){const Ee=Z.slice(ke+le.len,ie);if(Pme(Ee)){const{node:qe}=Om([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ee,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),C(qe);const ze=Z.slice(ie+3);return ze&&(E({type:"text",content:ze,raw:ze}),c--),c++,!0}}}if(!Eme(Z,ke)){const ie=Z.slice(ke,ke+le.len);T(ie,ie);const Ee=Z.slice(ke+le.len);return Ee&&(E({type:"text",content:Ee,raw:Ee}),c--),c++,!0}const ye=Nme(Z,ke+2);let Ae="",Me="";if(ye.index!==-1){Ae=Z.slice(ke+2,ye.index),Me=Z.slice(ye.index+2);const ie=ye.index,Ee=$g(Z,ie);if(le.intraword&&Ee.intraword&&!Lj(Ae)||!Ae&&le.len>=4&&le.intraword)return T(Z.slice(oe.length),Z.slice(oe.length)),c++,!0}else{if(d||ye.sawInvalidClose||le.intraword)return T(Z.slice(oe.length),Z.slice(oe.length)),c++,!0;Ae=Z.slice(ke+2),Me=""}if(!Ae&&/^\*+$/.test(Me))return T(Z,Z),c++,!0;const{node:fe}=Om([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:Ae,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),C(fe),Me&&(E({type:"text",content:Me,raw:Me}),c--),c++,!0}if(be.type==="emphasis"){let ke=be.index;ke===-1&&(ke=0);const oe=Z.slice(0,ke);if(oe&&T(oe,oe),!Mme(Z,ke)){T(Z[ke],Z[ke]);const ie=Z.slice(ke+1);return ie&&(E({type:"text",content:ie,raw:ie}),c--),c++,!0}const le=$g(Z,ke),ye=Tme(K,Z,ke+1),Ae=ye.index,Me=e[c+1];if(i?.final&&Me?.type==="em_open"&&Ae!==-1&&Z.slice(ke+1,Ae).trim()!==Z.slice(ke+1,Ae)||Ae===-1&&(ye.sawInvalidClose||i?.final||le.intraword||!pC(Z[ke+1])))return T(Z.slice(ke),Z.slice(ke)),c++,!0;const{node:fe}=N2([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ae>-1?Z.slice(ke+1,Ae):Z.slice(ke+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),C(fe),Ae!==-1&&Ae{for(let fe=0;fe=0&&Me[Ee]==="\\";Ee--)ie++;if(ie%2===0)return fe}return-1})(Z);if(re===-1)return!1;let we=1;for(let Me=re+1;Mebe?.type==="math_inline")||!hme.test(Z))return null;const K=ae.parseInline(Z,{__markstreamFinal:!!i?.final});if(!Array.isArray(K)||K.length===0)return null;const re=(K.find(be=>be?.type==="inline")?.children??[]).filter(be=>!(be?.type==="text"&&String(be.content??"")===""));if(!re.length||!re.some(be=>be?.type!=="text")||re.length===1&&re[0]?.type==="text"&&String(re[0].content??"")===Z)return null;const we=Eo(re,Z,n,i);return we.length?we:null}function b(Z){m(),a.push(Z)}function w(Z){m();const ae=mh(Z);a.push(ae)}function C(Z){b(Z)}function T(Z,ae){u?(u.content+=Z,u.raw+=ae??Z):(u={type:"text",content:String(Z??""),raw:String(ae??Z??"")},a.push(u))}function N(Z,ae){if(!Z)return;const K=Eo([{...ae,type:"text",content:Z,raw:Z}],Z,n,i);if(K.length===1&&K[0]?.type==="text"){const re=K[0];T(String(re.content??""),String(re.raw??re.content??""));return}for(const re of K)C(re)}function I(Z,ae){return String(Z.markup??"").startsWith(ae)}function S(Z){if(!u||Z.loading!==!0||Z.markup!=="\\(\\)")return;const ae=e[c-1];!ae||ae.type!=="text"||!I(ae,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function _(Z){return Z.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function x(Z,ae,K=F2(Z)){let re=Z;const we=String(ae.content??"");return(K&hC)!==0&&re.endsWith("\\")&&!I(ae,"\\\\")&&!we.endsWith("\\\\")&&(re=re.slice(0,-1)),(K&lg)!==0&&re.endsWith("(")&&!I(ae,"\\(")&&!we.endsWith("\\(")&&(re=re.slice(0,-1)),(K&Sj)!==0&&/\*+$/.test(re)&&!I(ae,"\\*")&&!we.endsWith("\\*")&&(re=re.replace(/\*+$/,"")),re}for(;c=0;ne--){const Ee=a[ne];if(Ee.type!=="text")break;le=ne,ye=String(Ee.content??"")+ye}lele==="href")?.[1],oe=String(we??"");if(t&&oe){const le=t.indexOf("](");if(le!==-1){const ye=t.indexOf(")",le+2);ye===-1?K.loading=!0:K.loading&&t.slice(le+2,ye).includes(oe)&&(K.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(K.href)&&j(K,ae-1)||B(K)||b(K)}function z(G){if(G.markup!=="linkify")return!1;const{node:ae,nextIndex:K}=F2(e,c,i);return H(ae,K)?(c=K,!0):!1}function O(G){m(),C(rme(G)),c++}function B(G){if(G.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const K=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!K)return!1;const re=G,be=String(re.href??""),ke=String(re.text??""),we=String(K[2]??""),oe=be.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!be||!(ke===be||ke===oe||Hme(ke)))return!1;const le=String(K[1]??"");return le?(ae.content=le,ae.raw=le):a.pop(),b({...G,text:we,children:[{type:"text",content:we,raw:we}],raw:`[${we}](${be}${re.title?` "${re.title}"`:""})`}),!0}function P(G){if(G.type!=="link")return!1;const ae=G,K=String(ae.href??"");return K?H({href:K,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},c+1):!1}function H(G,ae){const K=a[a.length-1];if(K?.type!=="image"||K.src||!K.loading||!String(K.raw??"").endsWith("]("))return!1;const re=e[ae],be=String(re?.content??"");if(re?.type!=="text"||!be.startsWith(")"))return!1;a.pop(),u=null;const ke=String(K.alt??"");b({type:"image",src:G.href,alt:ke,title:G.title,raw:`![${ke}](${G.href}${G.title?` "${G.title}"`:""})`,loading:!!G.loading});const we=be.slice(1),oe=ph(re);return oe.content=we,oe.raw=we,h()[ae]=oe,!0}function j(G,ae=c-1){if(G.type!=="link")return!1;const K=a[a.length-1],re=e[ae];if(!K||K.type!=="text"||re?.type!=="text")return!1;const be=String(K.content??""),ke=String(re.content??"");if(!be.endsWith("!")||!ke.endsWith("!")||I(re,"\\!"))return!1;const we=be.slice(0,-1);we?(K.content=we,K.raw=we,u=K):(a.pop(),u=null);const oe=G,le=String(oe.text??oe.children?.map(_e=>String(_e?.content??_e?.raw??"")).join("")??""),ye=String(oe.href??""),Ae=oe.title==null||oe.title===""?null:String(oe.title);return b({type:"image",src:ye,alt:le,title:Ae,raw:`![${le}](${ye}${Ae?` "${Ae}"`:""})`,loading:!!oe.loading}),!0}function Z(G,ae="",K=null){const re=String(G.alt??G.raw??"");return{type:"link",href:ae,title:K,text:re,children:[G],raw:`[${re}](${ae}${K?` "${K}"`:""})`,loading:!0}}function ie(G){const ae=G.startsWith("![")?G:`![${G}`,K=ae.slice(2),re=K.indexOf("](");return{type:"image",src:"",alt:re===-1?K.replace(/\]$/,""):K.slice(0,re),title:null,raw:ae,loading:!0}}function W(G){const ae=G.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&Rme(t,ae,"["))return!1;const K=G.slice(0,ae);return K&&T(K,K),b(Z(ie(G.slice(ae+1)))),c++,!0}function Q(G){if(i?.final)return!1;const ae=e[c-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||I(ae,"\\["))return!1;const K=a[a.length-1];if(K?.type==="text"&&K.content.endsWith("[")){const re=K.content.slice(0,-1);re?(K.content=re,K.raw=re,u=K):(a.pop(),u=null)}return b(Z(TE(G))),c++,!0}function te(G){if(G.type!=="link")return!1;const ae=G,K=String(ae.raw??""),re=String(ae.text??"");if(!K.startsWith("[![")&&!re.startsWith("!["))return!1;const be=ae.title==null||ae.title===""?null:String(ae.title);return b(Z({type:"image",src:String(ae.href??""),alt:re.replace(/^!\[/,"").replace(/\]$/,""),title:be,raw:K.startsWith("[![")?K.slice(1):K,loading:!0})),!0}function X(G){if(!G.startsWith("]("))return!1;const ae=e[c-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&I(ae,"\\["))return!1;const K=a[a.length-1];if(K?.type!=="image"&&K?.type!=="link")return!1;const re=K,be=K?.type==="link"&&Array.isArray(re.children)&&re.children.length===1&&re.children[0]?.type==="image"?a.pop():null,ke=be?be.children[0]:a.pop();if(!ke||ke.type!=="image")return!1;const we=e[c+1];let oe=String(be?.href??""),le=be?.title==null?null:String(be.title),ye=!0;if(we?.type==="link_open"){const{node:_e,nextIndex:pe}=F2(e,c+1,i);oe=_e.href,le=_e.title,ye=!0,c=pe}else{if(oe=G.slice(2),oe.includes('"')){const _e=oe.split('"');oe=String(_e[0]??"").trim(),le=_e[1]==null?null:String(_e[1]).trim()}c++}const Ae=Z(ke,oe,le);return Ae.loading=ye,b(Ae),!0}function ge(){const G=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&G?.type==="text"&&String(G.content??"").endsWith("[")&&I(G,"\\[")}function ue(G,ae){const K=G.indexOf("[");if(K===-1)return!1;let re=G.slice(0,K);const be=G.indexOf("](",K);if(be!==-1){const ke=e[c+2];let we=G.slice(K+1,be);if(we.includes("[")){const ne=we.indexOf("[");re+=G.slice(0,K+ne+1);const Ee=K+ne+1;we=G.slice(Ee+1,be)}const oe=e[c+1];if(G.endsWith("](")&&oe?.type==="link_open"&&ke){const ne=e[c+4];let Ee=4,qe=!0;if(ne?.type==="text"){const ft=String(ne.content??"");if(ft.startsWith(")")){qe=!1;const gt=ft.slice(1);if(gt){const _t=ph(ne);_t.content=gt,_t.raw=gt,h()[c+4]=_t}else Ee++}else ft==="."&&Ee++}N(re,ae);const ze=String(ke.content??"");return i?.validateLink&&!i.validateLink(ze)?T(we,we):b({type:"link",href:ze,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:qe}),c+=Ee,!0}const le=G.indexOf(")",be),ye=le!==-1?G.slice(be+2,le):"",Ae=le===-1;let _e=re.match(/\*+$/);if(_e&&(re=re.replace(/\*+$/,"")),N(re,ae),_e||(_e=we.match(/^\*+/)),!d&&_e){const ne=_e[0].length;we=we.replace(/^\*+/,"").replace(/\*+$/,"");const Ee=[];if(ne===1?Ee.push({type:"em_open",tag:"em",nesting:1}):ne===2?Ee.push({type:"strong_open",tag:"strong",nesting:1}):ne===3&&(Ee.push({type:"strong_open",tag:"strong",nesting:1}),Ee.push({type:"em_open",tag:"em",nesting:1})),Ee.push({type:"link",href:ye,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:Ae}),ne===1){Ee.push({type:"em_close",tag:"em",nesting:-1});const{node:qe}=D2(Ee,0,i);C(qe)}else if(ne===2){Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:qe}=Om(Ee,0,void 0,i);C(qe)}else if(ne===3){Ee.push({type:"em_close",tag:"em",nesting:-1}),Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:qe}=Om(Ee,0,void 0,i);C(qe)}else{const{node:qe}=D2(Ee,0,i);C(qe)}}else i?.validateLink&&!i.validateLink(ye)?T(we,we):b({type:"link",href:ye,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:Ae});const pe=le!==-1?G.slice(le+1):"";return pe&&(E({type:"text",content:pe,raw:pe}),c--),c++,!0}return!1}function se(G){const ae=G.indexOf("![");if(ae===-1)return!1;const K=G.slice(0,ae);return K&&!u?u={type:"text",content:K,raw:K}:K&&u&&(u.content+=K),u&&(a.push(u),u=null),b(ie(G.slice(ae))),c++,!0}function fe(G){if(!(G?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=G.slice(1).match(/[^\s\]]/);if(ae===null)return c++,!0;if(ae&&/x/i.test(ae[0])){const K=ae[0]==="x"||ae[0]==="X";return b({type:"checkbox_input",checked:K,raw:K?"[x]":"[ ]"}),c++,!0}return!1}return a}function a7(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function NE(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` -`&&r++,{startLine:s,endLine:r}}function F0(e,t,n,i){const o=qme(e,t,n);return a7(o.startLine,o.endLine,i)}function Ume(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:a7(i,o,t)}function Mi(e,t,n){if(!n?.includeSourceMap)return e;const i=Ume(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function Vme(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=a7(s,Math.max(r,l),i)),e}function Kme(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Zme(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Gme(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function G1(e,t,n){const i=e[t],o=[],s=of(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Mi(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` -`)};return n?.includeSourceMap&&Mi(l,i,n),[l,r+1]}function Qme(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=of(i,!0);let a=t+1;for(;a=0;ie--){const Ee=a[ie];if(Ee.type!=="text")break;le=ie,ye=String(Ee.content??"")+ye}lele==="href")?.[1],oe=String(ke??"");if(t&&oe){const le=t.indexOf("](");if(le!==-1){const ye=t.indexOf(")",le+2);ye===-1?K.loading=!0:K.loading&&t.slice(le+2,ye).includes(oe)&&(K.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(K.href)&&j(K,ae-1)||B(K)||b(K)}function z(Z){if(Z.markup!=="linkify")return!1;const{node:ae,nextIndex:K}=D2(e,c,i);return H(ae,K)?(c=K,!0):!1}function $(Z){m(),C(sme(Z)),c++}function B(Z){if(Z.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const K=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!K)return!1;const re=Z,we=String(re.href??""),be=String(re.text??""),ke=String(K[2]??""),oe=we.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!we||!(be===we||be===oe||jme(be)))return!1;const le=String(K[1]??"");return le?(ae.content=le,ae.raw=le):a.pop(),b({...Z,text:ke,children:[{type:"text",content:ke,raw:ke}],raw:`[${ke}](${we}${re.title?` "${re.title}"`:""})`}),!0}function P(Z){if(Z.type!=="link")return!1;const ae=Z,K=String(ae.href??"");return K?H({href:K,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},c+1):!1}function H(Z,ae){const K=a[a.length-1];if(K?.type!=="image"||K.src||!K.loading||!String(K.raw??"").endsWith("]("))return!1;const re=e[ae],we=String(re?.content??"");if(re?.type!=="text"||!we.startsWith(")"))return!1;a.pop(),u=null;const be=String(K.alt??"");b({type:"image",src:Z.href,alt:be,title:Z.title,raw:`![${be}](${Z.href}${Z.title?` "${Z.title}"`:""})`,loading:!!Z.loading});const ke=we.slice(1),oe=mh(re);return oe.content=ke,oe.raw=ke,h()[ae]=oe,!0}function j(Z,ae=c-1){if(Z.type!=="link")return!1;const K=a[a.length-1],re=e[ae];if(!K||K.type!=="text"||re?.type!=="text")return!1;const we=String(K.content??""),be=String(re.content??"");if(!we.endsWith("!")||!be.endsWith("!")||I(re,"\\!"))return!1;const ke=we.slice(0,-1);ke?(K.content=ke,K.raw=ke,u=K):(a.pop(),u=null);const oe=Z,le=String(oe.text??oe.children?.map(Me=>String(Me?.content??Me?.raw??"")).join("")??""),ye=String(oe.href??""),Ae=oe.title==null||oe.title===""?null:String(oe.title);return b({type:"image",src:ye,alt:le,title:Ae,raw:`![${le}](${ye}${Ae?` "${Ae}"`:""})`,loading:!!oe.loading}),!0}function G(Z,ae="",K=null){const re=String(Z.alt??Z.raw??"");return{type:"link",href:ae,title:K,text:re,children:[Z],raw:`[${re}](${ae}${K?` "${K}"`:""})`,loading:!0}}function ne(Z){const ae=Z.startsWith("![")?Z:`![${Z}`,K=ae.slice(2),re=K.indexOf("](");return{type:"image",src:"",alt:re===-1?K.replace(/\]$/,""):K.slice(0,re),title:null,raw:ae,loading:!0}}function W(Z){const ae=Z.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&Bme(t,ae,"["))return!1;const K=Z.slice(0,ae);return K&&T(K,K),b(G(ne(Z.slice(ae+1)))),c++,!0}function Q(Z){if(i?.final)return!1;const ae=e[c-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||I(ae,"\\["))return!1;const K=a[a.length-1];if(K?.type==="text"&&K.content.endsWith("[")){const re=K.content.slice(0,-1);re?(K.content=re,K.raw=re,u=K):(a.pop(),u=null)}return b(G(EE(Z))),c++,!0}function te(Z){if(Z.type!=="link")return!1;const ae=Z,K=String(ae.raw??""),re=String(ae.text??"");if(!K.startsWith("[![")&&!re.startsWith("!["))return!1;const we=ae.title==null||ae.title===""?null:String(ae.title);return b(G({type:"image",src:String(ae.href??""),alt:re.replace(/^!\[/,"").replace(/\]$/,""),title:we,raw:K.startsWith("[![")?K.slice(1):K,loading:!0})),!0}function X(Z){if(!Z.startsWith("]("))return!1;const ae=e[c-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&I(ae,"\\["))return!1;const K=a[a.length-1];if(K?.type!=="image"&&K?.type!=="link")return!1;const re=K,we=K?.type==="link"&&Array.isArray(re.children)&&re.children.length===1&&re.children[0]?.type==="image"?a.pop():null,be=we?we.children[0]:a.pop();if(!be||be.type!=="image")return!1;const ke=e[c+1];let oe=String(we?.href??""),le=we?.title==null?null:String(we.title),ye=!0;if(ke?.type==="link_open"){const{node:Me,nextIndex:fe}=D2(e,c+1,i);oe=Me.href,le=Me.title,ye=!0,c=fe}else{if(oe=Z.slice(2),oe.includes('"')){const Me=oe.split('"');oe=String(Me[0]??"").trim(),le=Me[1]==null?null:String(Me[1]).trim()}c++}const Ae=G(be,oe,le);return Ae.loading=ye,b(Ae),!0}function ve(){const Z=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&Z?.type==="text"&&String(Z.content??"").endsWith("[")&&I(Z,"\\[")}function ce(Z,ae){const K=Z.indexOf("[");if(K===-1)return!1;let re=Z.slice(0,K);const we=Z.indexOf("](",K);if(we!==-1){const be=e[c+2];let ke=Z.slice(K+1,we);if(ke.includes("[")){const ie=ke.indexOf("[");re+=Z.slice(0,K+ie+1);const Ee=K+ie+1;ke=Z.slice(Ee+1,we)}const oe=e[c+1];if(Z.endsWith("](")&&oe?.type==="link_open"&&be){const ie=e[c+4];let Ee=4,qe=!0;if(ie?.type==="text"){const ht=String(ie.content??"");if(ht.startsWith(")")){qe=!1;const gt=ht.slice(1);if(gt){const _t=mh(ie);_t.content=gt,_t.raw=gt,h()[c+4]=_t}else Ee++}else ht==="."&&Ee++}N(re,ae);const ze=String(be.content??"");return i?.validateLink&&!i.validateLink(ze)?T(ke,ke):b({type:"link",href:ze,title:null,text:ke,children:[{type:"text",content:ke,raw:ke}],loading:qe}),c+=Ee,!0}const le=Z.indexOf(")",we),ye=le!==-1?Z.slice(we+2,le):"",Ae=le===-1;let Me=re.match(/\*+$/);if(Me&&(re=re.replace(/\*+$/,"")),N(re,ae),Me||(Me=ke.match(/^\*+/)),!d&&Me){const ie=Me[0].length;ke=ke.replace(/^\*+/,"").replace(/\*+$/,"");const Ee=[];if(ie===1?Ee.push({type:"em_open",tag:"em",nesting:1}):ie===2?Ee.push({type:"strong_open",tag:"strong",nesting:1}):ie===3&&(Ee.push({type:"strong_open",tag:"strong",nesting:1}),Ee.push({type:"em_open",tag:"em",nesting:1})),Ee.push({type:"link",href:ye,title:null,text:ke,children:[{type:"text",content:ke,raw:ke}],loading:Ae}),ie===1){Ee.push({type:"em_close",tag:"em",nesting:-1});const{node:qe}=N2(Ee,0,i);C(qe)}else if(ie===2){Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:qe}=Om(Ee,0,void 0,i);C(qe)}else if(ie===3){Ee.push({type:"em_close",tag:"em",nesting:-1}),Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:qe}=Om(Ee,0,void 0,i);C(qe)}else{const{node:qe}=N2(Ee,0,i);C(qe)}}else i?.validateLink&&!i.validateLink(ye)?T(ke,ke):b({type:"link",href:ye,title:null,text:ke,children:[{type:"text",content:ke,raw:ke}],loading:Ae});const fe=le!==-1?Z.slice(le+1):"";return fe&&(E({type:"text",content:fe,raw:fe}),c--),c++,!0}return!1}function se(Z){const ae=Z.indexOf("![");if(ae===-1)return!1;const K=Z.slice(0,ae);return K&&!u?u={type:"text",content:K,raw:K}:K&&u&&(u.content+=K),u&&(a.push(u),u=null),b(ne(Z.slice(ae))),c++,!0}function pe(Z){if(!(Z?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=Z.slice(1).match(/[^\s\]]/);if(ae===null)return c++,!0;if(ae&&/x/i.test(ae[0])){const K=ae[0]==="x"||ae[0]==="X";return b({type:"checkbox_input",checked:K,raw:K?"[x]":"[ ]"}),c++,!0}return!1}return a}function l7(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function DE(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` +`&&r++,{startLine:s,endLine:r}}function D0(e,t,n,i){const o=Wme(e,t,n);return l7(o.startLine,o.endLine,i)}function qme(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:l7(i,o,t)}function Si(e,t,n){if(!n?.includeSourceMap)return e;const i=qme(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function Ume(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=l7(s,Math.max(r,l),i)),e}function Vme(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Kme(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Zme(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function G1(e,t,n){const i=e[t],o=[],s=of(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Si(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` +`)};return n?.includeSourceMap&&Si(l,i,n),[l,r+1]}function Gme(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=of(i,!0);let a=t+1;for(;au.raw).join(` `)} -:::`},a+1]}const Yme=new Set(["warning","info","note","tip","danger","caution"]);function Jme(e){let t=0;for(;t=0;g--){const v=f[g];if(v.type==="text"&&/:+/.test(v.content)){h=g;break}}const m={type:"paragraph",children:Lo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Mi(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=G1(e,u,a.options());n?.includeSourceMap&&Mi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=Q1(e,u,a.options());n?.includeSourceMap&&Mi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=Dk(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} +:::`},a+1]}const Qme=new Set(["warning","info","note","tip","danger","caution"]);function Yme(e){let t=0;for(;t=0;g--){const v=f[g];if(v.type==="text"&&/:+/.test(v.content)){h=g;break}}const m={type:"paragraph",children:Eo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Si(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=G1(e,u,a.options());n?.includeSourceMap&&Si(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=Q1(e,u,a.options());n?.includeSourceMap&&Si(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=Nk(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} ${l.map(d=>d.raw).join(` `)} -:::`},u+1]}const ege=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function tge(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=ege.exec(String(i.info??""));return o?Qme(e,t,o,n):null}const u7={parseContainer:(e,t,n)=>Xme(e,t,n),matchAdmonition:tge};function Q1(e,t,n){const i=[],o=of(n,!0);let s=t+1;for(;sl.raw).join(` -`)};return n?.includeSourceMap&&Mi(r,e[t],n),[r,s+1]}function nge(e){if(e.info?.startsWith("diff"))return r7(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function ige(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=of(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` +:::`},u+1]}const Xme=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function ege(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Xme.exec(String(i.info??""));return o?Gme(e,t,o,n):null}const a7={parseContainer:(e,t,n)=>Jme(e,t,n),matchAdmonition:ege};function Q1(e,t,n){const i=[],o=of(n,!0);let s=t+1;for(;sl.raw).join(` +`)};return n?.includeSourceMap&&Si(r,e[t],n),[r,s+1]}function tge(e){if(e.info?.startsWith("diff"))return s7(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function nge(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=of(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` `)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` -`)},o+1]}function oge(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=of(n,!0);let l=t+1;for(;la.raw).join(` -`)}`},l+1]}function sge(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:Lo(a.children||[],u,void 0,n),raw:u}}function rge(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function Nj(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!v.includes(">");else if(u)u=!v.includes("?>");else if(v.startsWith("");else if(v.startsWith("");else if(v.startsWith("");else{const y=o(v);if(y)if(y.closing){for(let b=r.length-1;b>=0;b--)if(r[b]===y.tag){r.length=b;break}}else y.selfClosing||s(y.after,y.tag)||r.push(y.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function Uge(e,t,n){if(!n?.length)return!1;const i=new Set(qh(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const v=c.indexOf(">",d);if(v===-1)return null;let y=v-1;for(;y>=0&&s(c[y]);)y--;return{closing:f,tag:m,selfClosing:!f&&c[y]==="/",after:c.slice(v+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=Y1(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let v=a.length-1;v>=0;v--)if(a[v]===g.tag){a.length=v;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function Vge(e,t){const n=Cge.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` -`,o),r=e.slice(o,s===-1?e.length:s);return!Y1(r.endsWith("\r")?r.slice(0,-1):r)||Hj(e,o)||qge(e,o)||Uge(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function g7(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!yu(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!yu(e,l)){const a=g7(e,s,"`"),u=Wj(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!yu(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!yu(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function Kge(e,t){if(!o7(t))return e;const n=t,i=$E.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?qj(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:Bk(e).state;$E.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` -`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return cd(l)&&!c?e:e.slice(0,r)}function Zge(e,t,n,i,o){const s=f7(e),r=h7(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&p7(e)==null&&l8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&l8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return jE(e,t,n,i,o)}else return jE(e,t,n,i,o);return!1}function Bk(e,t=Pge(),n=null,i=!1,o=0){const s=Hg(t);let r=Hg(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);Zge(h,s,o+u,n,i)&&(a=!0),d?(r=Hg(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function qj(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:Hg(e.committedContext),context:Hg(e.context),lineBuffer:e.lineBuffer+t}}:Bk(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function Gge(e,t){if(!o7(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=Fk.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?qj(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):Bk(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!Wge(o.source,r)&&!jge(t)){o.source=t,o.explicitBracketMath=a;return}const c=E1e(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),zge(e,t,c,a)}function Qge(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function Uj(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function Yge(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function UE(e){return{type:"paragraph",children:e,raw:e.map(t0e).join("")}}function VE(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function KE(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=Fge(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(UE(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(UE(u)),a}function n0e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Wg(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function i0e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ua(t)}\s*>\s*$`,"i").test(n)}const u8=new Set(["iframe","script","style","textarea","title"]);function Cv(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}const h=Ho(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let v=g.slice(1).trimStart();const y=v.startsWith("/");y&&(v=v.slice(1).trimStart());const b=v.match(/^([A-Z][\w:-]*)/i);return b?.[1]?{closing:y,end:m,selfClosing:/\/\s*>$/.test(g),tag:b[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Ua(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const v=o(g.index);return v?{start:g.index,end:v.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(u8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} -`}function ZE(e){return e.replace(/\r\n/g,` -`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function r0e(e,t,n){return n?e.includes(n,t)?!0:ZE(e.slice(Math.max(0,t))).includes(ZE(n)):!1}function l0e(e,t){let n=Math.max(0,t);for(;n0?r:void 0,children:l,raw:f},c?u+1:u]}function o8(e,t,n,i){if(n?.type.endsWith("_close")){let o=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(o)||(o=Array.isArray(t.map)?Number(t.map[1])+1:NaN),Ume(e,t,o,i)}return Si(e,t,i)}function hge(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function pge(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function mge(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Ga(i)}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${Ga(i)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return null}function gge(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=new RegExp(String.raw`<\s*${i}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const s=o.exec(e);if(!s||s.index==null)return null;const r=s.index,l=e.slice(r),a=Wo(l);if(a===-1)return null;const u=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const m=u+1;return{raw:e.slice(r,m),start:r,end:m}}let c=1,d=u+1;const f=m=>{const g=e.slice(m);return new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i").test(g)},h=m=>{const g=e.slice(m);return new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i").test(g)};for(;d",m);if(g===-1)return null;if(c--,c===0){const v=g+1;return{raw:e.slice(r,v),start:r,end:v}}d=g+1;continue}if(f(m)){const g=Wo(e.slice(m));if(g===-1)return null;c++,d=m+g+1;continue}d=m+1}return{raw:e.slice(r),start:r,end:e.length}}function mC(e){return Number.isFinite(e)&&e>0?e:0}function vge(e,t){const n=mC(t);if(!e||n<=0)return 0;let i=0;for(let o=0;o\s*$/.test(m),v=h===-1?null:mge(f,l,h+1),y=v?.start??-1;let b="";h!==-1&&(y!==-1&&h]+)))?/g;let T;for(;(T=C.exec(m))!==null;){const S=T[1];if(!S||S.toLowerCase()===l)continue;const _=T[2]||T[3]||T[4]||"";w.push([S,_])}const N=!n?.final&&!g&&v==null,I={type:l,tag:l,content:hge(b),raw:String(d?.raw??s.raw??f),loading:N,attrs:w.length?w:void 0};return o&&(d?I.sourceMap=D0(a,d.start,d.end,n):Si(I,i,n)),[I,t+1]}return o&&Si(s,i,n),[s,t+1]}case"table_open":{const[s,r]=uge(e,t,n);return o&&Si(s,i,n),[s,r]}case"dl_open":{const[s,r]=nge(e,t,n);return o&&Si(s,i,n),[s,r]}case"footnote_open":{const[s,r]=ige(e,t,n);return o&&Si(s,i,n),[s,r]}case"hr":{const s=cge();return o&&Si(s,i,n),[s,t+1]}}return null}function u7(e,t,n,i){const o=Nk(e,t,n);if(o)return o;const s=e[t],r=n?.includeSourceMap===!0;switch(s.type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(i?.parseContainer){const l=i.parseContainer(e,t,n);return r&&o8(l[0],s,e[l[1]-1],n),l}break;case"container_open":if(i?.matchAdmonition){const l=i.matchAdmonition(e,t,n);if(l)return r&&o8(l[0],s,e[l[1]-1],n),l}break;case"vmr_container_open":{const l=fge(e,t,n);return r&&o8(l[0],s,e[l[1]-1],n),l}}return null}function yge(){return{type:"hardbreak",raw:`\\ +`}}function kge(e,t,n){const i=e[t+1],o=String(i.content??"");return{type:"paragraph",children:Eo(i.children||[],o,void 0,n),raw:o}}const BE=new WeakMap,Bj=new WeakMap,RE=new WeakMap,OE=new WeakMap;function lu(e,t,n){const i=t?.map,o=n?.__sourceMarkdown;if(!Array.isArray(i)||i.length<2||typeof o!="string"||!n)return;const s=Number(i[0]),r=Number(i[1]);if(!Number.isFinite(s)||!Number.isFinite(r))return;let l=RE.get(n);if(!l){l=[0];for(let a=0;a{if(!xge.has(n.type)||(n.type==="link"||n.type==="link_open"||n.type==="link_close")&&!Npe(t))return!1;if(n.type==="link"){const o=Epe(n);if(o!=="explicit"&&o!=="linkify"&&o!=="autolink")return!1}if(n.type==="link_open"||n.type==="link_close"){const o=n.markup??"";if(o!==""&&o!=="linkify"&&o!=="autolink")return!1}const i=n.children;return!Array.isArray(i)||Pj(i,t)})}function Mge(e){const t=Sge.get(e);if(t)return t;const n=/^container_(.+)_open$/.exec(e);return n?`container_${n[1]}_close`:void 0}function Ige(e,t){const n=[];let i=!1,o=0;for(;o{const c=r[u+1]??n.length;return{firstToken:n[a],lastToken:n[c-1],tokenCount:c-a}});Pg.set(e,{groupBoundaries:l,source:t,nodes:o,stableGroupCount:i.mixed?Math.max(0,r.length-1):Tge(t)?r.length:Math.max(0,r.length-1),requireClosingStrong:s.requireClosingStrong,validateLink:s.validateLink})}function Lge(e,t,n,i){const o=n.length-1;for(let s=0;s=o||!WE(a.firstToken,t[r])||!WE(a.lastToken,t[l-1])))return!1}return!0}function Nge(e,t,n,i,o){const s=e,r=i.__disableStructuredReuse===!0;if(!(c7(e,i)&&Ege(i)))return r||Pg.delete(s),Ep(n,i,o);if(r)return Ep(n,i,o);const l=Ige(n,i.validateLink);if(!l)return Pg.delete(s),Ep(n,i,o);const a=l.starts,u=Pg.get(s),c=ag.get(s),d=u&&l.mixed?Math.min(u.stableGroupCount,Math.max(0,u.groupBoundaries.length-1)):u?.stableGroupCount??0;if(u&&d>0&&u.requireClosingStrong===i.requireClosingStrong&&u.validateLink===i.validateLink&&t.startsWith(u.source)&&a.length>=d&&(c==="append"||c==="tail")&&Lge(u,n,a,d)){const h=a[d]??n.length,m=Ep(n.slice(h),{...i,__linkifyDemotionSeed:u.nodes.slice(0,d).map(v=>String(v.raw??""))},o),g=a.length-d;if(m.length===g){const v=u.nodes.slice(0,d).concat(m);return xd(o,"processTokensReusedTopLevelNodes",d),zE(e,t,n,l,v,i),v}}const f=Ep(n,i,o);return zE(e,t,n,l,f,i),f}function Dge(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Uh(t);return n.length?new Set(n):null}function Fge(e,t){const n=e;let i=BE.get(n);i||(i=new Map,BE.set(n,i));const o=t.__markstreamFinal===!0?"final":"streaming";let s=i.get(o);s||(s={},i.set(o,s));for(const r of Object.keys(s))Object.prototype.hasOwnProperty.call(t,r)||delete s[r];return Object.assign(s,t),s}function Bge(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function B2(e,t,n){for(const i of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,i);if(!o||!("value"in o))continue;const s=Object.getOwnPropertyDescriptor(t,i);s&&(!("value"in s)||s.writable===!1)||(t[i]=Kf(o.value,n))}}function Kf(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,i=t.get(n);if(i)return i;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(Kf(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Kf(l,t),Kf(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Kf(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),B2(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),B2(n,r,t),r}if(e instanceof Error){let r;const l=e.constructor;try{r=new l(e.message)}catch{r=new Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),B2(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!Bge(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),B2(n,r,t),r}const o={};t.set(n,o);const s=e;for(const r of Object.keys(s))o[r]=Kf(s[r],t);return o}function zj(e,t=!0){if(!t)return mh(e);const n=Object.create(Object.getPrototypeOf(e)),i=new WeakMap;for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s)continue;if(!("value"in s)){Object.defineProperty(n,o,s);continue}const r=s.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>zj(a,t)):t&&r&&typeof r=="object"&&(l=Kf(r,i)),Object.defineProperty(n,o,{...s,value:l})}return n}function jE(e,t=!0){return e.map(n=>zj(n,t))}function c7(e,t){const n=t,i=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&i?.enabled===!0&&typeof i.parse=="function"}function Rge(e,t){const n=t,i=t.streamParse??"auto",o=e.stream;return t.final===!0&&i==="auto"&&n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function Oge(e){Dk.delete(e)}function $ge(){return{fenceChar:"",fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function zg(e){return{...e}}function Pge(e,t,n,i=Fk(t).state){Dk.set(e,{explicitBracketMath:i,source:t,key:n,pendingCandidate:n===null&&yj(t)})}function zge(e){return e.endsWith("$")||e.endsWith("\\")}function jge(e){const t=Math.max(e.lastIndexOf(` +`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return bge.some(i=>n.endsWith(i))}function Hge(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&t[0]==="["||jge(e)&&/[\r\n]/.test(t)):!1}function ku(e,t){let n=t-1,i=0;for(;n>=0&&e[n]==="\\";)i++,n--;return i%2===1}function vC(e){return e===" "||e===" "}function jj(e,t){return t===" "?e+1:e+4-e%4}function d7(e){let t=0,n=0;for(;t3?null:t}function s8(e){const t=Y1(e);if(!t)return null;const n=t.index,i=e[n];if(i!=="`"&&i!=="~")return null;let o=n;for(;o")return n?t:null;n=!0,o++,(t[o]===" "||t[o]===" ")&&o++,t=t.slice(o)}}function p7(e){const t=s8(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};const n=h7(e),i=n==null?null:s8(n);if(i)return{...i,inBlockquote:!0,inList:!1,listIndent:0};const o=f7(e);if(!o)return null;const s=s8(o.content);return s==null?null:{...s,inBlockquote:!1,inList:!0,listIndent:o.contentIndent}}function Hj(e,t){let n=!1,i="",o=0,s=!1,r=!1,l=0,a=null,u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=d7(h),g=f7(h);n&&s&&h.trim()&&h7(h)==null&&(n=!1,i="",o=0,s=!1,r=!1,l=0),n&&r&&h.trim()&&m.column=o&&/^\s*$/.test(v.rest)&&(n=!1,i="",o=0,s=!1,r=!1,l=0):(n=!0,i=v.markerChar,o=v.markerLen,s=v.inBlockquote,r=v.inList||a!=null&&!v.inBlockquote&&m.column>=a,l=v.listIndent||a||0)),c===-1||c>=t)break;u=c+1}return n}function Wge(e,t){const n=d=>d===" "||d===" ",i=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"||d===":"},o=d=>{if(d[0]!=="<")return null;let f=1;for(;f"&&v!=="/")return null;const y=Wo(d);if(y===-1)return null;let b=y-1;for(;b>=0&&n(d[b]);)b--;return{closing:h,tag:g,selfClosing:!h&&d[b]==="/",after:d.slice(y+1)}},s=(d,f)=>{const h=d.toLowerCase();let m=0;for(;m")return!0}}return!1},r=[];let l=!1,a=!1,u=!1,c=0;for(;c=t?t:d,h=e.slice(c,f),m=h.endsWith("\r")?h.slice(0,-1):h,g=Y1(m);if(g){const v=m.slice(g.index);if(l)l=!v.includes("-->");else if(a)a=!v.includes(">");else if(u)u=!v.includes("?>");else if(v.startsWith("");else if(v.startsWith("");else if(v.startsWith("");else{const y=o(v);if(y)if(y.closing){for(let b=r.length-1;b>=0;b--)if(r[b]===y.tag){r.length=b;break}}else y.selfClosing||s(y.after,y.tag)||r.push(y.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function qge(e,t,n){if(!n?.length)return!1;const i=new Set(Uh(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const v=c.indexOf(">",d);if(v===-1)return null;let y=v-1;for(;y>=0&&s(c[y]);)y--;return{closing:f,tag:m,selfClosing:!f&&c[y]==="/",after:c.slice(v+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=Y1(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let v=a.length-1;v>=0;v--)if(a[v]===g.tag){a.length=v;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function Uge(e,t){const n=wge.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` +`,o),r=e.slice(o,s===-1?e.length:s);return!Y1(r.endsWith("\r")?r.slice(0,-1):r)||Hj(e,o)||Wge(e,o)||qge(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function m7(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!ku(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!ku(e,l)){const a=m7(e,s,"`"),u=Wj(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!ku(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!ku(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function Vge(e,t){if(!i7(t))return e;const n=t,i=$E.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?qj(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:Fk(e).state;$E.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` +`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return cd(l)&&!c?e:e.slice(0,r)}function Kge(e,t,n,i,o){const s=d7(e),r=f7(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&h7(e)==null&&r8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&r8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return HE(e,t,n,i,o)}else return HE(e,t,n,i,o);return!1}function Fk(e,t=$ge(),n=null,i=!1,o=0){const s=zg(t);let r=zg(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);Kge(h,s,o+u,n,i)&&(a=!0),d?(r=zg(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function qj(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:zg(e.committedContext),context:zg(e.context),lineBuffer:e.lineBuffer+t}}:Fk(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function Zge(e,t){if(!i7(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=Dk.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?qj(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):Fk(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!Hge(o.source,r)&&!zge(t)){o.source=t,o.explicitBracketMath=a;return}const c=T1e(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),Pge(e,t,c,a)}function Gge(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function Uj(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function Qge(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function VE(e){return{type:"paragraph",children:e,raw:e.map(e0e).join("")}}function KE(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function ZE(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=Dge(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(VE(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(VE(u)),a}function t0e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function jg(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function n0e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ga(t)}\s*>\s*$`,"i").test(n)}const a8=new Set(["iframe","script","style","textarea","title"]);function wv(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}const h=Wo(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let v=g.slice(1).trimStart();const y=v.startsWith("/");y&&(v=v.slice(1).trimStart());const b=v.match(/^([A-Z][\w:-]*)/i);return b?.[1]?{closing:y,end:m,selfClosing:/\/\s*>$/.test(g),tag:b[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Ga(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const v=o(g.index);return v?{start:g.index,end:v.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(a8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} +`}function GE(e){return e.replace(/\r\n/g,` +`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function s0e(e,t,n){return n?e.includes(n,t)?!0:GE(e.slice(Math.max(0,t))).includes(GE(n)):!1}function r0e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function Kj(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const u0e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),c0e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function d0e(e){return/\n\s*\n/.test(e)||c0e.test(e)}function f0e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>u0e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!d0e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function h0e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=Cv(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function p0e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=RE.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:r1(u,t,n));return RE.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function m0e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||Vz.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=Ho(l);if(a===-1)return o;const u=Cv(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=Kj(n,i),m=d?null:h0e(f),g=m?p0e(m,t,h,i):r1(f,t,h);return f0e(f,g)?{...o,children:g}:o})}function g0e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function r1(e,t,n){return e.trim()?Gj(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function v0e(e,t,n){const i=r1(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function y0e(e,t,n){const i=Nj({content:e}),o=Ho(e),s=Vj(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=v0e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function k0e(e,t,n){const i=Ho(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=Cv(o,"summary",0);if(!s)return r1(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...r1(r,t,n),y0e(s.raw,t,n),...r1(l,t,n)]}function Zj(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const j=Vj(f,"details");return j!==-1?f.slice(0,j):f})():f,[w]=Zj(y?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),C=k0e(b,n,Kj(i,o)),T=g===-1?"":String(e[g].raw??Wg(e[g])??""),N=y||g!==-1&&v?.closed===!0,I=T.replace(/[\t\r\n ]+$/,""),S=N?(()=>{const j=(v?.raw??"").lastIndexOf(I);return j===-1?t.length:h+j})():t.length,_=Ho(f),x=y&&_!==-1?h+_+1:h+f.length,E=t.slice(x,S===-1?t.length:S),M=n.parse(E,{__markstreamFinal:o}),R=n.renderer.render(M,n.options,{__markstreamFinal:o}),q=S+I.length,z=N?Math.max(S+T.length,l0e(t,q)):t.length,O=N?t.slice(S,z):T,B=N?t.slice(h,z):t.slice(h),P=y&&_!==-1?f.slice(0,_+1):f,H={...u,tag:"details",attrs:Nk(f.slice(0,_+1)),raw:B,content:`${P}${R}${O}`,children:[...C,...w],loading:!o&&!N};if(i.includeSourceMap&&(H.sourceMap=F0(t,h,N?z:t.length,i)),r.push(H),l=N?z:t.length,g===-1&&!y)break;g!==-1&&(a=g)}return[r,l]}function b0e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&_.end<=d.end){o.splice(N,1);continue}break}T=S+I.length,o.splice(N,1)}}return o}function w0e(e){const t=l=>l===" "||l===" "||l===` +`?n+1:t}function QE(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function Kj(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const a0e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),u0e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function c0e(e){return/\n\s*\n/.test(e)||u0e.test(e)}function d0e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>a0e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!c0e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function f0e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=wv(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function h0e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=OE.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:r1(u,t,n));return OE.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function p0e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||Vz.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=Wo(l);if(a===-1)return o;const u=wv(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=Kj(n,i),m=d?null:f0e(f),g=m?h0e(m,t,h,i):r1(f,t,h);return d0e(f,g)?{...o,children:g}:o})}function m0e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function r1(e,t,n){return e.trim()?Gj(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function g0e(e,t,n){const i=r1(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function v0e(e,t,n){const i=Nj({content:e}),o=Wo(e),s=Vj(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=g0e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function y0e(e,t,n){const i=Wo(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=wv(o,"summary",0);if(!s)return r1(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...r1(r,t,n),v0e(s.raw,t,n),...r1(l,t,n)]}function Zj(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const j=Vj(f,"details");return j!==-1?f.slice(0,j):f})():f,[w]=Zj(y?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),C=y0e(b,n,Kj(i,o)),T=g===-1?"":String(e[g].raw??jg(e[g])??""),N=y||g!==-1&&v?.closed===!0,I=T.replace(/[\t\r\n ]+$/,""),S=N?(()=>{const j=(v?.raw??"").lastIndexOf(I);return j===-1?t.length:h+j})():t.length,_=Wo(f),x=y&&_!==-1?h+_+1:h+f.length,E=t.slice(x,S===-1?t.length:S),M=n.parse(E,{__markstreamFinal:o}),R=n.renderer.render(M,n.options,{__markstreamFinal:o}),q=S+I.length,z=N?Math.max(S+T.length,r0e(t,q)):t.length,$=N?t.slice(S,z):T,B=N?t.slice(h,z):t.slice(h),P=y&&_!==-1?f.slice(0,_+1):f,H={...u,tag:"details",attrs:Lk(f.slice(0,_+1)),raw:B,content:`${P}${R}${$}`,children:[...C,...w],loading:!o&&!N};if(i.includeSourceMap&&(H.sourceMap=D0(t,h,N?z:t.length,i)),r.push(H),l=N?z:t.length,g===-1&&!y)break;g!==-1&&(a=g)}return[r,l]}function k0e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&_.end<=d.end){o.splice(N,1);continue}break}T=S+I.length,o.splice(N,1)}}return o}function b0e(e){const t=l=>l===" "||l===" "||l===` `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const v=g.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122},c=g=>{const v=g.charCodeAt(0);return v>=48&&v<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||v==='"'||v==="'"||v==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>Hj(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` `||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` -`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function QE(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let v=0;v=4)return!0;continue}if(y===" ")return!0;break}return!1},r=m=>{let g=!1,v=!1;for(let y=0;y")return y}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const v=m.replace(/^[ \t]+/,"");if(!v||v.startsWith(">")||v.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(v))return-1;let y=!1,b=0;for(;b=T.length){y=!0,b++;continue}const I=T[N];if(I==="!"||I==="?"){y=!0,b+=C+1;continue}if(I==="/"){y=!0,b+=C+1;continue}const S=N;for(;N"&&x!=="/"){y=!0,b++;continue}const E=new RegExp(String.raw`<\s*\/\s*${_}\s*>`,"i"),M=/\/\s*>$/.test(T),R=E.test(m.slice(b+C+1)),q=E.test(e.slice(g+b+C+1)),z=/[\r\n]/.test(e.slice(g+b+C+1));if(y&&n.has(_)&&!M&&!R&&(q||z))return b;y=!0,b+=C+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;h{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let v=0;v=4)return!0;continue}if(y===" ")return!0;break}return!1},r=m=>{let g=!1,v=!1;for(let y=0;y")return y}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const v=m.replace(/^[ \t]+/,"");if(!v||v.startsWith(">")||v.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(v))return-1;let y=!1,b=0;for(;b=T.length){y=!0,b++;continue}const I=T[N];if(I==="!"||I==="?"){y=!0,b+=C+1;continue}if(I==="/"){y=!0,b+=C+1;continue}const S=N;for(;N"&&x!=="/"){y=!0,b++;continue}const E=new RegExp(String.raw`<\s*\/\s*${_}\s*>`,"i"),M=/\/\s*>$/.test(T),R=E.test(m.slice(b+C+1)),q=E.test(e.slice(g+b+C+1)),z=/[\r\n]/.test(e.slice(g+b+C+1));if(y&&n.has(_)&&!M&&!R&&(q||z))return b;y=!0,b+=C+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",y=g?v?m-1:m:e.length,b=e.slice(h,y),w=g?v?`\r `:` `:"",C=l(b);let T=b;if(!u&&!C){const N=a(b,h);if(N!==-1){const I=w||` -`;T=`${b.slice(0,N).replace(/[ \t]+$/,"")}${I}${I}${b.slice(N).replace(/^[ \t]+/,"")}`}}f+=T,f+=w,C&&(u?C.markerChar===c&&C.markerLen>=d&&/^\s*$/.test(C.rest)&&(u=!1,c="",d=0):(u=!0,c=C.markerChar,d=C.markerLen)),h=g?m+1:e.length}return f}function A0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let v=g+1;for(;v=d.length||d[v]!=="/"){g=d.indexOf("<",g+1);continue}for(v++;vd.length){g=d.indexOf("<",g+1);continue}let y=!0;for(let w=0;w="A"&&C<="Z"?String.fromCharCode(C.charCodeAt(0)+32):C)!==m[w]){y=!1;break}}if(!y){g=d.indexOf("<",g+1);continue}let b=v+m.length;if(b")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;f=d&&/^\s*$/.test(C.rest)&&(u=!1,c="",d=0):(u=!0,c=C.markerChar,d=C.markerLen)),h=g?m+1:e.length}return f}function C0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let v=g+1;for(;v=d.length||d[v]!=="/"){g=d.indexOf("<",g+1);continue}for(v++;vd.length){g=d.indexOf("<",g+1);continue}let y=!0;for(let w=0;w="A"&&C<="Z"?String.fromCharCode(C.charCodeAt(0)+32):C)!==m[w]){y=!1;break}}if(!y){g=d.indexOf("<",g+1);continue}let b=v+m.length;if(b")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=a(m),u+=f?`\r `:` -`,c=d+1}return u}function x0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dString(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,v=e.slice(d,g),y=h?m?`\r `:` `:"",b=o(v),w=b?.prefix??"",C=b?.content??v,T=s(C);T&&(l?T.markerChar===a&&T.markerLen>=u&&/^\s*$/.test(T.rest)&&(l=!1,a="",u=0):(l=!0,a=T.markerChar,u=T.markerLen));let N=C;if(!l&&N.includes("{if(E.replace(/^[\t ]+/,"").startsWith("|"))return S;const M=E.slice(0,x).replace(/^[\t ]+/,"");if(M.length>0){const R=_.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",q=M.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!R||!q||R!==q)return S}return`${_} `});if(w){const I=w+N.split(` `).join(` -${w}`);c+=I}else c+=N;c+=y,d=h?f+1:e.length}return c}function S0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(M=>String(M??"").toLowerCase()));if(!n.size)return e;const i=M=>M===" "||M===" ",o=M=>{if(!M)return!1;if(M[0]===" ")return!0;let R=0;for(let q=0;q=4)return!0;continue}if(z===" ")return!0;break}return!1},s=M=>{const R=M.charCodeAt(0);return R>=65&&R<=90||R>=97&&R<=122||R>=48&&R<=57||M==="_"||M==="-"||M===":"},r=M=>{let R=0;for(;R{let R=0,q=!1,z=0;for(;R=M.length||M[R]!==">")break;for(q=!0,R++;Rr(M).startsWith("<"),u=M=>{for(let R=0;R{if(o(M))return"";const R=r(M);if(!R.startsWith("<"))return"";let q=1;for(;q=R.length||R[q]==="/"||R[q]==="!"||R[q]==="?")return"";const z=q;for(;q"&&B!=="/"?"":O},d=M=>{if(o(M))return null;const R=r(M);if(!R.startsWith("<"))return null;let q=1;for(;q=R.length)return null;const z=R[q]==="/";if(z)for(q++;q"&&H!=="/")return null;if(z)return{type:"close",name:P};if(/\/\s*>\s*$/.test(R))return{type:"open",name:P,complete:!0};const j=R.indexOf(">",q);if(j!==-1){const Z=R.slice(j+1);if(new RegExp(`<\\s*\\/\\s*${P}\\s*>`,"i").test(Z))return{type:"open",name:P,complete:!0}}return{type:"open",name:P,complete:!1}},f=M=>{if(o(M))return null;const R=r(M).replace(/[ \t]+$/,"");if(!R.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(R))return null;const q=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(q?.[1])return q[1].toLowerCase();const z=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!z?.[1]||!z[2])return null;const O=z[1].toLowerCase();return O===z[2].toLowerCase()?O:null};let h=!1,m="",g=0;const v=M=>{let R=0;for(;Rv(M),b=M=>{const R=r(M);return R?o(M)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(R):!1},w=(M,R,q)=>{let z=M,O=0;for(;zz&&e[B-1]==="\r",j=P?H?B-1:B:e.length,Z=e.slice(z,j),ie=l(Z),W=ie?.key??"";if(O>0&&R&&W!==R)break;const Q=ie?.content??Z,te=d(Q);if(te?.name===q){if(te.type==="open")te.complete||O++;else if(O>0&&(O--,O===0))return!1}else if(O>0&&(u(Q)||b(Q)))return!0;if(P)z=B+1;else break}return!1};let C="",T=0,N=!0,I=!1,S=!1,_=` +${w}`);c+=I}else c+=N;c+=y,d=h?f+1:e.length}return c}function x0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(M=>String(M??"").toLowerCase()));if(!n.size)return e;const i=M=>M===" "||M===" ",o=M=>{if(!M)return!1;if(M[0]===" ")return!0;let R=0;for(let q=0;q=4)return!0;continue}if(z===" ")return!0;break}return!1},s=M=>{const R=M.charCodeAt(0);return R>=65&&R<=90||R>=97&&R<=122||R>=48&&R<=57||M==="_"||M==="-"||M===":"},r=M=>{let R=0;for(;R{let R=0,q=!1,z=0;for(;R=M.length||M[R]!==">")break;for(q=!0,R++;Rr(M).startsWith("<"),u=M=>{for(let R=0;R{if(o(M))return"";const R=r(M);if(!R.startsWith("<"))return"";let q=1;for(;q=R.length||R[q]==="/"||R[q]==="!"||R[q]==="?")return"";const z=q;for(;q"&&B!=="/"?"":$},d=M=>{if(o(M))return null;const R=r(M);if(!R.startsWith("<"))return null;let q=1;for(;q=R.length)return null;const z=R[q]==="/";if(z)for(q++;q"&&H!=="/")return null;if(z)return{type:"close",name:P};if(/\/\s*>\s*$/.test(R))return{type:"open",name:P,complete:!0};const j=R.indexOf(">",q);if(j!==-1){const G=R.slice(j+1);if(new RegExp(`<\\s*\\/\\s*${P}\\s*>`,"i").test(G))return{type:"open",name:P,complete:!0}}return{type:"open",name:P,complete:!1}},f=M=>{if(o(M))return null;const R=r(M).replace(/[ \t]+$/,"");if(!R.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(R))return null;const q=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(q?.[1])return q[1].toLowerCase();const z=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!z?.[1]||!z[2])return null;const $=z[1].toLowerCase();return $===z[2].toLowerCase()?$:null};let h=!1,m="",g=0;const v=M=>{let R=0;for(;Rv(M),b=M=>{const R=r(M);return R?o(M)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(R):!1},w=(M,R,q)=>{let z=M,$=0;for(;zz&&e[B-1]==="\r",j=P?H?B-1:B:e.length,G=e.slice(z,j),ne=l(G),W=ne?.key??"";if($>0&&R&&W!==R)break;const Q=ne?.content??G,te=d(Q);if(te?.name===q){if(te.type==="open")te.complete||$++;else if($>0&&($--,$===0))return!1}else if($>0&&(u(Q)||b(Q)))return!0;if(P)z=B+1;else break}return!1};let C="",T=0,N=!0,I=!1,S=!1,_=` `;const x=[];let E="";for(;TT&&e[M-1]==="\r",z=R?q?M-1:M:e.length,O=e.slice(T,z),B=R?q?`\r +`,T),R=M!==-1,q=R&&M>T&&e[M-1]==="\r",z=R?q?M-1:M:e.length,$=e.slice(T,z),B=R?q?`\r `:` -`:"",P=l(O),H=P?.key??"",j=P?.content??O,Z=y(j);Z&&(h?Z.markerChar===m&&Z.markerLen>=g&&/^\s*$/.test(Z.rest)&&(h=!1,m="",g=0):(h=!0,m=Z.markerChar,g=Z.markerLen));const ie=x.length>0;if(!h&&!ie){const Q=c(j),te=!!Q&&!N&&I&&S&&w(T,H,Q);Q&&!N&&(!I||te)&&(H&&E&&H===E?C+=`${H}${_}`:H||(C+=_))}if(C+=O,C+=B,B&&(_=B),!h){const Q=d(j);if(Q){if(Q.type==="open")Q.complete||x.push(Q.name);else for(let te=x.length-1;te>=0;te--)if(x[te]===Q.name){x.length=te;break}}}const W=u(j);N=W,I=!W&&a(j),S=!W&&!!f(j),E=H,T=R?M+1:e.length}return C}function _0e(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=m7(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function c8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=_0e(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` +`:"",P=l($),H=P?.key??"",j=P?.content??$,G=y(j);G&&(h?G.markerChar===m&&G.markerLen>=g&&/^\s*$/.test(G.rest)&&(h=!1,m="",g=0):(h=!0,m=G.markerChar,g=G.markerLen));const ne=x.length>0;if(!h&&!ne){const Q=c(j),te=!!Q&&!N&&I&&S&&w(T,H,Q);Q&&!N&&(!I||te)&&(H&&E&&H===E?C+=`${H}${_}`:H||(C+=_))}if(C+=$,C+=B,B&&(_=B),!h){const Q=d(j);if(Q){if(Q.type==="open")Q.complete||x.push(Q.name);else for(let te=x.length-1;te>=0;te--)if(x[te]===Q.name){x.length=te;break}}}const W=u(j);N=W,I=!W&&a(j),S=!W&&!!f(j),E=H,T=R?M+1:e.length}return C}function S0e(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=p7(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function u8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=S0e(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` `)?` `:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` `)?` @@ -234,28 +234,28 @@ ${w}`);c+=I}else c+=N;c+=y,d=h?f+1:e.length}return c}function S0e(e,t){if(!e||!t `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` `)?` `:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` -`)),o=Vge(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=qh(i.customHtmlTags);if(r.length&&(o=C0e(o,r),o=A0e(o,r),o=S0e(o,r),o=x0e(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=w0e(o)),o}function M0e(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=vC.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-Age-xge),u=c8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:c8(t,n,e,i)}else l=c8(t,n,e,i);return n||(l=Kge(l,e)),vC.set(o,{source:t,safeMarkdown:l,mode:s}),l}function Gj(e,t,n={}){const i=Rj(n),o=i?La():0,s=!!n.final,r=(e??"").toString();$ge(t,n)&&(t.stream.reset(),Oge(t),vC.delete(t));const l=M0e(t,r,s,n);i&&xd(i,"safeMarkdownMs",La()-o);const a=n0e(l);if(a){if(n.includeSourceMap){const T={...n,__sourceLineMapper:QE(r,l)};a[0].sourceMap=F0(l,0,l.length,T)}const w=n.preTransformTokens,C=n.postTransformTokens;if(d7(t,n)||typeof w=="function"||typeof C=="function"){const T=qE(t,l,{__markstreamFinal:s},n),N=typeof w=="function"&&w(T)||T;typeof C=="function"&&C(N)}return OE(a,n,i,o)}const u=i?La():0,c=qE(t,l,{__markstreamFinal:s},n);if(i&&xd(i,"tokenizeMs",La()-u),!c||!Array.isArray(c))return OE([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,v=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),y={...n,validateLink:v,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?QE(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let b=Dge(t,l,h,y,i);if(f&&typeof f=="function"){const w=f(h);if(Array.isArray(w)){const C=w[0],T=C?.type;C&&typeof T=="string"?b=Tp(w,{...y,__customHtmlBlockCursor:0},i):b=w}}if(g0e(b)){const w=i?La():0;b=b0e(b,s,l,y),b=Zj(b,l,t,y,s)[0],b=m0e(b,t,y,s),i&&xd(i,"htmlBlockPassesMs",La()-w)}if(s){const w=new WeakSet,C=T=>{if(!T||typeof T!="object"||w.has(T))return;if(w.add(T),Array.isArray(T)){for(const I of T)C(I);return}const N=T;N.type==="html_block"&&N.loading===!0&&(N.loading=!1);for(const I of Object.values(N))C(I)};C(b)}return b=Oj(b,n),n.debug&&console.log("Parsed Markdown Tree Structure:",b),$j(b,i,o)}function YE(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=of(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)Mi(d,a,t);for(const d of c)ru(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&Mi(d,a,t);const f=KE(d,t);if(f){s&&VE(f,d);for(const h of f)ru(h,a,t);n.push(...f)}else ru(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const I0e=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,qg=/\d/u,T0e=/[,.!?;:,。;、!?:]/u,E0e=/\d\p{Script=Han}{1,3}$/u;function L0e(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&L0e(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,B0e=new Set([...kv,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),R0e=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function JE(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $0e(e){return typeof e=="string"?e:e==null?"":String(e)}function Qj(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function dd(e){return $0e(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Yj(e){return dd(e).replace(/`/g,"`")}function $k(e){return String(e??"").trim().toLowerCase()}function v7(e,t="safe"){const n=$k(e);return n?t==="escape"?!0:t==="trusted"?kv.has(n):!R0e.has(n):!1}function Jj(e,t="safe"){const n=$k(e);return n?t==="escape"?!0:t==="trusted"?kv.has(n):B0e.has(n):!1}function XE(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${Yj(i)}"`).join("")}function Xj(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(F0e);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function O0e(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||hh(o,{tagName:t,attrName:"srcset"})})}function eH(e,t,n,i){return bhe.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?O0e(t,i):!!(whe.has(e)&&t&&hh(t,{tagName:i,attrName:e}))}function Kf(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function tH(e,t,n,i=!1){if(t!=="safe"||$k(n)!=="a")return e;const o=Kf(e,"href");if(i&&(!o||!e[o])){const a=Kf(e,"target"),u=Kf(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Kf(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Kf(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function eL(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Qj(r)||eH(l,s,t,n)||(i[r]=s)}return tH(i,t,n,!!Kf(e,"href"))}function nH(e,t){const n=e.toLowerCase();return Uz.has(n)?!1:JE(t,n)||JE(t,e)}function y7(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Qj(r)||eH(l,s,t,n)||(i[r]=s)}return tH(i,t,n,!!Kf(e,"href"))}function Ug(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function $y(e,t="safe",n){const i=y7(Ug(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function P0e(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function z0e(e){const t={};for(const[n,i]of Object.entries(e))t[n]=P0e(i,n);return t}function d8(e){return e.trim().length>0}function iH(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);d8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=Xj(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);d8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Od.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function j0e(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=Xj(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Od.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function H0e(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${dd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${dd(i)}`:` ${dd(i)}="${Yj(o)}"`).join("");return e.type==="self_closing"?`<${dd(t)}${n} />`:`<${dd(t)}${n}>`}function W0e(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of iH(e))if((n.type==="tag_open"||n.type==="self_closing")&&nH(n.tagName??"",t))return!0;return!1}function l1(e,t="safe"){if(!e)return"";if(t==="escape")return dd(e);const n=j0e(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(dd(r.content??""));continue}const l=$k(r.tagName);if(!l)continue;if(Jj(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&v7(l,t)){o.push(H0e(r));continue}if(r.type==="self_closing"){o.push(`<${l}${XE(eL(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${XE(eL(r.attrs??{},t,l))}>`),Od.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const q0e=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],tL="http://www.w3.org/2000/svg",U0e=new Set(["script","style","iframe","object","embed","link","meta"]),V0e=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),K0e=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Z0e=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),G0e=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Q0e(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Y0e(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function J0e(e){const t=e.nodeName.toLowerCase();return t==="use"?Q0e(e):t==="image"?Y0e(e):t==="text"||t==="tspan"?!!e.textContent?.trim():G0e.has(t)}function X0e(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function eve(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?hh(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?hh(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":hh(s,{tagName:i,attrName:o})?"":s:""}function tve(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function sH(e){const t=oH(e),n=t.toLowerCase();let i=0;for(;in.test(t))||sH(t)}function nve(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function $2(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function rH(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!U0e.has(i)){if(i==="br"){t.push(` -`);return}for(const o of Array.from(n.childNodes))rH(o,t)}}function ive(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];rH(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=$2(t.getAttribute("width")),s=$2(t.getAttribute("height")),r=$2(t.getAttribute("x")),l=$2(t.getAttribute("y")),a=e.ownerDocument.createElementNS(tL,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(tL,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function ove(e){ive(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!V0e.has(i)){n.remove();continue}if(i==="style"&&nL(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&nL(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(K0e.has(r)&&s.value){const l=eve(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(Z0e.has(r)&&s.value&&sH(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=X0e(s.value);l!==s.value&&n.setAttribute(s.name,l)}}nve(n)}}function s9t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return ove(n),sve(n)?null:n}catch{return null}}function sve(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){J0e(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const O2=[];function f8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function rve(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function lve(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function iL(e=`editor-${Date.now()}`,t={}){const n=P1e(t),i=n;i.__markstreamRegisteredPluginCount=O2.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||O2.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...v]=m;typeof g=="function"&&n.use(g,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(O2.length)for(const h of O2)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(D0e),n.use(sue),n.use(nue);const r=yue,l=r.default??r;n.use(l),n.use(tue),n.use(eue),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,v=!!m.env?.__markstreamFinal,y=g.split(/\r?\n/);for(const b of m.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const w=b.map[0],C=b.map[1],T=b.markup,N=T[0],I=T.length,S=y[Math.max(0,C-1)]??"";let _=0;for(;_w+1&&x>=I&&E===S.length,R=b;R.meta=R.meta??{},R.meta.unclosed=!M,R.meta.closed=!!M}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],v=String(g.info??"").trim(),y=String(g.content??""),b=btoa(unescape(encodeURIComponent(y))),w=rve(v),C=f8(w),T=lve(`editor-${e}-${m}-${w}`),N=f8(s("common.copy"));return`
      +`)),o=Uge(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=Uh(i.customHtmlTags);if(r.length&&(o=w0e(o,r),o=C0e(o,r),o=x0e(o,r),o=A0e(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=b0e(o)),o}function _0e(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=gC.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-Cge-Age),u=u8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:u8(t,n,e,i)}else l=u8(t,n,e,i);return n||(l=Vge(l,e)),gC.set(o,{source:t,safeMarkdown:l,mode:s}),l}function Gj(e,t,n={}){const i=Rj(n),o=i?Ba():0,s=!!n.final,r=(e??"").toString();Rge(t,n)&&(t.stream.reset(),Oge(t),gC.delete(t));const l=_0e(t,r,s,n);i&&xd(i,"safeMarkdownMs",Ba()-o);const a=t0e(l);if(a){if(n.includeSourceMap){const T={...n,__sourceLineMapper:YE(r,l)};a[0].sourceMap=D0(l,0,l.length,T)}const w=n.preTransformTokens,C=n.postTransformTokens;if(c7(t,n)||typeof w=="function"||typeof C=="function"){const T=UE(t,l,{__markstreamFinal:s},n),N=typeof w=="function"&&w(T)||T;typeof C=="function"&&C(N)}return PE(a,n,i,o)}const u=i?Ba():0,c=UE(t,l,{__markstreamFinal:s},n);if(i&&xd(i,"tokenizeMs",Ba()-u),!c||!Array.isArray(c))return PE([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,v=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),y={...n,validateLink:v,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?YE(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let b=Nge(t,l,h,y,i);if(f&&typeof f=="function"){const w=f(h);if(Array.isArray(w)){const C=w[0],T=C?.type;C&&typeof T=="string"?b=Ep(w,{...y,__customHtmlBlockCursor:0},i):b=w}}if(m0e(b)){const w=i?Ba():0;b=k0e(b,s,l,y),b=Zj(b,l,t,y,s)[0],b=p0e(b,t,y,s),i&&xd(i,"htmlBlockPassesMs",Ba()-w)}if(s){const w=new WeakSet,C=T=>{if(!T||typeof T!="object"||w.has(T))return;if(w.add(T),Array.isArray(T)){for(const I of T)C(I);return}const N=T;N.type==="html_block"&&N.loading===!0&&(N.loading=!1);for(const I of Object.values(N))C(I)};C(b)}return b=$j(b,n),n.debug&&console.log("Parsed Markdown Tree Structure:",b),Oj(b,i,o)}function JE(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=of(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)Si(d,a,t);for(const d of c)lu(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&Si(d,a,t);const f=ZE(d,t);if(f){s&&KE(f,d);for(const h of f)lu(h,a,t);n.push(...f)}else lu(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const M0e=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,Hg=/\d/u,I0e=/[,.!?;:,。;、!?:]/u,T0e=/\d\p{Script=Han}{1,3}$/u;function E0e(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&E0e(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,F0e=new Set([...yv,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),B0e=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function XE(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function R0e(e){return typeof e=="string"?e:e==null?"":String(e)}function Qj(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function dd(e){return R0e(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Yj(e){return dd(e).replace(/`/g,"`")}function Rk(e){return String(e??"").trim().toLowerCase()}function g7(e,t="safe"){const n=Rk(e);return n?t==="escape"?!0:t==="trusted"?yv.has(n):!B0e.has(n):!1}function Jj(e,t="safe"){const n=Rk(e);return n?t==="escape"?!0:t==="trusted"?yv.has(n):F0e.has(n):!1}function eL(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${Yj(i)}"`).join("")}function Xj(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(D0e);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function O0e(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||ph(o,{tagName:t,attrName:"srcset"})})}function eH(e,t,n,i){return khe.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?O0e(t,i):!!(bhe.has(e)&&t&&ph(t,{tagName:i,attrName:e}))}function Zf(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function tH(e,t,n,i=!1){if(t!=="safe"||Rk(n)!=="a")return e;const o=Zf(e,"href");if(i&&(!o||!e[o])){const a=Zf(e,"target"),u=Zf(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Zf(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Zf(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function tL(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Qj(r)||eH(l,s,t,n)||(i[r]=s)}return tH(i,t,n,!!Zf(e,"href"))}function nH(e,t){const n=e.toLowerCase();return Uz.has(n)?!1:XE(t,n)||XE(t,e)}function v7(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Qj(r)||eH(l,s,t,n)||(i[r]=s)}return tH(i,t,n,!!Zf(e,"href"))}function Wg(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function Ry(e,t="safe",n){const i=v7(Wg(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function $0e(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function P0e(e){const t={};for(const[n,i]of Object.entries(e))t[n]=$0e(i,n);return t}function c8(e){return e.trim().length>0}function iH(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);c8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=Xj(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);c8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||$d.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function z0e(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=Xj(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||$d.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function j0e(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${dd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${dd(i)}`:` ${dd(i)}="${Yj(o)}"`).join("");return e.type==="self_closing"?`<${dd(t)}${n} />`:`<${dd(t)}${n}>`}function H0e(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of iH(e))if((n.type==="tag_open"||n.type==="self_closing")&&nH(n.tagName??"",t))return!0;return!1}function l1(e,t="safe"){if(!e)return"";if(t==="escape")return dd(e);const n=z0e(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(dd(r.content??""));continue}const l=Rk(r.tagName);if(!l)continue;if(Jj(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&g7(l,t)){o.push(j0e(r));continue}if(r.type==="self_closing"){o.push(`<${l}${eL(tL(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${eL(tL(r.attrs??{},t,l))}>`),$d.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const W0e=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],nL="http://www.w3.org/2000/svg",q0e=new Set(["script","style","iframe","object","embed","link","meta"]),U0e=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),V0e=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),K0e=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Z0e=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function G0e(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Q0e(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Y0e(e){const t=e.nodeName.toLowerCase();return t==="use"?G0e(e):t==="image"?Q0e(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Z0e.has(t)}function J0e(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function X0e(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?ph(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ph(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":ph(s,{tagName:i,attrName:o})?"":s:""}function eve(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function sH(e){const t=oH(e),n=t.toLowerCase();let i=0;for(;in.test(t))||sH(t)}function tve(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function R2(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function rH(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!q0e.has(i)){if(i==="br"){t.push(` +`);return}for(const o of Array.from(n.childNodes))rH(o,t)}}function nve(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];rH(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=R2(t.getAttribute("width")),s=R2(t.getAttribute("height")),r=R2(t.getAttribute("x")),l=R2(t.getAttribute("y")),a=e.ownerDocument.createElementNS(nL,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(nL,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function ive(e){nve(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!U0e.has(i)){n.remove();continue}if(i==="style"&&iL(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&iL(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(V0e.has(r)&&s.value){const l=X0e(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(K0e.has(r)&&s.value&&sH(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=J0e(s.value);l!==s.value&&n.setAttribute(s.name,l)}}tve(n)}}function n9t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return ive(n),ove(n)?null:n}catch{return null}}function ove(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){Y0e(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const O2=[];function d8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function sve(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function rve(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function oL(e=`editor-${Date.now()}`,t={}){const n=$1e(t),i=n;i.__markstreamRegisteredPluginCount=O2.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||O2.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...v]=m;typeof g=="function"&&n.use(g,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(O2.length)for(const h of O2)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(N0e),n.use(oue),n.use(tue);const r=vue,l=r.default??r;n.use(l),n.use(eue),n.use(Xae),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,v=!!m.env?.__markstreamFinal,y=g.split(/\r?\n/);for(const b of m.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const w=b.map[0],C=b.map[1],T=b.markup,N=T[0],I=T.length,S=y[Math.max(0,C-1)]??"";let _=0;for(;_w+1&&x>=I&&E===S.length,R=b;R.meta=R.meta??{},R.meta.unclosed=!M,R.meta.closed=!!M}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],v=String(g.info??"").trim(),y=String(g.content??""),b=btoa(unescape(encodeURIComponent(y))),w=sve(v),C=d8(w),T=rve(`editor-${e}-${m}-${w}`),N=d8(s("common.copy"));return`
      - ${f8(w.toUpperCase())} + ${d8(w.toUpperCase())}
      -
      `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const v=a.exec(g.src.slice(g.pos));if(!v)return!1;const y=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(y))return!1;const b=g.src.slice(g.pos+v[0].length);if(b.startsWith("](")||b.startsWith("(")||c(b))return!1;if(!m){const w=v[1],C=g.push("reference","span",0);C.content=w,C.markup=v[0],C.raw=v[0]}return g.pos+=v[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const v=String(h[m].content??"");return`${v}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const ave="modulepreload",uve=function(e){return"/"+e},oL={},Yo=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(u=>{if(u=uve(u),u in oL)return;oL[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":ave,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};function cve({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function lH({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:cve({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const dve={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function fve(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function aH(e){const t=fve(e);return dve[t]??t}function hve(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>aH(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function pve(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function mve(e){return pve(e)?.join("\0")??""}function gve(e,t){return`${mve(e)}\0\0${hve(t)?.join("\0")??""}`}function pp(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function sL(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var vve=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=rL();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=rL();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,v=wve(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(v-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const y=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=bve(this.source.slice(this.visible.length),y,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=pp(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,pp(i,1e3,1)),this.normalizedTargetLatencyMs=pp(o,900,1),this.normalizedCatchUpLatencyMs=pp(s,350,1),this.normalizedCatchUpThreshold=sL(r,600),this.normalizedStartDelayMs=sL(a,80),this.maxCommitFps=Math.trunc(pp(l,30,1)),this.maxCharsPerCommit=Math.trunc(pp(u,80,1)),this.flushOnFinish=c,this.segmenter=kve(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function yve(e={},t){const n=new vve(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function kve(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function bve(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function rL(){return typeof performance<"u"?performance.now():Date.now()}function wve(e,t,n){return Math.min(n,Math.max(t,e))}var Cve=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const kC=Symbol.for("markstream-vue:node-lifecycle");function r9t(){}const k7=new Map;let uH="material";const Pp=new Map,lL=new Map;let bC=null;function Ave(e){k7.set(e.id,e)}function xve(e){const t=k7.get(uH);if(!t)return;const n=t.core[e];if(n)return n;const i=Pp.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!Pp.has(t.id)&&_ve(t)}function Sve(){var e,t;return(t=(e=k7.get(uH))==null?void 0:e.fallback)!=null?t:""}function _ve(e){return Cve(this,null,function*(){var t,n,i;if(Pp.has(e.id))return(t=Pp.get(e.id))!=null?t:null;let o=lL.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(Pp.set(e.id,s),bC?.(),s)).catch(()=>(Pp.set(e.id,null),null)),lL.set(e.id,o)),o})}const aL='',uL='',Mve={id:"material",core:{"":uL,plain:'',text:uL,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:aL,csharp:aL,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>Yo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Ive=Ka(0);bC=()=>{Ive.value++},Ave(Mve);const Tve={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Ok(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=Tve[n])!=null?t:n}function l9t(e){const t=Ok(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function a9t(e){return xve(Ok(e))||Sve()}const cL={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var Pk=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let Pr=null,eh=!1,th=null,zk=w7;function Av(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function b7(){try{const e=globalThis;return Av(e?.katex)}catch{return null}}function w7(){return Pk(null,null,function*(){const e=b7();if(e)return e;const t=yield Yo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Yo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Av(t)})}function cH(e){const t=Promise.resolve(e).then(n=>{var i;return th===t&&n?(Pr=(i=Av(n))!=null?i:n,Pr):null}).catch(()=>null).finally(()=>{th===t&&(th=null)});return th=t,eh=!0,t}function Eve(e){zk=e,Pr=null,eh=!1,th=null}function Lve(e){Eve(w7)}function dH(){return typeof zk=="function"}function u9t(){var e;const t=zk;if(!t||t===w7)return null;if(Pr)return Pr;const n=b7();if(n)return Pr=n,Pr;if(eh)return null;try{const i=t();return i?typeof i?.then=="function"?(cH(i),null):(Pr=(e=Av(i))!=null?e:i,Pr):null}catch{return null}}function fH(){return Pk(this,null,function*(){var e;const t=b7();if(t)return Pr=t,Pr;if(Pr)return Pr;if(th)return th;if(eh)return null;const n=zk;if(!n)return eh=!0,null;try{const i=n();if(typeof i?.then=="function")return cH(i);if(i)return Pr=(e=Av(i))!=null?e:i,eh=!0,Pr}catch{}return eh=!0,null})}function hH(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Oy=null,$f=null;const $r=new Map,uc=new Map;let B0=5;const mh=new Set;function Vg(){if($r.size{const{id:n,html:i,error:o}=t.data,s=$r.get(n);if(s)if($r.delete(n),clearTimeout(s.timeoutId),s.cleanup(),Vg(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(uc.set(a,i),uc.size>200){const u=uc.keys().next().value;uc.delete(u)}}s.aborted||s.resolve(i)}},Oy.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of $r.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));$r.clear(),Nve()}}function Fve(e,t=!0,n=2e3,i){return Pk(this,null,function*(){performance.now();const o=hH(e);if(!dH()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if($f)return Promise.reject($f);const s=`${t?"d":"i"}:${o}`,r=uc.get(s);if(r)return Vg(),Promise.resolve(r);const l=Oy||($f=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$f.name="WorkerInitError",$f.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject($f);if($r.size>=B0){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=$r.size,a.max=B0,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=$r.get(c);if(!g)return;$r.delete(c),g.cleanup();const v=new Error("Worker render timed out");v.name="WorkerTimeout",v.code="WORKER_TIMEOUT",g.aborted||g.reject(v),Vg()},n);d=()=>{const g=$r.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const v=new Error("Aborted");v.name="AbortError",u(v)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;$r.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const v=$r.get(c);$r.delete(c),clearTimeout(f),v?.cleanup(),v?.reject(g),Vg()}})})}function c9t(e,t=!0,n){const i=`${t?"d":"i"}:${hH(e)}`;if(uc.set(i,n),uc.size>200){const o=uc.keys().next().value;uc.delete(o)}}const Bve="WORKER_BUSY";function Rve(e=2e3,t){return $r.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),mh.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},mh.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>Vg()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const Pm={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function d9t(e){return Pk(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!dH()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:Pm.timeout,u=(s=i.waitTimeout)!=null?s:Pm.waitTimeout,c=(r=i.backoffMs)!=null?r:Pm.backoffMs,d=(l=i.maxRetries)!=null?l:Pm.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Pm.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield Fve(t,n,a,h)}catch(g){if(g?.code!==Bve||m>=f)throw g;if(m++,yield Rve(u,h).catch(()=>{}),h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}c>0&&(yield new Promise(v=>globalThis.setTimeout(v,c*m)))}}})}function zp(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function $ve(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function n4(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=$ve(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function i4(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function pH(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function o4(e,t=360,n=500){return pH(e,t,n)}function s4(e,t=360,n=500){return pH(e,t,n)}var Ove=Object.defineProperty,Pve=Object.defineProperties,zve=Object.getOwnPropertyDescriptors,dL=Object.getOwnPropertySymbols,jve=Object.prototype.hasOwnProperty,Hve=Object.prototype.propertyIsEnumerable,fL=(e,t,n)=>t in e?Ove(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mH=(e,t)=>{for(var n in t||(t={}))jve.call(t,n)&&fL(e,n,t[n]);if(dL)for(var n of dL(t))Hve.call(t,n)&&fL(e,n,t[n]);return e},hL=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const r4=()=>Yo(()=>import("./mermaid.core-CGrLstUA.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Qu=null,jp=r4,cg=null,wC=!1,CC=!1,dg=0;function Wve(e){jp=e,dg++,Qu=null,cg=null,wC=!1,CC=!1}function qve(e){Wve(r4)}function pL(){return typeof jp=="function"}function mL(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=mH({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},Pve(n,zve(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function gL(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=mH({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function f9t(){return hL(this,null,function*(){if(Qu)return Qu;const e=(function(){try{const i=globalThis;return mL(i?.mermaid)}catch{return null}})();if(e)return Qu=e,gL(Qu),Qu;const t=jp,n=dg;return t?t===r4&&wC?null:cg||(cg=hL(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===r4)return n===dg&&t===jp&&(wC=!0,(function(s){CC||(CC=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===dg&&t===jp&&(cg=null)}return n!==dg||t!==jp?null:i?(Qu=mL(i),gL(Qu),Qu):null}),cg):null})}let cu=null,Of=null;const Na=new Map,Pf=new Map;function h8(e){for(const t of Na.values())t.reject(e);Na.clear(),Pf.clear()}let vL=5,yL=!1;const Uve="WORKER_BUSY",kL="MERMAID_DISABLED";function Vve(e){if(cu&&cu!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",h8(n)}cu=e,Of=null;const t=e;cu.onmessage=n=>{if(cu!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=Na.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},cu.onerror=n=>{var i,o;if(cu===t)if(Na.size!==0){try{yL?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}h8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},cu.onmessageerror=n=>{var i,o;if(cu===t)if(Na.size!==0){try{yL?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}h8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function gH(e,t,n,i){if(!pL()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=kL,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=Pf.get(o);return s||(s=(function(r,l,a=1400){if(!pL()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=kL,Promise.reject(c)}if(Of)return Promise.reject(Of);const u=cu||(Of=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Of.name="WorkerInitError",Of.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Of);if(Na.size>=vL){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=Uve,c.inFlight=Na.size,c.max=vL,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Na.delete(f))},v={resolve:y=>{g(),c(y)},reject:y=>{g(),d(y)}};Na.set(f,v);try{u.postMessage({id:f,action:r,payload:l})}catch(y){return Na.delete(f),void d(y)}h=globalThis.setTimeout(()=>{const y=new Error("Worker call timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT";const b=Na.get(f);b&&b.reject(y)},a)})})(e,t,n),Pf.set(o,s),s.then(()=>{Pf.get(o)===s&&Pf.delete(o)},()=>{Pf.get(o)===s&&Pf.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function h9t(e,t,n=1400,i){return gH("canParse",{code:e,theme:t},n,i)}function p9t(e,t,n=1400,i){return gH("findPrefix",{code:e,theme:t},n,i)}var Kve=Object.defineProperty,Zve=Object.defineProperties,Gve=Object.getOwnPropertyDescriptors,bL=Object.getOwnPropertySymbols,Qve=Object.prototype.hasOwnProperty,Yve=Object.prototype.propertyIsEnumerable,wL=(e,t,n)=>t in e?Kve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dt=(e,t)=>{for(var n in t||(t={}))Qve.call(t,n)&&wL(e,n,t[n]);if(bL)for(var n of bL(t))Yve.call(t,n)&&wL(e,n,t[n]);return e},Dn=(e,t)=>Zve(e,Gve(t)),fo=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const Jve="__global__",p8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",AC=(()=>{const e=globalThis;if(e[p8])return e[p8];const t={scopedCustomComponents:{},revision:Ka(0)};return e[p8]=t,t})(),CL=AC.revision,Xve=Symbol("markstreamCustomComponents"),e2e=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function xv(e){return e2e.has(String(e).trim().toLowerCase())}function t2e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function m8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([va(n),va(t2e(n))]))!o||xv(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function gs(e){const t=Jt(Xve,null);return D(()=>{var n;return CL.value,(function(i,o={}){return CL.value,Dt(Dt(Dt({},m8(AC.scopedCustomComponents[Jve]||{})),m8(o)),m8((function(s){return s&&AC.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const n2e=["aria-label"],i2e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},o2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},$i=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},Bl=$i(lt({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),L("svg",o2e,[...n[1]||(n[1]=[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),A("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),L("svg",i2e,[...n[0]||(n[0]=[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,n2e))}),[["__scopeId","data-v-be21ab83"]]);Bl.install=e=>{e.component(Bl.__name,Bl)};const s2e={class:"emoji-node"},cl=$i(lt({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",s2e,F(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);cl.install=e=>{e.component(cl.__name,cl)};const r2e=["id"],l2e=["title"],Rl=$i(lt({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),L("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[A("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+F(e.node.id)+"]",9,l2e)],8,r2e))}}),[["__scopeId","data-v-c1463a29"]]);Rl.install=e=>{e.component(Rl.__name,Rl)};const vH=(()=>{try{return!1}catch{}return!1})();function g8(e){vH&&console.warn(e)}function AL(e,t="safe",n){return y7(e,t,n)}function yH(e){return z0e(e)}function v8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function C7(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=$y((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),v8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),v8(r.value)]):Object.entries(o).map(([r,l])=>[r,v8(l)]):null,t,n);var o;if(!i)return;const s=yH(Ug(i));return Object.keys(s).length>0?s:void 0}function xL(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function zm(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function y8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return nH(d,f)})(e,i);if(kv.has(e.toLowerCase())||!l&&Jj(e,s))return null;if(!l&&v7(e,s))return r?[xL(e,t,!0)]:[xL(e,t),...n,``];const a=y7(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=yH(a);return Tn(d,Dn(Dt({},f),{key:c}),n.length>0?n:void 0)}return Tn(e,Dn(Dt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function kH(e,t){return W0e(e,t)}function l4(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=y8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);zm(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=y8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?zm(u[u.length-1].children,g):zm(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&g8(`Auto-closing unclosed tag: <${m.tagName}>`)}else g8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=y8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?zm(u[u.length-1].children,f):zm(c,f),g8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(iH(e),t,n)}catch(o){return i=o,vH&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const a2e=["innerHTML"],$l=$i(lt({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=gs(()=>t.customId),s=lt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:l1(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=l4(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!kH(l,o.value))return{mode:"html",content:l1(l,i.value)};const a=l4(l,o.value,i.value);return a===null?{mode:"html",content:l1(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),L("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[U(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),L("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},F(r.value.content),3)):(k(),L("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,a2e))}}),[["__scopeId","data-v-d17f12b0"]]);$l.install=e=>{e.component($l.__name,$l)};const u2e={class:"inline-code"},c2e={key:0},xr=$i(lt({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=q1(),i=Jt("markstreamFade",void 0),o=Jt("markstreamTextStreamState",void 0),s=Jt("markstreamStreamVersion",void 0),r=D(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=D(()=>!l.value),c=D(()=>{var b;const w=(b=n["index-key"])!=null?b:n.indexKey;return w==null||w===""?"":String(w)}),d=V(t.node.code),f=V(""),h=V(0);let m;function g(){m?.(),m=void 0}function v(){g(),f.value&&(d.value=d.value+f.value,f.value="")}We([()=>t.node.code,c,l],([b])=>{const w=String(b??""),C=c.value,T=lH({nextContent:w,persistedContent:C?o?.get(C):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=T.settledContent,f.value=T.streamedDelta,T.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const N=s.value;m=We(()=>s.value,I=>{I!==N&&v()},{flush:"sync"})})()):f.value||g(),C&&o?.set(C,w)},{immediate:!0}),Gd(g);const y=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,w)=>(k(),L("code",u2e,[u.value?(k(),L(De,{key:0},[$e(F(a.value),1)],64)):(k(),L(De,{key:1},[d.value?(k(),L("span",c2e,F(d.value),1)):ee("",!0),f.value?(k(),L("span",{key:1,class:Re(["inline-code-stream-delta",[y.value]]),onAnimationend:v},F(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);xr.install=e=>{e.component(xr.__name,xr)};const xC=V(!1),SL=V(""),_L=V("top"),Kg=V(null),Zg=V(null),SC=V(null),_C=V(null),ML=V(null);let Py=null,zy=null,MC=0;function bH(){Py&&(clearTimeout(Py),Py=null),zy&&(clearTimeout(zy),zy=null)}let P2=!1,z2=null,IL=!1;function d2e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++MC;bH();const l=()=>fo(null,null,function*(){var a,u;if(yield(function(){return fo(this,null,function*(){if(!P2&&!IL&&typeof document<"u"){z2!=null||(z2=fo(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([Yo(()=>import("./vue.runtime.esm-bundler-Ii2EKmOx.js"),[]),Yo(()=>import("./Tooltip-3Kylewm2.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:xC.value,"anchor-el":Kg.value,content:SL.value,placement:_L.value,id:Zg.value,originX:SC.value,originY:_C.value,isDark:(m=ML.value)!=null?m:void 0})}}).mount(h),P2=!0}));try{yield z2}catch(c){P2=!1,z2=null,IL=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),P2&&r===MC){Zg.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Kg.value=e,SL.value=t,_L.value=n,SC.value=(a=o?.x)!=null?a:null,_C.value=(u=o?.y)!=null?u:null,ML.value=typeof s=="boolean"?s:null,xC.value=!0;try{e.setAttribute("aria-describedby",Zg.value)}catch{}}});i?l():Py=setTimeout(l,80)}function f2e(e=!1){MC+=1,bH();const t=()=>{if(Kg.value&&Zg.value)try{Kg.value.removeAttribute("aria-describedby")}catch{}xC.value=!1,Kg.value=null,Zg.value=null,SC.value=null,_C.value=null};e?t():zy=setTimeout(t,120)}const h2e={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},p2e=Symbol("markstreamI18nFallback");function wH(e,t){var n;return(n=t?.[e])!=null?n:h2e[e]}const IC=(e,t)=>{var n;return(n=wH(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function TL(e,t){return{t(n){const i=wH(n,t);if(e.te&&i!=null&&!e.te(n))return IC(n,t);const o=e.t(n);return o===n&&i!=null?IC(n,t):o}}}function m2e(){const e=(function(){var n,i,o;try{const s=ps(),r=p2e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=ps(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return TL(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return TL({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>IC(n,e)}}const CH=Symbol("ViewportPriority"),AH=Symbol("ViewportPriorityOptions"),xH=Symbol("OffscreenHeavyNodeDeferral"),g2e=D(()=>!1),Th="400px";function A7(){return Jt(AH,void 0)}function x7(){return Jt(xH,g2e)}function v2e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?V(t):t,r=o?(n=window.requestIdleCallback)!=null?n:I=>window.setTimeout(()=>I({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:I=>window.clearTimeout(I):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(I){if(!I)return"viewport";let S=a.get(I);return S||(S=u++,a.set(I,S)),String(S)}function v(){if(h!=null){try{l?.(h)}catch{}h=null}}function y(I){if(I){const S=c.get(I);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(I)}}d.size||f.size||v()}function b(I){const S=d.get(I);if(!S)return;const _=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{_?.io.unobserve(I)}catch{}_?.targets.delete(I),d.delete(I),f.delete(I),y(S.bucketKey)}function w(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const I=f.values().next().value;I&&(f.delete(I),b(I),f.size&&w())},{timeout:1200}))}function C(I,S){if(!o||typeof IntersectionObserver>"u")return null;const _=(function(z,O){var B,P,H;return{root:(B=e?.(z??null))!=null?B:null,rootMargin:(P=O?.rootMargin)!=null?P:Th,threshold:(H=O?.threshold)!=null?H:0}})(I,S),x=[g((E=_).root),E.rootMargin,E.threshold].join("\0");var E;const M=c.get(x);if(M)return{key:x,bucket:M};let R;try{R=new IntersectionObserver(z=>{for(const O of z)(O.isIntersecting||O.intersectionRatio>0)&&b(O.target)},{root:_.root,rootMargin:_.rootMargin,threshold:_.threshold})}catch{return null}const q={io:R,targets:new Map};return c.set(x,q),{key:x,bucket:q}}function T(){if(o&&s.value)for(const[I,S]of Array.from(d.entries())){const _=C(I,S.opts);if(!_){b(I);continue}if(_.key===S.bucketKey)continue;const x=S.bucketKey,E=c.get(x);try{E?.io.unobserve(I)}catch{}E?.targets.delete(I),S.bucketKey=_.key,_.bucket.targets.set(I,S),_.bucket.io.observe(I),y(x)}}We(s,I=>{if(!I){for(const S of Array.from(d.keys()))b(S);v()}},{flush:"sync"});const N=(I,S)=>{const _=V(!1);let x,E=!1;const M=new Promise(O=>{x=()=>{E||(E=!0,O())}}),R=()=>{const O=d.get(I);if(!O)return f.delete(I),void y();const B=c.get(O.bucketKey);try{B?.io.unobserve(I)}catch{}B?.targets.delete(I),d.delete(I),f.delete(I),y(O.bucketKey)};if(!o||!s.value)return _.value=!0,x(),{isVisible:_,whenVisible:M,destroy:R};const q=C(I,S);if(!q)return _.value=!0,x(),{isVisible:_,whenVisible:M,destroy:R};const z={resolve:x,visible:_,bucketKey:q.key,opts:S};return d.set(I,z),q.bucket.targets.set(I,z),q.bucket.io.observe(I),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,T()})),S?.allowIdle!==!1&&(f.add(I),w()),{isVisible:_,whenVisible:M,destroy:R}};return N.refresh=T,ii(CH,N),N}function S7(){var e,t;const n=Jt(CH,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=V(!1);let v,y=!1;const b=new Promise(T=>{v=()=>{y||(y=!0,T())}}),w=()=>{const T=i.get(h);if(!T)return s.delete(h),void(s.size||u());const N=o.get(T.bucketKey);try{N?.io.unobserve(h)}catch{}i.delete(h),N?.targets.delete(h),s.delete(h),c(T.bucketKey),s.size||u()},C=(T=>{var N,I;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(R=>{var q,z;return[(q=R?.rootMargin)!=null?q:Th,(z=R?.threshold)!=null?z:0].join("\0")})(T),_=o.get(S);if(_)return{key:S,bucket:_};const x=(N=T?.rootMargin)!=null?N:Th;let E;try{E=new IntersectionObserver(R=>{for(const q of R)(q.isIntersecting||q.intersectionRatio>0)&&d(q.target)},{root:null,rootMargin:x,threshold:(I=T?.threshold)!=null?I:0})}catch{return null}const M={io:E,targets:new Set};return o.set(S,M),{key:S,bucket:M}})(m);return C?(i.set(h,{resolve:v,visible:g,bucketKey:C.key}),C.bucket.targets.add(h),C.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:b,destroy:w}):(g.value=!0,v(),{isVisible:g,whenVisible:b,destroy:w})}}function y2e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const k2e=["data-markstream-viewport-pending"],b2e=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],w2e={key:1,class:"image-placeholder"},C2e={key:1,class:"image-node__raw-text"},A2e={key:2,class:"image-shimmer-overlay"},x2e={key:1,class:"image-node__raw-text"},S2e={key:3,class:"image-error"},Sd=$i(lt({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=V(!1),a=V(!1),u=V(""),c=V("primary"),d=V(null),f=q1(),h=Jt(kC,null),m=S7(),g=A7(),v=x7(),y=D(()=>YT(s.node.src)),b=D(()=>YT(s.fallbackSrc)),w=(o=(i=(n=ps())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),C=typeof window<"u"&&w?.getAttribute("src")===(y.value||b.value),T=V(typeof window>"u"||C||!v.value),N=Ka(null);let I="",S=null;const _=D(()=>u.value),x=D(()=>!s.lazy),E=D(()=>typeof window<"u"&&v.value&&!C),M=D(()=>!E.value||T.value),R=D(()=>M.value?_.value:""),q=D(()=>{var ue,se;return(se=(ue=g?.value.heavyBlockMargin)!=null?ue:g?.value.rootMargin)!=null?se:Th}),z=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),O=D(()=>c.value==="failed"),B=D(()=>(!x.value||E.value&&!T.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),P=D(()=>y2e(s,f));function H(ue=P.value){ue&&d.value&&h?.reportHeight(ue,d.value.offsetHeight)}function j(ue=P.value){ue&&ht(()=>{H(ue)})}function Z(){S&&(clearTimeout(S),S=null)}function ie(){const ue=P.value;ue&&I!==ue&&(I&&h?.markSettled(I),Z(),I=ue,h?.markPending(ue),typeof window<"u"&&(S=window.setTimeout(()=>{I===ue&&(j(ue),W())},8e3)))}function W(){return fo(this,null,function*(){const ue=I;ue&&(Z(),I="",yield ht(),H(ue),h?.markSettled(ue))})}function Q(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void j();c.value="failed",a.value=!0,r("error",u.value),j()}function te(){l.value=!0,a.value=!1,r("load",_.value),j()}function X(ue){ue.preventDefault(),l.value&&!a.value&&r("click",[ue,_.value])}const{t:ge}=m2e();return We([y,b,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||y.value?(u.value=y.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&We([d,E],([ue,se],fe,G)=>{var ae;if((ae=N.value)==null||ae.destroy(),N.value=null,!se||T.value)return void(T.value=!0);if(!ue)return void(T.value=!1);let K=!0;const re=m(ue,{rootMargin:q.value,allowIdle:!1});N.value=re,T.value=re.isVisible.value,re.whenVisible.then(()=>{K&&N.value===re&&(T.value=!0)}),G(()=>{K=!1,re.destroy(),N.value===re&&(N.value=null)})},{immediate:!0}),We([z,l,a,_,()=>s.lazy,M],([ue,se,fe,G,ae,K])=>ue&&G&&!fe&&K?se?(W(),void j()):ae?(ie(),void j()):void(se||fe||ie()):(W(),void j()),{flush:"post",immediate:!0}),ti(()=>{var ue;(ue=N.value)==null||ue.destroy(),N.value=null,(function(){const se=I;se&&(Z(),I="",h?.markSettled(se))})()}),(ue,se)=>{var fe,G,ae,K,re;return k(),L("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":E.value&&!T.value?"true":void 0},[z.value?(k(),L("img",{key:0,src:R.value||void 0,alt:String((G=(fe=s.node.alt)!=null?fe:s.node.title)!=null?G:""),title:String((K=(ae=s.node.title)!=null?ae:s.node.alt)!=null?K:""),class:Re(["image-node__img",{"is-loading":!x.value&&!l.value,"is-loaded":x.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:x.value?"high":void 0,decoding:x.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(re=s.node.alt)!=null?re:p(ge)("image.preview"),onError:Q,onLoad:te,onClick:X},null,42,b2e)):ee("",!0),e.node.loading&&!a.value?(k(),L("span",w2e,[s.usePlaceholder?Un(ue.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[0]||(se[0]=A("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",C2e,F(e.node.raw),1))])):ee("",!0),B.value&&!e.node.loading?(k(),L("span",A2e,[s.usePlaceholder?Un(ue.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[1]||(se[1]=A("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",x2e,F(e.node.raw),1))])):ee("",!0),O.value?(k(),L("span",S2e,[Un(ue.$slots,"error",{node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[2]||(se[2]=A("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[A("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),A("span",null,F(p(ge)("image.loadError")),1)],!0)])):ee("",!0)],8,k2e)}}}),[["__scopeId","data-v-046e82ac"]]);Sd.install=e=>{e.component(Sd.__name,Sd)};const _2e={key:2},Pu=lt({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=gs(()=>t.customId),i=Jt("markstreamHtmlPolicy",void 0),o=Jt("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const v=(m=o?.value)!=null?m:{};return Dn(Dt({},v),{customId:(g=t.customId)!=null?g:v.customId,htmlPolicy:s.value})}),l=wu({loader:()=>Promise.resolve().then(()=>R7),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!xv(String(t.node.type)))),c=D(()=>u.value?C7(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(k(),de(Po(a.value),ui({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ce(()=>[d.value?(k(),de(p(l),ui({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),de(p(l),ui({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),de(Po(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),L("span",_2e,F(h.value),1)):ee("",!0)}}),EL=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function M2e(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Dn(Dt(Dt({},EL),n),{enabled:(t=n.enabled)==null||t})}return Dt({},EL)}function _7(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function SH(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function LL(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function I2e(e){var t;return e.diff===!0||LL(e.language)||LL(SH(String((t=e.raw)!=null?t:"")))}function T2e(e,t,n){const i=(function(o){const s=SH(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const E2e=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],L2e={key:0,translate:"no",class:"markstream-pre__diff-code"},N2e={class:"markstream-pre__diff-pane-content"},D2e={class:"markstream-pre__diff-number","aria-hidden":"true"},F2e={class:"markstream-pre__diff-content"},B2e={class:"markstream-pre__diff-content-inner"},R2e={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},$2e=["textContent"],O2e=["textContent"],ol=lt({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(X,ge){const ue=String(X??"");return ge?ue:ue.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var X,ge,ue;const se=String((ge=(X=t.node)==null?void 0:X.language)!=null?ge:"");return String((ue=String(se).split(/\s+/g)[0])!=null?ue:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var X;return t.loading===!0||((X=t.node)==null?void 0:X.loading)===!0}),r=D(()=>{var X;return n((X=t.node)==null?void 0:X.code,s.value)});let l="",a=1;const u=D(()=>(function(X){let ge=0,ue=1;X.startsWith(l)&&(ge=l.length,ue=a,ge>0&&X[ge-1]==="\r"&&X[ge]===` -`&&ge++);for(let se=ge;ser.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const X=u.value;X{var X;return t.showLineNumbers===!0&&((X=t.node)==null?void 0:X.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),v=D(()=>{const X=Number(t.reservedHeightPx);if(!Number.isFinite(X)||X<=0)return;const ge=`${Math.ceil(X)}px`;return s.value?{maxHeight:ge,overflow:"auto"}:{height:ge,minHeight:ge,maxHeight:ge,overflow:"auto"}}),y=["diff ","index ","--- ","+++ ","@@ "];function b(X){return String(X??"").trim().length===0}function w(X,ge="context",ue={}){const se=b(X);return{code:X,kind:se&&ge!=="hunk"&&ge!=="spacer"&&!ue.preserveBlankKind?"context":ge,empty:se}}function C(X){const ge=n(X,s.value);return ge?ge.split(/\r\n|\n|\r/):[]}function T(X,ge){return!b(X[ge])||gey.some(ue=>ge.startsWith(ue)))}function _(X,ge){return ge||!X.startsWith(" ")||X.startsWith(" ")?X:` ${X}`}function x(X,ge){const ue=X.length,se=ge.length,fe=[];let G=0;for(;G=G&&re>=G&&X[K]===ge[re];)ae.unshift({originalIndex:K,modifiedIndex:re}),K--,re--;const be=K-G+1,ke=re-G+1;if(be<=0||ke<=0||s.value||(be+1)*(ke+1)>15e5)return fe.concat(ae);const we=ke+1,oe=new Uint32Array((be+1)*(ke+1));for(let _e=be-1;_e>=0;_e--)for(let pe=ke-1;pe>=0;pe--){const ne=_e*we+pe;if(X[G+_e]===ge[G+pe])oe[ne]=oe[(_e+1)*we+pe+1]+1;else{const Ee=oe[(_e+1)*we+pe],qe=oe[_e*we+pe+1];oe[ne]=Ee>=qe?Ee:qe}}const le=[];let ye=0,Ae=0;for(;ye=oe[ye*we+Ae+1]?ye++:Ae++;return fe.concat(le,ae)}function E(X){var ge;const ue=(function(){var re,be;const ke=t.diffHideUnchangedRegions;if(ke==null||ke===!1)return null;const we=ke===!0?{}:ke;return we.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((re=we.contextLineCount)!=null?re:2)),minimumLineCount:Math.max(1,Math.floor((be=we.minimumLineCount)!=null?be:4))}})();if(!ue||X.length<1||X.length>2||X.length===2&&X[0].lines.length!==X[1].lines.length)return X;const se=X[0].lines,fe=(ge=X[1])==null?void 0:ge.lines,G=re=>se[re].kind==="context"&&(fe===void 0||fe[re].kind==="context"&&se[re].code===fe[re].code),ae=[];let K=0;for(;K=ue.minimumLineCount){const ke=re+(re===0?0:ue.contextLineCount),we=be-(be===se.length?0:ue.contextLineCount);we-ke>=ue.minimumLineCount&&ae.push({start:ke,end:we})}K===re&&K++}return ae.length?X.map((re,be)=>{const ke=[];let we=0;for(const oe of ae)ke.push(...re.lines.slice(we,oe.start)),ke.push({code:be===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${re.key}-collapsed-${oe.start}-${oe.end}`,number:""}),we=oe.end;return ke.push(...re.lines.slice(we)),Dn(Dt({},re),{lines:ke})}):X}const M=D(()=>{var X,ge,ue,se;if(!m.value)return[];const fe=(function(be){const ke=be.some(oe=>N(oe)),we=be.some(oe=>I(oe));return ke&&we||(function(){var oe,le,ye,Ae;if(i.value==="diff")return!0;const _e=(Ae=(ye=String((le=(oe=t.node)==null?void 0:oe.raw)!=null?le:"").split(/\r?\n/,1)[0])==null?void 0:ye.trim())!=null?Ae:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(_e)})()&&(ke||we)})(c.value),G=(function(){var be,ke;return((be=t.node)==null?void 0:be.originalCode)!=null||((ke=t.node)==null?void 0:ke.updatedCode)!=null})();if(g.value){const be=G?(function(ke,we){const oe=C(ke),le=C(we),ye=x(oe,le);if(ye.length>0){const qe=[];let ze=0,ft=0;for(const gt of ye){for(;ze=_e&&ne>=_e&&oe[pe]===le[ne];)Ee.unshift(Dn(Dt({},w(le[ne])),{key:`inline-suffix-${ne}`,number:ne+1})),pe--,ne--;for(let qe=_e;qe<=pe;qe++)Ae.push(Dn(Dt({},w(oe[qe],"removed",{preserveBlankKind:T(oe,qe)})),{key:`inline-removed-source-${qe}`,number:qe+1}));for(let qe=_e;qe<=ne;qe++)Ae.push(Dn(Dt({},w(le[qe],"added",{preserveBlankKind:T(le,qe)})),{key:`inline-added-source-${qe}`,number:qe+1}));return Ae.concat(Ee)})((X=t.node)==null?void 0:X.originalCode,(ge=t.node)==null?void 0:ge.updatedCode):(function(ke){const we=[];let oe=1,le=1;const ye=S(ke);for(const[Ae,_e]of ke.entries())if(_e.startsWith("@@")){const pe=_e.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);pe&&(oe=Number(pe[1]),le=Number(pe[2])),we.push(Dn(Dt({},w(_e,"hunk")),{key:`inline-hunk-${Ae}`,number:""}))}else if(N(_e))we.push(Dn(Dt({},w(_(_e.slice(1),ye),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Ae}`,number:oe++}));else if(I(_e))we.push(Dn(Dt({},w(_(_e.slice(1),ye),"added",{preserveBlankKind:!0})),{key:`inline-added-${Ae}`,number:le++}));else{const pe=ye&&_e.startsWith(" ")?_e.slice(1):_e;we.push(Dn(Dt({},w(pe)),{key:`inline-context-${Ae}`,number:le})),oe++,le++}return we})(c.value);return E([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:be}])}if(!fe&&G)return(function(be,ke){const we=C(be),oe=C(ke),le=x(we,oe),ye=[],Ae=[];let _e=0,pe=0,ne=0;const Ee=(qe,ze)=>{const ft=Math.max(qe-_e,ze-pe);for(let gt=0;gtDn(Dt({},be),{key:`original-${ke}`,number:ke+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:K.map((be,ke)=>Dn(Dt({},be),{key:`modified-${ke}`,number:ke+1}))}])}),R=D(()=>{var X,ge;if(t.showLineNumbers!==!0)return;let ue=m.value?1:u.value;if(m.value){ue=Math.max(ue,C((X=t.node)==null?void 0:X.originalCode).length,C((ge=t.node)==null?void 0:ge.updatedCode).length);for(const fe of M.value)for(const G of fe.lines)typeof G.number=="number"&&(ue=Math.max(ue,G.number))}const se=`${Math.max(2,String(ue).length)}ch`;return{"--markstream-pre-line-number-width":se,"--markstream-pre-diff-line-number-width":se,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),q=D(()=>M.value.some(X=>X.lines.some(ge=>ge.kind==="collapsed"))),z=D(()=>{const X=i.value;return X?`Code block: ${X}`:"Code block"}),O=V(null),B=V([]);let P=null,H=!1,j=null;function Z(X){const ge=Number.parseFloat(String(X??""));return Number.isFinite(ge)&&ge>0?ge:0}function ie(X,ge){var ue;if(!X)return ge;if(X.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const se=X.querySelector(".markstream-pre__diff-content"),fe=se?.getBoundingClientRect(),G=(ue=fe?.height)!=null?ue:0;return Math.max(ge,Math.ceil(G))}function W(){H||typeof window>"u"||(P!=null&&window.cancelAnimationFrame(P),P=window.requestAnimationFrame(()=>{P=null,H||(function(){var X,ge;P=null;const ue=O.value;if(!ue||!m.value||g.value||!ue.classList.contains("is-wrap"))return void(B.value.length&&(B.value=[]));const se=(function(ke){const we=window.getComputedStyle(ke),oe=Z(we.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const le=Z(we.lineHeight);return le>0?le:18})(ue),fe=Array.from(ue.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),G=Array.from(ue.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),ae=Math.max(fe.length,G.length),K=[];for(let ke=0;ke{const oe=be[we];return oe&&Math.abs(ke.rowHeight-oe.rowHeight)<=.5&&Math.abs(ke.originalHeight-oe.originalHeight)<=.5&&Math.abs(ke.modifiedHeight-oe.modifiedHeight)<=.5})||(B.value=K)})()}))}function Q(X){j?.disconnect(),j=null,X&&m.value&&!g.value&&typeof ResizeObserver<"u"&&(j=new ResizeObserver(()=>{W()}),j.observe(X))}function te(X,ge){const ue=B.value[X];if(!ue)return;const se=ge==="original"?ue.originalHeight:ue.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ue.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(se)}px`}}return We(O,X=>{Q(X),ht(()=>W())},{flush:"post"}),We([m,g,M],()=>{Q(O.value),ht(()=>W())},{flush:"post",immediate:!0}),ti(()=>{H=!0,P!=null&&(window.cancelAnimationFrame(P),P=null),j?.disconnect(),j=null}),(X,ge)=>(k(),L("pre",{ref_key:"preRef",ref:O,style:on([v.value,R.value]),class:Re([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":q.value}]),"aria-busy":s.value,"aria-label":z.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),L("code",L2e,[(k(!0),L(De,null,Ct(M.value,ue=>(k(),L("span",{key:ue.key,class:Re(["markstream-pre__diff-pane",ue.className])},[A("span",N2e,[(k(!0),L(De,null,Ct(ue.lines,(se,fe)=>(k(),L("span",{key:se.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${se.kind}`,{"markstream-pre__diff-line--empty":se.empty}]]),style:on(te(fe,ue.key))},[ge[0]||(ge[0]=A("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),A("span",D2e,F(se.number),1),A("span",F2e,[A("span",B2e,F(se.code),1)])],6))),128))])],2))),128))])):(k(),L(De,{key:1},[t.showLineNumbers?(k(),L("span",R2e,[A("span",{class:"markstream-pre__line-numbers-text",textContent:F(h.value)},null,8,$2e)])):ee("",!0),A("code",{translate:"no",class:"markstream-pre__code",textContent:F(r.value)},null,8,O2e)],64))],14,E2e))}});ol.install=e=>{e.component(ol.__name,ol)};const Wo=$i(lt({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=q1(),i=Jt("markstreamFade",void 0),o=Jt("markstreamTextStreamState",void 0),s=Jt("markstreamStreamVersion",void 0),r=D(()=>{const T=n.fade;return T===""||T===!0||T==="true"||T!==!1&&T!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var T;const N=(T=n["index-key"])!=null?T:n.indexKey;return N==null||N===""?"":String(N)}),u=V(t.node.content),c=V(""),d=V(0),f=V(t.node.content);let h;const m=V(null),g=V(null);let v="",y=null;function b(){h?.(),h=void 0}function w(){b(),c.value&&(u.value=u.value+c.value,c.value="")}We([u,m,g],function(){var T,N;const I=m.value;if(!I)return;const S=String((T=u.value)!=null?T:""),_=g.value;return y||(y=I.firstChild,v=(N=y?.data)!=null?N:""),S.startsWith(v)?!y&&S?(I.textContent=S,y=I.firstChild,void(v=S)):void(S.length>v.length&&_&&(_.appendChild(document.createTextNode(S.slice(v.length))),v=S)):(I.textContent=S,y=I.firstChild,_&&(_.textContent=""),void(v=S))},{immediate:!0}),We([()=>t.node.content,a,l],([T])=>{const N=String(T??""),I=a.value,S=lH({nextContent:N,persistedContent:I?o?.get(I):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=S.settledContent,c.value=S.streamedDelta,S.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const _=s.value;h=We(()=>s.value,x=>{x!==_&&w()},{flush:"sync"})})()):c.value||b(),I&&o?.set(I,N)},{immediate:!0}),Gd(b);const C=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(T,N)=>(k(),L("span",{class:Re([[e.node.center?"text-node-center":""],"text-node"])},[ai(A("span",{ref_key:"settledTextEl",ref:m},F(f.value),513),[[Go,u.value!==""]]),ai(A("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Go,u.value!==""]]),c.value?(k(),L("span",{key:0,class:Re(["text-node-stream-delta",[C.value]]),onAnimationend:w},F(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function fg(e,t,n){return lt({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=S7(),u=A7(),c=x7(),d=typeof window<"u"&&((l=(r=ps())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=V(typeof window>"u"||d||!c.value),h=Ka(null);let m=null;function g(v){const y=v&&"$el"in v?v.$el:v;h.value=y instanceof HTMLElement?y:null}return typeof window<"u"&&We([h,c],([v,y],b,w)=>{if(m?.destroy(),m=null,!y||f.value)return void(f.value=!0);if(!v)return;let C=!0;const T=a(v,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=T,f.value=T.isVisible.value,T.whenVisible.then(()=>{C&&m===T&&(f.value=!0)}),w(()=>{C=!1,T.destroy(),m===T&&(m=null)})},{immediate:!0}),ti(()=>{m?.destroy(),m=null}),()=>Tn(f.value?t:n,Dn(Dt({},o),{ref:g}),s)}})}Wo.install=e=>{e.component(Wo.__name,Wo)};const a4=lt({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=Ok(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=cL[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):cL[""]),f=I2e(n.node),h=T2e(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:_7(m??{},typeof window>"u"?0:window.innerWidth)),v=m?.diffAppearance,y=v==="dark"||v!=="light"&&n.isDark===!0,b=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,w=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),C=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,T=f?0:8,N=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:T,I=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:T,S=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",_=Dt(Dt({fontSize:`${b}px`,lineHeight:`${w}px`,tabSize:C,paddingTop:`${N}px`,paddingBottom:`${I}px`,"--markstream-pre-line-number-top":`${N}px`},f?{"--markstream-pre-diff-line-height":`${w}px`}:{}),S?{"--markstream-code-font-family":S}:{}),x=()=>Tn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Tn("svg",{class:"action-icon",width:"14",height:"14"})]),E=n.isShowPreview!==!1&&(c==="html"||c==="svg"),M=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||E&&n.showPreviewButton!==!1,R=z=>{if(z!=null)return typeof z=="number"?`${z}px`:String(z)},q=Dt(Dt(Dt({"--markstream-code-layout-character-width":"1ch"},R(n.minWidth)?{minWidth:R(n.minWidth)}:{}),R(n.maxWidth)?{maxWidth:R(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Tn("div",Dn(Dt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":y,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[q,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Tn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Tn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[Tn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),Tn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[Tn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?Tn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),Tn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Tn("div",{class:"code-diff-stats","aria-hidden":"true"},[Tn("span",{class:"code-diff-stat removed"},"-0"),Tn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:x(),n.showCollapseButton===!1?null:x(),M?Tn("div",{class:"relative"},[x()]):null])]),Tn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Tn(ol,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?M2e(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:_,"data-markstream-code-loading":"1"})]),Tn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Tn("div",{class:"loading-skeleton"},[Tn("div",{class:"skeleton-line"}),Tn("div",{class:"skeleton-line"}),Tn("div",{class:"skeleton-line short"})])]),Tn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),k8=fg("ViewportDeferredCodeBlockNode",wu({loader:()=>fo(null,null,function*(){try{return(yield Yo(()=>import("./CodeBlockNode-TQKPIcUp.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),ol}}),loadingComponent:a4,delay:0,suspensible:!1}),a4),Za=wu(()=>fo(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return Tn(Wo,Dn(Dt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield fH(),(yield Yo(()=>import("./index7-ClRJOaWc.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return Tn(Wo,Dn(Dt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),_H=wu(()=>fo(null,null,function*(){try{return yield fH(),(yield Yo(()=>import("./index6-RUyA_B9p.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return Tn(Wo,Dn(Dt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),Hr=$i(lt({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),L("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},F(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Hr.install=e=>{e.component(Hr.__name,Hr)};const P2e={class:"superscript-node"},dl=$i(lt({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,footnote_reference:Rl,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,emoji:cl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("sup",P2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);dl.install=e=>{e.component(dl.__name,dl)};const z2e={class:"subscript-node"},fl=$i(lt({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,footnote_reference:Rl,strikethrough:qr,highlight:Ol,insert:hl,superscript:dl,emoji:cl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("sub",z2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);fl.install=e=>{e.component(fl.__name,fl)};const j2e={class:"strong-node"},Wr=$i(lt({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,emphasis:Vr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("strong",j2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Wr.install=e=>{e.component(Wr.__name,Wr)};const H2e={class:"strikethrough-node"},qr=$i(lt({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("del",H2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);qr.install=e=>{e.component(qr.__name,qr)};const W2e=["href","title","aria-label","aria-hidden","target","rel"],q2e=["aria-hidden"],U2e={class:"link-text-wrapper relative inline-flex"},V2e={class:"leading-[normal] link-text"},Ur=$i(lt({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Jt("markstreamShowTooltips",void 0),i=D(()=>{const y=n?.value;return typeof y=="boolean"?y:t.showTooltip}),o=D(()=>{var y,b,w,C,T;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",I=(y=t.animationOpacity)!=null?y:.35,S=Math.max(.12,Math.min(.5*I,I)),_={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":N,"--underline-opacity":String(I),"--underline-rest-opacity":String(S),"--underline-duration":`${(w=t.animationDuration)!=null?w:1.6}s`,"--underline-timing":(C=t.animationTiming)!=null?C:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(T=t.animationIteration)!=null?T:"infinite"};return t.color&&(_["--link-color"]=t.color),_}),s=gs(()=>t.customId),r=D(()=>Dt({text:Wo,strong:Wr,strikethrough:qr,emphasis:Vr,image:Sd,html_inline:$l,inline_code:xr},s.value)),l=q1(),a=D(()=>{var y,b;const w=(y=t.node)==null?void 0:y.attrs;if(!w||typeof w!="object")return{};const C={};if(Array.isArray(w))for(const T of w)Array.isArray(T)&&T[0]&&(C[String(T[0])]=String((b=T[1])!=null?b:""));else for(const[T,N]of Object.entries(w))T&&N!=null&&N!==!1&&(C[T]=N===!0?"":String(N));return AL(C,"safe","a")}),u=D(()=>Dt(Dt({},l),a.value)),c=D(()=>{var y,b;return AL({href:String((b=(y=t.node)==null?void 0:y.href)!=null?b:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const y=u.value.target;return(typeof y=="string"?y.trim():String(y??"").trim())||(Ihe(c.value)?"_blank":void 0)}),f=D(()=>{var y;return String((y=d.value)!=null?y:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const y=u.value.rel,b=new Set((typeof y=="string"?y:String(y??"")).split(/\s+/).filter(Boolean)),w=new Set(Array.from(b).filter(C=>C.toLowerCase()!=="opener"));return f.value&&(w.add("noopener"),w.add("noreferrer")),w.size>0?Array.from(w).join(" "):void 0}),m=D(()=>{const y=Dt({},u.value);return delete y.title,delete y.href,delete y.target,delete y.rel,y});function g(){i.value&&f2e()}const v=D(()=>{var y,b;const w=(y=t.node)==null?void 0:y.title;return typeof w=="string"&&w.trim().length>0?w:String((b=c.value)!=null?b:"")});return(y,b)=>{var w,C;return e.node.loading?(k(),L("span",ui({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[A("span",U2e,[A("span",V2e,[U(p(Wo),{class:"leading-[normal] link-text",node:{type:"text",content:String((w=e.node.text)!=null?w:""),raw:String((C=e.node.text)!=null?C:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=A("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,q2e)):(k(),L("a",ui({key:0,class:"link-node",href:c.value,title:i.value?"":v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:b[0]||(b[0]=T=>(function(N){var I,S,_,x;if(!i.value)return;const E=N,M=E?.clientX!=null&&E?.clientY!=null?{x:E.clientX,y:E.clientY}:void 0,R=((I=t.node)==null?void 0:I.title)||((S=c.value)!=null&&S.includes("xn--")&&((x=(_=t.node)==null?void 0:_.text)!=null&&x.includes("://"))?t.node.text:c.value)||"";d2e(N.currentTarget,R,"top",!1,M)})(T)),onMouseleave:g}),[(k(!0),L(De,null,Ct(e.node.children,(T,N)=>(k(),de(p(Pu),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:T,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,W2e))}}}),[["__scopeId","data-v-367e6ca4"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const K2e={class:"insert-node"},hl=$i(lt({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:Ol,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("ins",K2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);hl.install=e=>{e.component(hl.__name,hl)};const Z2e={class:"highlight-node"},Ol=$i(lt({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,strikethrough:qr,insert:hl,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("mark",Z2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Ol.install=e=>{e.component(Ol.__name,Ol)};const G2e={class:"emphasis-node"},Vr=$i(lt({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("em",G2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Vr.install=e=>{e.component(Vr.__name,Vr)};const Q2e={class:"hard-break"},_d=$i(lt({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("br",Q2e))}),[["__scopeId","data-v-50c58f70"]]);_d.install=e=>{e.component(_d.__name,_d)};const R0=lt({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Et({checkbox:Bl,checkbox_input:Bl,emoji:cl,emphasis:Vr,hardbreak:_d,highlight:Ol,inline_code:xr,insert:hl,link:Ur,reference:Hr,strikethrough:qr,strong:Wr,subscript:fl,superscript:dl,text:Wo}),i=gs(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Dt(Dt({},n),s):n});return(s,r)=>(k(!0),L(De,null,Ct(e.nodes,(l,a)=>(k(),de(p(Pu),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function TC(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(TC)}function u4(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(TC))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(TC)?o:null}function Eh(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Y2e=["cite"],J2e={key:0,dir:"auto",class:"paragraph-node"},X2e=["custom-id"],jy=$i(lt({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>u4(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:Eh(s.value));return ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade)),(l,a)=>(k(),L("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),L("p",J2e,[r.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(r.value),9,X2e)):(k(),de(p(R0),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),de(p(pl),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Y2e))}}),[["__scopeId","data-v-abfecebc"]]);jy.install=e=>{e.component(jy.__name,jy)};const eye={class:"definition-list"},tye={class:"definition-term"},nye={class:"definition-desc"},Hy=$i(lt({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("dl",eye,[(k(!0),L(De,null,Ct(t.node.items,(o,s)=>(k(),L(De,{key:s},[A("dt",tye,[U(p(pl),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),A("dd",nye,[U(p(pl),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Hy.install=e=>{e.component(Hy.__name,Hy)};const iye=["href","title"],Gg=$i(lt({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),L("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,iye))}}),[["__scopeId","data-v-e1eb37b6"]]);Gg.install=e=>{e.component(Gg.__name,Gg)};const oye=["id"],sye={class:"flex-1"},Wy=lt({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[A("div",sye,[U(p(pl),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,oye))}});Wy.install=e=>{e.component(Wy.__name,Wy)};const rye=["custom-id"],EC=$i(lt({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=Jt("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:Eh(t.node.children)),s=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,image:Sd,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,checkbox:Bl,checkbox_input:Bl,footnote_reference:Rl,hardbreak:_d,math_inline:Za,reference:Hr},n.value));return(r,l)=>(k(),de(Po(`h${e.node.level}`),ui({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ce(()=>[o.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(o.value),9,rye)):(k(!0),L(De,{key:1},Ct(e.node.children,(a,u)=>(k(),de(p(Pu),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),jk=EC;jk.install=e=>{e.component(EC.__name,EC)};const lye={key:0,dir:"auto",class:"paragraph-node"},aye=["custom-id"],uye={dir:"auto",class:"paragraph-node"},cye=["custom-id"],a1=$i(lt({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=gs(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return u4((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const v=m.slice(1);if(!v.every(b=>b?.type==="list"))return null;const y=u4([g]);return y?{paragraphChildren:y,nestedLists:v}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?Eh(r.value):null),c=D(()=>{var h;return a()?Eh((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,v;return k(),L("li",ui({class:"list-item",dir:"auto"},f.value),[r.value?(k(),L("p",lye,[u.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(u.value),9,aye)):(k(),de(p(R0),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(k(),L(De,{key:1},[A("p",uye,[c.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(c.value),9,cye)):(k(),de(p(R0),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),L(De,null,Ct(l.value.nestedLists,(y,b)=>(k(),de(p(pl),{key:b,nodes:[y],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=w=>h.$emit("copy",w))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),de(p(pl),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(v=(g=n.value)==null?void 0:g.children)!=null?v:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=y=>h.$emit("copy",y))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);a1.install=e=>{e.component(a1.__name,a1)};const u1=$i(lt({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=gs(()=>e.customId),n=D(()=>t.value.list_item||a1);return(i,o)=>(k(),de(Po(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ce(()=>[(k(!0),L(De,null,Ct(e.node.items,(s,r)=>{var l;return k(),de(Po(n.value),ui({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);u1.install=e=>{e.component(u1.__name,u1)};const dye={key:2,class:"html-block-node__raw"},fye=["innerHTML"],hye={key:1,class:"html-block-node__placeholder"},Qg=$i(lt({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),i=Jt("markstreamNestedRendererProps",void 0),o=D(()=>{var M,R;return(R=(M=t.htmlPolicy)!=null?M:n?.value)!=null?R:"safe"}),s=D(()=>{var M,R;const q=(M=i?.value)!=null?M:{};return Dn(Dt({},q),{customId:(R=t.customId)!=null?R:q.customId,htmlPolicy:o.value})}),r=wu({loader:()=>Promise.resolve().then(()=>R7),suspensible:!1}),l=D(()=>{const M=$y(t.node.attrs,o.value);if(!M)return;const R=Ug(M);return Object.keys(R).length>0?R:void 0}),a=D(()=>{const M=String(t.node.tag||"").trim(),R=$y(t.node.attrs,o.value,M);if(!R)return;const q=Ug(R);return Object.keys(q).length>0?q:void 0}),u=gs(()=>t.customId),c=lt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=V(null),f=V(typeof window>"u"),h=V(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),v=D(()=>{var M;if(g.value.trim().toLowerCase()!=="details"||(M=t.node.attrs)!=null&&M.some(([q])=>String(q).toLowerCase()==="open"))return null;const R=m.value[0];return R?.type==="html_block"&&String(R.tag||"").toLowerCase()==="summary"?R:null}),y=D(()=>{var M;return Eh((M=v.value)==null?void 0:M.children)}),b=D(()=>{const M=v.value;if(!M)return;const R=$y(M.attrs,o.value,"summary");if(!R)return;const q=Ug(R);return Object.keys(q).length>0?q:void 0}),w=D(()=>y.value==null?m.value:m.value.slice(1)),C=D(()=>{const M=g.value.trim().toLowerCase();return Vz.has(M)||v7(M,o.value)}),T=D(()=>m.value.length>0&&!!t.node.tag&&!C.value),N=D(()=>{var M,R,q;if(T.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(M=h.value)!=null?M:""};const z=(R=h.value)!=null?R:t.node.content;if(!z)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:l1(z,o.value)};if(t.node.loading){const B=l4(z,u.value,o.value);return B===null?{mode:"text",content:(q=t.node.raw)!=null?q:z}:{mode:"dynamic",nodes:B}}if(!kH(z,u.value))return{mode:"html",content:l1(z,o.value)};const O=l4(z,u.value,o.value);return O===null?{mode:"html",content:l1(z,o.value)}:{mode:"dynamic",nodes:O}}),I=S7(),S=A7(),_=x7(),x=Ka(null),E=!!t.node.loading;return typeof window<"u"?(We([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([M],R,q)=>{var z,O,B,P;if((O=(z=x.value)==null?void 0:z.destroy)==null||O.call(z),x.value=null,!E)return f.value=!0,void(h.value=t.node.content);if(!M)return void(f.value=!1);let H=!0;const j=(P=(B=S?.value.heavyBlockMargin)!=null?B:S?.value.rootMargin)!=null?P:Th,Z=I(M,{rootMargin:j,allowIdle:!_.value});x.value=Z,f.value=f.value||Z.isVisible.value,Z.whenVisible.then(()=>{H&&x.value===Z&&(f.value=!0)}),q(()=>{H=!1,Z.destroy(),x.value===Z&&(x.value=null)})},{immediate:!0}),We(()=>t.node.content,M=>{E&&!f.value||(h.value=M)})):f.value=!0,ti(()=>{var M,R;(R=(M=x.value)==null?void 0:M.destroy)==null||R.call(M),x.value=null}),(M,R)=>(k(),de(Po(T.value?g.value:"div"),ui({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(_)&&!f.value?"true":void 0},T.value?a.value:void 0),{default:ce(()=>[f.value?(k(),L(De,{key:0},[N.value.mode==="structured"?(k(),L(De,{key:0},[y.value!==null?(k(),L(De,{key:0},[A("summary",VG(L$(b.value)),F(y.value),17),w.value.length?(k(),de(p(r),ui({key:0},s.value,{nodes:w.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(k(),de(p(r),ui({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):N.value.mode==="dynamic"?(k(),de(p(c),{key:1,nodes:N.value.nodes},null,8,["nodes"])):N.value.mode==="text"?(k(),L("pre",dye,F(N.value.content),1)):(k(),L("div",ui({key:3},l.value,{innerHTML:N.value.content}),null,16,fye))],64)):(k(),L("div",hye,[Un(M.$slots,"placeholder",{node:e.node},()=>[R[0]||(R[0]=A("span",{class:"html-block-node__placeholder-bar"},null,-1)),R[1]||(R[1]=A("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),R[2]||(R[2]=A("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Qg.install=e=>{e.component(Qg.__name,Qg)};const pye={dir:"auto",class:"paragraph-node"},mye=["custom-id"],gh=$i(lt({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=gs(()=>t.customId),i=Jt("markstreamHtmlPolicy",void 0),o=Jt("markstreamFade",void 0),s=Jt("markstreamParseOptions",void 0),r=Jt("markstreamCustomMarkdownIt",void 0),l=Jt("markstreamNestedRendererProps",void 0),a=D(()=>{var S;return(S=i?.value)!=null?S:"safe"}),u=D(()=>{var S;return(S=t.parseOptions)!=null?S:s?.value}),c=D(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=D(()=>{var S,_;return(_=t.customHtmlTags)!=null?_:(S=l?.value)==null?void 0:S.customHtmlTags}),f=D(()=>{var S,_;const x=(S=l?.value)!=null?S:{};return Dn(Dt({},x),{customId:(_=t.customId)!=null?_:x.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=wu({loader:()=>Promise.resolve().then(()=>R7),suspensible:!1});function m(S){var _;return S.type==="text"&&String((_=S.content)!=null?_:"").trim()===""}const g=D(()=>t.node.children.filter(S=>!m(S))),v=D(()=>g.value.length>0&&g.value.every(S=>S.type==="image"||(function(_){var x;const E=(function(M){return M.type==="link"&&Array.isArray(M.children)?M.children.filter(R=>!m(R)):[]})(_);return E.length===1&&((x=E[0])==null?void 0:x.type)==="image"})(S))),y=D(()=>new Set(qh(d.value))),b=D(()=>{if(!v.value||g.value.length<=1)return t.node.children;const S=[];for(let _=0;_0,M=t.node.children.slice(_+1).some(R=>!m(R));E&&M&&S.push(Dn(Dt({},x),{content:" ",raw:" "}))}return S}),w=D(()=>o?.value===!1&&!n.value.text),C=D(()=>w.value?Eh(b.value):null);function T(S,_){return{node:S,"index-key":`${t.indexKey}-${_}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=D(()=>Dt({inline_code:xr,image:Sd,link:Ur,hardbreak:_d,emphasis:Vr,strong:Wr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,html_inline:$l,html_block:Qg,emoji:cl,checkbox:Bl,math_inline:Za,checkbox_input:Bl,reference:Hr,footnote_anchor:Gg,footnote_reference:Rl,text:Wo},n.value)),I=D(()=>b.value.map((S,_)=>{var x;const E=(function(M){var R,q,z,O;if(M.type==="html_block"||M.type==="html_inline"){const B=String((R=M.tag)!=null?R:"").trim().toLowerCase()||Yz(M.content);if(B&&!y.value.has(B)&&Jz((q=M.content)!=null?q:M.raw,B)){const P=String((O=(z=M.content)!=null?z:M.raw)!=null?O:"");return{child:{type:"text",content:P,raw:P},component:Wo,isCustomComponent:!1}}}return{child:M,component:N.value[M.type],isCustomComponent:!!(n.value[M.type]&&!xv(String(M.type)))}})(S);return Dn(Dt({},E),{index:_,key:`${t.indexKey||"paragraph"}-${_}`,customAttrs:E.isCustomComponent?C7(E.child,a.value):void 0,hasSlotChildren:Array.isArray(E.child.children)&&E.child.children.length>0,slotContent:String((x=E.child.content)!=null?x:""),originalChild:S})}));return(S,_)=>(k(),L("p",pye,[C.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(C.value),9,mye)):(k(!0),L(De,{key:1},Ct(I.value,x=>{return k(),L(De,{key:x.key},[v.value&&m(x.originalChild)?(k(),L(De,{key:0},[$e(F((E=x.originalChild,String((M=E.content)!=null?M:""))),1)],64)):x.isCustomComponent?(k(),de(Po(x.component),ui({key:1,ref_for:!0},x.customAttrs,{node:x.child,loading:x.child.loading,"index-key":x.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ce(()=>[x.hasSlotChildren?(k(),de(p(h),ui({key:0,ref_for:!0},f.value,{nodes:x.child.children,"index-key":x.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):x.slotContent?(k(),de(p(h),ui({key:1,ref_for:!0},f.value,{content:x.slotContent,final:!x.child.loading,"index-key":`${x.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),de(Po(x.component),ui({key:2,ref_for:!0},T(x.child,x.index)),null,16))],64);var E,M}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);gh.install=e=>{e.component(gh.__name,gh)};const gye={class:"table-node-wrapper"},vye=["aria-busy"],yye={key:0},kye=["custom-id"],bye=["aria-label","onPointerdown"],wye=["custom-id"],Cye={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Yg=$i(lt({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var y;return(y=t.node.loading)!=null&&y}),i=D(()=>{var y;return(y=t.node.rows)!=null?y:[]}),o=V(null),s=V([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(y=>Number.isFinite(y)&&y>0)),u=D(()=>a.value?s.value.map(y=>y>0?{width:`${y}px`}:void 0):[]);ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade));const c=gs(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(y){const b=t.fade===!1&&!d.value,w=!f.value,C=h.get(y);if(C?.children===y.children&&C.textFastPath===b&&C.paragraphFastPath===w)return C.info;const T=u4(y.children,w,!0),N={simpleChildren:T,plainText:T&&b?Eh(T):null};return h.set(y,{children:y.children,textFastPath:b,paragraphFastPath:w,info:N}),N}function g(y){if(!r)return;y.preventDefault();const b=r.startWidth+r.nextStartWidth,w=Math.min(48,Math.floor(b/2)),C=Math.max(w,Math.min(b-w,Math.round(r.startWidth+y.clientX-r.startX))),T=[...r.widths];T[r.index]=C,T[r.index+1]=b-C,s.value=T}function v(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),r=null)}return We(l,()=>{v(),s.value=[]}),ti(v),(y,b)=>(k(),L("div",gye,[A("table",{ref_key:"tableRef",ref:o,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),L("colgroup",yye,[(k(!0),L(De,null,Ct(e.node.header.cells,(w,C)=>(k(),L("col",{key:C,style:on(u.value[C])},null,4))),128))])):ee("",!0),A("thead",null,[A("tr",null,[(k(!0),L(De,null,Ct(e.node.header.cells,(w,C)=>(k(),L("th",{key:C,dir:"auto",class:Re([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"])},[m(w).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(m(w).plainText),9,kye)):m(w).simpleChildren?(k(),de(p(R0),{key:1,nodes:m(w).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${C}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(pl),{key:2,nodes:w.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=T=>y.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),C(function(N,I){if(I.button!==0)return;const S=(function(){var E;const M=(E=o.value)==null?void 0:E.querySelectorAll("thead th");return Array.from(M??[],R=>Math.round(R.getBoundingClientRect().width))})(),_=S[N],x=S[N+1];_&&x&&(I.preventDefault(),r={index:N,startX:I.clientX,startWidth:_,nextStartWidth:x,widths:S},s.value=S,window.addEventListener("pointermove",g),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v))})(C,T)},null,40,bye)):ee("",!0)],2))),128))])]),A("tbody",null,[(k(!0),L(De,null,Ct(i.value,(w,C)=>(k(),L("tr",{key:C},[(k(!0),L(De,null,Ct(w.cells,(T,N)=>(k(),L("td",{key:N,class:Re([T.align==="right"?"text-right":T.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(T).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(m(T).plainText),9,wye)):m(T).simpleChildren?(k(),de(p(R0),{key:1,nodes:m(T).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${C}-${N}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(pl),{key:2,nodes:T.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=I=>y.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,vye),U(ko,{name:"table-node-fade"},{default:ce(()=>[n.value?(k(),L("div",Cye,[Un(y.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=A("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=A("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Yg.install=e=>{e.component(Yg.__name,Yg)};const Aye={class:"hr-node"},qy=$i({},[["render",function(e,t){return k(),L("hr",Aye)}],["__scopeId","data-v-39b2349c"]]);qy.install=e=>{e.component(qy.__name,qy)};const xye={class:"unknown-node"},LC=lt({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),L("div",xye,F(e.node.raw),1))}),Uy=$i(lt({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=gs(()=>t.customId),o=D(()=>Dt({text:Wo,paragraph:gh,heading:jk,inline_code:xr,link:Ur,image:Sd,strong:Wr,emphasis:Vr,strikethrough:qr,insert:hl,subscript:fl,superscript:dl,checkbox:Bl,checkbox_input:Bl,hardbreak:_d,math_inline:Za,reference:Hr,list:u1,math_block:_H,table:Yg},i.value));return(s,r)=>(k(),L("div",ui({class:n.value},e.node.attrs),[(k(!0),L(De,null,Ct(e.node.children,(l,a)=>{return k(),de(Po((u=l.type,o.value[u]||LC)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Uy.install=e=>{e.component(Uy.__name,Uy)};const Sye=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],NL=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function _ye(e){if(e<=255)return Sye[e];let t=0,n=NL.length-1;for(;t<=n;){const i=t+n>>1,o=NL[i];if(eo[1]))return o[2];t=i+1}}return"L"}const Mye=/[ \t\n\r\f]+/g,Iye=/[\t\n\r\f]| {2,}|^ | $/;let b8=null;const Tye=new RegExp("\\p{Script=Arabic}","u"),jd=new RegExp("\\p{M}","u"),M7=new RegExp("\\p{Nd}","u");function DL(e){return Tye.test(e)}function FL(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Au(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(FL(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(FL(n))return!0}}return!1}const Eye=new Set([" "," ","⁠","\uFEFF"]),Lye=new Set(["-","‐","–","—"]);function MH(e,t){return!((function(n){const i=Jg(n);return i!==null&&Eye.has(i)})(e)||t&&((function(n){const i=Jg(n);return i!==null&&(I7.has(i)||Lh.has(i))})(e)||(function(n){const i=Jg(n);return i!==null&&Lye.has(i)})(e)))}const I7=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Hk=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),T7=new Set(["'","’"]),Lh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Nye=new Set([":",".","،","؛"]),Dye=new Set(["၏"]),Fye=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Bye(e){if(E7(e))return!0;let t=!1;for(const n of e)if(Lh.has(n)||d4(n))t=!0;else if(!t||!jd.test(n))return!1;return t}function Rye(e){for(const t of e)if(!I7.has(t)&&!Lh.has(t))return!1;return e.length>0}function $ye(e){if(E7(e))return!0;for(const t of e)if(!(Hk.has(t)||T7.has(t)||jd.test(t)||d4(t)))return!1;return e.length>0}function E7(e){let t=!1;for(const n of e)if(n!=="\\"&&!jd.test(n)){if(!(Hk.has(n)||Lh.has(n)||T7.has(n)))return!1;t=!0}return t}function c4(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function Jg(e){if(e.length===0)return null;const t=c4(e,e.length);return e.slice(t)}const Oye=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function d4(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,Oye)}function Pye(e){const t=(function(n){for(const i of n)if(!jd.test(i))return i;return null})(e);return t!==null&&M7.test(t)}function zye(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(jd.test(i))n--;else{if(!Hk.has(i)&&!T7.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function jye(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function BL(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function RL(e,t){return e&&t!==null&&Nye.has(t)}function Hye(e){const t=Jg(e);return t!==null&&Dye.has(t)}function Wye(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function NC(e){let t=e.length;for(;t>0;){const n=c4(e,t),i=e.slice(n,t);if(Fye.has(i))return!0;if(!Lh.has(i))return!1;t=n}return!1}function qye(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Uye=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ia(e){return e.length===1?e[0]:e.join("")}function Vye(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Ia(n)}function Kye(e,t,n,i){if(!Uye.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=qye(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:Ia(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:Ia(r),isWordLike:a,kind:s,start:l}),o}function w8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Zye=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Gye(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Zye.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!e9e.has(e)&&!Xye.test(e)&&Jye.test(e)}function $L(e){let t=!1;for(const n of e)if(!jd.test(n)){if(!IH(n))return!1;t=!0}return t}function t9e(e,t,n,i){const o=!t&&$L(e),s=!i&&$L(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=c4(c,d),h=c.slice(f,d);if(!jd.test(h))return h;d=f}return null})(a);return u!==null&&d4(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=c4(a,u),d=a.slice(c,u);if(!jd.test(d))return IH(d)||d4(d);u=c}return!1})(e);return!!(o||s||l)&&!Au(e)&&!Au(n)&&(t||o||r)&&(i||s)}function OL(e){for(const t of e)if(M7.test(t))return!0;return!1}function Vy(e){if(e.length===0)return!1;for(const t of e)if(!M7.test(t)&&!Yye.has(t))return!1;return!0}function n9e(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o`};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const v=a.exec(g.src.slice(g.pos));if(!v)return!1;const y=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(y))return!1;const b=g.src.slice(g.pos+v[0].length);if(b.startsWith("](")||b.startsWith("(")||c(b))return!1;if(!m){const w=v[1],C=g.push("reference","span",0);C.content=w,C.markup=v[0],C.raw=v[0]}return g.pos+=v[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const v=String(h[m].content??"");return`${v}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const lve="modulepreload",ave=function(e){return"/"+e},sL={},Jo=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(u=>{if(u=ave(u),u in sL)return;sL[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":lve,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};function uve({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function lH({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:uve({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const cve={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function dve(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function aH(e){const t=dve(e);return cve[t]??t}function fve(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>aH(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function hve(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function pve(e){return hve(e)?.join("\0")??""}function mve(e,t){return`${pve(e)}\0\0${fve(t)?.join("\0")??""}`}function mp(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function rL(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var gve=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=lL();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=lL();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,v=bve(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(v-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const y=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=kve(this.source.slice(this.visible.length),y,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=mp(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,mp(i,1e3,1)),this.normalizedTargetLatencyMs=mp(o,900,1),this.normalizedCatchUpLatencyMs=mp(s,350,1),this.normalizedCatchUpThreshold=rL(r,600),this.normalizedStartDelayMs=rL(a,80),this.maxCommitFps=Math.trunc(mp(l,30,1)),this.maxCharsPerCommit=Math.trunc(mp(u,80,1)),this.flushOnFinish=c,this.segmenter=yve(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function vve(e={},t){const n=new gve(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function yve(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function kve(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function lL(){return typeof performance<"u"?performance.now():Date.now()}function bve(e,t,n){return Math.min(n,Math.max(t,e))}var wve=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const yC=Symbol.for("markstream-vue:node-lifecycle");function i9t(){}const y7=new Map;let uH="material";const zp=new Map,aL=new Map;let kC=null;function Cve(e){y7.set(e.id,e)}function Ave(e){const t=y7.get(uH);if(!t)return;const n=t.core[e];if(n)return n;const i=zp.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!zp.has(t.id)&&Sve(t)}function xve(){var e,t;return(t=(e=y7.get(uH))==null?void 0:e.fallback)!=null?t:""}function Sve(e){return wve(this,null,function*(){var t,n,i;if(zp.has(e.id))return(t=zp.get(e.id))!=null?t:null;let o=aL.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(zp.set(e.id,s),kC?.(),s)).catch(()=>(zp.set(e.id,null),null)),aL.set(e.id,o)),o})}const uL='',cL='',_ve={id:"material",core:{"":cL,plain:'',text:cL,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:uL,csharp:uL,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>Jo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Mve=Ya(0);kC=()=>{Mve.value++},Cve(_ve);const Ive={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Ok(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=Ive[n])!=null?t:n}function o9t(e){const t=Ok(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function s9t(e){return Ave(Ok(e))||xve()}const dL={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var $k=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let $r=null,th=!1,nh=null,Pk=b7;function Cv(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function k7(){try{const e=globalThis;return Cv(e?.katex)}catch{return null}}function b7(){return $k(null,null,function*(){const e=k7();if(e)return e;const t=yield Jo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Jo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Cv(t)})}function cH(e){const t=Promise.resolve(e).then(n=>{var i;return nh===t&&n?($r=(i=Cv(n))!=null?i:n,$r):null}).catch(()=>null).finally(()=>{nh===t&&(nh=null)});return nh=t,th=!0,t}function Tve(e){Pk=e,$r=null,th=!1,nh=null}function Eve(e){Tve(b7)}function dH(){return typeof Pk=="function"}function r9t(){var e;const t=Pk;if(!t||t===b7)return null;if($r)return $r;const n=k7();if(n)return $r=n,$r;if(th)return null;try{const i=t();return i?typeof i?.then=="function"?(cH(i),null):($r=(e=Cv(i))!=null?e:i,$r):null}catch{return null}}function fH(){return $k(this,null,function*(){var e;const t=k7();if(t)return $r=t,$r;if($r)return $r;if(nh)return nh;if(th)return null;const n=Pk;if(!n)return th=!0,null;try{const i=n();if(typeof i?.then=="function")return cH(i);if(i)return $r=(e=Cv(i))!=null?e:i,th=!0,$r}catch{}return th=!0,null})}function hH(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Oy=null,$f=null;const Rr=new Map,cc=new Map;let F0=5;const gh=new Set;function qg(){if(Rr.size{const{id:n,html:i,error:o}=t.data,s=Rr.get(n);if(s)if(Rr.delete(n),clearTimeout(s.timeoutId),s.cleanup(),qg(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(cc.set(a,i),cc.size>200){const u=cc.keys().next().value;cc.delete(u)}}s.aborted||s.resolve(i)}},Oy.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of Rr.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));Rr.clear(),Lve()}}function Dve(e,t=!0,n=2e3,i){return $k(this,null,function*(){performance.now();const o=hH(e);if(!dH()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if($f)return Promise.reject($f);const s=`${t?"d":"i"}:${o}`,r=cc.get(s);if(r)return qg(),Promise.resolve(r);const l=Oy||($f=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$f.name="WorkerInitError",$f.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject($f);if(Rr.size>=F0){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Rr.size,a.max=F0,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=Rr.get(c);if(!g)return;Rr.delete(c),g.cleanup();const v=new Error("Worker render timed out");v.name="WorkerTimeout",v.code="WORKER_TIMEOUT",g.aborted||g.reject(v),qg()},n);d=()=>{const g=Rr.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const v=new Error("Aborted");v.name="AbortError",u(v)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;Rr.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const v=Rr.get(c);Rr.delete(c),clearTimeout(f),v?.cleanup(),v?.reject(g),qg()}})})}function l9t(e,t=!0,n){const i=`${t?"d":"i"}:${hH(e)}`;if(cc.set(i,n),cc.size>200){const o=cc.keys().next().value;cc.delete(o)}}const Fve="WORKER_BUSY";function Bve(e=2e3,t){return Rr.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),gh.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},gh.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>qg()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const $m={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function a9t(e){return $k(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!dH()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:$m.timeout,u=(s=i.waitTimeout)!=null?s:$m.waitTimeout,c=(r=i.backoffMs)!=null?r:$m.backoffMs,d=(l=i.maxRetries)!=null?l:$m.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):$m.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield Dve(t,n,a,h)}catch(g){if(g?.code!==Fve||m>=f)throw g;if(m++,yield Bve(u,h).catch(()=>{}),h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}c>0&&(yield new Promise(v=>globalThis.setTimeout(v,c*m)))}}})}function jp(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function Rve(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function t4(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=Rve(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function n4(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function pH(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function i4(e,t=360,n=500){return pH(e,t,n)}function o4(e,t=360,n=500){return pH(e,t,n)}var Ove=Object.defineProperty,$ve=Object.defineProperties,Pve=Object.getOwnPropertyDescriptors,fL=Object.getOwnPropertySymbols,zve=Object.prototype.hasOwnProperty,jve=Object.prototype.propertyIsEnumerable,hL=(e,t,n)=>t in e?Ove(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mH=(e,t)=>{for(var n in t||(t={}))zve.call(t,n)&&hL(e,n,t[n]);if(fL)for(var n of fL(t))jve.call(t,n)&&hL(e,n,t[n]);return e},pL=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const s4=()=>Jo(()=>import("./mermaid.core-XMN3hSDH.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Yu=null,Hp=s4,ug=null,bC=!1,wC=!1,cg=0;function Hve(e){Hp=e,cg++,Yu=null,ug=null,bC=!1,wC=!1}function Wve(e){Hve(s4)}function mL(){return typeof Hp=="function"}function gL(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=mH({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},$ve(n,Pve(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function vL(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=mH({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function u9t(){return pL(this,null,function*(){if(Yu)return Yu;const e=(function(){try{const i=globalThis;return gL(i?.mermaid)}catch{return null}})();if(e)return Yu=e,vL(Yu),Yu;const t=Hp,n=cg;return t?t===s4&&bC?null:ug||(ug=pL(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===s4)return n===cg&&t===Hp&&(bC=!0,(function(s){wC||(wC=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===cg&&t===Hp&&(ug=null)}return n!==cg||t!==Hp?null:i?(Yu=gL(i),vL(Yu),Yu):null}),ug):null})}let du=null,Pf=null;const Ra=new Map,zf=new Map;function f8(e){for(const t of Ra.values())t.reject(e);Ra.clear(),zf.clear()}let yL=5,kL=!1;const qve="WORKER_BUSY",bL="MERMAID_DISABLED";function Uve(e){if(du&&du!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",f8(n)}du=e,Pf=null;const t=e;du.onmessage=n=>{if(du!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=Ra.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},du.onerror=n=>{var i,o;if(du===t)if(Ra.size!==0){try{kL?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}f8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},du.onmessageerror=n=>{var i,o;if(du===t)if(Ra.size!==0){try{kL?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}f8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function gH(e,t,n,i){if(!mL()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=bL,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=zf.get(o);return s||(s=(function(r,l,a=1400){if(!mL()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=bL,Promise.reject(c)}if(Pf)return Promise.reject(Pf);const u=du||(Pf=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Pf.name="WorkerInitError",Pf.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Pf);if(Ra.size>=yL){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=qve,c.inFlight=Ra.size,c.max=yL,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Ra.delete(f))},v={resolve:y=>{g(),c(y)},reject:y=>{g(),d(y)}};Ra.set(f,v);try{u.postMessage({id:f,action:r,payload:l})}catch(y){return Ra.delete(f),void d(y)}h=globalThis.setTimeout(()=>{const y=new Error("Worker call timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT";const b=Ra.get(f);b&&b.reject(y)},a)})})(e,t,n),zf.set(o,s),s.then(()=>{zf.get(o)===s&&zf.delete(o)},()=>{zf.get(o)===s&&zf.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function c9t(e,t,n=1400,i){return gH("canParse",{code:e,theme:t},n,i)}function d9t(e,t,n=1400,i){return gH("findPrefix",{code:e,theme:t},n,i)}var Vve=Object.defineProperty,Kve=Object.defineProperties,Zve=Object.getOwnPropertyDescriptors,wL=Object.getOwnPropertySymbols,Gve=Object.prototype.hasOwnProperty,Qve=Object.prototype.propertyIsEnumerable,CL=(e,t,n)=>t in e?Vve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nt=(e,t)=>{for(var n in t||(t={}))Gve.call(t,n)&&CL(e,n,t[n]);if(wL)for(var n of wL(t))Qve.call(t,n)&&CL(e,n,t[n]);return e},Fn=(e,t)=>Kve(e,Zve(t)),ro=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const Yve="__global__",h8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",CC=(()=>{const e=globalThis;if(e[h8])return e[h8];const t={scopedCustomComponents:{},revision:Ya(0)};return e[h8]=t,t})(),AL=CC.revision,Jve=Symbol("markstreamCustomComponents"),Xve=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function Av(e){return Xve.has(String(e).trim().toLowerCase())}function e2e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function p8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([Ca(n),Ca(e2e(n))]))!o||Av(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function ms(e){const t=Yt(Jve,null);return D(()=>{var n;return AL.value,(function(i,o={}){return AL.value,Nt(Nt(Nt({},p8(CC.scopedCustomComponents[Yve]||{})),p8(o)),p8((function(s){return s&&CC.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const t2e=["aria-label"],n2e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},i2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},Ri=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},$l=Ri(rt({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),L("svg",i2e,[...n[1]||(n[1]=[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),A("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),L("svg",n2e,[...n[0]||(n[0]=[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,t2e))}),[["__scopeId","data-v-be21ab83"]]);$l.install=e=>{e.component($l.__name,$l)};const o2e={class:"emoji-node"},dl=Ri(rt({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",o2e,F(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);dl.install=e=>{e.component(dl.__name,dl)};const s2e=["id"],r2e=["title"],Pl=Ri(rt({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),L("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[A("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+F(e.node.id)+"]",9,r2e)],8,s2e))}}),[["__scopeId","data-v-c1463a29"]]);Pl.install=e=>{e.component(Pl.__name,Pl)};const vH=(()=>{try{return!1}catch{}return!1})();function m8(e){vH&&console.warn(e)}function xL(e,t="safe",n){return v7(e,t,n)}function yH(e){return P0e(e)}function g8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function w7(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=Ry((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),g8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),g8(r.value)]):Object.entries(o).map(([r,l])=>[r,g8(l)]):null,t,n);var o;if(!i)return;const s=yH(Wg(i));return Object.keys(s).length>0?s:void 0}function SL(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Pm(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function v8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return nH(d,f)})(e,i);if(yv.has(e.toLowerCase())||!l&&Jj(e,s))return null;if(!l&&g7(e,s))return r?[SL(e,t,!0)]:[SL(e,t),...n,``];const a=v7(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=yH(a);return Tn(d,Fn(Nt({},f),{key:c}),n.length>0?n:void 0)}return Tn(e,Fn(Nt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function kH(e,t){return H0e(e,t)}function r4(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=v8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Pm(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=v8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?Pm(u[u.length-1].children,g):Pm(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&m8(`Auto-closing unclosed tag: <${m.tagName}>`)}else m8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=v8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?Pm(u[u.length-1].children,f):Pm(c,f),m8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(iH(e),t,n)}catch(o){return i=o,vH&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const l2e=["innerHTML"],zl=Ri(rt({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Yt("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=ms(()=>t.customId),s=rt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:l1(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=r4(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!kH(l,o.value))return{mode:"html",content:l1(l,i.value)};const a=r4(l,o.value,i.value);return a===null?{mode:"html",content:l1(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),L("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[U(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),L("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},F(r.value.content),3)):(k(),L("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,l2e))}}),[["__scopeId","data-v-d17f12b0"]]);zl.install=e=>{e.component(zl.__name,zl)};const a2e={class:"inline-code"},u2e={key:0},Ar=Ri(rt({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=q1(),i=Yt("markstreamFade",void 0),o=Yt("markstreamTextStreamState",void 0),s=Yt("markstreamStreamVersion",void 0),r=D(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=D(()=>!l.value),c=D(()=>{var b;const w=(b=n["index-key"])!=null?b:n.indexKey;return w==null||w===""?"":String(w)}),d=V(t.node.code),f=V(""),h=V(0);let m;function g(){m?.(),m=void 0}function v(){g(),f.value&&(d.value=d.value+f.value,f.value="")}We([()=>t.node.code,c,l],([b])=>{const w=String(b??""),C=c.value,T=lH({nextContent:w,persistedContent:C?o?.get(C):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=T.settledContent,f.value=T.streamedDelta,T.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const N=s.value;m=We(()=>s.value,I=>{I!==N&&v()},{flush:"sync"})})()):f.value||g(),C&&o?.set(C,w)},{immediate:!0}),Gd(g);const y=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,w)=>(k(),L("code",a2e,[u.value?(k(),L(De,{key:0},[Oe(F(a.value),1)],64)):(k(),L(De,{key:1},[d.value?(k(),L("span",u2e,F(d.value),1)):ee("",!0),f.value?(k(),L("span",{key:1,class:Re(["inline-code-stream-delta",[y.value]]),onAnimationend:v},F(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Ar.install=e=>{e.component(Ar.__name,Ar)};const AC=V(!1),_L=V(""),ML=V("top"),Ug=V(null),Vg=V(null),xC=V(null),SC=V(null),IL=V(null);let $y=null,Py=null,_C=0;function bH(){$y&&(clearTimeout($y),$y=null),Py&&(clearTimeout(Py),Py=null)}let $2=!1,P2=null,TL=!1;function c2e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++_C;bH();const l=()=>ro(null,null,function*(){var a,u;if(yield(function(){return ro(this,null,function*(){if(!$2&&!TL&&typeof document<"u"){P2!=null||(P2=ro(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([Jo(()=>import("./vue.runtime.esm-bundler-BMAq9omn.js"),[]),Jo(()=>import("./Tooltip-BI78FOq1.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:AC.value,"anchor-el":Ug.value,content:_L.value,placement:ML.value,id:Vg.value,originX:xC.value,originY:SC.value,isDark:(m=IL.value)!=null?m:void 0})}}).mount(h),$2=!0}));try{yield P2}catch(c){$2=!1,P2=null,TL=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),$2&&r===_C){Vg.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ug.value=e,_L.value=t,ML.value=n,xC.value=(a=o?.x)!=null?a:null,SC.value=(u=o?.y)!=null?u:null,IL.value=typeof s=="boolean"?s:null,AC.value=!0;try{e.setAttribute("aria-describedby",Vg.value)}catch{}}});i?l():$y=setTimeout(l,80)}function d2e(e=!1){_C+=1,bH();const t=()=>{if(Ug.value&&Vg.value)try{Ug.value.removeAttribute("aria-describedby")}catch{}AC.value=!1,Ug.value=null,Vg.value=null,xC.value=null,SC.value=null};e?t():Py=setTimeout(t,120)}const f2e={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},h2e=Symbol("markstreamI18nFallback");function wH(e,t){var n;return(n=t?.[e])!=null?n:f2e[e]}const MC=(e,t)=>{var n;return(n=wH(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function EL(e,t){return{t(n){const i=wH(n,t);if(e.te&&i!=null&&!e.te(n))return MC(n,t);const o=e.t(n);return o===n&&i!=null?MC(n,t):o}}}function p2e(){const e=(function(){var n,i,o;try{const s=hs(),r=h2e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=hs(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return EL(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return EL({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>MC(n,e)}}const CH=Symbol("ViewportPriority"),AH=Symbol("ViewportPriorityOptions"),xH=Symbol("OffscreenHeavyNodeDeferral"),m2e=D(()=>!1),Eh="400px";function C7(){return Yt(AH,void 0)}function A7(){return Yt(xH,m2e)}function g2e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?V(t):t,r=o?(n=window.requestIdleCallback)!=null?n:I=>window.setTimeout(()=>I({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:I=>window.clearTimeout(I):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(I){if(!I)return"viewport";let S=a.get(I);return S||(S=u++,a.set(I,S)),String(S)}function v(){if(h!=null){try{l?.(h)}catch{}h=null}}function y(I){if(I){const S=c.get(I);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(I)}}d.size||f.size||v()}function b(I){const S=d.get(I);if(!S)return;const _=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{_?.io.unobserve(I)}catch{}_?.targets.delete(I),d.delete(I),f.delete(I),y(S.bucketKey)}function w(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const I=f.values().next().value;I&&(f.delete(I),b(I),f.size&&w())},{timeout:1200}))}function C(I,S){if(!o||typeof IntersectionObserver>"u")return null;const _=(function(z,$){var B,P,H;return{root:(B=e?.(z??null))!=null?B:null,rootMargin:(P=$?.rootMargin)!=null?P:Eh,threshold:(H=$?.threshold)!=null?H:0}})(I,S),x=[g((E=_).root),E.rootMargin,E.threshold].join("\0");var E;const M=c.get(x);if(M)return{key:x,bucket:M};let R;try{R=new IntersectionObserver(z=>{for(const $ of z)($.isIntersecting||$.intersectionRatio>0)&&b($.target)},{root:_.root,rootMargin:_.rootMargin,threshold:_.threshold})}catch{return null}const q={io:R,targets:new Map};return c.set(x,q),{key:x,bucket:q}}function T(){if(o&&s.value)for(const[I,S]of Array.from(d.entries())){const _=C(I,S.opts);if(!_){b(I);continue}if(_.key===S.bucketKey)continue;const x=S.bucketKey,E=c.get(x);try{E?.io.unobserve(I)}catch{}E?.targets.delete(I),S.bucketKey=_.key,_.bucket.targets.set(I,S),_.bucket.io.observe(I),y(x)}}We(s,I=>{if(!I){for(const S of Array.from(d.keys()))b(S);v()}},{flush:"sync"});const N=(I,S)=>{const _=V(!1);let x,E=!1;const M=new Promise($=>{x=()=>{E||(E=!0,$())}}),R=()=>{const $=d.get(I);if(!$)return f.delete(I),void y();const B=c.get($.bucketKey);try{B?.io.unobserve(I)}catch{}B?.targets.delete(I),d.delete(I),f.delete(I),y($.bucketKey)};if(!o||!s.value)return _.value=!0,x(),{isVisible:_,whenVisible:M,destroy:R};const q=C(I,S);if(!q)return _.value=!0,x(),{isVisible:_,whenVisible:M,destroy:R};const z={resolve:x,visible:_,bucketKey:q.key,opts:S};return d.set(I,z),q.bucket.targets.set(I,z),q.bucket.io.observe(I),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,T()})),S?.allowIdle!==!1&&(f.add(I),w()),{isVisible:_,whenVisible:M,destroy:R}};return N.refresh=T,ii(CH,N),N}function x7(){var e,t;const n=Yt(CH,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=V(!1);let v,y=!1;const b=new Promise(T=>{v=()=>{y||(y=!0,T())}}),w=()=>{const T=i.get(h);if(!T)return s.delete(h),void(s.size||u());const N=o.get(T.bucketKey);try{N?.io.unobserve(h)}catch{}i.delete(h),N?.targets.delete(h),s.delete(h),c(T.bucketKey),s.size||u()},C=(T=>{var N,I;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(R=>{var q,z;return[(q=R?.rootMargin)!=null?q:Eh,(z=R?.threshold)!=null?z:0].join("\0")})(T),_=o.get(S);if(_)return{key:S,bucket:_};const x=(N=T?.rootMargin)!=null?N:Eh;let E;try{E=new IntersectionObserver(R=>{for(const q of R)(q.isIntersecting||q.intersectionRatio>0)&&d(q.target)},{root:null,rootMargin:x,threshold:(I=T?.threshold)!=null?I:0})}catch{return null}const M={io:E,targets:new Set};return o.set(S,M),{key:S,bucket:M}})(m);return C?(i.set(h,{resolve:v,visible:g,bucketKey:C.key}),C.bucket.targets.add(h),C.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:b,destroy:w}):(g.value=!0,v(),{isVisible:g,whenVisible:b,destroy:w})}}function v2e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const y2e=["data-markstream-viewport-pending"],k2e=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],b2e={key:1,class:"image-placeholder"},w2e={key:1,class:"image-node__raw-text"},C2e={key:2,class:"image-shimmer-overlay"},A2e={key:1,class:"image-node__raw-text"},x2e={key:3,class:"image-error"},Sd=Ri(rt({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=V(!1),a=V(!1),u=V(""),c=V("primary"),d=V(null),f=q1(),h=Yt(yC,null),m=x7(),g=C7(),v=A7(),y=D(()=>JT(s.node.src)),b=D(()=>JT(s.fallbackSrc)),w=(o=(i=(n=hs())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),C=typeof window<"u"&&w?.getAttribute("src")===(y.value||b.value),T=V(typeof window>"u"||C||!v.value),N=Ya(null);let I="",S=null;const _=D(()=>u.value),x=D(()=>!s.lazy),E=D(()=>typeof window<"u"&&v.value&&!C),M=D(()=>!E.value||T.value),R=D(()=>M.value?_.value:""),q=D(()=>{var ce,se;return(se=(ce=g?.value.heavyBlockMargin)!=null?ce:g?.value.rootMargin)!=null?se:Eh}),z=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),$=D(()=>c.value==="failed"),B=D(()=>(!x.value||E.value&&!T.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),P=D(()=>v2e(s,f));function H(ce=P.value){ce&&d.value&&h?.reportHeight(ce,d.value.offsetHeight)}function j(ce=P.value){ce&&ft(()=>{H(ce)})}function G(){S&&(clearTimeout(S),S=null)}function ne(){const ce=P.value;ce&&I!==ce&&(I&&h?.markSettled(I),G(),I=ce,h?.markPending(ce),typeof window<"u"&&(S=window.setTimeout(()=>{I===ce&&(j(ce),W())},8e3)))}function W(){return ro(this,null,function*(){const ce=I;ce&&(G(),I="",yield ft(),H(ce),h?.markSettled(ce))})}function Q(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void j();c.value="failed",a.value=!0,r("error",u.value),j()}function te(){l.value=!0,a.value=!1,r("load",_.value),j()}function X(ce){ce.preventDefault(),l.value&&!a.value&&r("click",[ce,_.value])}const{t:ve}=p2e();return We([y,b,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||y.value?(u.value=y.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&We([d,E],([ce,se],pe,Z)=>{var ae;if((ae=N.value)==null||ae.destroy(),N.value=null,!se||T.value)return void(T.value=!0);if(!ce)return void(T.value=!1);let K=!0;const re=m(ce,{rootMargin:q.value,allowIdle:!1});N.value=re,T.value=re.isVisible.value,re.whenVisible.then(()=>{K&&N.value===re&&(T.value=!0)}),Z(()=>{K=!1,re.destroy(),N.value===re&&(N.value=null)})},{immediate:!0}),We([z,l,a,_,()=>s.lazy,M],([ce,se,pe,Z,ae,K])=>ce&&Z&&!pe&&K?se?(W(),void j()):ae?(ne(),void j()):void(se||pe||ne()):(W(),void j()),{flush:"post",immediate:!0}),Xn(()=>{var ce;(ce=N.value)==null||ce.destroy(),N.value=null,(function(){const se=I;se&&(G(),I="",h?.markSettled(se))})()}),(ce,se)=>{var pe,Z,ae,K,re;return k(),L("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":E.value&&!T.value?"true":void 0},[z.value?(k(),L("img",{key:0,src:R.value||void 0,alt:String((Z=(pe=s.node.alt)!=null?pe:s.node.title)!=null?Z:""),title:String((K=(ae=s.node.title)!=null?ae:s.node.alt)!=null?K:""),class:Re(["image-node__img",{"is-loading":!x.value&&!l.value,"is-loaded":x.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:x.value?"high":void 0,decoding:x.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(re=s.node.alt)!=null?re:p(ve)("image.preview"),onError:Q,onLoad:te,onClick:X},null,42,k2e)):ee("",!0),e.node.loading&&!a.value?(k(),L("span",b2e,[s.usePlaceholder?Wn(ce.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[0]||(se[0]=A("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",w2e,F(e.node.raw),1))])):ee("",!0),B.value&&!e.node.loading?(k(),L("span",C2e,[s.usePlaceholder?Wn(ce.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[1]||(se[1]=A("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",A2e,F(e.node.raw),1))])):ee("",!0),$.value?(k(),L("span",x2e,[Wn(ce.$slots,"error",{node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[2]||(se[2]=A("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[A("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),A("span",null,F(p(ve)("image.loadError")),1)],!0)])):ee("",!0)],8,y2e)}}}),[["__scopeId","data-v-046e82ac"]]);Sd.install=e=>{e.component(Sd.__name,Sd)};const S2e={key:2},zu=rt({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ms(()=>t.customId),i=Yt("markstreamHtmlPolicy",void 0),o=Yt("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const v=(m=o?.value)!=null?m:{};return Fn(Nt({},v),{customId:(g=t.customId)!=null?g:v.customId,htmlPolicy:s.value})}),l=Cu({loader:()=>Promise.resolve().then(()=>B7),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!Av(String(t.node.type)))),c=D(()=>u.value?w7(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(k(),de(zo(a.value),di({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ue(()=>[d.value?(k(),de(p(l),di({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),de(p(l),di({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),de(zo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),L("span",S2e,F(h.value),1)):ee("",!0)}}),LL=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function _2e(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Fn(Nt(Nt({},LL),n),{enabled:(t=n.enabled)==null||t})}return Nt({},LL)}function S7(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function SH(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function NL(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function M2e(e){var t;return e.diff===!0||NL(e.language)||NL(SH(String((t=e.raw)!=null?t:"")))}function I2e(e,t,n){const i=(function(o){const s=SH(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const T2e=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],E2e={key:0,translate:"no",class:"markstream-pre__diff-code"},L2e={class:"markstream-pre__diff-pane-content"},N2e={class:"markstream-pre__diff-number","aria-hidden":"true"},D2e={class:"markstream-pre__diff-content"},F2e={class:"markstream-pre__diff-content-inner"},B2e={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},R2e=["textContent"],O2e=["textContent"],sl=rt({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(X,ve){const ce=String(X??"");return ve?ce:ce.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var X,ve,ce;const se=String((ve=(X=t.node)==null?void 0:X.language)!=null?ve:"");return String((ce=String(se).split(/\s+/g)[0])!=null?ce:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var X;return t.loading===!0||((X=t.node)==null?void 0:X.loading)===!0}),r=D(()=>{var X;return n((X=t.node)==null?void 0:X.code,s.value)});let l="",a=1;const u=D(()=>(function(X){let ve=0,ce=1;X.startsWith(l)&&(ve=l.length,ce=a,ve>0&&X[ve-1]==="\r"&&X[ve]===` +`&&ve++);for(let se=ve;ser.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const X=u.value;X{var X;return t.showLineNumbers===!0&&((X=t.node)==null?void 0:X.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),v=D(()=>{const X=Number(t.reservedHeightPx);if(!Number.isFinite(X)||X<=0)return;const ve=`${Math.ceil(X)}px`;return s.value?{maxHeight:ve,overflow:"auto"}:{height:ve,minHeight:ve,maxHeight:ve,overflow:"auto"}}),y=["diff ","index ","--- ","+++ ","@@ "];function b(X){return String(X??"").trim().length===0}function w(X,ve="context",ce={}){const se=b(X);return{code:X,kind:se&&ve!=="hunk"&&ve!=="spacer"&&!ce.preserveBlankKind?"context":ve,empty:se}}function C(X){const ve=n(X,s.value);return ve?ve.split(/\r\n|\n|\r/):[]}function T(X,ve){return!b(X[ve])||vey.some(ce=>ve.startsWith(ce)))}function _(X,ve){return ve||!X.startsWith(" ")||X.startsWith(" ")?X:` ${X}`}function x(X,ve){const ce=X.length,se=ve.length,pe=[];let Z=0;for(;Z=Z&&re>=Z&&X[K]===ve[re];)ae.unshift({originalIndex:K,modifiedIndex:re}),K--,re--;const we=K-Z+1,be=re-Z+1;if(we<=0||be<=0||s.value||(we+1)*(be+1)>15e5)return pe.concat(ae);const ke=be+1,oe=new Uint32Array((we+1)*(be+1));for(let Me=we-1;Me>=0;Me--)for(let fe=be-1;fe>=0;fe--){const ie=Me*ke+fe;if(X[Z+Me]===ve[Z+fe])oe[ie]=oe[(Me+1)*ke+fe+1]+1;else{const Ee=oe[(Me+1)*ke+fe],qe=oe[Me*ke+fe+1];oe[ie]=Ee>=qe?Ee:qe}}const le=[];let ye=0,Ae=0;for(;ye=oe[ye*ke+Ae+1]?ye++:Ae++;return pe.concat(le,ae)}function E(X){var ve;const ce=(function(){var re,we;const be=t.diffHideUnchangedRegions;if(be==null||be===!1)return null;const ke=be===!0?{}:be;return ke.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((re=ke.contextLineCount)!=null?re:2)),minimumLineCount:Math.max(1,Math.floor((we=ke.minimumLineCount)!=null?we:4))}})();if(!ce||X.length<1||X.length>2||X.length===2&&X[0].lines.length!==X[1].lines.length)return X;const se=X[0].lines,pe=(ve=X[1])==null?void 0:ve.lines,Z=re=>se[re].kind==="context"&&(pe===void 0||pe[re].kind==="context"&&se[re].code===pe[re].code),ae=[];let K=0;for(;K=ce.minimumLineCount){const be=re+(re===0?0:ce.contextLineCount),ke=we-(we===se.length?0:ce.contextLineCount);ke-be>=ce.minimumLineCount&&ae.push({start:be,end:ke})}K===re&&K++}return ae.length?X.map((re,we)=>{const be=[];let ke=0;for(const oe of ae)be.push(...re.lines.slice(ke,oe.start)),be.push({code:we===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${re.key}-collapsed-${oe.start}-${oe.end}`,number:""}),ke=oe.end;return be.push(...re.lines.slice(ke)),Fn(Nt({},re),{lines:be})}):X}const M=D(()=>{var X,ve,ce,se;if(!m.value)return[];const pe=(function(we){const be=we.some(oe=>N(oe)),ke=we.some(oe=>I(oe));return be&&ke||(function(){var oe,le,ye,Ae;if(i.value==="diff")return!0;const Me=(Ae=(ye=String((le=(oe=t.node)==null?void 0:oe.raw)!=null?le:"").split(/\r?\n/,1)[0])==null?void 0:ye.trim())!=null?Ae:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Me)})()&&(be||ke)})(c.value),Z=(function(){var we,be;return((we=t.node)==null?void 0:we.originalCode)!=null||((be=t.node)==null?void 0:be.updatedCode)!=null})();if(g.value){const we=Z?(function(be,ke){const oe=C(be),le=C(ke),ye=x(oe,le);if(ye.length>0){const qe=[];let ze=0,ht=0;for(const gt of ye){for(;ze=Me&&ie>=Me&&oe[fe]===le[ie];)Ee.unshift(Fn(Nt({},w(le[ie])),{key:`inline-suffix-${ie}`,number:ie+1})),fe--,ie--;for(let qe=Me;qe<=fe;qe++)Ae.push(Fn(Nt({},w(oe[qe],"removed",{preserveBlankKind:T(oe,qe)})),{key:`inline-removed-source-${qe}`,number:qe+1}));for(let qe=Me;qe<=ie;qe++)Ae.push(Fn(Nt({},w(le[qe],"added",{preserveBlankKind:T(le,qe)})),{key:`inline-added-source-${qe}`,number:qe+1}));return Ae.concat(Ee)})((X=t.node)==null?void 0:X.originalCode,(ve=t.node)==null?void 0:ve.updatedCode):(function(be){const ke=[];let oe=1,le=1;const ye=S(be);for(const[Ae,Me]of be.entries())if(Me.startsWith("@@")){const fe=Me.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);fe&&(oe=Number(fe[1]),le=Number(fe[2])),ke.push(Fn(Nt({},w(Me,"hunk")),{key:`inline-hunk-${Ae}`,number:""}))}else if(N(Me))ke.push(Fn(Nt({},w(_(Me.slice(1),ye),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Ae}`,number:oe++}));else if(I(Me))ke.push(Fn(Nt({},w(_(Me.slice(1),ye),"added",{preserveBlankKind:!0})),{key:`inline-added-${Ae}`,number:le++}));else{const fe=ye&&Me.startsWith(" ")?Me.slice(1):Me;ke.push(Fn(Nt({},w(fe)),{key:`inline-context-${Ae}`,number:le})),oe++,le++}return ke})(c.value);return E([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:we}])}if(!pe&&Z)return(function(we,be){const ke=C(we),oe=C(be),le=x(ke,oe),ye=[],Ae=[];let Me=0,fe=0,ie=0;const Ee=(qe,ze)=>{const ht=Math.max(qe-Me,ze-fe);for(let gt=0;gtFn(Nt({},we),{key:`original-${be}`,number:be+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:K.map((we,be)=>Fn(Nt({},we),{key:`modified-${be}`,number:be+1}))}])}),R=D(()=>{var X,ve;if(t.showLineNumbers!==!0)return;let ce=m.value?1:u.value;if(m.value){ce=Math.max(ce,C((X=t.node)==null?void 0:X.originalCode).length,C((ve=t.node)==null?void 0:ve.updatedCode).length);for(const pe of M.value)for(const Z of pe.lines)typeof Z.number=="number"&&(ce=Math.max(ce,Z.number))}const se=`${Math.max(2,String(ce).length)}ch`;return{"--markstream-pre-line-number-width":se,"--markstream-pre-diff-line-number-width":se,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),q=D(()=>M.value.some(X=>X.lines.some(ve=>ve.kind==="collapsed"))),z=D(()=>{const X=i.value;return X?`Code block: ${X}`:"Code block"}),$=V(null),B=V([]);let P=null,H=!1,j=null;function G(X){const ve=Number.parseFloat(String(X??""));return Number.isFinite(ve)&&ve>0?ve:0}function ne(X,ve){var ce;if(!X)return ve;if(X.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const se=X.querySelector(".markstream-pre__diff-content"),pe=se?.getBoundingClientRect(),Z=(ce=pe?.height)!=null?ce:0;return Math.max(ve,Math.ceil(Z))}function W(){H||typeof window>"u"||(P!=null&&window.cancelAnimationFrame(P),P=window.requestAnimationFrame(()=>{P=null,H||(function(){var X,ve;P=null;const ce=$.value;if(!ce||!m.value||g.value||!ce.classList.contains("is-wrap"))return void(B.value.length&&(B.value=[]));const se=(function(be){const ke=window.getComputedStyle(be),oe=G(ke.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const le=G(ke.lineHeight);return le>0?le:18})(ce),pe=Array.from(ce.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),Z=Array.from(ce.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),ae=Math.max(pe.length,Z.length),K=[];for(let be=0;be{const oe=we[ke];return oe&&Math.abs(be.rowHeight-oe.rowHeight)<=.5&&Math.abs(be.originalHeight-oe.originalHeight)<=.5&&Math.abs(be.modifiedHeight-oe.modifiedHeight)<=.5})||(B.value=K)})()}))}function Q(X){j?.disconnect(),j=null,X&&m.value&&!g.value&&typeof ResizeObserver<"u"&&(j=new ResizeObserver(()=>{W()}),j.observe(X))}function te(X,ve){const ce=B.value[X];if(!ce)return;const se=ve==="original"?ce.originalHeight:ce.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ce.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(se)}px`}}return We($,X=>{Q(X),ft(()=>W())},{flush:"post"}),We([m,g,M],()=>{Q($.value),ft(()=>W())},{flush:"post",immediate:!0}),Xn(()=>{H=!0,P!=null&&(window.cancelAnimationFrame(P),P=null),j?.disconnect(),j=null}),(X,ve)=>(k(),L("pre",{ref_key:"preRef",ref:$,style:sn([v.value,R.value]),class:Re([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":q.value}]),"aria-busy":s.value,"aria-label":z.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),L("code",E2e,[(k(!0),L(De,null,Ct(M.value,ce=>(k(),L("span",{key:ce.key,class:Re(["markstream-pre__diff-pane",ce.className])},[A("span",L2e,[(k(!0),L(De,null,Ct(ce.lines,(se,pe)=>(k(),L("span",{key:se.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${se.kind}`,{"markstream-pre__diff-line--empty":se.empty}]]),style:sn(te(pe,ce.key))},[ve[0]||(ve[0]=A("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),A("span",N2e,F(se.number),1),A("span",D2e,[A("span",F2e,F(se.code),1)])],6))),128))])],2))),128))])):(k(),L(De,{key:1},[t.showLineNumbers?(k(),L("span",B2e,[A("span",{class:"markstream-pre__line-numbers-text",textContent:F(h.value)},null,8,R2e)])):ee("",!0),A("code",{translate:"no",class:"markstream-pre__code",textContent:F(r.value)},null,8,O2e)],64))],14,T2e))}});sl.install=e=>{e.component(sl.__name,sl)};const qo=Ri(rt({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=q1(),i=Yt("markstreamFade",void 0),o=Yt("markstreamTextStreamState",void 0),s=Yt("markstreamStreamVersion",void 0),r=D(()=>{const T=n.fade;return T===""||T===!0||T==="true"||T!==!1&&T!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var T;const N=(T=n["index-key"])!=null?T:n.indexKey;return N==null||N===""?"":String(N)}),u=V(t.node.content),c=V(""),d=V(0),f=V(t.node.content);let h;const m=V(null),g=V(null);let v="",y=null;function b(){h?.(),h=void 0}function w(){b(),c.value&&(u.value=u.value+c.value,c.value="")}We([u,m,g],function(){var T,N;const I=m.value;if(!I)return;const S=String((T=u.value)!=null?T:""),_=g.value;return y||(y=I.firstChild,v=(N=y?.data)!=null?N:""),S.startsWith(v)?!y&&S?(I.textContent=S,y=I.firstChild,void(v=S)):void(S.length>v.length&&_&&(_.appendChild(document.createTextNode(S.slice(v.length))),v=S)):(I.textContent=S,y=I.firstChild,_&&(_.textContent=""),void(v=S))},{immediate:!0}),We([()=>t.node.content,a,l],([T])=>{const N=String(T??""),I=a.value,S=lH({nextContent:N,persistedContent:I?o?.get(I):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=S.settledContent,c.value=S.streamedDelta,S.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const _=s.value;h=We(()=>s.value,x=>{x!==_&&w()},{flush:"sync"})})()):c.value||b(),I&&o?.set(I,N)},{immediate:!0}),Gd(b);const C=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(T,N)=>(k(),L("span",{class:Re([[e.node.center?"text-node-center":""],"text-node"])},[ai(A("span",{ref_key:"settledTextEl",ref:m},F(f.value),513),[[Qo,u.value!==""]]),ai(A("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Qo,u.value!==""]]),c.value?(k(),L("span",{key:0,class:Re(["text-node-stream-delta",[C.value]]),onAnimationend:w},F(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function dg(e,t,n){return rt({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=x7(),u=C7(),c=A7(),d=typeof window<"u"&&((l=(r=hs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=V(typeof window>"u"||d||!c.value),h=Ya(null);let m=null;function g(v){const y=v&&"$el"in v?v.$el:v;h.value=y instanceof HTMLElement?y:null}return typeof window<"u"&&We([h,c],([v,y],b,w)=>{if(m?.destroy(),m=null,!y||f.value)return void(f.value=!0);if(!v)return;let C=!0;const T=a(v,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=T,f.value=T.isVisible.value,T.whenVisible.then(()=>{C&&m===T&&(f.value=!0)}),w(()=>{C=!1,T.destroy(),m===T&&(m=null)})},{immediate:!0}),Xn(()=>{m?.destroy(),m=null}),()=>Tn(f.value?t:n,Fn(Nt({},o),{ref:g}),s)}})}qo.install=e=>{e.component(qo.__name,qo)};const l4=rt({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=Ok(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=dL[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):dL[""]),f=M2e(n.node),h=I2e(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:S7(m??{},typeof window>"u"?0:window.innerWidth)),v=m?.diffAppearance,y=v==="dark"||v!=="light"&&n.isDark===!0,b=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,w=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),C=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,T=f?0:8,N=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:T,I=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:T,S=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",_=Nt(Nt({fontSize:`${b}px`,lineHeight:`${w}px`,tabSize:C,paddingTop:`${N}px`,paddingBottom:`${I}px`,"--markstream-pre-line-number-top":`${N}px`},f?{"--markstream-pre-diff-line-height":`${w}px`}:{}),S?{"--markstream-code-font-family":S}:{}),x=()=>Tn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Tn("svg",{class:"action-icon",width:"14",height:"14"})]),E=n.isShowPreview!==!1&&(c==="html"||c==="svg"),M=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||E&&n.showPreviewButton!==!1,R=z=>{if(z!=null)return typeof z=="number"?`${z}px`:String(z)},q=Nt(Nt(Nt({"--markstream-code-layout-character-width":"1ch"},R(n.minWidth)?{minWidth:R(n.minWidth)}:{}),R(n.maxWidth)?{maxWidth:R(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Tn("div",Fn(Nt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":y,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[q,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Tn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Tn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[Tn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),Tn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[Tn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?Tn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),Tn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Tn("div",{class:"code-diff-stats","aria-hidden":"true"},[Tn("span",{class:"code-diff-stat removed"},"-0"),Tn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:x(),n.showCollapseButton===!1?null:x(),M?Tn("div",{class:"relative"},[x()]):null])]),Tn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Tn(sl,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?_2e(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:_,"data-markstream-code-loading":"1"})]),Tn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Tn("div",{class:"loading-skeleton"},[Tn("div",{class:"skeleton-line"}),Tn("div",{class:"skeleton-line"}),Tn("div",{class:"skeleton-line short"})])]),Tn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),y8=dg("ViewportDeferredCodeBlockNode",Cu({loader:()=>ro(null,null,function*(){try{return(yield Jo(()=>import("./CodeBlockNode-DiXk8vTC.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),sl}}),loadingComponent:l4,delay:0,suspensible:!1}),l4),Ja=Cu(()=>ro(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return Tn(qo,Fn(Nt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield fH(),(yield Jo(()=>import("./index7-Dw6CHuX-.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return Tn(qo,Fn(Nt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),_H=Cu(()=>ro(null,null,function*(){try{return yield fH(),(yield Jo(()=>import("./index6-CPKEqG-u.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return Tn(qo,Fn(Nt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),Hr=Ri(rt({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),L("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},F(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Hr.install=e=>{e.component(Hr.__name,Hr)};const $2e={class:"superscript-node"},fl=Ri(rt({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,footnote_reference:Pl,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,emoji:dl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("sup",$2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);fl.install=e=>{e.component(fl.__name,fl)};const P2e={class:"subscript-node"},hl=Ri(rt({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,footnote_reference:Pl,strikethrough:qr,highlight:jl,insert:pl,superscript:fl,emoji:dl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("sub",P2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);hl.install=e=>{e.component(hl.__name,hl)};const z2e={class:"strong-node"},Wr=Ri(rt({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,emphasis:Vr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("strong",z2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Wr.install=e=>{e.component(Wr.__name,Wr)};const j2e={class:"strikethrough-node"},qr=Ri(rt({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("del",j2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);qr.install=e=>{e.component(qr.__name,qr)};const H2e=["href","title","aria-label","aria-hidden","target","rel"],W2e=["aria-hidden"],q2e={class:"link-text-wrapper relative inline-flex"},U2e={class:"leading-[normal] link-text"},Ur=Ri(rt({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Yt("markstreamShowTooltips",void 0),i=D(()=>{const y=n?.value;return typeof y=="boolean"?y:t.showTooltip}),o=D(()=>{var y,b,w,C,T;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",I=(y=t.animationOpacity)!=null?y:.35,S=Math.max(.12,Math.min(.5*I,I)),_={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":N,"--underline-opacity":String(I),"--underline-rest-opacity":String(S),"--underline-duration":`${(w=t.animationDuration)!=null?w:1.6}s`,"--underline-timing":(C=t.animationTiming)!=null?C:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(T=t.animationIteration)!=null?T:"infinite"};return t.color&&(_["--link-color"]=t.color),_}),s=ms(()=>t.customId),r=D(()=>Nt({text:qo,strong:Wr,strikethrough:qr,emphasis:Vr,image:Sd,html_inline:zl,inline_code:Ar},s.value)),l=q1(),a=D(()=>{var y,b;const w=(y=t.node)==null?void 0:y.attrs;if(!w||typeof w!="object")return{};const C={};if(Array.isArray(w))for(const T of w)Array.isArray(T)&&T[0]&&(C[String(T[0])]=String((b=T[1])!=null?b:""));else for(const[T,N]of Object.entries(w))T&&N!=null&&N!==!1&&(C[T]=N===!0?"":String(N));return xL(C,"safe","a")}),u=D(()=>Nt(Nt({},l),a.value)),c=D(()=>{var y,b;return xL({href:String((b=(y=t.node)==null?void 0:y.href)!=null?b:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const y=u.value.target;return(typeof y=="string"?y.trim():String(y??"").trim())||(Mhe(c.value)?"_blank":void 0)}),f=D(()=>{var y;return String((y=d.value)!=null?y:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const y=u.value.rel,b=new Set((typeof y=="string"?y:String(y??"")).split(/\s+/).filter(Boolean)),w=new Set(Array.from(b).filter(C=>C.toLowerCase()!=="opener"));return f.value&&(w.add("noopener"),w.add("noreferrer")),w.size>0?Array.from(w).join(" "):void 0}),m=D(()=>{const y=Nt({},u.value);return delete y.title,delete y.href,delete y.target,delete y.rel,y});function g(){i.value&&d2e()}const v=D(()=>{var y,b;const w=(y=t.node)==null?void 0:y.title;return typeof w=="string"&&w.trim().length>0?w:String((b=c.value)!=null?b:"")});return(y,b)=>{var w,C;return e.node.loading?(k(),L("span",di({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[A("span",q2e,[A("span",U2e,[U(p(qo),{class:"leading-[normal] link-text",node:{type:"text",content:String((w=e.node.text)!=null?w:""),raw:String((C=e.node.text)!=null?C:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=A("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,W2e)):(k(),L("a",di({key:0,class:"link-node",href:c.value,title:i.value?"":v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:b[0]||(b[0]=T=>(function(N){var I,S,_,x;if(!i.value)return;const E=N,M=E?.clientX!=null&&E?.clientY!=null?{x:E.clientX,y:E.clientY}:void 0,R=((I=t.node)==null?void 0:I.title)||((S=c.value)!=null&&S.includes("xn--")&&((x=(_=t.node)==null?void 0:_.text)!=null&&x.includes("://"))?t.node.text:c.value)||"";c2e(N.currentTarget,R,"top",!1,M)})(T)),onMouseleave:g}),[(k(!0),L(De,null,Ct(e.node.children,(T,N)=>(k(),de(p(zu),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:T,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,H2e))}}}),[["__scopeId","data-v-367e6ca4"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const V2e={class:"insert-node"},pl=Ri(rt({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:jl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("ins",V2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);pl.install=e=>{e.component(pl.__name,pl)};const K2e={class:"highlight-node"},jl=Ri(rt({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,strikethrough:qr,insert:pl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("mark",K2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);jl.install=e=>{e.component(jl.__name,jl)};const Z2e={class:"emphasis-node"},Vr=Ri(rt({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("em",Z2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Vr.install=e=>{e.component(Vr.__name,Vr)};const G2e={class:"hard-break"},_d=Ri(rt({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("br",G2e))}),[["__scopeId","data-v-50c58f70"]]);_d.install=e=>{e.component(_d.__name,_d)};const B0=rt({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Et({checkbox:$l,checkbox_input:$l,emoji:dl,emphasis:Vr,hardbreak:_d,highlight:jl,inline_code:Ar,insert:pl,link:Ur,reference:Hr,strikethrough:qr,strong:Wr,subscript:hl,superscript:fl,text:qo}),i=ms(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Nt(Nt({},n),s):n});return(s,r)=>(k(!0),L(De,null,Ct(e.nodes,(l,a)=>(k(),de(p(zu),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function IC(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(IC)}function a4(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(IC))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(IC)?o:null}function Lh(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Q2e=["cite"],Y2e={key:0,dir:"auto",class:"paragraph-node"},J2e=["custom-id"],zy=Ri(rt({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>a4(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:Lh(s.value));return ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade)),(l,a)=>(k(),L("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),L("p",Y2e,[r.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(r.value),9,J2e)):(k(),de(p(B0),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),de(p(ml),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Q2e))}}),[["__scopeId","data-v-abfecebc"]]);zy.install=e=>{e.component(zy.__name,zy)};const X2e={class:"definition-list"},eye={class:"definition-term"},tye={class:"definition-desc"},jy=Ri(rt({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("dl",X2e,[(k(!0),L(De,null,Ct(t.node.items,(o,s)=>(k(),L(De,{key:s},[A("dt",eye,[U(p(ml),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),A("dd",tye,[U(p(ml),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);jy.install=e=>{e.component(jy.__name,jy)};const nye=["href","title"],Kg=Ri(rt({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),L("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,nye))}}),[["__scopeId","data-v-e1eb37b6"]]);Kg.install=e=>{e.component(Kg.__name,Kg)};const iye=["id"],oye={class:"flex-1"},Hy=rt({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[A("div",oye,[U(p(ml),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,iye))}});Hy.install=e=>{e.component(Hy.__name,Hy)};const sye=["custom-id"],TC=Ri(rt({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=Yt("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:Lh(t.node.children)),s=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,image:Sd,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,checkbox:$l,checkbox_input:$l,footnote_reference:Pl,hardbreak:_d,math_inline:Ja,reference:Hr},n.value));return(r,l)=>(k(),de(zo(`h${e.node.level}`),di({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ue(()=>[o.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(o.value),9,sye)):(k(!0),L(De,{key:1},Ct(e.node.children,(a,u)=>(k(),de(p(zu),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),zk=TC;zk.install=e=>{e.component(TC.__name,TC)};const rye={key:0,dir:"auto",class:"paragraph-node"},lye=["custom-id"],aye={dir:"auto",class:"paragraph-node"},uye=["custom-id"],a1=Ri(rt({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=ms(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return a4((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const v=m.slice(1);if(!v.every(b=>b?.type==="list"))return null;const y=a4([g]);return y?{paragraphChildren:y,nestedLists:v}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?Lh(r.value):null),c=D(()=>{var h;return a()?Lh((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,v;return k(),L("li",di({class:"list-item",dir:"auto"},f.value),[r.value?(k(),L("p",rye,[u.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(u.value),9,lye)):(k(),de(p(B0),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(k(),L(De,{key:1},[A("p",aye,[c.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(c.value),9,uye)):(k(),de(p(B0),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),L(De,null,Ct(l.value.nestedLists,(y,b)=>(k(),de(p(ml),{key:b,nodes:[y],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=w=>h.$emit("copy",w))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),de(p(ml),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(v=(g=n.value)==null?void 0:g.children)!=null?v:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=y=>h.$emit("copy",y))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);a1.install=e=>{e.component(a1.__name,a1)};const u1=Ri(rt({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ms(()=>e.customId),n=D(()=>t.value.list_item||a1);return(i,o)=>(k(),de(zo(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ue(()=>[(k(!0),L(De,null,Ct(e.node.items,(s,r)=>{var l;return k(),de(zo(n.value),di({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);u1.install=e=>{e.component(u1.__name,u1)};const cye={key:2,class:"html-block-node__raw"},dye=["innerHTML"],fye={key:1,class:"html-block-node__placeholder"},Zg=Ri(rt({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Yt("markstreamHtmlPolicy",void 0),i=Yt("markstreamNestedRendererProps",void 0),o=D(()=>{var M,R;return(R=(M=t.htmlPolicy)!=null?M:n?.value)!=null?R:"safe"}),s=D(()=>{var M,R;const q=(M=i?.value)!=null?M:{};return Fn(Nt({},q),{customId:(R=t.customId)!=null?R:q.customId,htmlPolicy:o.value})}),r=Cu({loader:()=>Promise.resolve().then(()=>B7),suspensible:!1}),l=D(()=>{const M=Ry(t.node.attrs,o.value);if(!M)return;const R=Wg(M);return Object.keys(R).length>0?R:void 0}),a=D(()=>{const M=String(t.node.tag||"").trim(),R=Ry(t.node.attrs,o.value,M);if(!R)return;const q=Wg(R);return Object.keys(q).length>0?q:void 0}),u=ms(()=>t.customId),c=rt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=V(null),f=V(typeof window>"u"),h=V(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),v=D(()=>{var M;if(g.value.trim().toLowerCase()!=="details"||(M=t.node.attrs)!=null&&M.some(([q])=>String(q).toLowerCase()==="open"))return null;const R=m.value[0];return R?.type==="html_block"&&String(R.tag||"").toLowerCase()==="summary"?R:null}),y=D(()=>{var M;return Lh((M=v.value)==null?void 0:M.children)}),b=D(()=>{const M=v.value;if(!M)return;const R=Ry(M.attrs,o.value,"summary");if(!R)return;const q=Wg(R);return Object.keys(q).length>0?q:void 0}),w=D(()=>y.value==null?m.value:m.value.slice(1)),C=D(()=>{const M=g.value.trim().toLowerCase();return Vz.has(M)||g7(M,o.value)}),T=D(()=>m.value.length>0&&!!t.node.tag&&!C.value),N=D(()=>{var M,R,q;if(T.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(M=h.value)!=null?M:""};const z=(R=h.value)!=null?R:t.node.content;if(!z)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:l1(z,o.value)};if(t.node.loading){const B=r4(z,u.value,o.value);return B===null?{mode:"text",content:(q=t.node.raw)!=null?q:z}:{mode:"dynamic",nodes:B}}if(!kH(z,u.value))return{mode:"html",content:l1(z,o.value)};const $=r4(z,u.value,o.value);return $===null?{mode:"html",content:l1(z,o.value)}:{mode:"dynamic",nodes:$}}),I=x7(),S=C7(),_=A7(),x=Ya(null),E=!!t.node.loading;return typeof window<"u"?(We([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([M],R,q)=>{var z,$,B,P;if(($=(z=x.value)==null?void 0:z.destroy)==null||$.call(z),x.value=null,!E)return f.value=!0,void(h.value=t.node.content);if(!M)return void(f.value=!1);let H=!0;const j=(P=(B=S?.value.heavyBlockMargin)!=null?B:S?.value.rootMargin)!=null?P:Eh,G=I(M,{rootMargin:j,allowIdle:!_.value});x.value=G,f.value=f.value||G.isVisible.value,G.whenVisible.then(()=>{H&&x.value===G&&(f.value=!0)}),q(()=>{H=!1,G.destroy(),x.value===G&&(x.value=null)})},{immediate:!0}),We(()=>t.node.content,M=>{E&&!f.value||(h.value=M)})):f.value=!0,Xn(()=>{var M,R;(R=(M=x.value)==null?void 0:M.destroy)==null||R.call(M),x.value=null}),(M,R)=>(k(),de(zo(T.value?g.value:"div"),di({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(_)&&!f.value?"true":void 0},T.value?a.value:void 0),{default:ue(()=>[f.value?(k(),L(De,{key:0},[N.value.mode==="structured"?(k(),L(De,{key:0},[y.value!==null?(k(),L(De,{key:0},[A("summary",VG(NO(b.value)),F(y.value),17),w.value.length?(k(),de(p(r),di({key:0},s.value,{nodes:w.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(k(),de(p(r),di({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):N.value.mode==="dynamic"?(k(),de(p(c),{key:1,nodes:N.value.nodes},null,8,["nodes"])):N.value.mode==="text"?(k(),L("pre",cye,F(N.value.content),1)):(k(),L("div",di({key:3},l.value,{innerHTML:N.value.content}),null,16,dye))],64)):(k(),L("div",fye,[Wn(M.$slots,"placeholder",{node:e.node},()=>[R[0]||(R[0]=A("span",{class:"html-block-node__placeholder-bar"},null,-1)),R[1]||(R[1]=A("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),R[2]||(R[2]=A("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Zg.install=e=>{e.component(Zg.__name,Zg)};const hye={dir:"auto",class:"paragraph-node"},pye=["custom-id"],vh=Ri(rt({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ms(()=>t.customId),i=Yt("markstreamHtmlPolicy",void 0),o=Yt("markstreamFade",void 0),s=Yt("markstreamParseOptions",void 0),r=Yt("markstreamCustomMarkdownIt",void 0),l=Yt("markstreamNestedRendererProps",void 0),a=D(()=>{var S;return(S=i?.value)!=null?S:"safe"}),u=D(()=>{var S;return(S=t.parseOptions)!=null?S:s?.value}),c=D(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=D(()=>{var S,_;return(_=t.customHtmlTags)!=null?_:(S=l?.value)==null?void 0:S.customHtmlTags}),f=D(()=>{var S,_;const x=(S=l?.value)!=null?S:{};return Fn(Nt({},x),{customId:(_=t.customId)!=null?_:x.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=Cu({loader:()=>Promise.resolve().then(()=>B7),suspensible:!1});function m(S){var _;return S.type==="text"&&String((_=S.content)!=null?_:"").trim()===""}const g=D(()=>t.node.children.filter(S=>!m(S))),v=D(()=>g.value.length>0&&g.value.every(S=>S.type==="image"||(function(_){var x;const E=(function(M){return M.type==="link"&&Array.isArray(M.children)?M.children.filter(R=>!m(R)):[]})(_);return E.length===1&&((x=E[0])==null?void 0:x.type)==="image"})(S))),y=D(()=>new Set(Uh(d.value))),b=D(()=>{if(!v.value||g.value.length<=1)return t.node.children;const S=[];for(let _=0;_0,M=t.node.children.slice(_+1).some(R=>!m(R));E&&M&&S.push(Fn(Nt({},x),{content:" ",raw:" "}))}return S}),w=D(()=>o?.value===!1&&!n.value.text),C=D(()=>w.value?Lh(b.value):null);function T(S,_){return{node:S,"index-key":`${t.indexKey}-${_}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=D(()=>Nt({inline_code:Ar,image:Sd,link:Ur,hardbreak:_d,emphasis:Vr,strong:Wr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,html_inline:zl,html_block:Zg,emoji:dl,checkbox:$l,math_inline:Ja,checkbox_input:$l,reference:Hr,footnote_anchor:Kg,footnote_reference:Pl,text:qo},n.value)),I=D(()=>b.value.map((S,_)=>{var x;const E=(function(M){var R,q,z,$;if(M.type==="html_block"||M.type==="html_inline"){const B=String((R=M.tag)!=null?R:"").trim().toLowerCase()||Yz(M.content);if(B&&!y.value.has(B)&&Jz((q=M.content)!=null?q:M.raw,B)){const P=String(($=(z=M.content)!=null?z:M.raw)!=null?$:"");return{child:{type:"text",content:P,raw:P},component:qo,isCustomComponent:!1}}}return{child:M,component:N.value[M.type],isCustomComponent:!!(n.value[M.type]&&!Av(String(M.type)))}})(S);return Fn(Nt({},E),{index:_,key:`${t.indexKey||"paragraph"}-${_}`,customAttrs:E.isCustomComponent?w7(E.child,a.value):void 0,hasSlotChildren:Array.isArray(E.child.children)&&E.child.children.length>0,slotContent:String((x=E.child.content)!=null?x:""),originalChild:S})}));return(S,_)=>(k(),L("p",hye,[C.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(C.value),9,pye)):(k(!0),L(De,{key:1},Ct(I.value,x=>{return k(),L(De,{key:x.key},[v.value&&m(x.originalChild)?(k(),L(De,{key:0},[Oe(F((E=x.originalChild,String((M=E.content)!=null?M:""))),1)],64)):x.isCustomComponent?(k(),de(zo(x.component),di({key:1,ref_for:!0},x.customAttrs,{node:x.child,loading:x.child.loading,"index-key":x.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ue(()=>[x.hasSlotChildren?(k(),de(p(h),di({key:0,ref_for:!0},f.value,{nodes:x.child.children,"index-key":x.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):x.slotContent?(k(),de(p(h),di({key:1,ref_for:!0},f.value,{content:x.slotContent,final:!x.child.loading,"index-key":`${x.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),de(zo(x.component),di({key:2,ref_for:!0},T(x.child,x.index)),null,16))],64);var E,M}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);vh.install=e=>{e.component(vh.__name,vh)};const mye={class:"table-node-wrapper"},gye=["aria-busy"],vye={key:0},yye=["custom-id"],kye=["aria-label","onPointerdown"],bye=["custom-id"],wye={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Gg=Ri(rt({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var y;return(y=t.node.loading)!=null&&y}),i=D(()=>{var y;return(y=t.node.rows)!=null?y:[]}),o=V(null),s=V([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(y=>Number.isFinite(y)&&y>0)),u=D(()=>a.value?s.value.map(y=>y>0?{width:`${y}px`}:void 0):[]);ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade));const c=ms(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(y){const b=t.fade===!1&&!d.value,w=!f.value,C=h.get(y);if(C?.children===y.children&&C.textFastPath===b&&C.paragraphFastPath===w)return C.info;const T=a4(y.children,w,!0),N={simpleChildren:T,plainText:T&&b?Lh(T):null};return h.set(y,{children:y.children,textFastPath:b,paragraphFastPath:w,info:N}),N}function g(y){if(!r)return;y.preventDefault();const b=r.startWidth+r.nextStartWidth,w=Math.min(48,Math.floor(b/2)),C=Math.max(w,Math.min(b-w,Math.round(r.startWidth+y.clientX-r.startX))),T=[...r.widths];T[r.index]=C,T[r.index+1]=b-C,s.value=T}function v(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),r=null)}return We(l,()=>{v(),s.value=[]}),Xn(v),(y,b)=>(k(),L("div",mye,[A("table",{ref_key:"tableRef",ref:o,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),L("colgroup",vye,[(k(!0),L(De,null,Ct(e.node.header.cells,(w,C)=>(k(),L("col",{key:C,style:sn(u.value[C])},null,4))),128))])):ee("",!0),A("thead",null,[A("tr",null,[(k(!0),L(De,null,Ct(e.node.header.cells,(w,C)=>(k(),L("th",{key:C,dir:"auto",class:Re([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"])},[m(w).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(m(w).plainText),9,yye)):m(w).simpleChildren?(k(),de(p(B0),{key:1,nodes:m(w).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${C}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(ml),{key:2,nodes:w.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=T=>y.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),C(function(N,I){if(I.button!==0)return;const S=(function(){var E;const M=(E=o.value)==null?void 0:E.querySelectorAll("thead th");return Array.from(M??[],R=>Math.round(R.getBoundingClientRect().width))})(),_=S[N],x=S[N+1];_&&x&&(I.preventDefault(),r={index:N,startX:I.clientX,startWidth:_,nextStartWidth:x,widths:S},s.value=S,window.addEventListener("pointermove",g),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v))})(C,T)},null,40,kye)):ee("",!0)],2))),128))])]),A("tbody",null,[(k(!0),L(De,null,Ct(i.value,(w,C)=>(k(),L("tr",{key:C},[(k(!0),L(De,null,Ct(w.cells,(T,N)=>(k(),L("td",{key:N,class:Re([T.align==="right"?"text-right":T.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(T).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(m(T).plainText),9,bye)):m(T).simpleChildren?(k(),de(p(B0),{key:1,nodes:m(T).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${C}-${N}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(ml),{key:2,nodes:T.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=I=>y.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,gye),U(mo,{name:"table-node-fade"},{default:ue(()=>[n.value?(k(),L("div",wye,[Wn(y.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=A("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=A("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Gg.install=e=>{e.component(Gg.__name,Gg)};const Cye={class:"hr-node"},Wy=Ri({},[["render",function(e,t){return k(),L("hr",Cye)}],["__scopeId","data-v-39b2349c"]]);Wy.install=e=>{e.component(Wy.__name,Wy)};const Aye={class:"unknown-node"},EC=rt({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),L("div",Aye,F(e.node.raw),1))}),qy=Ri(rt({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=ms(()=>t.customId),o=D(()=>Nt({text:qo,paragraph:vh,heading:zk,inline_code:Ar,link:Ur,image:Sd,strong:Wr,emphasis:Vr,strikethrough:qr,insert:pl,subscript:hl,superscript:fl,checkbox:$l,checkbox_input:$l,hardbreak:_d,math_inline:Ja,reference:Hr,list:u1,math_block:_H,table:Gg},i.value));return(s,r)=>(k(),L("div",di({class:n.value},e.node.attrs),[(k(!0),L(De,null,Ct(e.node.children,(l,a)=>{return k(),de(zo((u=l.type,o.value[u]||EC)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);qy.install=e=>{e.component(qy.__name,qy)};const xye=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],DL=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function Sye(e){if(e<=255)return xye[e];let t=0,n=DL.length-1;for(;t<=n;){const i=t+n>>1,o=DL[i];if(eo[1]))return o[2];t=i+1}}return"L"}const _ye=/[ \t\n\r\f]+/g,Mye=/[\t\n\r\f]| {2,}|^ | $/;let k8=null;const Iye=new RegExp("\\p{Script=Arabic}","u"),jd=new RegExp("\\p{M}","u"),_7=new RegExp("\\p{Nd}","u");function FL(e){return Iye.test(e)}function BL(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function xu(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(BL(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(BL(n))return!0}}return!1}const Tye=new Set([" "," ","⁠","\uFEFF"]),Eye=new Set(["-","‐","–","—"]);function MH(e,t){return!((function(n){const i=Qg(n);return i!==null&&Tye.has(i)})(e)||t&&((function(n){const i=Qg(n);return i!==null&&(M7.has(i)||Nh.has(i))})(e)||(function(n){const i=Qg(n);return i!==null&&Eye.has(i)})(e)))}const M7=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),jk=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),I7=new Set(["'","’"]),Nh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Lye=new Set([":",".","،","؛"]),Nye=new Set(["၏"]),Dye=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Fye(e){if(T7(e))return!0;let t=!1;for(const n of e)if(Nh.has(n)||c4(n))t=!0;else if(!t||!jd.test(n))return!1;return t}function Bye(e){for(const t of e)if(!M7.has(t)&&!Nh.has(t))return!1;return e.length>0}function Rye(e){if(T7(e))return!0;for(const t of e)if(!(jk.has(t)||I7.has(t)||jd.test(t)||c4(t)))return!1;return e.length>0}function T7(e){let t=!1;for(const n of e)if(n!=="\\"&&!jd.test(n)){if(!(jk.has(n)||Nh.has(n)||I7.has(n)))return!1;t=!0}return t}function u4(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function Qg(e){if(e.length===0)return null;const t=u4(e,e.length);return e.slice(t)}const Oye=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function c4(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,Oye)}function $ye(e){const t=(function(n){for(const i of n)if(!jd.test(i))return i;return null})(e);return t!==null&&_7.test(t)}function Pye(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(jd.test(i))n--;else{if(!jk.has(i)&&!I7.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function zye(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function RL(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function OL(e,t){return e&&t!==null&&Lye.has(t)}function jye(e){const t=Qg(e);return t!==null&&Nye.has(t)}function Hye(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function LC(e){let t=e.length;for(;t>0;){const n=u4(e,t),i=e.slice(n,t);if(Dye.has(i))return!0;if(!Nh.has(i))return!1;t=n}return!1}function Wye(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const qye=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Na(e){return e.length===1?e[0]:e.join("")}function Uye(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Na(n)}function Vye(e,t,n,i){if(!qye.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=Wye(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:Na(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:Na(r),isWordLike:a,kind:s,start:l}),o}function b8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Kye=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Zye(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Kye.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Xye.has(e)&&!Jye.test(e)&&Yye.test(e)}function $L(e){let t=!1;for(const n of e)if(!jd.test(n)){if(!IH(n))return!1;t=!0}return t}function e9e(e,t,n,i){const o=!t&&$L(e),s=!i&&$L(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=u4(c,d),h=c.slice(f,d);if(!jd.test(h))return h;d=f}return null})(a);return u!==null&&c4(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=u4(a,u),d=a.slice(c,u);if(!jd.test(d))return IH(d)||c4(d);u=c}return!1})(e);return!!(o||s||l)&&!xu(e)&&!xu(n)&&(t||o||r)&&(i||s)}function PL(e){for(const t of e)if(_7.test(t))return!0;return!1}function Uy(e){if(e.length===0)return!1;for(const t of e)if(!_7.test(t)&&!Qye.has(t))return!1;return!0}function t9e(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(b8===null&&(b8=new Intl.Segmenter(void 0,{granularity:"word"})),b8);let g=0;const v=[],y=[],b=[],w=[],C=[],T=[],N=[],I=[],S=[],_=[],x=[],E=[];for(const O of m.segment(a))for(const B of Kye(O.segment,(d=O.isWordLike)!=null&&d,O.index,c)){let P=function(){T[X]!==null&&(y[X]=[BL(v,T,N,X)],T[X]=null),y[X].push(B.text),b[X]=b[X]||B.isWordLike,I[X]=I[X]||Z,S[X]=S[X]||ie,_[X]=Q,x[X]=te,E[X]=RL(S[X],W)};const H=B.kind==="text",j=jye(B.text,B.isWordLike,B.kind),Z=Au(B.text),ie=DL(B.text),W=Jg(B.text),Q=NC(B.text),te=Hye(B.text),X=g-1;u.carryCJKAfterClosingQuote&&H&&g>0&&w[X]==="text"&&Z&&I[X]&&_[X]||H&&g>0&&w[X]==="text"&&Rye(B.text)&&I[X]||H&&g>0&&w[X]==="text"&&x[X]?P():H&&g>0&&w[X]==="text"&&B.isWordLike&&ie&&E[X]?(P(),b[X]=!0):j!==null&&g>0&&w[X]==="text"&&T[X]===j?N[X]=((f=N[X])!=null?f:1)+1:H&&!B.isWordLike&&g>0&&w[X]==="text"&&!I[X]&&(Bye(B.text)||B.text==="-"&&b[X])?P():(v[g]=B.text,y[g]=[B.text],b[g]=B.isWordLike,w[g]=B.kind,C[g]=B.start,T[g]=j,N[g]=j===null?0:1,I[g]=Z,S[g]=ie,_[g]=Q,x[g]=te,E[g]=RL(ie,W),g++)}for(let O=0;Onull);let R=-1;for(let O=g-1;O>=0;O--){const B=v[O];if(B.length!==0){if(w[O]==="text"&&!b[O]&&R>=0&&w[R]==="text"&&($ye(B)||B==="-"&&Pye(v[R]))){const P=(h=M[R])!=null?h:[];P.push(B),M[R]=P,C[R]=C[O],v[O]="";continue}R=O}}for(let O=0;OZ+1){B.push(Ia(te)),P.push(ge),H.push("text"),j.push(O.starts[Z]),Z=X;continue}}B.push(ie),P.push(Q),H.push(W),j.push(O.starts[Z]),Z++}return{len:B.length,texts:B,isWordLike:P,kinds:H,starts:j}})((function(O){const B=[],P=[],H=[],j=[];for(let Z=0;Z1;for(let te=0;te=O.len||w8(O.kinds[W]))continue;const Q=[],te=O.starts[W];let X=W;for(;X0&&(B.push(Ia(Q)),P.push(!0),H.push("text"),j.push(te),Z=X-1)}return{len:B.length,texts:B,isWordLike:P,kinds:H,starts:j}})((function(O){const B=O.texts.slice(),P=O.isWordLike.slice(),H=O.kinds.slice(),j=O.starts.slice();for(let ie=0;ie=0&&!MH(u.texts[w-1],c)&&b(w),g<0&&(g=w),v=v||Au(C))}return b(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Dt({normalized:s,chunks:n9e(l,o)},l)}let mp=null;const PL=new Map;let gp=null;const o9e=new RegExp("\\p{Emoji_Presentation}","u"),s9e=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let C8=null;const zL=new Map;function DC(){if(mp!==null)return mp;if(typeof OffscreenCanvas<"u")return mp=new OffscreenCanvas(1,1).getContext("2d"),mp;if(typeof document<"u")return mp=document.createElement("canvas").getContext("2d"),mp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Uc(e,t){let n=t.get(e);return n===void 0&&(n={width:DC().measureText(e).width,containsCJK:Au(e)},t.set(e,n)),n}function f4(){if(gp!==null)return gp;if(typeof navigator>"u")return gp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},gp;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return gp={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},gp}function TH(){return C8===null&&(C8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),C8}function r9e(e){return o9e.test(e)||e.includes("️")}function Ef(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=TH();for(const a of l.segment(s))r9e(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function l9e(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function jL(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function HL(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function L7(e,t){return t===0?0:e+t}function c9e(e,t,n,i,o){return L7(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function WL(e,t,n,i){return L7(i,t==="tab"?0:e.lineEndFitAdvances[n])}function qL(e,t,n,i,o){return L7(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function d9e(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function f9e(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function j2(e,t,n){let i=t;for(;iP){if(ke!==null&&oe>K){X(ae,oe,le),ye=oe,we=j2(ke,we,ye+1),oe=-1,le=0;continue}X(),ue(ae,ye,Ae)}else j+=Ae,ie=ae,W=ye+1;else ue(ae,ye,Ae);const _e=ye+1;ke!==null&&ke[we]===_e&&(oe=_e,le=j,we++),ye++}Z&&ie===ae&&W===be.length&&(ie=ae+1,W=0)}let G=0;for(;G=q.length)));){const ae=q[G],K=jL(z[G]);if(Z)if(j+ae>P){if(K){se(G,ae),X(G+1,0,j-ae),G++;continue}if(Q>=0){if(ie>Q||ie===Q&&W>0){X();continue}X(Q,0,te);continue}if(ae>P&&O[G]!==null){X(),fe(G,0),G++;continue}X()}else se(G,ae),K&&(Q=G+1,te=j-ae),G++;else ae>P&&O[G]!==null?fe(G,0):ge(G,ae),K&&(Q=G+1,te=j-ae),G++}return Z&&X(),H})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=f4(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,v=0,y=-1,b=0,w=null;function C(){y=-1,b=0,w=null}function T(M=g,R=v,q){f++,h=0,m=!1,C()}function N(M,R){m=!0,g=M+1,v=0,h=R}function I(M,R,q){m=!0,g=M,v=R+1,h=q}function S(M,R){m?(h+=R,g=M+1,v=0):N(M,R)}function _(M,R,q,z,O,B){if(!R)return;const P=WL(n,M,q,O);qL(n,M,q,O,z),y=q+1,b=h-B+P,w=M}function x(M,R){var q;const z=r[M],O=(q=l[M])!=null?q:null;let B=O===null?-1:j2(O,0,R+1),P=-1,H=R;for(;Hd){if(O!==null&&P>R){T(M,P),H=P,B=j2(O,B,H+1),P=-1;continue}T(),I(M,H,j)}else h=W,g=M,v=H+1}else I(M,H,j);const Z=H+1;O!==null&&O[B]===Z&&(P=Z,B++),H++}m&&g===M&&v===z.length&&(g=M+1,v=0)}function E(M){f++,C()}for(let M=0;M=R.endSegmentIndex)));){const z=s[q],O=jL(z),B=u9e(n,m,q),P=z==="tab"?a9e(h+B,n.tabStopAdvance):o[q],H=B+P,j=c9e(n,z,q,B,P);if(z!=="soft-hyphen")if(m){if(h+j>d){const Z=h+WL(n,z,q,B);if(qL(n,z,q,B,P),w==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){T(y,0);continue}if(O&&Z<=d){S(q,H),T(q+1,0),q++;continue}if(y>=0&&b<=d){if(g>y||g===y&&v>0){T();continue}const ie=y;T(ie,0),q=ie;continue}if(j>d&&r[q]!==null){T(),x(q,0),q++;continue}T();continue}S(q,H),_(z,O,q,P,B,H),q++}else j>d&&r[q]!==null?x(q,0):N(q,P),_(z,O,q,P,B,H),q++;else m&&(g=q+1,v=0,y=q+1,b=h+a,w=z),q++}m&&(R.consumedEndSegmentIndex,T(R.consumedEndSegmentIndex,0))}return f})(e,t)}let A8=null;function N7(){return A8===null&&(A8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),A8}function p9e(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=NC(d),l=Hk.has(d)}function c(d,f){i.push(d),s=s||f;const h=NC(d);r=d.length===1&&Lh.has(d)&&r||h,l=!1}for(const d of N7().segment(e)){const f=d.segment,h=Au(f);i.length!==0?l||I7.has(f)||Lh.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function m9e(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!MH(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||Au(a.text)}return r(t.length),i}function UL(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=N7();for(const o of i.segment(e))n++;return n}function g9e(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function v9e(e,t,n,i,o){const s=f4(),{cache:r,emojiCorrection:l}=(function(E,M){DC().font=E;const R=(function(O){let B=PL.get(O);return B||(B=new Map,PL.set(O,B)),B})(E),q=(function(O){const B=O.match(/(\d+(?:\.\d+)?)\s*px/);return B?parseFloat(B[1]):16})(E),z=M?(function(O,B){let P=zL.get(O);if(P!==void 0)return P;const H=DC();H.font=O;const j=H.measureText("😀").width;if(P=0,j>B+.5&&typeof document<"u"&&document.body!==null){const Z=document.createElement("span");Z.style.font=O,Z.style.display="inline-block",Z.style.visibility="hidden",Z.style.position="absolute",Z.textContent="😀",document.body.appendChild(Z);const ie=Z.getBoundingClientRect().width;document.body.removeChild(Z),j-ie>.5&&(P=j-ie)}return zL.set(O,P),P})(E,q):0;return{cache:R,fontSize:q,emojiCorrection:z}})(t,(a=e.normalized,s9e.test(a)));var a;const u=Ef("-",Uc("-",r),l)+(o===0?0:2*o),c=8*Ef(" ",Uc(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=null,b=[],w=[],C=[],T=null,N=Array.from({length:e.len});function I(E,M,R,q,z,O,B,P,H){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(v=!1),f.push(M),h.push(R),m.push(q),g.push(z),b.push(B),w.push(P),d&&C.push(H)}function S(E,M,R,q,z){const O=Uc(E,r),B=d?UL(E,M):0,P=(function(ie,W,Q){return W>1?ie+(W-1)*Q:ie})(Ef(E,O,l),B,o),H=M==="space"||M==="preserved-space"||M==="zero-width-break"?0:P,j=H===0?0:H+(B>0?o:0),Z=M==="space"||M==="zero-width-break"?0:P;if(z&&q&&E.length>1){let ie="sum-graphemes";o!==0?ie="segment-prefixes":Vy(E)?ie="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ie="segment-prefixes");const W=(function(te,X,ge,ue,se){if(X.breakableFitAdvances!==void 0&&X.breakableFitMode===se)return X.breakableFitAdvances;X.breakableFitMode=se;const fe=TH(),G=[];for(const be of fe.segment(te))G.push(be.segment);if(G.length<=1)return X.breakableFitAdvances=null,X.breakableFitAdvances;if(se==="sum-graphemes"){const be=[];for(const ke of G){const we=Uc(ke,ge);be.push(Ef(ke,we,ue))}return X.breakableFitAdvances=be,X.breakableFitAdvances}if(se==="pair-context"||G.length>96){const be=[];let ke=null,we=0;for(const oe of G){const le=Ef(oe,Uc(oe,ge),ue);if(ke===null)be.push(le);else{const ye=ke+oe,Ae=Uc(ye,ge);be.push(Ef(ye,Ae,ue)-we)}ke=oe,we=le}return X.breakableFitAdvances=be,X.breakableFitAdvances}const ae=[];let K="",re=0;for(const be of G){K+=be;const ke=Ef(K,Uc(K,ge),ue);ae.push(ke-re),re=ke}return X.breakableFitAdvances=ae,X.breakableFitAdvances})(E,O,r,l,ie),Q=W===null||i==="keep-all"?null:(function(te){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(te))return null;const X=[];let ge=0;for(const ue of N7().segment(te))ge++,g9e(ue.segment)&&X.push(ge);return X.length===0?null:X})(E);return void I(E,P,j,Z,M,R,W,Q,B)}I(E,P,j,Z,M,R,null,null,B)}for(let E=0;E=55296&&te<=56319&&Q+1=56320&&se<=57343&&(X=se-56320+(te-55296<<10)+65536,ge=2)}const ue=_ye(X);ue!=="R"&&ue!=="AL"&&ue!=="AN"||(P=!0);for(let se=0;se=0&&B[te]==="ET";te--)B[te]="EN";for(te=Q+1;te0?B[Q-1]:ie)!=="L"?"R":"L";if(X===((te{const e=globalThis;if(e[x8])return e[x8];const t={configs:{},controllers:{},revision:Ka(0),preparedCache:new Map,blockEstimateCache:new Map};return e[x8]=t,t})();let jm=null;const S8=Cs.revision;function VL(e){var t;return e&&(t=Cs.configs[e])!=null?t:null}function KL(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function k9e(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function _8(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!k9e(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` -`)}return o.length>0?o:null}function M8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(jm!=null)return jm;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return jm=!!((s=r.getContext)!=null&&s.call(r,"2d")),jm}catch{return jm=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=Cs.blockEstimateCache.get(r);if(l)return Cs.blockEstimateCache.delete(r),Cs.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const v=`${g}\0${m}\0${h}`,y=Cs.preparedCache.get(v);if(y)return Cs.preparedCache.delete(v),Cs.preparedCache.set(v,y),y.prepared;const b=(function(w,C,T){return(function(N,I,S,_){var x,E;const M=(x=_?.wordBreak)!=null?x:"normal",R=(E=_?.letterSpacing)!=null?E:0;return v9e(i9e(N,f4(),_?.whiteSpace,M),I,!1,M,R)})(w,C,0,T)})(h,m,{whiteSpace:g});for(Cs.preparedCache.set(v,{prepared:b});Cs.preparedCache.size>240;){const w=Cs.preparedCache.keys().next().value;if(!w)break;Cs.preparedCache.delete(w)}return b})(e,n.font,a),c=(function(h,m,g){const v=h9e(h,m);return{lineCount:v,height:v*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Cs.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Cs.blockEstimateCache.size>4e3;){const h=Cs.blockEstimateCache.keys().next().value;if(!h)break;Cs.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function EH(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=_8(e.children);return s&&n.paragraph?M8(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=_8(e.children),l=n.headings[s];return r&&l?M8(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=_8((o=s[0])==null?void 0:o.children);return r?M8(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=EH(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function Hm(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Lf(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function I8(e,t,n=0){return e.diff?_7(t??{},n)?(function(i){const o=Lf(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!y9e.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return Hm(Lf(i.originalCode))+Hm(Lf(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(Hm(Lf(o)),Hm(Lf(s)));const r=Lf(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):Hm(Lf(e.code,e.loading===!0))}function b9e(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function T8(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=KL(i.lineHeight,1.5*KL(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:b9e(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const w9e=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function ZL(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))w9e.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function GL(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function QL(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function YL(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const LH=Symbol("MarkstreamMathBlockMinHeightCache");function m9t(){return Jt(LH,null)}const C9e=new Set(["text","inline_code","emoji","footnote_reference"]),A9e=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function Wm(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function Nf(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function NH(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(C9e.has(i))return!0;if(!A9e.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(NH)}function FC(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(FC).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function DH(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(DH)})}function x9e(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function S9e(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const v=e,y=String((n=v.type)!=null?n:""),b=Number.isFinite(t)&&t>0?t:640;switch(y){case"heading":return(function(w){var C;const T=Number((C=w.level)!=null?C:w.depth);return T>=4?20:T===3?30:T===2?32:44})(v);case"paragraph":return(function(w,C){const T=String(w??"");if(!T)return 28;const N=Math.max(18,Math.floor(Math.max(320,C)/8)),I=T.split(/\r?\n/).length,S=Math.ceil(T.length/N);return Math.max(1,I,S)<=1?28:Nf(T,C,34)})(String((o=(i=v.raw)!=null?i:v.content)!=null?o:""),b);case"list":return(function(w,C){var T;const N=Array.isArray(w.items)?w.items:[];if(!N.length)return 48;const I=Math.max(48,30*N.length+12);let S=12;for(const E of N)S+=x9e(FC(E)||String((T=E.raw)!=null?T:""),C);const _=Math.max(0,S-I);if(N.length>20){const E=Math.round(2.4*N.length);return Math.round(I+Math.max(E,Math.min(_,3*N.length)))}if(_<=0)return I;const x=N.length>8?8*N.length:_;return Math.round(I+Math.min(_,x))})(v,b);case"list_item":return Nf(String((r=(s=v.raw)!=null?s:v.content)!=null?r:""),b,34);case"blockquote":return Nf(String((a=(l=v.raw)!=null?l:v.content)!=null?a:""),b,56);case"table":return(function(w,C){const T=[...w.header?[w.header]:[],...Array.isArray(w.rows)?w.rows:[]];if(!T.length){const N=Array.isArray(w.children)?w.children.length:3;return Math.max(120,38*N+48)}return Math.max(120,Math.round(4+T.reduce((N,I)=>N+(function(S,_){const x=Math.max(1,S.length),E=Math.max(80,(_-32)/x),M=Math.max(10,Math.floor(E/8)),R=Math.max(1,...S.map(q=>{var z;const O=FC(q)||String((z=q?.raw)!=null?z:"");return Math.ceil(O.length/M)||1}));return 54+34*Math.max(0,R-1)+(x<=3&&S.some(DH)?14:0)})((function(S){var _;return Array.isArray(S?.cells)&&(_=S.cells)!=null?_:[]})(I),C),0)))})(v,b);case"code_block":{const w=String((u=v.language)!=null?u:"").trim().toLowerCase(),C=String((d=(c=v.code)!=null?c:v.raw)!=null?d:"");return w==="mermaid"?o4(n4(C)):w==="infographic"?s4(i4(C)):Nf(C,b,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(w,C){var T,N,I;const S=w.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((T=S[1])!=null?T:"")?Nf(((I=(N=w.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:N[1])==null?void 0:I.replace(/<[^>]*>/g,"").trim())||"Details",C,28,28):Nf(w,C,96)})(String((h=(f=v.raw)!=null?f:v.content)!=null?h:""),b);case"thematic_break":return 24;default:return Nf(String((g=(m=v.raw)!=null?m:v.content)!=null?g:""),b,40)}}function JL(e,t,n){return Math.min(Math.max(e,t),n)}const _9e=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],M9e=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],I9e=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),FH=["raw","content","code","originalCode","updatedCode"],XL=new WeakMap,eN=new WeakMap;let T9e=1;function Ma(){return typeof performance<"u"?performance.now():Date.now()}function tN(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Ll(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=XL.get(t);return n||(n=T9e++,XL.set(t,n)),String(n)}function nN(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:Ll(t),customMarkdownIt:Ll(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:Ll(e.validateLink),preTransformTokens:Ll(e.preTransformTokens),postTransformTokens:Ll(e.postTransformTokens),postTransformNodes:Ll(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function iN(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` -`,t-1)+1;return e.slice(n,t).trim()}function oN(e){const t=BH(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function BH(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function RH(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function D7(e){const t=String(e??"");return`${t.length}:${RH(t)}`}function BC(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?D7(r):`${r.length}:${RH(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Ll(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${Ll(i)}`;const s=Ll(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>BC(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${BC(r[u],t,n+1)}`).join(";")}`}return typeof e}function h4(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function $H(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>h4(i)?Hd(i,t,n+1):$H(i,t,n+1)).join(",")}`:h4(e)?Hd(e,t,n):BC(e,t,n)}function E9e(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!FH.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${D7(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${Ll(o)}`:I9e.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${$H(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${Ll(o)}`:""}).filter(Boolean).join(";")}function L9e(e){return FH.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${D7(n)}`:""}).filter(Boolean).join(";")}function Hd(e,t=new WeakMap,n=0){const i=eN.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${Ll(o)}`;const r=Ll(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Hd(m,u,c+1)).join("|"):"";return[a.type,L9e(d),E9e(d,u,c),f.length,h].join(":")})(e,t,n);return eN.set(o,l),l}function OH(e,t){return Hd(e)===Hd(t)}function F7(e,t,n){const i=Ma(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ma()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function sN(e,t,n){return F7(t,n,()=>Hd(e))}function PH(e,t,n){return sN(e,n,"stabilizeSignatureMs")===sN(t,n,"stabilizeSignatureMs")}function H2(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function rN(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function lN(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function N9e(e,t){return e.length===t.length&&e===t}function B7(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=B7(e,t)}),i??PH(e,t,n)}function B9e(e,t){const n={};for(const i of _9e){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function R9e(e,t){var n;const i=iL(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=V(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let q="",z=0,O=!1,B=!1,P=!1,H=!1;function j(){q="",z=0,O=!1,B=!1,P=!1,H=!1}function Z(ie){let W=!1;for(let Q=0;Q{if(!ie||!W.startsWith(ie)||W.length<=ie.length)return j(),[!0,0];let Q=0;q!==ie&&(j(),Z(ie),Q=ie.length);const te=W.slice(ie.length),X=Z(te);return q=W,[X,Q+te.length]}})();let h,m=0,g=0,v=Ma(),y=-1,b=0;function w(q){y=Number.isInteger(q)?q:0,b+=1}function C(){h&&(clearTimeout(h),h=void 0)}function T(){C();const q=t.renderContent.value;r.value!==q&&(r.value=q),v=Ma()}We([t.renderContent,t.effectiveFinal,s],([q,z,O])=>{r.value!==q&&(!O||z||(function(B,P){if(!B&&P||P.length<=80||P.length0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(k8===null&&(k8=new Intl.Segmenter(void 0,{granularity:"word"})),k8);let g=0;const v=[],y=[],b=[],w=[],C=[],T=[],N=[],I=[],S=[],_=[],x=[],E=[];for(const $ of m.segment(a))for(const B of Vye($.segment,(d=$.isWordLike)!=null&&d,$.index,c)){let P=function(){T[X]!==null&&(y[X]=[RL(v,T,N,X)],T[X]=null),y[X].push(B.text),b[X]=b[X]||B.isWordLike,I[X]=I[X]||G,S[X]=S[X]||ne,_[X]=Q,x[X]=te,E[X]=OL(S[X],W)};const H=B.kind==="text",j=zye(B.text,B.isWordLike,B.kind),G=xu(B.text),ne=FL(B.text),W=Qg(B.text),Q=LC(B.text),te=jye(B.text),X=g-1;u.carryCJKAfterClosingQuote&&H&&g>0&&w[X]==="text"&&G&&I[X]&&_[X]||H&&g>0&&w[X]==="text"&&Bye(B.text)&&I[X]||H&&g>0&&w[X]==="text"&&x[X]?P():H&&g>0&&w[X]==="text"&&B.isWordLike&&ne&&E[X]?(P(),b[X]=!0):j!==null&&g>0&&w[X]==="text"&&T[X]===j?N[X]=((f=N[X])!=null?f:1)+1:H&&!B.isWordLike&&g>0&&w[X]==="text"&&!I[X]&&(Fye(B.text)||B.text==="-"&&b[X])?P():(v[g]=B.text,y[g]=[B.text],b[g]=B.isWordLike,w[g]=B.kind,C[g]=B.start,T[g]=j,N[g]=j===null?0:1,I[g]=G,S[g]=ne,_[g]=Q,x[g]=te,E[g]=OL(ne,W),g++)}for(let $=0;$null);let R=-1;for(let $=g-1;$>=0;$--){const B=v[$];if(B.length!==0){if(w[$]==="text"&&!b[$]&&R>=0&&w[R]==="text"&&(Rye(B)||B==="-"&&$ye(v[R]))){const P=(h=M[R])!=null?h:[];P.push(B),M[R]=P,C[R]=C[$],v[$]="";continue}R=$}}for(let $=0;$G+1){B.push(Na(te)),P.push(ve),H.push("text"),j.push($.starts[G]),G=X;continue}}B.push(ne),P.push(Q),H.push(W),j.push($.starts[G]),G++}return{len:B.length,texts:B,isWordLike:P,kinds:H,starts:j}})((function($){const B=[],P=[],H=[],j=[];for(let G=0;G<$.len;G++){const ne=$.texts[G];if($.kinds[G]==="text"&&ne.includes("-")){const W=ne.split("-");let Q=W.length>1;for(let te=0;te=$.len||b8($.kinds[W]))continue;const Q=[],te=$.starts[W];let X=W;for(;X<$.len&&!b8($.kinds[X]);)Q.push($.texts[X]),X++;Q.length>0&&(B.push(Na(Q)),P.push(!0),H.push("text"),j.push(te),G=X-1)}return{len:B.length,texts:B,isWordLike:P,kinds:H,starts:j}})((function($){const B=$.texts.slice(),P=$.isWordLike.slice(),H=$.kinds.slice(),j=$.starts.slice();for(let ne=0;ne<$.len;ne++){if(H[ne]!=="text"||!Zye($,ne))continue;const W=[B[ne]];let Q=ne+1;for(;Q<$.len&&!b8(H[Q]);){W.push(B[Q]),P[ne]=!0;const te=B[Q].includes("?");if(H[Q]="text",B[Q]="",Q++,te)break}B[ne]=Na(W)}let G=0;for(let ne=0;ne=0&&!MH(u.texts[w-1],c)&&b(w),g<0&&(g=w),v=v||xu(C))}return b(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Nt({normalized:s,chunks:t9e(l,o)},l)}let gp=null;const zL=new Map;let vp=null;const i9e=new RegExp("\\p{Emoji_Presentation}","u"),o9e=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let w8=null;const jL=new Map;function NC(){if(gp!==null)return gp;if(typeof OffscreenCanvas<"u")return gp=new OffscreenCanvas(1,1).getContext("2d"),gp;if(typeof document<"u")return gp=document.createElement("canvas").getContext("2d"),gp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Uc(e,t){let n=t.get(e);return n===void 0&&(n={width:NC().measureText(e).width,containsCJK:xu(e)},t.set(e,n)),n}function d4(){if(vp!==null)return vp;if(typeof navigator>"u")return vp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},vp;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return vp={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},vp}function TH(){return w8===null&&(w8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),w8}function s9e(e){return i9e.test(e)||e.includes("️")}function Lf(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=TH();for(const a of l.segment(s))s9e(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function r9e(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function HL(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function WL(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function E7(e,t){return t===0?0:e+t}function u9e(e,t,n,i,o){return E7(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function qL(e,t,n,i){return E7(i,t==="tab"?0:e.lineEndFitAdvances[n])}function UL(e,t,n,i,o){return E7(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function c9e(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function d9e(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function z2(e,t,n){let i=t;for(;iP){if(be!==null&&oe>K){X(ae,oe,le),ye=oe,ke=z2(be,ke,ye+1),oe=-1,le=0;continue}X(),ce(ae,ye,Ae)}else j+=Ae,ne=ae,W=ye+1;else ce(ae,ye,Ae);const Me=ye+1;be!==null&&be[ke]===Me&&(oe=Me,le=j,ke++),ye++}G&&ne===ae&&W===we.length&&(ne=ae+1,W=0)}let Z=0;for(;Z=q.length)));){const ae=q[Z],K=HL(z[Z]);if(G)if(j+ae>P){if(K){se(Z,ae),X(Z+1,0,j-ae),Z++;continue}if(Q>=0){if(ne>Q||ne===Q&&W>0){X();continue}X(Q,0,te);continue}if(ae>P&&$[Z]!==null){X(),pe(Z,0),Z++;continue}X()}else se(Z,ae),K&&(Q=Z+1,te=j-ae),Z++;else ae>P&&$[Z]!==null?pe(Z,0):ve(Z,ae),K&&(Q=Z+1,te=j-ae),Z++}return G&&X(),H})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=d4(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,v=0,y=-1,b=0,w=null;function C(){y=-1,b=0,w=null}function T(M=g,R=v,q){f++,h=0,m=!1,C()}function N(M,R){m=!0,g=M+1,v=0,h=R}function I(M,R,q){m=!0,g=M,v=R+1,h=q}function S(M,R){m?(h+=R,g=M+1,v=0):N(M,R)}function _(M,R,q,z,$,B){if(!R)return;const P=qL(n,M,q,$);UL(n,M,q,$,z),y=q+1,b=h-B+P,w=M}function x(M,R){var q;const z=r[M],$=(q=l[M])!=null?q:null;let B=$===null?-1:z2($,0,R+1),P=-1,H=R;for(;Hd){if($!==null&&P>R){T(M,P),H=P,B=z2($,B,H+1),P=-1;continue}T(),I(M,H,j)}else h=W,g=M,v=H+1}else I(M,H,j);const G=H+1;$!==null&&$[B]===G&&(P=G,B++),H++}m&&g===M&&v===z.length&&(g=M+1,v=0)}function E(M){f++,C()}for(let M=0;M=R.endSegmentIndex)));){const z=s[q],$=HL(z),B=a9e(n,m,q),P=z==="tab"?l9e(h+B,n.tabStopAdvance):o[q],H=B+P,j=u9e(n,z,q,B,P);if(z!=="soft-hyphen")if(m){if(h+j>d){const G=h+qL(n,z,q,B);if(UL(n,z,q,B,P),w==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){T(y,0);continue}if($&&G<=d){S(q,H),T(q+1,0),q++;continue}if(y>=0&&b<=d){if(g>y||g===y&&v>0){T();continue}const ne=y;T(ne,0),q=ne;continue}if(j>d&&r[q]!==null){T(),x(q,0),q++;continue}T();continue}S(q,H),_(z,$,q,P,B,H),q++}else j>d&&r[q]!==null?x(q,0):N(q,P),_(z,$,q,P,B,H),q++;else m&&(g=q+1,v=0,y=q+1,b=h+a,w=z),q++}m&&(R.consumedEndSegmentIndex,T(R.consumedEndSegmentIndex,0))}return f})(e,t)}let C8=null;function L7(){return C8===null&&(C8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),C8}function h9e(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=LC(d),l=jk.has(d)}function c(d,f){i.push(d),s=s||f;const h=LC(d);r=d.length===1&&Nh.has(d)&&r||h,l=!1}for(const d of L7().segment(e)){const f=d.segment,h=xu(f);i.length!==0?l||M7.has(f)||Nh.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function p9e(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!MH(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||xu(a.text)}return r(t.length),i}function VL(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=L7();for(const o of i.segment(e))n++;return n}function m9e(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function g9e(e,t,n,i,o){const s=d4(),{cache:r,emojiCorrection:l}=(function(E,M){NC().font=E;const R=(function($){let B=zL.get($);return B||(B=new Map,zL.set($,B)),B})(E),q=(function($){const B=$.match(/(\d+(?:\.\d+)?)\s*px/);return B?parseFloat(B[1]):16})(E),z=M?(function($,B){let P=jL.get($);if(P!==void 0)return P;const H=NC();H.font=$;const j=H.measureText("😀").width;if(P=0,j>B+.5&&typeof document<"u"&&document.body!==null){const G=document.createElement("span");G.style.font=$,G.style.display="inline-block",G.style.visibility="hidden",G.style.position="absolute",G.textContent="😀",document.body.appendChild(G);const ne=G.getBoundingClientRect().width;document.body.removeChild(G),j-ne>.5&&(P=j-ne)}return jL.set($,P),P})(E,q):0;return{cache:R,fontSize:q,emojiCorrection:z}})(t,(a=e.normalized,o9e.test(a)));var a;const u=Lf("-",Uc("-",r),l)+(o===0?0:2*o),c=8*Lf(" ",Uc(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=null,b=[],w=[],C=[],T=null,N=Array.from({length:e.len});function I(E,M,R,q,z,$,B,P,H){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(v=!1),f.push(M),h.push(R),m.push(q),g.push(z),b.push(B),w.push(P),d&&C.push(H)}function S(E,M,R,q,z){const $=Uc(E,r),B=d?VL(E,M):0,P=(function(ne,W,Q){return W>1?ne+(W-1)*Q:ne})(Lf(E,$,l),B,o),H=M==="space"||M==="preserved-space"||M==="zero-width-break"?0:P,j=H===0?0:H+(B>0?o:0),G=M==="space"||M==="zero-width-break"?0:P;if(z&&q&&E.length>1){let ne="sum-graphemes";o!==0?ne="segment-prefixes":Uy(E)?ne="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ne="segment-prefixes");const W=(function(te,X,ve,ce,se){if(X.breakableFitAdvances!==void 0&&X.breakableFitMode===se)return X.breakableFitAdvances;X.breakableFitMode=se;const pe=TH(),Z=[];for(const we of pe.segment(te))Z.push(we.segment);if(Z.length<=1)return X.breakableFitAdvances=null,X.breakableFitAdvances;if(se==="sum-graphemes"){const we=[];for(const be of Z){const ke=Uc(be,ve);we.push(Lf(be,ke,ce))}return X.breakableFitAdvances=we,X.breakableFitAdvances}if(se==="pair-context"||Z.length>96){const we=[];let be=null,ke=0;for(const oe of Z){const le=Lf(oe,Uc(oe,ve),ce);if(be===null)we.push(le);else{const ye=be+oe,Ae=Uc(ye,ve);we.push(Lf(ye,Ae,ce)-ke)}be=oe,ke=le}return X.breakableFitAdvances=we,X.breakableFitAdvances}const ae=[];let K="",re=0;for(const we of Z){K+=we;const be=Lf(K,Uc(K,ve),ce);ae.push(be-re),re=be}return X.breakableFitAdvances=ae,X.breakableFitAdvances})(E,$,r,l,ne),Q=W===null||i==="keep-all"?null:(function(te){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(te))return null;const X=[];let ve=0;for(const ce of L7().segment(te))ve++,m9e(ce.segment)&&X.push(ve);return X.length===0?null:X})(E);return void I(E,P,j,G,M,R,W,Q,B)}I(E,P,j,G,M,R,null,null,B)}for(let E=0;E=55296&&te<=56319&&Q+1<$){const se=z.charCodeAt(Q+1);se>=56320&&se<=57343&&(X=se-56320+(te-55296<<10)+65536,ve=2)}const ce=Sye(X);ce!=="R"&&ce!=="AL"&&ce!=="AN"||(P=!0);for(let se=0;se=0&&B[te]==="ET";te--)B[te]="EN";for(te=Q+1;te<$&&B[te]==="ET";te++)B[te]="EN"}for(let Q=0;Q<$;Q++){const te=B[Q];te!=="WS"&&te!=="ES"&&te!=="ET"&&te!=="CS"||(B[Q]="ON")}W=ne;for(let Q=0;Q<$;Q++){const te=B[Q];te==="EN"?B[Q]=W==="L"?"L":"EN":te!=="R"&&te!=="L"||(W=te)}for(let Q=0;Q<$;Q++){if(B[Q]!=="ON")continue;let te=Q+1;for(;te<$&&B[te]==="ON";)te++;const X=(Q>0?B[Q-1]:ne)!=="L"?"R":"L";if(X===((te<$?B[te]:ne)!=="L"?"R":"L"))for(let ve=Q;ve{const e=globalThis;if(e[A8])return e[A8];const t={configs:{},controllers:{},revision:Ya(0),preparedCache:new Map,blockEstimateCache:new Map};return e[A8]=t,t})();let zm=null;const x8=As.revision;function KL(e){var t;return e&&(t=As.configs[e])!=null?t:null}function ZL(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function y9e(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function S8(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!y9e(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` +`)}return o.length>0?o:null}function _8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(zm!=null)return zm;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return zm=!!((s=r.getContext)!=null&&s.call(r,"2d")),zm}catch{return zm=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=As.blockEstimateCache.get(r);if(l)return As.blockEstimateCache.delete(r),As.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const v=`${g}\0${m}\0${h}`,y=As.preparedCache.get(v);if(y)return As.preparedCache.delete(v),As.preparedCache.set(v,y),y.prepared;const b=(function(w,C,T){return(function(N,I,S,_){var x,E;const M=(x=_?.wordBreak)!=null?x:"normal",R=(E=_?.letterSpacing)!=null?E:0;return g9e(n9e(N,d4(),_?.whiteSpace,M),I,!1,M,R)})(w,C,0,T)})(h,m,{whiteSpace:g});for(As.preparedCache.set(v,{prepared:b});As.preparedCache.size>240;){const w=As.preparedCache.keys().next().value;if(!w)break;As.preparedCache.delete(w)}return b})(e,n.font,a),c=(function(h,m,g){const v=f9e(h,m);return{lineCount:v,height:v*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(As.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});As.blockEstimateCache.size>4e3;){const h=As.blockEstimateCache.keys().next().value;if(!h)break;As.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function EH(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=S8(e.children);return s&&n.paragraph?_8(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=S8(e.children),l=n.headings[s];return r&&l?_8(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=S8((o=s[0])==null?void 0:o.children);return r?_8(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=EH(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function jm(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Nf(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function M8(e,t,n=0){return e.diff?S7(t??{},n)?(function(i){const o=Nf(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!v9e.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return jm(Nf(i.originalCode))+jm(Nf(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(jm(Nf(o)),jm(Nf(s)));const r=Nf(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):jm(Nf(e.code,e.loading===!0))}function k9e(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function I8(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=ZL(i.lineHeight,1.5*ZL(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:k9e(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const b9e=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function GL(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))b9e.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function QL(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function YL(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function JL(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const LH=Symbol("MarkstreamMathBlockMinHeightCache");function f9t(){return Yt(LH,null)}const w9e=new Set(["text","inline_code","emoji","footnote_reference"]),C9e=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function Hm(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function Df(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function NH(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(w9e.has(i))return!0;if(!C9e.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(NH)}function DC(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(DC).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function DH(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(DH)})}function A9e(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function x9e(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const v=e,y=String((n=v.type)!=null?n:""),b=Number.isFinite(t)&&t>0?t:640;switch(y){case"heading":return(function(w){var C;const T=Number((C=w.level)!=null?C:w.depth);return T>=4?20:T===3?30:T===2?32:44})(v);case"paragraph":return(function(w,C){const T=String(w??"");if(!T)return 28;const N=Math.max(18,Math.floor(Math.max(320,C)/8)),I=T.split(/\r?\n/).length,S=Math.ceil(T.length/N);return Math.max(1,I,S)<=1?28:Df(T,C,34)})(String((o=(i=v.raw)!=null?i:v.content)!=null?o:""),b);case"list":return(function(w,C){var T;const N=Array.isArray(w.items)?w.items:[];if(!N.length)return 48;const I=Math.max(48,30*N.length+12);let S=12;for(const E of N)S+=A9e(DC(E)||String((T=E.raw)!=null?T:""),C);const _=Math.max(0,S-I);if(N.length>20){const E=Math.round(2.4*N.length);return Math.round(I+Math.max(E,Math.min(_,3*N.length)))}if(_<=0)return I;const x=N.length>8?8*N.length:_;return Math.round(I+Math.min(_,x))})(v,b);case"list_item":return Df(String((r=(s=v.raw)!=null?s:v.content)!=null?r:""),b,34);case"blockquote":return Df(String((a=(l=v.raw)!=null?l:v.content)!=null?a:""),b,56);case"table":return(function(w,C){const T=[...w.header?[w.header]:[],...Array.isArray(w.rows)?w.rows:[]];if(!T.length){const N=Array.isArray(w.children)?w.children.length:3;return Math.max(120,38*N+48)}return Math.max(120,Math.round(4+T.reduce((N,I)=>N+(function(S,_){const x=Math.max(1,S.length),E=Math.max(80,(_-32)/x),M=Math.max(10,Math.floor(E/8)),R=Math.max(1,...S.map(q=>{var z;const $=DC(q)||String((z=q?.raw)!=null?z:"");return Math.ceil($.length/M)||1}));return 54+34*Math.max(0,R-1)+(x<=3&&S.some(DH)?14:0)})((function(S){var _;return Array.isArray(S?.cells)&&(_=S.cells)!=null?_:[]})(I),C),0)))})(v,b);case"code_block":{const w=String((u=v.language)!=null?u:"").trim().toLowerCase(),C=String((d=(c=v.code)!=null?c:v.raw)!=null?d:"");return w==="mermaid"?i4(t4(C)):w==="infographic"?o4(n4(C)):Df(C,b,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(w,C){var T,N,I;const S=w.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((T=S[1])!=null?T:"")?Df(((I=(N=w.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:N[1])==null?void 0:I.replace(/<[^>]*>/g,"").trim())||"Details",C,28,28):Df(w,C,96)})(String((h=(f=v.raw)!=null?f:v.content)!=null?h:""),b);case"thematic_break":return 24;default:return Df(String((g=(m=v.raw)!=null?m:v.content)!=null?g:""),b,40)}}function XL(e,t,n){return Math.min(Math.max(e,t),n)}const S9e=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],_9e=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],M9e=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),FH=["raw","content","code","originalCode","updatedCode"],eN=new WeakMap,tN=new WeakMap;let I9e=1;function La(){return typeof performance<"u"?performance.now():Date.now()}function nN(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Fl(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=eN.get(t);return n||(n=I9e++,eN.set(t,n)),String(n)}function iN(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:Fl(t),customMarkdownIt:Fl(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:Fl(e.validateLink),preTransformTokens:Fl(e.preTransformTokens),postTransformTokens:Fl(e.postTransformTokens),postTransformNodes:Fl(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function oN(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` +`,t-1)+1;return e.slice(n,t).trim()}function sN(e){const t=BH(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function BH(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function RH(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function N7(e){const t=String(e??"");return`${t.length}:${RH(t)}`}function FC(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?N7(r):`${r.length}:${RH(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Fl(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${Fl(i)}`;const s=Fl(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>FC(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${FC(r[u],t,n+1)}`).join(";")}`}return typeof e}function f4(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function OH(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>f4(i)?Hd(i,t,n+1):OH(i,t,n+1)).join(",")}`:f4(e)?Hd(e,t,n):FC(e,t,n)}function T9e(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!FH.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${N7(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${Fl(o)}`:M9e.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${OH(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${Fl(o)}`:""}).filter(Boolean).join(";")}function E9e(e){return FH.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${N7(n)}`:""}).filter(Boolean).join(";")}function Hd(e,t=new WeakMap,n=0){const i=tN.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${Fl(o)}`;const r=Fl(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Hd(m,u,c+1)).join("|"):"";return[a.type,E9e(d),T9e(d,u,c),f.length,h].join(":")})(e,t,n);return tN.set(o,l),l}function $H(e,t){return Hd(e)===Hd(t)}function D7(e,t,n){const i=La(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=La()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function rN(e,t,n){return D7(t,n,()=>Hd(e))}function PH(e,t,n){return rN(e,n,"stabilizeSignatureMs")===rN(t,n,"stabilizeSignatureMs")}function j2(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function lN(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function aN(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function L9e(e,t){return e.length===t.length&&e===t}function F7(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=F7(e,t)}),i??PH(e,t,n)}function F9e(e,t){const n={};for(const i of S9e){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function B9e(e,t){var n;const i=oL(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=V(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let q="",z=0,$=!1,B=!1,P=!1,H=!1;function j(){q="",z=0,$=!1,B=!1,P=!1,H=!1}function G(ne){let W=!1;for(let Q=0;Q{if(!ne||!W.startsWith(ne)||W.length<=ne.length)return j(),[!0,0];let Q=0;q!==ne&&(j(),G(ne),Q=ne.length);const te=W.slice(ne.length),X=G(te);return q=W,[X,Q+te.length]}})();let h,m=0,g=0,v=La(),y=-1,b=0;function w(q){y=Number.isInteger(q)?q:0,b+=1}function C(){h&&(clearTimeout(h),h=void 0)}function T(){C();const q=t.renderContent.value;r.value!==q&&(r.value=q),v=La()}We([t.renderContent,t.effectiveFinal,s],([q,z,$])=>{r.value!==q&&(!$||z||(function(B,P){if(!B&&P||P.length<=80||P.length\s*|`{3,}|~{3,})/.test(H))||H.endsWith(` -`)&&!(function(j){const Z=iN(j);if(oN(Z))return!1;const ie=BH(Z);return ie.length>=2&&ie.some(W=>W.trim())})(P))})(r.value,q)?T():(function(){if(g+=1,h)return;const B=Math.max(0,(function(P){const H=P.parseCoalesceMs;return typeof H=="number"&&Number.isFinite(H)&&H>=0?H:80})(e)-(Ma()-v));B<=0?T():h=setTimeout(T,B)})())},{flush:"sync",immediate:!0}),Gd(C);const N=D(()=>{var q,z,O,B;return Fhe(e.customHtmlTags,(q=e.parseOptions)==null?void 0:q.customHtmlTags,(B=(O=(z=t.customComponentsMap)==null?void 0:z.value)!=null?O:{},Object.entries(B).map(([P,H])=>{const j=va(P);return H==null||!j||xv(j)||Uz.has(j)||kv.has(j)?"":j}).filter(Boolean)))}),I=D(()=>{const{key:q,tags:z}=Bhe(N.value);if(!q)return i;const O=o.get(q);if(O)return O;const B=iL(t.instanceMsgId,{customHtmlTags:z});return o.set(q,B),B}),S=D(()=>{const q=I.value;if(!e.customMarkdownIt)return q;const z=e.customMarkdownIt(q);return q.__markstreamHasCustomParserExtensions=!0,z.__markstreamHasCustomParserExtensions=!0,z}),_=D(()=>{var q,z;const O=(q=e.parseOptions)!=null?q:{},B=t.effectiveFinal.value,P=N.value,H=B!=null,j=P.length>0;return H||j||O.streamParse==null?Dt(Dt(Dn(Dt({},O),{streamParse:(z=O.streamParse)==null||z}),H?{final:B}:{}),j?{customHtmlTags:P}:{}):O}),x=D(()=>{var q;return new Set(((q=_.value.customHtmlTags)!=null?q:[]).map(z=>String(z).trim().toLowerCase()).filter(Boolean))}),E=D(()=>nN(_.value,S.value,e.customMarkdownIt,{includeFinal:!0})),M=D(()=>nN(_.value,S.value,e.customMarkdownIt,{includeFinal:!1}));We([E,M],([q,z],[O,B])=>{O&&(q===O&&z===B||(T(),z!==B&&(l=[],c="")))},{flush:"sync"});const R=D(()=>{var q,z,O,B,P,H,j,Z,ie,W,Q;if((q=e.nodes)!=null&&q.length)return l=[],c="",w(0),Et(e.nodes.slice());const te=r.value;if(!te)return l=[],c="",w(-1),[];const X=t.debugPerformanceEnabled.value,ge=X?Ma():0,ue=S.value,se=E.value,fe=M.value;a&&se!==a&&(function(ze){var ft,gt;(gt=(ft=ze.stream)==null?void 0:ft.reset)==null||gt.call(ft)})(ue),u&&fe!==u&&(l=[],c="");const G=Object.keys((O=(z=t.customComponentsMap)==null?void 0:z.value)!=null?O:{}).length>0||typeof _.value.postTransformNodes=="function";G!==d&&(l=[],c="");const ae=!G&&l.length>0&&te.startsWith(c)&&fe===u,K=X?tN(ue):null,re=X?{}:void 0,be=lN(ue),ke=!be&&!G,we=Dt(Dt(Dn(Dt({},_.value),{__reuseStableTopLevelNodes:ke}),be?{__disableStreamParse:!0}:{}),re?{__timing:re}:{}),oe=Gj(te,ue,we),le=X?Ma():0,ye=X?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Ae,_e=X?H2(oe.length):void 0,pe=0,ne=0,Ee=0;if(ae){const ze=X?Ma():0,[ft,gt]=(function(Pt){var Ht,jt;const[Te,Fe]=Pt.scanGlobalReferenceAppend(Pt.previousContent,Pt.content),Ke=Pt.parseOptions;return[Pt.previousDirtyStartIndex>0&&Ke.final!==!0&&!Pt.customMarkdownIt&&!lN(Pt.md)&&!Te&&typeof Ke.preTransformTokens!="function"&&typeof Ke.postTransformTokens!="function"&&typeof Ke.postTransformNodes!="function"&&((jt=(Ht=Ke.customHtmlTags)==null?void 0:Ht.length)!=null?jt:0)===0?Pt.previousDirtyStartIndex:0,Fe]})({content:te,previousContent:c,previousDirtyStartIndex:y,parseOptions:_.value,customMarkdownIt:e.customMarkdownIt,md:ue,scanGlobalReferenceAppend:f});Ee=gt;const _t=ft<=0;if(ye){const Pt=(function(Ht,jt,Te,Fe={}){var Ke;if(!jt.length)return{nodes:Ht,metrics:H2(Ht.length)};const rt=(Ke=Fe.scanStartIndex)!=null?Ke:0,Nt=Fe.reuseDirtyTail!==!1,Lt=(function(en,it,dt,wt=0){const dn=Math.min(en.length,it.length);for(let Gt=Math.min(dn,Math.max(0,wt));GtHd(ze[_t]))})(Ae,ye,ne):(function(ze,ft=0){for(let gt=Math.max(0,ft);gt((P=K?.total)!=null?P:0);t.logPerf(ft?"parse(stream)":"parse(sync)",Dt(Dt(Dt({rendererId:t.instanceMsgId,ms:Math.round(Ma()-ge),nodes:Ae.length,contentLength:te.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:qe,referenceDefinitionScanChars:Ee,signatureMs:(H=ye?.signatureMs)!=null?H:0,stabilizeSignatureMs:(j=ye?.stabilizeSignatureMs)!=null?j:0,primeSignatureMs:(Z=ye?.primeSignatureMs)!=null?Z:0,signatureCallCount:(ie=ye?.signatureCallCount)!=null?ie:0,stabilizeSignatureCallCount:(W=ye?.stabilizeSignatureCallCount)!=null?W:0,primeSignatureCallCount:(Q=ye?.primeSignatureCallCount)!=null?Q:0,stabilizeMs:pe},_e??{}),re?Object.fromEntries(M9e.map(gt=>{var _t;return[gt,(_t=re[gt])!=null?_t:0]})):{}),ze?{streamMode:ze.lastMode,streamDelta:B9e(ze,K),streamStats:ze}:{}))}return Et(Ae)});return{effectiveCustomHtmlTags:N,effectiveCustomHtmlTagsSet:x,mdBase:I,mdInstance:S,mergedParseOptions:_,getParsedNodesDirtyStartIndex:()=>y,getParsedNodesRevision:()=>b,parsedNodes:R}}function $9e(e){const{isClient:t}=e,n=V(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const v=n.value,y=v.has(f);if(h){if(y)return;const w=new Set(v);return w.add(f),void(n.value=w)}if(!y)return;const b=new Set(v);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return uv()&&Gd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const P9e={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},aN=/auto|scroll|overlay/i;function z9e(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return aN.test(t)||aN.test(n)}function j9e(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const H9e={class:"m-0 p-0"},W9e=["data-probe"],q9e=$i(lt(Dn(Dt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),L("div",{class:"height-estimation-probes",style:on({width:`${e.width}px`}),"aria-hidden":"true"},[A("div",{ref:s=>e.setParagraphWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[U(p(gh),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),A("div",{ref:s=>e.setListItemWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[A("ul",H9e,[U(p(a1),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),A("div",{ref:s=>e.setListWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[U(p(u1),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),L(De,null,Ct(6,s=>A("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[U(p(jk),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,W9e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),uN=lt({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return s4((i=zp(e.estimatedPreviewHeightPx))!=null?i:i4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Tn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Tn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Tn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Tn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Tn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Tn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Tn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Tn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Tn("div",{class:"absolute inset-0"},[Tn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),cN=lt({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return o4((i=zp(e.estimatedPreviewHeightPx))!=null?i:n4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Tn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Tn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Tn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Tn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Tn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Tn("span",{class:"action-icon block"})])))]):null,Tn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Tn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Tn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),U9e={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Rs(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const V9e=["data-custom-id"],K9e=["data-node-index","data-node-type"],dN="typewriter-simple-cursor-target",zH=$i(lt(Dn(Dt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s($){if(!(typeof Event<"u"&&$ instanceof Event))return typeof $=="string"&&o("copy-code",$),void o("copy",$)}const r=ps(),l=Jt("markstreamNestedRendererProps",void 0);function a($){const J=r?.vnode.props;return!!J&&(Object.prototype.hasOwnProperty.call(J,$)||Object.prototype.hasOwnProperty.call(J,String($).replace(/[A-Z]/g,he=>`-${he.toLowerCase()}`)))}function u($){var J,he;const me=i[$];return a($)?me:(he=(J=l?.value)==null?void 0:J[$])!=null?he:me}const c=D(()=>{return($=u("mode"))==="chat"||$==="minimal"||$==="docs"?$:"docs";var $}),d=D(()=>YL(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return($={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":$.codeRenderer==="pre"||$.codeRenderer==="shiki"||$.codeRenderer==="monaco"?$.codeRenderer:$.renderCodeBlocksAsPre===!1||$.mode==="docs"?"monaco":"pre";var $}),g=D(()=>U9e[c.value]),v=D(()=>{var $;return($=u("showTooltips"))!=null?$:g.value.showTooltips}),y=D(()=>{var $;return($=u("fade"))!=null?$:g.value.fade}),b=D(()=>{var $;return($=u("batchRendering"))!=null?$:g.value.batchRendering}),w=D(()=>{var $;return($=u("initialRenderBatchSize"))!=null?$:g.value.initialRenderBatchSize}),C=D(()=>{var $;return($=u("renderBatchSize"))!=null?$:g.value.renderBatchSize}),T=D(()=>{var $;return($=u("renderBatchDelay"))!=null?$:g.value.renderBatchDelay}),N=D(()=>{var $;return($=u("renderBatchBudgetMs"))!=null?$:g.value.renderBatchBudgetMs}),I=D(()=>{var $;return($=u("renderBatchIdleTimeoutMs"))!=null?$:g.value.renderBatchIdleTimeoutMs}),S=D(()=>{var $;return($=u("deferNodesUntilVisible"))!=null?$:g.value.deferNodesUntilVisible}),_=D(()=>{var $;return($=u("maxLiveNodes"))!=null?$:g.value.maxLiveNodes}),x=D(()=>{var $;return($=u("liveNodeBuffer"))!=null?$:g.value.liveNodeBuffer}),E=D(()=>{var $;return($=u("nodeVirtual"))!=null?$:g.value.nodeVirtual}),M={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return v.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return y.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return w.value},get renderBatchSize(){return C.value},get renderBatchDelay(){return T.value},get renderBatchBudgetMs(){return N.value},get renderBatchIdleTimeoutMs(){return I.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return _.value},get liveNodeBuffer(){return x.value},get nodeVirtual(){return E.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function R($){o("height-change",$)}function q($){o("virtual-state-change",$)}function z($){o("anchor-change",$)}const O=V(),B=V(null),P=V(null),H=V(null),j=po({1:null,2:null,3:null,4:null,5:null,6:null}),Z=V(!1),ie=new Map,W=V(0),Q=V(0),te=V({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function X($,J){return typeof $!="string"?J:$.trim()||J}function ge($){const J=Number($);return Number.isFinite(J)&&J>0?Math.max(1,Math.trunc(J)):640}const ue=D(()=>{var $;const J=($=M.viewportPriorityOptions)!=null?$:{},he=X(J.rootMargin,Th);return{rootMargin:he,heavyBlockMargin:X(J.heavyBlockMargin,he),maxTargets:ge(J.maxTargets)}}),se=D(()=>{var $;return($=ue.value.rootMargin)!=null?$:Th}),fe=D(()=>{var $;return($=ue.value.maxTargets)!=null?$:640});function G(){var $,J;if((($=i.virtualScroll)==null?void 0:$.enabled)!==!0)return null;const he=(J=i.virtualScroll)==null?void 0:J.scrollRoot;return ae(typeof he=="function"?he():he)}function ae($){return $?typeof HTMLElement<"u"&&$ instanceof HTMLElement?$:typeof $=="object"&&"value"in $?ae($.value):typeof $=="object"&&"$el"in $?ae($.$el):null:null}ii(AH,ue);const{isClient:K,renderAsFragment:re,debugPerformanceEnabled:be,resolvedShowTooltips:ke,resolvedHtmlPolicy:we,inheritedSmoothStreaming:oe,ownsTypewriterCursor:le}=(function($){const J=typeof window<"u",he=q1(),me=Jt("markstreamHtmlPolicy",void 0),Le=Jt("markstreamTypewriterCursor",void 0),Oe=Jt("markstreamSmoothStreaming",void 0),Ze=D(()=>$.renderAsFragment===!0),et=D(()=>!!($.debugPerformance&&J&&typeof console<"u")),mt=D(()=>{var pt;if(typeof $.showTooltips=="boolean")return $.showTooltips;const Qe=(pt=he.showTooltips)!=null?pt:he["show-tooltips"];return Qe===""||Qe===!0||Qe==="true"||Qe!==!1&&Qe!=="false"&&void 0}),tt=D(()=>{var pt,Qe;return(Qe=(pt=$.htmlPolicy)!=null?pt:me?.value)!=null?Qe:"safe"}),ut=D(()=>Le?.value!==!0);return{isClient:J,renderAsFragment:Ze,debugPerformanceEnabled:et,resolvedShowTooltips:mt,resolvedHtmlPolicy:tt,inheritedSmoothStreaming:Oe,inheritedTypewriterCursor:Le,ownsTypewriterCursor:ut}})(M),{resolveViewportRoot:ye,resolveScrollContainer:Ae,isReverseFlexScrollRoot:_e,getNormalizedScrollTop:pe,getOffsetTopWithinRoot:ne}=(function($,J){function he(){var et,mt;return(mt=(et=J.scrollRoot)==null?void 0:et.call(J))!=null?mt:null}function me(et){if(typeof window>"u")return null;const mt=he();if(mt)return mt;const tt=et??$.value;if(!tt)return null;const ut=tt.ownerDocument||document,pt=ut.scrollingElement||ut.documentElement;let Qe=tt;for(;Qe&&Qe!==ut.body&&Qe!==pt;){if(z9e(window.getComputedStyle(Qe))&&j9e(Qe))return Qe;Qe=Qe.parentElement}return null}function Le(et){if(!J.isClient)return!1;try{const mt=window.getComputedStyle(et);return!!(mt.display||"").toLowerCase().includes("flex")&&(mt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Oe(et,mt,tt){var ut,pt;if(tt)return Ze(mt);const Qe=et.scrollTop;if(!Le(et))return Qe;const ct=Qe<0?-Qe:Qe;return Math.max(0,((ut=et.scrollHeight)!=null?ut:0)-((pt=et.clientHeight)!=null?pt:0))-ct}function Ze(et){var mt,tt,ut,pt,Qe;const ct=Number((mt=et.scrollingElement)==null?void 0:mt.scrollTop),At=Number((ut=(tt=et.documentElement)==null?void 0:tt.scrollTop)!=null?ut:0),yt=Number((Qe=(pt=et.body)==null?void 0:pt.scrollTop)!=null?Qe:0);return Math.max(0,Number.isFinite(ct)?ct:0,Number.isFinite(At)?At:0,Number.isFinite(yt)?yt:0)}return{resolveViewportRoot:me,resolveScrollContainer:function(et){var mt,tt,ut,pt;const Qe=he();if(Qe)return Qe;const ct=me((mt=et??$.value)!=null?mt:null);if(ct)return ct;const At=(pt=(ut=et?.ownerDocument)!=null?ut:(tt=$.value)==null?void 0:tt.ownerDocument)!=null?pt:typeof document<"u"?document:null;return At?.scrollingElement||At?.documentElement||null},isReverseFlexScrollRoot:Le,getNormalizedScrollTop:Oe,getOffsetTopWithinRoot:function(et,mt){const tt=mt.ownerDocument||et.ownerDocument||document;if((function(ct,At){return ct===At.documentElement||ct===At.body||ct===At.scrollingElement})(mt,tt))return et.getBoundingClientRect().top+Ze(tt);const ut=mt.getBoundingClientRect(),pt=et.getBoundingClientRect(),Qe=Oe(mt,tt,!1);return pt.top-ut.top+Qe}}})(O,{isClient:K,scrollRoot:G});ii("markstreamShowTooltips",ke),ii("markstreamHtmlPolicy",we),ii("markstreamTypewriter",f),ii("markstreamFade",D(()=>M.fade!==!1)),ii("markstreamTypewriterCursor",D(()=>!0)),ii("markstreamTextStreamState",ie),ii("markstreamStreamVersion",W),ii("markstreamParseOptions",D(()=>M.parseOptions)),ii("markstreamCustomMarkdownIt",D(()=>M.customMarkdownIt));const{smoothStreamingEnabled:Ee,renderContent:qe,requestedFinal:ze,effectiveFinal:ft}=(function($,J){const he=O9e(Dt(Dt({},P9e),$.smoothStreamingOptions)),me=D(()=>{var Qe,ct,At;return $.smoothStreaming!==!1&&!((Qe=$.nodes)!=null&&Qe.length)&&($.smoothStreaming===!0||!((ct=J.inheritedSmoothStreaming)!=null&&ct.value))&&($.smoothStreaming===!0||YL($.typewriter)!=="off"||((At=$.maxLiveNodes)!=null?At:0)<=0)}),Le=V(!J.isClient||$.smoothStreaming===!0);yn(()=>{Le.value=!0});const Oe=D(()=>Le.value&&me.value),Ze=D(()=>{var Qe;return Oe.value?he.visible.value:(Qe=$.content)!=null?Qe:""}),et=D(()=>{var Qe,ct;const At=(Qe=$.parseOptions)!=null?Qe:{};return(ct=$.final)!=null?ct:At.final}),mt=D(()=>{const Qe=et.value;return Oe.value&&Qe!=null?!!Qe&&he.caughtUp.value:Qe});let tt=0,ut=!1;function pt(){tt=0,ut=!1}return We([()=>$.content,()=>$.nodes,Oe,et],([Qe,ct,At,yt])=>{if(ct?.length)return pt(),void he.reset("");const Wt=Qe??"";if(!At)return pt(),he.reset(Wt),void(yt&&he.finish({flush:!0}));const It=he.source.value;if(Wt){if(Wt!==It)if(Wt.startsWith(It)){const tn=Wt.slice(It.length),un=he.pendingChars.value;tn.length<=8?(tt++,ut||tt>=2&&un<=8?(ut=!0,he.reset(Wt)):he.enqueue(tn)):(pt(),he.enqueue(tn))}else pt(),he.reset(Wt)}else pt(),he.reset("");yt&&he.finish()},{immediate:!0}),{smoothStream:he,smoothStreamingEligible:me,smoothStreamingEnabled:Oe,renderContent:Ze,requestedFinal:et,effectiveFinal:mt}})(M,{isClient:K,inheritedSmoothStreaming:oe}),gt=ze.value===!0;ii("markstreamSmoothStreaming",Ee);const _t=V(!1),Pt=V(!1),Ht=V(!1);let jt="",Te=!1,Fe=null;function Ke(){K&&Fe!=null&&(window.clearTimeout(Fe),Fe=null)}function rt(){_t.value=!1,Ke()}function Nt($,J){if(!be.value)return;const he=(function(){if(!be.value)return null;const me=it(Lt),Le=it(Qt),Oe=Math.max(en,Le);if(me<=0&&Oe<=0)return null;const Ze={total:me,maxPerFrame:Oe,byLabel:(et=Lt,Object.fromEntries(Array.from(et.entries()).sort((mt,tt)=>tt[1]-mt[1]||mt[0].localeCompare(tt[0]))))};var et;return Lt.clear(),Qt.clear(),en=0,Ze})();console.info(`[markstream-vue][perf] ${$}`,he?Dn(Dt({},J),{layoutReads:he}):J)}We([()=>M.indexKey,()=>M.customId],()=>{var $,J;rt(),Pt.value=!1,Ht.value=!(($=i.nodes)!=null&&$.length)&&ze.value!==!0&&!!i.content,jt=(J=qe.value)!=null?J:"",Te=jt.length>0},{flush:"sync"}),We([()=>i.content,()=>i.nodes,ze],([$,J,he])=>{!J?.length&&he!==!0&&$&&(Ht.value=!0)},{flush:"sync",immediate:!0}),We([qe,()=>i.nodes,ze],([$,J,he])=>{const me=$??"";return J?.length||he===!0?(rt(),Pt.value=!1,jt=me,void(Te=!0)):(me.length>0&&(Ht.value=!0),Te?(jt&&me.length>jt.length&&me.startsWith(jt)?(_t.value=!0,Pt.value=!0,K&&(Ke(),Fe=window.setTimeout(()=>{var Le;Fe=null,ft.value===!0||(Le=i.nodes)!=null&&Le.length||(op(),_t.value=!1,Wu())},1200))):(me.length"u")return null;const Oe=window;if(Oe.__markstreamLayoutReadPerformance)return Oe.__markstreamLayoutReadPerformance;const Ze={total:0,maxPerFrame:0,byLabel:{}};return Oe.__markstreamLayoutReadPerformance=Ze,Ze})();Le&&(Le.total=Number(Le.total||0)+1,Le.byLabel[me]=Number(Le.byLabel[me]||0)+1,Le.currentFrameTotal=Number(Le.currentFrameTotal||0)+1,Le.frameScheduled||(Le.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>wt(Le),0):queueMicrotask(()=>wt(Le)):window.requestAnimationFrame(()=>wt(Le))))})($),Ut||(Ut=!0,K&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(dt):typeof queueMicrotask!="function"?setTimeout(dt,0):queueMicrotask(dt)))}function Gt($,J){return dn($),J()}const ri=M.customId?`renderer-${M.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,ci=(function($){const J=new Map;return{scope:$,cache:J,clear:()=>J.clear()}})(ri),ji=ri;ii(LH,ci);const xi=gs(()=>M.customId),{effectiveCustomHtmlTagsSet:Uo,mergedParseOptions:ot,parsedNodes:Ue,getParsedNodesDirtyStartIndex:st,getParsedNodesRevision:_n}=R9e(M,{instanceMsgId:ri,renderContent:qe,effectiveFinal:ft,smoothStreamingEnabled:Ee,debugPerformanceEnabled:be,customComponentsMap:xi,logPerf:Nt});We(Ue,()=>{_t.value||ci.clear(),W.value+=1},{immediate:!0});const bt=D(()=>({customId:M.customId,customHtmlTags:ot.value.customHtmlTags,parseOptions:M.parseOptions,customMarkdownIt:M.customMarkdownIt,htmlPolicy:we.value,viewportPriority:M.viewportPriority,viewportPriorityOptions:ue.value,mode:c.value,domMode:M.domMode,codeRenderer:m.value,codeBlockStream:M.codeBlockStream,codeBlockDarkTheme:M.codeBlockDarkTheme,codeBlockLightTheme:M.codeBlockLightTheme,codeBlockMonacoOptions:M.codeBlockMonacoOptions,renderCodeBlocksAsPre:M.renderCodeBlocksAsPre,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockProps:M.codeBlockProps,mermaidProps:M.mermaidProps,d2Props:M.d2Props,infographicProps:M.infographicProps,showTooltips:ke.value,themes:M.themes,langs:M.langs,isDark:M.isDark,typewriter:f.value,smoothStreamingOptions:M.smoothStreamingOptions,parseCoalesceMs:M.parseCoalesceMs,fade:M.fade}));ii("markstreamNestedRendererProps",bt);const Zn=D(()=>Ue.value),vs=D(()=>Ue.value.length),go=V(null),Ls=V(null),Hs=V(null),ys=V(null),Vo=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Ti=!Vo&&M.customId?VL(M.customId):null,Tr=D(()=>Ti?(S8.value,VL(M.customId)):null),vo=D(()=>{var $;return!!(!re.value&&M.customId&&!Vo&&(($=Tr.value)!=null&&$.enabled))}),no=D(()=>!!(K&&vo.value)),_o=D(()=>{var $;return!!(!re.value&&(($=i.virtualScroll)!=null&&$.enabled))}),Er=D(()=>_o.value),Bo=V(!1);yn(()=>{Bo.value=!0});const Qn=D(()=>!!(K&&_o.value));ii("markstreamHostScrollManaged",Qn);const Zi=D(()=>!!(Bo.value&&Qn.value)),yi=D(()=>no.value||Qn.value),Hi=D(()=>no.value||Zi.value),io=D(()=>{var $;return yi.value&&(($=Tr.value)==null?void 0:$.textEstimation)!==!1});function ki(){const $=Q.value||Gt("getMeasuredContainerWidth.clientWidth",()=>{var J;return((J=O.value)==null?void 0:J.clientWidth)||0});return Number.isFinite($)&&$>0?$:0}const di=D(()=>{const $=ki();return $>0?Math.max(1,Math.round($)):640}),bi=D(()=>{var $,J;return!(ft.value!==!0||_o.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||($=i.nodes)!=null&&$.length||Ht.value||!(((J=M.maxLiveNodes)!=null?J:0)<=0))}),oo=D(()=>{var $;return bi.value?50:Math.max(1,($=M.maxLiveNodes)!=null?$:320)}),so=D(()=>{var $;return bi.value?16:Math.max(0,($=M.liveNodeBuffer)!=null?$:60)}),Mn=D(()=>{var $;return!re.value&&M.nodeVirtual!==!1&&!((($=M.maxLiveNodes)!=null?$:0)<=0&&!bi.value)&&(M.nodeVirtual===!0?Ue.value.length>0:Ue.value.length>oo.value)}),Ns=D(()=>Mn.value||no.value||Qn.value),Ws=D(()=>M.viewportPriority!==!1),Jo=D(()=>!!Ws.value&&!Z.value);var ks;ks=D(()=>Ws.value),ii(xH,ks);const ro=D(()=>{var $;return!(re.value||M.deferNodesUntilVisible===!1||(($=M.maxLiveNodes)!=null?$:0)<=0||Mn.value||Ue.value.length>900||M.viewportPriority===!1)}),eo=v2e($=>{var J;return ye((J=$??O.value)!=null?J:null)},Ws),{requestFrame:to,cancelFrame:Gi,hasIdleCallback:je,isTestEnv:xe}=(function($){const J=$.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,he=$.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,me=$.isClient&&typeof window.requestIdleCallback=="function",Le=(function(){var Oe;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ze=(Oe=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Oe.value;return Ze?.env})();return{requestFrame:J,cancelFrame:he,hasIdleCallback:me,isTestEnv:Le?.NODE_ENV==="test"}})({isClient:K}),Pe=D(()=>ft.value===!0&&!_o.value),{resolvedBatchSize:rn,resolvedInitialBatch:Yn,batchingEnabled:ei,incrementalRenderingActive:Qi,renderedCount:Vn,previousRenderContext:qs,adaptiveBatchSize:bs,previousBatchConfig:Je}=(function($,J){var he;const me=D(()=>{var pt;const Qe=Math.trunc((pt=$.renderBatchSize)!=null?pt:80);return Number.isFinite(Qe)?Math.max(0,Qe):0}),Le=D(()=>{var pt;const Qe=Math.trunc((pt=$.initialRenderBatchSize)!=null?pt:me.value);return Number.isFinite(Qe)?Math.max(0,Qe):me.value}),Oe=D(()=>!J.renderAsFragment.value&&$.batchRendering!==!1&&me.value>0&&J.isClient&&!J.isTestEnv),Ze=V(0),et=V({key:$.indexKey,total:0}),mt=V(Math.max(1,me.value||1)),tt=D(()=>{var pt,Qe,ct;return Oe.value&&!((pt=J.continuousStreaming)!=null&&pt.value)&&!((Qe=J.forceFullRenderFinalContent)!=null&&Qe.value)&&((ct=$.maxLiveNodes)!=null?ct:0)<=0}),ut=V({batchSize:me.value,initial:Le.value,delay:(he=$.renderBatchDelay)!=null?he:16,enabled:tt.value});return{resolvedBatchSize:me,resolvedInitialBatch:Le,batchingEnabled:Oe,incrementalRenderingActive:tt,renderedCount:Ze,previousRenderContext:et,adaptiveBatchSize:mt,previousBatchConfig:ut}})(M,{isClient:K,isTestEnv:xe,renderAsFragment:re,forceFullRenderFinalContent:Pe,continuousStreaming:D(()=>Pt.value&&ft.value!==!0)}),Ve=D(()=>{var $;return!re.value&&M.batchRendering!==!1&&rn.value>0&&!xe&&(($=M.maxLiveNodes)!=null?$:0)<=0&&!Pe.value}),St=D(()=>Ve.value),Rt=D(()=>yi.value||St.value),Fn=D(()=>{var $;return Rt.value&&(($=Tr.value)==null?void 0:$.codeBlockEstimation)!==!1}),fi=new Map,Mo=new Map,Io=new WeakMap;let ni=null;const Ro=new WeakMap,mi=new Map,cr=[];let Ni=[],Us=[],Vs=-1;const Ds=Ka(cr),$o=new Set,zu=V(0);let Ks=0;const Ul=V(0),pf=D(()=>(Ul.value,Array.from(fi.entries()).sort(($,J)=>$[0]-J[0]))),Vl=V(null),Ko=V(null);let Fs,Cl=null,Ya=0,Lr=null;function lo(){Fs.markFallbackHeightPrefixDirty()}function Ja($){return Fs.getFallbackNodeHeight($)}function Zs($,J){return Fs.estimateHeightRange($,J)}function yo($){return Fs.estimateIndexForOffset($)}const{activeRestoreAnchor:Xo,getRelativeScrollTopWithinContainer:Yr,setRelativeScrollTopWithinContainer:Kl,resolveAnchorOffset:Zl,clearRestoreReconcile:Nr,scheduleRestoreReconcile:Al,captureRestoreAnchor:Xa,restoreAnchor:Gl,getAnchorDrift:ju}=(function($){const{isClient:J,containerRef:he,parsedNodeCount:me,requestFrame:Le,cancelFrame:Oe,resolveScrollContainer:Ze,getNormalizedScrollTop:et,getOffsetTopWithinRoot:mt,isReverseFlexScrollRoot:tt,estimateIndexForOffset:ut,estimateHeightRange:pt,getFallbackNodeHeight:Qe,clamp:ct}=$,At=V(null);let yt=null,Wt=[];function It(){const wn=Ze(),jn=he.value;if(!wn||!jn)return null;const Xn=wn.ownerDocument||jn.ownerDocument||document;if(wn===Xn.documentElement||wn===Xn.body||wn===Xn.scrollingElement){const Wi=jn.getBoundingClientRect();return Math.max(0,-Wi.top)}return Math.max(0,et(wn,Xn,!1)-mt(jn,wn))}function tn(wn){var jn;const Xn=Ze(),Wi=he.value;if(!Xn||!Wi)return;const Ys=Math.max(0,wn),Bs=Xn.ownerDocument||Wi.ownerDocument||document,Sa=Bs.defaultView||(typeof window<"u"?window:null);if(Xn===Bs.documentElement||Xn===Bs.body||Xn===Bs.scrollingElement){const iu=et(Xn,Bs,!0)+Wi.getBoundingClientRect().top;return void((jn=Sa?.scrollTo)==null||jn.call(Sa,0,Math.max(0,iu+Ys)))}GL(Xn,Bs,mt(Wi,Xn)+Ys,{isReverseFlexScrollRoot:iu=>{var Tm;return(Tm=tt?.(iu))!=null&&Tm},getNormalizedScrollTop:et})}function un(wn){const jn=me.value,Xn=ct(wn.nodeIndex,0,Math.max(0,jn-1));return pt(0,Xn)+Math.max(0,wn.offsetWithinNodePx)}function bn(){if(yt!=null&&(Oe?.(yt),yt=null),J)for(const wn of Wt)window.clearTimeout(wn);Wt=[]}function gn(wn){const jn=un(wn),Xn=It();Xn!=null&&Math.abs(Xn-jn)<=.5||tn(jn)}return{activeRestoreAnchor:At,getRelativeScrollTopWithinContainer:It,setRelativeScrollTopWithinContainer:tn,resolveAnchorOffset:un,clearRestoreReconcile:bn,applyRestoreAnchor:gn,scheduleRestoreReconcile:function(){At.value&&J&&yt==null&&(yt=Le?Le(()=>{yt=null,At.value&&gn(At.value)}):null,yt==null&&At.value&&gn(At.value))},captureRestoreAnchor:function(){const wn=It(),jn=me.value;if(wn==null||jn<=0)return null;const Xn=ct(ut(wn+1),0,jn-1),Wi=pt(0,Xn),Ys=Qe(Xn);return{nodeIndex:Xn,offsetWithinNodePx:ct(wn-Wi,0,Math.max(0,Ys-1))}},restoreAnchor:function(wn){const jn=me.value;if(At.value={nodeIndex:ct(wn.nodeIndex,0,Math.max(0,jn-1)),offsetWithinNodePx:Math.max(0,wn.offsetWithinNodePx)},bn(),gn(At.value),J)for(const Xn of[0,120,280,480])Wt.push(window.setTimeout(()=>{At.value&&gn(At.value)},Xn))},getAnchorDrift:function(wn){const jn=It();return jn==null?null:jn-un(wn)}}})({isClient:K,containerRef:O,parsedNodeCount:vs,requestFrame:to,cancelFrame:Gi,resolveScrollContainer:()=>Vl.value||Ae(),getNormalizedScrollTop:pe,getOffsetTopWithinRoot:ne,isReverseFlexScrollRoot:_e,estimateIndexForOffset:yo,estimateHeightRange:Zs,getFallbackNodeHeight:Ja,clamp:Qs}),{nodeHeights:Y,heightStats:ve,heightTreeSize:Be,heightSumTree:He,heightKnownTree:Ye,averageNodeHeight:Xe,resetHeightMeasurements:vt,pruneHeightMeasurements:$t,rebuildHeightTrees:Vt,recordNodeHeight:pn,removeNodeHeights:In,exportHeightCache:Bn,importHeightCache:an,fenwickRangeSum:An}=(function($={}){const J=po({}),he=po({total:0,count:0}),me=V(0),Le=V([]),Oe=V([]);function Ze(){for(const Qe of Object.keys(J))delete J[Number(Qe)];he.total=0,he.count=0,me.value=0,Le.value=[],Oe.value=[]}function et(Qe,ct,At){for(let yt=ct+1;yt0;yt-=yt&-yt)At+=Qe[yt];return At}function tt(Qe){me.value=Qe;const ct=new Array(Qe+1).fill(0),At=new Array(Qe+1).fill(0);for(const[yt,Wt]of Object.entries(J)){const It=Number(yt),tn=Number(Wt);!Number.isFinite(It)||It<0||It>=Qe||!Number.isFinite(tn)||tn<=0||(et(ct,It,tn),et(At,It,1))}Le.value=ct,Oe.value=At}function ut(Qe){if(!Number.isInteger(Qe)||Qe<0)return!1;const ct=J[Qe];if(!Number.isFinite(ct)||ct<=0)return!1;if(delete J[Qe],he.total=Math.max(0,he.total-ct),he.count=Math.max(0,he.count-1),me.value>Qe){const At=Le.value,yt=Oe.value;At.length&&yt.length&&(et(At,Qe,-ct),et(yt,Qe,-1))}return!0}const pt=D(()=>he.count>0?Math.max(12,he.total/he.count):32);return{nodeHeights:J,heightStats:he,heightTreeSize:me,heightSumTree:Le,heightKnownTree:Oe,averageNodeHeight:pt,resetHeightMeasurements:Ze,pruneHeightMeasurements:function(Qe){if(Qe<=0)return void Ze();let ct=0,At=0;for(const[yt,Wt]of Object.entries(J)){const It=Number(yt),tn=Number(Wt);!Number.isFinite(It)||It<0||It>=Qe||!Number.isFinite(tn)||tn<=0?delete J[It]:(ct+=tn,At++)}he.total=ct,he.count=At},rebuildHeightTrees:tt,recordNodeHeight:function(Qe,ct,At={}){(function(yt,Wt,It={}){var tn;if(!Number.isFinite(Wt)||Wt<=0)return!1;const un=J[yt];if(un&&(It.allowShrink===!1&&Wtyt){const bn=Le.value,gn=Oe.value;if(bn.length&&gn.length)if(un){const wn=Wt-un;wn!==0&&et(bn,yt,wn)}else et(bn,yt,Wt),et(gn,yt,1)}It.notify!==!1&&((tn=$.onHeightRecorded)==null||tn.call($))})(Qe,ct,Dn(Dt({},At),{notify:!0}))},removeNodeHeight:function(Qe,ct={}){var At;const yt=ut(Qe);return yt&&ct.notify!==!1&&((At=$.onHeightRecorded)==null||At.call($)),yt},removeNodeHeights:function(Qe,ct={}){var At;let yt=0;for(const Wt of Qe)ut(Number(Wt))&&yt++;return yt>0&&ct.notify!==!1&&((At=$.onHeightRecorded)==null||At.call($)),yt},exportHeightCache:function(){return Object.entries(J).map(([Qe,ct])=>({index:Number(Qe),height:Number(ct)})).filter(Qe=>Number.isFinite(Qe.index)&&Qe.index>=0&&Number.isFinite(Qe.height)&&Qe.height>0).sort((Qe,ct)=>Qe.index-ct.index)},importHeightCache:function(Qe,ct={}){var At;if(!Array.isArray(Qe))return;const yt=me.value;let Wt=!1;if(ct.mode!=="merge"){const It=Object.keys(J);if(It.length>0){for(const tn of It)delete J[Number(tn)];Wt=!0}}for(const It of Qe){const tn=Number(It.index),un=Number(It.height);if(!Number.isInteger(tn)||tn<0||yt>0&&tn>=yt||!Number.isFinite(un)||un<=0)continue;const bn=J[tn];bn&&Math.abs(bn-un)<=1||(J[tn]=un,Wt=!0)}Wt&&((function(){let It=0,tn=0;const un=me.value;for(const[bn,gn]of Object.entries(J)){const wn=Number(bn),jn=Number(gn);!Number.isFinite(wn)||wn<0||un>0&&wn>=un||!Number.isFinite(jn)||jn<=0?delete J[wn]:(It+=jn,tn++)}he.total=It,he.count=tn})(),yt>0&&tt(yt),(At=$.onHeightRecorded)==null||At.call($))},fenwickRangeSum:function(Qe,ct,At){if(At<=ct)return 0;const yt=mt(Qe,At-1);return ct<=0?yt:yt-mt(Qe,ct-1)}}})({onHeightRecorded:()=>{lo(),Qn.value&&Am(),Xo.value&&Al(),Ko.value&&tp(),uo("node-resize")}});function Hn($){Number.isInteger($)&&$>=0&&$o.add($)}function Wn($){for(const J of $)Hn(Number(J))}function Di($){Ks++;let J=!0;try{const he=$();return J=he!==!1,he}finally{Ks--,Ks===0&&J&&zu.value++}}function ao(){Ni=[],Us=[],Vs=-1,$o.clear(),Ds.value=cr}function dr(){ao(),Di(()=>vt()),mi.clear()}function Dc($){!Number.isInteger($)||$<0||$>=Ue.value.length||mi.set($,fm($))}function xl($,J,he={}){const me=Y[$];Hn($),pn($,J,he);const Le=Y[$];return Object.is(me,Le)?($o.delete($),!1):(Le&&Le>0?Dc($):me&&mi.delete($),!0)}function wa($,J){const he=Gt("getNodeLayoutHeight.slot.offsetHeight",()=>{var me,Le;return(Le=(me=fi.get($))==null?void 0:me.offsetHeight)!=null?Le:0});return he>0?he:Gt("getNodeLayoutHeight.content.offsetHeight",()=>J.offsetHeight)}function Me($,J={}){J.mode!=="merge"?ao():Wn($.map(he=>he.index)),Di(()=>an($,J)),qb()}const Ne=D(()=>ro.value&&Jo.value),nt=D(()=>{var $;return!re.value&&M.batchRendering!==!1&&rn.value>0&&(($=M.maxLiveNodes)!=null?$:0)<=0}),Ft=D(()=>!re.value&>&&ft.value===!0&&!Mn.value&&!_o.value&&!vo.value&&!Ne.value&&!nt.value),fn=D(()=>!!eo&&Ne.value),$n=D(()=>Mn.value||Qn.value),{focusIndex:Gn,liveRange:zn,updateLiveRange:bo}=(function($,J){const{parsedNodeCount:he,virtualizationEnabled:me,maxLiveNodesResolved:Le,liveNodeBufferResolved:Oe,clamp:Ze}=J,et=Oe??D(()=>{var ut;return Math.max(0,(ut=$.liveNodeBuffer)!=null?ut:60)}),mt=V(0),tt=po({start:0,end:0});return{liveNodeBufferResolved:et,focusIndex:mt,liveRange:tt,updateLiveRange:function(){const ut=he.value;if(!me.value||ut===0)return tt.start=0,void(tt.end=ut);const pt=Math.min(Le.value,ut),Qe=et.value,ct=Ze(mt.value-Qe,0,Math.max(0,ut-pt));tt.start=ct,tt.end=Math.min(ut,ct+pt)}}})(M,{parsedNodeCount:vs,virtualizationEnabled:Mn,maxLiveNodesResolved:oo,liveNodeBufferResolved:so,clamp:Qs}),Gs=new Map,Sl=new Map,Ca=new Map,mf=[],Aa=new Map,xa=new Set,Zh=V(0);let eu=!1;const Hv=D(()=>(Zh.value,xa.size)),es=new Map,Ql=new Map,am=V(0),um=D(()=>{am.value;let $=0;for(const J of es.values())$+=Math.max(0,J);return $});let fr=null;const Ie=D(()=>{if(!Mn.value)return Ue.value.length;const $=so.value,J=Math.max(zn.end+$,Yn.value),he=Math.min(Ue.value.length,J);return Math.max(Vn.value,he)});function at(){eu||(eu=!0,queueMicrotask(()=>{eu=!1,Zh.value+=1}))}function Ge($,J,he="node-resize"){if(!K||typeof window>"u")return null;const me=window.setTimeout(()=>{xa.delete(me)&&at();try{J()}finally{uo(he)}},Math.max(0,$));return xa.add(me),at(),me}function kt($){K&&$!=null&&(xa.delete($)&&at(),window.clearTimeout($))}function Yt(){if(K&&typeof window<"u")for(const $ of xa)window.clearTimeout($);xa.size&&(xa.clear(),at()),mf.length=0,Ca.clear()}function mn($){B.value=$}function En($){P.value=$}function Jn($){H.value=$}const{cancelScheduledFocusSync:xn,scheduleFocusSync:gi}=(function($){const{isClient:J,containerRef:he,virtualizationEnabled:me,requestFrame:Le,cancelFrame:Oe,syncFocusToScroll:Ze}=$;let et=null;function mt(){var ut,pt,Qe;return(Qe=(pt=(ut=he.value)==null?void 0:ut.ownerDocument)==null?void 0:pt.defaultView)!=null?Qe:typeof window<"u"?window:null}function tt(){if(!et)return;const ut=mt();et.viaTimeout?ut?ut.clearTimeout(et.id):clearTimeout(et.id):Oe?.(et.id),et=null}return{cancelScheduledFocusSync:tt,scheduleFocusSync:function(ut={}){if(!me.value)return;if(!J)return void Ze(!0);if(ut.immediate)return tt(),void Ze(!0);if(et)return;const pt=()=>{et=null,Ze()};if(Le)return void(et={id:Le(pt),viaTimeout:!1});const Qe=mt();et={id:Qe?Qe.setTimeout(pt,16):setTimeout(pt,16),viaTimeout:!0}}}})({isClient:K,containerRef:O,virtualizationEnabled:Mn,requestFrame:to,cancelFrame:Gi,syncFocusToScroll:function($=!1){var J;if(!Mn.value)return;const he=Vl.value||Ae();if(!he)return;const me=he.ownerDocument||((J=O.value)==null?void 0:J.ownerDocument)||document,Le=me?.defaultView||(typeof window<"u"?window:null),Oe=he===me?.documentElement||he===me?.body,Ze=Ue.value.length;if(Ze<=0)return;if(!Oe&&Ze>0&&_e(he)){const yt=Gt("syncFocusToScroll.clientHeight",()=>he.clientHeight||0),Wt=Gt("syncFocusToScroll.scrollTop",()=>he.scrollTop),It=Wt<0?-Wt:Wt;return void Wv(Qs((et=Math.max(0,It)+.5*Math.max(0,yt),Fs.estimateIndexForOffsetFromEnd(et)),0,Math.max(0,Ze-1)),$)}var et;const mt=(function(yt,Wt,It,tn){const un=O.value;if(!un)return null;const bn=tn?0:Gt("syncFocusToScroll.model.root.getBoundingClientRect",()=>yt.getBoundingClientRect().top),gn=Gt("syncFocusToScroll.model.container.getBoundingClientRect",()=>un.getBoundingClientRect().top),wn=Math.max(0,bn-gn),jn=tn?Gt("syncFocusToScroll.model.viewport.clientHeight",()=>{var Xn,Wi,Ys,Bs;return(Bs=(Ys=(Wi=It?.innerHeight)!=null?Wi:(Xn=Wt.documentElement)==null?void 0:Xn.clientHeight)!=null?Ys:yt.clientHeight)!=null?Bs:0}):Gt("syncFocusToScroll.model.root.clientHeight",()=>yt.clientHeight);return Qs(yo(wn+.5*Math.max(0,jn)),0,Math.max(0,Ue.value.length-1))})(he,me,Le,Oe);if(mt!=null)return void Wv(mt,$);const tt=Oe?null:Gt("syncFocusToScroll.root.getBoundingClientRect",()=>he.getBoundingClientRect()),ut=Oe?0:tt.top,pt=Oe?Gt("syncFocusToScroll.viewport.clientHeight",()=>{var yt,Wt;return(Wt=(yt=Le?.innerHeight)!=null?yt:he.clientHeight)!=null?Wt:0}):tt.bottom,Qe=pf.value;let ct=null,At=null;for(const[yt,Wt]of Qe){if(!Wt)continue;const It=Gt("syncFocusToScroll.slot.getBoundingClientRect",()=>Wt.getBoundingClientRect());It.bottom<=ut||It.top>=pt||(ct==null&&(ct=yt),At=yt)}if(ct==null||At==null){const yt=O.value;if(!yt)return;const Wt=Oe?{top:0}:Gt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>he.getBoundingClientRect()),It=Gt("syncFocusToScroll.fallback.scrollTop",()=>pe(he,me,Oe)),tn=Oe?(()=>{const bn=Gt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>yt.getBoundingClientRect()),gn=(Oe?0:Wt.top)-bn.top;return Math.max(0,gn)})():(()=>{const bn=ne(yt,he);return Math.max(0,It-bn)})(),un=Oe?Gt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var bn,gn,wn,jn;return(jn=(wn=(gn=Le?.innerHeight)!=null?gn:(bn=me?.documentElement)==null?void 0:bn.clientHeight)!=null?wn:he.clientHeight)!=null?jn:0}):Gt("syncFocusToScroll.fallback.root.clientHeight",()=>he.clientHeight);return void Wv(Qs(yo(tn+.5*Math.max(0,un)),0,Math.max(0,Ue.value.length-1)),!0)}Wv(Math.round((ct+At)/2),$)}}),{visibleNodeIndices:hr,nodeVisibilityHandles:ws,nodeVisibilityWatchStops:_l,nodeVisibilityFallbackTimers:tu,clearVisibilityFallback:nu,markNodeVisible:Fc,cleanupNodeVisibility:GZ,destroyNodeVisibilityState:wb}=$9e({isClient:K,shouldTrackVisibleNodeIndices:()=>Ne.value,shouldCleanupNodeVisibility:()=>Mn.value,onNodeMarkedVisible:$=>{Mn.value?gi():Gn.value=Qs($,0,Math.max(0,Ue.value.length-1))},onNodeVisibilityCleaned:$=>{fi.delete($)&&n_()}}),{cleanupScrollListener:TS,setupScrollListener:QZ}=(function($){const{isClient:J,virtualizationEnabled:he,listenerEnabled:me,scrollRootElement:Le,resolveScrollContainer:Oe,scheduleFocusSync:Ze,onScroll:et}=$;let mt=null,tt=null;function ut(){mt&&(mt(),mt=null),tt=null,Le.value=null}function pt(Qe){const ct=$.getScrollTop?$.getScrollTop(Qe):Qe.scrollTop;return Math.max(0,Number.isFinite(ct)?Math.abs(ct):0)}return{cleanupScrollListener:ut,setupScrollListener:function(){if(!J)return;if(!((Qe=me?.value)!=null?Qe:he.value))return void ut();var Qe;const ct=Oe();if(!ct)return void ut();if(Le.value===ct&&mt)return;ut(),tt=pt(ct);const At=()=>{if(et?.(),he.value){const yt=(function(Wt){const It=pt(Wt),tn=tt;tt=It;const un=Math.max(480,.75*(Wt.clientHeight||0));return tn==null?It>un?{immediate:!0}:void 0:Math.abs(It-tn)>un?{immediate:!0}:void 0})(ct);yt?Ze(yt):Ze()}};ct.addEventListener("scroll",At,{passive:!0}),Le.value=ct,mt=()=>{ct.removeEventListener("scroll",At)}}}})({isClient:K,virtualizationEnabled:Mn,listenerEnabled:$n,scrollRootElement:Vl,resolveScrollContainer:Ae,scheduleFocusSync:gi,onScroll:function(){const $=Ko.value;if(!$)return;const J=dm();if(!J||(function(me){if(vm()>=Ya)return Lr=null,!1;const Le=Lr;if(Le==null)return!0;const Oe=Math.abs(me.scrollTop-Le)<=2;return Oe||(Lr=null),Oe})(J))return;const he=qS(J);he!=null?(he<-32||Math.abs(Math.max(0,he)-Math.max(0,$.distanceFromBottomPx))>32)&&ep("restore"):ep("restore")},getScrollTop:$=>{var J;const he=$.ownerDocument||((J=O.value)==null?void 0:J.ownerDocument)||document,me=$===he.documentElement||$===he.body||$===he.scrollingElement;return Gt("scrollListener.getScrollTop",()=>pe($,he,me))}});function Wv($,J=!1){const he=Qs($,0,Math.max(0,Ue.value.length-1));!J&&Math.abs(he-Gn.value)<=1||(Gn.value=he,bo())}function Qs($,J,he){return Math.min(Math.max($,J),he)}function Cb($=Ue.value.length){const J=st();return!Number.isInteger(J)||J<0?$:Qs(J,0,$)}function Ab($){return $?.firstElementChild}function ES($,J){var he;return $?(he=$.matches)!=null&&he.call($,J)?$:$.querySelector(J):null}function YZ($,J){$<1||$>6||(j[$]=J)}function LS(){if(!yi.value)return void(Q.value=0);const $=Gt("updateExperimentContainerWidth.clientWidth",()=>{var J,he;return(he=(J=O.value)==null?void 0:J.clientWidth)!=null?he:0});Q.value=$>0?$:0}let cm=null;function xb(){cm?.disconnect(),cm=null}const NS=fg("ViewportDeferredMarkdownCodeBlockNode",wu({loader:()=>fo(null,null,function*(){return(yield Yo(()=>import("./index5-DPyXoDa2.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:a4,delay:0,suspensible:!1}),a4);function DS($){return $===NS}const FS=D(()=>m.value==="pre"?ol:m.value==="shiki"?NS:k8);function BS(){var $;return(($=M.codeBlockProps)==null?void 0:$.showHeader)!==!1}function RS($,J,he){const me=Y[J],Le=typeof me=="number"&&me>0;if(io.value&&!Le&&!(function(Oe){return!!xi.value.paragraph&&(Oe.type==="paragraph"||Oe.type==="list_item"||Oe.type==="list")})($)){const Oe=EH($,he,te.value);if(Oe)return Oe}if(Fn.value&&$.type==="code_block"){const Oe=(function(Ze){if(Ze.type!=="code_block")return null;const et=p_(Ze,Xv(Ze));return DS(et)?"markdown":et===ol?"pre":et===FS.value||et===k8?"monaco":null})($);if(Oe==="monaco"||Oe==="markdown"||Oe==="pre")return(function(Ze,et){var mt,tt,ut;if(!Ze||Ze.type!=="code_block")return null;const pt=et.rendererKind,Qe=pt!=="pre"&&et.showHeader!==!1,ct=!!Ze.diff;let At=0,yt=500;if(pt==="monaco"){const It=(mt=et.monacoOptions)!=null?mt:{},tn=I8(Ze,It,et.width),un=(function(gn){const wn=typeof gn?.fontSize=="number"&&gn.fontSize>0?gn.fontSize:12;return typeof gn?.lineHeight=="number"&&gn.lineHeight>0?gn.lineHeight:Math.round(1.5*wn)})(It),bn=(function(gn,wn){var jn,Xn;const Wi=typeof((jn=gn?.padding)==null?void 0:jn.top)=="number"?gn.padding.top:wn?0:8,Ys=typeof((Xn=gn?.padding)==null?void 0:Xn.bottom)=="number"?gn.padding.bottom:wn?0:8;return Math.max(0,Wi)+Math.max(0,Ys)})(It,ct);yt=typeof It.MAX_HEIGHT=="number"&&It.MAX_HEIGHT>0?It.MAX_HEIGHT:500,At=Math.round(tn*un+bn)}else if(pt==="markdown"){const It=I8(Ze);At=Math.round(21*It+32)}else{const It=I8(Ze);At=Math.round(28*It),yt=Number.POSITIVE_INFINITY}const Wt=Math.max(1,Math.min(At,yt));return Dt({kind:"code-block",height:Math.round(Wt+(Qe?40:0)),contentHeight:Wt,rendererKind:pt},ct&&pt==="monaco"?{diffInline:_7((tt=et.monacoOptions)!=null?tt:{},(ut=et.width)!=null?ut:0)}:{})})($,{rendererKind:Oe,monacoOptions:M.codeBlockMonacoOptions,showHeader:BS(),width:he})}return null}Jp(()=>{if(zu.value,Ks>0)return;const $=Ue.value,J=_n();if(!$.length||!Rt.value)return Ni=[],Us=[],Vs=-1,$o.clear(),void(Ds.value=cr);const he=Q.value||Gt("estimatedNodeHeights.clientWidth",()=>{var tt;return((tt=O.value)==null?void 0:tt.clientWidth)||0});if(!Number.isFinite(he)||he<=0)return Ni=[],Us=[],Vs=-1,$o.clear(),void(Ds.value=cr);const me=(function(tt){return[Math.round(tt),io.value,Fn.value,te.value,M.codeBlockMonacoOptions,BS(),m.value,xi.value,S8.value]})(he),Le=Ni.length<=$.length&&(Ze=me,(Oe=Us).length===Ze.length&&Oe.every((tt,ut)=>Object.is(tt,Ze[ut])));var Oe,Ze;const et=Le&&Vs===J?$.length:Le?Cb($.length):0,mt=Le?Array.from($o):[];Ni.length=$.length;for(let tt=et;tt<$.length;tt++)Ni[tt]=RS($[tt],tt,he);for(const tt of mt)tt>=0&&tt<$.length&&ttDs.value);Fs=(function($){let J=!0,he=[0],me="";function Le(ut){var pt;const Qe=$.nodeHeights[ut];if(Number.isFinite(Qe)&&Qe>0)return Qe;const ct=$.parsedNodes.value[ut],At=ct?.type,yt=!!((pt=$.hasCustomParagraphComponent)!=null&&pt.call($)),Wt=$.estimatedNodeHeights.value[ut],It=Wt?.height;if(!(function(un,bn,gn){return!!(gn&&bn?.kind==="simple-text"&&(un==="paragraph"||un==="list_item"||un==="list"))})(At,Wt,yt)&&Number.isFinite(It)&&It>0)return It;const tn=S9e(ct,$.getContainerWidth()||640);return At==="heading"||At==="paragraph"&&tn<=28&&(function(un,bn){if(bn)return!1;const gn=un.children;return!Array.isArray(gn)||!gn.length||gn.every(NH)})(ct,yt)?tn:Math.max($.averageNodeHeight.value,tn)}function Oe(){var ut;const pt=$.parsedNodes.value.length,Qe=$.getPrefixCacheKeyParts().join(":");if(!J&&me===Qe)return he;const ct=new Array(pt+1);ct[0]=0;for(let At=0;At=((pt=At[ct])!=null?pt:0))return ct-1;let yt=0,Wt=ct-1,It=ct-1;for(;yt<=Wt;){const tn=yt+Wt>>1;((Qe=At[tn+1])!=null?Qe:0)>=ut?(It=tn,Wt=tn-1):yt=tn+1}return It}function et(ut,pt){var Qe,ct;if(ut>=pt)return 0;if($.heightEstimationActive.value)return(function(Wt,It){var tn,un;const bn=$.parsedNodes.value.length,gn=JL(Math.trunc(Wt),0,bn),wn=JL(Math.trunc(It),gn,bn);if(gn>=wn)return 0;const jn=Oe();return((tn=jn[wn])!=null?tn:0)-((un=jn[gn])!=null?un:0)})(ut,pt);if($.heightTreeSize.value!==$.parsedNodes.value.length){let Wt=0;for(let It=ut;Itgn<=0?0:$.fenwickRangeSum(yt,0,gn)+(gn-$.fenwickRangeSum(Wt,0,gn))*At;let tn=0,un=Qe.length-1,bn=Qe.length-1;for(;tn<=un;){const gn=tn+un>>1;It(gn+1)>=ut?(bn=gn,un=gn-1):tn=gn+1}return bn}let ct=ut;for(let At=0;At0||ut++}return ut}return{markFallbackHeightPrefixDirty:function(){J=!0},getFallbackNodeHeight:Le,estimateHeightRange:et,estimateIndexForOffset:mt,estimateIndexForOffsetFromEnd:function(ut){var pt,Qe;const ct=$.parsedNodes.value;if(!ct.length)return 0;if(ut<=0)return Math.max(0,ct.length-1);if($.heightEstimationActive.value){const yt=(pt=Oe()[ct.length])!=null?pt:0;return Ze(Math.max(0,yt-ut))}if($.heightTreeSize.value===ct.length){const yt=et(0,ct.length);return mt(Math.max(0,yt-ut))}let At=ut;for(let yt=ct.length-1;yt>=0;yt--){const Wt=(Qe=$.nodeHeights[yt])!=null?Qe:$.averageNodeHeight.value;if(At<=Wt)return yt;At-=Wt}return 0},getEstimatedNodeHeightCount:tt,buildVirtualHeightSummary:function(ut){var pt;const Qe=$.parsedNodes.value.length;return{totalNodes:Qe,measuredCount:$.heightStats.count,estimatedCount:tt(),averageNodeHeight:$.averageNodeHeight.value,topSpacerHeight:ut.topSpacerHeight,bottomSpacerHeight:ut.bottomSpacerHeight,estimatedTotalHeight:et(0,Qe),width:(pt=ut.width)!=null?pt:$.getContainerWidth()}}}})({parsedNodes:Ue,nodeHeights:Y,heightStats:ve,heightTreeSize:Be,heightSumTree:He,heightKnownTree:Ye,averageNodeHeight:Xe,heightEstimationActive:yi,estimatedNodeHeights:Gh,getContainerWidth:ki,hasCustomParagraphComponent:()=>!!xi.value.paragraph,getPrefixCacheKeyParts:()=>{var $;const J=Wm(Q.value||Gt("getFallbackHeightPrefix.clientWidth",()=>{var me;return((me=O.value)==null?void 0:me.clientWidth)||0})),he=(($=i.virtualScroll)==null?void 0:$.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Ue.value.length,ve.count,Math.round(ve.total),Math.round(100*Xe.value),he,J,yi.value?1:0,S8.value,W.value,xi.value.paragraph?1:0]},fenwickRangeSum:An}),We(()=>Ue.value.length,$=>{var J;lo(),$<=0?dr():($$t(J))),$!==Be.value&&Vt($))},{immediate:!0});const JZ=D(()=>{if(!Mn.value)return Ue.value.map((me,Le)=>({node:me,index:Le}));const $=Ue.value.length,J=Qs(zn.start,0,$),he=Qs(zn.end,J,$);return Ue.value.slice(J,he).map((me,Le)=>({node:me,index:J+Le}))}),Sb=D(()=>Mn.value?Zs(0,Math.min(zn.start,Ue.value.length)):0),_b=D(()=>{if(!Mn.value)return 0;const $=Ue.value.length;return Zs(Math.min(zn.end,$),$)});function $S(){return Fs.buildVirtualHeightSummary({topSpacerHeight:Sb.value,bottomSpacerHeight:_b.value,width:gf()})}function XZ(){const $=Ue.value,J=$S();return Dn(Dt({},J),{probe:{paragraphReady:!!te.value.paragraph,listItemReady:!!te.value.listItem,listWrapperOverhead:te.value.listWrapperOverhead,headingReadyLevels:Object.entries(te.value.headings).filter(([,he])=>!!he).map(([he])=>Number(he))},nodes:$.map((he,me)=>{var Le,Oe,Ze,et,mt,tt,ut,pt,Qe;return{index:me,type:he.type,estimateKind:(Oe=(Le=Gh.value[me])==null?void 0:Le.kind)!=null?Oe:null,rendererKind:(et=(Ze=Gh.value[me])==null?void 0:Ze.rendererKind)!=null?et:null,estimatedHeight:(tt=(mt=Gh.value[me])==null?void 0:mt.height)!=null?tt:null,estimatedContentHeight:(pt=(ut=Gh.value[me])==null?void 0:ut.contentHeight)!=null?pt:null,measuredHeight:(Qe=Y[me])!=null?Qe:null}})})}function Mb(){return i.indexKey!=null?String(i.indexKey):_o.value?`virtual-${wo()}`:"markdown-renderer"}function OS($){const J=String($),he=`${Mb()}-`;if(!J.startsWith(he))return null;const me=J.slice(he.length).match(/^(\d+)(?:$|-)/);if(!me)return null;const Le=Number(me[1]);return!Number.isInteger(Le)||Le<0||Le>=Ue.value.length?null:Le}function wo(){var $,J,he;const me=($=i.virtualScroll)==null?void 0:$.sessionKey;return String(me!=null&&me!==""?me:(he=(J=i.indexKey)!=null?J:M.customId)!=null?he:ri)}function ts(){var $;const J=($=i.virtualScroll)==null?void 0:$.threadKey;return J==null||J===""?void 0:String(J)}const eG=D(()=>{var $,J,he;return(he=ts())!=null?he:String((J=($=i.indexKey)!=null?$:M.customId)!=null?J:ri)});function Ib($){var J;return($??"")===((J=ts())!=null?J:"")}function Hu(){var $,J,he;return J=($=i.virtualScroll)==null?void 0:$.measurementKey,he=(function(){const me=m.value;return(function(Le){var Oe,Ze;const et=Le.renderer,mt=et==="monaco"?Le.codeBlockMonacoOptions:void 0,tt=Le.codeBlockProps,ut=et==="shiki";return[Le.isDark?"dark":"light",et==="monaco"?"code-rich":et==="pre"?"code-pre":"code-shiki",Le.codeBlockStream===!1?"code-static":"code-stream",Rs(Le.codeBlockMinWidth),Rs(Le.codeBlockMaxWidth),...ut?[gve((Oe=tt?.themes)!=null?Oe:Le.themes,(Ze=tt?.langs)!=null?Ze:Le.langs)]:[],Rs(mt?.fontSize),Rs(mt?.lineHeight),Rs(mt?.fontFamily),Rs(mt?.tabSize),Rs(mt?.MAX_HEIGHT),Rs(mt?.wordWrap),Rs(mt?.wrappingIndent),Rs(mt?.padding),Rs(tt?.showHeader),Rs(tt?.showCopyButton),Rs(tt?.showExpandButton),Rs(tt?.showPreviewButton),Rs(tt?.showCollapseButton),Rs(tt?.showFontSizeButtons)].join("\0")})({renderer:me,isDark:M.isDark,codeBlockStream:M.codeBlockStream,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockMonacoOptions:me==="monaco"?M.codeBlockMonacoOptions:void 0,codeBlockProps:M.codeBlockProps,themes:me==="shiki"?M.themes:void 0,langs:me==="shiki"?M.langs:void 0})})(),[J==null?"":String(J),he].join("\0")}function gf(){return ki()}const qv=D(()=>Wm(gf())),Ml=D(()=>[Hu(),qv.value].join("\0")),tG=D(()=>{var $;return _o.value?["virtual",($=ts())!=null?$:"",wo(),Ml.value].join("\0"):i.indexKey});function Qh(){am.value+=1}function Tb($){return!(!$||!Number.isInteger($.index)||$.index<0||$.index>=Ue.value.length||$.sessionKey!==wo()||$.threadKey!==ts()||$.layoutEpochKey!==Ml.value)}function PS($){const J=String($),he=Ql.get(J);return he?Tb(he)?he.index:null:OS(J)}function zS($="async-node"){(es.size||Ql.size)&&(es.clear(),Ql.clear(),Qh(),uo($))}const Yh=Jt(kC,null),Eb={reportHeight($,J){if(!Qn.value)return;const he=PS($);if(he==null)return;const me=Gs.get(he);if(!me)return;const Le=Number(J),Oe=wa(he,me);(function(Ze,et,mt={}){Di(()=>xl(Ze,et,mt))})(he,Number.isFinite(Le)&&Le>0?Math.max(Le,Oe||0):Oe)},markPending($){if(!Qn.value)return;const J=OS($);J!=null&&(function(he,me){var Le;const Oe=Ql.get(he);if(Oe&&Tb(Oe))return es.set(he,Math.max(0,(Le=es.get(he))!=null?Le:0)+1),Qh(),void uo("async-node");es.set(he,1),Ql.set(he,(function(Ze){return{index:Ze,sessionKey:wo(),threadKey:ts(),layoutEpochKey:Ml.value}})(me)),Qh(),uo("async-node")})(String($),J)},markSettled($){if(!Qn.value)return;const J=String($),he=PS($);(he!=null||(function(me){return es.has(String(me))})(J))&&(function(me){var Le;const Oe=(Le=es.get(me))!=null?Le:0;return!(Oe<=0||(Oe<=1?(es.delete(me),Ql.delete(me)):es.set(me,Oe-1),Qh(),Oe===1&&uo("async-node"),0))})(J)&&he!=null&&Wu()}};function nG(){let $=0;for(const J of Gs.values())$+=Gt("getVisibleDomHeight.offsetHeight",()=>{var he;return(he=J?.offsetHeight)!=null?he:0});return Math.ceil(Math.max(0,$))}ii(kC,{reportHeight($,J){Eb.reportHeight($,J),Yh?.reportHeight($,J)},markPending($){Eb.markPending($),Yh?.markPending($)},markSettled($){Eb.markSettled($),Yh?.markSettled($)}});let Lb,Nb=null,Jh=null;function Uv($){return $!==!1&&$!=null&&$!==""}function jS(){return Mn.value?(function(){if(!Mn.value)return!0;const $=Ue.value.length,J=Qs(zn.start,0,$),he=Qs(zn.end,J,$);if(J>=he)return!0;for(let me=J;me=Ie.value}function Db(){return ft.value===!0&&!_t.value&&um.value===0&&xa.size===0&&Aa.size===0&&fr==null&&jS()}function HS(){var $,J;if((($=i.virtualScroll)==null?void 0:$.settleMode)!=="manual"||Nb===wo()&&Lb===ts())return!0;const he=(J=i.virtualScroll)==null?void 0:J.settledToken;return!!Uv(he)&&Jh===xm(he)}function Fb(){return Db()&&HS()}function iG($,J){return J.totalNodes<=0?$==="final"?"final":"estimate":J.measuredCount>=J.totalNodes?$==="final"?"final":"measured":J.measuredCount>0||J.estimatedCount>0?"mixed":"estimate"}function vf($="manual",J){const he=$S(),me=(function(Le){return Le||(ft.value!==!0?Ue.value.length>0?"streaming":"estimating":!jS()||Aa.size>0||fr!=null?"measuring":Fb()?"settled":"settling")})(J);return{sessionKey:wo(),threadKey:ts(),phase:me,nodeCount:he.totalNodes,liveRange:{start:zn.start,end:zn.end},renderedCount:Vn.value,measuredCount:he.measuredCount,estimatedCount:he.estimatedCount,averageNodeHeight:he.averageNodeHeight,topSpacerHeight:he.topSpacerHeight,bottomSpacerHeight:he.bottomSpacerHeight,visibleDomHeight:nG(),totalHeight:WS(),width:he.width,final:ft.value===!0,stable:Fb(),confidence:iG(me,he),reason:$}}function dm(){const $=Vl.value||Ae(),J=O.value;if(!$||!J)return null;const he=$.ownerDocument||J.ownerDocument||document,me=$===he.documentElement||$===he.body||$===he.scrollingElement,Le=Gt("getScrollBox.scrollTop",()=>pe($,he,me)),Oe=Gt("getScrollBox.scrollHeight",()=>{var et,mt,tt,ut,pt;return me?Math.max((mt=(et=he.documentElement)==null?void 0:et.scrollHeight)!=null?mt:0,(ut=(tt=he.body)==null?void 0:tt.scrollHeight)!=null?ut:0,(pt=$.scrollHeight)!=null?pt:0):$.scrollHeight}),Ze=Gt("getScrollBox.clientHeight",()=>{var et;return me?((et=he.documentElement)==null?void 0:et.clientHeight)||$.clientHeight||0:$.clientHeight});return{root:$,doc:he,isViewportRoot:me,scrollTop:Le,scrollHeight:Oe,clientHeight:Ze}}function WS(){const $=Ue.value.length,J=Math.max(0,Zs(0,$)),he=Gt("getRendererLogicalHeight.offsetHeight",()=>{var Le,Oe;return(Oe=(Le=O.value)==null?void 0:Le.offsetHeight)!=null?Oe:0}),me=Math.max(0,he>0?he:Gt("getRendererLogicalHeight.scrollHeight",()=>{var Le,Oe;return(Oe=(Le=O.value)==null?void 0:Le.scrollHeight)!=null?Oe:0}));return $<=0?Math.ceil(he):Mn.value?J>0?Math.max(1,Math.ceil(J),(function(){let Le=Sb.value+_b.value;for(const Oe of fi.values())Oe&&(Le+=Math.max(0,Gt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Oe.offsetHeight||0)));return Math.ceil(Math.max(0,Le))})(),(function(Le,Oe){return Le<=0||Oe<=0?0:Oe<=Le+Math.max(512,.05*Le)?Math.ceil(Oe):0})(J,me)):Math.max(1,Math.ceil(me)):Qn.value?J>0||ve.count>0||Fs.getEstimatedNodeHeightCount()>0?(Qi.value&&Vn.value,Math.max(1,Math.ceil(me),Math.ceil(J))):Math.ceil(me):Math.max(1,Math.ceil(me),Math.ceil(J))}function qS($){const J=O.value;if(!J)return null;const he=Gt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>J.getBoundingClientRect());return(function(Le){return Le.isViewportRoot?Le.clientHeight:Gt("getViewportBottomInRoot.getBoundingClientRect",()=>Le.root.getBoundingClientRect().bottom)})($)-he.bottom}function oG($={}){const J=$.requireViewport!==!1,he=(function(Oe=64){const Ze=dm(),et=O.value;if(!Ze||!et)return!1;const mt=(function(ut){if(ut.isViewportRoot)return{top:0,bottom:ut.clientHeight};const pt=Gt("getVirtualViewportRect.getBoundingClientRect",()=>ut.root.getBoundingClientRect());return{top:pt.top,bottom:pt.bottom}})(Ze),tt=Gt("isRendererNearVirtualViewport.getBoundingClientRect",()=>et.getBoundingClientRect());return tt.bottom>=mt.top-Oe&&tt.top<=mt.bottom+Oe})();if(J&&!he)return null;const me=(function(){const Oe=dm(),Ze=O.value;if(!Oe||!Ze||Math.max(0,Oe.scrollHeight-Oe.scrollTop-Oe.clientHeight)>64)return null;const et=qS(Oe);return et==null?null:et>=-8&&et<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,et)}:null})();if(me)return{anchor:me,captured:!0};const Le=Xa();if(Le)return{anchor:{type:"node",nodeIndex:Le.nodeIndex,offsetWithinNodePx:Le.offsetWithinNodePx},captured:he};if($.allowFallback===!0){const Oe=(function(){const Ze=Ue.value.length;return Ze<=0?null:{type:"node",nodeIndex:Qs(Gn.value,0,Math.max(0,Ze-1)),offsetWithinNodePx:0}})();return Oe?{anchor:Oe,captured:!1}:null}return null}function Bb($){let J=2166136261;for(let he=0;he<$.length;he++)J^=$.charCodeAt(he),J=Math.imul(J,16777619);return(J>>>0).toString(36)}function sG($,J){let he=$;for(let me=0;me8192?`${me.slice(0,8192)}...${me.length}`:me;return`${me.length}:${Bb(Le)}`})($)}`;if(typeof $=="function")return"fn";if(typeof $!="object")return typeof $;if(J.has($))return"cycle";if(he>=6)return"max-depth";J.add($);try{if(Array.isArray($)){if($.length<=160){const tt=[];for(let ut=0;ut<$.length;ut++)tt.push(Vv($[ut],J,he+1));return`a:${$.length}:${tt.join(",")}`}const Oe=[],Ze=[],et=Math.max(0,$.length-32);let mt=2166136261;for(let tt=0;tt<$.length;tt++){const ut=Vv($[tt],J,he+1);mt=sG(mt,ut),tt<32&&Oe.push(ut),tt>=et&&Ze.push(ut)}return[`a:${$.length}`,`h=${Oe.join(",")}`,`t=${Ze.join(",")}`,`all=${(mt>>>0).toString(36)}`].join(":")}const me=$,Le=Object.keys(me).filter(Oe=>{const Ze=me[Oe];return Oe!=="parent"&&Oe!=="el"&&Oe!=="component"&&(Ze==null||typeof Ze=="string"||typeof Ze=="number"||typeof Ze=="boolean"||rG.has(Oe))}).sort();return`o:${Le.length}:${Le.map(Oe=>`${Oe}=${Vv(me[Oe],J,he+1)}`).join(";")}`}finally{J.delete($)}}let Rb=-1,$b="",yf=[2166136261];function fm($){const J=Ue.value[$];return J?Bb(Vv(J)):""}function lG($,J){let he=$;for(let me=0;me>>0}function Ob(){var $,J;const he=W.value;if(Rb===he)return $b;const me=Ue.value.length;let Le=Cb(me);(Rb!==he-1||Le>me||yf.length>>0).toString(36),Rb=he,$b}function Xh($,J={}){var he;const me=J.includeHeightCache===!0,Le=(he=J.includeContentHash)!=null?he:me,Oe=me?(function(et){const mt=(function(){var yt,Wt;const It=Number((Wt=(yt=i.virtualScroll)==null?void 0:yt.heightCacheLimit)!=null?Wt:5e3);return!Number.isFinite(It)||It<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(It))})();if(!Number.isFinite(mt)||et.length<=mt)return et;const tt=new Map,ut=yt=>{!yt||tt.size>=mt||tt.set(yt.index,yt)},pt=Ue.value.length,Qe=Qs(zn.start-2*so.value,0,pt),ct=Qs(zn.end+2*so.value,Qe,pt);for(const yt of et)yt.index>=Qe&&yt.index=0&&tt.sizeyt.index-Wt.index).slice(0,mt)})(Bn().map(et=>{var mt;const tt=Ue.value[et.index];return tt?Dn(Dt({},et),{nodeType:String((mt=tt.type)!=null?mt:""),signature:fm(et.index)}):null}).filter(et=>!!et)):[],Ze=oG({allowFallback:J.allowAnchorFallback===!0,requireViewport:J.requireViewport});return Ze||Oe.length||J.includeEmptyState===!0?Dn(Dt({sessionKey:$.sessionKey,threadKey:$.threadKey},Ze?{anchor:Ze.anchor,anchorCaptured:Ze.captured}:{anchorCaptured:!1}),{metrics:$,width:$.width,contentHash:Le?Ob():void 0,measurementKey:Hu()||void 0,heightCache:Oe.length?Oe:void 0}):null}function Pb($){var J,he;const me=dm();if(!me)return;const Le=(function(et){const mt=O.value;if(!mt)return null;const tt=ne(mt,et.root),ut=Ue.value.length,pt=Gt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>mt.offsetHeight||0),Qe=Math.max(0,pt>0?pt:ut>0?Gt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>mt.scrollHeight||0):0),ct=WS();return tt+Math.max(Qe,ct)})(me);if(Le==null)return;const Oe=Math.max(0,$.distanceFromBottomPx),Ze=Math.max(0,Le-me.clientHeight-Oe);(function(et){Ya=vm()+120,Lr=et})(Ze),me.isViewportRoot?(he=(J=me.doc.defaultView)==null?void 0:J.scrollTo)==null||he.call(J,0,Ze):GL(me.root,me.doc,Ze,{isReverseFlexScrollRoot:_e,getNormalizedScrollTop:pe})}const zb=[];function US(){if(K)for(Cl!=null&&(Gi?.(Cl),Cl=null);zb.length;){const $=zb.pop();$!=null&&window.clearTimeout($)}}function ep($){const J=!!Ko.value;Ko.value=null,Ya=0,Lr=null,US(),J&&$&&uo($)}function tp(){if(!Ko.value||!K||Cl!=null)return;const $=()=>{Cl=null;const J=Ko.value;J&&Pb(J)};Cl=to?to($):null,Cl==null&&$()}function VS($,J={}){const he=Ue.value.length;return he<=0?[]:$.filter(me=>!(!Number.isInteger(me.index)||me.index<0||me.index>=he)&&!(!Number.isFinite(me.height)||me.height<=0)&&!(J.requireSignature&&!me.signature)&&!(J.requireCompatibilityMetadata&&!me.nodeType&&!me.signature)&&(function(Le){var Oe;const Ze=Ue.value[Le.index];return!(!Ze||Le.nodeType&&Le.nodeType!==String((Oe=Ze.type)!=null?Oe:"")||Le.signature&&Le.signature!==fm(Le.index))})(me))}function KS($){const J=Wm(gf()),he=Wm($);return J!==-1&&he!==-1&&J===he}function jb($){var J;const he=Number($?.width);if(Number.isFinite(he)&&he>0)return he;const me=Number((J=$?.metrics)==null?void 0:J.width);return Number.isFinite(me)&&me>0?me:null}function ZS($){var J;return $.sessionKey===wo()&&!!Ib($.threadKey)&&((J=$.measurementKey)!=null?J:"")===Hu()&&!!KS(jb($))&&!!(function(he){const me=he.heightCache;return!!me?.length&&(GS(he)?me.some(Le=>!!(Le.nodeType||Le.signature)):me.some(Le=>!!Le.signature))})($)}function GS($){return!!($.contentHash&&$.contentHash===Ob())}function aG($){return!GS($)}let kf=null,bf=null,Kv=null,hm=null,pm=null;function Hb($){var J;const he=$.map(Le=>{var Oe,Ze;return[Le.index,Math.round(10*Le.height),(Oe=Le.nodeType)!=null?Oe:"",(Ze=Le.signature)!=null?Ze:""].join("")}).join(""),me=Wm(gf());return[(J=ts())!=null?J:"",wo(),Hu(),Ue.value.length,me,$.length,Bb(he)].join(":")}function QS($=(J=>(J=i.virtualScroll)==null?void 0:J.heightCache)()){if(!Qn.value||!$?.length||Ue.value.length<=0||!KS((J=i.virtualScroll)==null?void 0:J.heightCacheWidth))return!1;var J;const he=VS($,{requireSignature:!0});if(!he.length)return!1;const me=Hb(he);return me===kf?(bf="standalone",!0):(Me(he,{mode:"merge"}),lo(),kf=me,bf="standalone",km(),uo("restore"),!0)}function Wb($,J={}){var he,me,Le;if(!Qn.value||!$||$.sessionKey!==wo()||!Ib($.threadKey)||Ue.value.length<=0)return!1;const Oe=!!((he=$.heightCache)!=null&&he.length)&&!Zv(),Ze=!$.anchor||$.anchorCaptured===!1&&J.allowUncapturedAnchor!==!0?null:$.anchor,et=J.restoreAnchor===!0&&!!Ze&&!Zv()&&Number(jb($))>0;let mt=!1;if((me=$.heightCache)!=null&&me.length&&ZS($)){const ut=VS($.heightCache,{requireCompatibilityMetadata:!$.contentHash,requireSignature:aG($)});ut.length&&(Me(ut,{mode:"merge"}),lo(),kf=Hb(ut),bf="restore",km(),mt=!0)}if(Oe||et)return!1;if(!J.restoreAnchor||!Ze)return mt&&uo("restore"),!0;const tt=(function(ut,pt){var Qe;const ct=ut.anchor,At=ct?ct.type==="bottom"?`bottom:${Math.round(ct.distanceFromBottomPx)}`:`node:${ct.nodeIndex}:${Math.round(ct.offsetWithinNodePx)}`:"none";return[(Qe=ts())!=null?Qe:"",wo(),Hu(),qv.value,pt,At].join(":")})($,(Le=J.restoreToken)!=null?Le:"imperative");return Kv===tt?(mt&&uo("restore"),!0):(Kv=tt,(function(ut){const pt=()=>{if(ut.type==="node")return ep(),void Gl({nodeIndex:ut.nodeIndex,offsetWithinNodePx:ut.offsetWithinNodePx});if(Nr(),Xo.value=null,Ko.value=ut,US(),Pb(ut),K)for(const Qe of[0,120,280,480])zb.push(window.setTimeout(()=>{const ct=Ko.value;ct&&Pb(ct)},Qe))};(function(Qe){if(!Mn.value)return!1;const ct=Ue.value.length;return!(ct<=0||(Gn.value=Qe.type==="node"?Qs(Qe.nodeIndex,0,ct-1):ct-1,bo(),0))})(ut)?ht(pt):pt()})(Ze),uo("restore"),!0)}function Zv(){const $=gf();return Number.isFinite($)&&$>0}function YS($){var J;return $.sessionKey===wo()&&!!Ib($.threadKey)&&(Ue.value.length<=0||!(!((J=$.heightCache)!=null&&J.length)||Zv())||!(!($.anchor&&Number(jb($))>0)||Zv()))}function qb(){mi.clear();for(const $ of Object.keys(Y)){const J=Number($);Number.isInteger(J)&&J>=0&&J{let J=!1,he=null;const me=()=>{J||(J=!0,he!=null&&window.clearTimeout(he),$())};if(to)return to(me),void(he=window.setTimeout(me,50));he=window.setTimeout(me,0)})}function Ub($,J=ts(),he=Ml.value){return wo()===$&&ts()===J&&Ml.value===he}function Vb(){return fo(this,arguments,function*($={}){var J,he,me,Le,Oe;const Ze=wo(),et=ts(),mt=Ml.value,tt=(J=$.frames)!=null?J:2,ut=(he=$.timeoutMs)!=null?he:120,pt=(me=$.reason)!=null?me:"manual",Qe=$.expectedSettledTokenKey,ct=$.flushPendingTimers===!0,At=vf(pt),yt=()=>Dn(Dt({},At),{phase:At.final?"settling":At.phase,stable:!1,confidence:At.confidence==="final"?"mixed":At.confidence,reason:pt}),Wt=()=>Ub(Ze,et,mt)&&(Qe==null||ym()===Qe);for(let bn=0;bnwindow.setTimeout(gn,bn))})(ut),!Wt()||(ct&&Yt(),Wu(),mm(),!Wt()))return yt();const It=Db();It&&(Nb=Ze,Lb=et,((Le=i.virtualScroll)==null?void 0:Le.settleMode)==="manual"&&Qe!=null&&Uv((Oe=i.virtualScroll)==null?void 0:Oe.settledToken)&&ym()===Qe&&(Jh=xm(i.virtualScroll.settledToken)));const tn=Wt()&&It&&HS(),un=vf(pt,tn?"final":void 0);return Yb(un,!0),un})}let Kb="content",wf=null,Cf=null,Zb=0,gm=null,np=null,Gb=null,Qb=null;function vm(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function XS($){var J,he;const me=gm;if(!me)return!0;const Le=(he=(J=i.virtualScroll)==null?void 0:J.heightDiffThresholdPx)!=null?he:1;return Math.abs($.totalHeight-me.totalHeight)>Le||$.sessionKey!==me.sessionKey||$.phase!==me.phase||$.stable!==me.stable||$.final!==me.final||$.threadKey!==me.threadKey||$.nodeCount!==me.nodeCount||$.measuredCount!==me.measuredCount||$.width!==me.width}function ym($=(J=>(J=i.virtualScroll)==null?void 0:J.settledToken)()){return Rs($)}function e_($,J){var he,me;return[$,J.sessionKey,(he=J.threadKey)!=null?he:"",Hu(),Ob(),Rs((me=i.virtualScroll)==null?void 0:me.settledToken),Math.round(J.totalHeight),Math.round(J.width)].join("\0")}function km(){Gb=null,Qb=null,np=null}function uG($){const J=$.heightCache;return J?.length?Hb(J):""}function bm($){var J,he,me;const Le=$.metrics,Oe=$.anchor?(Ze=$.anchor).type==="bottom"?`bottom:${Math.round(Ze.distanceFromBottomPx)}`:`node:${Ze.nodeIndex}:${Math.round(Ze.offsetWithinNodePx)}`:"none";var Ze;return[$.sessionKey,(J=$.threadKey)!=null?J:"",(he=$.measurementKey)!=null?he:Hu(),(me=$.contentHash)!=null?me:"",uG($),Oe,$.anchorCaptured?1:0,Le.liveRange.start,Le.liveRange.end,Le.renderedCount,Le.nodeCount,Math.round(Le.totalHeight),Math.round(Le.width),Le.phase,Le.stable?1:0].join("\0")}function Yb($,J=!1){if(!Qn.value||(function(Ze=!1){return!Ze&&_o.value&&!Zi.value})(J))return;const he=J||XS($),me=(function(Ze,et=!1){return et||Ze.stable||Ze.phase==="final"?{state:Xh(Ze,{includeHeightCache:!0})}:{state:Xh(Ze)}})($,J),Le=me.state,Oe=!!(Le&&(he||(function(Ze,et=!1){return!!et||bm(Ze)!==np})(Le,J)));if(he&&(R($),gm=$,Zb=vm()),Le&&Oe&&(q(Le),Le.anchor&&z(Le.anchor),np=bm(Le)),$.stable){const Ze=e_("settled",$);if(Ze!==Gb){Gb=Ze;const et=Xh($,{includeHeightCache:!0});et&&(q(et),np=bm(et)),(function(mt){o("render-settled",mt)})($)}}if($.phase==="final"){const Ze=e_("final",$);if(Ze!==Qb){Qb=Ze;const et=Xh($,{includeHeightCache:!0});et&&(q(et),np=bm(et)),(function(mt){o("render-final",mt)})($)}}}function Jb(){wf!=null&&(Gi?.(wf),wf=null),Cf!=null&&K&&(window.clearTimeout(Cf),Cf=null)}function t_(){wf=null,Cf=null,(function($){if(Aa.size>0||fr!=null)return!0;switch($){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Kb)&&(Wu(),mm()),Yb(vf(Kb))}function uo($){var J,he;if(!Qn.value||(Kb=$,wf!=null||Cf!=null))return;const me=Math.max(0,(he=(J=i.virtualScroll)==null?void 0:J.emitIntervalMs)!=null?he:32),Le=Math.max(0,me-(vm()-Zb)),Oe=()=>{Cf=null,wf=to?to(t_):null,wf==null&&t_()};K&&Le>0?Cf=window.setTimeout(Oe,Le):Oe()}function n_(){Ul.value+=1}function Gv($){if(Qi.value&&$>=Vn.value){const J=Ue.value[$],he=ze.value===!0&&ft.value!==!0&&$>=Ue.value.length-2,me=J?.type==="code_block"||J?.type==="image"||J?.type==="mermaid"||J?.type==="infographic";if(!he||me)return!1}return!Ne.value||$=fe.value&&(Z.value||(Z.value=!0,wb()),!fn.value||!eo))return ip($),void(J&&Fc($,!0));if(${if(tu.delete(Oe),!Ne.value||hr.value.has(Oe))return;const mt=fi.get(Oe);if(!mt)return;const tt=Ae(mt),ut=mt.ownerDocument||document,pt=ut.defaultView||window,Qe=!tt||tt===ut.documentElement||tt===ut.body,ct=!Qe&&tt?Gt("nodeVisibilityFallback.root.getBoundingClientRect",()=>tt.getBoundingClientRect()):null,At=Qe?0:ct.top,yt=Qe?Gt("nodeVisibilityFallback.clientHeight",()=>{var It,tn;return(tn=(It=pt.innerHeight)!=null?It:tt?.clientHeight)!=null?tn:0}):ct.bottom,Wt=Gt("nodeVisibilityFallback.node.getBoundingClientRect",()=>mt.getBoundingClientRect());Wt.bottom>=At-500&&Wt.top<=yt+500&&Fc(Oe,!0)},1800+Ze);tu.set(Oe,et)})($);let Le=null;Le=We(()=>me.isVisible.value,Oe=>{if(Oe){nu($),Fc($,!0),Le?.(),_l.delete($),ws.get($)===me&&ws.delete($);try{me.destroy()}catch{}}},{immediate:!0}),_l.set($,Le),Mn.value&&gi()}function Xb(){fr=null,Di(()=>{let $=!1;for(const[J,he]of Aa)Aa.delete(J),Gs.get(J)===he.el&&Sl.get(J)===he.version&&($=xl(J,he.height,{allowShrink:he.allowShrink})||$);return $})}function op(){fr!=null&&(Gi?.(fr),fr=null),Aa.clear()}function Yv($,J){(function(he,me,Le){var Oe;if(!Number.isFinite(Le)||Le<=0||Gs.get(he)!==me)return;const Ze=Sl.get(he);if(Ze==null)return;const et=Ue.value[he],mt=_t.value&&ft.value!==!0&&!((Oe=i.nodes)!=null&&Oe.length)&&he>=Ue.value.length-2,tt=!(et?.loading===!0||mt),ut=Aa.get(he),pt=ut?ut.allowShrink&&tt:tt,Qe=ut&&!pt?Math.max(ut.height,Le):Le;Aa.set(he,{height:Qe,allowShrink:pt,version:Ze,el:me}),fr==null&&(fr=to?to(Xb):null,fr==null&&Xb())})($,J,wa($,J))}function Wu(){for(const[$,J]of Gs)J&&Yv($,J)}function i_(){ni?.disconnect(),ni=null,Mo.clear()}function e3(){for(;mf.length;)kt(mf.pop())}We(Zi,$=>{$&&uo("content")},{flush:"post"}),t({getVirtualMetrics:vf,captureVirtualState:function($={}){var J;return Xh(vf("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:$.allowFallbackAnchor===!0,requireViewport:$.requireViewport===!0,includeEmptyState:(J=$.includeEmptyState)==null||J})},restoreVirtualState:function($,J={}){const he=J.restoreAnchor===!0,me=J.restoreToken==null?"imperative":String(J.restoreToken);hm=$,pm={restoreAnchor:he,restoreToken:me,allowUncapturedAnchor:J.allowUncapturedAnchor===!0},!Wb($,{restoreAnchor:he,restoreToken:me,allowUncapturedAnchor:J.allowUncapturedAnchor===!0})&&YS($)||(hm=null,pm=null)},forceMeasure:function($="manual"){return fo(this,null,function*(){yield ht(),yield JS(),Wu(),mm(),yield ht();const J=vf($);return Yb(J,!0),J})},settle:Vb,scrollToNode:function($,J="start"){ep(),Nr();const he=Ue.value.length;if(he<=0)return;const me=Qs($,0,he-1),Le=()=>{var Oe;const Ze=Zl({nodeIndex:me,offsetWithinNodePx:0}),et=Ja(me),mt=dm(),tt=(Oe=mt?.clientHeight)!=null?Oe:0,ut=Yr();let pt=Ze;if(J==="center")pt=Ze-tt/2+et/2;else if(J==="end")pt=Ze-tt+et;else if(J==="nearest"&&ut!=null){if(Ze>=ut&&Ze+et<=ut+tt)return;pt=ZeNs.value,$=>{if(!$){i_();for(const J of Ca.values())for(const he of J)kt(he);Ca.clear(),Sl.clear(),e3(),op()}},{immediate:!0}),We(ft,$=>{$&&(function(){if(K&&ft.value&&Gs.size){e3();for(const J of[80,240,640]){const he=Ge(J,()=>{for(const[me,Le]of Gs)Le&&Yv(me,Le)},"final");he!=null&&mf.push(he)}}})(),uo($?"final":"content")});const cG=QL(()=>uo("content"),16),dG=QL(()=>uo("batch"),16);We([()=>Ue.value.length,()=>Vn.value],()=>{Ko.value&&tp(),cG()},{flush:"post",immediate:!0}),We([()=>zn.start,()=>zn.end],()=>{dG()},{flush:"post"});const{cleanupBatchScheduler:fG}=(function($){const{props:J,isClient:he,isTestEnv:me,parsedNodesIdentity:Le,parsedNodeCount:Oe,desiredRenderedCount:Ze,datasetKey:et,batchingEnabled:mt,incrementalRenderingActive:tt,resolvedBatchSize:ut,resolvedInitialBatch:pt,renderedCount:Qe,adaptiveBatchSize:ct,previousRenderContext:At,previousBatchConfig:yt,requestFrame:Wt,cancelFrame:It,hasIdleCallback:tn,cleanupNodeVisibility:un,onDatasetKeyChanged:bn,onDatasetChanged:gn}=$;let wn=null,jn="raf",Xn=null,Wi=0,Ys=!1,Bs=!1;const Sa=new Set,iu=new Set;function Tm(){if(he){wn!=null&&(jn==="raf"&&It?It(wn):jn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(wn):jn==="timeout"&&window.clearTimeout(wn),wn=null),Wi+=1;for(const pr of Sa)It&&It(pr);for(const pr of iu)window.clearTimeout(pr);Sa.clear(),iu.clear(),Xn=null,Ys=!1,Bs=!1}}function r2(){return typeof performance<"u"?performance.now():Date.now()}function w_(pr){(function(qu){var Rc;if(!tt.value)return;const Uu=Math.max(2,(Rc=J.renderBatchBudgetMs)!=null?Rc:6),Vu=Math.max(1,ut.value||1),_a=Math.max(1,Math.floor(Vu/4));qu>1.5*Uu?ct.value=Math.max(_a,Math.floor(.8*ct.value)):qu<.6*Uu&&ct.value=Uu)return;const Vu=Math.max(1,pr),_a=()=>{const lp=r2();wn=null;const Em=Xn??Vu;Xn=null;const ap=r2();Qe.value=Math.min(Uu,Qe.value+Em),un(Qe.value),(function(l3,l2){if(!he)return void w_(l2);Ys=!0;const S_=++Wi;ht().then(()=>{var __;if(S_!==Wi)return;const DG=r2(),FG=Math.max(l2,DG-l3),M_=()=>{S_===Wi&&w_(FG)};if(Wt){let xf=null,up=null,T_=!1;const E_=()=>{T_||(T_=!0,xf!==null&&(Sa.delete(xf),xf=null),up!==null&&(iu.delete(up),window.clearTimeout(up),up=null),M_())};return xf=Wt(()=>{E_()}),Sa.add(xf),up=window.setTimeout(()=>{xf!==null&&It&&It(xf),E_()},Math.max(32,(__=J.renderBatchIdleTimeoutMs)!=null?__:120)),void iu.add(up)}const I_=window.setTimeout(()=>{iu.delete(I_),M_()},0);iu.add(I_)})})(lp,r2()-ap)};if(!he||Xr.immediate)return void _a();const $c=Math.max(0,(qu=J.renderBatchDelay)!=null?qu:16);if(Xn=Xn!=null?Math.max(Xn,Vu):Vu,wn==null){if(!me&&tn&&window.requestIdleCallback){const lp=Math.max(0,(Rc=J.renderBatchIdleTimeoutMs)!=null?Rc:120);return jn="idle",void(wn=window.requestIdleCallback(()=>_a(),{timeout:lp}))}if(Wt&&!me)return jn="raf",void(wn=Wt(()=>{$c===0?_a():(jn="timeout",wn=window.setTimeout(()=>_a(),$c))}));jn="timeout",wn=window.setTimeout(()=>_a(),$c)}}function A_(pr,Xr={}){Ys?Bs=!0:pr==null?x_():C_(pr,Xr)}function x_(){tt.value&&C_(mt.value?Math.max(1,Math.round(ct.value)):Math.max(1,ut.value))}return We([Le,Oe,et,tt,ut,pt,()=>J.renderBatchDelay],()=>{var pr;const Xr=Oe.value,qu=At.value,Rc=et.value,Uu=!Object.is(Rc,qu.key),Vu=Xr!==qu.total,_a=Uu||Vu;At.value={key:Rc,total:Xr};const $c=yt.value,lp=(pr=J.renderBatchDelay)!=null?pr:16,Em=$c.batchSize!==ut.value||$c.initial!==pt.value||$c.delay!==lp||$c.enabled!==tt.value;yt.value={batchSize:ut.value,initial:pt.value,delay:lp,enabled:tt.value},Uu&&bn(Xr),(_a||Em||!tt.value)&&Tm(),(_a||Em)&&(ct.value=Math.max(1,ut.value||1)),_a&&gn();const ap=Ze.value;if(!Xr)return Qe.value=0,void un(0);if(!tt.value)return Qe.value=ap,void un(Qe.value);const l3=Uu||qu.total===0;Qe.value=l3||Em?Math.min(ap,pt.value):Math.min(Qe.value,ap);const l2=Math.max(1,pt.value||ut.value||Xr);Qe.value{tt.value&&(typeof Xr=="number"&&pr<=Xr||pr>Qe.value&&A_())}),{cleanupBatchScheduler:Tm}})({props:M,isClient:K,isTestEnv:xe,parsedNodesIdentity:Zn,parsedNodeCount:vs,desiredRenderedCount:Ie,datasetKey:tG,batchingEnabled:ei,incrementalRenderingActive:Qi,resolvedBatchSize:rn,resolvedInitialBatch:Yn,renderedCount:Vn,adaptiveBatchSize:bs,previousRenderContext:qs,previousBatchConfig:Je,requestFrame:to,cancelFrame:Gi,hasIdleCallback:je,cleanupNodeVisibility:GZ,onDatasetKeyChanged:$=>{op(),dr(),lo(),km(),$>0&&Vt($)},onDatasetChanged:()=>{Mn.value&&gi({immediate:!0})}});We([$n,Mn,()=>O.value,()=>G()],([$,J])=>{if(!$)return TS(),void xn();QZ(),J?gi({immediate:!0}):xn()},{flush:"post",immediate:!0}),We([()=>Ue.value.length,()=>Mn.value],$=>fo(null,[$],function*([J,he]){he&&J&&K&&(yield ht(),gi({immediate:!0}))}),{flush:"post"}),We(yi,$=>{$&&(function(){var J;if(go.value&&Ls.value&&Hs.value&&((J=ys.value)!=null&&J[1]))return;const he=Et({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),me=Et({type:"list_item",children:[he],raw:"- Probe paragraph text"}),Le=Et({type:"list",ordered:!1,items:[me],raw:"- Probe paragraph text"});go.value=he,Ls.value=me,Hs.value=Le;const Oe={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ze=1;Ze<=6;Ze++)Oe[Ze]=Et({type:"heading",level:Ze,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ze)} Probe heading`});ys.value=Oe})()},{immediate:!0}),We([()=>O.value,yi],()=>{if(!yi.value)return xb(),void(Q.value=0);LS(),xb(),yi.value&&O.value&&typeof ResizeObserver<"u"&&(cm=new ResizeObserver(()=>{LS(),Xo.value&&Al(),Ko.value&&tp(),uo("resize")}),cm.observe(O.value))},{immediate:!0}),We([yi,di,Ml],()=>fo(null,null,function*(){if(!yi.value)return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void lo();yield ht(),(function(){if(!yi.value||typeof window>"u")return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void lo();const $={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},J=ES(Ab(B.value),".paragraph-node");$.paragraph=T8(B.value,J,"pre-wrap");const he=Ab(P.value),me=he?.querySelector(".paragraph-node");$.listItem=T8(P.value,me,"pre-wrap");const Le=Gt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ze,et;return(et=(Ze=H.value)==null?void 0:Ze.offsetHeight)!=null?et:0}),Oe=Gt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ze,et;return(et=(Ze=P.value)==null?void 0:Ze.offsetHeight)!=null?et:0});$.listWrapperOverhead=Math.max(0,Le-Oe);for(let Ze=1;Ze<=6;Ze++){const et=ES(Ab(j[Ze]),`h${Ze}`);$.headings[Ze]=T8(j[Ze],et,"pre-wrap")}te.value=$,lo()})()}),{flush:"post",immediate:!0}),We(()=>Ue.value.length,()=>{Mn.value&&gi({immediate:!0})}),We([yi,Q],()=>{lo(),Mn.value&&gi({immediate:!0}),Xo.value&&Al(),Ko.value&&tp(),uo("resize")},{immediate:!1}),We(()=>Ne.value,$=>{if($)for(const[J,he]of fi)Qv(J,he);else if(wb(),Mn.value)gi({immediate:!0});else for(const[J,he]of fi)he&&Fc(J,!0)},{immediate:!1}),We([se,fe,()=>G()],()=>{var $;($=eo.refresh)==null||$.call(eo);for(const[J,he]of fi)Qv(J,he)},{immediate:!1}),We([()=>M.viewportPriority,()=>Ue.value.length,fe],([$,J,he])=>{if($!==!1){if(Z.value&&(J<=200||J<=he)){Z.value=!1;for(const[me,Le]of fi)Qv(me,Le)}}else Z.value=!1}),We(()=>Vn.value,()=>{Mn.value&&gi({immediate:!0})}),We([Gn,oo,so,()=>Ue.value.length,Mn],()=>{bo()},{immediate:!0});let wm=null,Cm=!1,sp=null;function Am(){wm=null,Nb=null,Lb=void 0,Jh=null,km()}function t3(){op(),dr(),lo(),mi.clear();const $=Ue.value.length;$>0&&Vt($),qb()}function n3(){Jb(),Yt(),gm=null,kf=null,bf=null,Kv=null,hm=null,pm=null,Cm=!1,Am(),zS("restore"),Nr(),ep()}function xm($){var J;return[(J=ts())!=null?J:"",wo(),Hu(),qv.value,ym($),Ue.value.length,Math.round(Zs(0,Ue.value.length)),Math.round(gf()),ve.count,Math.round(ve.total)].join(":")}function o_(){return fo(this,null,function*(){var $,J,he,me;const Le=($=i.virtualScroll)==null?void 0:$.settledToken,Oe=ym(Le),Ze=wo(),et=ts(),mt=Ml.value;if(Qn.value&&((J=i.virtualScroll)==null?void 0:J.settleMode)==="manual"&&Uv(Le))if(Db()){if(xm(Le)!==Jh&&!Cm){Cm=!0;try{const tt=yield Vb({reason:"manual",expectedSettledTokenKey:Oe}),ut=ym()===Oe;Ub(Ze,et,mt)&&tt.sessionKey===Ze&&tt.threadKey===et&&ut&&tt.stable&&tt.phase==="final"&&(Jh=xm((he=i.virtualScroll)==null?void 0:he.settledToken))}finally{Cm=!1,yield ht();const tt=(me=i.virtualScroll)==null?void 0:me.settledToken,ut=Uv(tt)?xm(tt):"";Ub(Ze,et,mt)&&ut&&Jh!==ut&&o_()}}}else uo("manual")})}We(Qn,($,J)=>{if($!==J){if(!$)return n3(),void Jb();n3(),t3(),sp=Ml.value,uo("content")}},{flush:"post"}),We([Qn,Ml],([$,J])=>{$?sp!=null?sp!==J&&(sp=J,(function(he="resize"){op(),dr(),lo(),mi.clear();const me=Ue.value.length;me>0&&Vt(me),qb(),kf=null,bf=null,Kv=null,gm=null,Cm=!1,Am(),QS(),ht(()=>{Wu(),Xo.value&&Al(),Ko.value&&tp(),uo(he)})})("resize")):sp=J:sp=null},{flush:"post",immediate:!0}),We([Qn,()=>wo(),()=>ts()],([$])=>{$&&(n3(),t3(),zS("content"),uo("content"))}),We([Qn,()=>wo(),()=>ts(),Ml,()=>Ue.value.length],([$])=>{$&&(function(J="async-node"){let he=!1;for(const[me,Le]of Array.from(Ql.entries()))Tb(Le)||(Ql.delete(me),es.delete(me),he=!0);he&&(Qh(),uo(J))})("async-node")},{flush:"post"}),We([Qn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.sessionKey},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>i.indexKey,()=>W.value],([$])=>{$&&(km(),(function(J="content"){if(!Qn.value)return;const he=[],me=Ue.value.length,Le=Cb(me);for(const Oe of Array.from(mi.keys())){if(Oe>=me){he.push(Oe);continue}if(Oe=me&&mi.delete(Oe);he.length&&((function(Oe,Ze={}){const et=Array.from(Oe,Number);Wn(et);let mt=0;if(Di(()=>(mt=In(et,Ze),mt>0)),mt>0)(function(tt){for(const ut of tt)mi.delete(ut)})(et);else for(const tt of et)$o.delete(tt)})(he,{notify:!1}),lo(),Am(),Xo.value&&Al(),Ko.value&&tp(),uo(J))})("content"))},{flush:"post",immediate:!0}),We([Qn,()=>Ue.value.length,()=>wo(),()=>ts()],([$,J,he,me],[Le,Oe,Ze,et])=>{$&&Le&&he===Ze&&me===et&&J!==Oe&&Am()},{flush:"post"}),We([Qn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCache},()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCacheWidth},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Ue.value.length,()=>wo(),Q],()=>{QS()},{flush:"post",immediate:!0}),We([Qn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreAnchor},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Ue.value.length,()=>wo(),Q],$=>fo(null,[$],function*([J,he]){if(!J||!he)return;yield ht();const me=(function(){var Le;const Oe=(Le=i.virtualScroll)==null?void 0:Le.restoreAnchor;return Oe==null||Oe===!1?null:Oe===!0?"true":String(Oe)})();Wb(he,{restoreAnchor:me!=null,restoreToken:me??void 0})}),{flush:"post",immediate:!0}),We([Qn,Q,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey}],([$])=>{var J;if(!$)return;const he=(J=i.virtualScroll)==null?void 0:J.restoreState;he&&kf&&bf==="restore"&&(ZS(he)||(t3(),kf=null,bf=null,uo("resize")))},{flush:"post"}),We([Qn,()=>Ue.value.length,()=>wo(),Q],$=>fo(null,[$],function*([J]){var he;const me=hm,Le=pm;J&&me&&(yield ht(),!Wb(me,{restoreAnchor:Le?.restoreAnchor===!0,restoreToken:(he=Le?.restoreToken)!=null?he:"imperative",allowUncapturedAnchor:Le?.allowUncapturedAnchor===!0})&&YS(me)||(hm=null,pm=null))}),{flush:"post",immediate:!0}),We([Qn,ft,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>wo(),()=>ts(),Ml,um,Hv,()=>Vn.value,Ie,()=>ve.count,()=>ve.total],([$,J,he])=>{if(!$||J!==!0||he==="manual"||!Fb())return;const me=(function(){var Le;const Oe=Ue.value.length;return[(Le=ts())!=null?Le:"",wo(),Hu(),qv.value,Oe,Math.round(Zs(0,Oe)),Math.round(gf()),ve.count,Math.round(ve.total)].join(":")})();wm!==me&&(wm=me,Vb({reason:"final"}).then(Le=>{Le.stable||wm!==me||(wm=null)}))},{flush:"post",immediate:!0}),We([Qn,ft,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>{var $;return($=i.virtualScroll)==null?void 0:$.settledToken},()=>wo(),()=>ts(),Ml,um,Hv,()=>Vn.value,Ie,()=>Ue.value.length,()=>ve.count,()=>ve.total],()=>{o_()},{flush:"post",immediate:!0}),We([()=>Ue.value.length,Mn,oo,so,()=>zn.start,()=>zn.end],([$,J,he,me,Le,Oe])=>{be.value&&Nt("virtualization",{nodes:$,virtualization:J,maxLiveNodes:he,buffer:me,focusIndex:Gn.value,scroll:J?(()=>{const Ze=Vl.value||Ae();return Ze?{reverse:_e(Ze),scrollTop:Math.round(Ze.scrollTop),scrollTopAbs:Math.round(Math.abs(Ze.scrollTop)),scrollHeight:Math.round(Ze.scrollHeight),clientHeight:Math.round(Ze.clientHeight)}:null})():null,liveRange:{start:Le,end:Oe},rendered:Vn.value})}),We([()=>M.customId],([$],J,he)=>{if(!$||Vo)return;const me=(function(Le,Oe){return Le?(Cs.controllers[Le]=Oe,()=>{Cs.controllers[Le]===Oe&&delete Cs.controllers[Le]}):()=>{}})($,{captureRestoreAnchor:Xa,restoreAnchor:Gl,getAnchorDrift:ju,getReport:XZ});he(()=>{me()})},{immediate:!0}),ti(()=>{(function(){if(Qn.value)try{Wu(),mm();const $=vf("manual");XS($)&&(R($),gm=$,Zb=vm());const J=Xh($,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});J&&(q(J),J.anchor&&z(J.anchor),np=bm(J))}catch{}})(),fG(),wb(),Ke(),i_();for(const $ of Ca.values())for(const J of $)kt(J);Ca.clear(),Sl.clear(),mi.clear(),e3(),op(),xb(),Nr(),ep(),Jb(),TS(),xn()});const hG=fg("ViewportDeferredMermaidBlockNode",wu({loader:()=>fo(null,null,function*(){try{return(yield Yo(()=>import("./index11-DNt97Omj.js"),__vite__mapDeps([7,5]))).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',$),ol}}),loadingComponent:cN,delay:0}),cN),pG=fg("ViewportDeferredInfographicBlockNode",wu({loader:()=>fo(null,null,function*(){try{return(yield Yo(()=>import("./index10-C0TQjdWb.js"),[])).default}catch($){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',$),ol}}),loadingComponent:uN,delay:0}),uN),mG=fg("ViewportDeferredD2BlockNode",wu(()=>fo(null,null,function*(){try{return(yield Yo(()=>import("./index8-Dx-vzK_w.js"),[])).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',$),ol}})),ol),s_={text:Wo,paragraph:gh,heading:jk,code_block:k8,list:u1,list_item:a1,blockquote:jy,table:Yg,definition_list:Hy,footnote:Wy,footnote_reference:Rl,footnote_anchor:Gg,admonition:Ky,vmr_container:Uy,hardbreak:_d,link:Ur,image:Sd,thematic_break:qy,math_inline:Za,math_block:_H,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,checkbox:Bl,checkbox_input:Bl,inline_code:xr,html_inline:$l,reference:Hr,html_block:Qg},gG=D(()=>Mb()),r_=D(()=>ZL(M.codeBlockProps)),vG=D(()=>ZL(M.codeBlockProps,{omit:["langs"]})),l_=D(()=>Dt(Dt({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,monacoOptions:M.codeBlockMonacoOptions,themes:M.themes,langs:m.value==="shiki"?M.langs:void 0,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof ke.value=="boolean"?{showTooltips:ke.value}:{}),vG.value)),a_=D(()=>Dt(Dn(Dt({},l_.value),{langs:M.langs}),r_.value));function u_($){return typeof $=="boolean"?$:void 0}const yG=D(()=>{const $=M.codeBlockProps||{},J={},he=u_($.showLineNumbers);he!==void 0&&(J.showLineNumbers=he);const me=u_($.diffInline);me!==void 0&&(J.diffInline=me);const Le=(function(Oe){const Ze=Number(Oe);return Number.isFinite(Ze)&&Ze>0?Ze:void 0})($.reservedHeightPx);return Le!==void 0&&(J.reservedHeightPx=Le),J}),kG=D(()=>Dt(Dt({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,themes:M.themes,langs:M.langs,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof ke.value=="boolean"?{showTooltips:ke.value}:{}),r_.value)),bG=D(()=>Dt({},M.mermaidProps||{})),c_=D(()=>Dt({},M.d2Props||{})),wG=D(()=>Dt({},M.infographicProps||{})),Sm=D(()=>({typewriter:f.value,fade:M.fade,customHtmlTags:ot.value.customHtmlTags})),CG=D(()=>Dt(Dt({},Sm.value),typeof ke.value=="boolean"?{showTooltip:ke.value}:{})),AG=D(()=>Dt(Dt({},Sm.value),typeof ke.value=="boolean"?{showTooltips:ke.value}:{})),xG=D(()=>Dt(Dt({},Sm.value),typeof ke.value=="boolean"?{showTooltips:ke.value}:{})),SG=D(()=>Dt(Dt({},Sm.value),typeof ke.value=="boolean"?{showTooltips:ke.value}:{}));function _G($){return Array.isArray($.children)&&$.children.length>0}const Jv=D(()=>JZ.value.map($=>{var J,he,me,Le,Oe,Ze,et,mt;let tt=(function(It){var tn,un,bn,gn,wn,jn,Xn;if(It.type!=="code_block")return It;const Wi=It,Ys=[String((tn=Wi.language)!=null?tn:""),String((un=Wi.loading)!=null?un:""),String((bn=Wi.diff)!=null?bn:""),String((gn=Wi.code)!=null?gn:""),String((wn=Wi.originalCode)!=null?wn:""),String((jn=Wi.updatedCode)!=null?jn:""),String((Xn=Wi.raw)!=null?Xn:"")].join("\0"),Bs=Ro.get(Wi);if(Bs&&Bs.signature===Ys)return Bs.node;const Sa=Dt({},Wi);return Ro.set(Wi,{signature:Ys,node:Sa}),Sa})($.node);const ut=Xv(tt);let pt=p_(tt,ut);if((tt.type==="html_block"||tt.type==="html_inline")&&pt===s_[tt.type]){const It=tt,tn=String((J=It.tag)!=null?J:"").trim().toLowerCase()||Yz(It.content);if(tn){const un=xi.value[tn];if(Uo.value.has(tn)&&un)pt=un,tt=Dn(Dt({},It),{type:tn,tag:tn,content:$he(It.content,tn)});else if(Jz((he=It.content)!=null?he:It.raw,tn)){const bn=String((Le=(me=It.content)!=null?me:It.raw)!=null?Le:"");tt.type==="html_inline"?(pt=Wo,tt={type:"text",content:bn,raw:bn}):(pt=gh,tt={type:"paragraph",children:[{type:"text",content:bn,raw:bn}],raw:bn})}}}const Qe=tt.type==="code_block"&&m.value==="pre"&&pt===ol&&!i3(xi.value,ut);let ct=Dt({},(function(It,tn,un){const bn=tn??Xv(It);if(It.type==="code_block"){const gn=bn?i3(xi.value,bn):void 0;if(un&&m.value==="pre"&&!gn&&un===ol)return yG.value;if(un&&bn&&un===gn)return bn==="mermaid"?f_(It):bn==="infographic"?h_(It):bn==="d2"||bn==="d2lang"?c_.value:a_.value;if(un&&un===xi.value.code_block)return a_.value;if(DS(un))return kG.value}return bn==="mermaid"?f_(It):bn==="infographic"?h_(It):bn==="d2"||bn==="d2lang"?c_.value:It.type==="link"?CG.value:It.type==="list"?AG.value:It.type==="blockquote"?xG.value:It.type==="table"?SG.value:It.type==="code_block"?l_.value:Sm.value})(tt,ut,pt));const At=yi.value?Gh.value[$.index]:null;tt.type==="code_block"&&At?.kind==="code-block"&&(ct=Dn(Dt({},ct),Qe?{reservedHeightPx:(Oe=At.height)!=null?Oe:At.contentHeight}:{estimatedHeightPx:At.height,estimatedContentHeightPx:At.contentHeight,estimatedDiffInline:At.diffInline})),Qe||tt.type!=="code_block"||ut!=="mermaid"||zp(ct.estimatedPreviewHeightPx)!=null||(ct=Dn(Dt({},ct),{estimatedPreviewHeightPx:o4(n4(String((Ze=tt.code)!=null?Ze:"")))})),Qe||tt.type!=="code_block"||ut!=="infographic"||zp(ct.estimatedPreviewHeightPx)!=null||(ct=Dn(Dt({},ct),{estimatedPreviewHeightPx:s4(i4(String((et=tt.code)!=null?et:"")))})),tt.type==="math_block"&&(ct=Dn(Dt({},ct),{cacheScope:ji}));const yt=(function(It,tn){const un=String(It.type);return!xv(un)&&xi.value[un]===tn})(tt,pt),Wt=yt?C7(tt,we.value):void 0;return Dn(Dt({},$),{node:tt,component:pt,bindings:ct,customBindings:Dt(Dt({},Wt??{}),ct),rendersCustomNode:yt,hasSlotChildren:_G(tt),slotContent:String((mt=tt.content)!=null?mt:""),isCodeBlock:tt.type==="code_block",indexKey:`${gG.value}-${$.index}`,vnodeKey:`${eG.value}\0${$.index}\0${tt.type}`})}));function Xv($){var J;return $?.type==="code_block"?String((J=$.language)!=null?J:"").trim().toLowerCase():""}function i3($,J){const he=J.trim().toLowerCase();if(he)for(const me of[he,Ok(he),aH(he)]){const Le=me&&$[me];if(Le)return Le}}function d_($,J,he,me){var Le,Oe;const Ze=Dt({},$.value);return zp(Ze.estimatedPreviewHeightPx)==null&&(Ze.estimatedPreviewHeightPx=me(he(String((Le=J?.code)!=null?Le:"")),void 0,Ze.maxHeight==="none"?null:(Oe=zp(Ze.maxHeight))!=null?Oe:void 0)),Ze}function f_($){return d_(bG,$,n4,o4)}function h_($){return d_(wG,$,i4,s4)}function p_($,J){if(!$)return LC;const he=xi.value,me=he[String($.type)];if($.type==="code_block"){const Le=J??Xv($),Oe=Le?i3(he,Le):void 0;return Oe||(m.value==="pre"?he.code_block||ol:Le==="mermaid"?he.mermaid||hG:Le==="infographic"?he.infographic||pG:Le==="d2"||Le==="d2lang"?he.d2||mG:me||he.code_block||FS.value)}return me||s_[String($.type)]||LC}function o3($){o("click",$)}function MG($){var J;(J=$.target)!=null&&J.closest("[data-node-index]")&&o("mouseover",$)}function IG($){var J;(J=$.target)!=null&&J.closest("[data-node-index]")&&o("mouseout",$)}function m_($){o("mouseover",$)}function g_($){o("mouseout",$)}const Af=V(null),Jr=V(!1),_m=V(null),TG=D(()=>!(M.domMode!=="minimal"||re.value||M.fade!==!1||f.value||Jr.value||Ve.value||Mn.value||Er.value||vo.value||ro.value||Object.keys(xi.value).length!==0));let Mm,rp=null,s3=0,e2=0,t2=0;const v_=["code_block","admonition","table","math_block","html_block","image","thematic_break"],EG=new Set(v_),y_=[".typewriter-cursor",".height-estimation-probes",...v_.map($=>`[data-node-type="${$}"]`),"script","style"].join(",");function k_($){if(!$||typeof $!="object")return!1;const J=$.type;return typeof J=="string"&&EG.has(J)}function n2($){var J,he;if(!$||typeof $!="object")return 0;const me=$,Le=(he=(J=me.raw)!=null?J:me.content)!=null?he:me.code;if(typeof Le=="string")return Le.length;const Oe=me.children;if(Array.isArray(Oe))return Oe.reduce((et,mt)=>et+n2(mt),0);const Ze=me.items;return Array.isArray(Ze)?Ze.reduce((et,mt)=>et+n2(mt),0):0}function i2(){Mm&&(clearTimeout(Mm),Mm=void 0)}function r3(){s3+=1,rp!=null&&(Gi?.(rp),rp=null)}function Im(){r3(),Bc(),Af.value&&(Af.value.style.visibility="hidden")}function LG($){var J;if($.nodeType!==Node.TEXT_NODE||!((J=$.textContent)!=null?J:"").trim())return!1;const he=$.parentElement;return!!he&&!he.closest(y_)}function NG($){let J=$.lastChild;for(;J;){if(LG(J))return J;if(J.nodeType===Node.ELEMENT_NODE){const he=J;if(!he.matches(y_)&&he.lastChild){J=he.lastChild;continue}}for(;J&&J!==$&&!J.previousSibling;)J=J.parentNode;if(!J||J===$)break;J=J.previousSibling}return null}function b_(){const $=Jv.value;for(let J=$.length-1;J>=0;J--){const he=$[J];if(!he||k_(he.node)||!Gv(he.index))continue;const me=fi.get(he.index);if(!me)continue;const Le=NG(me);if(Le)return Le}return null}function Bc(){_m.value&&(_m.value.classList.remove(dN),_m.value=null)}function o2(){if(d.value!=="simple"||!K||!Jr.value||!O.value)return void Bc();const $=b_(),J=$?(function(he){var me;const Le=(me=he.parentElement)==null?void 0:me.closest(".text-node");return Le instanceof HTMLElement?Le:he.parentElement})($):null;J!==_m.value&&(Bc(),J&&(J.classList.add(dN),_m.value=J))}function s2(){if(d.value!=="precise"||!K||!Jr.value||rp!=null)return;const $=s3,J=()=>{rp=null,$===s3&&(function(){var he,me;if(d.value!=="precise"||!(K&&Jr.value&&O.value&&Af.value))return;const Le=O.value,Oe=Af.value;Oe.style.visibility="hidden";const Ze=b_();if(!Ze)return;let et=0,mt=0,tt=20,ut=!1;if(Ze?.textContent){const pt=Ze.textContent.length,Qe=document.createRange();Qe.setStart(Ze,Math.max(0,pt-1)),Qe.setEnd(Ze,pt);const ct=typeof Qe.getClientRects=="function"?Qe.getClientRects():void 0,At=(me=ct?.[ct.length-1])!=null?me:(he=Ze.parentElement)==null?void 0:he.getBoundingClientRect();if(At){const yt=Gt("typewriterCursor.root.getBoundingClientRect",()=>Le.getBoundingClientRect());et=At.right-yt.left+Le.scrollLeft,mt=At.top-yt.top+Le.scrollTop,tt=At.height||tt,ut=!0}Qe.detach()}ut&&(Oe.style.transform=`translate(${Math.max(0,et)}px, ${Math.max(0,mt)}px)`,Oe.style.height=`${tt}px`,Oe.style.visibility="visible")})()};to?rp=to(J):J()}return We([qe,()=>i.content,()=>i.nodes,()=>M.typewriter,ft],()=>fo(null,null,function*(){var $,J;if(!K||re.value||!le.value)return;if(ft.value)return Jr.value=!1,i2(),void Im();if(($=i.nodes)!=null&&$.length)return Jr.value=!1,i2(),Im(),e2=((J=i.content)!=null?J:"").length,void(t2=qe.value.length);const he=(function(){var et,mt;return(et=i.nodes)!=null&&et.length?i.nodes.reduce((tt,ut)=>tt+n2(ut),0):((mt=i.content)!=null?mt:"").length})(),me=(function(){var et;return(et=i.nodes)!=null&&et.length?i.nodes.reduce((mt,tt)=>mt+n2(tt),0):qe.value.length})(),Le=!k_(Ue.value[Ue.value.length-1]),Oe=he>e2,Ze=me>t2;if(!f.value||!Le||!Oe&&!Ze)return f.value&&Le||(Jr.value=!1,Im()),e2=he,void(t2=me);e2=he,t2=me,Jr.value=!0,d.value==="precise"&&Af.value&&(Af.value.style.visibility="hidden"),i2(),yield ht(),d.value==="simple"?o2():(Bc(),s2()),Mm=setTimeout(()=>{Mm=void 0,Jr.value=!1},3e3)}),{flush:"post",immediate:!0}),We(Jr,$=>fo(null,null,function*(){$?(yield ht(),d.value!=="simple"?(Bc(),d.value==="precise"&&s2()):o2()):Im()}),{flush:"post"}),We(d,()=>fo(null,null,function*(){if(K&&!re.value&&le.value&&Jr.value){if(yield ht(),d.value==="simple")return r3(),void o2();Bc(),d.value!=="precise"?Im():s2()}}),{flush:"post"}),We([()=>Vn.value,()=>zn.start,()=>zn.end],()=>fo(null,null,function*(){K&&!re.value&&le.value&&Jr.value&&(yield ht(),d.value!=="simple"?(Bc(),d.value==="precise"&&s2()):o2())}),{flush:"post"}),ti(()=>{i2(),r3(),Bc(),ci.clear()}),($,J)=>{const he=uY("NodeRenderer",!0);return p(re)?(k(!0),L(De,{key:0},Ct(Jv.value,me=>(k(),L(De,{key:me.vnodeKey},[me.rendersCustomNode?(k(),de(Po(me.component),ui({key:0,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onClick:o3,onMouseover:m_,onMouseout:g_,onCopy:J[0]||(J[0]=Le=>s(Le)),onHandleArtifactClick:J[1]||(J[1]=Le=>o("handleArtifactClick",Le))}),{default:ce(()=>[me.hasSlotChildren?(k(),de(he,ui({key:0,ref_for:!0},bt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,ui({key:1,ref_for:!0},bt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Po(me.component),ui({key:1,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onClick:o3,onMouseover:m_,onMouseout:g_,onCopy:J[2]||(J[2]=Le=>s(Le)),onHandleArtifactClick:J[3]||(J[3]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),L("div",{key:1,ref_key:"containerRef",ref:O,class:Re(["markstream-vue markdown-renderer",[{dark:M.isDark},{virtualized:Mn.value},{"virtual-scroll-coordinated":Zi.value},{"stable-layout":Ft.value},{"typewriter-simple-cursor":Jr.value&&d.value==="simple"}]]),"data-custom-id":M.customId,onClick:o3,onMouseover:MG,onMouseout:IG},[Hi.value||Mn.value?(k(),L(De,{key:0},[Hi.value?(k(),de(q9e,{key:0,width:di.value,"flow-root":Mn.value||Zi.value,"paragraph-node":go.value,"list-item-node":Ls.value,"list-node":Hs.value,"heading-nodes":ys.value,"set-paragraph-wrapper":mn,"set-list-item-wrapper":En,"set-list-wrapper":Jn,"set-heading-wrapper":YZ},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),Mn.value?(k(),L("div",{key:1,class:"node-spacer",style:on({height:`${Sb.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),TG.value?(k(!0),L(De,{key:1},Ct(Jv.value,me=>(k(),L(De,{key:me.vnodeKey},[Gv(me.index)?(k(),de(Po(me.component),ui({key:0,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onMouseover:J[4]||(J[4]=Le=>o("mouseover",Le)),onMouseout:J[5]||(J[5]=Le=>o("mouseout",Le)),onCopy:J[6]||(J[6]=Le=>s(Le)),onHandleArtifactClick:J[7]||(J[7]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(k(!0),L(De,{key:2},Ct(Jv.value,me=>(k(),L("div",{key:me.vnodeKey,ref_for:!0,ref:Le=>Qv(me.index,Le),class:"node-slot","data-node-index":me.index,"data-node-type":me.node.type},[Gv(me.index)?(k(),L("div",{key:0,ref_for:!0,ref:Le=>(function(Oe,Ze){var et;Ze||(function(pt){const Qe=`${Mb()}-${pt}`;let ct=!1;for(const At of Array.from(es.keys())){const yt=Ql.get(At);(yt?.index===pt||At===Qe||At.startsWith(`${Qe}-`))&&(es.delete(At),Ql.delete(At),ct=!0)}ct&&(Qh(),uo("async-node"))})(Oe),Aa.delete(Oe),(function(pt){var Qe;const ct=((Qe=Sl.get(pt))!=null?Qe:0)+1;Sl.set(pt,ct)})(Oe);const mt=Ca.get(Oe);if(mt){for(const pt of mt)kt(pt);Ca.delete(Oe)}if((function(pt){const Qe=Mo.get(pt);Qe&&(ni?.unobserve(Qe),Io.delete(Qe),Mo.delete(pt))})(Oe),!Ze||!Ns.value)return Gs.delete(Oe),void Sl.delete(Oe);Gs.set(Oe,Ze);const tt=()=>{Yv(Oe,Ze)};queueMicrotask(tt);const ut=(ni||typeof ResizeObserver>"u"||(ni=new ResizeObserver(pt=>{if(pt.length)for(const Qe of pt){const ct=Io.get(Qe.target),At=Mo.get(ct??-1);ct!=null&&At&&Yv(ct,At)}else Wu()})),ni);if(ut&&(Mo.set(Oe,Ze),Io.set(Ze,Oe),ut.observe(Ze)),typeof window<"u"){const pt=((et=Ue.value[Oe])==null?void 0:et.type)==="code_block"?[16,80,240,800]:ft.value?[80]:[];if(pt.length){const Qe=pt.map(ct=>Ge(ct,tt,"node-resize")).filter(ct=>ct!=null);Qe.length&&Ca.set(Oe,Qe)}}})(me.index,Le),class:"node-content"},[me.isCodeBlock?me.rendersCustomNode?(k(),de(Po(me.component),ui({key:1,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[12]||(J[12]=Le=>s(Le)),onHandleArtifactClick:J[13]||(J[13]=Le=>o("handleArtifactClick",Le))}),{default:ce(()=>[me.hasSlotChildren?(k(),de(he,ui({key:0,ref_for:!0},bt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,ui({key:1,ref_for:!0},bt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Po(me.component),ui({key:2,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[14]||(J[14]=Le=>s(Le)),onHandleArtifactClick:J[15]||(J[15]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),de(ko,{key:0,name:"fade",css:M.fade!==!1,appear:M.fade!==!1},{default:ce(()=>[me.rendersCustomNode?(k(),de(Po(me.component),ui({key:0,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[8]||(J[8]=Le=>s(Le)),onHandleArtifactClick:J[9]||(J[9]=Le=>o("handleArtifactClick",Le))}),{default:ce(()=>[me.hasSlotChildren?(k(),de(he,ui({key:0,ref_for:!0},bt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,ui({key:1,ref_for:!0},bt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Po(me.component),ui({key:1,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[10]||(J[10]=Le=>s(Le)),onHandleArtifactClick:J[11]||(J[11]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),L("div",{key:1,class:"node-placeholder",style:on({height:`${Ja(me.index)}px`})},null,4))],8,K9e))),128)),Jr.value&&d.value==="precise"?(k(),L("span",{key:3,ref_key:"typewriterCursorRef",ref:Af,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),Mn.value?(k(),L("div",{key:4,class:"node-spacer",style:on({height:`${_b.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,V9e))}}})),[["__scopeId","data-v-a9489508"]]),pl=zH;pl.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",pl.__name,pl.name].filter(n=>!!n));for(const n of t)e.component(n,zH)};const R7=Object.freeze(Object.defineProperty({__proto__:null,default:pl},Symbol.toStringTag,{value:"Module"})),Z9e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},G9e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Q9e={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Y9e={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},J9e={class:"admonition-title"},X9e=["aria-expanded","aria-controls"],e4e=["id"],Ky=$i(lt({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=V(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),L("div",{class:Re(["admonition",[`admonition-${i.node.kind}`]])},[A("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),L("svg",Z9e,[...c[1]||(c[1]=[A("circle",{cx:"12",cy:"12",r:"10"},null,-1),A("path",{d:"M12 16v-4"},null,-1),A("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),L("svg",G9e,[...c[2]||(c[2]=[A("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),A("path",{d:"M9 18h6"},null,-1),A("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),L("svg",Q9e,[...c[3]||(c[3]=[A("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),A("path",{d:"M12 9v4"},null,-1),A("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),L("svg",Y9e,[...c[4]||(c[4]=[A("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),A("path",{d:"M12 8v4"},null,-1),A("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),A("span",J9e,F(s.value),1),i.node.collapsible?(k(),L("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),L("svg",{style:on({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[A("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,X9e)):ee("",!0)]),ai(A("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[U(p(pl),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,e4e),[[Go,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Ky.install=e=>{e.component(Ky.__name,Ky)};const RC=()=>Yo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let W2=null,q2=RC,U2=null,fN=!1,hN=!1;function g9t(){return fo(this,null,function*(){if(W2)return W2;const e=q2;return e?e===RC&&fN?null:U2||(U2=fo(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===RC)return e===q2&&(fN=!0,(function(i){hN||(hN=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===q2&&(U2=null)}return e!==q2?null:t?(W2=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),W2):null}),U2):null})}let V2=null,jH=null,K2=null;function v9t(){return typeof jH=="function"}function y9t(){return fo(this,null,function*(){if(V2)return V2;const e=jH;return e?K2||(K2=fo(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(V2=n,V2):null}).finally(()=>{K2=null}),K2):null})}const k9t=Symbol("markstreamLanguageIconResolver");function t4e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function n4e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let pN=!1;function HH(){pN||typeof Worker>"u"||(pN=!0,Dve(new t4e),Vve(new n4e))}HH();function fd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function mN(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const $7={},p4=Symbol("resolveImage");class ku extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class na extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class O7 extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function qi(e){return e instanceof ku||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Wk(e){return e instanceof na||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function i4e(e){return Wk(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function o4e(e){return e instanceof O7||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const s4e=41301,r4e=40922;function gN(e){return qi(e)&&e.code===r4e}const Yu=3e4,Z2=5*6e4,vN=5*6e4,WH="0123456789ABCDEFGHJKMNPQRSTVWXYZ",$C=500,qH=40101;function yN(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function G2(e=Yu){try{return AbortSignal.timeout(e)}catch{return}}function l4e(e,t){let n="",i=e;for(let o=0;oWH[n%32]).join("")}function qm(){return`${l4e(Date.now(),10)}${a4e(16)}`}function kN(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function E8(e){try{const t=await e.text();return t?t.length>$C?`${t.slice(0,$C)}...`:t:void 0}catch{return}}class bN{constructor(t){this.opts=t,this.tracer=t.tracer??$7}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=fd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;yN(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=qm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:G2()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new na({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Yu,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new O7({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new ku({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i?.allowCodes,i?.timeoutMs)}async postZip(t,n,i){const o="POST",s=fd(this.opts.origin,t,this.opts.restBasePath),r=qm(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:G2(Z2)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new na({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:Z2,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const v=h?.code??u.status,y=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:v,msg:y,envelopeRequestId:h?.request_id}),new ku({code:v,msg:y,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new na({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Z2,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await E8(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new na({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Z2,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=fd(this.opts.origin,t,this.opts.restBasePath),s=qm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:kN(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:G2()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new na({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Yu,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new na({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Yu,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await E8(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new ku({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=fd(this.opts.origin,t,this.opts.restBasePath),s=qm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:kN(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=Yu;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new na({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Yu,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new na({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Yu,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new na({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Yu,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,$C),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new ku({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s=[],r=Yu){let l=fd(this.opts.origin,n,this.opts.restBasePath);if(o){const m=new URLSearchParams;yN(m,o);const g=m.toString();g&&(l=`${l}?${g}`)}const a=qm(),u={"X-Request-Id":a};this.addClientHeaders(u),i!==void 0&&(u["Content-Type"]="application/json; charset=utf-8");const c=Date.now();this.tracer.restRequest?.({method:t,path:n,url:l,requestId:a,body:i});let d;try{d=await fetch(l,{method:t,headers:u,body:i!==void 0?JSON.stringify(i):void 0,signal:G2(r)})}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"fetch",durationMs:Date.now()-c,error:m}),new na({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"fetch",timeoutMs:r,timestamp:Date.now(),durationMs:Date.now()-c})}let f;const h=d.clone();try{const m=await d.text();f=d.status===204&&m===""?{code:0,msg:"",data:null,request_id:a}:JSON.parse(m)}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"parse",durationMs:Date.now()-c,status:d.status,error:m}),new na({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"parse",timeoutMs:r,status:d.status,statusText:d.statusText,contentType:d.headers.get("content-type")??void 0,bodyPreview:await E8(h),timestamp:Date.now(),durationMs:Date.now()-c})}if(this.tracer.restResponse?.({method:t,path:n,requestId:a,status:d.status,durationMs:Date.now()-c,code:f.code,msg:f.msg,envelopeRequestId:f.request_id,data:f.data}),this.checkAuthRequired(d,f.code),f.code!==0&&!s.includes(f.code))throw new ku({code:typeof f.code=="number"?f.code:d.status,msg:typeof f.msg=="string"&&f.msg.length>0?f.msg:`HTTP ${d.status}${d.statusText?` ${d.statusText}`:""}`,requestId:f.request_id??a,details:f.details,timestamp:Date.now(),durationMs:Date.now()-c});return f.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===qH)&&this.opts.credentialStore?.markAuthRequired?.()}}function UH(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function wN(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function fu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:UH(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Q2(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function Xg(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function CN(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function P7(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:CN(e.source)};case"video":return{type:"video",source:CN(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function VH(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(P7),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function KH(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function u4e(e){return{content:e.content.map(KH),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function c4e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function d4e(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function f4e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function h4e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(f4e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function p4e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(h4e),createdAt:e.created_at}}function m4e(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function g4e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=m4e(i);return{answers:t,method:e.method,note:e.note}}function OC(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function AN(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Vc(e,t){const n=e[t];return typeof n=="string"?n:void 0}function vp(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Jl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ZH(e){if(!e||typeof e!="object")return null;const t=e,n=Vc(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:Vc(t,"goalId")??Vc(t,"goal_id")??"goal",objective:Vc(t,"objective")??"",completionCriterion:Vc(t,"completionCriterion")??Vc(t,"completion_criterion"),status:n,turnsUsed:vp(t,"turnsUsed")??vp(t,"turns_used")??0,tokensUsed:vp(t,"tokensUsed")??vp(t,"tokens_used")??0,wallClockMs:vp(t,"wallClockMs")??vp(t,"wall_clock_ms")??0,terminalReason:Vc(t,"terminalReason")??Vc(t,"terminal_reason"),budget:{tokenBudget:Jl(o,"tokenBudget")??Jl(o,"token_budget"),remainingTokens:Jl(o,"remainingTokens")??Jl(o,"remaining_tokens"),turnBudget:Jl(o,"turnBudget")??Jl(o,"turn_budget"),remainingTurns:Jl(o,"remainingTurns")??Jl(o,"remaining_turns"),wallClockBudgetMs:Jl(o,"wallClockBudgetMs")??Jl(o,"wall_clock_budget_ms"),remainingWallClockMs:Jl(o,"remainingWallClockMs")??Jl(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function v4e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:fu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:fu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:Xg(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Xg(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:UH(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=ZH(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:VH(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(P7),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:d4e(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:p4e(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:OC(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:PC(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function y4e(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function yp(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function xN(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function PC(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function k4e(e){return e.session_id}function b4e(e){return e.seq}function w4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function SN(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const C4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function A4e(e,t){switch(t.op){case"reset":return x4e(e,t);case"turn.upsert":return _4e(e,t.turn);case"step.upsert":return I4e(e,t.turnId,t.step);case"frame.upsert":return E4e(e,t);case"append":return N4e(e,t);case"marker.upsert":return MN(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return MN(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return B4e(e,t.task);case"interaction.upsert":return R4e(e,t.interaction);case"attachment.upsert":return O4e(e,t.attachment);case"todo.upsert":return z4e(e,t.todo);case"prompt.upsert":return H4e(e,t.prompt);case"meta.merge":return U4e(e,t.meta);case"items.remove":return F4e(e,t.ids)}}function x4e(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function _N(e,t){return{...e,kind:"turn",steps:[...t]}}function GH(e){return{kind:"turn",turnId:e,ordinal:w4e(e),state:"running",origin:{kind:"other"},steps:[]}}function S4e(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function M1(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function z7(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function qk(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function _4e(e,t){const n=M1(e,t.turnId);return n?M4e(n,t)?{state:e,changed:!1}:{state:{...e,items:qk(e.items,t.turnId,i=>_N(t,i.steps))},changed:!0}:{state:{...e,items:z7(e.items,_N(t,[]))},changed:!0}}function M4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function I4e(e,t,n){const i=M1(e,t)??GH(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&T4e(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=M1(e,t)?qk(e.items,t,()=>l):z7(e.items,l);return{state:{...e,items:a},changed:!0}}function T4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function E4e(e,t){const n=M1(e,t.turnId)??GH(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??S4e(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&L4e(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=M1(e,t.turnId)?qk(e.items,t.turnId,()=>a):z7(e.items,a);return{state:{...e,items:u},changed:!0}}function L4e(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function N4e(e,t){if(t.target.type==="task")return D4e(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=M1(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=QH(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:qk(e.items,n,()=>d)},changed:!0}}function D4e(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=QH(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function QH(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function MN(e,t,n,i){if(e.items.some(s=>zC(s)===n)){let s=!1;const r=e.items.map(l=>zC(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function zC(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function F4e(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(zC(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function B4e(e,t){const n=e.tasks.get(t.taskId);if(n&&q4e(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function R4e(e,t){const n=e.interactions.get(t.interactionId);if(n&&$4e(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function $4e(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function O4e(e,t){const n=e.attachments.get(t.attachmentId);if(n&&P4e(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function P4e(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function z4e(e,t){const n=e.todos.get(t.todoId);if(n&&j4e(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function j4e(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function H4e(e,t){const n=e.prompts.get(t.promptId);if(n&&W4e(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function W4e(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function q4e(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function U4e(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class V4e{constructor(t){this.agentId=t}#e=C4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=A4e(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Mt(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class c1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class YH extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const JH={};function Wd(e){return JH}function XH(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function jC(e,t){return typeof t=="bigint"?t.toString():t}function Uk(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function j7(e){return e==null}function H7(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function K4e(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const IN=Symbol("evaluating");function zi(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==IN)return i===void 0&&(i=IN,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Uh(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function TN(e){return JSON.stringify(e)}function Z4e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eW="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const G4e=Uk(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function I1(e){if($0(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!($0(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tW(e){return I1(e)?{...e}:Array.isArray(e)?[...e]:e}const Q4e=new Set(["string","number","symbol"]);function T1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Sn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Y4e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const J4e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function X4e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=sf(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return Uh(this,"shape",r),r},checks:[]});return rf(e,s)}function eke(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=sf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return Uh(this,"shape",r),r},checks:[]});return rf(e,s)}function tke(e,t){if(!I1(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=sf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Uh(this,"shape",s),s}});return rf(e,o)}function nke(e,t){if(!I1(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=sf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Uh(this,"shape",i),i}});return rf(e,n)}function ike(e,t){const n=sf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Uh(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return rf(e,n)}function oke(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=sf(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return Uh(this,"shape",a),a},checks:[]});return rf(t,r)}function ske(e,t,n){const i=sf(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return Uh(this,"shape",s),s}});return rf(t,i)}function Hp(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Y2(e){return typeof e=="string"?e:e?.message}function qd(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Y2(e.inst?._zod.def?.error?.(e))??Y2(t?.error?.(e))??Y2(n.customError?.(e))??Y2(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function W7(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function O0(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const nW=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,jC,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iW=Mt("$ZodError",nW),oW=Mt("$ZodError",nW,{Parent:Error});function rke(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function lke(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new c1;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>qd(a,s,Wd())));throw eW(l,o?.callee),l}return r.value},U7=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>qd(a,s,Wd())));throw eW(l,o?.callee),l}return r.value},Vk=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new c1;return s.issues.length?{success:!1,error:new(e??iW)(s.issues.map(r=>qd(r,o,Wd())))}:{success:!0,data:s.value}},ake=Vk(oW),Kk=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>qd(r,o,Wd())))}:{success:!0,data:s.value}},uke=Kk(oW),cke=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return q7(e)(t,n,o)},dke=e=>(t,n,i)=>q7(e)(t,n,i),fke=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return U7(e)(t,n,o)},hke=e=>async(t,n,i)=>U7(e)(t,n,i),pke=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Vk(e)(t,n,o)},mke=e=>(t,n,i)=>Vk(e)(t,n,i),gke=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Kk(e)(t,n,o)},vke=e=>async(t,n,i)=>Kk(e)(t,n,i),yke=/^[cC][^\s-]{8,}$/,kke=/^[0-9a-z]+$/,bke=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wke=/^[0-9a-vA-V]{20}$/,Cke=/^[A-Za-z0-9]{27}$/,Ake=/^[a-zA-Z0-9_-]{21}$/,xke=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ske=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,EN=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_ke=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mke="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ike(){return new RegExp(Mke,"u")}const Tke=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Eke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Lke=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Nke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Dke=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sW=/^[A-Za-z0-9_-]*$/,Fke=/^\+[1-9]\d{6,14}$/,rW="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Bke=new RegExp(`^${rW}$`);function lW(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Rke(e){return new RegExp(`^${lW(e)}$`)}function $ke(e){const t=lW({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${rW}T(?:${i})$`)}const Oke=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Pke=/^-?\d+$/,aW=/^-?\d+(?:\.\d+)?$/,zke=/^(?:true|false)$/i,jke=/^[^A-Z]*$/,Hke=/^[^a-z]*$/,bl=Mt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uW={number:"number",bigint:"bigint",object:"date"},cW=Mt("$ZodCheckLessThan",(e,t)=>{bl.init(e,t);const n=uW[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{bl.init(e,t);const n=uW[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Wke=Mt("$ZodCheckMultipleOf",(e,t)=>{bl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):K4e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),qke=Mt("$ZodCheckNumberFormat",(e,t)=>{bl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=J4e[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=Pke)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Uke=Mt("$ZodCheckMaxLength",(e,t)=>{var n;bl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!j7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=W7(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Vke=Mt("$ZodCheckMinLength",(e,t)=>{var n;bl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!j7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=W7(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Kke=Mt("$ZodCheckLengthEquals",(e,t)=>{var n;bl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!j7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=W7(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Zk=Mt("$ZodCheckStringFormat",(e,t)=>{var n,i;bl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Zke=Mt("$ZodCheckRegex",(e,t)=>{Zk.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gke=Mt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jke),Zk.init(e,t)}),Qke=Mt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Hke),Zk.init(e,t)}),Yke=Mt("$ZodCheckIncludes",(e,t)=>{bl.init(e,t);const n=T1(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Jke=Mt("$ZodCheckStartsWith",(e,t)=>{bl.init(e,t);const n=new RegExp(`^${T1(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Xke=Mt("$ZodCheckEndsWith",(e,t)=>{bl.init(e,t);const n=new RegExp(`.*${T1(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),ebe=Mt("$ZodCheckOverwrite",(e,t)=>{bl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tbe{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` +`)&&!(function(j){const G=oN(j);if(sN(G))return!1;const ne=BH(G);return ne.length>=2&&ne.some(W=>W.trim())})(P))})(r.value,q)?T():(function(){if(g+=1,h)return;const B=Math.max(0,(function(P){const H=P.parseCoalesceMs;return typeof H=="number"&&Number.isFinite(H)&&H>=0?H:80})(e)-(La()-v));B<=0?T():h=setTimeout(T,B)})())},{flush:"sync",immediate:!0}),Gd(C);const N=D(()=>{var q,z,$,B;return Dhe(e.customHtmlTags,(q=e.parseOptions)==null?void 0:q.customHtmlTags,(B=($=(z=t.customComponentsMap)==null?void 0:z.value)!=null?$:{},Object.entries(B).map(([P,H])=>{const j=Ca(P);return H==null||!j||Av(j)||Uz.has(j)||yv.has(j)?"":j}).filter(Boolean)))}),I=D(()=>{const{key:q,tags:z}=Fhe(N.value);if(!q)return i;const $=o.get(q);if($)return $;const B=oL(t.instanceMsgId,{customHtmlTags:z});return o.set(q,B),B}),S=D(()=>{const q=I.value;if(!e.customMarkdownIt)return q;const z=e.customMarkdownIt(q);return q.__markstreamHasCustomParserExtensions=!0,z.__markstreamHasCustomParserExtensions=!0,z}),_=D(()=>{var q,z;const $=(q=e.parseOptions)!=null?q:{},B=t.effectiveFinal.value,P=N.value,H=B!=null,j=P.length>0;return H||j||$.streamParse==null?Nt(Nt(Fn(Nt({},$),{streamParse:(z=$.streamParse)==null||z}),H?{final:B}:{}),j?{customHtmlTags:P}:{}):$}),x=D(()=>{var q;return new Set(((q=_.value.customHtmlTags)!=null?q:[]).map(z=>String(z).trim().toLowerCase()).filter(Boolean))}),E=D(()=>iN(_.value,S.value,e.customMarkdownIt,{includeFinal:!0})),M=D(()=>iN(_.value,S.value,e.customMarkdownIt,{includeFinal:!1}));We([E,M],([q,z],[$,B])=>{$&&(q===$&&z===B||(T(),z!==B&&(l=[],c="")))},{flush:"sync"});const R=D(()=>{var q,z,$,B,P,H,j,G,ne,W,Q;if((q=e.nodes)!=null&&q.length)return l=[],c="",w(0),Et(e.nodes.slice());const te=r.value;if(!te)return l=[],c="",w(-1),[];const X=t.debugPerformanceEnabled.value,ve=X?La():0,ce=S.value,se=E.value,pe=M.value;a&&se!==a&&(function(ze){var ht,gt;(gt=(ht=ze.stream)==null?void 0:ht.reset)==null||gt.call(ht)})(ce),u&&pe!==u&&(l=[],c="");const Z=Object.keys(($=(z=t.customComponentsMap)==null?void 0:z.value)!=null?$:{}).length>0||typeof _.value.postTransformNodes=="function";Z!==d&&(l=[],c="");const ae=!Z&&l.length>0&&te.startsWith(c)&&pe===u,K=X?nN(ce):null,re=X?{}:void 0,we=aN(ce),be=!we&&!Z,ke=Nt(Nt(Fn(Nt({},_.value),{__reuseStableTopLevelNodes:be}),we?{__disableStreamParse:!0}:{}),re?{__timing:re}:{}),oe=Gj(te,ce,ke),le=X?La():0,ye=X?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Ae,Me=X?j2(oe.length):void 0,fe=0,ie=0,Ee=0;if(ae){const ze=X?La():0,[ht,gt]=(function($t){var jt,Ht;const[Te,Fe]=$t.scanGlobalReferenceAppend($t.previousContent,$t.content),Ve=$t.parseOptions;return[$t.previousDirtyStartIndex>0&&Ve.final!==!0&&!$t.customMarkdownIt&&!aN($t.md)&&!Te&&typeof Ve.preTransformTokens!="function"&&typeof Ve.postTransformTokens!="function"&&typeof Ve.postTransformNodes!="function"&&((Ht=(jt=Ve.customHtmlTags)==null?void 0:jt.length)!=null?Ht:0)===0?$t.previousDirtyStartIndex:0,Fe]})({content:te,previousContent:c,previousDirtyStartIndex:y,parseOptions:_.value,customMarkdownIt:e.customMarkdownIt,md:ce,scanGlobalReferenceAppend:f});Ee=gt;const _t=ht<=0;if(ye){const $t=(function(jt,Ht,Te,Fe={}){var Ve;if(!Ht.length)return{nodes:jt,metrics:j2(jt.length)};const lt=(Ve=Fe.scanStartIndex)!=null?Ve:0,Ft=Fe.reuseDirtyTail!==!1,Lt=(function(nn,it,dt,At=0){const un=Math.min(nn.length,it.length);for(let Qt=Math.min(un,Math.max(0,At));QtHd(ze[_t]))})(Ae,ye,ie):(function(ze,ht=0){for(let gt=Math.max(0,ht);gt((P=K?.total)!=null?P:0);t.logPerf(ht?"parse(stream)":"parse(sync)",Nt(Nt(Nt({rendererId:t.instanceMsgId,ms:Math.round(La()-ve),nodes:Ae.length,contentLength:te.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:qe,referenceDefinitionScanChars:Ee,signatureMs:(H=ye?.signatureMs)!=null?H:0,stabilizeSignatureMs:(j=ye?.stabilizeSignatureMs)!=null?j:0,primeSignatureMs:(G=ye?.primeSignatureMs)!=null?G:0,signatureCallCount:(ne=ye?.signatureCallCount)!=null?ne:0,stabilizeSignatureCallCount:(W=ye?.stabilizeSignatureCallCount)!=null?W:0,primeSignatureCallCount:(Q=ye?.primeSignatureCallCount)!=null?Q:0,stabilizeMs:fe},Me??{}),re?Object.fromEntries(_9e.map(gt=>{var _t;return[gt,(_t=re[gt])!=null?_t:0]})):{}),ze?{streamMode:ze.lastMode,streamDelta:F9e(ze,K),streamStats:ze}:{}))}return Et(Ae)});return{effectiveCustomHtmlTags:N,effectiveCustomHtmlTagsSet:x,mdBase:I,mdInstance:S,mergedParseOptions:_,getParsedNodesDirtyStartIndex:()=>y,getParsedNodesRevision:()=>b,parsedNodes:R}}function R9e(e){const{isClient:t}=e,n=V(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const v=n.value,y=v.has(f);if(h){if(y)return;const w=new Set(v);return w.add(f),void(n.value=w)}if(!y)return;const b=new Set(v);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return av()&&Gd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const $9e={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},uN=/auto|scroll|overlay/i;function P9e(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return uN.test(t)||uN.test(n)}function z9e(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const j9e={class:"m-0 p-0"},H9e=["data-probe"],W9e=Ri(rt(Fn(Nt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),L("div",{class:"height-estimation-probes",style:sn({width:`${e.width}px`}),"aria-hidden":"true"},[A("div",{ref:s=>e.setParagraphWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[U(p(vh),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),A("div",{ref:s=>e.setListItemWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[A("ul",j9e,[U(p(a1),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),A("div",{ref:s=>e.setListWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[U(p(u1),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),L(De,null,Ct(6,s=>A("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[U(p(zk),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,H9e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),cN=rt({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return o4((i=jp(e.estimatedPreviewHeightPx))!=null?i:n4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Tn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Tn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Tn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Tn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Tn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Tn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Tn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Tn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Tn("div",{class:"absolute inset-0"},[Tn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),dN=rt({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return i4((i=jp(e.estimatedPreviewHeightPx))!=null?i:t4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Tn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Tn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Tn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Tn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Tn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Tn("span",{class:"action-icon block"})])))]):null,Tn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Tn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Tn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),q9e={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function $s(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const U9e=["data-custom-id"],V9e=["data-node-index","data-node-type"],fN="typewriter-simple-cursor-target",zH=Ri(rt(Fn(Nt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s(O){if(!(typeof Event<"u"&&O instanceof Event))return typeof O=="string"&&o("copy-code",O),void o("copy",O)}const r=hs(),l=Yt("markstreamNestedRendererProps",void 0);function a(O){const J=r?.vnode.props;return!!J&&(Object.prototype.hasOwnProperty.call(J,O)||Object.prototype.hasOwnProperty.call(J,String(O).replace(/[A-Z]/g,he=>`-${he.toLowerCase()}`)))}function u(O){var J,he;const me=i[O];return a(O)?me:(he=(J=l?.value)==null?void 0:J[O])!=null?he:me}const c=D(()=>{return(O=u("mode"))==="chat"||O==="minimal"||O==="docs"?O:"docs";var O}),d=D(()=>JL(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return(O={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":O.codeRenderer==="pre"||O.codeRenderer==="shiki"||O.codeRenderer==="monaco"?O.codeRenderer:O.renderCodeBlocksAsPre===!1||O.mode==="docs"?"monaco":"pre";var O}),g=D(()=>q9e[c.value]),v=D(()=>{var O;return(O=u("showTooltips"))!=null?O:g.value.showTooltips}),y=D(()=>{var O;return(O=u("fade"))!=null?O:g.value.fade}),b=D(()=>{var O;return(O=u("batchRendering"))!=null?O:g.value.batchRendering}),w=D(()=>{var O;return(O=u("initialRenderBatchSize"))!=null?O:g.value.initialRenderBatchSize}),C=D(()=>{var O;return(O=u("renderBatchSize"))!=null?O:g.value.renderBatchSize}),T=D(()=>{var O;return(O=u("renderBatchDelay"))!=null?O:g.value.renderBatchDelay}),N=D(()=>{var O;return(O=u("renderBatchBudgetMs"))!=null?O:g.value.renderBatchBudgetMs}),I=D(()=>{var O;return(O=u("renderBatchIdleTimeoutMs"))!=null?O:g.value.renderBatchIdleTimeoutMs}),S=D(()=>{var O;return(O=u("deferNodesUntilVisible"))!=null?O:g.value.deferNodesUntilVisible}),_=D(()=>{var O;return(O=u("maxLiveNodes"))!=null?O:g.value.maxLiveNodes}),x=D(()=>{var O;return(O=u("liveNodeBuffer"))!=null?O:g.value.liveNodeBuffer}),E=D(()=>{var O;return(O=u("nodeVirtual"))!=null?O:g.value.nodeVirtual}),M={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return v.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return y.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return w.value},get renderBatchSize(){return C.value},get renderBatchDelay(){return T.value},get renderBatchBudgetMs(){return N.value},get renderBatchIdleTimeoutMs(){return I.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return _.value},get liveNodeBuffer(){return x.value},get nodeVirtual(){return E.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function R(O){o("height-change",O)}function q(O){o("virtual-state-change",O)}function z(O){o("anchor-change",O)}const $=V(),B=V(null),P=V(null),H=V(null),j=ao({1:null,2:null,3:null,4:null,5:null,6:null}),G=V(!1),ne=new Map,W=V(0),Q=V(0),te=V({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function X(O,J){return typeof O!="string"?J:O.trim()||J}function ve(O){const J=Number(O);return Number.isFinite(J)&&J>0?Math.max(1,Math.trunc(J)):640}const ce=D(()=>{var O;const J=(O=M.viewportPriorityOptions)!=null?O:{},he=X(J.rootMargin,Eh);return{rootMargin:he,heavyBlockMargin:X(J.heavyBlockMargin,he),maxTargets:ve(J.maxTargets)}}),se=D(()=>{var O;return(O=ce.value.rootMargin)!=null?O:Eh}),pe=D(()=>{var O;return(O=ce.value.maxTargets)!=null?O:640});function Z(){var O,J;if(((O=i.virtualScroll)==null?void 0:O.enabled)!==!0)return null;const he=(J=i.virtualScroll)==null?void 0:J.scrollRoot;return ae(typeof he=="function"?he():he)}function ae(O){return O?typeof HTMLElement<"u"&&O instanceof HTMLElement?O:typeof O=="object"&&"value"in O?ae(O.value):typeof O=="object"&&"$el"in O?ae(O.$el):null:null}ii(AH,ce);const{isClient:K,renderAsFragment:re,debugPerformanceEnabled:we,resolvedShowTooltips:be,resolvedHtmlPolicy:ke,inheritedSmoothStreaming:oe,ownsTypewriterCursor:le}=(function(O){const J=typeof window<"u",he=q1(),me=Yt("markstreamHtmlPolicy",void 0),Le=Yt("markstreamTypewriterCursor",void 0),$e=Yt("markstreamSmoothStreaming",void 0),Ze=D(()=>O.renderAsFragment===!0),et=D(()=>!!(O.debugPerformance&&J&&typeof console<"u")),mt=D(()=>{var pt;if(typeof O.showTooltips=="boolean")return O.showTooltips;const Ge=(pt=he.showTooltips)!=null?pt:he["show-tooltips"];return Ge===""||Ge===!0||Ge==="true"||Ge!==!1&&Ge!=="false"&&void 0}),tt=D(()=>{var pt,Ge;return(Ge=(pt=O.htmlPolicy)!=null?pt:me?.value)!=null?Ge:"safe"}),ut=D(()=>Le?.value!==!0);return{isClient:J,renderAsFragment:Ze,debugPerformanceEnabled:et,resolvedShowTooltips:mt,resolvedHtmlPolicy:tt,inheritedSmoothStreaming:$e,inheritedTypewriterCursor:Le,ownsTypewriterCursor:ut}})(M),{resolveViewportRoot:ye,resolveScrollContainer:Ae,isReverseFlexScrollRoot:Me,getNormalizedScrollTop:fe,getOffsetTopWithinRoot:ie}=(function(O,J){function he(){var et,mt;return(mt=(et=J.scrollRoot)==null?void 0:et.call(J))!=null?mt:null}function me(et){if(typeof window>"u")return null;const mt=he();if(mt)return mt;const tt=et??O.value;if(!tt)return null;const ut=tt.ownerDocument||document,pt=ut.scrollingElement||ut.documentElement;let Ge=tt;for(;Ge&&Ge!==ut.body&&Ge!==pt;){if(P9e(window.getComputedStyle(Ge))&&z9e(Ge))return Ge;Ge=Ge.parentElement}return null}function Le(et){if(!J.isClient)return!1;try{const mt=window.getComputedStyle(et);return!!(mt.display||"").toLowerCase().includes("flex")&&(mt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function $e(et,mt,tt){var ut,pt;if(tt)return Ze(mt);const Ge=et.scrollTop;if(!Le(et))return Ge;const ct=Ge<0?-Ge:Ge;return Math.max(0,((ut=et.scrollHeight)!=null?ut:0)-((pt=et.clientHeight)!=null?pt:0))-ct}function Ze(et){var mt,tt,ut,pt,Ge;const ct=Number((mt=et.scrollingElement)==null?void 0:mt.scrollTop),xt=Number((ut=(tt=et.documentElement)==null?void 0:tt.scrollTop)!=null?ut:0),vt=Number((Ge=(pt=et.body)==null?void 0:pt.scrollTop)!=null?Ge:0);return Math.max(0,Number.isFinite(ct)?ct:0,Number.isFinite(xt)?xt:0,Number.isFinite(vt)?vt:0)}return{resolveViewportRoot:me,resolveScrollContainer:function(et){var mt,tt,ut,pt;const Ge=he();if(Ge)return Ge;const ct=me((mt=et??O.value)!=null?mt:null);if(ct)return ct;const xt=(pt=(ut=et?.ownerDocument)!=null?ut:(tt=O.value)==null?void 0:tt.ownerDocument)!=null?pt:typeof document<"u"?document:null;return xt?.scrollingElement||xt?.documentElement||null},isReverseFlexScrollRoot:Le,getNormalizedScrollTop:$e,getOffsetTopWithinRoot:function(et,mt){const tt=mt.ownerDocument||et.ownerDocument||document;if((function(ct,xt){return ct===xt.documentElement||ct===xt.body||ct===xt.scrollingElement})(mt,tt))return et.getBoundingClientRect().top+Ze(tt);const ut=mt.getBoundingClientRect(),pt=et.getBoundingClientRect(),Ge=$e(mt,tt,!1);return pt.top-ut.top+Ge}}})($,{isClient:K,scrollRoot:Z});ii("markstreamShowTooltips",be),ii("markstreamHtmlPolicy",ke),ii("markstreamTypewriter",f),ii("markstreamFade",D(()=>M.fade!==!1)),ii("markstreamTypewriterCursor",D(()=>!0)),ii("markstreamTextStreamState",ne),ii("markstreamStreamVersion",W),ii("markstreamParseOptions",D(()=>M.parseOptions)),ii("markstreamCustomMarkdownIt",D(()=>M.customMarkdownIt));const{smoothStreamingEnabled:Ee,renderContent:qe,requestedFinal:ze,effectiveFinal:ht}=(function(O,J){const he=O9e(Nt(Nt({},$9e),O.smoothStreamingOptions)),me=D(()=>{var Ge,ct,xt;return O.smoothStreaming!==!1&&!((Ge=O.nodes)!=null&&Ge.length)&&(O.smoothStreaming===!0||!((ct=J.inheritedSmoothStreaming)!=null&&ct.value))&&(O.smoothStreaming===!0||JL(O.typewriter)!=="off"||((xt=O.maxLiveNodes)!=null?xt:0)<=0)}),Le=V(!J.isClient||O.smoothStreaming===!0);kn(()=>{Le.value=!0});const $e=D(()=>Le.value&&me.value),Ze=D(()=>{var Ge;return $e.value?he.visible.value:(Ge=O.content)!=null?Ge:""}),et=D(()=>{var Ge,ct;const xt=(Ge=O.parseOptions)!=null?Ge:{};return(ct=O.final)!=null?ct:xt.final}),mt=D(()=>{const Ge=et.value;return $e.value&&Ge!=null?!!Ge&&he.caughtUp.value:Ge});let tt=0,ut=!1;function pt(){tt=0,ut=!1}return We([()=>O.content,()=>O.nodes,$e,et],([Ge,ct,xt,vt])=>{if(ct?.length)return pt(),void he.reset("");const Wt=Ge??"";if(!xt)return pt(),he.reset(Wt),void(vt&&he.finish({flush:!0}));const It=he.source.value;if(Wt){if(Wt!==It)if(Wt.startsWith(It)){const en=Wt.slice(It.length),cn=he.pendingChars.value;en.length<=8?(tt++,ut||tt>=2&&cn<=8?(ut=!0,he.reset(Wt)):he.enqueue(en)):(pt(),he.enqueue(en))}else pt(),he.reset(Wt)}else pt(),he.reset("");vt&&he.finish()},{immediate:!0}),{smoothStream:he,smoothStreamingEligible:me,smoothStreamingEnabled:$e,renderContent:Ze,requestedFinal:et,effectiveFinal:mt}})(M,{isClient:K,inheritedSmoothStreaming:oe}),gt=ze.value===!0;ii("markstreamSmoothStreaming",Ee);const _t=V(!1),$t=V(!1),jt=V(!1);let Ht="",Te=!1,Fe=null;function Ve(){K&&Fe!=null&&(window.clearTimeout(Fe),Fe=null)}function lt(){_t.value=!1,Ve()}function Ft(O,J){if(!we.value)return;const he=(function(){if(!we.value)return null;const me=it(Lt),Le=it(Vt),$e=Math.max(nn,Le);if(me<=0&&$e<=0)return null;const Ze={total:me,maxPerFrame:$e,byLabel:(et=Lt,Object.fromEntries(Array.from(et.entries()).sort((mt,tt)=>tt[1]-mt[1]||mt[0].localeCompare(tt[0]))))};var et;return Lt.clear(),Vt.clear(),nn=0,Ze})();console.info(`[markstream-vue][perf] ${O}`,he?Fn(Nt({},J),{layoutReads:he}):J)}We([()=>M.indexKey,()=>M.customId],()=>{var O,J;lt(),$t.value=!1,jt.value=!((O=i.nodes)!=null&&O.length)&&ze.value!==!0&&!!i.content,Ht=(J=qe.value)!=null?J:"",Te=Ht.length>0},{flush:"sync"}),We([()=>i.content,()=>i.nodes,ze],([O,J,he])=>{!J?.length&&he!==!0&&O&&(jt.value=!0)},{flush:"sync",immediate:!0}),We([qe,()=>i.nodes,ze],([O,J,he])=>{const me=O??"";return J?.length||he===!0?(lt(),$t.value=!1,Ht=me,void(Te=!0)):(me.length>0&&(jt.value=!0),Te?(Ht&&me.length>Ht.length&&me.startsWith(Ht)?(_t.value=!0,$t.value=!0,K&&(Ve(),Fe=window.setTimeout(()=>{var Le;Fe=null,ht.value===!0||(Le=i.nodes)!=null&&Le.length||(sp(),_t.value=!1,qu())},1200))):(me.length"u")return null;const $e=window;if($e.__markstreamLayoutReadPerformance)return $e.__markstreamLayoutReadPerformance;const Ze={total:0,maxPerFrame:0,byLabel:{}};return $e.__markstreamLayoutReadPerformance=Ze,Ze})();Le&&(Le.total=Number(Le.total||0)+1,Le.byLabel[me]=Number(Le.byLabel[me]||0)+1,Le.currentFrameTotal=Number(Le.currentFrameTotal||0)+1,Le.frameScheduled||(Le.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>At(Le),0):queueMicrotask(()=>At(Le)):window.requestAnimationFrame(()=>At(Le))))})(O),qt||(qt=!0,K&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(dt):typeof queueMicrotask!="function"?setTimeout(dt,0):queueMicrotask(dt)))}function Qt(O,J){return un(O),J()}const ei=M.customId?`renderer-${M.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,mi=(function(O){const J=new Map;return{scope:O,cache:J,clear:()=>J.clear()}})(ei),Hi=ei;ii(LH,mi);const wi=ms(()=>M.customId),{effectiveCustomHtmlTagsSet:Vo,mergedParseOptions:ot,parsedNodes:Ue,getParsedNodesDirtyStartIndex:st,getParsedNodesRevision:In}=B9e(M,{instanceMsgId:ei,renderContent:qe,effectiveFinal:ht,smoothStreamingEnabled:Ee,debugPerformanceEnabled:we,customComponentsMap:wi,logPerf:Ft});We(Ue,()=>{_t.value||mi.clear(),W.value+=1},{immediate:!0});const kt=D(()=>({customId:M.customId,customHtmlTags:ot.value.customHtmlTags,parseOptions:M.parseOptions,customMarkdownIt:M.customMarkdownIt,htmlPolicy:ke.value,viewportPriority:M.viewportPriority,viewportPriorityOptions:ce.value,mode:c.value,domMode:M.domMode,codeRenderer:m.value,codeBlockStream:M.codeBlockStream,codeBlockDarkTheme:M.codeBlockDarkTheme,codeBlockLightTheme:M.codeBlockLightTheme,codeBlockMonacoOptions:M.codeBlockMonacoOptions,renderCodeBlocksAsPre:M.renderCodeBlocksAsPre,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockProps:M.codeBlockProps,mermaidProps:M.mermaidProps,d2Props:M.d2Props,infographicProps:M.infographicProps,showTooltips:be.value,themes:M.themes,langs:M.langs,isDark:M.isDark,typewriter:f.value,smoothStreamingOptions:M.smoothStreamingOptions,parseCoalesceMs:M.parseCoalesceMs,fade:M.fade}));ii("markstreamNestedRendererProps",kt);const ui=D(()=>Ue.value),_o=D(()=>Ue.value.length),co=V(null),Ns=V(null),Ds=V(null),Fs=V(null),Fo=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Ei=!Fo&&M.customId?KL(M.customId):null,ur=D(()=>Ei?(x8.value,KL(M.customId)):null),Mo=D(()=>{var O;return!!(!re.value&&M.customId&&!Fo&&((O=ur.value)!=null&&O.enabled))}),go=D(()=>!!(K&&Mo.value)),fo=D(()=>{var O;return!!(!re.value&&((O=i.virtualScroll)!=null&&O.enabled))}),Ir=D(()=>fo.value),Bo=V(!1);kn(()=>{Bo.value=!0});const qn=D(()=>!!(K&&fo.value));ii("markstreamHostScrollManaged",qn);const to=D(()=>!!(Bo.value&&qn.value)),fi=D(()=>go.value||qn.value),Zi=D(()=>go.value||to.value),no=D(()=>{var O;return fi.value&&((O=ur.value)==null?void 0:O.textEstimation)!==!1});function Ko(){const O=Q.value||Qt("getMeasuredContainerWidth.clientWidth",()=>{var J;return((J=$.value)==null?void 0:J.clientWidth)||0});return Number.isFinite(O)&&O>0?O:0}const ri=D(()=>{const O=Ko();return O>0?Math.max(1,Math.round(O)):640}),Li=D(()=>{var O,J;return!(ht.value!==!0||fo.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(O=i.nodes)!=null&&O.length||jt.value||!(((J=M.maxLiveNodes)!=null?J:0)<=0))}),Mi=D(()=>{var O;return Li.value?50:Math.max(1,(O=M.maxLiveNodes)!=null?O:320)}),Ni=D(()=>{var O;return Li.value?16:Math.max(0,(O=M.liveNodeBuffer)!=null?O:60)}),_n=D(()=>{var O;return!re.value&&M.nodeVirtual!==!1&&!(((O=M.maxLiveNodes)!=null?O:0)<=0&&!Li.value)&&(M.nodeVirtual===!0?Ue.value.length>0:Ue.value.length>Mi.value)}),gs=D(()=>_n.value||go.value||qn.value),qs=D(()=>M.viewportPriority!==!1),Xo=D(()=>!!qs.value&&!G.value);var Us;Us=D(()=>qs.value),ii(xH,Us);const vo=D(()=>{var O;return!(re.value||M.deferNodesUntilVisible===!1||((O=M.maxLiveNodes)!=null?O:0)<=0||_n.value||Ue.value.length>900||M.viewportPriority===!1)}),Ji=g2e(O=>{var J;return ye((J=O??$.value)!=null?J:null)},qs),{requestFrame:Oi,cancelFrame:$i,hasIdleCallback:je,isTestEnv:Se}=(function(O){const J=O.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,he=O.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,me=O.isClient&&typeof window.requestIdleCallback=="function",Le=(function(){var $e;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ze=($e=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:$e.value;return Ze?.env})();return{requestFrame:J,cancelFrame:he,hasIdleCallback:me,isTestEnv:Le?.NODE_ENV==="test"}})({isClient:K}),Pe=D(()=>ht.value===!0&&!fo.value),{resolvedBatchSize:on,resolvedInitialBatch:Zn,batchingEnabled:Gn,incrementalRenderingActive:Xi,renderedCount:ti,previousRenderContext:vs,adaptiveBatchSize:ys,previousBatchConfig:Je}=(function(O,J){var he;const me=D(()=>{var pt;const Ge=Math.trunc((pt=O.renderBatchSize)!=null?pt:80);return Number.isFinite(Ge)?Math.max(0,Ge):0}),Le=D(()=>{var pt;const Ge=Math.trunc((pt=O.initialRenderBatchSize)!=null?pt:me.value);return Number.isFinite(Ge)?Math.max(0,Ge):me.value}),$e=D(()=>!J.renderAsFragment.value&&O.batchRendering!==!1&&me.value>0&&J.isClient&&!J.isTestEnv),Ze=V(0),et=V({key:O.indexKey,total:0}),mt=V(Math.max(1,me.value||1)),tt=D(()=>{var pt,Ge,ct;return $e.value&&!((pt=J.continuousStreaming)!=null&&pt.value)&&!((Ge=J.forceFullRenderFinalContent)!=null&&Ge.value)&&((ct=O.maxLiveNodes)!=null?ct:0)<=0}),ut=V({batchSize:me.value,initial:Le.value,delay:(he=O.renderBatchDelay)!=null?he:16,enabled:tt.value});return{resolvedBatchSize:me,resolvedInitialBatch:Le,batchingEnabled:$e,incrementalRenderingActive:tt,renderedCount:Ze,previousRenderContext:et,adaptiveBatchSize:mt,previousBatchConfig:ut}})(M,{isClient:K,isTestEnv:Se,renderAsFragment:re,forceFullRenderFinalContent:Pe,continuousStreaming:D(()=>$t.value&&ht.value!==!0)}),Ye=D(()=>{var O;return!re.value&&M.batchRendering!==!1&&on.value>0&&!Se&&((O=M.maxLiveNodes)!=null?O:0)<=0&&!Pe.value}),wt=D(()=>Ye.value),Bt=D(()=>fi.value||wt.value),Bn=D(()=>{var O;return Bt.value&&((O=ur.value)==null?void 0:O.codeBlockEstimation)!==!1}),ci=new Map,Ro=new Map,yo=new WeakMap;let ni=null;const Oo=new WeakMap,gi=new Map,cr=[];let $o=[],ko=[],Bs=-1;const Vs=Ya(cr),ks=new Set,Al=V(0);let Yr=0;const Zl=V(0),_a=D(()=>(Zl.value,Array.from(ci.entries()).sort((O,J)=>O[0]-J[0]))),Gl=V(null),Zo=V(null);let Tr,dr=null,tu=0,xl=null;function bo(){Tr.markFallbackHeightPrefixDirty()}function Sl(O){return Tr.getFallbackNodeHeight(O)}function Rs(O,J){return Tr.estimateHeightRange(O,J)}function bs(O){return Tr.estimateIndexForOffset(O)}const{activeRestoreAnchor:ho,getRelativeScrollTopWithinContainer:_l,setRelativeScrollTopWithinContainer:Ml,resolveAnchorOffset:Ql,clearRestoreReconcile:Il,scheduleRestoreReconcile:fr,captureRestoreAnchor:nu,restoreAnchor:Yl,getAnchorDrift:ju}=(function(O){const{isClient:J,containerRef:he,parsedNodeCount:me,requestFrame:Le,cancelFrame:$e,resolveScrollContainer:Ze,getNormalizedScrollTop:et,getOffsetTopWithinRoot:mt,isReverseFlexScrollRoot:tt,estimateIndexForOffset:ut,estimateHeightRange:pt,getFallbackNodeHeight:Ge,clamp:ct}=O,xt=V(null);let vt=null,Wt=[];function It(){const An=Ze(),zn=he.value;if(!An||!zn)return null;const Jn=An.ownerDocument||zn.ownerDocument||document;if(An===Jn.documentElement||An===Jn.body||An===Jn.scrollingElement){const Wi=zn.getBoundingClientRect();return Math.max(0,-Wi.top)}return Math.max(0,et(An,Jn,!1)-mt(zn,An))}function en(An){var zn;const Jn=Ze(),Wi=he.value;if(!Jn||!Wi)return;const Qs=Math.max(0,An),Os=Jn.ownerDocument||Wi.ownerDocument||document,Ta=Os.defaultView||(typeof window<"u"?window:null);if(Jn===Os.documentElement||Jn===Os.body||Jn===Os.scrollingElement){const ou=et(Jn,Os,!0)+Wi.getBoundingClientRect().top;return void((zn=Ta?.scrollTo)==null||zn.call(Ta,0,Math.max(0,ou+Qs)))}QL(Jn,Os,mt(Wi,Jn)+Qs,{isReverseFlexScrollRoot:ou=>{var Im;return(Im=tt?.(ou))!=null&&Im},getNormalizedScrollTop:et})}function cn(An){const zn=me.value,Jn=ct(An.nodeIndex,0,Math.max(0,zn-1));return pt(0,Jn)+Math.max(0,An.offsetWithinNodePx)}function Cn(){if(vt!=null&&($e?.(vt),vt=null),J)for(const An of Wt)window.clearTimeout(An);Wt=[]}function vn(An){const zn=cn(An),Jn=It();Jn!=null&&Math.abs(Jn-zn)<=.5||en(zn)}return{activeRestoreAnchor:xt,getRelativeScrollTopWithinContainer:It,setRelativeScrollTopWithinContainer:en,resolveAnchorOffset:cn,clearRestoreReconcile:Cn,applyRestoreAnchor:vn,scheduleRestoreReconcile:function(){xt.value&&J&&vt==null&&(vt=Le?Le(()=>{vt=null,xt.value&&vn(xt.value)}):null,vt==null&&xt.value&&vn(xt.value))},captureRestoreAnchor:function(){const An=It(),zn=me.value;if(An==null||zn<=0)return null;const Jn=ct(ut(An+1),0,zn-1),Wi=pt(0,Jn),Qs=Ge(Jn);return{nodeIndex:Jn,offsetWithinNodePx:ct(An-Wi,0,Math.max(0,Qs-1))}},restoreAnchor:function(An){const zn=me.value;if(xt.value={nodeIndex:ct(An.nodeIndex,0,Math.max(0,zn-1)),offsetWithinNodePx:Math.max(0,An.offsetWithinNodePx)},Cn(),vn(xt.value),J)for(const Jn of[0,120,280,480])Wt.push(window.setTimeout(()=>{xt.value&&vn(xt.value)},Jn))},getAnchorDrift:function(An){const zn=It();return zn==null?null:zn-cn(An)}}})({isClient:K,containerRef:$,parsedNodeCount:_o,requestFrame:Oi,cancelFrame:$i,resolveScrollContainer:()=>Gl.value||Ae(),getNormalizedScrollTop:fe,getOffsetTopWithinRoot:ie,isReverseFlexScrollRoot:Me,estimateIndexForOffset:bs,estimateHeightRange:Rs,getFallbackNodeHeight:Sl,clamp:Gs}),{nodeHeights:Y,heightStats:ge,heightTreeSize:Be,heightSumTree:He,heightKnownTree:Qe,averageNodeHeight:Xe,resetHeightMeasurements:yt,pruneHeightMeasurements:Rt,rebuildHeightTrees:Kt,recordNodeHeight:wn,removeNodeHeights:Sn,exportHeightCache:Un,importHeightCache:mn,fenwickRangeSum:fn}=(function(O={}){const J=ao({}),he=ao({total:0,count:0}),me=V(0),Le=V([]),$e=V([]);function Ze(){for(const Ge of Object.keys(J))delete J[Number(Ge)];he.total=0,he.count=0,me.value=0,Le.value=[],$e.value=[]}function et(Ge,ct,xt){for(let vt=ct+1;vt0;vt-=vt&-vt)xt+=Ge[vt];return xt}function tt(Ge){me.value=Ge;const ct=new Array(Ge+1).fill(0),xt=new Array(Ge+1).fill(0);for(const[vt,Wt]of Object.entries(J)){const It=Number(vt),en=Number(Wt);!Number.isFinite(It)||It<0||It>=Ge||!Number.isFinite(en)||en<=0||(et(ct,It,en),et(xt,It,1))}Le.value=ct,$e.value=xt}function ut(Ge){if(!Number.isInteger(Ge)||Ge<0)return!1;const ct=J[Ge];if(!Number.isFinite(ct)||ct<=0)return!1;if(delete J[Ge],he.total=Math.max(0,he.total-ct),he.count=Math.max(0,he.count-1),me.value>Ge){const xt=Le.value,vt=$e.value;xt.length&&vt.length&&(et(xt,Ge,-ct),et(vt,Ge,-1))}return!0}const pt=D(()=>he.count>0?Math.max(12,he.total/he.count):32);return{nodeHeights:J,heightStats:he,heightTreeSize:me,heightSumTree:Le,heightKnownTree:$e,averageNodeHeight:pt,resetHeightMeasurements:Ze,pruneHeightMeasurements:function(Ge){if(Ge<=0)return void Ze();let ct=0,xt=0;for(const[vt,Wt]of Object.entries(J)){const It=Number(vt),en=Number(Wt);!Number.isFinite(It)||It<0||It>=Ge||!Number.isFinite(en)||en<=0?delete J[It]:(ct+=en,xt++)}he.total=ct,he.count=xt},rebuildHeightTrees:tt,recordNodeHeight:function(Ge,ct,xt={}){(function(vt,Wt,It={}){var en;if(!Number.isFinite(Wt)||Wt<=0)return!1;const cn=J[vt];if(cn&&(It.allowShrink===!1&&Wtvt){const Cn=Le.value,vn=$e.value;if(Cn.length&&vn.length)if(cn){const An=Wt-cn;An!==0&&et(Cn,vt,An)}else et(Cn,vt,Wt),et(vn,vt,1)}It.notify!==!1&&((en=O.onHeightRecorded)==null||en.call(O))})(Ge,ct,Fn(Nt({},xt),{notify:!0}))},removeNodeHeight:function(Ge,ct={}){var xt;const vt=ut(Ge);return vt&&ct.notify!==!1&&((xt=O.onHeightRecorded)==null||xt.call(O)),vt},removeNodeHeights:function(Ge,ct={}){var xt;let vt=0;for(const Wt of Ge)ut(Number(Wt))&&vt++;return vt>0&&ct.notify!==!1&&((xt=O.onHeightRecorded)==null||xt.call(O)),vt},exportHeightCache:function(){return Object.entries(J).map(([Ge,ct])=>({index:Number(Ge),height:Number(ct)})).filter(Ge=>Number.isFinite(Ge.index)&&Ge.index>=0&&Number.isFinite(Ge.height)&&Ge.height>0).sort((Ge,ct)=>Ge.index-ct.index)},importHeightCache:function(Ge,ct={}){var xt;if(!Array.isArray(Ge))return;const vt=me.value;let Wt=!1;if(ct.mode!=="merge"){const It=Object.keys(J);if(It.length>0){for(const en of It)delete J[Number(en)];Wt=!0}}for(const It of Ge){const en=Number(It.index),cn=Number(It.height);if(!Number.isInteger(en)||en<0||vt>0&&en>=vt||!Number.isFinite(cn)||cn<=0)continue;const Cn=J[en];Cn&&Math.abs(Cn-cn)<=1||(J[en]=cn,Wt=!0)}Wt&&((function(){let It=0,en=0;const cn=me.value;for(const[Cn,vn]of Object.entries(J)){const An=Number(Cn),zn=Number(vn);!Number.isFinite(An)||An<0||cn>0&&An>=cn||!Number.isFinite(zn)||zn<=0?delete J[An]:(It+=zn,en++)}he.total=It,he.count=en})(),vt>0&&tt(vt),(xt=O.onHeightRecorded)==null||xt.call(O))},fenwickRangeSum:function(Ge,ct,xt){if(xt<=ct)return 0;const vt=mt(Ge,xt-1);return ct<=0?vt:vt-mt(Ge,ct-1)}}})({onHeightRecorded:()=>{bo(),qn.value&&Cm(),ho.value&&fr(),Zo.value&&np(),oo("node-resize")}});function Qn(O){Number.isInteger(O)&&O>=0&&ks.add(O)}function On(O){for(const J of O)Qn(Number(J))}function Ci(O){Yr++;let J=!0;try{const he=O();return J=he!==!1,he}finally{Yr--,Yr===0&&J&&Al.value++}}function io(){$o=[],ko=[],Bs=-1,ks.clear(),Vs.value=cr}function hr(){io(),Ci(()=>yt()),gi.clear()}function Fc(O){!Number.isInteger(O)||O<0||O>=Ue.value.length||gi.set(O,dm(O))}function Jl(O,J,he={}){const me=Y[O];Qn(O),wn(O,J,he);const Le=Y[O];return Object.is(me,Le)?(ks.delete(O),!1):(Le&&Le>0?Fc(O):me&&gi.delete(O),!0)}function Tl(O,J){const he=Qt("getNodeLayoutHeight.slot.offsetHeight",()=>{var me,Le;return(Le=(me=ci.get(O))==null?void 0:me.offsetHeight)!=null?Le:0});return he>0?he:Qt("getNodeLayoutHeight.content.offsetHeight",()=>J.offsetHeight)}function Ie(O,J={}){J.mode!=="merge"?io():On(O.map(he=>he.index)),Ci(()=>mn(O,J)),Wb()}const Ne=D(()=>vo.value&&Xo.value),nt=D(()=>{var O;return!re.value&&M.batchRendering!==!1&&on.value>0&&((O=M.maxLiveNodes)!=null?O:0)<=0}),Pt=D(()=>!re.value&>&&ht.value===!0&&!_n.value&&!fo.value&&!Mo.value&&!Ne.value&&!nt.value),ln=D(()=>!!Ji&&Ne.value),Dn=D(()=>_n.value||qn.value),{focusIndex:Yn,liveRange:jn,updateLiveRange:po}=(function(O,J){const{parsedNodeCount:he,virtualizationEnabled:me,maxLiveNodesResolved:Le,liveNodeBufferResolved:$e,clamp:Ze}=J,et=$e??D(()=>{var ut;return Math.max(0,(ut=O.liveNodeBuffer)!=null?ut:60)}),mt=V(0),tt=ao({start:0,end:0});return{liveNodeBufferResolved:et,focusIndex:mt,liveRange:tt,updateLiveRange:function(){const ut=he.value;if(!me.value||ut===0)return tt.start=0,void(tt.end=ut);const pt=Math.min(Le.value,ut),Ge=et.value,ct=Ze(mt.value-Ge,0,Math.max(0,ut-pt));tt.start=ct,tt.end=Math.min(ut,ct+pt)}}})(M,{parsedNodeCount:_o,virtualizationEnabled:_n,maxLiveNodesResolved:Mi,liveNodeBufferResolved:Ni,clamp:Gs}),ws=new Map,Xl=new Map,Ma=new Map,pf=[],ea=new Map,iu=new Set,am=V(0);let mf=!1;const Hu=D(()=>(am.value,iu.size)),Er=new Map,Ks=new Map,jv=V(0),Gh=D(()=>{jv.value;let O=0;for(const J of Er.values())O+=Math.max(0,J);return O});let Lr=null;const gf=D(()=>{if(!_n.value)return Ue.value.length;const O=Ni.value,J=Math.max(jn.end+O,Zn.value),he=Math.min(Ue.value.length,J);return Math.max(ti.value,he)});function _e(){mf||(mf=!0,queueMicrotask(()=>{mf=!1,am.value+=1}))}function at(O,J,he="node-resize"){if(!K||typeof window>"u")return null;const me=window.setTimeout(()=>{iu.delete(me)&&_e();try{J()}finally{oo(he)}},Math.max(0,O));return iu.add(me),_e(),me}function Ke(O){K&&O!=null&&(iu.delete(O)&&_e(),window.clearTimeout(O))}function bt(){if(K&&typeof window<"u")for(const O of iu)window.clearTimeout(O);iu.size&&(iu.clear(),_e()),pf.length=0,Ma.clear()}function Jt(O){B.value=O}function gn(O){P.value=O}function En(O){H.value=O}const{cancelScheduledFocusSync:Vn,scheduleFocusSync:pn}=(function(O){const{isClient:J,containerRef:he,virtualizationEnabled:me,requestFrame:Le,cancelFrame:$e,syncFocusToScroll:Ze}=O;let et=null;function mt(){var ut,pt,Ge;return(Ge=(pt=(ut=he.value)==null?void 0:ut.ownerDocument)==null?void 0:pt.defaultView)!=null?Ge:typeof window<"u"?window:null}function tt(){if(!et)return;const ut=mt();et.viaTimeout?ut?ut.clearTimeout(et.id):clearTimeout(et.id):$e?.(et.id),et=null}return{cancelScheduledFocusSync:tt,scheduleFocusSync:function(ut={}){if(!me.value)return;if(!J)return void Ze(!0);if(ut.immediate)return tt(),void Ze(!0);if(et)return;const pt=()=>{et=null,Ze()};if(Le)return void(et={id:Le(pt),viaTimeout:!1});const Ge=mt();et={id:Ge?Ge.setTimeout(pt,16):setTimeout(pt,16),viaTimeout:!0}}}})({isClient:K,containerRef:$,virtualizationEnabled:_n,requestFrame:Oi,cancelFrame:$i,syncFocusToScroll:function(O=!1){var J;if(!_n.value)return;const he=Gl.value||Ae();if(!he)return;const me=he.ownerDocument||((J=$.value)==null?void 0:J.ownerDocument)||document,Le=me?.defaultView||(typeof window<"u"?window:null),$e=he===me?.documentElement||he===me?.body,Ze=Ue.value.length;if(Ze<=0)return;if(!$e&&Ze>0&&Me(he)){const vt=Qt("syncFocusToScroll.clientHeight",()=>he.clientHeight||0),Wt=Qt("syncFocusToScroll.scrollTop",()=>he.scrollTop),It=Wt<0?-Wt:Wt;return void Hv(Gs((et=Math.max(0,It)+.5*Math.max(0,vt),Tr.estimateIndexForOffsetFromEnd(et)),0,Math.max(0,Ze-1)),O)}var et;const mt=(function(vt,Wt,It,en){const cn=$.value;if(!cn)return null;const Cn=en?0:Qt("syncFocusToScroll.model.root.getBoundingClientRect",()=>vt.getBoundingClientRect().top),vn=Qt("syncFocusToScroll.model.container.getBoundingClientRect",()=>cn.getBoundingClientRect().top),An=Math.max(0,Cn-vn),zn=en?Qt("syncFocusToScroll.model.viewport.clientHeight",()=>{var Jn,Wi,Qs,Os;return(Os=(Qs=(Wi=It?.innerHeight)!=null?Wi:(Jn=Wt.documentElement)==null?void 0:Jn.clientHeight)!=null?Qs:vt.clientHeight)!=null?Os:0}):Qt("syncFocusToScroll.model.root.clientHeight",()=>vt.clientHeight);return Gs(bs(An+.5*Math.max(0,zn)),0,Math.max(0,Ue.value.length-1))})(he,me,Le,$e);if(mt!=null)return void Hv(mt,O);const tt=$e?null:Qt("syncFocusToScroll.root.getBoundingClientRect",()=>he.getBoundingClientRect()),ut=$e?0:tt.top,pt=$e?Qt("syncFocusToScroll.viewport.clientHeight",()=>{var vt,Wt;return(Wt=(vt=Le?.innerHeight)!=null?vt:he.clientHeight)!=null?Wt:0}):tt.bottom,Ge=_a.value;let ct=null,xt=null;for(const[vt,Wt]of Ge){if(!Wt)continue;const It=Qt("syncFocusToScroll.slot.getBoundingClientRect",()=>Wt.getBoundingClientRect());It.bottom<=ut||It.top>=pt||(ct==null&&(ct=vt),xt=vt)}if(ct==null||xt==null){const vt=$.value;if(!vt)return;const Wt=$e?{top:0}:Qt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>he.getBoundingClientRect()),It=Qt("syncFocusToScroll.fallback.scrollTop",()=>fe(he,me,$e)),en=$e?(()=>{const Cn=Qt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>vt.getBoundingClientRect()),vn=($e?0:Wt.top)-Cn.top;return Math.max(0,vn)})():(()=>{const Cn=ie(vt,he);return Math.max(0,It-Cn)})(),cn=$e?Qt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Cn,vn,An,zn;return(zn=(An=(vn=Le?.innerHeight)!=null?vn:(Cn=me?.documentElement)==null?void 0:Cn.clientHeight)!=null?An:he.clientHeight)!=null?zn:0}):Qt("syncFocusToScroll.fallback.root.clientHeight",()=>he.clientHeight);return void Hv(Gs(bs(en+.5*Math.max(0,cn)),0,Math.max(0,Ue.value.length-1)),!0)}Hv(Math.round((ct+xt)/2),O)}}),{visibleNodeIndices:eo,nodeVisibilityHandles:Cs,nodeVisibilityWatchStops:Zs,nodeVisibilityFallbackTimers:Ia,clearVisibilityFallback:ta,markNodeVisible:Jr,cleanupNodeVisibility:GZ,destroyNodeVisibilityState:bb}=R9e({isClient:K,shouldTrackVisibleNodeIndices:()=>Ne.value,shouldCleanupNodeVisibility:()=>_n.value,onNodeMarkedVisible:O=>{_n.value?pn():Yn.value=Gs(O,0,Math.max(0,Ue.value.length-1))},onNodeVisibilityCleaned:O=>{ci.delete(O)&&t_()}}),{cleanupScrollListener:IS,setupScrollListener:QZ}=(function(O){const{isClient:J,virtualizationEnabled:he,listenerEnabled:me,scrollRootElement:Le,resolveScrollContainer:$e,scheduleFocusSync:Ze,onScroll:et}=O;let mt=null,tt=null;function ut(){mt&&(mt(),mt=null),tt=null,Le.value=null}function pt(Ge){const ct=O.getScrollTop?O.getScrollTop(Ge):Ge.scrollTop;return Math.max(0,Number.isFinite(ct)?Math.abs(ct):0)}return{cleanupScrollListener:ut,setupScrollListener:function(){if(!J)return;if(!((Ge=me?.value)!=null?Ge:he.value))return void ut();var Ge;const ct=$e();if(!ct)return void ut();if(Le.value===ct&&mt)return;ut(),tt=pt(ct);const xt=()=>{if(et?.(),he.value){const vt=(function(Wt){const It=pt(Wt),en=tt;tt=It;const cn=Math.max(480,.75*(Wt.clientHeight||0));return en==null?It>cn?{immediate:!0}:void 0:Math.abs(It-en)>cn?{immediate:!0}:void 0})(ct);vt?Ze(vt):Ze()}};ct.addEventListener("scroll",xt,{passive:!0}),Le.value=ct,mt=()=>{ct.removeEventListener("scroll",xt)}}}})({isClient:K,virtualizationEnabled:_n,listenerEnabled:Dn,scrollRootElement:Gl,resolveScrollContainer:Ae,scheduleFocusSync:pn,onScroll:function(){const O=Zo.value;if(!O)return;const J=cm();if(!J||(function(me){if(gm()>=tu)return xl=null,!1;const Le=xl;if(Le==null)return!0;const $e=Math.abs(me.scrollTop-Le)<=2;return $e||(xl=null),$e})(J))return;const he=WS(J);he!=null?(he<-32||Math.abs(Math.max(0,he)-Math.max(0,O.distanceFromBottomPx))>32)&&tp("restore"):tp("restore")},getScrollTop:O=>{var J;const he=O.ownerDocument||((J=$.value)==null?void 0:J.ownerDocument)||document,me=O===he.documentElement||O===he.body||O===he.scrollingElement;return Qt("scrollListener.getScrollTop",()=>fe(O,he,me))}});function Hv(O,J=!1){const he=Gs(O,0,Math.max(0,Ue.value.length-1));!J&&Math.abs(he-Yn.value)<=1||(Yn.value=he,po())}function Gs(O,J,he){return Math.min(Math.max(O,J),he)}function wb(O=Ue.value.length){const J=st();return!Number.isInteger(J)||J<0?O:Gs(J,0,O)}function Cb(O){return O?.firstElementChild}function TS(O,J){var he;return O?(he=O.matches)!=null&&he.call(O,J)?O:O.querySelector(J):null}function YZ(O,J){O<1||O>6||(j[O]=J)}function ES(){if(!fi.value)return void(Q.value=0);const O=Qt("updateExperimentContainerWidth.clientWidth",()=>{var J,he;return(he=(J=$.value)==null?void 0:J.clientWidth)!=null?he:0});Q.value=O>0?O:0}let um=null;function Ab(){um?.disconnect(),um=null}const LS=dg("ViewportDeferredMarkdownCodeBlockNode",Cu({loader:()=>ro(null,null,function*(){return(yield Jo(()=>import("./index5-CfzaNIoE.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:l4,delay:0,suspensible:!1}),l4);function NS(O){return O===LS}const DS=D(()=>m.value==="pre"?sl:m.value==="shiki"?LS:y8);function FS(){var O;return((O=M.codeBlockProps)==null?void 0:O.showHeader)!==!1}function BS(O,J,he){const me=Y[J],Le=typeof me=="number"&&me>0;if(no.value&&!Le&&!(function($e){return!!wi.value.paragraph&&($e.type==="paragraph"||$e.type==="list_item"||$e.type==="list")})(O)){const $e=EH(O,he,te.value);if($e)return $e}if(Bn.value&&O.type==="code_block"){const $e=(function(Ze){if(Ze.type!=="code_block")return null;const et=h_(Ze,Jv(Ze));return NS(et)?"markdown":et===sl?"pre":et===DS.value||et===y8?"monaco":null})(O);if($e==="monaco"||$e==="markdown"||$e==="pre")return(function(Ze,et){var mt,tt,ut;if(!Ze||Ze.type!=="code_block")return null;const pt=et.rendererKind,Ge=pt!=="pre"&&et.showHeader!==!1,ct=!!Ze.diff;let xt=0,vt=500;if(pt==="monaco"){const It=(mt=et.monacoOptions)!=null?mt:{},en=M8(Ze,It,et.width),cn=(function(vn){const An=typeof vn?.fontSize=="number"&&vn.fontSize>0?vn.fontSize:12;return typeof vn?.lineHeight=="number"&&vn.lineHeight>0?vn.lineHeight:Math.round(1.5*An)})(It),Cn=(function(vn,An){var zn,Jn;const Wi=typeof((zn=vn?.padding)==null?void 0:zn.top)=="number"?vn.padding.top:An?0:8,Qs=typeof((Jn=vn?.padding)==null?void 0:Jn.bottom)=="number"?vn.padding.bottom:An?0:8;return Math.max(0,Wi)+Math.max(0,Qs)})(It,ct);vt=typeof It.MAX_HEIGHT=="number"&&It.MAX_HEIGHT>0?It.MAX_HEIGHT:500,xt=Math.round(en*cn+Cn)}else if(pt==="markdown"){const It=M8(Ze);xt=Math.round(21*It+32)}else{const It=M8(Ze);xt=Math.round(28*It),vt=Number.POSITIVE_INFINITY}const Wt=Math.max(1,Math.min(xt,vt));return Nt({kind:"code-block",height:Math.round(Wt+(Ge?40:0)),contentHeight:Wt,rendererKind:pt},ct&&pt==="monaco"?{diffInline:S7((tt=et.monacoOptions)!=null?tt:{},(ut=et.width)!=null?ut:0)}:{})})(O,{rendererKind:$e,monacoOptions:M.codeBlockMonacoOptions,showHeader:FS(),width:he})}return null}p0(()=>{if(Al.value,Yr>0)return;const O=Ue.value,J=In();if(!O.length||!Bt.value)return $o=[],ko=[],Bs=-1,ks.clear(),void(Vs.value=cr);const he=Q.value||Qt("estimatedNodeHeights.clientWidth",()=>{var tt;return((tt=$.value)==null?void 0:tt.clientWidth)||0});if(!Number.isFinite(he)||he<=0)return $o=[],ko=[],Bs=-1,ks.clear(),void(Vs.value=cr);const me=(function(tt){return[Math.round(tt),no.value,Bn.value,te.value,M.codeBlockMonacoOptions,FS(),m.value,wi.value,x8.value]})(he),Le=$o.length<=O.length&&(Ze=me,($e=ko).length===Ze.length&&$e.every((tt,ut)=>Object.is(tt,Ze[ut])));var $e,Ze;const et=Le&&Bs===J?O.length:Le?wb(O.length):0,mt=Le?Array.from(ks):[];$o.length=O.length;for(let tt=et;tt=0&&ttVs.value);Tr=(function(O){let J=!0,he=[0],me="";function Le(ut){var pt;const Ge=O.nodeHeights[ut];if(Number.isFinite(Ge)&&Ge>0)return Ge;const ct=O.parsedNodes.value[ut],xt=ct?.type,vt=!!((pt=O.hasCustomParagraphComponent)!=null&&pt.call(O)),Wt=O.estimatedNodeHeights.value[ut],It=Wt?.height;if(!(function(cn,Cn,vn){return!!(vn&&Cn?.kind==="simple-text"&&(cn==="paragraph"||cn==="list_item"||cn==="list"))})(xt,Wt,vt)&&Number.isFinite(It)&&It>0)return It;const en=x9e(ct,O.getContainerWidth()||640);return xt==="heading"||xt==="paragraph"&&en<=28&&(function(cn,Cn){if(Cn)return!1;const vn=cn.children;return!Array.isArray(vn)||!vn.length||vn.every(NH)})(ct,vt)?en:Math.max(O.averageNodeHeight.value,en)}function $e(){var ut;const pt=O.parsedNodes.value.length,Ge=O.getPrefixCacheKeyParts().join(":");if(!J&&me===Ge)return he;const ct=new Array(pt+1);ct[0]=0;for(let xt=0;xt=((pt=xt[ct])!=null?pt:0))return ct-1;let vt=0,Wt=ct-1,It=ct-1;for(;vt<=Wt;){const en=vt+Wt>>1;((Ge=xt[en+1])!=null?Ge:0)>=ut?(It=en,Wt=en-1):vt=en+1}return It}function et(ut,pt){var Ge,ct;if(ut>=pt)return 0;if(O.heightEstimationActive.value)return(function(Wt,It){var en,cn;const Cn=O.parsedNodes.value.length,vn=XL(Math.trunc(Wt),0,Cn),An=XL(Math.trunc(It),vn,Cn);if(vn>=An)return 0;const zn=$e();return((en=zn[An])!=null?en:0)-((cn=zn[vn])!=null?cn:0)})(ut,pt);if(O.heightTreeSize.value!==O.parsedNodes.value.length){let Wt=0;for(let It=ut;Itvn<=0?0:O.fenwickRangeSum(vt,0,vn)+(vn-O.fenwickRangeSum(Wt,0,vn))*xt;let en=0,cn=Ge.length-1,Cn=Ge.length-1;for(;en<=cn;){const vn=en+cn>>1;It(vn+1)>=ut?(Cn=vn,cn=vn-1):en=vn+1}return Cn}let ct=ut;for(let xt=0;xt0||ut++}return ut}return{markFallbackHeightPrefixDirty:function(){J=!0},getFallbackNodeHeight:Le,estimateHeightRange:et,estimateIndexForOffset:mt,estimateIndexForOffsetFromEnd:function(ut){var pt,Ge;const ct=O.parsedNodes.value;if(!ct.length)return 0;if(ut<=0)return Math.max(0,ct.length-1);if(O.heightEstimationActive.value){const vt=(pt=$e()[ct.length])!=null?pt:0;return Ze(Math.max(0,vt-ut))}if(O.heightTreeSize.value===ct.length){const vt=et(0,ct.length);return mt(Math.max(0,vt-ut))}let xt=ut;for(let vt=ct.length-1;vt>=0;vt--){const Wt=(Ge=O.nodeHeights[vt])!=null?Ge:O.averageNodeHeight.value;if(xt<=Wt)return vt;xt-=Wt}return 0},getEstimatedNodeHeightCount:tt,buildVirtualHeightSummary:function(ut){var pt;const Ge=O.parsedNodes.value.length;return{totalNodes:Ge,measuredCount:O.heightStats.count,estimatedCount:tt(),averageNodeHeight:O.averageNodeHeight.value,topSpacerHeight:ut.topSpacerHeight,bottomSpacerHeight:ut.bottomSpacerHeight,estimatedTotalHeight:et(0,Ge),width:(pt=ut.width)!=null?pt:O.getContainerWidth()}}}})({parsedNodes:Ue,nodeHeights:Y,heightStats:ge,heightTreeSize:Be,heightSumTree:He,heightKnownTree:Qe,averageNodeHeight:Xe,heightEstimationActive:fi,estimatedNodeHeights:Qh,getContainerWidth:Ko,hasCustomParagraphComponent:()=>!!wi.value.paragraph,getPrefixCacheKeyParts:()=>{var O;const J=Hm(Q.value||Qt("getFallbackHeightPrefix.clientWidth",()=>{var me;return((me=$.value)==null?void 0:me.clientWidth)||0})),he=((O=i.virtualScroll)==null?void 0:O.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Ue.value.length,ge.count,Math.round(ge.total),Math.round(100*Xe.value),he,J,fi.value?1:0,x8.value,W.value,wi.value.paragraph?1:0]},fenwickRangeSum:fn}),We(()=>Ue.value.length,O=>{var J;bo(),O<=0?hr():(ORt(J))),O!==Be.value&&Kt(O))},{immediate:!0});const JZ=D(()=>{if(!_n.value)return Ue.value.map((me,Le)=>({node:me,index:Le}));const O=Ue.value.length,J=Gs(jn.start,0,O),he=Gs(jn.end,J,O);return Ue.value.slice(J,he).map((me,Le)=>({node:me,index:J+Le}))}),xb=D(()=>_n.value?Rs(0,Math.min(jn.start,Ue.value.length)):0),Sb=D(()=>{if(!_n.value)return 0;const O=Ue.value.length;return Rs(Math.min(jn.end,O),O)});function RS(){return Tr.buildVirtualHeightSummary({topSpacerHeight:xb.value,bottomSpacerHeight:Sb.value,width:vf()})}function XZ(){const O=Ue.value,J=RS();return Fn(Nt({},J),{probe:{paragraphReady:!!te.value.paragraph,listItemReady:!!te.value.listItem,listWrapperOverhead:te.value.listWrapperOverhead,headingReadyLevels:Object.entries(te.value.headings).filter(([,he])=>!!he).map(([he])=>Number(he))},nodes:O.map((he,me)=>{var Le,$e,Ze,et,mt,tt,ut,pt,Ge;return{index:me,type:he.type,estimateKind:($e=(Le=Qh.value[me])==null?void 0:Le.kind)!=null?$e:null,rendererKind:(et=(Ze=Qh.value[me])==null?void 0:Ze.rendererKind)!=null?et:null,estimatedHeight:(tt=(mt=Qh.value[me])==null?void 0:mt.height)!=null?tt:null,estimatedContentHeight:(pt=(ut=Qh.value[me])==null?void 0:ut.contentHeight)!=null?pt:null,measuredHeight:(Ge=Y[me])!=null?Ge:null}})})}function _b(){return i.indexKey!=null?String(i.indexKey):fo.value?`virtual-${wo()}`:"markdown-renderer"}function OS(O){const J=String(O),he=`${_b()}-`;if(!J.startsWith(he))return null;const me=J.slice(he.length).match(/^(\d+)(?:$|-)/);if(!me)return null;const Le=Number(me[1]);return!Number.isInteger(Le)||Le<0||Le>=Ue.value.length?null:Le}function wo(){var O,J,he;const me=(O=i.virtualScroll)==null?void 0:O.sessionKey;return String(me!=null&&me!==""?me:(he=(J=i.indexKey)!=null?J:M.customId)!=null?he:ei)}function es(){var O;const J=(O=i.virtualScroll)==null?void 0:O.threadKey;return J==null||J===""?void 0:String(J)}const eG=D(()=>{var O,J,he;return(he=es())!=null?he:String((J=(O=i.indexKey)!=null?O:M.customId)!=null?J:ei)});function Mb(O){var J;return(O??"")===((J=es())!=null?J:"")}function Wu(){var O,J,he;return J=(O=i.virtualScroll)==null?void 0:O.measurementKey,he=(function(){const me=m.value;return(function(Le){var $e,Ze;const et=Le.renderer,mt=et==="monaco"?Le.codeBlockMonacoOptions:void 0,tt=Le.codeBlockProps,ut=et==="shiki";return[Le.isDark?"dark":"light",et==="monaco"?"code-rich":et==="pre"?"code-pre":"code-shiki",Le.codeBlockStream===!1?"code-static":"code-stream",$s(Le.codeBlockMinWidth),$s(Le.codeBlockMaxWidth),...ut?[mve(($e=tt?.themes)!=null?$e:Le.themes,(Ze=tt?.langs)!=null?Ze:Le.langs)]:[],$s(mt?.fontSize),$s(mt?.lineHeight),$s(mt?.fontFamily),$s(mt?.tabSize),$s(mt?.MAX_HEIGHT),$s(mt?.wordWrap),$s(mt?.wrappingIndent),$s(mt?.padding),$s(tt?.showHeader),$s(tt?.showCopyButton),$s(tt?.showExpandButton),$s(tt?.showPreviewButton),$s(tt?.showCollapseButton),$s(tt?.showFontSizeButtons)].join("\0")})({renderer:me,isDark:M.isDark,codeBlockStream:M.codeBlockStream,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockMonacoOptions:me==="monaco"?M.codeBlockMonacoOptions:void 0,codeBlockProps:M.codeBlockProps,themes:me==="shiki"?M.themes:void 0,langs:me==="shiki"?M.langs:void 0})})(),[J==null?"":String(J),he].join("\0")}function vf(){return Ko()}const Wv=D(()=>Hm(vf())),El=D(()=>[Wu(),Wv.value].join("\0")),tG=D(()=>{var O;return fo.value?["virtual",(O=es())!=null?O:"",wo(),El.value].join("\0"):i.indexKey});function Yh(){jv.value+=1}function Ib(O){return!(!O||!Number.isInteger(O.index)||O.index<0||O.index>=Ue.value.length||O.sessionKey!==wo()||O.threadKey!==es()||O.layoutEpochKey!==El.value)}function $S(O){const J=String(O),he=Ks.get(J);return he?Ib(he)?he.index:null:OS(J)}function PS(O="async-node"){(Er.size||Ks.size)&&(Er.clear(),Ks.clear(),Yh(),oo(O))}const Jh=Yt(yC,null),Tb={reportHeight(O,J){if(!qn.value)return;const he=$S(O);if(he==null)return;const me=ws.get(he);if(!me)return;const Le=Number(J),$e=Tl(he,me);(function(Ze,et,mt={}){Ci(()=>Jl(Ze,et,mt))})(he,Number.isFinite(Le)&&Le>0?Math.max(Le,$e||0):$e)},markPending(O){if(!qn.value)return;const J=OS(O);J!=null&&(function(he,me){var Le;const $e=Ks.get(he);if($e&&Ib($e))return Er.set(he,Math.max(0,(Le=Er.get(he))!=null?Le:0)+1),Yh(),void oo("async-node");Er.set(he,1),Ks.set(he,(function(Ze){return{index:Ze,sessionKey:wo(),threadKey:es(),layoutEpochKey:El.value}})(me)),Yh(),oo("async-node")})(String(O),J)},markSettled(O){if(!qn.value)return;const J=String(O),he=$S(O);(he!=null||(function(me){return Er.has(String(me))})(J))&&(function(me){var Le;const $e=(Le=Er.get(me))!=null?Le:0;return!($e<=0||($e<=1?(Er.delete(me),Ks.delete(me)):Er.set(me,$e-1),Yh(),$e===1&&oo("async-node"),0))})(J)&&he!=null&&qu()}};function nG(){let O=0;for(const J of ws.values())O+=Qt("getVisibleDomHeight.offsetHeight",()=>{var he;return(he=J?.offsetHeight)!=null?he:0});return Math.ceil(Math.max(0,O))}ii(yC,{reportHeight(O,J){Tb.reportHeight(O,J),Jh?.reportHeight(O,J)},markPending(O){Tb.markPending(O),Jh?.markPending(O)},markSettled(O){Tb.markSettled(O),Jh?.markSettled(O)}});let Eb,Lb=null,Xh=null;function qv(O){return O!==!1&&O!=null&&O!==""}function zS(){return _n.value?(function(){if(!_n.value)return!0;const O=Ue.value.length,J=Gs(jn.start,0,O),he=Gs(jn.end,J,O);if(J>=he)return!0;for(let me=J;me=gf.value}function Nb(){return ht.value===!0&&!_t.value&&Gh.value===0&&iu.size===0&&ea.size===0&&Lr==null&&zS()}function jS(){var O,J;if(((O=i.virtualScroll)==null?void 0:O.settleMode)!=="manual"||Lb===wo()&&Eb===es())return!0;const he=(J=i.virtualScroll)==null?void 0:J.settledToken;return!!qv(he)&&Xh===Am(he)}function Db(){return Nb()&&jS()}function iG(O,J){return J.totalNodes<=0?O==="final"?"final":"estimate":J.measuredCount>=J.totalNodes?O==="final"?"final":"measured":J.measuredCount>0||J.estimatedCount>0?"mixed":"estimate"}function yf(O="manual",J){const he=RS(),me=(function(Le){return Le||(ht.value!==!0?Ue.value.length>0?"streaming":"estimating":!zS()||ea.size>0||Lr!=null?"measuring":Db()?"settled":"settling")})(J);return{sessionKey:wo(),threadKey:es(),phase:me,nodeCount:he.totalNodes,liveRange:{start:jn.start,end:jn.end},renderedCount:ti.value,measuredCount:he.measuredCount,estimatedCount:he.estimatedCount,averageNodeHeight:he.averageNodeHeight,topSpacerHeight:he.topSpacerHeight,bottomSpacerHeight:he.bottomSpacerHeight,visibleDomHeight:nG(),totalHeight:HS(),width:he.width,final:ht.value===!0,stable:Db(),confidence:iG(me,he),reason:O}}function cm(){const O=Gl.value||Ae(),J=$.value;if(!O||!J)return null;const he=O.ownerDocument||J.ownerDocument||document,me=O===he.documentElement||O===he.body||O===he.scrollingElement,Le=Qt("getScrollBox.scrollTop",()=>fe(O,he,me)),$e=Qt("getScrollBox.scrollHeight",()=>{var et,mt,tt,ut,pt;return me?Math.max((mt=(et=he.documentElement)==null?void 0:et.scrollHeight)!=null?mt:0,(ut=(tt=he.body)==null?void 0:tt.scrollHeight)!=null?ut:0,(pt=O.scrollHeight)!=null?pt:0):O.scrollHeight}),Ze=Qt("getScrollBox.clientHeight",()=>{var et;return me?((et=he.documentElement)==null?void 0:et.clientHeight)||O.clientHeight||0:O.clientHeight});return{root:O,doc:he,isViewportRoot:me,scrollTop:Le,scrollHeight:$e,clientHeight:Ze}}function HS(){const O=Ue.value.length,J=Math.max(0,Rs(0,O)),he=Qt("getRendererLogicalHeight.offsetHeight",()=>{var Le,$e;return($e=(Le=$.value)==null?void 0:Le.offsetHeight)!=null?$e:0}),me=Math.max(0,he>0?he:Qt("getRendererLogicalHeight.scrollHeight",()=>{var Le,$e;return($e=(Le=$.value)==null?void 0:Le.scrollHeight)!=null?$e:0}));return O<=0?Math.ceil(he):_n.value?J>0?Math.max(1,Math.ceil(J),(function(){let Le=xb.value+Sb.value;for(const $e of ci.values())$e&&(Le+=Math.max(0,Qt("getVirtualizedDomLogicalHeight.offsetHeight",()=>$e.offsetHeight||0)));return Math.ceil(Math.max(0,Le))})(),(function(Le,$e){return Le<=0||$e<=0?0:$e<=Le+Math.max(512,.05*Le)?Math.ceil($e):0})(J,me)):Math.max(1,Math.ceil(me)):qn.value?J>0||ge.count>0||Tr.getEstimatedNodeHeightCount()>0?(Xi.value&&ti.value,Math.max(1,Math.ceil(me),Math.ceil(J))):Math.ceil(me):Math.max(1,Math.ceil(me),Math.ceil(J))}function WS(O){const J=$.value;if(!J)return null;const he=Qt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>J.getBoundingClientRect());return(function(Le){return Le.isViewportRoot?Le.clientHeight:Qt("getViewportBottomInRoot.getBoundingClientRect",()=>Le.root.getBoundingClientRect().bottom)})(O)-he.bottom}function oG(O={}){const J=O.requireViewport!==!1,he=(function($e=64){const Ze=cm(),et=$.value;if(!Ze||!et)return!1;const mt=(function(ut){if(ut.isViewportRoot)return{top:0,bottom:ut.clientHeight};const pt=Qt("getVirtualViewportRect.getBoundingClientRect",()=>ut.root.getBoundingClientRect());return{top:pt.top,bottom:pt.bottom}})(Ze),tt=Qt("isRendererNearVirtualViewport.getBoundingClientRect",()=>et.getBoundingClientRect());return tt.bottom>=mt.top-$e&&tt.top<=mt.bottom+$e})();if(J&&!he)return null;const me=(function(){const $e=cm(),Ze=$.value;if(!$e||!Ze||Math.max(0,$e.scrollHeight-$e.scrollTop-$e.clientHeight)>64)return null;const et=WS($e);return et==null?null:et>=-8&&et<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,et)}:null})();if(me)return{anchor:me,captured:!0};const Le=nu();if(Le)return{anchor:{type:"node",nodeIndex:Le.nodeIndex,offsetWithinNodePx:Le.offsetWithinNodePx},captured:he};if(O.allowFallback===!0){const $e=(function(){const Ze=Ue.value.length;return Ze<=0?null:{type:"node",nodeIndex:Gs(Yn.value,0,Math.max(0,Ze-1)),offsetWithinNodePx:0}})();return $e?{anchor:$e,captured:!1}:null}return null}function Fb(O){let J=2166136261;for(let he=0;he>>0).toString(36)}function sG(O,J){let he=O;for(let me=0;me8192?`${me.slice(0,8192)}...${me.length}`:me;return`${me.length}:${Fb(Le)}`})(O)}`;if(typeof O=="function")return"fn";if(typeof O!="object")return typeof O;if(J.has(O))return"cycle";if(he>=6)return"max-depth";J.add(O);try{if(Array.isArray(O)){if(O.length<=160){const tt=[];for(let ut=0;ut=et&&Ze.push(ut)}return[`a:${O.length}`,`h=${$e.join(",")}`,`t=${Ze.join(",")}`,`all=${(mt>>>0).toString(36)}`].join(":")}const me=O,Le=Object.keys(me).filter($e=>{const Ze=me[$e];return $e!=="parent"&&$e!=="el"&&$e!=="component"&&(Ze==null||typeof Ze=="string"||typeof Ze=="number"||typeof Ze=="boolean"||rG.has($e))}).sort();return`o:${Le.length}:${Le.map($e=>`${$e}=${Uv(me[$e],J,he+1)}`).join(";")}`}finally{J.delete(O)}}let Bb=-1,Rb="",kf=[2166136261];function dm(O){const J=Ue.value[O];return J?Fb(Uv(J)):""}function lG(O,J){let he=O;for(let me=0;me>>0}function Ob(){var O,J;const he=W.value;if(Bb===he)return Rb;const me=Ue.value.length;let Le=wb(me);(Bb!==he-1||Le>me||kf.length>>0).toString(36),Bb=he,Rb}function ep(O,J={}){var he;const me=J.includeHeightCache===!0,Le=(he=J.includeContentHash)!=null?he:me,$e=me?(function(et){const mt=(function(){var vt,Wt;const It=Number((Wt=(vt=i.virtualScroll)==null?void 0:vt.heightCacheLimit)!=null?Wt:5e3);return!Number.isFinite(It)||It<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(It))})();if(!Number.isFinite(mt)||et.length<=mt)return et;const tt=new Map,ut=vt=>{!vt||tt.size>=mt||tt.set(vt.index,vt)},pt=Ue.value.length,Ge=Gs(jn.start-2*Ni.value,0,pt),ct=Gs(jn.end+2*Ni.value,Ge,pt);for(const vt of et)vt.index>=Ge&&vt.index=0&&tt.sizevt.index-Wt.index).slice(0,mt)})(Un().map(et=>{var mt;const tt=Ue.value[et.index];return tt?Fn(Nt({},et),{nodeType:String((mt=tt.type)!=null?mt:""),signature:dm(et.index)}):null}).filter(et=>!!et)):[],Ze=oG({allowFallback:J.allowAnchorFallback===!0,requireViewport:J.requireViewport});return Ze||$e.length||J.includeEmptyState===!0?Fn(Nt({sessionKey:O.sessionKey,threadKey:O.threadKey},Ze?{anchor:Ze.anchor,anchorCaptured:Ze.captured}:{anchorCaptured:!1}),{metrics:O,width:O.width,contentHash:Le?Ob():void 0,measurementKey:Wu()||void 0,heightCache:$e.length?$e:void 0}):null}function $b(O){var J,he;const me=cm();if(!me)return;const Le=(function(et){const mt=$.value;if(!mt)return null;const tt=ie(mt,et.root),ut=Ue.value.length,pt=Qt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>mt.offsetHeight||0),Ge=Math.max(0,pt>0?pt:ut>0?Qt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>mt.scrollHeight||0):0),ct=HS();return tt+Math.max(Ge,ct)})(me);if(Le==null)return;const $e=Math.max(0,O.distanceFromBottomPx),Ze=Math.max(0,Le-me.clientHeight-$e);(function(et){tu=gm()+120,xl=et})(Ze),me.isViewportRoot?(he=(J=me.doc.defaultView)==null?void 0:J.scrollTo)==null||he.call(J,0,Ze):QL(me.root,me.doc,Ze,{isReverseFlexScrollRoot:Me,getNormalizedScrollTop:fe})}const Pb=[];function qS(){if(K)for(dr!=null&&($i?.(dr),dr=null);Pb.length;){const O=Pb.pop();O!=null&&window.clearTimeout(O)}}function tp(O){const J=!!Zo.value;Zo.value=null,tu=0,xl=null,qS(),J&&O&&oo(O)}function np(){if(!Zo.value||!K||dr!=null)return;const O=()=>{dr=null;const J=Zo.value;J&&$b(J)};dr=Oi?Oi(O):null,dr==null&&O()}function US(O,J={}){const he=Ue.value.length;return he<=0?[]:O.filter(me=>!(!Number.isInteger(me.index)||me.index<0||me.index>=he)&&!(!Number.isFinite(me.height)||me.height<=0)&&!(J.requireSignature&&!me.signature)&&!(J.requireCompatibilityMetadata&&!me.nodeType&&!me.signature)&&(function(Le){var $e;const Ze=Ue.value[Le.index];return!(!Ze||Le.nodeType&&Le.nodeType!==String(($e=Ze.type)!=null?$e:"")||Le.signature&&Le.signature!==dm(Le.index))})(me))}function VS(O){const J=Hm(vf()),he=Hm(O);return J!==-1&&he!==-1&&J===he}function zb(O){var J;const he=Number(O?.width);if(Number.isFinite(he)&&he>0)return he;const me=Number((J=O?.metrics)==null?void 0:J.width);return Number.isFinite(me)&&me>0?me:null}function KS(O){var J;return O.sessionKey===wo()&&!!Mb(O.threadKey)&&((J=O.measurementKey)!=null?J:"")===Wu()&&!!VS(zb(O))&&!!(function(he){const me=he.heightCache;return!!me?.length&&(ZS(he)?me.some(Le=>!!(Le.nodeType||Le.signature)):me.some(Le=>!!Le.signature))})(O)}function ZS(O){return!!(O.contentHash&&O.contentHash===Ob())}function aG(O){return!ZS(O)}let bf=null,wf=null,Vv=null,fm=null,hm=null;function jb(O){var J;const he=O.map(Le=>{var $e,Ze;return[Le.index,Math.round(10*Le.height),($e=Le.nodeType)!=null?$e:"",(Ze=Le.signature)!=null?Ze:""].join("")}).join(""),me=Hm(vf());return[(J=es())!=null?J:"",wo(),Wu(),Ue.value.length,me,O.length,Fb(he)].join(":")}function GS(O=(J=>(J=i.virtualScroll)==null?void 0:J.heightCache)()){if(!qn.value||!O?.length||Ue.value.length<=0||!VS((J=i.virtualScroll)==null?void 0:J.heightCacheWidth))return!1;var J;const he=US(O,{requireSignature:!0});if(!he.length)return!1;const me=jb(he);return me===bf?(wf="standalone",!0):(Ie(he,{mode:"merge"}),bo(),bf=me,wf="standalone",ym(),oo("restore"),!0)}function Hb(O,J={}){var he,me,Le;if(!qn.value||!O||O.sessionKey!==wo()||!Mb(O.threadKey)||Ue.value.length<=0)return!1;const $e=!!((he=O.heightCache)!=null&&he.length)&&!Kv(),Ze=!O.anchor||O.anchorCaptured===!1&&J.allowUncapturedAnchor!==!0?null:O.anchor,et=J.restoreAnchor===!0&&!!Ze&&!Kv()&&Number(zb(O))>0;let mt=!1;if((me=O.heightCache)!=null&&me.length&&KS(O)){const ut=US(O.heightCache,{requireCompatibilityMetadata:!O.contentHash,requireSignature:aG(O)});ut.length&&(Ie(ut,{mode:"merge"}),bo(),bf=jb(ut),wf="restore",ym(),mt=!0)}if($e||et)return!1;if(!J.restoreAnchor||!Ze)return mt&&oo("restore"),!0;const tt=(function(ut,pt){var Ge;const ct=ut.anchor,xt=ct?ct.type==="bottom"?`bottom:${Math.round(ct.distanceFromBottomPx)}`:`node:${ct.nodeIndex}:${Math.round(ct.offsetWithinNodePx)}`:"none";return[(Ge=es())!=null?Ge:"",wo(),Wu(),Wv.value,pt,xt].join(":")})(O,(Le=J.restoreToken)!=null?Le:"imperative");return Vv===tt?(mt&&oo("restore"),!0):(Vv=tt,(function(ut){const pt=()=>{if(ut.type==="node")return tp(),void Yl({nodeIndex:ut.nodeIndex,offsetWithinNodePx:ut.offsetWithinNodePx});if(Il(),ho.value=null,Zo.value=ut,qS(),$b(ut),K)for(const Ge of[0,120,280,480])Pb.push(window.setTimeout(()=>{const ct=Zo.value;ct&&$b(ct)},Ge))};(function(Ge){if(!_n.value)return!1;const ct=Ue.value.length;return!(ct<=0||(Yn.value=Ge.type==="node"?Gs(Ge.nodeIndex,0,ct-1):ct-1,po(),0))})(ut)?ft(pt):pt()})(Ze),oo("restore"),!0)}function Kv(){const O=vf();return Number.isFinite(O)&&O>0}function QS(O){var J;return O.sessionKey===wo()&&!!Mb(O.threadKey)&&(Ue.value.length<=0||!(!((J=O.heightCache)!=null&&J.length)||Kv())||!(!(O.anchor&&Number(zb(O))>0)||Kv()))}function Wb(){gi.clear();for(const O of Object.keys(Y)){const J=Number(O);Number.isInteger(J)&&J>=0&&J{let J=!1,he=null;const me=()=>{J||(J=!0,he!=null&&window.clearTimeout(he),O())};if(Oi)return Oi(me),void(he=window.setTimeout(me,50));he=window.setTimeout(me,0)})}function qb(O,J=es(),he=El.value){return wo()===O&&es()===J&&El.value===he}function Ub(){return ro(this,arguments,function*(O={}){var J,he,me,Le,$e;const Ze=wo(),et=es(),mt=El.value,tt=(J=O.frames)!=null?J:2,ut=(he=O.timeoutMs)!=null?he:120,pt=(me=O.reason)!=null?me:"manual",Ge=O.expectedSettledTokenKey,ct=O.flushPendingTimers===!0,xt=yf(pt),vt=()=>Fn(Nt({},xt),{phase:xt.final?"settling":xt.phase,stable:!1,confidence:xt.confidence==="final"?"mixed":xt.confidence,reason:pt}),Wt=()=>qb(Ze,et,mt)&&(Ge==null||vm()===Ge);for(let Cn=0;Cnwindow.setTimeout(vn,Cn))})(ut),!Wt()||(ct&&bt(),qu(),pm(),!Wt()))return vt();const It=Nb();It&&(Lb=Ze,Eb=et,((Le=i.virtualScroll)==null?void 0:Le.settleMode)==="manual"&&Ge!=null&&qv(($e=i.virtualScroll)==null?void 0:$e.settledToken)&&vm()===Ge&&(Xh=Am(i.virtualScroll.settledToken)));const en=Wt()&&It&&jS(),cn=yf(pt,en?"final":void 0);return Qb(cn,!0),cn})}let Vb="content",Cf=null,Af=null,Kb=0,mm=null,ip=null,Zb=null,Gb=null;function gm(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function JS(O){var J,he;const me=mm;if(!me)return!0;const Le=(he=(J=i.virtualScroll)==null?void 0:J.heightDiffThresholdPx)!=null?he:1;return Math.abs(O.totalHeight-me.totalHeight)>Le||O.sessionKey!==me.sessionKey||O.phase!==me.phase||O.stable!==me.stable||O.final!==me.final||O.threadKey!==me.threadKey||O.nodeCount!==me.nodeCount||O.measuredCount!==me.measuredCount||O.width!==me.width}function vm(O=(J=>(J=i.virtualScroll)==null?void 0:J.settledToken)()){return $s(O)}function XS(O,J){var he,me;return[O,J.sessionKey,(he=J.threadKey)!=null?he:"",Wu(),Ob(),$s((me=i.virtualScroll)==null?void 0:me.settledToken),Math.round(J.totalHeight),Math.round(J.width)].join("\0")}function ym(){Zb=null,Gb=null,ip=null}function uG(O){const J=O.heightCache;return J?.length?jb(J):""}function km(O){var J,he,me;const Le=O.metrics,$e=O.anchor?(Ze=O.anchor).type==="bottom"?`bottom:${Math.round(Ze.distanceFromBottomPx)}`:`node:${Ze.nodeIndex}:${Math.round(Ze.offsetWithinNodePx)}`:"none";var Ze;return[O.sessionKey,(J=O.threadKey)!=null?J:"",(he=O.measurementKey)!=null?he:Wu(),(me=O.contentHash)!=null?me:"",uG(O),$e,O.anchorCaptured?1:0,Le.liveRange.start,Le.liveRange.end,Le.renderedCount,Le.nodeCount,Math.round(Le.totalHeight),Math.round(Le.width),Le.phase,Le.stable?1:0].join("\0")}function Qb(O,J=!1){if(!qn.value||(function(Ze=!1){return!Ze&&fo.value&&!to.value})(J))return;const he=J||JS(O),me=(function(Ze,et=!1){return et||Ze.stable||Ze.phase==="final"?{state:ep(Ze,{includeHeightCache:!0})}:{state:ep(Ze)}})(O,J),Le=me.state,$e=!!(Le&&(he||(function(Ze,et=!1){return!!et||km(Ze)!==ip})(Le,J)));if(he&&(R(O),mm=O,Kb=gm()),Le&&$e&&(q(Le),Le.anchor&&z(Le.anchor),ip=km(Le)),O.stable){const Ze=XS("settled",O);if(Ze!==Zb){Zb=Ze;const et=ep(O,{includeHeightCache:!0});et&&(q(et),ip=km(et)),(function(mt){o("render-settled",mt)})(O)}}if(O.phase==="final"){const Ze=XS("final",O);if(Ze!==Gb){Gb=Ze;const et=ep(O,{includeHeightCache:!0});et&&(q(et),ip=km(et)),(function(mt){o("render-final",mt)})(O)}}}function Yb(){Cf!=null&&($i?.(Cf),Cf=null),Af!=null&&K&&(window.clearTimeout(Af),Af=null)}function e_(){Cf=null,Af=null,(function(O){if(ea.size>0||Lr!=null)return!0;switch(O){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Vb)&&(qu(),pm()),Qb(yf(Vb))}function oo(O){var J,he;if(!qn.value||(Vb=O,Cf!=null||Af!=null))return;const me=Math.max(0,(he=(J=i.virtualScroll)==null?void 0:J.emitIntervalMs)!=null?he:32),Le=Math.max(0,me-(gm()-Kb)),$e=()=>{Af=null,Cf=Oi?Oi(e_):null,Cf==null&&e_()};K&&Le>0?Af=window.setTimeout($e,Le):$e()}function t_(){Zl.value+=1}function Zv(O){if(Xi.value&&O>=ti.value){const J=Ue.value[O],he=ze.value===!0&&ht.value!==!0&&O>=Ue.value.length-2,me=J?.type==="code_block"||J?.type==="image"||J?.type==="mermaid"||J?.type==="infographic";if(!he||me)return!1}return!Ne.value||O=pe.value&&(G.value||(G.value=!0,bb()),!ln.value||!Ji))return op(O),void(J&&Jr(O,!0));if(O{if(Ia.delete($e),!Ne.value||eo.value.has($e))return;const mt=ci.get($e);if(!mt)return;const tt=Ae(mt),ut=mt.ownerDocument||document,pt=ut.defaultView||window,Ge=!tt||tt===ut.documentElement||tt===ut.body,ct=!Ge&&tt?Qt("nodeVisibilityFallback.root.getBoundingClientRect",()=>tt.getBoundingClientRect()):null,xt=Ge?0:ct.top,vt=Ge?Qt("nodeVisibilityFallback.clientHeight",()=>{var It,en;return(en=(It=pt.innerHeight)!=null?It:tt?.clientHeight)!=null?en:0}):ct.bottom,Wt=Qt("nodeVisibilityFallback.node.getBoundingClientRect",()=>mt.getBoundingClientRect());Wt.bottom>=xt-500&&Wt.top<=vt+500&&Jr($e,!0)},1800+Ze);Ia.set($e,et)})(O);let Le=null;Le=We(()=>me.isVisible.value,$e=>{if($e){ta(O),Jr(O,!0),Le?.(),Zs.delete(O),Cs.get(O)===me&&Cs.delete(O);try{me.destroy()}catch{}}},{immediate:!0}),Zs.set(O,Le),_n.value&&pn()}function Jb(){Lr=null,Ci(()=>{let O=!1;for(const[J,he]of ea)ea.delete(J),ws.get(J)===he.el&&Xl.get(J)===he.version&&(O=Jl(J,he.height,{allowShrink:he.allowShrink})||O);return O})}function sp(){Lr!=null&&($i?.(Lr),Lr=null),ea.clear()}function Qv(O,J){(function(he,me,Le){var $e;if(!Number.isFinite(Le)||Le<=0||ws.get(he)!==me)return;const Ze=Xl.get(he);if(Ze==null)return;const et=Ue.value[he],mt=_t.value&&ht.value!==!0&&!(($e=i.nodes)!=null&&$e.length)&&he>=Ue.value.length-2,tt=!(et?.loading===!0||mt),ut=ea.get(he),pt=ut?ut.allowShrink&&tt:tt,Ge=ut&&!pt?Math.max(ut.height,Le):Le;ea.set(he,{height:Ge,allowShrink:pt,version:Ze,el:me}),Lr==null&&(Lr=Oi?Oi(Jb):null,Lr==null&&Jb())})(O,J,Tl(O,J))}function qu(){for(const[O,J]of ws)J&&Qv(O,J)}function n_(){ni?.disconnect(),ni=null,Ro.clear()}function Xb(){for(;pf.length;)Ke(pf.pop())}We(to,O=>{O&&oo("content")},{flush:"post"}),t({getVirtualMetrics:yf,captureVirtualState:function(O={}){var J;return ep(yf("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:O.allowFallbackAnchor===!0,requireViewport:O.requireViewport===!0,includeEmptyState:(J=O.includeEmptyState)==null||J})},restoreVirtualState:function(O,J={}){const he=J.restoreAnchor===!0,me=J.restoreToken==null?"imperative":String(J.restoreToken);fm=O,hm={restoreAnchor:he,restoreToken:me,allowUncapturedAnchor:J.allowUncapturedAnchor===!0},!Hb(O,{restoreAnchor:he,restoreToken:me,allowUncapturedAnchor:J.allowUncapturedAnchor===!0})&&QS(O)||(fm=null,hm=null)},forceMeasure:function(O="manual"){return ro(this,null,function*(){yield ft(),yield YS(),qu(),pm(),yield ft();const J=yf(O);return Qb(J,!0),J})},settle:Ub,scrollToNode:function(O,J="start"){tp(),Il();const he=Ue.value.length;if(he<=0)return;const me=Gs(O,0,he-1),Le=()=>{var $e;const Ze=Ql({nodeIndex:me,offsetWithinNodePx:0}),et=Sl(me),mt=cm(),tt=($e=mt?.clientHeight)!=null?$e:0,ut=_l();let pt=Ze;if(J==="center")pt=Ze-tt/2+et/2;else if(J==="end")pt=Ze-tt+et;else if(J==="nearest"&&ut!=null){if(Ze>=ut&&Ze+et<=ut+tt)return;pt=Zegs.value,O=>{if(!O){n_();for(const J of Ma.values())for(const he of J)Ke(he);Ma.clear(),Xl.clear(),Xb(),sp()}},{immediate:!0}),We(ht,O=>{O&&(function(){if(K&&ht.value&&ws.size){Xb();for(const J of[80,240,640]){const he=at(J,()=>{for(const[me,Le]of ws)Le&&Qv(me,Le)},"final");he!=null&&pf.push(he)}}})(),oo(O?"final":"content")});const cG=YL(()=>oo("content"),16),dG=YL(()=>oo("batch"),16);We([()=>Ue.value.length,()=>ti.value],()=>{Zo.value&&np(),cG()},{flush:"post",immediate:!0}),We([()=>jn.start,()=>jn.end],()=>{dG()},{flush:"post"});const{cleanupBatchScheduler:fG}=(function(O){const{props:J,isClient:he,isTestEnv:me,parsedNodesIdentity:Le,parsedNodeCount:$e,desiredRenderedCount:Ze,datasetKey:et,batchingEnabled:mt,incrementalRenderingActive:tt,resolvedBatchSize:ut,resolvedInitialBatch:pt,renderedCount:Ge,adaptiveBatchSize:ct,previousRenderContext:xt,previousBatchConfig:vt,requestFrame:Wt,cancelFrame:It,hasIdleCallback:en,cleanupNodeVisibility:cn,onDatasetKeyChanged:Cn,onDatasetChanged:vn}=O;let An=null,zn="raf",Jn=null,Wi=0,Qs=!1,Os=!1;const Ta=new Set,ou=new Set;function Im(){if(he){An!=null&&(zn==="raf"&&It?It(An):zn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(An):zn==="timeout"&&window.clearTimeout(An),An=null),Wi+=1;for(const pr of Ta)It&&It(pr);for(const pr of ou)window.clearTimeout(pr);Ta.clear(),ou.clear(),Jn=null,Qs=!1,Os=!1}}function s2(){return typeof performance<"u"?performance.now():Date.now()}function b_(pr){(function(Uu){var Rc;if(!tt.value)return;const Vu=Math.max(2,(Rc=J.renderBatchBudgetMs)!=null?Rc:6),Ku=Math.max(1,ut.value||1),Ea=Math.max(1,Math.floor(Ku/4));Uu>1.5*Vu?ct.value=Math.max(Ea,Math.floor(.8*ct.value)):Uu<.6*Vu&&ct.value=Vu)return;const Ku=Math.max(1,pr),Ea=()=>{const ap=s2();An=null;const Tm=Jn??Ku;Jn=null;const up=s2();Ge.value=Math.min(Vu,Ge.value+Tm),cn(Ge.value),(function(r3,r2){if(!he)return void b_(r2);Qs=!0;const x_=++Wi;ft().then(()=>{var S_;if(x_!==Wi)return;const DG=s2(),FG=Math.max(r2,DG-r3),__=()=>{x_===Wi&&b_(FG)};if(Wt){let Sf=null,cp=null,I_=!1;const T_=()=>{I_||(I_=!0,Sf!==null&&(Ta.delete(Sf),Sf=null),cp!==null&&(ou.delete(cp),window.clearTimeout(cp),cp=null),__())};return Sf=Wt(()=>{T_()}),Ta.add(Sf),cp=window.setTimeout(()=>{Sf!==null&&It&&It(Sf),T_()},Math.max(32,(S_=J.renderBatchIdleTimeoutMs)!=null?S_:120)),void ou.add(cp)}const M_=window.setTimeout(()=>{ou.delete(M_),__()},0);ou.add(M_)})})(ap,s2()-up)};if(!he||el.immediate)return void Ea();const Oc=Math.max(0,(Uu=J.renderBatchDelay)!=null?Uu:16);if(Jn=Jn!=null?Math.max(Jn,Ku):Ku,An==null){if(!me&&en&&window.requestIdleCallback){const ap=Math.max(0,(Rc=J.renderBatchIdleTimeoutMs)!=null?Rc:120);return zn="idle",void(An=window.requestIdleCallback(()=>Ea(),{timeout:ap}))}if(Wt&&!me)return zn="raf",void(An=Wt(()=>{Oc===0?Ea():(zn="timeout",An=window.setTimeout(()=>Ea(),Oc))}));zn="timeout",An=window.setTimeout(()=>Ea(),Oc)}}function C_(pr,el={}){Qs?Os=!0:pr==null?A_():w_(pr,el)}function A_(){tt.value&&w_(mt.value?Math.max(1,Math.round(ct.value)):Math.max(1,ut.value))}return We([Le,$e,et,tt,ut,pt,()=>J.renderBatchDelay],()=>{var pr;const el=$e.value,Uu=xt.value,Rc=et.value,Vu=!Object.is(Rc,Uu.key),Ku=el!==Uu.total,Ea=Vu||Ku;xt.value={key:Rc,total:el};const Oc=vt.value,ap=(pr=J.renderBatchDelay)!=null?pr:16,Tm=Oc.batchSize!==ut.value||Oc.initial!==pt.value||Oc.delay!==ap||Oc.enabled!==tt.value;vt.value={batchSize:ut.value,initial:pt.value,delay:ap,enabled:tt.value},Vu&&Cn(el),(Ea||Tm||!tt.value)&&Im(),(Ea||Tm)&&(ct.value=Math.max(1,ut.value||1)),Ea&&vn();const up=Ze.value;if(!el)return Ge.value=0,void cn(0);if(!tt.value)return Ge.value=up,void cn(Ge.value);const r3=Vu||Uu.total===0;Ge.value=r3||Tm?Math.min(up,pt.value):Math.min(Ge.value,up);const r2=Math.max(1,pt.value||ut.value||el);Ge.value{tt.value&&(typeof el=="number"&&pr<=el||pr>Ge.value&&C_())}),{cleanupBatchScheduler:Im}})({props:M,isClient:K,isTestEnv:Se,parsedNodesIdentity:ui,parsedNodeCount:_o,desiredRenderedCount:gf,datasetKey:tG,batchingEnabled:Gn,incrementalRenderingActive:Xi,resolvedBatchSize:on,resolvedInitialBatch:Zn,renderedCount:ti,adaptiveBatchSize:ys,previousRenderContext:vs,previousBatchConfig:Je,requestFrame:Oi,cancelFrame:$i,hasIdleCallback:je,cleanupNodeVisibility:GZ,onDatasetKeyChanged:O=>{sp(),hr(),bo(),ym(),O>0&&Kt(O)},onDatasetChanged:()=>{_n.value&&pn({immediate:!0})}});We([Dn,_n,()=>$.value,()=>Z()],([O,J])=>{if(!O)return IS(),void Vn();QZ(),J?pn({immediate:!0}):Vn()},{flush:"post",immediate:!0}),We([()=>Ue.value.length,()=>_n.value],O=>ro(null,[O],function*([J,he]){he&&J&&K&&(yield ft(),pn({immediate:!0}))}),{flush:"post"}),We(fi,O=>{O&&(function(){var J;if(co.value&&Ns.value&&Ds.value&&((J=Fs.value)!=null&&J[1]))return;const he=Et({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),me=Et({type:"list_item",children:[he],raw:"- Probe paragraph text"}),Le=Et({type:"list",ordered:!1,items:[me],raw:"- Probe paragraph text"});co.value=he,Ns.value=me,Ds.value=Le;const $e={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ze=1;Ze<=6;Ze++)$e[Ze]=Et({type:"heading",level:Ze,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ze)} Probe heading`});Fs.value=$e})()},{immediate:!0}),We([()=>$.value,fi],()=>{if(!fi.value)return Ab(),void(Q.value=0);ES(),Ab(),fi.value&&$.value&&typeof ResizeObserver<"u"&&(um=new ResizeObserver(()=>{ES(),ho.value&&fr(),Zo.value&&np(),oo("resize")}),um.observe($.value))},{immediate:!0}),We([fi,ri,El],()=>ro(null,null,function*(){if(!fi.value)return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void bo();yield ft(),(function(){if(!fi.value||typeof window>"u")return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void bo();const O={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},J=TS(Cb(B.value),".paragraph-node");O.paragraph=I8(B.value,J,"pre-wrap");const he=Cb(P.value),me=he?.querySelector(".paragraph-node");O.listItem=I8(P.value,me,"pre-wrap");const Le=Qt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ze,et;return(et=(Ze=H.value)==null?void 0:Ze.offsetHeight)!=null?et:0}),$e=Qt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ze,et;return(et=(Ze=P.value)==null?void 0:Ze.offsetHeight)!=null?et:0});O.listWrapperOverhead=Math.max(0,Le-$e);for(let Ze=1;Ze<=6;Ze++){const et=TS(Cb(j[Ze]),`h${Ze}`);O.headings[Ze]=I8(j[Ze],et,"pre-wrap")}te.value=O,bo()})()}),{flush:"post",immediate:!0}),We(()=>Ue.value.length,()=>{_n.value&&pn({immediate:!0})}),We([fi,Q],()=>{bo(),_n.value&&pn({immediate:!0}),ho.value&&fr(),Zo.value&&np(),oo("resize")},{immediate:!1}),We(()=>Ne.value,O=>{if(O)for(const[J,he]of ci)Gv(J,he);else if(bb(),_n.value)pn({immediate:!0});else for(const[J,he]of ci)he&&Jr(J,!0)},{immediate:!1}),We([se,pe,()=>Z()],()=>{var O;(O=Ji.refresh)==null||O.call(Ji);for(const[J,he]of ci)Gv(J,he)},{immediate:!1}),We([()=>M.viewportPriority,()=>Ue.value.length,pe],([O,J,he])=>{if(O!==!1){if(G.value&&(J<=200||J<=he)){G.value=!1;for(const[me,Le]of ci)Gv(me,Le)}}else G.value=!1}),We(()=>ti.value,()=>{_n.value&&pn({immediate:!0})}),We([Yn,Mi,Ni,()=>Ue.value.length,_n],()=>{po()},{immediate:!0});let bm=null,wm=!1,rp=null;function Cm(){bm=null,Lb=null,Eb=void 0,Xh=null,ym()}function e3(){sp(),hr(),bo(),gi.clear();const O=Ue.value.length;O>0&&Kt(O),Wb()}function t3(){Yb(),bt(),mm=null,bf=null,wf=null,Vv=null,fm=null,hm=null,wm=!1,Cm(),PS("restore"),Il(),tp()}function Am(O){var J;return[(J=es())!=null?J:"",wo(),Wu(),Wv.value,vm(O),Ue.value.length,Math.round(Rs(0,Ue.value.length)),Math.round(vf()),ge.count,Math.round(ge.total)].join(":")}function i_(){return ro(this,null,function*(){var O,J,he,me;const Le=(O=i.virtualScroll)==null?void 0:O.settledToken,$e=vm(Le),Ze=wo(),et=es(),mt=El.value;if(qn.value&&((J=i.virtualScroll)==null?void 0:J.settleMode)==="manual"&&qv(Le))if(Nb()){if(Am(Le)!==Xh&&!wm){wm=!0;try{const tt=yield Ub({reason:"manual",expectedSettledTokenKey:$e}),ut=vm()===$e;qb(Ze,et,mt)&&tt.sessionKey===Ze&&tt.threadKey===et&&ut&&tt.stable&&tt.phase==="final"&&(Xh=Am((he=i.virtualScroll)==null?void 0:he.settledToken))}finally{wm=!1,yield ft();const tt=(me=i.virtualScroll)==null?void 0:me.settledToken,ut=qv(tt)?Am(tt):"";qb(Ze,et,mt)&&ut&&Xh!==ut&&i_()}}}else oo("manual")})}We(qn,(O,J)=>{if(O!==J){if(!O)return t3(),void Yb();t3(),e3(),rp=El.value,oo("content")}},{flush:"post"}),We([qn,El],([O,J])=>{O?rp!=null?rp!==J&&(rp=J,(function(he="resize"){sp(),hr(),bo(),gi.clear();const me=Ue.value.length;me>0&&Kt(me),Wb(),bf=null,wf=null,Vv=null,mm=null,wm=!1,Cm(),GS(),ft(()=>{qu(),ho.value&&fr(),Zo.value&&np(),oo(he)})})("resize")):rp=J:rp=null},{flush:"post",immediate:!0}),We([qn,()=>wo(),()=>es()],([O])=>{O&&(t3(),e3(),PS("content"),oo("content"))}),We([qn,()=>wo(),()=>es(),El,()=>Ue.value.length],([O])=>{O&&(function(J="async-node"){let he=!1;for(const[me,Le]of Array.from(Ks.entries()))Ib(Le)||(Ks.delete(me),Er.delete(me),he=!0);he&&(Yh(),oo(J))})("async-node")},{flush:"post"}),We([qn,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.sessionKey},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.measurementKey},()=>i.indexKey,()=>W.value],([O])=>{O&&(ym(),(function(J="content"){if(!qn.value)return;const he=[],me=Ue.value.length,Le=wb(me);for(const $e of Array.from(gi.keys())){if($e>=me){he.push($e);continue}if($e=me&&gi.delete($e);he.length&&((function($e,Ze={}){const et=Array.from($e,Number);On(et);let mt=0;if(Ci(()=>(mt=Sn(et,Ze),mt>0)),mt>0)(function(tt){for(const ut of tt)gi.delete(ut)})(et);else for(const tt of et)ks.delete(tt)})(he,{notify:!1}),bo(),Cm(),ho.value&&fr(),Zo.value&&np(),oo(J))})("content"))},{flush:"post",immediate:!0}),We([qn,()=>Ue.value.length,()=>wo(),()=>es()],([O,J,he,me],[Le,$e,Ze,et])=>{O&&Le&&he===Ze&&me===et&&J!==$e&&Cm()},{flush:"post"}),We([qn,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.heightCache},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.heightCacheWidth},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.restoreState},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.measurementKey},()=>Ue.value.length,()=>wo(),Q],()=>{GS()},{flush:"post",immediate:!0}),We([qn,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.restoreState},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.restoreAnchor},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.measurementKey},()=>Ue.value.length,()=>wo(),Q],O=>ro(null,[O],function*([J,he]){if(!J||!he)return;yield ft();const me=(function(){var Le;const $e=(Le=i.virtualScroll)==null?void 0:Le.restoreAnchor;return $e==null||$e===!1?null:$e===!0?"true":String($e)})();Hb(he,{restoreAnchor:me!=null,restoreToken:me??void 0})}),{flush:"post",immediate:!0}),We([qn,Q,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.restoreState},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.measurementKey}],([O])=>{var J;if(!O)return;const he=(J=i.virtualScroll)==null?void 0:J.restoreState;he&&bf&&wf==="restore"&&(KS(he)||(e3(),bf=null,wf=null,oo("resize")))},{flush:"post"}),We([qn,()=>Ue.value.length,()=>wo(),Q],O=>ro(null,[O],function*([J]){var he;const me=fm,Le=hm;J&&me&&(yield ft(),!Hb(me,{restoreAnchor:Le?.restoreAnchor===!0,restoreToken:(he=Le?.restoreToken)!=null?he:"imperative",allowUncapturedAnchor:Le?.allowUncapturedAnchor===!0})&&QS(me)||(fm=null,hm=null))}),{flush:"post",immediate:!0}),We([qn,ht,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.settleMode},()=>wo(),()=>es(),El,Gh,Hu,()=>ti.value,gf,()=>ge.count,()=>ge.total],([O,J,he])=>{if(!O||J!==!0||he==="manual"||!Db())return;const me=(function(){var Le;const $e=Ue.value.length;return[(Le=es())!=null?Le:"",wo(),Wu(),Wv.value,$e,Math.round(Rs(0,$e)),Math.round(vf()),ge.count,Math.round(ge.total)].join(":")})();bm!==me&&(bm=me,Ub({reason:"final"}).then(Le=>{Le.stable||bm!==me||(bm=null)}))},{flush:"post",immediate:!0}),We([qn,ht,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.settleMode},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.settledToken},()=>wo(),()=>es(),El,Gh,Hu,()=>ti.value,gf,()=>Ue.value.length,()=>ge.count,()=>ge.total],()=>{i_()},{flush:"post",immediate:!0}),We([()=>Ue.value.length,_n,Mi,Ni,()=>jn.start,()=>jn.end],([O,J,he,me,Le,$e])=>{we.value&&Ft("virtualization",{nodes:O,virtualization:J,maxLiveNodes:he,buffer:me,focusIndex:Yn.value,scroll:J?(()=>{const Ze=Gl.value||Ae();return Ze?{reverse:Me(Ze),scrollTop:Math.round(Ze.scrollTop),scrollTopAbs:Math.round(Math.abs(Ze.scrollTop)),scrollHeight:Math.round(Ze.scrollHeight),clientHeight:Math.round(Ze.clientHeight)}:null})():null,liveRange:{start:Le,end:$e},rendered:ti.value})}),We([()=>M.customId],([O],J,he)=>{if(!O||Fo)return;const me=(function(Le,$e){return Le?(As.controllers[Le]=$e,()=>{As.controllers[Le]===$e&&delete As.controllers[Le]}):()=>{}})(O,{captureRestoreAnchor:nu,restoreAnchor:Yl,getAnchorDrift:ju,getReport:XZ});he(()=>{me()})},{immediate:!0}),Xn(()=>{(function(){if(qn.value)try{qu(),pm();const O=yf("manual");JS(O)&&(R(O),mm=O,Kb=gm());const J=ep(O,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});J&&(q(J),J.anchor&&z(J.anchor),ip=km(J))}catch{}})(),fG(),bb(),Ve(),n_();for(const O of Ma.values())for(const J of O)Ke(J);Ma.clear(),Xl.clear(),gi.clear(),Xb(),sp(),Ab(),Il(),tp(),Yb(),IS(),Vn()});const hG=dg("ViewportDeferredMermaidBlockNode",Cu({loader:()=>ro(null,null,function*(){try{return(yield Jo(()=>import("./index11-ChlZyGAH.js"),__vite__mapDeps([7,5]))).default}catch(O){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',O),sl}}),loadingComponent:dN,delay:0}),dN),pG=dg("ViewportDeferredInfographicBlockNode",Cu({loader:()=>ro(null,null,function*(){try{return(yield Jo(()=>import("./index10-DGuREUB3.js"),[])).default}catch(O){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',O),sl}}),loadingComponent:cN,delay:0}),cN),mG=dg("ViewportDeferredD2BlockNode",Cu(()=>ro(null,null,function*(){try{return(yield Jo(()=>import("./index8-6GF_RzW4.js"),[])).default}catch(O){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',O),sl}})),sl),o_={text:qo,paragraph:vh,heading:zk,code_block:y8,list:u1,list_item:a1,blockquote:zy,table:Gg,definition_list:jy,footnote:Hy,footnote_reference:Pl,footnote_anchor:Kg,admonition:Vy,vmr_container:qy,hardbreak:_d,link:Ur,image:Sd,thematic_break:Wy,math_inline:Ja,math_block:_H,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,checkbox:$l,checkbox_input:$l,inline_code:Ar,html_inline:zl,reference:Hr,html_block:Zg},gG=D(()=>_b()),s_=D(()=>GL(M.codeBlockProps)),vG=D(()=>GL(M.codeBlockProps,{omit:["langs"]})),r_=D(()=>Nt(Nt({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,monacoOptions:M.codeBlockMonacoOptions,themes:M.themes,langs:m.value==="shiki"?M.langs:void 0,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),vG.value)),l_=D(()=>Nt(Fn(Nt({},r_.value),{langs:M.langs}),s_.value));function a_(O){return typeof O=="boolean"?O:void 0}const yG=D(()=>{const O=M.codeBlockProps||{},J={},he=a_(O.showLineNumbers);he!==void 0&&(J.showLineNumbers=he);const me=a_(O.diffInline);me!==void 0&&(J.diffInline=me);const Le=(function($e){const Ze=Number($e);return Number.isFinite(Ze)&&Ze>0?Ze:void 0})(O.reservedHeightPx);return Le!==void 0&&(J.reservedHeightPx=Le),J}),kG=D(()=>Nt(Nt({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,themes:M.themes,langs:M.langs,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),s_.value)),bG=D(()=>Nt({},M.mermaidProps||{})),u_=D(()=>Nt({},M.d2Props||{})),wG=D(()=>Nt({},M.infographicProps||{})),xm=D(()=>({typewriter:f.value,fade:M.fade,customHtmlTags:ot.value.customHtmlTags})),CG=D(()=>Nt(Nt({},xm.value),typeof be.value=="boolean"?{showTooltip:be.value}:{})),AG=D(()=>Nt(Nt({},xm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),xG=D(()=>Nt(Nt({},xm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),SG=D(()=>Nt(Nt({},xm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{}));function _G(O){return Array.isArray(O.children)&&O.children.length>0}const Yv=D(()=>JZ.value.map(O=>{var J,he,me,Le,$e,Ze,et,mt;let tt=(function(It){var en,cn,Cn,vn,An,zn,Jn;if(It.type!=="code_block")return It;const Wi=It,Qs=[String((en=Wi.language)!=null?en:""),String((cn=Wi.loading)!=null?cn:""),String((Cn=Wi.diff)!=null?Cn:""),String((vn=Wi.code)!=null?vn:""),String((An=Wi.originalCode)!=null?An:""),String((zn=Wi.updatedCode)!=null?zn:""),String((Jn=Wi.raw)!=null?Jn:"")].join("\0"),Os=Oo.get(Wi);if(Os&&Os.signature===Qs)return Os.node;const Ta=Nt({},Wi);return Oo.set(Wi,{signature:Qs,node:Ta}),Ta})(O.node);const ut=Jv(tt);let pt=h_(tt,ut);if((tt.type==="html_block"||tt.type==="html_inline")&&pt===o_[tt.type]){const It=tt,en=String((J=It.tag)!=null?J:"").trim().toLowerCase()||Yz(It.content);if(en){const cn=wi.value[en];if(Vo.value.has(en)&&cn)pt=cn,tt=Fn(Nt({},It),{type:en,tag:en,content:Rhe(It.content,en)});else if(Jz((he=It.content)!=null?he:It.raw,en)){const Cn=String((Le=(me=It.content)!=null?me:It.raw)!=null?Le:"");tt.type==="html_inline"?(pt=qo,tt={type:"text",content:Cn,raw:Cn}):(pt=vh,tt={type:"paragraph",children:[{type:"text",content:Cn,raw:Cn}],raw:Cn})}}}const Ge=tt.type==="code_block"&&m.value==="pre"&&pt===sl&&!n3(wi.value,ut);let ct=Nt({},(function(It,en,cn){const Cn=en??Jv(It);if(It.type==="code_block"){const vn=Cn?n3(wi.value,Cn):void 0;if(cn&&m.value==="pre"&&!vn&&cn===sl)return yG.value;if(cn&&Cn&&cn===vn)return Cn==="mermaid"?d_(It):Cn==="infographic"?f_(It):Cn==="d2"||Cn==="d2lang"?u_.value:l_.value;if(cn&&cn===wi.value.code_block)return l_.value;if(NS(cn))return kG.value}return Cn==="mermaid"?d_(It):Cn==="infographic"?f_(It):Cn==="d2"||Cn==="d2lang"?u_.value:It.type==="link"?CG.value:It.type==="list"?AG.value:It.type==="blockquote"?xG.value:It.type==="table"?SG.value:It.type==="code_block"?r_.value:xm.value})(tt,ut,pt));const xt=fi.value?Qh.value[O.index]:null;tt.type==="code_block"&&xt?.kind==="code-block"&&(ct=Fn(Nt({},ct),Ge?{reservedHeightPx:($e=xt.height)!=null?$e:xt.contentHeight}:{estimatedHeightPx:xt.height,estimatedContentHeightPx:xt.contentHeight,estimatedDiffInline:xt.diffInline})),Ge||tt.type!=="code_block"||ut!=="mermaid"||jp(ct.estimatedPreviewHeightPx)!=null||(ct=Fn(Nt({},ct),{estimatedPreviewHeightPx:i4(t4(String((Ze=tt.code)!=null?Ze:"")))})),Ge||tt.type!=="code_block"||ut!=="infographic"||jp(ct.estimatedPreviewHeightPx)!=null||(ct=Fn(Nt({},ct),{estimatedPreviewHeightPx:o4(n4(String((et=tt.code)!=null?et:"")))})),tt.type==="math_block"&&(ct=Fn(Nt({},ct),{cacheScope:Hi}));const vt=(function(It,en){const cn=String(It.type);return!Av(cn)&&wi.value[cn]===en})(tt,pt),Wt=vt?w7(tt,ke.value):void 0;return Fn(Nt({},O),{node:tt,component:pt,bindings:ct,customBindings:Nt(Nt({},Wt??{}),ct),rendersCustomNode:vt,hasSlotChildren:_G(tt),slotContent:String((mt=tt.content)!=null?mt:""),isCodeBlock:tt.type==="code_block",indexKey:`${gG.value}-${O.index}`,vnodeKey:`${eG.value}\0${O.index}\0${tt.type}`})}));function Jv(O){var J;return O?.type==="code_block"?String((J=O.language)!=null?J:"").trim().toLowerCase():""}function n3(O,J){const he=J.trim().toLowerCase();if(he)for(const me of[he,Ok(he),aH(he)]){const Le=me&&O[me];if(Le)return Le}}function c_(O,J,he,me){var Le,$e;const Ze=Nt({},O.value);return jp(Ze.estimatedPreviewHeightPx)==null&&(Ze.estimatedPreviewHeightPx=me(he(String((Le=J?.code)!=null?Le:"")),void 0,Ze.maxHeight==="none"?null:($e=jp(Ze.maxHeight))!=null?$e:void 0)),Ze}function d_(O){return c_(bG,O,t4,i4)}function f_(O){return c_(wG,O,n4,o4)}function h_(O,J){if(!O)return EC;const he=wi.value,me=he[String(O.type)];if(O.type==="code_block"){const Le=J??Jv(O),$e=Le?n3(he,Le):void 0;return $e||(m.value==="pre"?he.code_block||sl:Le==="mermaid"?he.mermaid||hG:Le==="infographic"?he.infographic||pG:Le==="d2"||Le==="d2lang"?he.d2||mG:me||he.code_block||DS.value)}return me||o_[String(O.type)]||EC}function i3(O){o("click",O)}function MG(O){var J;(J=O.target)!=null&&J.closest("[data-node-index]")&&o("mouseover",O)}function IG(O){var J;(J=O.target)!=null&&J.closest("[data-node-index]")&&o("mouseout",O)}function p_(O){o("mouseover",O)}function m_(O){o("mouseout",O)}const xf=V(null),Xr=V(!1),Sm=V(null),TG=D(()=>!(M.domMode!=="minimal"||re.value||M.fade!==!1||f.value||Xr.value||Ye.value||_n.value||Ir.value||Mo.value||vo.value||Object.keys(wi.value).length!==0));let _m,lp=null,o3=0,Xv=0,e2=0;const g_=["code_block","admonition","table","math_block","html_block","image","thematic_break"],EG=new Set(g_),v_=[".typewriter-cursor",".height-estimation-probes",...g_.map(O=>`[data-node-type="${O}"]`),"script","style"].join(",");function y_(O){if(!O||typeof O!="object")return!1;const J=O.type;return typeof J=="string"&&EG.has(J)}function t2(O){var J,he;if(!O||typeof O!="object")return 0;const me=O,Le=(he=(J=me.raw)!=null?J:me.content)!=null?he:me.code;if(typeof Le=="string")return Le.length;const $e=me.children;if(Array.isArray($e))return $e.reduce((et,mt)=>et+t2(mt),0);const Ze=me.items;return Array.isArray(Ze)?Ze.reduce((et,mt)=>et+t2(mt),0):0}function n2(){_m&&(clearTimeout(_m),_m=void 0)}function s3(){o3+=1,lp!=null&&($i?.(lp),lp=null)}function Mm(){s3(),Bc(),xf.value&&(xf.value.style.visibility="hidden")}function LG(O){var J;if(O.nodeType!==Node.TEXT_NODE||!((J=O.textContent)!=null?J:"").trim())return!1;const he=O.parentElement;return!!he&&!he.closest(v_)}function NG(O){let J=O.lastChild;for(;J;){if(LG(J))return J;if(J.nodeType===Node.ELEMENT_NODE){const he=J;if(!he.matches(v_)&&he.lastChild){J=he.lastChild;continue}}for(;J&&J!==O&&!J.previousSibling;)J=J.parentNode;if(!J||J===O)break;J=J.previousSibling}return null}function k_(){const O=Yv.value;for(let J=O.length-1;J>=0;J--){const he=O[J];if(!he||y_(he.node)||!Zv(he.index))continue;const me=ci.get(he.index);if(!me)continue;const Le=NG(me);if(Le)return Le}return null}function Bc(){Sm.value&&(Sm.value.classList.remove(fN),Sm.value=null)}function i2(){if(d.value!=="simple"||!K||!Xr.value||!$.value)return void Bc();const O=k_(),J=O?(function(he){var me;const Le=(me=he.parentElement)==null?void 0:me.closest(".text-node");return Le instanceof HTMLElement?Le:he.parentElement})(O):null;J!==Sm.value&&(Bc(),J&&(J.classList.add(fN),Sm.value=J))}function o2(){if(d.value!=="precise"||!K||!Xr.value||lp!=null)return;const O=o3,J=()=>{lp=null,O===o3&&(function(){var he,me;if(d.value!=="precise"||!(K&&Xr.value&&$.value&&xf.value))return;const Le=$.value,$e=xf.value;$e.style.visibility="hidden";const Ze=k_();if(!Ze)return;let et=0,mt=0,tt=20,ut=!1;if(Ze?.textContent){const pt=Ze.textContent.length,Ge=document.createRange();Ge.setStart(Ze,Math.max(0,pt-1)),Ge.setEnd(Ze,pt);const ct=typeof Ge.getClientRects=="function"?Ge.getClientRects():void 0,xt=(me=ct?.[ct.length-1])!=null?me:(he=Ze.parentElement)==null?void 0:he.getBoundingClientRect();if(xt){const vt=Qt("typewriterCursor.root.getBoundingClientRect",()=>Le.getBoundingClientRect());et=xt.right-vt.left+Le.scrollLeft,mt=xt.top-vt.top+Le.scrollTop,tt=xt.height||tt,ut=!0}Ge.detach()}ut&&($e.style.transform=`translate(${Math.max(0,et)}px, ${Math.max(0,mt)}px)`,$e.style.height=`${tt}px`,$e.style.visibility="visible")})()};Oi?lp=Oi(J):J()}return We([qe,()=>i.content,()=>i.nodes,()=>M.typewriter,ht],()=>ro(null,null,function*(){var O,J;if(!K||re.value||!le.value)return;if(ht.value)return Xr.value=!1,n2(),void Mm();if((O=i.nodes)!=null&&O.length)return Xr.value=!1,n2(),Mm(),Xv=((J=i.content)!=null?J:"").length,void(e2=qe.value.length);const he=(function(){var et,mt;return(et=i.nodes)!=null&&et.length?i.nodes.reduce((tt,ut)=>tt+t2(ut),0):((mt=i.content)!=null?mt:"").length})(),me=(function(){var et;return(et=i.nodes)!=null&&et.length?i.nodes.reduce((mt,tt)=>mt+t2(tt),0):qe.value.length})(),Le=!y_(Ue.value[Ue.value.length-1]),$e=he>Xv,Ze=me>e2;if(!f.value||!Le||!$e&&!Ze)return f.value&&Le||(Xr.value=!1,Mm()),Xv=he,void(e2=me);Xv=he,e2=me,Xr.value=!0,d.value==="precise"&&xf.value&&(xf.value.style.visibility="hidden"),n2(),yield ft(),d.value==="simple"?i2():(Bc(),o2()),_m=setTimeout(()=>{_m=void 0,Xr.value=!1},3e3)}),{flush:"post",immediate:!0}),We(Xr,O=>ro(null,null,function*(){O?(yield ft(),d.value!=="simple"?(Bc(),d.value==="precise"&&o2()):i2()):Mm()}),{flush:"post"}),We(d,()=>ro(null,null,function*(){if(K&&!re.value&&le.value&&Xr.value){if(yield ft(),d.value==="simple")return s3(),void i2();Bc(),d.value!=="precise"?Mm():o2()}}),{flush:"post"}),We([()=>ti.value,()=>jn.start,()=>jn.end],()=>ro(null,null,function*(){K&&!re.value&&le.value&&Xr.value&&(yield ft(),d.value!=="simple"?(Bc(),d.value==="precise"&&o2()):i2())}),{flush:"post"}),Xn(()=>{n2(),s3(),Bc(),mi.clear()}),(O,J)=>{const he=uY("NodeRenderer",!0);return p(re)?(k(!0),L(De,{key:0},Ct(Yv.value,me=>(k(),L(De,{key:me.vnodeKey},[me.rendersCustomNode?(k(),de(zo(me.component),di({key:0,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onClick:i3,onMouseover:p_,onMouseout:m_,onCopy:J[0]||(J[0]=Le=>s(Le)),onHandleArtifactClick:J[1]||(J[1]=Le=>o("handleArtifactClick",Le))}),{default:ue(()=>[me.hasSlotChildren?(k(),de(he,di({key:0,ref_for:!0},kt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,di({key:1,ref_for:!0},kt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(zo(me.component),di({key:1,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onClick:i3,onMouseover:p_,onMouseout:m_,onCopy:J[2]||(J[2]=Le=>s(Le)),onHandleArtifactClick:J[3]||(J[3]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),L("div",{key:1,ref_key:"containerRef",ref:$,class:Re(["markstream-vue markdown-renderer",[{dark:M.isDark},{virtualized:_n.value},{"virtual-scroll-coordinated":to.value},{"stable-layout":Pt.value},{"typewriter-simple-cursor":Xr.value&&d.value==="simple"}]]),"data-custom-id":M.customId,onClick:i3,onMouseover:MG,onMouseout:IG},[Zi.value||_n.value?(k(),L(De,{key:0},[Zi.value?(k(),de(W9e,{key:0,width:ri.value,"flow-root":_n.value||to.value,"paragraph-node":co.value,"list-item-node":Ns.value,"list-node":Ds.value,"heading-nodes":Fs.value,"set-paragraph-wrapper":Jt,"set-list-item-wrapper":gn,"set-list-wrapper":En,"set-heading-wrapper":YZ},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),_n.value?(k(),L("div",{key:1,class:"node-spacer",style:sn({height:`${xb.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),TG.value?(k(!0),L(De,{key:1},Ct(Yv.value,me=>(k(),L(De,{key:me.vnodeKey},[Zv(me.index)?(k(),de(zo(me.component),di({key:0,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onMouseover:J[4]||(J[4]=Le=>o("mouseover",Le)),onMouseout:J[5]||(J[5]=Le=>o("mouseout",Le)),onCopy:J[6]||(J[6]=Le=>s(Le)),onHandleArtifactClick:J[7]||(J[7]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(k(!0),L(De,{key:2},Ct(Yv.value,me=>(k(),L("div",{key:me.vnodeKey,ref_for:!0,ref:Le=>Gv(me.index,Le),class:"node-slot","data-node-index":me.index,"data-node-type":me.node.type},[Zv(me.index)?(k(),L("div",{key:0,ref_for:!0,ref:Le=>(function($e,Ze){var et;Ze||(function(pt){const Ge=`${_b()}-${pt}`;let ct=!1;for(const xt of Array.from(Er.keys())){const vt=Ks.get(xt);(vt?.index===pt||xt===Ge||xt.startsWith(`${Ge}-`))&&(Er.delete(xt),Ks.delete(xt),ct=!0)}ct&&(Yh(),oo("async-node"))})($e),ea.delete($e),(function(pt){var Ge;const ct=((Ge=Xl.get(pt))!=null?Ge:0)+1;Xl.set(pt,ct)})($e);const mt=Ma.get($e);if(mt){for(const pt of mt)Ke(pt);Ma.delete($e)}if((function(pt){const Ge=Ro.get(pt);Ge&&(ni?.unobserve(Ge),yo.delete(Ge),Ro.delete(pt))})($e),!Ze||!gs.value)return ws.delete($e),void Xl.delete($e);ws.set($e,Ze);const tt=()=>{Qv($e,Ze)};queueMicrotask(tt);const ut=(ni||typeof ResizeObserver>"u"||(ni=new ResizeObserver(pt=>{if(pt.length)for(const Ge of pt){const ct=yo.get(Ge.target),xt=Ro.get(ct??-1);ct!=null&&xt&&Qv(ct,xt)}else qu()})),ni);if(ut&&(Ro.set($e,Ze),yo.set(Ze,$e),ut.observe(Ze)),typeof window<"u"){const pt=((et=Ue.value[$e])==null?void 0:et.type)==="code_block"?[16,80,240,800]:ht.value?[80]:[];if(pt.length){const Ge=pt.map(ct=>at(ct,tt,"node-resize")).filter(ct=>ct!=null);Ge.length&&Ma.set($e,Ge)}}})(me.index,Le),class:"node-content"},[me.isCodeBlock?me.rendersCustomNode?(k(),de(zo(me.component),di({key:1,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[12]||(J[12]=Le=>s(Le)),onHandleArtifactClick:J[13]||(J[13]=Le=>o("handleArtifactClick",Le))}),{default:ue(()=>[me.hasSlotChildren?(k(),de(he,di({key:0,ref_for:!0},kt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,di({key:1,ref_for:!0},kt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(zo(me.component),di({key:2,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[14]||(J[14]=Le=>s(Le)),onHandleArtifactClick:J[15]||(J[15]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),de(mo,{key:0,name:"fade",css:M.fade!==!1,appear:M.fade!==!1},{default:ue(()=>[me.rendersCustomNode?(k(),de(zo(me.component),di({key:0,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[8]||(J[8]=Le=>s(Le)),onHandleArtifactClick:J[9]||(J[9]=Le=>o("handleArtifactClick",Le))}),{default:ue(()=>[me.hasSlotChildren?(k(),de(he,di({key:0,ref_for:!0},kt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,di({key:1,ref_for:!0},kt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(zo(me.component),di({key:1,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[10]||(J[10]=Le=>s(Le)),onHandleArtifactClick:J[11]||(J[11]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),L("div",{key:1,class:"node-placeholder",style:sn({height:`${Sl(me.index)}px`})},null,4))],8,V9e))),128)),Xr.value&&d.value==="precise"?(k(),L("span",{key:3,ref_key:"typewriterCursorRef",ref:xf,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),_n.value?(k(),L("div",{key:4,class:"node-spacer",style:sn({height:`${Sb.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,U9e))}}})),[["__scopeId","data-v-a9489508"]]),ml=zH;ml.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",ml.__name,ml.name].filter(n=>!!n));for(const n of t)e.component(n,zH)};const B7=Object.freeze(Object.defineProperty({__proto__:null,default:ml},Symbol.toStringTag,{value:"Module"})),K9e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Z9e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},G9e={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Q9e={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Y9e={class:"admonition-title"},J9e=["aria-expanded","aria-controls"],X9e=["id"],Vy=Ri(rt({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=V(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),L("div",{class:Re(["admonition",[`admonition-${i.node.kind}`]])},[A("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),L("svg",K9e,[...c[1]||(c[1]=[A("circle",{cx:"12",cy:"12",r:"10"},null,-1),A("path",{d:"M12 16v-4"},null,-1),A("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),L("svg",Z9e,[...c[2]||(c[2]=[A("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),A("path",{d:"M9 18h6"},null,-1),A("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),L("svg",G9e,[...c[3]||(c[3]=[A("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),A("path",{d:"M12 9v4"},null,-1),A("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),L("svg",Q9e,[...c[4]||(c[4]=[A("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),A("path",{d:"M12 8v4"},null,-1),A("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),A("span",Y9e,F(s.value),1),i.node.collapsible?(k(),L("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),L("svg",{style:sn({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[A("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,J9e)):ee("",!0)]),ai(A("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[U(p(ml),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,X9e),[[Qo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Vy.install=e=>{e.component(Vy.__name,Vy)};const BC=()=>Jo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let H2=null,W2=BC,q2=null,hN=!1,pN=!1;function h9t(){return ro(this,null,function*(){if(H2)return H2;const e=W2;return e?e===BC&&hN?null:q2||(q2=ro(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===BC)return e===W2&&(hN=!0,(function(i){pN||(pN=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===W2&&(q2=null)}return e!==W2?null:t?(H2=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),H2):null}),q2):null})}let U2=null,jH=null,V2=null;function p9t(){return typeof jH=="function"}function m9t(){return ro(this,null,function*(){if(U2)return U2;const e=jH;return e?V2||(V2=ro(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(U2=n,U2):null}).finally(()=>{V2=null}),V2):null})}const g9t=Symbol("markstreamLanguageIconResolver");function e4e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function t4e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let mN=!1;function HH(){mN||typeof Worker>"u"||(mN=!0,Nve(new e4e),Uve(new t4e))}HH();function fd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function gN(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const R7={},h4=Symbol("resolveImage");class bu extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class la extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class O7 extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function qi(e){return e instanceof bu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Hk(e){return e instanceof la||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function n4e(e){return Hk(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function i4e(e){return e instanceof O7||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const o4e=41301,s4e=40922;function vN(e){return qi(e)&&e.code===s4e}const Ju=3e4,K2=5*6e4,yN=5*6e4,WH="0123456789ABCDEFGHJKMNPQRSTVWXYZ",RC=500,qH=40101;function kN(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function Z2(e=Ju){try{return AbortSignal.timeout(e)}catch{return}}function r4e(e,t){let n="",i=e;for(let o=0;oWH[n%32]).join("")}function Wm(){return`${r4e(Date.now(),10)}${l4e(16)}`}function bN(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function T8(e){try{const t=await e.text();return t?t.length>RC?`${t.slice(0,RC)}...`:t:void 0}catch{return}}class wN{constructor(t){this.opts=t,this.tracer=t.tracer??R7}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=fd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;kN(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=Wm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:Z2()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new la({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ju,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new O7({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new bu({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i?.allowCodes,i?.timeoutMs)}async postZip(t,n,i){const o="POST",s=fd(this.opts.origin,t,this.opts.restBasePath),r=Wm(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:Z2(K2)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new la({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:K2,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const v=h?.code??u.status,y=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:v,msg:y,envelopeRequestId:h?.request_id}),new bu({code:v,msg:y,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new la({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:K2,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await T8(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new la({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:K2,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=fd(this.opts.origin,t,this.opts.restBasePath),s=Wm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:bN(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:Z2()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new la({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ju,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new la({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Ju,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await T8(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new bu({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=fd(this.opts.origin,t,this.opts.restBasePath),s=Wm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:bN(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=Ju;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new la({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ju,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new la({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ju,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new la({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Ju,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,RC),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new bu({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s=[],r=Ju){let l=fd(this.opts.origin,n,this.opts.restBasePath);if(o){const m=new URLSearchParams;kN(m,o);const g=m.toString();g&&(l=`${l}?${g}`)}const a=Wm(),u={"X-Request-Id":a};this.addClientHeaders(u),i!==void 0&&(u["Content-Type"]="application/json; charset=utf-8");const c=Date.now();this.tracer.restRequest?.({method:t,path:n,url:l,requestId:a,body:i});let d;try{d=await fetch(l,{method:t,headers:u,body:i!==void 0?JSON.stringify(i):void 0,signal:Z2(r)})}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"fetch",durationMs:Date.now()-c,error:m}),new la({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"fetch",timeoutMs:r,timestamp:Date.now(),durationMs:Date.now()-c})}let f;const h=d.clone();try{const m=await d.text();f=d.status===204&&m===""?{code:0,msg:"",data:null,request_id:a}:JSON.parse(m)}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"parse",durationMs:Date.now()-c,status:d.status,error:m}),new la({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"parse",timeoutMs:r,status:d.status,statusText:d.statusText,contentType:d.headers.get("content-type")??void 0,bodyPreview:await T8(h),timestamp:Date.now(),durationMs:Date.now()-c})}if(this.tracer.restResponse?.({method:t,path:n,requestId:a,status:d.status,durationMs:Date.now()-c,code:f.code,msg:f.msg,envelopeRequestId:f.request_id,data:f.data}),this.checkAuthRequired(d,f.code),f.code!==0&&!s.includes(f.code))throw new bu({code:typeof f.code=="number"?f.code:d.status,msg:typeof f.msg=="string"&&f.msg.length>0?f.msg:`HTTP ${d.status}${d.statusText?` ${d.statusText}`:""}`,requestId:f.request_id??a,details:f.details,timestamp:Date.now(),durationMs:Date.now()-c});return f.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===qH)&&this.opts.credentialStore?.markAuthRequired?.()}}function UH(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function CN(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function hu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:UH(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function G2(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function Yg(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function AN(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function $7(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:AN(e.source)};case"video":return{type:"video",source:AN(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function VH(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map($7),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function KH(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function a4e(e){return{content:e.content.map(KH),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function u4e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function c4e(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function d4e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function f4e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(d4e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function h4e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(f4e),createdAt:e.created_at}}function p4e(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function m4e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=p4e(i);return{answers:t,method:e.method,note:e.note}}function OC(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function xN(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Vc(e,t){const n=e[t];return typeof n=="string"?n:void 0}function yp(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ia(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ZH(e){if(!e||typeof e!="object")return null;const t=e,n=Vc(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:Vc(t,"goalId")??Vc(t,"goal_id")??"goal",objective:Vc(t,"objective")??"",completionCriterion:Vc(t,"completionCriterion")??Vc(t,"completion_criterion"),status:n,turnsUsed:yp(t,"turnsUsed")??yp(t,"turns_used")??0,tokensUsed:yp(t,"tokensUsed")??yp(t,"tokens_used")??0,wallClockMs:yp(t,"wallClockMs")??yp(t,"wall_clock_ms")??0,terminalReason:Vc(t,"terminalReason")??Vc(t,"terminal_reason"),budget:{tokenBudget:ia(o,"tokenBudget")??ia(o,"token_budget"),remainingTokens:ia(o,"remainingTokens")??ia(o,"remaining_tokens"),turnBudget:ia(o,"turnBudget")??ia(o,"turn_budget"),remainingTurns:ia(o,"remainingTurns")??ia(o,"remaining_turns"),wallClockBudgetMs:ia(o,"wallClockBudgetMs")??ia(o,"wall_clock_budget_ms"),remainingWallClockMs:ia(o,"remainingWallClockMs")??ia(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function g4e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:hu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:hu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:Yg(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Yg(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:UH(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=ZH(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:VH(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map($7),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:c4e(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:h4e(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:OC(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:$C(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function v4e(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function kp(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function SN(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function $C(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function y4e(e){return e.session_id}function k4e(e){return e.seq}function b4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function _N(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const w4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function C4e(e,t){switch(t.op){case"reset":return A4e(e,t);case"turn.upsert":return S4e(e,t.turn);case"step.upsert":return M4e(e,t.turnId,t.step);case"frame.upsert":return T4e(e,t);case"append":return L4e(e,t);case"marker.upsert":return IN(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return IN(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return F4e(e,t.task);case"interaction.upsert":return B4e(e,t.interaction);case"attachment.upsert":return O4e(e,t.attachment);case"todo.upsert":return P4e(e,t.todo);case"prompt.upsert":return j4e(e,t.prompt);case"meta.merge":return q4e(e,t.meta);case"items.remove":return D4e(e,t.ids)}}function A4e(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function MN(e,t){return{...e,kind:"turn",steps:[...t]}}function GH(e){return{kind:"turn",turnId:e,ordinal:b4e(e),state:"running",origin:{kind:"other"},steps:[]}}function x4e(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function M1(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function P7(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function Wk(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function S4e(e,t){const n=M1(e,t.turnId);return n?_4e(n,t)?{state:e,changed:!1}:{state:{...e,items:Wk(e.items,t.turnId,i=>MN(t,i.steps))},changed:!0}:{state:{...e,items:P7(e.items,MN(t,[]))},changed:!0}}function _4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function M4e(e,t,n){const i=M1(e,t)??GH(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&I4e(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=M1(e,t)?Wk(e.items,t,()=>l):P7(e.items,l);return{state:{...e,items:a},changed:!0}}function I4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function T4e(e,t){const n=M1(e,t.turnId)??GH(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??x4e(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&E4e(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=M1(e,t.turnId)?Wk(e.items,t.turnId,()=>a):P7(e.items,a);return{state:{...e,items:u},changed:!0}}function E4e(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function L4e(e,t){if(t.target.type==="task")return N4e(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=M1(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=QH(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:Wk(e.items,n,()=>d)},changed:!0}}function N4e(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=QH(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function QH(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function IN(e,t,n,i){if(e.items.some(s=>PC(s)===n)){let s=!1;const r=e.items.map(l=>PC(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function PC(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function D4e(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(PC(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function F4e(e,t){const n=e.tasks.get(t.taskId);if(n&&W4e(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function B4e(e,t){const n=e.interactions.get(t.interactionId);if(n&&R4e(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function R4e(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function O4e(e,t){const n=e.attachments.get(t.attachmentId);if(n&&$4e(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function $4e(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function P4e(e,t){const n=e.todos.get(t.todoId);if(n&&z4e(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function z4e(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function j4e(e,t){const n=e.prompts.get(t.promptId);if(n&&H4e(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function H4e(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function W4e(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function q4e(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class U4e{constructor(t){this.agentId=t}#e=w4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=C4e(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Mt(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class c1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class YH extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const JH={};function Wd(e){return JH}function XH(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function zC(e,t){return typeof t=="bigint"?t.toString():t}function qk(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function z7(e){return e==null}function j7(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function V4e(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const TN=Symbol("evaluating");function ji(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==TN)return i===void 0&&(i=TN,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Vh(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function EN(e){return JSON.stringify(e)}function K4e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eW="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function R0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Z4e=qk(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function I1(e){if(R0(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(R0(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tW(e){return I1(e)?{...e}:Array.isArray(e)?[...e]:e}const G4e=new Set(["string","number","symbol"]);function T1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Mn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Q4e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Y4e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function J4e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=sf(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return Vh(this,"shape",r),r},checks:[]});return rf(e,s)}function X4e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=sf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return Vh(this,"shape",r),r},checks:[]});return rf(e,s)}function eke(e,t){if(!I1(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=sf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Vh(this,"shape",s),s}});return rf(e,o)}function tke(e,t){if(!I1(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=sf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Vh(this,"shape",i),i}});return rf(e,n)}function nke(e,t){const n=sf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Vh(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return rf(e,n)}function ike(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=sf(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return Vh(this,"shape",a),a},checks:[]});return rf(t,r)}function oke(e,t,n){const i=sf(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return Vh(this,"shape",s),s}});return rf(t,i)}function Wp(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Q2(e){return typeof e=="string"?e:e?.message}function qd(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Q2(e.inst?._zod.def?.error?.(e))??Q2(t?.error?.(e))??Q2(n.customError?.(e))??Q2(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function H7(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function O0(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const nW=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zC,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iW=Mt("$ZodError",nW),oW=Mt("$ZodError",nW,{Parent:Error});function ske(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function rke(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new c1;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>qd(a,s,Wd())));throw eW(l,o?.callee),l}return r.value},q7=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>qd(a,s,Wd())));throw eW(l,o?.callee),l}return r.value},Uk=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new c1;return s.issues.length?{success:!1,error:new(e??iW)(s.issues.map(r=>qd(r,o,Wd())))}:{success:!0,data:s.value}},lke=Uk(oW),Vk=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>qd(r,o,Wd())))}:{success:!0,data:s.value}},ake=Vk(oW),uke=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return W7(e)(t,n,o)},cke=e=>(t,n,i)=>W7(e)(t,n,i),dke=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return q7(e)(t,n,o)},fke=e=>async(t,n,i)=>q7(e)(t,n,i),hke=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Uk(e)(t,n,o)},pke=e=>(t,n,i)=>Uk(e)(t,n,i),mke=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Vk(e)(t,n,o)},gke=e=>async(t,n,i)=>Vk(e)(t,n,i),vke=/^[cC][^\s-]{8,}$/,yke=/^[0-9a-z]+$/,kke=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bke=/^[0-9a-vA-V]{20}$/,wke=/^[A-Za-z0-9]{27}$/,Cke=/^[a-zA-Z0-9_-]{21}$/,Ake=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xke=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,LN=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ske=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_ke="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Mke(){return new RegExp(_ke,"u")}const Ike=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Eke=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nke=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sW=/^[A-Za-z0-9_-]*$/,Dke=/^\+[1-9]\d{6,14}$/,rW="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Fke=new RegExp(`^${rW}$`);function lW(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Bke(e){return new RegExp(`^${lW(e)}$`)}function Rke(e){const t=lW({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${rW}T(?:${i})$`)}const Oke=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$ke=/^-?\d+$/,aW=/^-?\d+(?:\.\d+)?$/,Pke=/^(?:true|false)$/i,zke=/^[^A-Z]*$/,jke=/^[^a-z]*$/,wl=Mt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uW={number:"number",bigint:"bigint",object:"date"},cW=Mt("$ZodCheckLessThan",(e,t)=>{wl.init(e,t);const n=uW[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{wl.init(e,t);const n=uW[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hke=Mt("$ZodCheckMultipleOf",(e,t)=>{wl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):V4e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wke=Mt("$ZodCheckNumberFormat",(e,t)=>{wl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=Y4e[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=$ke)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),qke=Mt("$ZodCheckMaxLength",(e,t)=>{var n;wl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!z7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=H7(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Uke=Mt("$ZodCheckMinLength",(e,t)=>{var n;wl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!z7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=H7(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Vke=Mt("$ZodCheckLengthEquals",(e,t)=>{var n;wl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!z7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=H7(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Kk=Mt("$ZodCheckStringFormat",(e,t)=>{var n,i;wl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Kke=Mt("$ZodCheckRegex",(e,t)=>{Kk.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Zke=Mt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=zke),Kk.init(e,t)}),Gke=Mt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jke),Kk.init(e,t)}),Qke=Mt("$ZodCheckIncludes",(e,t)=>{wl.init(e,t);const n=T1(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Yke=Mt("$ZodCheckStartsWith",(e,t)=>{wl.init(e,t);const n=new RegExp(`^${T1(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Jke=Mt("$ZodCheckEndsWith",(e,t)=>{wl.init(e,t);const n=new RegExp(`.*${T1(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),Xke=Mt("$ZodCheckOverwrite",(e,t)=>{wl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ebe{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` `).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` -`))}}const nbe={major:4,minor:3,patch:6},No=Mt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nbe;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=Hp(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new c1;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=Hp(r,f)))});else{if(r.issues.length===f)continue;u||(u=Hp(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(Hp(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new c1;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new c1;return a.then(u=>o(u,i,l))}return o(a,i,l)}}zi(e,"~standard",()=>({validate:o=>{try{const s=ake(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return uke(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),V7=Mt("$ZodString",(e,t)=>{No.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Oke(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),So=Mt("$ZodStringFormat",(e,t)=>{Zk.init(e,t),V7.init(e,t)}),ibe=Mt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ske),So.init(e,t)}),obe=Mt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=EN(i))}else t.pattern??(t.pattern=EN());So.init(e,t)}),sbe=Mt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_ke),So.init(e,t)}),rbe=Mt("$ZodURL",(e,t)=>{So.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lbe=Mt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ike()),So.init(e,t)}),abe=Mt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ake),So.init(e,t)}),ube=Mt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=yke),So.init(e,t)}),cbe=Mt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=kke),So.init(e,t)}),dbe=Mt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bke),So.init(e,t)}),fbe=Mt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wke),So.init(e,t)}),hbe=Mt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cke),So.init(e,t)}),pbe=Mt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=$ke(t)),So.init(e,t)}),mbe=Mt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Bke),So.init(e,t)}),gbe=Mt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Rke(t)),So.init(e,t)}),vbe=Mt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=xke),So.init(e,t)}),ybe=Mt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Tke),So.init(e,t),e._zod.bag.format="ipv4"}),kbe=Mt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Eke),So.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),bbe=Mt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Lke),So.init(e,t)}),wbe=Mt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Nke),So.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fW(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Cbe=Mt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Dke),So.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fW(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Abe(e){if(!sW.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fW(n)}const xbe=Mt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sW),So.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Abe(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Sbe=Mt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Fke),So.init(e,t)});function _be(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Mbe=Mt("$ZodJWT",(e,t)=>{So.init(e,t),e._zod.check=n=>{_be(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hW=Mt("$ZodNumber",(e,t)=>{No.init(e,t),e._zod.pattern=e._zod.bag.pattern??aW,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Ibe=Mt("$ZodNumberFormat",(e,t)=>{qke.init(e,t),hW.init(e,t)}),Tbe=Mt("$ZodBoolean",(e,t)=>{No.init(e,t),e._zod.pattern=zke,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Ebe=Mt("$ZodUnknown",(e,t)=>{No.init(e,t),e._zod.parse=n=>n}),Lbe=Mt("$ZodNever",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function LN(e,t,n){e.issues.length&&t.issues.push(...Wp(n,e.issues)),t.value[n]=e.value}const Nbe=Mt("$ZodArray",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rLN(u,n,r))):LN(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function m4(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...Wp(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pW(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Y4e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function mW(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>m4(h,n,d,t,c))):m4(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Dbe=Mt("$ZodObject",(e,t)=>{if(No.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=Uk(()=>pW(t));zi(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=$0,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(v=>m4(v,l,f,u,m))):m4(g,l,f,u,m)}return s?mW(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),Fbe=Mt("$ZodObjectJIT",(e,t)=>{Dbe.init(e,t);const n=e._zod.parse,i=Uk(()=>pW(t)),o=f=>{const h=new tbe(["shape","payload","ctx"]),m=i.value,g=w=>{const C=TN(w);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const w of m.keys)v[w]=`key_${y++}`;h.write("const newResult = {};");for(const w of m.keys){const C=v[w],T=TN(w),I=f[w]?._zod?.optout==="optional";h.write(`const ${C} = ${g(w)};`),I?h.write(` +`))}}const tbe={major:4,minor:3,patch:6},Lo=Mt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tbe;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=Wp(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new c1;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=Wp(r,f)))});else{if(r.issues.length===f)continue;u||(u=Wp(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(Wp(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new c1;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new c1;return a.then(u=>o(u,i,l))}return o(a,i,l)}}ji(e,"~standard",()=>({validate:o=>{try{const s=lke(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ake(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),U7=Mt("$ZodString",(e,t)=>{Lo.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Oke(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),So=Mt("$ZodStringFormat",(e,t)=>{Kk.init(e,t),U7.init(e,t)}),nbe=Mt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xke),So.init(e,t)}),ibe=Mt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=LN(i))}else t.pattern??(t.pattern=LN());So.init(e,t)}),obe=Mt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ske),So.init(e,t)}),sbe=Mt("$ZodURL",(e,t)=>{So.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),rbe=Mt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Mke()),So.init(e,t)}),lbe=Mt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Cke),So.init(e,t)}),abe=Mt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vke),So.init(e,t)}),ube=Mt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yke),So.init(e,t)}),cbe=Mt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=kke),So.init(e,t)}),dbe=Mt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bke),So.init(e,t)}),fbe=Mt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wke),So.init(e,t)}),hbe=Mt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Rke(t)),So.init(e,t)}),pbe=Mt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Fke),So.init(e,t)}),mbe=Mt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Bke(t)),So.init(e,t)}),gbe=Mt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ake),So.init(e,t)}),vbe=Mt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ike),So.init(e,t),e._zod.bag.format="ipv4"}),ybe=Mt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Tke),So.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),kbe=Mt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Eke),So.init(e,t)}),bbe=Mt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Lke),So.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fW(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wbe=Mt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Nke),So.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fW(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Cbe(e){if(!sW.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fW(n)}const Abe=Mt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sW),So.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Cbe(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),xbe=Mt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Dke),So.init(e,t)});function Sbe(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const _be=Mt("$ZodJWT",(e,t)=>{So.init(e,t),e._zod.check=n=>{Sbe(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hW=Mt("$ZodNumber",(e,t)=>{Lo.init(e,t),e._zod.pattern=e._zod.bag.pattern??aW,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Mbe=Mt("$ZodNumberFormat",(e,t)=>{Wke.init(e,t),hW.init(e,t)}),Ibe=Mt("$ZodBoolean",(e,t)=>{Lo.init(e,t),e._zod.pattern=Pke,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Tbe=Mt("$ZodUnknown",(e,t)=>{Lo.init(e,t),e._zod.parse=n=>n}),Ebe=Mt("$ZodNever",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function NN(e,t,n){e.issues.length&&t.issues.push(...qp(n,e.issues)),t.value[n]=e.value}const Lbe=Mt("$ZodArray",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rNN(u,n,r))):NN(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function p4(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...qp(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pW(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Q4e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function mW(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>p4(h,n,d,t,c))):p4(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Nbe=Mt("$ZodObject",(e,t)=>{if(Lo.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=qk(()=>pW(t));ji(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=R0,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(v=>p4(v,l,f,u,m))):p4(g,l,f,u,m)}return s?mW(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),Dbe=Mt("$ZodObjectJIT",(e,t)=>{Nbe.init(e,t);const n=e._zod.parse,i=qk(()=>pW(t)),o=f=>{const h=new ebe(["shape","payload","ctx"]),m=i.value,g=w=>{const C=EN(w);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const w of m.keys)v[w]=`key_${y++}`;h.write("const newResult = {};");for(const w of m.keys){const C=v[w],T=EN(w),I=f[w]?._zod?.optout==="optional";h.write(`const ${C} = ${g(w)};`),I?h.write(` if (${C}.issues.length) { if (${T} in input) { payload.issues = payload.issues.concat(${C}.issues.map(iss => ({ @@ -289,47 +289,47 @@ ${w}`);c+=I}else c+=N;c+=y,d=h?f+1:e.length}return c}function S0e(e,t){if(!e||!t newResult[${T}] = ${C}.value; } - `)}h.write("payload.value = newResult;"),h.write("return payload;");const b=h.compile();return(w,C)=>b(f,w,C)};let s;const r=$0,l=!JH.jitless,u=l&&G4e.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?mW([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function NN(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Hp(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>qd(r,i,Wd())))}),t)}const gW=Mt("$ZodUnion",(e,t)=>{No.init(e,t),zi(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),zi(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),zi(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),zi(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>H7(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>NN(a,o,e,s)):NN(l,o,e,s)}}),Bbe=Mt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gW.init(e,t);const n=e._zod.parse;zi(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=Uk(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!$0(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),Rbe=Mt("$ZodIntersection",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>DN(n,a,u)):DN(n,s,r)}});function HC(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(I1(e)&&I1(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=HC(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),Hp(e))return e;const r=HC(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const $be=Mt("$ZodRecord",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!I1(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...Wp(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...Wp(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&aW.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>qd(d,i,Wd())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...Wp(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...Wp(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Obe=Mt("$ZodEnum",(e,t)=>{No.init(e,t);const n=XH(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>Q4e.has(typeof o)).map(o=>typeof o=="string"?T1(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),Pbe=Mt("$ZodLiteral",(e,t)=>{if(No.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?T1(i):i?T1(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),zbe=Mt("$ZodTransform",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new YH(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new c1;return n.value=o,n}});function FN(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vW=Mt("$ZodOptional",(e,t)=>{No.init(e,t),e._zod.optin="optional",e._zod.optout="optional",zi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),zi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${H7(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>FN(s,n.value)):FN(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),jbe=Mt("$ZodExactOptional",(e,t)=>{vW.init(e,t),zi(e._zod,"values",()=>t.innerType._zod.values),zi(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),Hbe=Mt("$ZodNullable",(e,t)=>{No.init(e,t),zi(e._zod,"optin",()=>t.innerType._zod.optin),zi(e._zod,"optout",()=>t.innerType._zod.optout),zi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${H7(n.source)}|null)$`):void 0}),zi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),Wbe=Mt("$ZodDefault",(e,t)=>{No.init(e,t),e._zod.optin="optional",zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>BN(s,t)):BN(o,t)}});function BN(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const qbe=Mt("$ZodPrefault",(e,t)=>{No.init(e,t),e._zod.optin="optional",zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),Ube=Mt("$ZodNonOptional",(e,t)=>{No.init(e,t),zi(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>RN(s,e)):RN(o,e)}});function RN(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Vbe=Mt("$ZodCatch",(e,t)=>{No.init(e,t),zi(e._zod,"optin",()=>t.innerType._zod.optin),zi(e._zod,"optout",()=>t.innerType._zod.optout),zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>qd(r,i,Wd()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>qd(s,i,Wd()))},input:n.value}),n.issues=[]),n)}}),Kbe=Mt("$ZodPipe",(e,t)=>{No.init(e,t),zi(e._zod,"values",()=>t.in._zod.values),zi(e._zod,"optin",()=>t.in._zod.optin),zi(e._zod,"optout",()=>t.out._zod.optout),zi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>J2(r,t.in,i)):J2(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>J2(s,t.out,i)):J2(o,t.out,i)}});function J2(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Zbe=Mt("$ZodReadonly",(e,t)=>{No.init(e,t),zi(e._zod,"propValues",()=>t.innerType._zod.propValues),zi(e._zod,"values",()=>t.innerType._zod.values),zi(e._zod,"optin",()=>t.innerType?._zod?.optin),zi(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then($N):$N(o)}});function $N(e){return e.value=Object.freeze(e.value),e}const Gbe=Mt("$ZodCustom",(e,t)=>{bl.init(e,t),No.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>ON(s,n,i,e));ON(o,n,i,e)}});function ON(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(O0(o))}}var PN;class Qbe{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Ybe(){return new Qbe}(PN=globalThis).__zod_globalRegistry??(PN.__zod_globalRegistry=Ybe());const hg=globalThis.__zod_globalRegistry;function Jbe(e,t){return new e({type:"string",...Sn(t)})}function Xbe(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Sn(t)})}function zN(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Sn(t)})}function e3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Sn(t)})}function t3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Sn(t)})}function n3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Sn(t)})}function i3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Sn(t)})}function o3e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Sn(t)})}function s3e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Sn(t)})}function r3e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Sn(t)})}function l3e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Sn(t)})}function a3e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Sn(t)})}function u3e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Sn(t)})}function c3e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Sn(t)})}function d3e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Sn(t)})}function f3e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Sn(t)})}function h3e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Sn(t)})}function p3e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Sn(t)})}function m3e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Sn(t)})}function g3e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Sn(t)})}function v3e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Sn(t)})}function y3e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Sn(t)})}function k3e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Sn(t)})}function b3e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Sn(t)})}function w3e(e,t){return new e({type:"string",format:"date",check:"string_format",...Sn(t)})}function C3e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Sn(t)})}function A3e(e,t){return new e({type:"string",format:"duration",check:"string_format",...Sn(t)})}function x3e(e,t){return new e({type:"number",checks:[],...Sn(t)})}function S3e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Sn(t)})}function _3e(e,t){return new e({type:"boolean",...Sn(t)})}function M3e(e){return new e({type:"unknown"})}function I3e(e,t){return new e({type:"never",...Sn(t)})}function jN(e,t){return new cW({check:"less_than",...Sn(t),value:e,inclusive:!1})}function L8(e,t){return new cW({check:"less_than",...Sn(t),value:e,inclusive:!0})}function HN(e,t){return new dW({check:"greater_than",...Sn(t),value:e,inclusive:!1})}function N8(e,t){return new dW({check:"greater_than",...Sn(t),value:e,inclusive:!0})}function WN(e,t){return new Wke({check:"multiple_of",...Sn(t),value:e})}function yW(e,t){return new Uke({check:"max_length",...Sn(t),maximum:e})}function g4(e,t){return new Vke({check:"min_length",...Sn(t),minimum:e})}function kW(e,t){return new Kke({check:"length_equals",...Sn(t),length:e})}function T3e(e,t){return new Zke({check:"string_format",format:"regex",...Sn(t),pattern:e})}function E3e(e){return new Gke({check:"string_format",format:"lowercase",...Sn(e)})}function L3e(e){return new Qke({check:"string_format",format:"uppercase",...Sn(e)})}function N3e(e,t){return new Yke({check:"string_format",format:"includes",...Sn(t),includes:e})}function D3e(e,t){return new Jke({check:"string_format",format:"starts_with",...Sn(t),prefix:e})}function F3e(e,t){return new Xke({check:"string_format",format:"ends_with",...Sn(t),suffix:e})}function J1(e){return new ebe({check:"overwrite",tx:e})}function B3e(e){return J1(t=>t.normalize(e))}function R3e(){return J1(e=>e.trim())}function $3e(){return J1(e=>e.toLowerCase())}function O3e(){return J1(e=>e.toUpperCase())}function P3e(){return J1(e=>Z4e(e))}function z3e(e,t,n){return new e({type:"array",element:t,...Sn(n)})}function j3e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Sn(n)})}function H3e(e){const t=W3e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(O0(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(O0(o))}},e(n.value,n)));return t}function W3e(e,t){const n=new bl({check:"custom",...Sn(t)});return n._zod.check=e,n}function bW(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??hg,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function hs(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),hs(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Fr(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function wW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ + `)}h.write("payload.value = newResult;"),h.write("return payload;");const b=h.compile();return(w,C)=>b(f,w,C)};let s;const r=R0,l=!JH.jitless,u=l&&Z4e.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?mW([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function DN(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Wp(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>qd(r,i,Wd())))}),t)}const gW=Mt("$ZodUnion",(e,t)=>{Lo.init(e,t),ji(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ji(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ji(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ji(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>j7(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>DN(a,o,e,s)):DN(l,o,e,s)}}),Fbe=Mt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gW.init(e,t);const n=e._zod.parse;ji(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=qk(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!R0(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),Bbe=Mt("$ZodIntersection",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>FN(n,a,u)):FN(n,s,r)}});function jC(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(I1(e)&&I1(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=jC(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),Wp(e))return e;const r=jC(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Rbe=Mt("$ZodRecord",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!I1(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...qp(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...qp(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&aW.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>qd(d,i,Wd())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...qp(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...qp(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Obe=Mt("$ZodEnum",(e,t)=>{Lo.init(e,t);const n=XH(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>G4e.has(typeof o)).map(o=>typeof o=="string"?T1(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),$be=Mt("$ZodLiteral",(e,t)=>{if(Lo.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?T1(i):i?T1(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),Pbe=Mt("$ZodTransform",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new YH(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new c1;return n.value=o,n}});function BN(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vW=Mt("$ZodOptional",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ji(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ji(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${j7(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>BN(s,n.value)):BN(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),zbe=Mt("$ZodExactOptional",(e,t)=>{vW.init(e,t),ji(e._zod,"values",()=>t.innerType._zod.values),ji(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),jbe=Mt("$ZodNullable",(e,t)=>{Lo.init(e,t),ji(e._zod,"optin",()=>t.innerType._zod.optin),ji(e._zod,"optout",()=>t.innerType._zod.optout),ji(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${j7(n.source)}|null)$`):void 0}),ji(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),Hbe=Mt("$ZodDefault",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",ji(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>RN(s,t)):RN(o,t)}});function RN(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Wbe=Mt("$ZodPrefault",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",ji(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),qbe=Mt("$ZodNonOptional",(e,t)=>{Lo.init(e,t),ji(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>ON(s,e)):ON(o,e)}});function ON(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ube=Mt("$ZodCatch",(e,t)=>{Lo.init(e,t),ji(e._zod,"optin",()=>t.innerType._zod.optin),ji(e._zod,"optout",()=>t.innerType._zod.optout),ji(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>qd(r,i,Wd()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>qd(s,i,Wd()))},input:n.value}),n.issues=[]),n)}}),Vbe=Mt("$ZodPipe",(e,t)=>{Lo.init(e,t),ji(e._zod,"values",()=>t.in._zod.values),ji(e._zod,"optin",()=>t.in._zod.optin),ji(e._zod,"optout",()=>t.out._zod.optout),ji(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>Y2(r,t.in,i)):Y2(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Y2(s,t.out,i)):Y2(o,t.out,i)}});function Y2(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Kbe=Mt("$ZodReadonly",(e,t)=>{Lo.init(e,t),ji(e._zod,"propValues",()=>t.innerType._zod.propValues),ji(e._zod,"values",()=>t.innerType._zod.values),ji(e._zod,"optin",()=>t.innerType?._zod?.optin),ji(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then($N):$N(o)}});function $N(e){return e.value=Object.freeze(e.value),e}const Zbe=Mt("$ZodCustom",(e,t)=>{wl.init(e,t),Lo.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>PN(s,n,i,e));PN(o,n,i,e)}});function PN(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(O0(o))}}var zN;class Gbe{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Qbe(){return new Gbe}(zN=globalThis).__zod_globalRegistry??(zN.__zod_globalRegistry=Qbe());const fg=globalThis.__zod_globalRegistry;function Ybe(e,t){return new e({type:"string",...Mn(t)})}function Jbe(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Mn(t)})}function jN(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Mn(t)})}function Xbe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Mn(t)})}function e3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Mn(t)})}function t3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Mn(t)})}function n3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Mn(t)})}function i3e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Mn(t)})}function o3e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Mn(t)})}function s3e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Mn(t)})}function r3e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Mn(t)})}function l3e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Mn(t)})}function a3e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Mn(t)})}function u3e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Mn(t)})}function c3e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Mn(t)})}function d3e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Mn(t)})}function f3e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Mn(t)})}function h3e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Mn(t)})}function p3e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Mn(t)})}function m3e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Mn(t)})}function g3e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Mn(t)})}function v3e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Mn(t)})}function y3e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Mn(t)})}function k3e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Mn(t)})}function b3e(e,t){return new e({type:"string",format:"date",check:"string_format",...Mn(t)})}function w3e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Mn(t)})}function C3e(e,t){return new e({type:"string",format:"duration",check:"string_format",...Mn(t)})}function A3e(e,t){return new e({type:"number",checks:[],...Mn(t)})}function x3e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Mn(t)})}function S3e(e,t){return new e({type:"boolean",...Mn(t)})}function _3e(e){return new e({type:"unknown"})}function M3e(e,t){return new e({type:"never",...Mn(t)})}function HN(e,t){return new cW({check:"less_than",...Mn(t),value:e,inclusive:!1})}function E8(e,t){return new cW({check:"less_than",...Mn(t),value:e,inclusive:!0})}function WN(e,t){return new dW({check:"greater_than",...Mn(t),value:e,inclusive:!1})}function L8(e,t){return new dW({check:"greater_than",...Mn(t),value:e,inclusive:!0})}function qN(e,t){return new Hke({check:"multiple_of",...Mn(t),value:e})}function yW(e,t){return new qke({check:"max_length",...Mn(t),maximum:e})}function m4(e,t){return new Uke({check:"min_length",...Mn(t),minimum:e})}function kW(e,t){return new Vke({check:"length_equals",...Mn(t),length:e})}function I3e(e,t){return new Kke({check:"string_format",format:"regex",...Mn(t),pattern:e})}function T3e(e){return new Zke({check:"string_format",format:"lowercase",...Mn(e)})}function E3e(e){return new Gke({check:"string_format",format:"uppercase",...Mn(e)})}function L3e(e,t){return new Qke({check:"string_format",format:"includes",...Mn(t),includes:e})}function N3e(e,t){return new Yke({check:"string_format",format:"starts_with",...Mn(t),prefix:e})}function D3e(e,t){return new Jke({check:"string_format",format:"ends_with",...Mn(t),suffix:e})}function J1(e){return new Xke({check:"overwrite",tx:e})}function F3e(e){return J1(t=>t.normalize(e))}function B3e(){return J1(e=>e.trim())}function R3e(){return J1(e=>e.toLowerCase())}function O3e(){return J1(e=>e.toUpperCase())}function $3e(){return J1(e=>K4e(e))}function P3e(e,t,n){return new e({type:"array",element:t,...Mn(n)})}function z3e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Mn(n)})}function j3e(e){const t=H3e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(O0(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(O0(o))}},e(n.value,n)));return t}function H3e(e,t){const n=new wl({check:"custom",...Mn(t)});return n._zod.check=e,n}function bW(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??fg,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function fs(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),fs(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Dr(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function wW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function CW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:v4(t,"input",e.processors),output:v4(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Fr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Fr(i.element,n);if(i.type==="set")return Fr(i.valueType,n);if(i.type==="lazy")return Fr(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Fr(i.innerType,n);if(i.type==="intersection")return Fr(i.left,n)||Fr(i.right,n);if(i.type==="record"||i.type==="map")return Fr(i.keyType,n)||Fr(i.valueType,n);if(i.type==="pipe")return Fr(i.in,n)||Fr(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Fr(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Fr(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Fr(o,n))return!0;return!!(i.rest&&Fr(i.rest,n))}return!1}const q3e=(e,t={})=>n=>{const i=bW({...n,processors:t});return hs(e,i),wW(i,e),CW(i,e)},v4=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=bW({...o??{},target:s,io:t,processors:n});return hs(e,r),wW(r,e),CW(r,e)},U3e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},V3e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=U3e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},K3e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},Z3e=(e,t,n,i)=>{n.type="boolean"},G3e=(e,t,n,i)=>{n.not={}},Q3e=(e,t,n,i)=>{},Y3e=(e,t,n,i)=>{const o=e._zod.def,s=XH(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},J3e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},X3e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},e8e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},t8e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=hs(s.element,t,{...i,path:[...i.path,"items"]})},n8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=hs(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=hs(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},i8e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>hs(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},o8e=(e,t,n,i)=>{const o=e._zod.def,s=hs(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=hs(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},s8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=hs(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=hs(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=hs(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},r8e=(e,t,n,i)=>{const o=e._zod.def,s=hs(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},l8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},a8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},u8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},c8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},d8e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;hs(s,t,i);const r=t.seen.get(e);r.ref=s},f8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},AW=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},h8e=Mt("ZodISODateTime",(e,t)=>{pbe.init(e,t),Fo.init(e,t)});function p8e(e){return b3e(h8e,e)}const m8e=Mt("ZodISODate",(e,t)=>{mbe.init(e,t),Fo.init(e,t)});function g8e(e){return w3e(m8e,e)}const v8e=Mt("ZodISOTime",(e,t)=>{gbe.init(e,t),Fo.init(e,t)});function y8e(e){return C3e(v8e,e)}const k8e=Mt("ZodISODuration",(e,t)=>{vbe.init(e,t),Fo.init(e,t)});function b8e(e){return A3e(k8e,e)}const w8e=(e,t)=>{iW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>lke(e,n)},flatten:{value:n=>rke(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,jC,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,jC,2)}},isEmpty:{get(){return e.issues.length===0}}})},ya=Mt("ZodError",w8e,{Parent:Error}),C8e=q7(ya),A8e=U7(ya),x8e=Vk(ya),S8e=Kk(ya),_8e=cke(ya),M8e=dke(ya),I8e=fke(ya),T8e=hke(ya),E8e=pke(ya),L8e=mke(ya),N8e=gke(ya),D8e=vke(ya),Do=Mt("ZodType",(e,t)=>(No.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:v4(e,"input"),output:v4(e,"output")}}),e.toJSONSchema=q3e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(sf(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>rf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>C8e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>x8e(e,n,i),e.parseAsync=async(n,i)=>A8e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>S8e(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>_8e(e,n,i),e.decode=(n,i)=>M8e(e,n,i),e.encodeAsync=async(n,i)=>I8e(e,n,i),e.decodeAsync=async(n,i)=>T8e(e,n,i),e.safeEncode=(n,i)=>E8e(e,n,i),e.safeDecode=(n,i)=>L8e(e,n,i),e.safeEncodeAsync=async(n,i)=>N8e(e,n,i),e.safeDecodeAsync=async(n,i)=>D8e(e,n,i),e.refine=(n,i)=>e.check(M5e(n,i)),e.superRefine=n=>e.check(I5e(n)),e.overwrite=n=>e.check(J1(n)),e.optional=()=>VN(e),e.exactOptional=()=>p5e(e),e.nullable=()=>KN(e),e.nullish=()=>VN(KN(e)),e.nonoptional=n=>b5e(e,n),e.array=()=>Ii(e),e.or=n=>s5e([e,n]),e.and=n=>a5e(e,n),e.transform=n=>ZN(e,f5e(n)),e.default=n=>v5e(e,n),e.prefault=n=>k5e(e,n),e.catch=n=>C5e(e,n),e.pipe=n=>ZN(e,n),e.readonly=()=>S5e(e),e.describe=n=>{const i=e.clone();return hg.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return hg.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return hg.get(e);const i=e.clone();return hg.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xW=Mt("_ZodString",(e,t)=>{V7.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>V3e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(T3e(...i)),e.includes=(...i)=>e.check(N3e(...i)),e.startsWith=(...i)=>e.check(D3e(...i)),e.endsWith=(...i)=>e.check(F3e(...i)),e.min=(...i)=>e.check(g4(...i)),e.max=(...i)=>e.check(yW(...i)),e.length=(...i)=>e.check(kW(...i)),e.nonempty=(...i)=>e.check(g4(1,...i)),e.lowercase=i=>e.check(E3e(i)),e.uppercase=i=>e.check(L3e(i)),e.trim=()=>e.check(R3e()),e.normalize=(...i)=>e.check(B3e(...i)),e.toLowerCase=()=>e.check($3e()),e.toUpperCase=()=>e.check(O3e()),e.slugify=()=>e.check(P3e())}),F8e=Mt("ZodString",(e,t)=>{V7.init(e,t),xW.init(e,t),e.email=n=>e.check(Xbe(B8e,n)),e.url=n=>e.check(o3e(R8e,n)),e.jwt=n=>e.check(k3e(Y8e,n)),e.emoji=n=>e.check(s3e($8e,n)),e.guid=n=>e.check(zN(qN,n)),e.uuid=n=>e.check(e3e(X2,n)),e.uuidv4=n=>e.check(t3e(X2,n)),e.uuidv6=n=>e.check(n3e(X2,n)),e.uuidv7=n=>e.check(i3e(X2,n)),e.nanoid=n=>e.check(r3e(O8e,n)),e.guid=n=>e.check(zN(qN,n)),e.cuid=n=>e.check(l3e(P8e,n)),e.cuid2=n=>e.check(a3e(z8e,n)),e.ulid=n=>e.check(u3e(j8e,n)),e.base64=n=>e.check(g3e(Z8e,n)),e.base64url=n=>e.check(v3e(G8e,n)),e.xid=n=>e.check(c3e(H8e,n)),e.ksuid=n=>e.check(d3e(W8e,n)),e.ipv4=n=>e.check(f3e(q8e,n)),e.ipv6=n=>e.check(h3e(U8e,n)),e.cidrv4=n=>e.check(p3e(V8e,n)),e.cidrv6=n=>e.check(m3e(K8e,n)),e.e164=n=>e.check(y3e(Q8e,n)),e.datetime=n=>e.check(p8e(n)),e.date=n=>e.check(g8e(n)),e.time=n=>e.check(y8e(n)),e.duration=n=>e.check(b8e(n))});function Ot(e){return Jbe(F8e,e)}const Fo=Mt("ZodStringFormat",(e,t)=>{So.init(e,t),xW.init(e,t)}),B8e=Mt("ZodEmail",(e,t)=>{sbe.init(e,t),Fo.init(e,t)}),qN=Mt("ZodGUID",(e,t)=>{ibe.init(e,t),Fo.init(e,t)}),X2=Mt("ZodUUID",(e,t)=>{obe.init(e,t),Fo.init(e,t)}),R8e=Mt("ZodURL",(e,t)=>{rbe.init(e,t),Fo.init(e,t)}),$8e=Mt("ZodEmoji",(e,t)=>{lbe.init(e,t),Fo.init(e,t)}),O8e=Mt("ZodNanoID",(e,t)=>{abe.init(e,t),Fo.init(e,t)}),P8e=Mt("ZodCUID",(e,t)=>{ube.init(e,t),Fo.init(e,t)}),z8e=Mt("ZodCUID2",(e,t)=>{cbe.init(e,t),Fo.init(e,t)}),j8e=Mt("ZodULID",(e,t)=>{dbe.init(e,t),Fo.init(e,t)}),H8e=Mt("ZodXID",(e,t)=>{fbe.init(e,t),Fo.init(e,t)}),W8e=Mt("ZodKSUID",(e,t)=>{hbe.init(e,t),Fo.init(e,t)}),q8e=Mt("ZodIPv4",(e,t)=>{ybe.init(e,t),Fo.init(e,t)}),U8e=Mt("ZodIPv6",(e,t)=>{kbe.init(e,t),Fo.init(e,t)}),V8e=Mt("ZodCIDRv4",(e,t)=>{bbe.init(e,t),Fo.init(e,t)}),K8e=Mt("ZodCIDRv6",(e,t)=>{wbe.init(e,t),Fo.init(e,t)}),Z8e=Mt("ZodBase64",(e,t)=>{Cbe.init(e,t),Fo.init(e,t)}),G8e=Mt("ZodBase64URL",(e,t)=>{xbe.init(e,t),Fo.init(e,t)}),Q8e=Mt("ZodE164",(e,t)=>{Sbe.init(e,t),Fo.init(e,t)}),Y8e=Mt("ZodJWT",(e,t)=>{Mbe.init(e,t),Fo.init(e,t)}),SW=Mt("ZodNumber",(e,t)=>{hW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>K3e(e,i,o),e.gt=(i,o)=>e.check(HN(i,o)),e.gte=(i,o)=>e.check(N8(i,o)),e.min=(i,o)=>e.check(N8(i,o)),e.lt=(i,o)=>e.check(jN(i,o)),e.lte=(i,o)=>e.check(L8(i,o)),e.max=(i,o)=>e.check(L8(i,o)),e.int=i=>e.check(UN(i)),e.safe=i=>e.check(UN(i)),e.positive=i=>e.check(HN(0,i)),e.nonnegative=i=>e.check(N8(0,i)),e.negative=i=>e.check(jN(0,i)),e.nonpositive=i=>e.check(L8(0,i)),e.multipleOf=(i,o)=>e.check(WN(i,o)),e.step=(i,o)=>e.check(WN(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function vn(e){return x3e(SW,e)}const J8e=Mt("ZodNumberFormat",(e,t)=>{Ibe.init(e,t),SW.init(e,t)});function UN(e){return S3e(J8e,e)}const X8e=Mt("ZodBoolean",(e,t)=>{Tbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Z3e(e,n,i)});function Sv(e){return _3e(X8e,e)}const e5e=Mt("ZodUnknown",(e,t)=>{Ebe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Q3e()});function Ss(){return M3e(e5e)}const t5e=Mt("ZodNever",(e,t)=>{Lbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>G3e(e,n,i)});function n5e(e){return I3e(t5e,e)}const i5e=Mt("ZodArray",(e,t)=>{Nbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>t8e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(g4(n,i)),e.nonempty=n=>e.check(g4(1,n)),e.max=(n,i)=>e.check(yW(n,i)),e.length=(n,i)=>e.check(kW(n,i)),e.unwrap=()=>e.element});function Ii(e,t){return z3e(i5e,e,t)}const o5e=Mt("ZodObject",(e,t)=>{Fbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>n8e(e,n,i,o),zi(e,"shape",()=>t.shape),e.keyof=()=>xo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ss()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ss()}),e.strict=()=>e.clone({...e._zod.def,catchall:n5e()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>tke(e,n),e.safeExtend=n=>nke(e,n),e.merge=n=>ike(e,n),e.pick=n=>X4e(e,n),e.omit=n=>eke(e,n),e.partial=(...n)=>oke(MW,e,n[0]),e.required=(...n)=>ske(IW,e,n[0])});function Zt(e,t){const n={type:"object",shape:e??{},...Sn(t)};return new o5e(n)}const _W=Mt("ZodUnion",(e,t)=>{gW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>i8e(e,n,i,o),e.options=t.options});function s5e(e,t){return new _W({type:"union",options:e,...Sn(t)})}const r5e=Mt("ZodDiscriminatedUnion",(e,t)=>{_W.init(e,t),Bbe.init(e,t)});function lf(e,t,n){return new r5e({type:"union",options:t,discriminator:e,...Sn(n)})}const l5e=Mt("ZodIntersection",(e,t)=>{Rbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>o8e(e,n,i,o)});function a5e(e,t){return new l5e({type:"intersection",left:e,right:t})}const u5e=Mt("ZodRecord",(e,t)=>{$be.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>s8e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function K7(e,t,n){return new u5e({type:"record",keyType:e,valueType:t,...Sn(n)})}const WC=Mt("ZodEnum",(e,t)=>{Obe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>Y3e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new WC({...t,checks:[],...Sn(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new WC({...t,checks:[],...Sn(o),entries:s})}});function xo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new WC({type:"enum",entries:n,...Sn(t)})}const c5e=Mt("ZodLiteral",(e,t)=>{Pbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>J3e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function qn(e,t){return new c5e({type:"literal",values:Array.isArray(e)?e:[e],...Sn(t)})}const d5e=Mt("ZodTransform",(e,t)=>{zbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>e8e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new YH(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(O0(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(O0(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function f5e(e){return new d5e({type:"transform",transform:e})}const MW=Mt("ZodOptional",(e,t)=>{vW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function VN(e){return new MW({type:"optional",innerType:e})}const h5e=Mt("ZodExactOptional",(e,t)=>{jbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function p5e(e){return new h5e({type:"optional",innerType:e})}const m5e=Mt("ZodNullable",(e,t)=>{Hbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>r8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function KN(e){return new m5e({type:"nullable",innerType:e})}const g5e=Mt("ZodDefault",(e,t)=>{Wbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>a8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function v5e(e,t){return new g5e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tW(t)}})}const y5e=Mt("ZodPrefault",(e,t)=>{qbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>u8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function k5e(e,t){return new y5e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tW(t)}})}const IW=Mt("ZodNonOptional",(e,t)=>{Ube.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>l8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function b5e(e,t){return new IW({type:"nonoptional",innerType:e,...Sn(t)})}const w5e=Mt("ZodCatch",(e,t)=>{Vbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>c8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function C5e(e,t){return new w5e({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const A5e=Mt("ZodPipe",(e,t)=>{Kbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>d8e(e,n,i,o),e.in=t.in,e.out=t.out});function ZN(e,t){return new A5e({type:"pipe",in:e,out:t})}const x5e=Mt("ZodReadonly",(e,t)=>{Zbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>f8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function S5e(e){return new x5e({type:"readonly",innerType:e})}const _5e=Mt("ZodCustom",(e,t)=>{Gbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>X3e(e,n)});function M5e(e,t={}){return j3e(_5e,e,t)}function I5e(e){return H3e(e)}const Nh=Ot().min(1),Z7=Ot().min(1),_v=Ot().min(1),Dh=Ot().min(1),ql=Ot().min(1),T5e=/^[A-Za-z0-9._-]{1,128}$/;function E5e(e){return T5e.test(e)&&e!=="."&&e!==".."}const TW=lf("kind",[Zt({kind:qn("user"),payload:Ss().optional()}),Zt({kind:qn("cron"),taskId:Dh.optional(),payload:Ss().optional()}),Zt({kind:qn("task"),taskId:Dh,payload:Ss().optional()}),Zt({kind:qn("hook"),payload:Ss().optional()}),Zt({kind:qn("compaction"),payload:Ss().optional()}),Zt({kind:qn("side"),payload:Ss().optional()}),Zt({kind:qn("other"),payload:Ss().optional()})]),L5e=Zt({inputTokens:vn().optional(),outputTokens:vn().optional(),cachedTokens:vn().optional(),cost:vn().optional()}),e0=Zt({inputOther:vn(),output:vn(),inputCacheRead:vn(),inputCacheCreation:vn()}),N5e=Zt({llmFirstTokenLatencyMs:vn().optional(),llmStreamDurationMs:vn().optional(),llmRequestBuildMs:vn().optional(),llmServerFirstTokenMs:vn().optional(),llmServerDecodeMs:vn().optional(),llmClientConsumeMs:vn().optional()}),D5e=Zt({failedAttempt:vn(),nextAttempt:vn(),maxAttempts:vn(),delayMs:vn(),errorName:Ot(),errorMessage:Ot(),statusCode:vn().optional()}),EW=xo(["queued","running","completed","failed","cancelled"]),F5e=xo(["running","completed","interrupted","failed"]),B5e=Zt({kind:qn("text"),frameId:_v,role:xo(["assistant","user"]),text:Ot(),attachmentIds:Ii(Ot()).optional(),taskId:Dh.optional(),promptIds:Ii(Ot()).optional()}),R5e=Zt({kind:qn("thinking"),frameId:_v,text:Ot()}),$5e=Zt({agentId:ql,role:xo(["child","member"]).optional()}),O5e=Zt({kind:xo(["stdout","stderr","progress","status","custom"]),text:Ot().optional(),percent:vn().optional(),customKind:Ot().optional(),customData:Ss().optional()}),P5e=Zt({kind:qn("tool"),frameId:_v,toolCallId:Ot(),name:Ot(),view:Ot().optional(),state:xo(["running","done","error"]),input:Ss().optional(),output:Ss().optional(),display:Ss().optional(),error:Ot().optional(),inputText:Ot().optional(),progress:O5e.optional(),taskId:Dh.optional(),approvalId:Ot().optional(),todoId:Ot().optional(),agentRefs:Ii($5e).optional()}),G7=Zt({interactionId:Ot(),interactionKind:xo(["approval","question"]),toolCallId:Ot().optional(),state:xo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Ss().optional(),response:Ss().optional()}),z5e=Zt({kind:qn("notice"),frameId:_v,level:xo(["error","warning","info"]),source:Ot().optional(),message:Ot(),detail:Ss().optional()}),LW=lf("kind",[B5e,R5e,P5e,z5e]),NW=Zt({kind:qn("step"),stepId:Z7,turnId:Nh,ordinal:vn().int(),state:F5e,frames:Ii(LW),startedAt:Ot().optional(),endedAt:Ot().optional(),usage:e0.optional(),finishReason:Ot().optional(),timing:N5e.optional(),retry:D5e.optional(),endReason:Ot().optional(),endMessage:Ot().optional()}),DW=Zt({kind:qn("turn"),turnId:Nh,ordinal:vn().int(),state:EW,origin:TW,prompt:Ot().optional(),attachmentIds:Ii(Ot()).optional(),steps:Ii(NW),startedAt:Ot().optional(),endedAt:Ot().optional(),usage:L5e.optional(),durationMs:vn().optional(),error:Ot().optional()}),FW=Zt({kind:qn("marker"),markerId:Ot(),marker:Ot(),payload:Ss().optional(),at:Ot().optional()}),BW=Zt({kind:qn("taskref"),refId:Ot(),taskId:Dh,at:Ot().optional()}),RW=lf("kind",[DW,FW,BW]),Q7=Zt({taskId:Dh,kind:xo(["shell","subagent","tool","other"]),state:xo(["running","completed","failed","timed_out","killed","lost"]),detached:Sv(),description:Ot().optional(),agentId:ql.optional(),outputTail:Ot(),startedAt:Ot().optional(),endedAt:Ot().optional(),resultSummary:Ot().optional(),error:Ot().optional(),stateReason:Ot().optional(),usage:e0.optional(),model:Ot().optional(),thinkingEffort:Ot().optional()}),$W=Zt({objective:Ot(),status:xo(["active","paused","blocked","complete"]),completionCriterion:Ot().optional(),budgetUsed:vn().optional(),budgetLimit:vn().optional()}),j5e=Zt({plan:Zt({reviewPath:Ot().optional(),version:vn().optional()}).optional(),swarm:Zt({trigger:Ot().optional()}).optional(),tower:Zt({}).optional()}),H5e=Zt({plan:Zt({reviewPath:Ot().optional(),version:vn().optional()}).nullable().optional(),swarm:Zt({trigger:Ot().optional()}).nullable().optional(),tower:Zt({}).nullable().optional()}),W5e=lf("kind",[Zt({kind:qn("idle")}),Zt({kind:qn("running"),turnId:vn(),step:vn(),stepId:Ot(),since:vn()}),Zt({kind:qn("streaming"),turnId:vn(),step:vn(),stepId:Ot(),stream:xo(["assistant","thinking","tool_call"]),toolCallId:Ot().optional(),toolName:Ot().optional(),since:vn()}),Zt({kind:qn("tool_call"),turnId:vn(),step:vn(),toolCallId:Ot(),name:Ot(),since:vn()}),Zt({kind:qn("retrying"),turnId:vn(),step:vn(),stepId:Ot(),failedAttempt:vn(),nextAttempt:vn(),maxAttempts:vn(),delayMs:vn(),errorName:Ot().optional(),statusCode:vn().optional(),since:vn()}),Zt({kind:qn("awaiting_approval"),turnId:vn(),step:vn().optional(),approval:Ss().optional(),since:vn()}),Zt({kind:qn("interrupted"),turnId:vn(),step:vn().optional(),reason:xo(["aborted","max_steps","error"]),message:Ot().optional(),at:vn()}),Zt({kind:qn("ended"),turnId:vn(),reason:xo(["completed","cancelled","failed","blocked"]),durationMs:vn().optional(),at:vn()})]),q5e=Zt({byModel:K7(Ot(),e0).optional(),currentTurn:e0.optional(),total:e0.optional()}),U5e=Zt({model:Ot().optional(),thinkingEffort:Ot().optional(),usage:q5e.optional(),contextTokens:vn().optional(),maxContextTokens:vn().optional(),contextUsage:vn().optional(),permission:xo(["manual","yolo","auto"]).optional(),phase:W5e.optional()}),Y7=Zt({goal:$W.optional(),modes:j5e.optional(),activity:xo(["idle","turn","disposing","unknown"]).optional(),agent:U5e.optional()}),V5e=Y7.extend({goal:$W.nullable().optional(),modes:H5e.optional()}),Gk=Zt({attachmentId:Ot(),mediaType:Ot(),name:Ot().optional(),size:vn().optional(),source:lf("kind",[Zt({kind:qn("url"),url:Ot()}),Zt({kind:qn("file"),fileId:Ot()}),Zt({kind:qn("session_media"),fileId:Ot()})]).optional(),placeholder:Ot().optional()}),K5e=Zt({title:Ot(),status:xo(["pending","in_progress","done"])}),J7=Zt({todoId:Ot(),items:Ii(K5e),updatedAt:Ot().optional()}),X7=Zt({promptId:Ot(),status:xo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:Ot().optional(),content:Ss().optional(),createdAt:Ot(),finishedAt:Ot().optional(),steeredAt:Ot().optional()}),OW=Zt({items:Ii(RW),tasks:Ii(Q7),interactions:Ii(G7).default([]),attachments:Ii(Gk).default([]),todos:Ii(J7).default([]),prompts:Ii(X7).default([]),meta:Y7,hasMoreOlder:Sv().optional()}),Z5e=DW.omit({steps:!0}),G5e=NW.omit({frames:!0}),Q5e=lf("type",[Zt({type:qn("frame"),turnId:Nh,stepId:Z7,frameId:_v}),Zt({type:qn("task"),taskId:Dh})]),ex=lf("op",[Zt({op:qn("reset"),agentId:ql,snapshot:OW}),Zt({op:qn("turn.upsert"),turn:Z5e}),Zt({op:qn("step.upsert"),turnId:Nh,step:G5e}),Zt({op:qn("frame.upsert"),turnId:Nh,stepId:Z7,frame:LW}),Zt({op:qn("append"),target:Q5e,offset:vn().int().nonnegative(),text:Ot()}),Zt({op:qn("marker.upsert"),item:FW,beforeTurn:vn().int().optional()}),Zt({op:qn("taskref.upsert"),item:BW,beforeTurn:vn().int().optional()}),Zt({op:qn("task.upsert"),task:Q7}),Zt({op:qn("interaction.upsert"),interaction:G7}),Zt({op:qn("attachment.upsert"),attachment:Gk}),Zt({op:qn("todo.upsert"),todo:J7}),Zt({op:qn("prompt.upsert"),prompt:X7}),Zt({op:qn("meta.merge"),meta:V5e}),Zt({op:qn("items.remove"),ids:Ii(Ot())})]);Zt({agentId:ql,ops:Ii(ex)});const Y5e=xo(["off","turn","block","delta"]),E1=vn().int().nonnegative(),J5e=K7(Ot(),Y5e);Zt({session_id:Ot().min(1),transcript:J5e,transcript_since:K7(Ot(),E1).optional()});Zt({agent_id:ql,before_turn:Ot().min(1).optional(),after_turn:Ot().min(1).optional(),page_size:vn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),E5e(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const X5e=Zt({agentId:ql,type:xo(["main","sub","independent"]).optional(),parentAgentId:ql.optional(),label:Ot().optional(),createdAt:Ot().optional(),disposedAt:Ot().optional()}),ewe=Zt({agent_id:ql,items:Ii(RW),has_more:Sv(),tasks:Ii(Q7),interactions:Ii(G7).default([]),attachments:Ii(Gk).default([]),todos:Ii(J7).default([]),prompts:Ii(X7).default([]),meta:Y7,agents:Ii(X5e),pending_interactions:Ii(Ot()),seq:E1.optional()});Zt({agent_id:ql,batches:Ii(Zt({seq:E1,ops:Ii(ex)})),latest_seq:E1,complete:Sv()});const twe=Zt({turn_id:Nh,ordinal:vn().int(),state:EW,origin:TW,prompt:Ot(),attachment_ids:Ii(Ot()).optional(),started_at:Ot().optional()});Zt({agents:Ii(Zt({agent_id:ql,messages:Ii(twe),attachments:Ii(Gk).default([])}))});const nwe=Zt({state:xo(["pending","approved","rejected","cancelled"]),selected_option:Ot().optional(),feedback:Ot().optional()}),iwe=Zt({tool_call_id:Ot(),turn_id:Nh,source:xo(["interaction","display","output"]),plan:Ot(),path:Ot().optional(),options:Ii(Zt({label:Ot(),description:Ot().optional()})).optional(),review:nwe.optional()});Zt({agent_id:ql,plans:Ii(iwe)});const owe=Zt({agent_id:ql,snapshot:OW,has_more_older:Sv(),seq:E1.optional()}),swe=Zt({agent_id:ql,ops:Ii(ex),seq:E1.optional()}),PW=owe.extend({type:qn("transcript.reset")}),zW=swe.extend({type:qn("transcript.ops")});lf("type",[PW,zW]);const GN=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),rwe=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),lwe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),awe=new Set(["assistant.delta","thinking.delta"]);function uwe(e,t){if(lwe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return awe.has(i)?cwe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?rwe.has(i)?{route:"protocol"}:GN.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:GN.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function cwe(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const dwe="kimi-code.bearer.",fwe=3e4;class QN{constructor(t){this.opts=t,this.tracer=t.tracer??$7}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${dwe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=ey(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(ey(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(ey(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,fwe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=PW.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=zW.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=ey(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=uwe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function ey(e,t){return`${e}\0${t}`}async function hwe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=ewe.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const D8=10485760,pwe=5e3,YN=40001;function mwe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function gwe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function F8(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function JN(e){return e==="auto_compact"||e==="manual_compact"}class vwe{constructor(t){this.opts=t,this.tracer=t.tracer??$7,this.http=new bN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new bN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(fu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return fu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return fu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return fu(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return ZH(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return fu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(VH),hasMore:o.has_more}}async getSessionTranscript(t,n){return hwe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` -`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&qi(d)&&d.code===YN)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:mwe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,u4e(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...gwe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:vN});return fu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:vN});return fu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(fu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,c4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,g4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>OC(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return OC(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(F8)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return F8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return F8(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(KH));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(AN)])):void 0;return{items:o.items.map(AN),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:search",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async suggestFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:suggest",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return fd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Xg)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return Xg(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Xg(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(y4e)}async listProviders(){return(await this.http.get("/providers")).items.map(yp)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=yp(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return yp(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:yp(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(xN)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return xN(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:yp(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(yp),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return B8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return B8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return B8(t)}async getConfig(){const t=await this.http.get("/config");return PC(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return PC(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&qi(i)&&i.code===YN)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),pwe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return fd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return fd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:D8});if(n.size>D8)throw new O7({size:n.size,limit:D8});const i=n.type,o=!ywe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await kwe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=mN(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new QN({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=k4e(s),l=b4e(s),a=v4e(s);a.type==="historyCompacted"&&!JN(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!JN(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new QN({wsUrl:mN(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function B8(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function ywe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function kwe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const bwe="main",wwe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function R8(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function Cwe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function XN(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function yr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Xs(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Xl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Awe(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=yr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=yr(t,"goalId")??yr(t,"goal_id")??"goal",r=yr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:yr(t,"completionCriterion")??yr(t,"completion_criterion"),status:o,turnsUsed:Xs(t,"turnsUsed")??Xs(t,"turns_used")??0,tokensUsed:Xs(t,"tokensUsed")??Xs(t,"tokens_used")??0,wallClockMs:Xs(t,"wallClockMs")??Xs(t,"wall_clock_ms")??0,terminalReason:yr(t,"terminalReason")??yr(t,"terminal_reason"),budget:{tokenBudget:Xl(i,"tokenBudget")??Xl(i,"token_budget"),remainingTokens:Xl(i,"remainingTokens")??Xl(i,"remaining_tokens"),turnBudget:Xl(i,"turnBudget")??Xl(i,"turn_budget"),remainingTurns:Xl(i,"remainingTurns")??Xl(i,"remaining_turns"),wallClockBudgetMs:Xl(i,"wallClockBudgetMs")??Xl(i,"wall_clock_budget_ms"),remainingWallClockMs:Xl(i,"remainingWallClockMs")??Xl(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function nd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function xwe(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=yr(n,"name")??yr(n,"toolName")??"tool",o=BO(e,Swe(i)),s=_we(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=yr(i,"text");if(s)return $8(s);const r=yr(i,"message");if(r)return $8(r)}const o=yr(n,"message");if(o)return $8(o)}return null}function Swe(e){return e.replace(/_\d+$/,"")}const eD=2e3;function $8(e){return e.length>eD?`${e.slice(0,eD)}…`:e}function _we(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return _6(e,t,i)}function Mwe(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=yr(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=nd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),v=[];return g&&v.push({type:"taskCreated",sessionId:n,task:g}),v.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),v}const l=xwe(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=nd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function Iwe(e){return Array.isArray(e)?e.map(t=>P7(t)):[]}function Twe(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const Ewe=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function Lwe(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=Awe(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function Nwe(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=XN(),n.set(f,h)),h}function s(f){n.set(f,XN())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(v){return vu("[agentProjector] Error projecting event:",f,v instanceof Error?v.message:v),[]}}function d(f,h,m,g){if(Ewe.has(f))return Lwe(f,h,m);const v=o(m),y=h,b=[],w=y?.agentId;if(typeof w=="string"&&w!==bwe){const C=i.has(w);if(f==="prompt.submitted"){if(!C)return[];const T=y?.promptId,N=y?.userMessageId;if(!T||!N)return[];const I=Iwe(y?.content);return I.length===0?[]:[{type:"messageCreated",agentId:w,message:{id:N,sessionId:m,role:"user",content:I,createdAt:typeof y?.createdAt=="string"?y.createdAt:new Date().toISOString(),promptId:T}}]}if(C&&(f==="thinking.delta"||f==="assistant.delta")){const T=y?.delta??"";return T?[{type:"agentDelta",sessionId:m,agentId:w,delta:{[f==="thinking.delta"?"thinking":"text"]:T}}]:[]}if(C&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:w,reason:y?.reason}];if(wwe.has(f))return Mwe(t,v,m,w,f,y??{},i)}switch(f){case"turn.started":{const C=y?.turnId,T=v.currentPromptId??R8("pr_");v.currentPromptId=T,C!==void 0&&v.turnPromptId.set(C,T),b.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const C=Cwe(y?.usage);v.totalInput+=C.input,v.totalOutput+=C.output,v.totalCacheRead+=C.cacheRead,v.totalCacheCreate+=C.cacheCreate;break}case"agent.status.updated":{y?.model&&(v.model=y.model),y?.contextTokens!==void 0&&(v.contextTokens=y.contextTokens),y?.maxContextTokens!==void 0&&(v.contextLimit=y.maxContextTokens);const C=y?.phase;C!=null&&C.kind==="retrying"?(v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Xs(C,"failedAttempt")??0,nextAttempt:Xs(C,"nextAttempt")??0,maxAttempts:Xs(C,"maxAttempts")??0,delayMs:Xs(C,"delayMs")??0,errorName:yr(C,"errorName"),statusCode:Xs(C,"statusCode"),turnId:Xs(C,"turnId")}})):v.retryActive&&C!==void 0&&C!==null&&typeof C.kind=="string"&&(v.retryActive=!1,b.push({type:"turnRetry",sessionId:m,retry:void 0})),b.push({type:"sessionUsageUpdated",sessionId:m,usage:Twe(v),model:v.model||void 0,swarmMode:y?.swarmMode===!0?!0:y?.swarmMode===!1?!1:void 0,planMode:y?.planMode===!0?!0:y?.planMode===!1?!1:void 0,thinking:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:void 0});break}case"turn.ended":{const C=y?.turnId,T=(C!==void 0?v.turnPromptId.get(C):void 0)??v.currentPromptId;b.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:y?.reason,promptId:T}),v.turnCount++,v.currentPromptId=void 0;break}case"prompt.completed":{const C=y?.promptId;typeof C=="string"&&C.length>0&&b.push({type:"promptCompleted",sessionId:m,promptId:C,reason:y?.reason??"completed"});break}case"prompt.aborted":{const C=y?.promptId;typeof C=="string"&&C.length>0&&b.push({type:"promptAborted",sessionId:m,promptId:C});break}case"turn.step.retrying":{v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Xs(y??{},"failedAttempt")??0,nextAttempt:Xs(y??{},"nextAttempt")??0,maxAttempts:Xs(y??{},"maxAttempts")??0,delayMs:Xs(y??{},"delayMs")??0,errorName:yr(y??{},"errorName"),statusCode:Xs(y??{},"statusCode"),turnId:typeof y?.turnId=="number"?y.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const C=typeof y?.subagentId=="string"&&y.subagentId.length>0?y.subagentId:R8("task_"),T=typeof y?.taskId=="string"&&y.taskId.length>0?y.taskId:void 0,N=T!==void 0&&T!==C?v.subagentMeta.get(T):void 0,I=v.subagentMeta.get(C);N!==void 0&&v.subagentMeta.delete(T),T!==void 0&&!v.registrationOrderByKey.has(T)&&v.registrationOrderByKey.set(T,++v.registrationSeq);const S=I===void 0||N===void 0?I??N:{...I,createdAt:N.createdAt,startedAt:N.startedAt??I.startedAt,runInBackground:!0,backgroundTaskId:I.backgroundTaskId??T},_=S?.backgroundTaskId??(S!==void 0&&T!==void 0&&S.id===T?T:void 0),x=T!==void 0?v.registrationOrderByKey.get(T):void 0,E=_!==void 0?v.registrationOrderByKey.get(_):void 0,M=v.retiredBindings.has(T??"")||x!==void 0&&E!==void 0&&x0?y.model:S?.model,thinkingEffort:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:S?.thinkingEffort,parentToolCallId:typeof y?.parentToolCallId=="string"?y.parentToolCallId:S?.parentToolCallId,swarmIndex:typeof y?.swarmIndex=="number"?y.swarmIndex:S?.swarmIndex,runInBackground:R?y?.runInBackground===!0||y?.runInBackground===void 0&&S?.runInBackground===!0:y?.runInBackground===!0||S?.runInBackground===!0,outputPreview:R?void 0:S?.outputPreview,outputBytes:R?void 0:S?.outputBytes,outputLines:R?void 0:S?.outputLines,suspendedReason:R?void 0:S?.suspendedReason,text:R?void 0:S?.text,backgroundTaskId:M?S?.backgroundTaskId:R?T:T??S?.backgroundTaskId};v.subagentMeta.set(z.id,z),b.push({type:"taskCreated",sessionId:m,task:z});break}case"subagent.started":{const C=typeof y?.subagentId=="string"?y.subagentId:void 0,T=C!==void 0&&(v.subagentMeta.get(C)?.status!==void 0&&v.subagentMeta.get(C).status!=="running"||v.settledByKernel.has(C));T&&v.settledByKernel.delete(C);const N=nd(t,v,m,y?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...T?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});T&&C!==void 0&&v.restartedThisRun.add(C),N&&b.push({type:"taskCreated",sessionId:m,task:N});break}case"subagent.suspended":{const C=nd(t,v,m,y?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof y?.reason=="string"?y.reason:void 0});C&&b.push({type:"taskCreated",sessionId:m,task:C});break}case"subagent.completed":{const C=typeof y?.resultSummary=="string"?y.resultSummary:void 0,T=nd(t,v,m,y?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:C});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"completed",outputPreview:C});break}case"subagent.failed":{const C=typeof y?.error=="string"?y.error:void 0,T=nd(t,v,m,y?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:C});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"failed",outputPreview:C});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:y?.code,message:y?.message,name:y?.name,details:y?.details,retryable:y?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:y?.message}});break}case"task.started":case"background.task.started":{const C=y?.info??{},T=typeof C.startedAt=="number"?new Date(C.startedAt).toISOString():void 0,N=typeof C.taskId=="string"?C.taskId:typeof C.taskId=="number"?String(C.taskId):R8("task_"),I=typeof C.description=="string"?C.description:typeof C.command=="string"?C.command:t("tasks.defaultDescription");if(C.kind==="agent"){const _=typeof C.agentId=="string"&&C.agentId.length>0?C.agentId:void 0;if(_!==void 0){const x=v.subagentMeta.get(_),E=v.registrationOrderByKey.get(N),M=x?.backgroundTaskId!==void 0?v.registrationOrderByKey.get(x.backgroundTaskId):void 0;if(v.retiredBindings.has(N)||E!==void 0&&M!==void 0&&EM.backgroundTaskId===N);if(x===void 0&&(v.retiredBindings.has(N)||v.registrationOrderByKey.has(N)&&v.registrationOrderByKey.get(N)0&&v.settledByKernel.add(C.agentId),b.push({type:"taskCompleted",sessionId:m,taskId:typeof C.taskId=="string"?C.taskId:typeof C.taskId=="number"?String(C.taskId):"",status:C.status==="killed"?"cancelled":T?"failed":"completed"});break}}return b}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function Dwe(e){return new vwe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>Nwe({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const Fwe={t:e=>e},tD="Sub Agent";function Bwe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function Rwe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function $we(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function ty(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const Owe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function qC(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?Owe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function Pwe(e,t,n,i=Fwe){const o=Rwe(e);switch($we(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!ty(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),v=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),y=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,b=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:v?g.status:t.task.status,subagentPhase:v?g.subagentPhase:t.task.subagentPhase,completedAt:v?g.completedAt:b?h.completedAt:t.task.completedAt,completedAtEstimated:v?g.completedAtEstimated:b?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:v?g.outputLines:y?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:v?g.text:y?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:v?g.outputPreview:t.task.outputPreview??(y?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:v?g.outputBytes:t.task.outputBytes??(y?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===tD&&h.description!==tD?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:y?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:y?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!ty(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!ty(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(ty(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,qC(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function zwe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,Hwe=/([\w-]+)="([^"]*)"/g,Wwe=/]*)>[\s\S]*?<\/output-file>/,qwe=/]*)>([\s\S]*?)<\/output-preview>/,Uwe=/^Title: (.*)$/m,Vwe=/^Severity: (.*)$/m;function Zy(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function O8(e){const t={};for(const n of e.matchAll(Hwe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=Zy(n[2]));return t}function Kwe(e,t,n){const i=O8(e),o=Uwe.exec(t)?.[1]?.trim()??"",s=Vwe.exec(t)?.[1]?.trim()??"";let r=t.split(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function CW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:g4(t,"input",e.processors),output:g4(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Dr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Dr(i.element,n);if(i.type==="set")return Dr(i.valueType,n);if(i.type==="lazy")return Dr(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Dr(i.innerType,n);if(i.type==="intersection")return Dr(i.left,n)||Dr(i.right,n);if(i.type==="record"||i.type==="map")return Dr(i.keyType,n)||Dr(i.valueType,n);if(i.type==="pipe")return Dr(i.in,n)||Dr(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Dr(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Dr(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Dr(o,n))return!0;return!!(i.rest&&Dr(i.rest,n))}return!1}const W3e=(e,t={})=>n=>{const i=bW({...n,processors:t});return fs(e,i),wW(i,e),CW(i,e)},g4=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=bW({...o??{},target:s,io:t,processors:n});return fs(e,r),wW(r,e),CW(r,e)},q3e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},U3e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=q3e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},V3e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},K3e=(e,t,n,i)=>{n.type="boolean"},Z3e=(e,t,n,i)=>{n.not={}},G3e=(e,t,n,i)=>{},Q3e=(e,t,n,i)=>{const o=e._zod.def,s=XH(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},Y3e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},J3e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},X3e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},e8e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=fs(s.element,t,{...i,path:[...i.path,"items"]})},t8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=fs(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=fs(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},n8e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>fs(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},i8e=(e,t,n,i)=>{const o=e._zod.def,s=fs(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=fs(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},o8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=fs(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=fs(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=fs(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},s8e=(e,t,n,i)=>{const o=e._zod.def,s=fs(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},r8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},l8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},a8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},u8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},c8e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;fs(s,t,i);const r=t.seen.get(e);r.ref=s},d8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},AW=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},f8e=Mt("ZodISODateTime",(e,t)=>{hbe.init(e,t),Do.init(e,t)});function h8e(e){return k3e(f8e,e)}const p8e=Mt("ZodISODate",(e,t)=>{pbe.init(e,t),Do.init(e,t)});function m8e(e){return b3e(p8e,e)}const g8e=Mt("ZodISOTime",(e,t)=>{mbe.init(e,t),Do.init(e,t)});function v8e(e){return w3e(g8e,e)}const y8e=Mt("ZodISODuration",(e,t)=>{gbe.init(e,t),Do.init(e,t)});function k8e(e){return C3e(y8e,e)}const b8e=(e,t)=>{iW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>rke(e,n)},flatten:{value:n=>ske(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,zC,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,zC,2)}},isEmpty:{get(){return e.issues.length===0}}})},Aa=Mt("ZodError",b8e,{Parent:Error}),w8e=W7(Aa),C8e=q7(Aa),A8e=Uk(Aa),x8e=Vk(Aa),S8e=uke(Aa),_8e=cke(Aa),M8e=dke(Aa),I8e=fke(Aa),T8e=hke(Aa),E8e=pke(Aa),L8e=mke(Aa),N8e=gke(Aa),No=Mt("ZodType",(e,t)=>(Lo.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:g4(e,"input"),output:g4(e,"output")}}),e.toJSONSchema=W3e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(sf(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>rf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>w8e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>A8e(e,n,i),e.parseAsync=async(n,i)=>C8e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>x8e(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>S8e(e,n,i),e.decode=(n,i)=>_8e(e,n,i),e.encodeAsync=async(n,i)=>M8e(e,n,i),e.decodeAsync=async(n,i)=>I8e(e,n,i),e.safeEncode=(n,i)=>T8e(e,n,i),e.safeDecode=(n,i)=>E8e(e,n,i),e.safeEncodeAsync=async(n,i)=>L8e(e,n,i),e.safeDecodeAsync=async(n,i)=>N8e(e,n,i),e.refine=(n,i)=>e.check(_5e(n,i)),e.superRefine=n=>e.check(M5e(n)),e.overwrite=n=>e.check(J1(n)),e.optional=()=>KN(e),e.exactOptional=()=>h5e(e),e.nullable=()=>ZN(e),e.nullish=()=>KN(ZN(e)),e.nonoptional=n=>k5e(e,n),e.array=()=>_i(e),e.or=n=>o5e([e,n]),e.and=n=>l5e(e,n),e.transform=n=>GN(e,d5e(n)),e.default=n=>g5e(e,n),e.prefault=n=>y5e(e,n),e.catch=n=>w5e(e,n),e.pipe=n=>GN(e,n),e.readonly=()=>x5e(e),e.describe=n=>{const i=e.clone();return fg.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return fg.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return fg.get(e);const i=e.clone();return fg.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xW=Mt("_ZodString",(e,t)=>{U7.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>U3e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(I3e(...i)),e.includes=(...i)=>e.check(L3e(...i)),e.startsWith=(...i)=>e.check(N3e(...i)),e.endsWith=(...i)=>e.check(D3e(...i)),e.min=(...i)=>e.check(m4(...i)),e.max=(...i)=>e.check(yW(...i)),e.length=(...i)=>e.check(kW(...i)),e.nonempty=(...i)=>e.check(m4(1,...i)),e.lowercase=i=>e.check(T3e(i)),e.uppercase=i=>e.check(E3e(i)),e.trim=()=>e.check(B3e()),e.normalize=(...i)=>e.check(F3e(...i)),e.toLowerCase=()=>e.check(R3e()),e.toUpperCase=()=>e.check(O3e()),e.slugify=()=>e.check($3e())}),D8e=Mt("ZodString",(e,t)=>{U7.init(e,t),xW.init(e,t),e.email=n=>e.check(Jbe(F8e,n)),e.url=n=>e.check(i3e(B8e,n)),e.jwt=n=>e.check(y3e(Q8e,n)),e.emoji=n=>e.check(o3e(R8e,n)),e.guid=n=>e.check(jN(UN,n)),e.uuid=n=>e.check(Xbe(J2,n)),e.uuidv4=n=>e.check(e3e(J2,n)),e.uuidv6=n=>e.check(t3e(J2,n)),e.uuidv7=n=>e.check(n3e(J2,n)),e.nanoid=n=>e.check(s3e(O8e,n)),e.guid=n=>e.check(jN(UN,n)),e.cuid=n=>e.check(r3e($8e,n)),e.cuid2=n=>e.check(l3e(P8e,n)),e.ulid=n=>e.check(a3e(z8e,n)),e.base64=n=>e.check(m3e(K8e,n)),e.base64url=n=>e.check(g3e(Z8e,n)),e.xid=n=>e.check(u3e(j8e,n)),e.ksuid=n=>e.check(c3e(H8e,n)),e.ipv4=n=>e.check(d3e(W8e,n)),e.ipv6=n=>e.check(f3e(q8e,n)),e.cidrv4=n=>e.check(h3e(U8e,n)),e.cidrv6=n=>e.check(p3e(V8e,n)),e.e164=n=>e.check(v3e(G8e,n)),e.datetime=n=>e.check(h8e(n)),e.date=n=>e.check(m8e(n)),e.time=n=>e.check(v8e(n)),e.duration=n=>e.check(k8e(n))});function Ot(e){return Ybe(D8e,e)}const Do=Mt("ZodStringFormat",(e,t)=>{So.init(e,t),xW.init(e,t)}),F8e=Mt("ZodEmail",(e,t)=>{obe.init(e,t),Do.init(e,t)}),UN=Mt("ZodGUID",(e,t)=>{nbe.init(e,t),Do.init(e,t)}),J2=Mt("ZodUUID",(e,t)=>{ibe.init(e,t),Do.init(e,t)}),B8e=Mt("ZodURL",(e,t)=>{sbe.init(e,t),Do.init(e,t)}),R8e=Mt("ZodEmoji",(e,t)=>{rbe.init(e,t),Do.init(e,t)}),O8e=Mt("ZodNanoID",(e,t)=>{lbe.init(e,t),Do.init(e,t)}),$8e=Mt("ZodCUID",(e,t)=>{abe.init(e,t),Do.init(e,t)}),P8e=Mt("ZodCUID2",(e,t)=>{ube.init(e,t),Do.init(e,t)}),z8e=Mt("ZodULID",(e,t)=>{cbe.init(e,t),Do.init(e,t)}),j8e=Mt("ZodXID",(e,t)=>{dbe.init(e,t),Do.init(e,t)}),H8e=Mt("ZodKSUID",(e,t)=>{fbe.init(e,t),Do.init(e,t)}),W8e=Mt("ZodIPv4",(e,t)=>{vbe.init(e,t),Do.init(e,t)}),q8e=Mt("ZodIPv6",(e,t)=>{ybe.init(e,t),Do.init(e,t)}),U8e=Mt("ZodCIDRv4",(e,t)=>{kbe.init(e,t),Do.init(e,t)}),V8e=Mt("ZodCIDRv6",(e,t)=>{bbe.init(e,t),Do.init(e,t)}),K8e=Mt("ZodBase64",(e,t)=>{wbe.init(e,t),Do.init(e,t)}),Z8e=Mt("ZodBase64URL",(e,t)=>{Abe.init(e,t),Do.init(e,t)}),G8e=Mt("ZodE164",(e,t)=>{xbe.init(e,t),Do.init(e,t)}),Q8e=Mt("ZodJWT",(e,t)=>{_be.init(e,t),Do.init(e,t)}),SW=Mt("ZodNumber",(e,t)=>{hW.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>V3e(e,i,o),e.gt=(i,o)=>e.check(WN(i,o)),e.gte=(i,o)=>e.check(L8(i,o)),e.min=(i,o)=>e.check(L8(i,o)),e.lt=(i,o)=>e.check(HN(i,o)),e.lte=(i,o)=>e.check(E8(i,o)),e.max=(i,o)=>e.check(E8(i,o)),e.int=i=>e.check(VN(i)),e.safe=i=>e.check(VN(i)),e.positive=i=>e.check(WN(0,i)),e.nonnegative=i=>e.check(L8(0,i)),e.negative=i=>e.check(HN(0,i)),e.nonpositive=i=>e.check(E8(0,i)),e.multipleOf=(i,o)=>e.check(qN(i,o)),e.step=(i,o)=>e.check(qN(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function yn(e){return A3e(SW,e)}const Y8e=Mt("ZodNumberFormat",(e,t)=>{Mbe.init(e,t),SW.init(e,t)});function VN(e){return x3e(Y8e,e)}const J8e=Mt("ZodBoolean",(e,t)=>{Ibe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>K3e(e,n,i)});function xv(e){return S3e(J8e,e)}const X8e=Mt("ZodUnknown",(e,t)=>{Tbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>G3e()});function _s(){return _3e(X8e)}const e5e=Mt("ZodNever",(e,t)=>{Ebe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Z3e(e,n,i)});function t5e(e){return M3e(e5e,e)}const n5e=Mt("ZodArray",(e,t)=>{Lbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>e8e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(m4(n,i)),e.nonempty=n=>e.check(m4(1,n)),e.max=(n,i)=>e.check(yW(n,i)),e.length=(n,i)=>e.check(kW(n,i)),e.unwrap=()=>e.element});function _i(e,t){return P3e(n5e,e,t)}const i5e=Mt("ZodObject",(e,t)=>{Dbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>t8e(e,n,i,o),ji(e,"shape",()=>t.shape),e.keyof=()=>xo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_s()}),e.loose=()=>e.clone({...e._zod.def,catchall:_s()}),e.strict=()=>e.clone({...e._zod.def,catchall:t5e()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>eke(e,n),e.safeExtend=n=>tke(e,n),e.merge=n=>nke(e,n),e.pick=n=>J4e(e,n),e.omit=n=>X4e(e,n),e.partial=(...n)=>ike(MW,e,n[0]),e.required=(...n)=>oke(IW,e,n[0])});function Gt(e,t){const n={type:"object",shape:e??{},...Mn(t)};return new i5e(n)}const _W=Mt("ZodUnion",(e,t)=>{gW.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>n8e(e,n,i,o),e.options=t.options});function o5e(e,t){return new _W({type:"union",options:e,...Mn(t)})}const s5e=Mt("ZodDiscriminatedUnion",(e,t)=>{_W.init(e,t),Fbe.init(e,t)});function lf(e,t,n){return new s5e({type:"union",options:t,discriminator:e,...Mn(n)})}const r5e=Mt("ZodIntersection",(e,t)=>{Bbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>i8e(e,n,i,o)});function l5e(e,t){return new r5e({type:"intersection",left:e,right:t})}const a5e=Mt("ZodRecord",(e,t)=>{Rbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>o8e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function V7(e,t,n){return new a5e({type:"record",keyType:e,valueType:t,...Mn(n)})}const HC=Mt("ZodEnum",(e,t)=>{Obe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>Q3e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new HC({...t,checks:[],...Mn(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new HC({...t,checks:[],...Mn(o),entries:s})}});function xo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new HC({type:"enum",entries:n,...Mn(t)})}const u5e=Mt("ZodLiteral",(e,t)=>{$be.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Y3e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Hn(e,t){return new u5e({type:"literal",values:Array.isArray(e)?e:[e],...Mn(t)})}const c5e=Mt("ZodTransform",(e,t)=>{Pbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>X3e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new YH(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(O0(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(O0(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function d5e(e){return new c5e({type:"transform",transform:e})}const MW=Mt("ZodOptional",(e,t)=>{vW.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function KN(e){return new MW({type:"optional",innerType:e})}const f5e=Mt("ZodExactOptional",(e,t)=>{zbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function h5e(e){return new f5e({type:"optional",innerType:e})}const p5e=Mt("ZodNullable",(e,t)=>{jbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>s8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ZN(e){return new p5e({type:"nullable",innerType:e})}const m5e=Mt("ZodDefault",(e,t)=>{Hbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>l8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function g5e(e,t){return new m5e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tW(t)}})}const v5e=Mt("ZodPrefault",(e,t)=>{Wbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>a8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function y5e(e,t){return new v5e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tW(t)}})}const IW=Mt("ZodNonOptional",(e,t)=>{qbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>r8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function k5e(e,t){return new IW({type:"nonoptional",innerType:e,...Mn(t)})}const b5e=Mt("ZodCatch",(e,t)=>{Ube.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>u8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function w5e(e,t){return new b5e({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const C5e=Mt("ZodPipe",(e,t)=>{Vbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>c8e(e,n,i,o),e.in=t.in,e.out=t.out});function GN(e,t){return new C5e({type:"pipe",in:e,out:t})}const A5e=Mt("ZodReadonly",(e,t)=>{Kbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>d8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function x5e(e){return new A5e({type:"readonly",innerType:e})}const S5e=Mt("ZodCustom",(e,t)=>{Zbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>J3e(e,n)});function _5e(e,t={}){return z3e(S5e,e,t)}function M5e(e){return j3e(e)}const Dh=Ot().min(1),K7=Ot().min(1),Sv=Ot().min(1),Fh=Ot().min(1),Kl=Ot().min(1),I5e=/^[A-Za-z0-9._-]{1,128}$/;function T5e(e){return I5e.test(e)&&e!=="."&&e!==".."}const TW=lf("kind",[Gt({kind:Hn("user"),payload:_s().optional()}),Gt({kind:Hn("cron"),taskId:Fh.optional(),payload:_s().optional()}),Gt({kind:Hn("task"),taskId:Fh,payload:_s().optional()}),Gt({kind:Hn("hook"),payload:_s().optional()}),Gt({kind:Hn("compaction"),payload:_s().optional()}),Gt({kind:Hn("side"),payload:_s().optional()}),Gt({kind:Hn("other"),payload:_s().optional()})]),E5e=Gt({inputTokens:yn().optional(),outputTokens:yn().optional(),cachedTokens:yn().optional(),cost:yn().optional()}),Jg=Gt({inputOther:yn(),output:yn(),inputCacheRead:yn(),inputCacheCreation:yn()}),L5e=Gt({llmFirstTokenLatencyMs:yn().optional(),llmStreamDurationMs:yn().optional(),llmRequestBuildMs:yn().optional(),llmServerFirstTokenMs:yn().optional(),llmServerDecodeMs:yn().optional(),llmClientConsumeMs:yn().optional()}),N5e=Gt({failedAttempt:yn(),nextAttempt:yn(),maxAttempts:yn(),delayMs:yn(),errorName:Ot(),errorMessage:Ot(),statusCode:yn().optional()}),EW=xo(["queued","running","completed","failed","cancelled"]),D5e=xo(["running","completed","interrupted","failed"]),F5e=Gt({kind:Hn("text"),frameId:Sv,role:xo(["assistant","user"]),text:Ot(),attachmentIds:_i(Ot()).optional(),taskId:Fh.optional(),promptIds:_i(Ot()).optional()}),B5e=Gt({kind:Hn("thinking"),frameId:Sv,text:Ot()}),R5e=Gt({agentId:Kl,role:xo(["child","member"]).optional()}),O5e=Gt({kind:xo(["stdout","stderr","progress","status","custom"]),text:Ot().optional(),percent:yn().optional(),customKind:Ot().optional(),customData:_s().optional()}),$5e=Gt({kind:Hn("tool"),frameId:Sv,toolCallId:Ot(),name:Ot(),view:Ot().optional(),state:xo(["running","done","error"]),input:_s().optional(),output:_s().optional(),display:_s().optional(),error:Ot().optional(),inputText:Ot().optional(),progress:O5e.optional(),taskId:Fh.optional(),approvalId:Ot().optional(),todoId:Ot().optional(),agentRefs:_i(R5e).optional()}),Z7=Gt({interactionId:Ot(),interactionKind:xo(["approval","question"]),toolCallId:Ot().optional(),state:xo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:_s().optional(),response:_s().optional()}),P5e=Gt({kind:Hn("notice"),frameId:Sv,level:xo(["error","warning","info"]),source:Ot().optional(),message:Ot(),detail:_s().optional()}),LW=lf("kind",[F5e,B5e,$5e,P5e]),NW=Gt({kind:Hn("step"),stepId:K7,turnId:Dh,ordinal:yn().int(),state:D5e,frames:_i(LW),startedAt:Ot().optional(),endedAt:Ot().optional(),usage:Jg.optional(),finishReason:Ot().optional(),timing:L5e.optional(),retry:N5e.optional(),endReason:Ot().optional(),endMessage:Ot().optional()}),DW=Gt({kind:Hn("turn"),turnId:Dh,ordinal:yn().int(),state:EW,origin:TW,prompt:Ot().optional(),attachmentIds:_i(Ot()).optional(),steps:_i(NW),startedAt:Ot().optional(),endedAt:Ot().optional(),usage:E5e.optional(),durationMs:yn().optional(),error:Ot().optional()}),FW=Gt({kind:Hn("marker"),markerId:Ot(),marker:Ot(),payload:_s().optional(),at:Ot().optional()}),BW=Gt({kind:Hn("taskref"),refId:Ot(),taskId:Fh,at:Ot().optional()}),RW=lf("kind",[DW,FW,BW]),G7=Gt({taskId:Fh,kind:xo(["shell","subagent","tool","other"]),state:xo(["running","completed","failed","timed_out","killed","lost"]),detached:xv(),description:Ot().optional(),agentId:Kl.optional(),outputTail:Ot(),startedAt:Ot().optional(),endedAt:Ot().optional(),resultSummary:Ot().optional(),error:Ot().optional(),stateReason:Ot().optional(),usage:Jg.optional(),model:Ot().optional(),thinkingEffort:Ot().optional()}),OW=Gt({objective:Ot(),status:xo(["active","paused","blocked","complete"]),completionCriterion:Ot().optional(),budgetUsed:yn().optional(),budgetLimit:yn().optional()}),z5e=Gt({plan:Gt({reviewPath:Ot().optional(),version:yn().optional()}).optional(),swarm:Gt({trigger:Ot().optional()}).optional(),tower:Gt({}).optional()}),j5e=Gt({plan:Gt({reviewPath:Ot().optional(),version:yn().optional()}).nullable().optional(),swarm:Gt({trigger:Ot().optional()}).nullable().optional(),tower:Gt({}).nullable().optional()}),H5e=lf("kind",[Gt({kind:Hn("idle")}),Gt({kind:Hn("running"),turnId:yn(),step:yn(),stepId:Ot(),since:yn()}),Gt({kind:Hn("streaming"),turnId:yn(),step:yn(),stepId:Ot(),stream:xo(["assistant","thinking","tool_call"]),toolCallId:Ot().optional(),toolName:Ot().optional(),since:yn()}),Gt({kind:Hn("tool_call"),turnId:yn(),step:yn(),toolCallId:Ot(),name:Ot(),since:yn()}),Gt({kind:Hn("retrying"),turnId:yn(),step:yn(),stepId:Ot(),failedAttempt:yn(),nextAttempt:yn(),maxAttempts:yn(),delayMs:yn(),errorName:Ot().optional(),statusCode:yn().optional(),since:yn()}),Gt({kind:Hn("awaiting_approval"),turnId:yn(),step:yn().optional(),approval:_s().optional(),since:yn()}),Gt({kind:Hn("interrupted"),turnId:yn(),step:yn().optional(),reason:xo(["aborted","max_steps","error"]),message:Ot().optional(),at:yn()}),Gt({kind:Hn("ended"),turnId:yn(),reason:xo(["completed","cancelled","failed","blocked"]),durationMs:yn().optional(),at:yn()})]),W5e=Gt({byModel:V7(Ot(),Jg).optional(),currentTurn:Jg.optional(),total:Jg.optional()}),q5e=Gt({model:Ot().optional(),thinkingEffort:Ot().optional(),usage:W5e.optional(),contextTokens:yn().optional(),maxContextTokens:yn().optional(),contextUsage:yn().optional(),permission:xo(["manual","yolo","auto"]).optional(),phase:H5e.optional()}),Q7=Gt({goal:OW.optional(),modes:z5e.optional(),activity:xo(["idle","turn","disposing","unknown"]).optional(),agent:q5e.optional()}),U5e=Q7.extend({goal:OW.nullable().optional(),modes:j5e.optional()}),Zk=Gt({attachmentId:Ot(),mediaType:Ot(),name:Ot().optional(),size:yn().optional(),source:lf("kind",[Gt({kind:Hn("url"),url:Ot()}),Gt({kind:Hn("file"),fileId:Ot()}),Gt({kind:Hn("session_media"),fileId:Ot()})]).optional(),placeholder:Ot().optional()}),V5e=Gt({title:Ot(),status:xo(["pending","in_progress","done"])}),Y7=Gt({todoId:Ot(),items:_i(V5e),updatedAt:Ot().optional()}),J7=Gt({promptId:Ot(),status:xo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:Ot().optional(),content:_s().optional(),createdAt:Ot(),finishedAt:Ot().optional(),steeredAt:Ot().optional()}),$W=Gt({items:_i(RW),tasks:_i(G7),interactions:_i(Z7).default([]),attachments:_i(Zk).default([]),todos:_i(Y7).default([]),prompts:_i(J7).default([]),meta:Q7,hasMoreOlder:xv().optional()}),K5e=DW.omit({steps:!0}),Z5e=NW.omit({frames:!0}),G5e=lf("type",[Gt({type:Hn("frame"),turnId:Dh,stepId:K7,frameId:Sv}),Gt({type:Hn("task"),taskId:Fh})]),X7=lf("op",[Gt({op:Hn("reset"),agentId:Kl,snapshot:$W}),Gt({op:Hn("turn.upsert"),turn:K5e}),Gt({op:Hn("step.upsert"),turnId:Dh,step:Z5e}),Gt({op:Hn("frame.upsert"),turnId:Dh,stepId:K7,frame:LW}),Gt({op:Hn("append"),target:G5e,offset:yn().int().nonnegative(),text:Ot()}),Gt({op:Hn("marker.upsert"),item:FW,beforeTurn:yn().int().optional()}),Gt({op:Hn("taskref.upsert"),item:BW,beforeTurn:yn().int().optional()}),Gt({op:Hn("task.upsert"),task:G7}),Gt({op:Hn("interaction.upsert"),interaction:Z7}),Gt({op:Hn("attachment.upsert"),attachment:Zk}),Gt({op:Hn("todo.upsert"),todo:Y7}),Gt({op:Hn("prompt.upsert"),prompt:J7}),Gt({op:Hn("meta.merge"),meta:U5e}),Gt({op:Hn("items.remove"),ids:_i(Ot())})]);Gt({agentId:Kl,ops:_i(X7)});const Q5e=xo(["off","turn","block","delta"]),E1=yn().int().nonnegative(),Y5e=V7(Ot(),Q5e);Gt({session_id:Ot().min(1),transcript:Y5e,transcript_since:V7(Ot(),E1).optional()});Gt({agent_id:Kl,before_turn:Ot().min(1).optional(),after_turn:Ot().min(1).optional(),page_size:yn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),T5e(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const J5e=Gt({agentId:Kl,type:xo(["main","sub","independent"]).optional(),parentAgentId:Kl.optional(),label:Ot().optional(),createdAt:Ot().optional(),disposedAt:Ot().optional()}),X5e=Gt({agent_id:Kl,items:_i(RW),has_more:xv(),tasks:_i(G7),interactions:_i(Z7).default([]),attachments:_i(Zk).default([]),todos:_i(Y7).default([]),prompts:_i(J7).default([]),meta:Q7,agents:_i(J5e),pending_interactions:_i(Ot()),seq:E1.optional()});Gt({agent_id:Kl,batches:_i(Gt({seq:E1,ops:_i(X7)})),latest_seq:E1,complete:xv()});const ewe=Gt({turn_id:Dh,ordinal:yn().int(),state:EW,origin:TW,prompt:Ot(),attachment_ids:_i(Ot()).optional(),started_at:Ot().optional()});Gt({agents:_i(Gt({agent_id:Kl,messages:_i(ewe),attachments:_i(Zk).default([])}))});const twe=Gt({state:xo(["pending","approved","rejected","cancelled"]),selected_option:Ot().optional(),feedback:Ot().optional()}),nwe=Gt({tool_call_id:Ot(),turn_id:Dh,source:xo(["interaction","display","output"]),plan:Ot(),path:Ot().optional(),options:_i(Gt({label:Ot(),description:Ot().optional()})).optional(),review:twe.optional()});Gt({agent_id:Kl,plans:_i(nwe)});const iwe=Gt({agent_id:Kl,snapshot:$W,has_more_older:xv(),seq:E1.optional()}),owe=Gt({agent_id:Kl,ops:_i(X7),seq:E1.optional()}),PW=iwe.extend({type:Hn("transcript.reset")}),zW=owe.extend({type:Hn("transcript.ops")});lf("type",[PW,zW]);const QN=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),swe=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),rwe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),lwe=new Set(["assistant.delta","thinking.delta"]);function awe(e,t){if(rwe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return lwe.has(i)?uwe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?swe.has(i)?{route:"protocol"}:QN.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:QN.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function uwe(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const cwe="kimi-code.bearer.",dwe=3e4;class YN{constructor(t){this.opts=t,this.tracer=t.tracer??R7}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${cwe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=X2(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(X2(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(X2(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,dwe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=PW.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=zW.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=X2(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=awe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function X2(e,t){return`${e}\0${t}`}async function fwe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=X5e.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const N8=10485760,hwe=5e3,JN=40001;function pwe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function mwe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function D8(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function XN(e){return e==="auto_compact"||e==="manual_compact"}class gwe{constructor(t){this.opts=t,this.tracer=t.tracer??R7,this.http=new wN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new wN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(hu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return hu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return hu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return hu(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return ZH(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return hu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(VH),hasMore:o.has_more}}async getSessionTranscript(t,n){return fwe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` +`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&qi(d)&&d.code===JN)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:pwe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,a4e(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...mwe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:yN});return hu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:yN});return hu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(hu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,u4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,m4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>OC(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return OC(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(D8)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return D8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return D8(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(KH));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(xN)])):void 0;return{items:o.items.map(xN),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:search",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async suggestFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:suggest",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return fd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Yg)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return Yg(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Yg(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(v4e)}async listProviders(){return(await this.http.get("/providers")).items.map(kp)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=kp(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return kp(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:kp(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(SN)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return SN(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:kp(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(kp),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return F8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return F8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return F8(t)}async getConfig(){const t=await this.http.get("/config");return $C(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return $C(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&qi(i)&&i.code===JN)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),hwe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return fd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return fd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:N8});if(n.size>N8)throw new O7({size:n.size,limit:N8});const i=n.type,o=!vwe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await ywe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=gN(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new YN({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=y4e(s),l=k4e(s),a=g4e(s);a.type==="historyCompacted"&&!XN(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!XN(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new YN({wsUrl:gN(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function F8(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function vwe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function ywe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const kwe="main",bwe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function B8(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function wwe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function eD(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function yr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Js(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function oa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Cwe(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=yr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=yr(t,"goalId")??yr(t,"goal_id")??"goal",r=yr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:yr(t,"completionCriterion")??yr(t,"completion_criterion"),status:o,turnsUsed:Js(t,"turnsUsed")??Js(t,"turns_used")??0,tokensUsed:Js(t,"tokensUsed")??Js(t,"tokens_used")??0,wallClockMs:Js(t,"wallClockMs")??Js(t,"wall_clock_ms")??0,terminalReason:yr(t,"terminalReason")??yr(t,"terminal_reason"),budget:{tokenBudget:oa(i,"tokenBudget")??oa(i,"token_budget"),remainingTokens:oa(i,"remainingTokens")??oa(i,"remaining_tokens"),turnBudget:oa(i,"turnBudget")??oa(i,"turn_budget"),remainingTurns:oa(i,"remainingTurns")??oa(i,"remaining_turns"),wallClockBudgetMs:oa(i,"wallClockBudgetMs")??oa(i,"wall_clock_budget_ms"),remainingWallClockMs:oa(i,"remainingWallClockMs")??oa(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function nd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function Awe(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=yr(n,"name")??yr(n,"toolName")??"tool",o=R$(e,xwe(i)),s=Swe(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=yr(i,"text");if(s)return R8(s);const r=yr(i,"message");if(r)return R8(r)}const o=yr(n,"message");if(o)return R8(o)}return null}function xwe(e){return e.replace(/_\d+$/,"")}const tD=2e3;function R8(e){return e.length>tD?`${e.slice(0,tD)}…`:e}function Swe(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return S6(e,t,i)}function _we(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=yr(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=nd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),v=[];return g&&v.push({type:"taskCreated",sessionId:n,task:g}),v.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),v}const l=Awe(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=nd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function Mwe(e){return Array.isArray(e)?e.map(t=>$7(t)):[]}function Iwe(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const Twe=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function Ewe(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=Cwe(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function Lwe(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=eD(),n.set(f,h)),h}function s(f){n.set(f,eD())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(v){return yu("[agentProjector] Error projecting event:",f,v instanceof Error?v.message:v),[]}}function d(f,h,m,g){if(Twe.has(f))return Ewe(f,h,m);const v=o(m),y=h,b=[],w=y?.agentId;if(typeof w=="string"&&w!==kwe){const C=i.has(w);if(f==="prompt.submitted"){if(!C)return[];const T=y?.promptId,N=y?.userMessageId;if(!T||!N)return[];const I=Mwe(y?.content);return I.length===0?[]:[{type:"messageCreated",agentId:w,message:{id:N,sessionId:m,role:"user",content:I,createdAt:typeof y?.createdAt=="string"?y.createdAt:new Date().toISOString(),promptId:T}}]}if(C&&(f==="thinking.delta"||f==="assistant.delta")){const T=y?.delta??"";return T?[{type:"agentDelta",sessionId:m,agentId:w,delta:{[f==="thinking.delta"?"thinking":"text"]:T}}]:[]}if(C&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:w,reason:y?.reason}];if(bwe.has(f))return _we(t,v,m,w,f,y??{},i)}switch(f){case"turn.started":{const C=y?.turnId,T=v.currentPromptId??B8("pr_");v.currentPromptId=T,C!==void 0&&v.turnPromptId.set(C,T),b.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const C=wwe(y?.usage);v.totalInput+=C.input,v.totalOutput+=C.output,v.totalCacheRead+=C.cacheRead,v.totalCacheCreate+=C.cacheCreate;break}case"agent.status.updated":{y?.model&&(v.model=y.model),y?.contextTokens!==void 0&&(v.contextTokens=y.contextTokens),y?.maxContextTokens!==void 0&&(v.contextLimit=y.maxContextTokens);const C=y?.phase;C!=null&&C.kind==="retrying"?(v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Js(C,"failedAttempt")??0,nextAttempt:Js(C,"nextAttempt")??0,maxAttempts:Js(C,"maxAttempts")??0,delayMs:Js(C,"delayMs")??0,errorName:yr(C,"errorName"),statusCode:Js(C,"statusCode"),turnId:Js(C,"turnId")}})):v.retryActive&&C!==void 0&&C!==null&&typeof C.kind=="string"&&(v.retryActive=!1,b.push({type:"turnRetry",sessionId:m,retry:void 0})),b.push({type:"sessionUsageUpdated",sessionId:m,usage:Iwe(v),model:v.model||void 0,swarmMode:y?.swarmMode===!0?!0:y?.swarmMode===!1?!1:void 0,planMode:y?.planMode===!0?!0:y?.planMode===!1?!1:void 0,thinking:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:void 0});break}case"turn.ended":{const C=y?.turnId,T=(C!==void 0?v.turnPromptId.get(C):void 0)??v.currentPromptId;b.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:y?.reason,promptId:T}),v.turnCount++,v.currentPromptId=void 0;break}case"prompt.completed":{const C=y?.promptId;typeof C=="string"&&C.length>0&&b.push({type:"promptCompleted",sessionId:m,promptId:C,reason:y?.reason??"completed"});break}case"prompt.aborted":{const C=y?.promptId;typeof C=="string"&&C.length>0&&b.push({type:"promptAborted",sessionId:m,promptId:C});break}case"turn.step.retrying":{v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Js(y??{},"failedAttempt")??0,nextAttempt:Js(y??{},"nextAttempt")??0,maxAttempts:Js(y??{},"maxAttempts")??0,delayMs:Js(y??{},"delayMs")??0,errorName:yr(y??{},"errorName"),statusCode:Js(y??{},"statusCode"),turnId:typeof y?.turnId=="number"?y.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const C=typeof y?.subagentId=="string"&&y.subagentId.length>0?y.subagentId:B8("task_"),T=typeof y?.taskId=="string"&&y.taskId.length>0?y.taskId:void 0,N=T!==void 0&&T!==C?v.subagentMeta.get(T):void 0,I=v.subagentMeta.get(C);N!==void 0&&v.subagentMeta.delete(T),T!==void 0&&!v.registrationOrderByKey.has(T)&&v.registrationOrderByKey.set(T,++v.registrationSeq);const S=I===void 0||N===void 0?I??N:{...I,createdAt:N.createdAt,startedAt:N.startedAt??I.startedAt,runInBackground:!0,backgroundTaskId:I.backgroundTaskId??T},_=S?.backgroundTaskId??(S!==void 0&&T!==void 0&&S.id===T?T:void 0),x=T!==void 0?v.registrationOrderByKey.get(T):void 0,E=_!==void 0?v.registrationOrderByKey.get(_):void 0,M=v.retiredBindings.has(T??"")||x!==void 0&&E!==void 0&&x0?y.model:S?.model,thinkingEffort:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:S?.thinkingEffort,parentToolCallId:typeof y?.parentToolCallId=="string"?y.parentToolCallId:S?.parentToolCallId,swarmIndex:typeof y?.swarmIndex=="number"?y.swarmIndex:S?.swarmIndex,runInBackground:R?y?.runInBackground===!0||y?.runInBackground===void 0&&S?.runInBackground===!0:y?.runInBackground===!0||S?.runInBackground===!0,outputPreview:R?void 0:S?.outputPreview,outputBytes:R?void 0:S?.outputBytes,outputLines:R?void 0:S?.outputLines,suspendedReason:R?void 0:S?.suspendedReason,text:R?void 0:S?.text,backgroundTaskId:M?S?.backgroundTaskId:R?T:T??S?.backgroundTaskId};v.subagentMeta.set(z.id,z),b.push({type:"taskCreated",sessionId:m,task:z});break}case"subagent.started":{const C=typeof y?.subagentId=="string"?y.subagentId:void 0,T=C!==void 0&&(v.subagentMeta.get(C)?.status!==void 0&&v.subagentMeta.get(C).status!=="running"||v.settledByKernel.has(C));T&&v.settledByKernel.delete(C);const N=nd(t,v,m,y?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...T?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});T&&C!==void 0&&v.restartedThisRun.add(C),N&&b.push({type:"taskCreated",sessionId:m,task:N});break}case"subagent.suspended":{const C=nd(t,v,m,y?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof y?.reason=="string"?y.reason:void 0});C&&b.push({type:"taskCreated",sessionId:m,task:C});break}case"subagent.completed":{const C=typeof y?.resultSummary=="string"?y.resultSummary:void 0,T=nd(t,v,m,y?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:C});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"completed",outputPreview:C});break}case"subagent.failed":{const C=typeof y?.error=="string"?y.error:void 0,T=nd(t,v,m,y?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:C});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"failed",outputPreview:C});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:y?.code,message:y?.message,name:y?.name,details:y?.details,retryable:y?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:y?.message}});break}case"task.started":case"background.task.started":{const C=y?.info??{},T=typeof C.startedAt=="number"?new Date(C.startedAt).toISOString():void 0,N=typeof C.taskId=="string"?C.taskId:typeof C.taskId=="number"?String(C.taskId):B8("task_"),I=typeof C.description=="string"?C.description:typeof C.command=="string"?C.command:t("tasks.defaultDescription");if(C.kind==="agent"){const _=typeof C.agentId=="string"&&C.agentId.length>0?C.agentId:void 0;if(_!==void 0){const x=v.subagentMeta.get(_),E=v.registrationOrderByKey.get(N),M=x?.backgroundTaskId!==void 0?v.registrationOrderByKey.get(x.backgroundTaskId):void 0;if(v.retiredBindings.has(N)||E!==void 0&&M!==void 0&&EM.backgroundTaskId===N);if(x===void 0&&(v.retiredBindings.has(N)||v.registrationOrderByKey.has(N)&&v.registrationOrderByKey.get(N)0&&v.settledByKernel.add(C.agentId),b.push({type:"taskCompleted",sessionId:m,taskId:typeof C.taskId=="string"?C.taskId:typeof C.taskId=="number"?String(C.taskId):"",status:C.status==="killed"?"cancelled":T?"failed":"completed"});break}}return b}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function Nwe(e){return new gwe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>Lwe({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const Dwe={t:e=>e},nD="Sub Agent";function Fwe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function Bwe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Rwe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function ey(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const Owe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function WC(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?Owe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function $we(e,t,n,i=Dwe){const o=Bwe(e);switch(Rwe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!ey(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),v=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),y=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,b=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:v?g.status:t.task.status,subagentPhase:v?g.subagentPhase:t.task.subagentPhase,completedAt:v?g.completedAt:b?h.completedAt:t.task.completedAt,completedAtEstimated:v?g.completedAtEstimated:b?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:v?g.outputLines:y?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:v?g.text:y?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:v?g.outputPreview:t.task.outputPreview??(y?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:v?g.outputBytes:t.task.outputBytes??(y?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===nD&&h.description!==nD?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:y?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:y?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!ey(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!ey(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(ey(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,WC(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function Pwe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,jwe=/([\w-]+)="([^"]*)"/g,Hwe=/]*)>[\s\S]*?<\/output-file>/,Wwe=/]*)>([\s\S]*?)<\/output-preview>/,qwe=/^Title: (.*)$/m,Uwe=/^Severity: (.*)$/m;function Ky(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function O8(e){const t={};for(const n of e.matchAll(jwe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=Ky(n[2]));return t}function Vwe(e,t,n){const i=O8(e),o=qwe.exec(t)?.[1]?.trim()??"",s=Uwe.exec(t)?.[1]?.trim()??"";let r=t.split(` `).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` -`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=Wwe.exec(t),u=a?(()=>{const f=O8(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=qwe.exec(t),d=c?(()=>{const f=O8(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` -`),g=Zy(m===-1?"":h.slice(m+1)).replace(/\n$/,""),v=Number(f.bytes),y=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(v)?v:void 0,totalBytes:Number.isFinite(y)?y:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:Zy(o),severity:s,body:Zy(r),outputFile:u,outputPreview:d,raw:n}}function Zwe(e){if(!e.includes("{const f=O8(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=Wwe.exec(t),d=c?(()=>{const f=O8(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` +`),g=Ky(m===-1?"":h.slice(m+1)).replace(/\n$/,""),v=Number(f.bytes),y=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(v)?v:void 0,totalBytes:Number.isFinite(y)?y:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:Ky(o),severity:s,body:Ky(r),outputFile:u,outputPreview:d,raw:n}}function Kwe(e){if(!e.includes("nD||s>nD||(o+1)*(s+1)>Ywe)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const iD=500;function oD(e,t){const n=[],i=Bu(e),o=Bu(t),s=Math.min(i.length,iD),r=Math.min(o.length,iD);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function WW(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}const Jwe=/^read[_-]?media(?:file)?$/i,Xwe=/^data:([^;]+);base64,(.*)$/s,eCe=/^<(image|video|audio)\s+path="([^"]+)">$/,tCe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,nCe=/Mime type:\s*([^.\s]+)/i,iCe=/Size:\s*(\d+)\s*bytes/i,oCe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,sCe="Image compressed to fit model limits:",rCe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function lCe(e){return e.includes(sCe)?e.replace(rCe,""):e}function aCe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function sD(e){const t=tCe.exec(e.trim());return t?{kind:t[1],path:aCe(t[2])}:null}const qW=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,uCe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function VC(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return qW.test(i)?i:void 0}const cCe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function rD(e){const t=cCe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",i=uCe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:i!==void 0&&qW.test(i)?i:void 0}}const dCe=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function UW(e){let t="",n=0,i=0;for(;iiD||s>iD||(o+1)*(s+1)>Qwe)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const oD=500;function sD(e,t){const n=[],i=Ru(e),o=Ru(t),s=Math.min(i.length,oD),r=Math.min(o.length,oD);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function WW(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}const Ywe=/^read[_-]?media(?:file)?$/i,Jwe=/^data:([^;]+);base64,(.*)$/s,Xwe=/^<(image|video|audio)\s+path="([^"]+)">$/,eCe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,tCe=/Mime type:\s*([^.\s]+)/i,nCe=/Size:\s*(\d+)\s*bytes/i,iCe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,oCe="Image compressed to fit model limits:",sCe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function rCe(e){return e.includes(oCe)?e.replace(sCe,""):e}function lCe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function rD(e){const t=eCe.exec(e.trim());return t?{kind:t[1],path:lCe(t[2])}:null}const qW=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,aCe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function UC(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return qW.test(i)?i:void 0}const uCe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function lD(e){const t=uCe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",i=aCe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:i!==void 0&&qW.test(i)?i:void 0}}const cCe=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function UW(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function bCe(e,t){if(Mr(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function wCe(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function VW(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=y4(o,s)??oD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=y4(t.before,t.after)??oD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:sre(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function KW(e){const t=` +`)):i.type==="image_url"||i.type==="image"?t.push("[image]"):typeof i.type=="string"?t.push(`[${i.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function kCe(e,t){if(_r(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function bCe(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function VW(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=v4(o,s)??sD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=v4(t.before,t.after)??sD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:ore(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function KW(e){const t=` `,n=` -`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):CCe(e)}function CCe(e){const t=e.split(` +`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):wCe(e)}function wCe(e){const t=e.split(` `);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` -`):e}function ACe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function xCe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` -`);return KW(t)}function SCe(e,t){const n=e.metadata?.origin??{},i=xCe(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function _Ce(e,t,n){const{text:i,cron:o}=SCe(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function MCe(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function ICe(e){return e.metadata?.origin?.kind==="compaction_summary"}function TCe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function ECe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function LCe(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function Qk(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const v=d;if(d=null,!g&&v.blocks.length===0&&v.textParts.length===0&&v.thinkingParts.length===0&&v.tools.length===0)return;if(!g||!i)for(let b=0;bN.kind==="tool"&&N.tool.id===C.id);T&&T.kind==="tool"&&(T.tool=C)}const y={id:v.id,role:"assistant",no:a++,text:v.textParts.join(` +`):e}function CCe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function ACe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` +`);return KW(t)}function xCe(e,t){const n=e.metadata?.origin??{},i=ACe(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function SCe(e,t,n){const{text:i,cron:o}=xCe(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function _Ce(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function MCe(e){return e.metadata?.origin?.kind==="compaction_summary"}function ICe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function TCe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function ECe(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function Gk(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const v=d;if(d=null,!g&&v.blocks.length===0&&v.textParts.length===0&&v.thinkingParts.length===0&&v.tools.length===0)return;if(!g||!i)for(let b=0;bN.kind==="tool"&&N.tool.id===C.id);T&&T.kind==="tool"&&(T.tool=C)}const y={id:v.id,role:"assistant",no:a++,text:v.textParts.join(` `),thinking:v.thinkingParts.length>0?v.thinkingParts.join(` `):void 0,tools:v.tools.length>0?v.tools:void 0,blocks:v.blocks.length>0?v.blocks:void 0,approval:v.approval,approvalId:v.approvalId,durationMs:v.durationMs,createdAt:v.createdAt,endedAt:v.endedAt,goalContinuation:v.goalContinuation};l.push(y),u?.(y,v.sources)}function h(g,v){let y=null;for(const b of v)if(b.type==="text"){if(b.text){y==="text"?g.textParts[g.textParts.length-1]+=b.text:g.textParts.push(b.text);const w=g.blocks.at(-1);w&&w.kind==="text"?w.text+=(y==="text"?"":` `)+b.text:g.blocks.push({kind:"text",text:b.text}),y="text"}}else if(b.type==="thinking"){if(b.thinking){y==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=b.thinking:g.thinkingParts.push(b.thinking);const w=g.blocks.at(-1);if(w&&w.kind==="thinking"){w.thinking+=(y==="thinking"?"":` -`)+b.thinking;const C=[w.startedAt,b.startedAt].filter(I=>I!==void 0).sort()[0],T=w.startedAt!==void 0&&w.durationMs===void 0||b.startedAt!==void 0&&b.durationMs===void 0,N=[w,b].flatMap(I=>I.startedAt!==void 0&&I.durationMs!==void 0?[Date.parse(I.startedAt)+I.durationMs]:[]);w.startedAt=C,w.durationMs=!T&&C!==void 0&&N.length>0?Math.max(...N)-Date.parse(C):void 0}else g.blocks.push({kind:"thinking",thinking:b.thinking,startedAt:b.startedAt,durationMs:b.durationMs});y="thinking"}}else if(b.type==="toolUse"){y=null;const w=c.get(b.toolCallId),C=b.toolName==="ExitPlanMode"?s[b.toolCallId]:void 0,T={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),agentId:Mr(b.toolName)==="task"?b.agentRefs?.find(N=>N.role!=="member")?.agentId??b.agentRefs?.[0]?.agentId:void 0,status:"running",output:b.outputLines,plan:C,planPath:b.toolName==="ExitPlanMode"?C?.path??o[b.toolCallId]?.path:void 0};g.tools.push(T),g.blocks.push({kind:"tool",tool:T}),w&&(g.approval=VW(w),g.approvalId=w.approvalId)}else if(b.type==="toolResult"){y=null;const w=g.tools.findIndex(C=>C.id===b.toolCallId);if(w!==-1){const C=g.tools[w],T=tx(b.output),N={...C,status:b.isError?"error":"ok",output:T,media:b.isError?void 0:kCe(C.name,b.output),agentId:C.agentId??bCe(C.name,T)};N.name==="ExitPlanMode"&&!N.planPath&&(N.planPath=ECe(N.output)),g.tools[w]=N;const I=g.blocks.find(S=>S.kind==="tool"&&S.tool.id===b.toolCallId);I&&I.kind==="tool"&&(I.tool=N)}}else y=null}function m(g,v){if(g.type==="image"||g.type==="video"){const y=g.type,b=g.source;if(b.kind==="url")return{url:b.url,kind:y};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:y};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:y,fileId:b.fileId};if(b.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(v,b.fileId)??"",kind:y,fileId:b.fileId,sessionId:v}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(ICe(g)){f();const C=g.metadata?.[jW],T={id:g.id,role:"compaction",no:a,text:g.content.filter(N=>N.type==="text").map(N=>N.text).join(` -`),compaction:{trigger:C?.trigger,tokensBefore:C?.tokensBefore,tokensAfter:C?.tokensAfter}};l.push(T),u?.(T,[g]);continue}if(g.role==="user"){const C=ACe(g),T=g.metadata?.origin?.kind,N=T==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(C===void 0&&(T==="injection"||N))continue;if(C===void 0&&(T==="task"||T==="background_task"||T==="task_notification")){const Q=g.content.filter(ge=>ge.type==="text").map(ge=>ge.text).join(` -`),te=Gwe(g.metadata),X=te!==void 0?[te]:Zwe(Q);if(X.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ge of X)d.blocks.push({kind:"notification",notification:{...ge,createdAt:g.createdAt}})}continue}if(f(),C!==void 0){const Q=_Ce(g,a++,C);l.push(Q),u?.(Q,[g]);continue}if(T==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!MCe(g))continue;const I=g.metadata?.origin,S=I?.kind==="skill_activation"&&I?.trigger==="user-slash",_=I?.kind==="plugin_command"&&I?.trigger==="user-slash",x=[],E=[];for(const Q of g.content){if(Q.type==="text")if(S){const X=sD(Q.text);if(X&&(X.kind==="video"||X.kind==="image")&&n){const ue=VC(X.path);if(ue){E.push({url:n(ue),kind:X.kind,fileId:ue});continue}}const ge=rD(Q.text);ge&&E.push({kind:"file",url:ge.fileId&&n?n(ge.fileId):"",fileId:ge.fileId,name:ge.name,mediaType:ge.mediaType,size:ge.size})}else if(_)x.push(I.commandArgs??"");else{const X=sD(Q.text);if(X&&(X.kind==="video"||X.kind==="image")&&n){const se=VC(X.path);if(se){E.push({url:n(se),kind:X.kind,fileId:se});continue}}const ge=rD(Q.text);if(ge){E.push({kind:"file",url:ge.fileId&&n?n(ge.fileId):"",fileId:ge.fileId,name:ge.name,mediaType:ge.mediaType,size:ge.size});continue}const ue=lCe(Q.text);if(ue!==Q.text&&ue.trim().length===0)continue;x.push(ue)}const te=m(Q,g.sessionId);if(te){E.push({url:te.url,kind:te.kind,name:Q.type==="file"?Q.name:void 0,fileId:te.fileId,sessionId:te.sessionId});continue}Q.type==="file"&&n&&E.push({kind:"file",url:n(Q.fileId),fileId:Q.fileId,name:Q.name,mediaType:Q.mediaType||void 0,size:Q.size})}const M=S?I?.skillArgs??"":x.join(` -`),R=pCe(M),q=mCe(M),z=E.filter(Q=>Q.kind==="file"),O=E.filter(Q=>Q.kind==="image"||Q.kind==="video"),B=[...R].some(Q=>Q<=z.length),P=[...q].some(Q=>Q<=O.length),H=B||P?E:[];let j=0,Z=0;const ie=E.filter(Q=>Q.kind==="file"?(j+=1,!(B&&R.has(j))):Q.kind==="image"||Q.kind==="video"?(Z+=1,!(P&&q.has(Z))):!0),W={id:g.id,role:"user",no:a++,text:M,attachments:ie.length>0?ie:void 0,inlineAttachments:H.length>0?H:void 0,skillActivation:S?{name:I.skillName,args:I.skillArgs}:void 0,pluginCommand:_?{pluginId:I.pluginId,commandName:I.commandName,args:I.commandArgs}:void 0,createdAt:g.createdAt};l.push(W),u?.(W,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const v=g.promptId;TCe(d,v)?d!==null&&d.promptId===void 0&&v!==void 0&&(d.promptId=v):(f(),d={id:g.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const b=d;if(b===null)continue;const w=LCe(g.content);b.promptId!==void 0&&b.seenSigs.has(w)||(b.seenSigs.add(w),b.sources.push(g),g.durationMs!==void 0&&(b.durationMs=g.durationMs),h(b,g.content),g.endedAt!==void 0?b.endedAt=g.endedAt:g.id!==b.id&&(b.endedAt=g.createdAt))}return f(!0),l}function ZW(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function NCe(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||ZW(a,c,u)||(d.settledAt=i)}}}function DCe(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function FCe(e,t,n,i){const o=e.items.filter(d=>d.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(d=>[d.taskId,d])),a=new Map(e.prompts.map(d=>[d.promptId,d])),u=e.items.flatMap(d=>d.kind==="turn"?nx(d,e.attachments,l,d.turnId===s?n?.createdAt:void 0,d.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a}):[]),c=e.meta.activity==="turn";return Qk(u,[],t,c,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(RCe)}function nx(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(v=>[v.attachmentId,v])),u=KC([e.startedAt,...e.steps.map(v=>v.startedAt),i])??"",c=lD(e.endedAt)??lD(o),d=e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h){const v=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const y of e.attachmentIds??[]){const b=aD(a.get(y));b!==void 0&&v.push(b)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:v,createdAt:u,promptId:d,metadata:r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(y.text.length===0&&!b)continue;if(y.role==="user"){if(y.taskId!==void 0){const T=BCe(y.taskId,y.text,n.get(y.taskId));l.push({id:y.frameId,sessionId:"",role:"user",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:y.taskId},[HW]:T}});continue}const w=y.text.length>0?[{type:"text",text:y.text}]:[];for(const T of y.attachmentIds??[]){const N=aD(a.get(T));N!==void 0&&w.push(N)}const C=y.promptIds?.map(T=>r?.promptById?.get(T)).find(T=>T!==void 0);l.push({id:y.frameId,sessionId:s,role:"user",content:w,createdAt:C?.createdAt??v.startedAt??u,promptId:d});continue}l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d})}else if(y.kind==="thinking"){if(y.text.length===0)continue;const b=r?.pendingInteractionAtByStepId?.get(v.stepId),w=ZW(v,y,b!==void 0),C=r?.thinkingTiming,T=C?.get(y.frameId);let N,I;if(T!==void 0)T.settledAt===void 0&&!w&&(T.settledAt=new Date().toISOString()),N=T.startedAt,I=P8(T.startedAt,T.settledAt);else if(C!==void 0&&w){const S=new Date().toISOString();C.set(y.frameId,{startedAt:S}),N=S}else N=v.startedAt,I=P8(v.startedAt,KC([v.endedAt,b]));l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"thinking",thinking:y.text,startedAt:N,durationMs:I}],createdAt:v.startedAt??u,promptId:d})}else y.kind==="tool"&&(l.push({id:`${y.frameId}:call`,sessionId:"",role:"assistant",content:[{type:"toolUse",toolCallId:y.toolCallId,toolName:y.name,input:y.input??y.display??{},outputLines:y.state==="running"?tx(y.output):void 0,agentRefs:y.agentRefs}],createdAt:v.startedAt??u,promptId:d}),y.state!=="running"&&l.push({id:`${y.frameId}:result`,sessionId:"",role:"tool",content:[{type:"toolResult",toolCallId:y.toolCallId,output:y.output??y.error??"",isError:y.state==="error"}],createdAt:v.endedAt??v.startedAt??u,promptId:d}));const m=e.durationMs??P8(u||void 0,c),g=l.findLastIndex(v=>v.role==="assistant");return g>=0&&(m!==void 0||c!==void 0)&&(l[g]={...l[g],durationMs:m,endedAt:c??l[g].endedAt}),l}function BCe(e,t,n){const[i="",...o]=t.split(` +`)+b.thinking;const C=[w.startedAt,b.startedAt].filter(I=>I!==void 0).sort()[0],T=w.startedAt!==void 0&&w.durationMs===void 0||b.startedAt!==void 0&&b.durationMs===void 0,N=[w,b].flatMap(I=>I.startedAt!==void 0&&I.durationMs!==void 0?[Date.parse(I.startedAt)+I.durationMs]:[]);w.startedAt=C,w.durationMs=!T&&C!==void 0&&N.length>0?Math.max(...N)-Date.parse(C):void 0}else g.blocks.push({kind:"thinking",thinking:b.thinking,startedAt:b.startedAt,durationMs:b.durationMs});y="thinking"}}else if(b.type==="toolUse"){y=null;const w=c.get(b.toolCallId),C=b.toolName==="ExitPlanMode"?s[b.toolCallId]:void 0,T={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),agentId:_r(b.toolName)==="task"?b.agentRefs?.find(N=>N.role!=="member")?.agentId??b.agentRefs?.[0]?.agentId:void 0,status:"running",output:b.outputLines,plan:C,planPath:b.toolName==="ExitPlanMode"?C?.path??o[b.toolCallId]?.path:void 0};g.tools.push(T),g.blocks.push({kind:"tool",tool:T}),w&&(g.approval=VW(w),g.approvalId=w.approvalId)}else if(b.type==="toolResult"){y=null;const w=g.tools.findIndex(C=>C.id===b.toolCallId);if(w!==-1){const C=g.tools[w],T=ex(b.output),N={...C,status:b.isError?"error":"ok",output:T,media:b.isError?void 0:yCe(C.name,b.output),agentId:C.agentId??kCe(C.name,T)};N.name==="ExitPlanMode"&&!N.planPath&&(N.planPath=TCe(N.output)),g.tools[w]=N;const I=g.blocks.find(S=>S.kind==="tool"&&S.tool.id===b.toolCallId);I&&I.kind==="tool"&&(I.tool=N)}}else y=null}function m(g,v){if(g.type==="image"||g.type==="video"){const y=g.type,b=g.source;if(b.kind==="url")return{url:b.url,kind:y};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:y};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:y,fileId:b.fileId};if(b.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(v,b.fileId)??"",kind:y,fileId:b.fileId,sessionId:v}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(MCe(g)){f();const C=g.metadata?.[jW],T={id:g.id,role:"compaction",no:a,text:g.content.filter(N=>N.type==="text").map(N=>N.text).join(` +`),compaction:{trigger:C?.trigger,tokensBefore:C?.tokensBefore,tokensAfter:C?.tokensAfter}};l.push(T),u?.(T,[g]);continue}if(g.role==="user"){const C=CCe(g),T=g.metadata?.origin?.kind,N=T==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(C===void 0&&(T==="injection"||N))continue;if(C===void 0&&(T==="task"||T==="background_task"||T==="task_notification")){const Q=g.content.filter(ve=>ve.type==="text").map(ve=>ve.text).join(` +`),te=Zwe(g.metadata),X=te!==void 0?[te]:Kwe(Q);if(X.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ve of X)d.blocks.push({kind:"notification",notification:{...ve,createdAt:g.createdAt}})}continue}if(f(),C!==void 0){const Q=SCe(g,a++,C);l.push(Q),u?.(Q,[g]);continue}if(T==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!_Ce(g))continue;const I=g.metadata?.origin,S=I?.kind==="skill_activation"&&I?.trigger==="user-slash",_=I?.kind==="plugin_command"&&I?.trigger==="user-slash",x=[],E=[];for(const Q of g.content){if(Q.type==="text")if(S){const X=rD(Q.text);if(X&&(X.kind==="video"||X.kind==="image")&&n){const ce=UC(X.path);if(ce){E.push({url:n(ce),kind:X.kind,fileId:ce});continue}}const ve=lD(Q.text);ve&&E.push({kind:"file",url:ve.fileId&&n?n(ve.fileId):"",fileId:ve.fileId,name:ve.name,mediaType:ve.mediaType,size:ve.size})}else if(_)x.push(I.commandArgs??"");else{const X=rD(Q.text);if(X&&(X.kind==="video"||X.kind==="image")&&n){const se=UC(X.path);if(se){E.push({url:n(se),kind:X.kind,fileId:se});continue}}const ve=lD(Q.text);if(ve){E.push({kind:"file",url:ve.fileId&&n?n(ve.fileId):"",fileId:ve.fileId,name:ve.name,mediaType:ve.mediaType,size:ve.size});continue}const ce=rCe(Q.text);if(ce!==Q.text&&ce.trim().length===0)continue;x.push(ce)}const te=m(Q,g.sessionId);if(te){E.push({url:te.url,kind:te.kind,name:Q.type==="file"?Q.name:void 0,fileId:te.fileId,sessionId:te.sessionId});continue}Q.type==="file"&&n&&E.push({kind:"file",url:n(Q.fileId),fileId:Q.fileId,name:Q.name,mediaType:Q.mediaType||void 0,size:Q.size})}const M=S?I?.skillArgs??"":x.join(` +`),R=hCe(M),q=pCe(M),z=E.filter(Q=>Q.kind==="file"),$=E.filter(Q=>Q.kind==="image"||Q.kind==="video"),B=[...R].some(Q=>Q<=z.length),P=[...q].some(Q=>Q<=$.length),H=B||P?E:[];let j=0,G=0;const ne=E.filter(Q=>Q.kind==="file"?(j+=1,!(B&&R.has(j))):Q.kind==="image"||Q.kind==="video"?(G+=1,!(P&&q.has(G))):!0),W={id:g.id,role:"user",no:a++,text:M,attachments:ne.length>0?ne:void 0,inlineAttachments:H.length>0?H:void 0,skillActivation:S?{name:I.skillName,args:I.skillArgs}:void 0,pluginCommand:_?{pluginId:I.pluginId,commandName:I.commandName,args:I.commandArgs}:void 0,createdAt:g.createdAt};l.push(W),u?.(W,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const v=g.promptId;ICe(d,v)?d!==null&&d.promptId===void 0&&v!==void 0&&(d.promptId=v):(f(),d={id:g.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const b=d;if(b===null)continue;const w=ECe(g.content);b.promptId!==void 0&&b.seenSigs.has(w)||(b.seenSigs.add(w),b.sources.push(g),g.durationMs!==void 0&&(b.durationMs=g.durationMs),h(b,g.content),g.endedAt!==void 0?b.endedAt=g.endedAt:g.id!==b.id&&(b.endedAt=g.createdAt))}return f(!0),l}function ZW(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function LCe(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||ZW(a,c,u)||(d.settledAt=i)}}}function NCe(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function DCe(e,t,n,i){const o=e.items.filter(d=>d.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(d=>[d.taskId,d])),a=new Map(e.prompts.map(d=>[d.promptId,d])),u=e.items.flatMap(d=>d.kind==="turn"?tx(d,e.attachments,l,d.turnId===s?n?.createdAt:void 0,d.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a}):[]),c=e.meta.activity==="turn";return Gk(u,[],t,c,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(BCe)}function tx(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(v=>[v.attachmentId,v])),u=VC([e.startedAt,...e.steps.map(v=>v.startedAt),i])??"",c=aD(e.endedAt)??aD(o),d=e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h){const v=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const y of e.attachmentIds??[]){const b=uD(a.get(y));b!==void 0&&v.push(b)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:v,createdAt:u,promptId:d,metadata:r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(y.text.length===0&&!b)continue;if(y.role==="user"){if(y.taskId!==void 0){const T=FCe(y.taskId,y.text,n.get(y.taskId));l.push({id:y.frameId,sessionId:"",role:"user",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:y.taskId},[HW]:T}});continue}const w=y.text.length>0?[{type:"text",text:y.text}]:[];for(const T of y.attachmentIds??[]){const N=uD(a.get(T));N!==void 0&&w.push(N)}const C=y.promptIds?.map(T=>r?.promptById?.get(T)).find(T=>T!==void 0);l.push({id:y.frameId,sessionId:s,role:"user",content:w,createdAt:C?.createdAt??v.startedAt??u,promptId:d});continue}l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d})}else if(y.kind==="thinking"){if(y.text.length===0)continue;const b=r?.pendingInteractionAtByStepId?.get(v.stepId),w=ZW(v,y,b!==void 0),C=r?.thinkingTiming,T=C?.get(y.frameId);let N,I;if(T!==void 0)T.settledAt===void 0&&!w&&(T.settledAt=new Date().toISOString()),N=T.startedAt,I=$8(T.startedAt,T.settledAt);else if(C!==void 0&&w){const S=new Date().toISOString();C.set(y.frameId,{startedAt:S}),N=S}else N=v.startedAt,I=$8(v.startedAt,VC([v.endedAt,b]));l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"thinking",thinking:y.text,startedAt:N,durationMs:I}],createdAt:v.startedAt??u,promptId:d})}else y.kind==="tool"&&(l.push({id:`${y.frameId}:call`,sessionId:"",role:"assistant",content:[{type:"toolUse",toolCallId:y.toolCallId,toolName:y.name,input:y.input??y.display??{},outputLines:y.state==="running"?ex(y.output):void 0,agentRefs:y.agentRefs}],createdAt:v.startedAt??u,promptId:d}),y.state!=="running"&&l.push({id:`${y.frameId}:result`,sessionId:"",role:"tool",content:[{type:"toolResult",toolCallId:y.toolCallId,output:y.output??y.error??"",isError:y.state==="error"}],createdAt:v.endedAt??v.startedAt??u,promptId:d}));const m=e.durationMs??$8(u||void 0,c),g=l.findLastIndex(v=>v.role==="assistant");return g>=0&&(m!==void 0||c!==void 0)&&(l[g]={...l[g],durationMs:m,endedAt:c??l[g].endedAt}),l}function FCe(e,t,n){const[i="",...o]=t.split(` `),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` -`).trim(),raw:t}}function RCe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function KC(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const uD=6e3,ZC=256*1024,$Ce=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function cD(e,t){return t===0?e:e-1}function OCe(e,t){const n=Bu(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=$Ce.exec(s.text);if(!r)return null;const l=cD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=cD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oZC||Bu(n).length>uD)return null;const i=OCe(e,n);return i===null||i.length>ZC||Bu(i).length>uD?null:{before:i,after:n}}const zCe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function jCe(e){return zCe.has(e.type)}const HCe=50,WCe=100,GC=32*1024,qCe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,HCe)},cancelTask(e){clearTimeout(e)}};function UCe(e,t,n={}){const i=n.scheduler??qCe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??WCe)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const y=++u,b=()=>{y===u&&m()};l=i.requestFrame(b),a=i.requestTask(b)};m=()=>{f();let y=0;for(;!c&&y{if(!c){if(t(y)){const b=s.length>r?s.at(-1):void 0,w=b===void 0?void 0:n.coalesce?.(b,y);w===void 0?s.push(y):s[s.length-1]=w,g();return}if(d()===0){e(y);return}s.push(y),m()}});return v.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let b=r;for(let w=r;w{c||(c=!0,f(),s.length=0,r=0)},v}function QC(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function VCe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=QC(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=GC)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function KCe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=QC(e.appEvent),s=QC(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>GC)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function ZCe(e,t){const i=e.items.filter(d=>d.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(d=>[d.taskId,d])),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=d=>d.kind==="turn"?d.origin.payload??d.origin:void 0,l=new Set,a=e.items.flatMap((d,f)=>{if(d.kind==="turn"){const h=d.startedAt!==void 0||d.steps.some(m=>m.startedAt!==void 0);return GCe(d,e.attachments,o,d.turnId===i&&!h&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s)}if(d.kind==="marker"&&d.marker==="compaction"){const h=QCe(d.payload,d.at,t.sessionId,d.markerId,JCe(e.items,f));return h===void 0?[]:[h]}if(d.kind==="marker"&&d.marker==="cron.fired"){const h=d.payload,m=h?.origin?.jobId,g=typeof h?.prompt=="string"?h.prompt:void 0,v=e.items.slice(f+1).find(b=>{if(b.kind!=="turn"||l.has(b.turnId))return!1;const w=r(b);return w?.kind==="cron_job"&&(m===void 0||w.jobId===m)&&(g===void 0||b.kind==="turn"&&KW(b.prompt??"")===g)});if(v!==void 0&&v.kind==="turn")return l.add(v.turnId),[];const y=YCe(d.payload,d.at,t.sessionId,d.markerId);return y===void 0?[]:[y]}return[]}),u=e.interactions.map(d=>Ep(d,t.sessionId)).filter(d=>d!==void 0),c=e.meta.activity==="turn";return Qk(a,u,t.getFileUrl,c,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(tAe)}function GCe(e,t,n,i,o,s,r,l,a){const u=e.origin.payload??e.origin,c=u?.kind;return[...e.prompt===void 0&&c==="system_trigger"?[{id:`${e.turnId}:origin`,sessionId:s,role:"user",content:[],createdAt:KC([e.startedAt,...e.steps.map(f=>f.startedAt),i])??"",promptId:e.turnId,metadata:{origin:u}}]:[],...nx(e,t,n,i,o,s,{includeOrigin:!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a})]}function QCe(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[jW]:l}}}function YCe(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function JCe(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function Ep(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function Um(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(XCe),createdAt:""}}function XCe(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(eAe),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function eAe(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function tAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function nAe(){let e=[];const t=(n,i)=>{const s=ZCe(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function iAe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function oAe(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` -`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&iAe(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function dD(e){return e?e.split(` -`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function sAe(e){return e.suspendedReason||dD(e.text)||dD(e.outputLines?.join(` -`))||e.summary||""}function rAe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` -`):e.summary??""}function lAe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function fD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` -`)[0]??"",phase:lAe(e.outcome),body:e.body}}function aAe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function uAe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:sAe(o),phase:o.phase,body:rAe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>aAe(s,o))).map((o,s)=>fD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>fD(o,s))}const cAe=["queued","working","suspended","completed","failed","cancelled"];function GW(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function dAe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function fAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:GW(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=dAe();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function hAe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of cAe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function pAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:GW(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function ix(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function QW(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const pg=100*1024;function YW(e){const t=Mr(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=ix(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>pg||a.length>pg?null:y4(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>pg||c.length>pg)return null;const d=y4(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=Bu(u).length,r+=Bu(c).length}return o}const mAe=5e3;function gAe(e){if(Mr(e.name)!=="write")return null;const t=ix(e.arg);return!t||typeof t.content!="string"||t.content.length>pg||t.content.split(` -`).length>mAe?null:{content:t.content,path:QW(t)}}function hD(e){const t=ix(e.arg);return t?QW(t):void 0}function vAe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function yAe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function kAe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function bAe(e){return JW(e).parents}function JW(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function wAe(e,t,n){const i=JW(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=vAe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:kAe(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?yAe(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function CAe(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(S,_)=>l.set(S,_);let v=n!==null;if(v){const S=n,_=Object.keys(h);v=_.length===Object.keys(S).length&&_.every(x=>h[x]===S[x])}let y=i!==null;if(y){const S=i,_=Object.keys(m);y=_.length===Object.keys(S).length&&_.every(x=>m[x]===S[x])}const b=e.length>0&&d===t&&v&&y&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let w=0,C=0,T=1;if(b){let S=-1;for(let _=e.length-1;_>=0;_--)if(e[_].role==="assistant"){S=_;break}for(let _=0;_0?[...e.slice(0,w),...N]:N;return e=I,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,I};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function AAe(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&(n++,t.set(o.id,n))}return t}const XW=["light","dark","system"],xAe=["small","medium","large","xlarge"],z8="medium",eq="kimi-web.color-scheme",YC="kimi-web.font-scale",pD="kimi-web.ui-font-size";function JC(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ox(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function SAe(e){try{globalThis.localStorage.removeItem(e)}catch{}}function _Ae(){const e=JC(eq);return e&&XW.includes(e)?e:"system"}const ny={light:"#ffffff",dark:"#121212"};function MAe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?ny.dark:e==="light"?ny.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?ny.dark:ny.light;i.setAttribute("content",n??s)})}function tq(e){return xAe.includes(e)}function IAe(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function TAe(){const e=JC(YC);if(e==="xxlarge")return"xlarge";if(e!==null)return tq(e)?e:z8;const t=JC(pD);if(t===null)return z8;const n=Number(t),i=Number.isFinite(n)?IAe(n):z8;return ox(YC,i),SAe(pD),i}function EAe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const sx=V(_Ae()),rx=V(TAe());let mD=!1;function LAe(){mD||(mD=!0,We(sx,MAe,{immediate:!0}),We(rx,EAe,{immediate:!0}))}function NAe(e){XW.includes(e)&&(sx.value=e,ox(eq,e))}function DAe(e){tq(e)&&(rx.value=e,ox(YC,e))}function X1(){return LAe(),{colorScheme:sx,fontScale:rx,setColorScheme:NAe,setFontScale:DAe}}const iy=V(!1);let gD=!1;function j8(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Yk(){return!gD&&typeof window<"u"&&typeof document<"u"&&(gD=!0,iy.value=j8(),new MutationObserver(()=>{iy.value=j8()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{iy.value=j8()})),iy}const nq="kimi-web.sidebar-multi-tab";function FAe(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function BAe(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function RAe(){return FAe(nq)==="1"}const iq=V(RAe());function $Ae(e){iq.value=e,BAe(nq,e?"1":"0")}function em(){return{sidebarTabs:iq,setSidebarTabs:$Ae}}const vD=document.createElement("i");function OAe(e){const t="&"+e+";";vD.innerHTML=t;const n=vD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ru(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(Ru(e,e.length,0,t),e):t}const yD={}.hasOwnProperty;function PAe(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function ho(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Bi(a)?(e.enter(n),l(a)):t(a)}function l(a){return Bi(a)&&s++r))return;const I=t.events.length;let S=I,_,x;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(_){x=t.events[S][1].end;break}_=!0}for(y(i),N=I;Nw;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=w}function b(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function YAe(e,t,n){return ho(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bD(e){if(e===null||ml(e)||VAe(e))return 1;if(UAe(e))return 2}function ax(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};wD(d,-a),wD(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=la(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=la(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=la(u,ax(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=la(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=la(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Ru(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Bi(N)?ho(e,b,"linePrefix",s+1)(N):b(N)}function b(N){return N===null||Pn(N)?e.check(CD,g,C)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||Pn(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),w)}function C(N){return e.exit("codeFenced"),t(N)}function T(N,I,S){let _=0;return x;function x(z){return N.enter("lineEnding"),N.consume(z),N.exit("lineEnding"),E}function E(z){return N.enter("codeFencedFence"),Bi(z)?ho(N,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):M(z)}function M(z){return z===l?(N.enter("codeFencedFenceSequence"),R(z)):S(z)}function R(z){return z===l?(_++,N.consume(z),R):_>=r?(N.exit("codeFencedFenceSequence"),Bi(z)?ho(N,q,"whitespace")(z):q(z)):S(z)}function q(z){return z===null||Pn(z)?(N.exit("codeFencedFence"),I(z)):S(z)}}}function u6e(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const H8={name:"codeIndented",tokenize:d6e},c6e={partial:!0,tokenize:f6e};function d6e(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),ho(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Pn(u)?e.attempt(c6e,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Pn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function f6e(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):ho(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Pn(r)?o(r):n(r)}}const h6e={name:"codeText",previous:m6e,resolve:p6e,tokenize:g6e};function p6e(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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 tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Vm(this.left,i),s.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),Vm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vm(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=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function aq(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||XC(y)?n(y):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||Pn(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function g(y){return!c&&(y===null||y===41||ml(y))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(y)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Pn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Pn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Bi(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function cq(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):Pn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ho(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Pn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function t0(e,t){let n;return i;function i(o){return Pn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Bi(o)?ho(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const x6e={name:"definition",tokenize:_6e},S6e={partial:!0,tokenize:M6e};function _6e(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return uq.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=lx(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return ml(h)?t0(e,u)(h):u(h)}function u(h){return aq(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(S6e,d,d)(h)}function d(h){return Bi(h)?ho(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Pn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function M6e(e,t,n){return i;function i(l){return ml(l)?t0(e,o)(l):n(l)}function o(l){return cq(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Bi(l)?ho(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Pn(l)?t(l):n(l)}}const I6e={name:"hardBreakEscape",tokenize:T6e};function T6e(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Pn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const E6e={name:"headingAtx",resolve:L6e,tokenize:N6e};function L6e(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Ru(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function N6e(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||ml(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Pn(c)?(e.exit("atxHeading"),t(c)):Bi(c)?ho(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||ml(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const D6e=["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"],xD=["pre","script","style","textarea"],F6e={concrete:!0,name:"htmlFlow",resolveTo:$6e,tokenize:O6e},B6e={partial:!0,tokenize:z6e},R6e={partial:!0,tokenize:P6e};function $6e(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 O6e(e,t,n){const i=this;let o,s,r,l,a;return u;function u(W){return c(W)}function c(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),d}function d(W){return W===33?(e.consume(W),f):W===47?(e.consume(W),s=!0,g):W===63?(e.consume(W),o=3,i.interrupt?t:j):bu(W)?(e.consume(W),r=String.fromCharCode(W),v):n(W)}function f(W){return W===45?(e.consume(W),o=2,h):W===91?(e.consume(W),o=5,l=0,m):bu(W)?(e.consume(W),o=4,i.interrupt?t:j):n(W)}function h(W){return W===45?(e.consume(W),i.interrupt?t:j):n(W)}function m(W){const Q="CDATA[";return W===Q.charCodeAt(l++)?(e.consume(W),l===Q.length?i.interrupt?t:M:m):n(W)}function g(W){return bu(W)?(e.consume(W),r=String.fromCharCode(W),v):n(W)}function v(W){if(W===null||W===47||W===62||ml(W)){const Q=W===47,te=r.toLowerCase();return!Q&&!s&&xD.includes(te)?(o=1,i.interrupt?t(W):M(W)):D6e.includes(r.toLowerCase())?(o=6,Q?(e.consume(W),y):i.interrupt?t(W):M(W)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(W):s?b(W):w(W))}return W===45||Oa(W)?(e.consume(W),r+=String.fromCharCode(W),v):n(W)}function y(W){return W===62?(e.consume(W),i.interrupt?t:M):n(W)}function b(W){return Bi(W)?(e.consume(W),b):x(W)}function w(W){return W===47?(e.consume(W),x):W===58||W===95||bu(W)?(e.consume(W),C):Bi(W)?(e.consume(W),w):x(W)}function C(W){return W===45||W===46||W===58||W===95||Oa(W)?(e.consume(W),C):T(W)}function T(W){return W===61?(e.consume(W),N):Bi(W)?(e.consume(W),T):w(W)}function N(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),a=W,I):Bi(W)?(e.consume(W),N):S(W)}function I(W){return W===a?(e.consume(W),a=null,_):W===null||Pn(W)?n(W):(e.consume(W),I)}function S(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||ml(W)?T(W):(e.consume(W),S)}function _(W){return W===47||W===62||Bi(W)?w(W):n(W)}function x(W){return W===62?(e.consume(W),E):n(W)}function E(W){return W===null||Pn(W)?M(W):Bi(W)?(e.consume(W),E):n(W)}function M(W){return W===45&&o===2?(e.consume(W),O):W===60&&o===1?(e.consume(W),B):W===62&&o===4?(e.consume(W),Z):W===63&&o===3?(e.consume(W),j):W===93&&o===5?(e.consume(W),H):Pn(W)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(B6e,ie,R)(W)):W===null||Pn(W)?(e.exit("htmlFlowData"),R(W)):(e.consume(W),M)}function R(W){return e.check(R6e,q,ie)(W)}function q(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),z}function z(W){return W===null||Pn(W)?R(W):(e.enter("htmlFlowData"),M(W))}function O(W){return W===45?(e.consume(W),j):M(W)}function B(W){return W===47?(e.consume(W),r="",P):M(W)}function P(W){if(W===62){const Q=r.toLowerCase();return xD.includes(Q)?(e.consume(W),Z):M(W)}return bu(W)&&r.length<8?(e.consume(W),r+=String.fromCharCode(W),P):M(W)}function H(W){return W===93?(e.consume(W),j):M(W)}function j(W){return W===62?(e.consume(W),Z):W===45&&o===2?(e.consume(W),j):M(W)}function Z(W){return W===null||Pn(W)?(e.exit("htmlFlowData"),ie(W)):(e.consume(W),Z)}function ie(W){return e.exit("htmlFlow"),t(W)}}function P6e(e,t,n){const i=this;return o;function o(r){return Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function z6e(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Jk,t,n)}}const j6e={name:"htmlText",tokenize:H6e};function H6e(e,t,n){const i=this;let o,s,r;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),a}function a(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),T):j===63?(e.consume(j),w):bu(j)?(e.consume(j),S):n(j)}function u(j){return j===45?(e.consume(j),c):j===91?(e.consume(j),s=0,m):bu(j)?(e.consume(j),b):n(j)}function c(j){return j===45?(e.consume(j),h):n(j)}function d(j){return j===null?n(j):j===45?(e.consume(j),f):Pn(j)?(r=d,B(j)):(e.consume(j),d)}function f(j){return j===45?(e.consume(j),h):d(j)}function h(j){return j===62?O(j):j===45?f(j):d(j)}function m(j){const Z="CDATA[";return j===Z.charCodeAt(s++)?(e.consume(j),s===Z.length?g:m):n(j)}function g(j){return j===null?n(j):j===93?(e.consume(j),v):Pn(j)?(r=g,B(j)):(e.consume(j),g)}function v(j){return j===93?(e.consume(j),y):g(j)}function y(j){return j===62?O(j):j===93?(e.consume(j),y):g(j)}function b(j){return j===null||j===62?O(j):Pn(j)?(r=b,B(j)):(e.consume(j),b)}function w(j){return j===null?n(j):j===63?(e.consume(j),C):Pn(j)?(r=w,B(j)):(e.consume(j),w)}function C(j){return j===62?O(j):w(j)}function T(j){return bu(j)?(e.consume(j),N):n(j)}function N(j){return j===45||Oa(j)?(e.consume(j),N):I(j)}function I(j){return Pn(j)?(r=I,B(j)):Bi(j)?(e.consume(j),I):O(j)}function S(j){return j===45||Oa(j)?(e.consume(j),S):j===47||j===62||ml(j)?_(j):n(j)}function _(j){return j===47?(e.consume(j),O):j===58||j===95||bu(j)?(e.consume(j),x):Pn(j)?(r=_,B(j)):Bi(j)?(e.consume(j),_):O(j)}function x(j){return j===45||j===46||j===58||j===95||Oa(j)?(e.consume(j),x):E(j)}function E(j){return j===61?(e.consume(j),M):Pn(j)?(r=E,B(j)):Bi(j)?(e.consume(j),E):_(j)}function M(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,R):Pn(j)?(r=M,B(j)):Bi(j)?(e.consume(j),M):(e.consume(j),q)}function R(j){return j===o?(e.consume(j),o=void 0,z):j===null?n(j):Pn(j)?(r=R,B(j)):(e.consume(j),R)}function q(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||ml(j)?_(j):(e.consume(j),q)}function z(j){return j===47||j===62||ml(j)?_(j):n(j)}function O(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function B(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),P}function P(j){return Bi(j)?ho(e,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):H(j)}function H(j){return e.enter("htmlTextData"),r(j)}}const ux={name:"labelEnd",resolveAll:V6e,resolveTo:K6e,tokenize:Z6e},W6e={tokenize:G6e},q6e={tokenize:Q6e},U6e={tokenize:Y6e};function V6e(e){let t=-1;const n=[];for(;++t=3&&(u===null||Pn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Bi(u)?ho(e,l,"whitespace")(u):l(u))}}const tl={continuation:{tokenize:l7e},exit:u7e,name:"list",tokenize:r7e},o7e={partial:!0,tokenize:c7e},s7e={partial:!0,tokenize:a7e};function r7e(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:eA(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Gy,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return eA(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(Jk,i.interrupt?n:c,e.attempt(o7e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Bi(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function l7e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Jk,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ho(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Bi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(s7e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,ho(e,e.attempt(tl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function a7e(e,t,n){const i=this;return ho(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function u7e(e){e.exit(this.containerState.type)}function c7e(e,t,n){const i=this;return ho(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Bi(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const SD={name:"setextUnderline",resolveTo:d7e,tokenize:f7e};function d7e(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function f7e(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Bi(u)?ho(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Pn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const h7e={tokenize:p7e};function p7e(e){const t=this,n=e.attempt(Jk,i,e.attempt(this.parser.constructs.flowInitial,o,ho(e,e.attempt(this.parser.constructs.flow,o,e.attempt(k6e,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const m7e={resolveAll:fq()},g7e=dq("string"),v7e=dq("text");function dq(e){return{resolveAll:fq(e==="text"?y7e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function L7e(e,t){let n=-1;const i=[];let o;for(;++n=0?n:void 0}const cD=6e3,KC=256*1024,RCe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function dD(e,t){return t===0?e:e-1}function OCe(e,t){const n=Ru(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=RCe.exec(s.text);if(!r)return null;const l=dD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=dD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oKC||Ru(n).length>cD)return null;const i=OCe(e,n);return i===null||i.length>KC||Ru(i).length>cD?null:{before:i,after:n}}const PCe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function zCe(e){return PCe.has(e.type)}const jCe=50,HCe=100,ZC=32*1024,WCe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,jCe)},cancelTask(e){clearTimeout(e)}};function qCe(e,t,n={}){const i=n.scheduler??WCe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??HCe)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const y=++u,b=()=>{y===u&&m()};l=i.requestFrame(b),a=i.requestTask(b)};m=()=>{f();let y=0;for(;!c&&y{if(!c){if(t(y)){const b=s.length>r?s.at(-1):void 0,w=b===void 0?void 0:n.coalesce?.(b,y);w===void 0?s.push(y):s[s.length-1]=w,g();return}if(d()===0){e(y);return}s.push(y),m()}});return v.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let b=r;for(let w=r;w{c||(c=!0,f(),s.length=0,r=0)},v}function GC(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function UCe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=GC(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=ZC)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function VCe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=GC(e.appEvent),s=GC(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>ZC)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function KCe(e,t){const i=e.items.filter(d=>d.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(d=>[d.taskId,d])),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=d=>d.kind==="turn"?d.origin.payload??d.origin:void 0,l=new Set,a=e.items.flatMap((d,f)=>{if(d.kind==="turn"){const h=d.startedAt!==void 0||d.steps.some(m=>m.startedAt!==void 0);return ZCe(d,e.attachments,o,d.turnId===i&&!h&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s)}if(d.kind==="marker"&&d.marker==="compaction"){const h=GCe(d.payload,d.at,t.sessionId,d.markerId,YCe(e.items,f));return h===void 0?[]:[h]}if(d.kind==="marker"&&d.marker==="cron.fired"){const h=d.payload,m=h?.origin?.jobId,g=typeof h?.prompt=="string"?h.prompt:void 0,v=e.items.slice(f+1).find(b=>{if(b.kind!=="turn"||l.has(b.turnId))return!1;const w=r(b);return w?.kind==="cron_job"&&(m===void 0||w.jobId===m)&&(g===void 0||b.kind==="turn"&&KW(b.prompt??"")===g)});if(v!==void 0&&v.kind==="turn")return l.add(v.turnId),[];const y=QCe(d.payload,d.at,t.sessionId,d.markerId);return y===void 0?[]:[y]}return[]}),u=e.interactions.map(d=>Lp(d,t.sessionId)).filter(d=>d!==void 0),c=e.meta.activity==="turn";return Gk(a,u,t.getFileUrl,c,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(eAe)}function ZCe(e,t,n,i,o,s,r,l,a){const u=e.origin.payload??e.origin,c=u?.kind;return[...e.prompt===void 0&&c==="system_trigger"?[{id:`${e.turnId}:origin`,sessionId:s,role:"user",content:[],createdAt:VC([e.startedAt,...e.steps.map(f=>f.startedAt),i])??"",promptId:e.turnId,metadata:{origin:u}}]:[],...tx(e,t,n,i,o,s,{includeOrigin:!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a})]}function GCe(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[jW]:l}}}function QCe(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function YCe(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function Lp(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function qm(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(JCe),createdAt:""}}function JCe(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(XCe),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function XCe(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function eAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function tAe(){let e=[];const t=(n,i)=>{const s=KCe(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function nAe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function iAe(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` +`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&nAe(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function fD(e){return e?e.split(` +`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function oAe(e){return e.suspendedReason||fD(e.text)||fD(e.outputLines?.join(` +`))||e.summary||""}function sAe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` +`):e.summary??""}function rAe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function hD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` +`)[0]??"",phase:rAe(e.outcome),body:e.body}}function lAe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function aAe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:oAe(o),phase:o.phase,body:sAe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>lAe(s,o))).map((o,s)=>hD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>hD(o,s))}const uAe=["queued","working","suspended","completed","failed","cancelled"];function GW(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function cAe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function dAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:GW(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=cAe();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function fAe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of uAe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function hAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:GW(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function nx(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function QW(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const hg=100*1024;function YW(e){const t=_r(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=nx(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>hg||a.length>hg?null:v4(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>hg||c.length>hg)return null;const d=v4(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=Ru(u).length,r+=Ru(c).length}return o}const pAe=5e3;function mAe(e){if(_r(e.name)!=="write")return null;const t=nx(e.arg);return!t||typeof t.content!="string"||t.content.length>hg||t.content.split(` +`).length>pAe?null:{content:t.content,path:QW(t)}}function pD(e){const t=nx(e.arg);return t?QW(t):void 0}function gAe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function vAe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function yAe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function kAe(e){return JW(e).parents}function JW(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function bAe(e,t,n){const i=JW(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=gAe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:yAe(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?vAe(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function wAe(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(S,_)=>l.set(S,_);let v=n!==null;if(v){const S=n,_=Object.keys(h);v=_.length===Object.keys(S).length&&_.every(x=>h[x]===S[x])}let y=i!==null;if(y){const S=i,_=Object.keys(m);y=_.length===Object.keys(S).length&&_.every(x=>m[x]===S[x])}const b=e.length>0&&d===t&&v&&y&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let w=0,C=0,T=1;if(b){let S=-1;for(let _=e.length-1;_>=0;_--)if(e[_].role==="assistant"){S=_;break}for(let _=0;_0?[...e.slice(0,w),...N]:N;return e=I,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,I};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function CAe(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&(n++,t.set(o.id,n))}return t}const XW=["light","dark","system"],AAe=["small","medium","large","xlarge"],P8="medium",eq="kimi-web.color-scheme",QC="kimi-web.font-scale",mD="kimi-web.ui-font-size";function YC(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ix(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function xAe(e){try{globalThis.localStorage.removeItem(e)}catch{}}function SAe(){const e=YC(eq);return e&&XW.includes(e)?e:"system"}const ty={light:"#ffffff",dark:"#121212"};function _Ae(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?ty.dark:e==="light"?ty.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?ty.dark:ty.light;i.setAttribute("content",n??s)})}function tq(e){return AAe.includes(e)}function MAe(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function IAe(){const e=YC(QC);if(e==="xxlarge")return"xlarge";if(e!==null)return tq(e)?e:P8;const t=YC(mD);if(t===null)return P8;const n=Number(t),i=Number.isFinite(n)?MAe(n):P8;return ix(QC,i),xAe(mD),i}function TAe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const ox=V(SAe()),sx=V(IAe());let gD=!1;function EAe(){gD||(gD=!0,We(ox,_Ae,{immediate:!0}),We(sx,TAe,{immediate:!0}))}function LAe(e){XW.includes(e)&&(ox.value=e,ix(eq,e))}function NAe(e){tq(e)&&(sx.value=e,ix(QC,e))}function X1(){return EAe(),{colorScheme:ox,fontScale:sx,setColorScheme:LAe,setFontScale:NAe}}const ny=V(!1);let vD=!1;function z8(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Qk(){return!vD&&typeof window<"u"&&typeof document<"u"&&(vD=!0,ny.value=z8(),new MutationObserver(()=>{ny.value=z8()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ny.value=z8()})),ny}const nq="kimi-web.sidebar-multi-tab";function DAe(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function FAe(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function BAe(){return DAe(nq)==="1"}const iq=V(BAe());function RAe(e){iq.value=e,FAe(nq,e?"1":"0")}function em(){return{sidebarTabs:iq,setSidebarTabs:RAe}}const yD=document.createElement("i");function OAe(e){const t="&"+e+";";yD.innerHTML=t;const n=yD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ou(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(Ou(e,e.length,0,t),e):t}const kD={}.hasOwnProperty;function $Ae(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function lo(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Fi(a)?(e.enter(n),l(a)):t(a)}function l(a){return Fi(a)&&s++r))return;const I=t.events.length;let S=I,_,x;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(_){x=t.events[S][1].end;break}_=!0}for(y(i),N=I;Nw;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=w}function b(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function QAe(e,t,n){return lo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wD(e){if(e===null||gl(e)||UAe(e))return 1;if(qAe(e))return 2}function lx(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};CD(d,-a),CD(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=fa(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=fa(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=fa(u,lx(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=fa(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=fa(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Ou(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Fi(N)?lo(e,b,"linePrefix",s+1)(N):b(N)}function b(N){return N===null||Pn(N)?e.check(AD,g,C)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||Pn(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),w)}function C(N){return e.exit("codeFenced"),t(N)}function T(N,I,S){let _=0;return x;function x(z){return N.enter("lineEnding"),N.consume(z),N.exit("lineEnding"),E}function E(z){return N.enter("codeFencedFence"),Fi(z)?lo(N,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):M(z)}function M(z){return z===l?(N.enter("codeFencedFenceSequence"),R(z)):S(z)}function R(z){return z===l?(_++,N.consume(z),R):_>=r?(N.exit("codeFencedFenceSequence"),Fi(z)?lo(N,q,"whitespace")(z):q(z)):S(z)}function q(z){return z===null||Pn(z)?(N.exit("codeFencedFence"),I(z)):S(z)}}}function a6e(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const j8={name:"codeIndented",tokenize:c6e},u6e={partial:!0,tokenize:d6e};function c6e(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),lo(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Pn(u)?e.attempt(u6e,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Pn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function d6e(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):lo(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Pn(r)?o(r):n(r)}}const f6e={name:"codeText",previous:p6e,resolve:h6e,tokenize:m6e};function h6e(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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 tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Um(this.left,i),s.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),Um(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Um(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=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function aq(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||JC(y)?n(y):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||Pn(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function g(y){return!c&&(y===null||y===41||gl(y))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(y)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Pn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Pn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Fi(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function cq(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):Pn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),lo(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Pn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function Xg(e,t){let n;return i;function i(o){return Pn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Fi(o)?lo(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const A6e={name:"definition",tokenize:S6e},x6e={partial:!0,tokenize:_6e};function S6e(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return uq.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=rx(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return gl(h)?Xg(e,u)(h):u(h)}function u(h){return aq(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(x6e,d,d)(h)}function d(h){return Fi(h)?lo(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Pn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function _6e(e,t,n){return i;function i(l){return gl(l)?Xg(e,o)(l):n(l)}function o(l){return cq(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Fi(l)?lo(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Pn(l)?t(l):n(l)}}const M6e={name:"hardBreakEscape",tokenize:I6e};function I6e(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Pn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const T6e={name:"headingAtx",resolve:E6e,tokenize:L6e};function E6e(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Ou(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function L6e(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||gl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Pn(c)?(e.exit("atxHeading"),t(c)):Fi(c)?lo(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||gl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const N6e=["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"],SD=["pre","script","style","textarea"],D6e={concrete:!0,name:"htmlFlow",resolveTo:R6e,tokenize:O6e},F6e={partial:!0,tokenize:P6e},B6e={partial:!0,tokenize:$6e};function R6e(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 O6e(e,t,n){const i=this;let o,s,r,l,a;return u;function u(W){return c(W)}function c(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),d}function d(W){return W===33?(e.consume(W),f):W===47?(e.consume(W),s=!0,g):W===63?(e.consume(W),o=3,i.interrupt?t:j):wu(W)?(e.consume(W),r=String.fromCharCode(W),v):n(W)}function f(W){return W===45?(e.consume(W),o=2,h):W===91?(e.consume(W),o=5,l=0,m):wu(W)?(e.consume(W),o=4,i.interrupt?t:j):n(W)}function h(W){return W===45?(e.consume(W),i.interrupt?t:j):n(W)}function m(W){const Q="CDATA[";return W===Q.charCodeAt(l++)?(e.consume(W),l===Q.length?i.interrupt?t:M:m):n(W)}function g(W){return wu(W)?(e.consume(W),r=String.fromCharCode(W),v):n(W)}function v(W){if(W===null||W===47||W===62||gl(W)){const Q=W===47,te=r.toLowerCase();return!Q&&!s&&SD.includes(te)?(o=1,i.interrupt?t(W):M(W)):N6e.includes(r.toLowerCase())?(o=6,Q?(e.consume(W),y):i.interrupt?t(W):M(W)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(W):s?b(W):w(W))}return W===45||Ha(W)?(e.consume(W),r+=String.fromCharCode(W),v):n(W)}function y(W){return W===62?(e.consume(W),i.interrupt?t:M):n(W)}function b(W){return Fi(W)?(e.consume(W),b):x(W)}function w(W){return W===47?(e.consume(W),x):W===58||W===95||wu(W)?(e.consume(W),C):Fi(W)?(e.consume(W),w):x(W)}function C(W){return W===45||W===46||W===58||W===95||Ha(W)?(e.consume(W),C):T(W)}function T(W){return W===61?(e.consume(W),N):Fi(W)?(e.consume(W),T):w(W)}function N(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),a=W,I):Fi(W)?(e.consume(W),N):S(W)}function I(W){return W===a?(e.consume(W),a=null,_):W===null||Pn(W)?n(W):(e.consume(W),I)}function S(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||gl(W)?T(W):(e.consume(W),S)}function _(W){return W===47||W===62||Fi(W)?w(W):n(W)}function x(W){return W===62?(e.consume(W),E):n(W)}function E(W){return W===null||Pn(W)?M(W):Fi(W)?(e.consume(W),E):n(W)}function M(W){return W===45&&o===2?(e.consume(W),$):W===60&&o===1?(e.consume(W),B):W===62&&o===4?(e.consume(W),G):W===63&&o===3?(e.consume(W),j):W===93&&o===5?(e.consume(W),H):Pn(W)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(F6e,ne,R)(W)):W===null||Pn(W)?(e.exit("htmlFlowData"),R(W)):(e.consume(W),M)}function R(W){return e.check(B6e,q,ne)(W)}function q(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),z}function z(W){return W===null||Pn(W)?R(W):(e.enter("htmlFlowData"),M(W))}function $(W){return W===45?(e.consume(W),j):M(W)}function B(W){return W===47?(e.consume(W),r="",P):M(W)}function P(W){if(W===62){const Q=r.toLowerCase();return SD.includes(Q)?(e.consume(W),G):M(W)}return wu(W)&&r.length<8?(e.consume(W),r+=String.fromCharCode(W),P):M(W)}function H(W){return W===93?(e.consume(W),j):M(W)}function j(W){return W===62?(e.consume(W),G):W===45&&o===2?(e.consume(W),j):M(W)}function G(W){return W===null||Pn(W)?(e.exit("htmlFlowData"),ne(W)):(e.consume(W),G)}function ne(W){return e.exit("htmlFlow"),t(W)}}function $6e(e,t,n){const i=this;return o;function o(r){return Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function P6e(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Yk,t,n)}}const z6e={name:"htmlText",tokenize:j6e};function j6e(e,t,n){const i=this;let o,s,r;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),a}function a(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),T):j===63?(e.consume(j),w):wu(j)?(e.consume(j),S):n(j)}function u(j){return j===45?(e.consume(j),c):j===91?(e.consume(j),s=0,m):wu(j)?(e.consume(j),b):n(j)}function c(j){return j===45?(e.consume(j),h):n(j)}function d(j){return j===null?n(j):j===45?(e.consume(j),f):Pn(j)?(r=d,B(j)):(e.consume(j),d)}function f(j){return j===45?(e.consume(j),h):d(j)}function h(j){return j===62?$(j):j===45?f(j):d(j)}function m(j){const G="CDATA[";return j===G.charCodeAt(s++)?(e.consume(j),s===G.length?g:m):n(j)}function g(j){return j===null?n(j):j===93?(e.consume(j),v):Pn(j)?(r=g,B(j)):(e.consume(j),g)}function v(j){return j===93?(e.consume(j),y):g(j)}function y(j){return j===62?$(j):j===93?(e.consume(j),y):g(j)}function b(j){return j===null||j===62?$(j):Pn(j)?(r=b,B(j)):(e.consume(j),b)}function w(j){return j===null?n(j):j===63?(e.consume(j),C):Pn(j)?(r=w,B(j)):(e.consume(j),w)}function C(j){return j===62?$(j):w(j)}function T(j){return wu(j)?(e.consume(j),N):n(j)}function N(j){return j===45||Ha(j)?(e.consume(j),N):I(j)}function I(j){return Pn(j)?(r=I,B(j)):Fi(j)?(e.consume(j),I):$(j)}function S(j){return j===45||Ha(j)?(e.consume(j),S):j===47||j===62||gl(j)?_(j):n(j)}function _(j){return j===47?(e.consume(j),$):j===58||j===95||wu(j)?(e.consume(j),x):Pn(j)?(r=_,B(j)):Fi(j)?(e.consume(j),_):$(j)}function x(j){return j===45||j===46||j===58||j===95||Ha(j)?(e.consume(j),x):E(j)}function E(j){return j===61?(e.consume(j),M):Pn(j)?(r=E,B(j)):Fi(j)?(e.consume(j),E):_(j)}function M(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,R):Pn(j)?(r=M,B(j)):Fi(j)?(e.consume(j),M):(e.consume(j),q)}function R(j){return j===o?(e.consume(j),o=void 0,z):j===null?n(j):Pn(j)?(r=R,B(j)):(e.consume(j),R)}function q(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||gl(j)?_(j):(e.consume(j),q)}function z(j){return j===47||j===62||gl(j)?_(j):n(j)}function $(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function B(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),P}function P(j){return Fi(j)?lo(e,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):H(j)}function H(j){return e.enter("htmlTextData"),r(j)}}const ax={name:"labelEnd",resolveAll:U6e,resolveTo:V6e,tokenize:K6e},H6e={tokenize:Z6e},W6e={tokenize:G6e},q6e={tokenize:Q6e};function U6e(e){let t=-1;const n=[];for(;++t=3&&(u===null||Pn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Fi(u)?lo(e,l,"whitespace")(u):l(u))}}const nl={continuation:{tokenize:r7e},exit:a7e,name:"list",tokenize:s7e},i7e={partial:!0,tokenize:u7e},o7e={partial:!0,tokenize:l7e};function s7e(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:XC(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Zy,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return XC(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(Yk,i.interrupt?n:c,e.attempt(i7e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Fi(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function r7e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Yk,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,lo(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Fi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(o7e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,lo(e,e.attempt(nl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function l7e(e,t,n){const i=this;return lo(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function a7e(e){e.exit(this.containerState.type)}function u7e(e,t,n){const i=this;return lo(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Fi(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const _D={name:"setextUnderline",resolveTo:c7e,tokenize:d7e};function c7e(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function d7e(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Fi(u)?lo(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Pn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const f7e={tokenize:h7e};function h7e(e){const t=this,n=e.attempt(Yk,i,e.attempt(this.parser.constructs.flowInitial,o,lo(e,e.attempt(this.parser.constructs.flow,o,e.attempt(y6e,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const p7e={resolveAll:fq()},m7e=dq("string"),g7e=dq("text");function dq(e){return{resolveAll:fq(e==="text"?v7e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function E7e(e,t){let n=-1;const i=[];let o;for(;++n>1}};Js.from=function(e){if(e instanceof Js)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Js(t)};function hq(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function gq(e){return e>=55296&&e<56320}class Xt{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new Xt(i,o)}cutByIndex(t,n){return t==n?Xt.empty:t==0&&n==this.content.length?this:new Xt(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new Xt(o,s)}addToStart(t){return new Xt([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Xt(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?oy(n+1,s):oy(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Xt.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return Xt.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Xt.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}Pi.none=[];class P0 extends Error{}class hn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=yq(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new hn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new hn(vq(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return hn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new hn(Xt.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new hn(t,i,o)}}hn.empty=new hn(Xt.empty,0,0);function vq(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(vq(s.content,t-o-1,n-o-1)))}function yq(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=yq(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function B7e(e,t,n){if(n.openStart>e.depth)throw new P0("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new P0("Inconsistent open depths");return kq(e,t,n,0)}function kq(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function n0(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(vh(e.nodeAfter,i),s++));for(let l=s;lo&&nA(e,t,o+1),r=i.depth>o&&nA(n,i,o+1),l=[];return n0(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(bq(s,r),vh(yh(s,wq(e,t,n,i,o+1)),l)):(s&&vh(yh(s,b4(e,t,o+1)),l),n0(t,n,o,l),r&&vh(yh(r,b4(n,i,o+1)),l)),n0(i,null,o,l),new Xt(l)}function b4(e,t,n){let i=[];if(n0(null,e,n,i),e.depth>n){let o=nA(e,t,n+1);vh(yh(o,b4(e,t,n+1)),i)}return n0(t,null,n,i),new Xt(i)}function R7e(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(Xt.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class z0{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new P7e(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new z0(n,i,s)}static resolveCached(t,n){let i=MD.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Cq(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=Xt.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=Xt.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};kh.prototype.text=void 0;class w4 extends kh{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cq(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new w4(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new w4(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Cq(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Fh{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new j7e(t,n);if(i.next==null)return Fh.empty;let o=Aq(i);i.next&&i.err("Unexpected trailing text");let s=Z7e(K7e(o));return G7e(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` -`)}}Fh.empty=new Fh(!0);class j7e{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Aq(e){let t=[];do t.push(H7e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function H7e(e){let t=[];do t.push(W7e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function W7e(e){let t=V7e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=q7e(e,t);else break;return t}function ID(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function q7e(e,t){let n=ID(e),i=n;return e.eat(",")&&(e.next!="}"?i=ID(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function U7e(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function V7e(e){if(e.eat("(")){let t=Aq(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=U7e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function K7e(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Fh(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:_q(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new kh(this,this.computeAttrs(t),Xt.from(n),Pi.setFrom(i))}createChecked(t=null,n,i){return n=Xt.from(n),this.checkContent(n),new kh(this,this.computeAttrs(t),n,Pi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=Xt.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(Xt.empty,!0);return s?new kh(this,t,n.append(s),Pi.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new Tq(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function Q7e(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class Y7e{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?Q7e(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Xk{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=Iq(t,o.attrs),this.excluded=null;let s=Sq(this.attrs);this.instance=s?new Pi(this,s):null}create(t=null){return!t&&this.instance?this.instance:new Pi(this,_q(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new Xk(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class J7e{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Js.from(t.nodes),n.marks=Js.from(t.marks||{}),this.nodes=ED.compile(this.spec.nodes,this),this.marks=Xk.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Fh.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?LD(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:LD(this,r.split(" "))}this.nodeFromJSON=o=>kh.fromJSON(this,o),this.markFromJSON=o=>Pi.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ED){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new w4(i,i.defaultAttrs,t,Pi.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function LD(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function X7e(e){return e.tag!=null}function exe(e){return e.style!=null}let Eq=class oA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(X7e(o))this.tags.push(o);else if(exe(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new DD(this,n,!1);return i.addAll(t,Pi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new DD(this,n,!0);return i.addAll(t,Pi.none,n.from,n.to),hn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=FD(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=FD(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new oA(t,oA.schemaRules(t)))}};const Lq={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},txe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Nq={ol:!0,ul:!0},j0=1,sA=2,i0=4;function ND(e,t,n){return t!=null?(t?j0:0)|(t==="full"?sA:0):e&&e.whitespace=="pre"?j0|sA:n&~i0}class sy{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=Pi.none,this.match=s||(r&i0?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Xt.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&j0)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=Xt.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Xt.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Lq.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class DD{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=ND(null,n.preserveWhitespace,0)|(i?i0:0);o?s=new sy(o.type,o.attrs,Pi.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new sy(null,null,Pi.none,!0,null,r):s=new sy(t.schema.topNodeType,null,Pi.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&sA?"full":this.localPreserveWS||(o.options&j0)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` -`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):BD(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new sy(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=j0)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function nxe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&Nq.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function ixe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function FD(e){let t={};for(let n in e)t[n]=e[n];return t}function BD(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&Qy(ry(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:Qy(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Eu(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=RD(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return RD(t.marks)}}function RD(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function ry(e){return e.document||window.document}const $D=new WeakMap;function oxe(e){let t=$D.get(e);return t===void 0&&$D.set(e,t=sxe(e)),t}function sxe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=Qy(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Dq=65535,Fq=Math.pow(2,16);function rxe(e,t){return e+t*Fq}function OD(e){return e&Dq}function lxe(e){return(e-(e&Dq))/Fq}const Bq=1,Rq=2,Yy=4,$q=8;class rA{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&$q)>0}get deletedBefore(){return(this.delInfo&(Bq|Yy))>0}get deletedAfter(){return(this.delInfo&(Rq|Yy))>0}get deletedAcross(){return(this.delInfo&Yy)>0}}class Nl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Nl.empty)return Nl.empty}recover(t){let n=0,i=OD(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:rxe(l/3,t-a),g=t==a?Rq:t==d?Bq:Yy;return(n<0?t!=a:t!=d)&&(g|=$q),new rA(h,g,m)}o+=c-u}return i?t+o:new rA(t+o,0,null)}touches(t,n){let i=0,o=OD(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new H0;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return us.fromReplace(t,this.from,this.to,s)}invert(){return new xu(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new gd(n.pos,i.pos,this.mark)}merge(t){return t instanceof gd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new gd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new gd(n.from,n.to,t.markFromJSON(n.mark))}}Ir.jsonID("addMark",gd);class xu extends Ir{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new hn(cx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return us.fromReplace(t,this.from,this.to,i)}invert(){return new gd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new xu(n.pos,i.pos,this.mark)}merge(t){return t instanceof xu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new xu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xu(n.from,n.to,t.markFromJSON(n.mark))}}Ir.jsonID("removeMark",xu);class vd extends Ir{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return us.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return us.fromReplace(t,this.pos,this.pos+1,new hn(Xt.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new Pl(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Pl(n.from,n.to,n.gapFrom,n.gapTo,hn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Ir.jsonID("replaceAround",Pl);function lA(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function axe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function uxe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof Xk){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new xu(r.from,r.to,r.style)))}function dx(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function cxe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function fx(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=Xt.from(i.node(m).copy(c)),d++):a--;let f=Xt.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Xt.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new Pl(o,s,o,s,new hn(i,0,0),n.length,!0))}function hxe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&pxe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&Pq(e,r,l,s),dx(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new Pl(d,f,d+1,f-1,new hn(Xt.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&Oq(e,r,l,s),!1}})}function Oq(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function Pq(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` -`))}})}function pxe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function mxe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Pl(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new hn(Xt.from(r),0,0),1,!0))}function Jy(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function gxe(e,t,n=1,i){let o=e.doc.resolve(t),s=Xt.empty,r=Xt.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=Xt.from(o.node(l).copy(s));let c=i&&i[u];r=Xt.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new Ps(t,t,new hn(s.append(r),n,n),!0))}function zq(e,t){let n=e.resolve(t),i=n.index();return yxe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function vxe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function hx(e,t,n=t,i=hn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return jq(o,s,i)?new Ps(t,n,i):new Cxe(o,s,i).fit()}function jq(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class Cxe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=Xt.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=Xt.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new hn(s,r,l);return t>-1?new Pl(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new Ps(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=V8(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(Xt.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=V8(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new hn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=V8(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new hn(mg(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new hn(mg(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=v,c.push(Hq(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=gg(this.placed,n,Xt.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=K8(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=gg(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=gg(this.placed,this.depth,Xt.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Xt.empty,!0);n.childCount&&(this.placed=gg(this.placed,this.frontier.length,n))}}function mg(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(mg(e.firstChild.content,t-1,n)))}function gg(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(gg(e.lastChild.content,t-1,n)))}function V8(e,t){for(let n=0;n1&&(i=i.replaceChild(0,Hq(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(Xt.empty,!0)))),e.copy(i)}function K8(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!Axe(n,s.content,r)?l:null}function Axe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=xxe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function Wq(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(Xt.empty,!0))}return e}function _xe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=bxe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new hn(Xt.from(i),0,0))}function Mxe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=qq(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function qq(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class d1 extends Ir{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return us.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return us.fromReplace(t,this.pos,this.pos+1,new hn(Xt.from(o),0,n.isLeaf?0:1))}getMap(){return Nl.empty}invert(t){return new d1(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new d1(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new d1(n.pos,n.attr,n.value)}}Ir.jsonID("attr",d1);class W0 extends Ir{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return us.ok(i)}getMap(){return Nl.empty}invert(t){return new W0(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new W0(n.attr,n.value)}}Ir.jsonID("docAttr",W0);let L1=class extends Error{};L1=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};L1.prototype=Object.create(Error.prototype);L1.prototype.constructor=L1;L1.prototype.name="TransformError";class Ixe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new H0}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new L1(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=hn.empty){let o=hx(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new hn(Xt.from(i),0,0))}delete(t,n){return this.replace(t,n,hn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return Sxe(this,t,n,i),this}replaceRangeWith(t,n,i){return _xe(this,t,n,i),this}deleteRange(t,n){return Mxe(this,t,n),this}lift(t,n){return dxe(this,t,n),this}join(t,n=1){return kxe(this,t,n),this}wrap(t,n){return fxe(this,t,n),this}setBlockType(t,n=t,i,o=null){return hxe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return mxe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new d1(t,n,i)),this}setDocAttribute(t,n){return this.step(new W0(t,n)),this}addNodeMark(t,n){return this.step(new vd(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof Pi)n.isInSet(i.marks)&&this.step(new Bh(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Bh(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return gxe(this,t,n,i),this}addMark(t,n,i){return axe(this,t,n,i),this}removeMark(t,n,i){return uxe(this,t,n,i),this}clearIncompatible(t,n,i){return dx(this,t,n,i),this}}const Z8=Object.create(null);class Vi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new Txe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?Lp(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):Lp(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new zl(t.node(0))}static atStart(t){return Lp(t,t,0,0,1)||new zl(t)}static atEnd(t){return Lp(t,t,t.content.size,t.childCount,-1)||new zl(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Z8[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Z8)throw new RangeError("Duplicate use of selection JSON ID "+t);return Z8[t]=n,n.prototype.jsonID=t,n}getBookmark(){return si.between(this.$anchor,this.$head).getBookmark()}}Vi.prototype.visible=!0;class Txe{constructor(t,n){this.$from=t,this.$to=n}}let PD=!1;function zD(e){!PD&&!e.parent.inlineContent&&(PD=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class si extends Vi{constructor(t,n=t){zD(t),zD(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Vi.near(i);let o=t.resolve(n.map(this.anchor));return new si(o.parent.inlineContent?o:i,i)}replace(t,n=hn.empty){if(super.replace(t,n),n==hn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof si&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new eb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new si(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Vi.findFrom(n,i,!0)||Vi.findFrom(n,-i,!0);if(s)n=s.$head;else return Vi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Vi.findFrom(t,-i,!0)||Vi.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Kn.isSelectable(l))return Kn.create(e,n-(o<0?l.nodeSize:0))}else{let a=Lp(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function jD(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Vi.near(e.doc.resolve(r),n))}const HD=1,ly=2,WD=4;class Lxe extends Ixe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ly,this}ensureMarks(t){return Pi.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ly)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ly,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Pi.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Vi.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=WD,this}get scrolledIntoView(){return(this.updated&WD)>0}}function qD(e,t){return!t||!e?e:e.bind(t)}class vg{constructor(t,n,i){this.name=t,this.init=qD(n.init,i),this.apply=qD(n.apply,i)}}const Nxe=[new vg("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new vg("selection",{init(e,t){return e.selection||Vi.atStart(t.doc)},apply(e){return e.selection}}),new vg("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new vg("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class G8{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Nxe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new vg(i.key,i.spec.state,i))})}}class nh{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new G8(t.schema,t.plugins),s=new nh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=kh.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Vi.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function Uq(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=Uq(o,t,{})),n[i]=o}return n}class tm{constructor(t){this.spec=t,this.props={},t.props&&Uq(t.props,this,this.props),this.key=t.key?t.key.key:Vq("plugin")}getState(t){return t[this.key]}}const Q8=Object.create(null);function Vq(e){return e in Q8?e+"$"+ ++Q8[e]:(Q8[e]=0,e+"$")}class mx{constructor(t="key"){this.key=Vq(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const aA=` +`;break}case-2:{r=t?" ":" ";break}case-1:{if(!t&&o)continue;r=" ";break}default:r=String.fromCharCode(s)}o=s===-2,i.push(r)}return i.join("")}function L7e(e){const i={constructs:$Ae([M7e,...(e||{}).extensions||[]]),content:o(VAe),defined:[],document:o(ZAe),flow:o(f7e),lazy:{},string:o(m7e),text:o(g7e)};return i;function o(s){return r;function r(l){return I7e(i,s,l)}}}function N7e(e){for(;!lq(e););return e}const MD=/[\0\t\n\r]/g;function D7e(){let e=1,t="",n=!0,i;return o;function o(s,r,l){const a=[];let u,c,d,f,h;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(r||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d>1}};Ys.from=function(e){if(e instanceof Ys)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ys(t)};function hq(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function gq(e){return e>=55296&&e<56320}class Xt{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new Xt(i,o)}cutByIndex(t,n){return t==n?Xt.empty:t==0&&n==this.content.length?this:new Xt(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new Xt(o,s)}addToStart(t){return new Xt([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Xt(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?iy(n+1,s):iy(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Xt.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return Xt.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Xt.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}zi.none=[];class $0 extends Error{}class hn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=yq(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new hn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new hn(vq(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return hn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new hn(Xt.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new hn(t,i,o)}}hn.empty=new hn(Xt.empty,0,0);function vq(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(vq(s.content,t-o-1,n-o-1)))}function yq(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=yq(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function F7e(e,t,n){if(n.openStart>e.depth)throw new $0("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new $0("Inconsistent open depths");return kq(e,t,n,0)}function kq(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function e0(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(yh(e.nodeAfter,i),s++));for(let l=s;lo&&tA(e,t,o+1),r=i.depth>o&&tA(n,i,o+1),l=[];return e0(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(bq(s,r),yh(kh(s,wq(e,t,n,i,o+1)),l)):(s&&yh(kh(s,k4(e,t,o+1)),l),e0(t,n,o,l),r&&yh(kh(r,k4(n,i,o+1)),l)),e0(i,null,o,l),new Xt(l)}function k4(e,t,n){let i=[];if(e0(null,e,n,i),e.depth>n){let o=tA(e,t,n+1);yh(kh(o,k4(e,t,n+1)),i)}return e0(t,null,n,i),new Xt(i)}function B7e(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(Xt.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class P0{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new $7e(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new P0(n,i,s)}static resolveCached(t,n){let i=ID.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Cq(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=Xt.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=Xt.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};bh.prototype.text=void 0;class b4 extends bh{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cq(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new b4(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new b4(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Cq(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Bh{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new z7e(t,n);if(i.next==null)return Bh.empty;let o=Aq(i);i.next&&i.err("Unexpected trailing text");let s=K7e(V7e(o));return Z7e(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` +`)}}Bh.empty=new Bh(!0);class z7e{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Aq(e){let t=[];do t.push(j7e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function j7e(e){let t=[];do t.push(H7e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function H7e(e){let t=U7e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=W7e(e,t);else break;return t}function TD(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function W7e(e,t){let n=TD(e),i=n;return e.eat(",")&&(e.next!="}"?i=TD(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function q7e(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function U7e(e){if(e.eat("(")){let t=Aq(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=q7e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function V7e(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Bh(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:_q(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new bh(this,this.computeAttrs(t),Xt.from(n),zi.setFrom(i))}createChecked(t=null,n,i){return n=Xt.from(n),this.checkContent(n),new bh(this,this.computeAttrs(t),n,zi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=Xt.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(Xt.empty,!0);return s?new bh(this,t,n.append(s),zi.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new Tq(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function G7e(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class Q7e{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?G7e(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Jk{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=Iq(t,o.attrs),this.excluded=null;let s=Sq(this.attrs);this.instance=s?new zi(this,s):null}create(t=null){return!t&&this.instance?this.instance:new zi(this,_q(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new Jk(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class Y7e{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Ys.from(t.nodes),n.marks=Ys.from(t.marks||{}),this.nodes=LD.compile(this.spec.nodes,this),this.marks=Jk.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Bh.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?ND(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:ND(this,r.split(" "))}this.nodeFromJSON=o=>bh.fromJSON(this,o),this.markFromJSON=o=>zi.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof LD){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new b4(i,i.defaultAttrs,t,zi.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function ND(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function J7e(e){return e.tag!=null}function X7e(e){return e.style!=null}let Eq=class iA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(J7e(o))this.tags.push(o);else if(X7e(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new FD(this,n,!1);return i.addAll(t,zi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new FD(this,n,!0);return i.addAll(t,zi.none,n.from,n.to),hn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=BD(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=BD(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new iA(t,iA.schemaRules(t)))}};const Lq={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},exe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Nq={ol:!0,ul:!0},z0=1,oA=2,t0=4;function DD(e,t,n){return t!=null?(t?z0:0)|(t==="full"?oA:0):e&&e.whitespace=="pre"?z0|oA:n&~t0}class oy{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=zi.none,this.match=s||(r&t0?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Xt.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&z0)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=Xt.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Xt.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Lq.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class FD{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=DD(null,n.preserveWhitespace,0)|(i?t0:0);o?s=new oy(o.type,o.attrs,zi.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new oy(null,null,zi.none,!0,null,r):s=new oy(t.schema.topNodeType,null,zi.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&oA?"full":this.localPreserveWS||(o.options&z0)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` +`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):RD(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new oy(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=z0)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function txe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&Nq.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function nxe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function BD(e){let t={};for(let n in e)t[n]=e[n];return t}function RD(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&Gy(sy(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:Gy(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Lu(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=OD(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return OD(t.marks)}}function OD(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function sy(e){return e.document||window.document}const $D=new WeakMap;function ixe(e){let t=$D.get(e);return t===void 0&&$D.set(e,t=oxe(e)),t}function oxe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=Gy(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Dq=65535,Fq=Math.pow(2,16);function sxe(e,t){return e+t*Fq}function PD(e){return e&Dq}function rxe(e){return(e-(e&Dq))/Fq}const Bq=1,Rq=2,Qy=4,Oq=8;class sA{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&Oq)>0}get deletedBefore(){return(this.delInfo&(Bq|Qy))>0}get deletedAfter(){return(this.delInfo&(Rq|Qy))>0}get deletedAcross(){return(this.delInfo&Qy)>0}}class Bl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Bl.empty)return Bl.empty}recover(t){let n=0,i=PD(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:sxe(l/3,t-a),g=t==a?Rq:t==d?Bq:Qy;return(n<0?t!=a:t!=d)&&(g|=Oq),new sA(h,g,m)}o+=c-u}return i?t+o:new sA(t+o,0,null)}touches(t,n){let i=0,o=PD(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new j0;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return as.fromReplace(t,this.from,this.to,s)}invert(){return new Su(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new gd(n.pos,i.pos,this.mark)}merge(t){return t instanceof gd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new gd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new gd(n.from,n.to,t.markFromJSON(n.mark))}}Mr.jsonID("addMark",gd);class Su extends Mr{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new hn(ux(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return as.fromReplace(t,this.from,this.to,i)}invert(){return new gd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Su(n.pos,i.pos,this.mark)}merge(t){return t instanceof Su&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Su(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Su(n.from,n.to,t.markFromJSON(n.mark))}}Mr.jsonID("removeMark",Su);class vd extends Mr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return as.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return as.fromReplace(t,this.pos,this.pos+1,new hn(Xt.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new Hl(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Hl(n.from,n.to,n.gapFrom,n.gapTo,hn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Mr.jsonID("replaceAround",Hl);function rA(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function lxe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function axe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof Jk){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new Su(r.from,r.to,r.style)))}function cx(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function uxe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function dx(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=Xt.from(i.node(m).copy(c)),d++):a--;let f=Xt.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Xt.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new Hl(o,s,o,s,new hn(i,0,0),n.length,!0))}function fxe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&hxe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&Pq(e,r,l,s),cx(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new Hl(d,f,d+1,f-1,new hn(Xt.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&$q(e,r,l,s),!1}})}function $q(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function Pq(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` +`))}})}function hxe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function pxe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Hl(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new hn(Xt.from(r),0,0),1,!0))}function Yy(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function mxe(e,t,n=1,i){let o=e.doc.resolve(t),s=Xt.empty,r=Xt.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=Xt.from(o.node(l).copy(s));let c=i&&i[u];r=Xt.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new js(t,t,new hn(s.append(r),n,n),!0))}function zq(e,t){let n=e.resolve(t),i=n.index();return vxe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function gxe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function fx(e,t,n=t,i=hn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return jq(o,s,i)?new js(t,n,i):new wxe(o,s,i).fit()}function jq(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class wxe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=Xt.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=Xt.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new hn(s,r,l);return t>-1?new Hl(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new js(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=U8(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(Xt.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=U8(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new hn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=U8(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new hn(pg(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new hn(pg(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=v,c.push(Hq(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=mg(this.placed,n,Xt.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=V8(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=mg(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=mg(this.placed,this.depth,Xt.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Xt.empty,!0);n.childCount&&(this.placed=mg(this.placed,this.frontier.length,n))}}function pg(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(pg(e.firstChild.content,t-1,n)))}function mg(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(mg(e.lastChild.content,t-1,n)))}function U8(e,t){for(let n=0;n1&&(i=i.replaceChild(0,Hq(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(Xt.empty,!0)))),e.copy(i)}function V8(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!Cxe(n,s.content,r)?l:null}function Cxe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=Axe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function Wq(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(Xt.empty,!0))}return e}function Sxe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=kxe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new hn(Xt.from(i),0,0))}function _xe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=qq(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function qq(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class d1 extends Mr{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return as.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return as.fromReplace(t,this.pos,this.pos+1,new hn(Xt.from(o),0,n.isLeaf?0:1))}getMap(){return Bl.empty}invert(t){return new d1(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new d1(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new d1(n.pos,n.attr,n.value)}}Mr.jsonID("attr",d1);class H0 extends Mr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return as.ok(i)}getMap(){return Bl.empty}invert(t){return new H0(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new H0(n.attr,n.value)}}Mr.jsonID("docAttr",H0);let L1=class extends Error{};L1=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};L1.prototype=Object.create(Error.prototype);L1.prototype.constructor=L1;L1.prototype.name="TransformError";class Mxe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new j0}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new L1(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=hn.empty){let o=fx(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new hn(Xt.from(i),0,0))}delete(t,n){return this.replace(t,n,hn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return xxe(this,t,n,i),this}replaceRangeWith(t,n,i){return Sxe(this,t,n,i),this}deleteRange(t,n){return _xe(this,t,n),this}lift(t,n){return cxe(this,t,n),this}join(t,n=1){return yxe(this,t,n),this}wrap(t,n){return dxe(this,t,n),this}setBlockType(t,n=t,i,o=null){return fxe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return pxe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new d1(t,n,i)),this}setDocAttribute(t,n){return this.step(new H0(t,n)),this}addNodeMark(t,n){return this.step(new vd(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof zi)n.isInSet(i.marks)&&this.step(new Rh(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Rh(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return mxe(this,t,n,i),this}addMark(t,n,i){return lxe(this,t,n,i),this}removeMark(t,n,i){return axe(this,t,n,i),this}clearIncompatible(t,n,i){return cx(this,t,n,i),this}}const K8=Object.create(null);class Vi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new Ixe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?Np(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):Np(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Wl(t.node(0))}static atStart(t){return Np(t,t,0,0,1)||new Wl(t)}static atEnd(t){return Np(t,t,t.content.size,t.childCount,-1)||new Wl(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=K8[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in K8)throw new RangeError("Duplicate use of selection JSON ID "+t);return K8[t]=n,n.prototype.jsonID=t,n}getBookmark(){return si.between(this.$anchor,this.$head).getBookmark()}}Vi.prototype.visible=!0;class Ixe{constructor(t,n){this.$from=t,this.$to=n}}let zD=!1;function jD(e){!zD&&!e.parent.inlineContent&&(zD=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class si extends Vi{constructor(t,n=t){jD(t),jD(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Vi.near(i);let o=t.resolve(n.map(this.anchor));return new si(o.parent.inlineContent?o:i,i)}replace(t,n=hn.empty){if(super.replace(t,n),n==hn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof si&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Xk(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new si(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Vi.findFrom(n,i,!0)||Vi.findFrom(n,-i,!0);if(s)n=s.$head;else return Vi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Vi.findFrom(t,-i,!0)||Vi.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Kn.isSelectable(l))return Kn.create(e,n-(o<0?l.nodeSize:0))}else{let a=Np(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function HD(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Vi.near(e.doc.resolve(r),n))}const WD=1,ry=2,qD=4;class Exe extends Mxe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ry,this}ensureMarks(t){return zi.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ry)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ry,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||zi.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Vi.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qD,this}get scrolledIntoView(){return(this.updated&qD)>0}}function UD(e,t){return!t||!e?e:e.bind(t)}class gg{constructor(t,n,i){this.name=t,this.init=UD(n.init,i),this.apply=UD(n.apply,i)}}const Lxe=[new gg("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new gg("selection",{init(e,t){return e.selection||Vi.atStart(t.doc)},apply(e){return e.selection}}),new gg("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new gg("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Z8{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Lxe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new gg(i.key,i.spec.state,i))})}}class ih{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Z8(t.schema,t.plugins),s=new ih(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=bh.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Vi.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function Uq(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=Uq(o,t,{})),n[i]=o}return n}class tm{constructor(t){this.spec=t,this.props={},t.props&&Uq(t.props,this,this.props),this.key=t.key?t.key.key:Vq("plugin")}getState(t){return t[this.key]}}const G8=Object.create(null);function Vq(e){return e in G8?e+"$"+ ++G8[e]:(G8[e]=0,e+"$")}class px{constructor(t="key"){this.key=Vq(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const lA=` @@ -355,155 +355,155 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. `,eU=` -`,Dxe='',Fxe='',Bxe='',Rxe='',$xe='',Oxe={sm:14,md:16,lg:20},Pxe={file:aA,folder:Kq,skill:Zq,copy:Gq,check:Qq,"external-link":Yq,target:Jq,"file-edit":Xq,close:eU,attachment:Dxe,image:Fxe,video:Bxe,fullscreen:Rxe,quote:$xe};function Kr(e,t="md"){const n=Oxe[t];return Pxe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=qU(),i=n.body,o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&WU[o[1].toLowerCase()])&&(e=s.map(r=>"<"+r+">").join("")+e+s.map(r=>"").reverse().join("")),i.innerHTML=y_e(e),s)for(let r=0;r=0;l-=2){let a=n.nodes[i[l]];if(!a||a.hasRequiredAttrs())break;o=Xt.from(a.create(i[l+1],o)),s++,r++}return new hn(o,s,r)}const Zr={},Gr={},C_e={touchstart:!0,touchmove:!0};class A_e{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function x_e(e){for(let t in Zr){let n=Zr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=i=>{__e(e,i)&&!Ix(e,i)&&(e.editable||!(i.type in Gr))&&n(e,i)},C_e[t]?{passive:!0}:void 0)}_r&&e.dom.addEventListener("input",()=>null),wA(e)}function dc(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function S_e(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function wA(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=i=>Ix(e,i))})}function Ix(e,t){return e.someProp("handleDOMEvents",n=>{let i=n[t.type];return i?i(e,t)||t.defaultPrevented:!1})}function __e(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function M_e(e,t){!Ix(e,t)&&Zr[t.type]&&(e.editable||!(t.type in Gr))&&Zr[t.type](e,t)}Gr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!ZU(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(cc&&ar&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),B1&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();e.input.lastIOSEnter=i,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==i&&(e.someProp("handleKeyDown",o=>o(e,Gf(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",i=>i(e,n))||m_e(e,n)?n.preventDefault():dc(e,"key")};Gr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Gr.keypress=(e,t)=>{let n=t;if(ZU(e)||!n.charCode||n.ctrlKey&&!n.altKey||sa&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let i=e.state.selection;if(!(i instanceof si)||!i.$from.sameParent(i.$to)){let o=String.fromCharCode(n.charCode),s=()=>e.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",r=>r(e,i.$from.pos,i.$to.pos,o,s))&&e.dispatch(s()),n.preventDefault()}};function Ev(e){return{left:e.clientX,top:e.clientY}}function I_e(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}function Tx(e,t,n,i,o){if(i==-1)return!1;let s=e.state.doc.resolve(i);for(let r=s.depth+1;r>0;r--)if(e.someProp(t,l=>r>s.depth?l(e,n,s.nodeAfter,s.before(r),o,!0):l(e,n,s.node(r),s.before(r),o,!1)))return!0;return!1}function Lv(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function T_e(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return i&&i.isAtom&&Kn.isSelectable(i)?(Lv(e,new Kn(n)),!0):!1}function E_e(e,t){if(t==-1)return!1;let n=e.state.selection,i,o;n instanceof Kn&&(i=n.node);let s=e.state.doc.resolve(t);for(let r=s.depth+1;r>0;r--){let l=r>s.depth?s.nodeAfter:s.node(r);if(Kn.isSelectable(l)){i&&n.$from.depth>0&&r>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(r);break}}return o!=null?(Lv(e,Kn.create(e.state.doc,o)),!0):!1}function L_e(e,t,n,i,o){return Tx(e,"handleClickOn",t,n,i)||e.someProp("handleClick",s=>s(e,t,i))||(o?E_e(e,n):T_e(e,n))}function N_e(e,t,n,i){return Tx(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",o=>o(e,t,i))}function D_e(e,t,n,i){return Tx(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",o=>o(e,t,i))||F_e(e,n,i)}function F_e(e,t,n){if(n.button!=0)return!1;let i=UU(e,t,!0),o=e.state.doc;return i?(Lv(e,i),i instanceof si&&o.eq(e.state.doc)&&(e.input.mouseDown=new R_e(e,i)),!0):!1}function UU(e,t,n){let i=e.state.doc;if(t==-1)return i.inlineContent?si.create(i,0,i.content.size):null;let o=i.resolve(t);for(let s=o.depth+1;s>0;s--){let r=s>o.depth?o.nodeAfter:o.node(s),l=o.before(s);if(r.inlineContent)return si.create(i,l+1,l+1+r.content.size);if(n&&Kn.isSelectable(r))return Kn.create(i,l)}return null}function Ex(e){return S4(e)}const VU=sa?"metaKey":"ctrlKey";Zr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=Ex(e),o=Date.now(),s="singleClick";o-e.input.lastClick.time<500&&I_e(n,e.input.lastClick)&&!n[VU]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?s="doubleClick":e.input.lastClick.type=="doubleClick"&&(s="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let r=e.posAtCoords(Ev(n));r&&(s=="singleClick"?e.input.mouseDown=new B_e(e,r,n,!!i):(s=="doubleClick"?N_e:D_e)(e,r.pos,r.inside,n)?n.preventDefault():dc(e,"pointer"))};class KU{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class B_e extends KU{constructor(t,n,i,o){super(t),this.pos=n,this.event=i,this.flushed=o,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!i[VU],this.allowDefault=i.shiftKey;let s,r;if(n.inside>-1)s=t.state.doc.nodeAt(n.inside),r=n.inside;else{let c=t.state.doc.resolve(n.pos);s=c.parent,r=c.depth?c.before():0}const l=o?null:i.target,a=l?t.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:u}=t.state;i.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof Kn&&u.from<=r&&u.to>r)&&(this.mightDrag={node:s,pos:r,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&pa&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),dc(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||vc(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ev(t))),this.updateAllowDefault(t),this.allowDefault||!n?dc(this.view,"pointer"):L_e(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||_r&&this.mightDrag&&!this.mightDrag.node.isAtom||ar&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Lv(this.view,Vi.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):dc(this.view,"pointer")}move(t){this.updateAllowDefault(t),dc(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class R_e extends KU{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),dc(this.view,"pointer");let n=this.view.posAtCoords(Ev(t)),i=n&&UU(this.view,n.inside,!1);if(!i)return;let{doc:o}=this.view.state,s=this.startSelection,[r,l]=i.from{e.input.lastTouch=Date.now(),Ex(e),dc(e,"pointer")};Zr.touchmove=e=>{e.input.lastTouch=Date.now(),dc(e,"pointer")};Zr.contextmenu=e=>Ex(e);function ZU(e,t){return e.composing?!0:_r&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const $_e=cc?5e3:-1;Gr.compositionstart=Gr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof si&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||ar&&AU&&O_e(e)))e.markCursor=e.state.storedMarks||n.marks(),S4(e,!0),e.markCursor=null;else if(S4(e,!t.selection.empty),pa&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=e.domSelectionRange();for(let o=i.focusNode,s=i.focusOffset;o&&o.nodeType==1&&s!=0;){let r=s<0?o.lastChild:o.childNodes[s-1];if(!r)break;if(r.nodeType==3){let l=e.domSelection();l&&l.collapse(r,r.nodeValue.length);break}else o=r,s=-1}}e.input.composing=!0}GU(e,$_e)};function O_e(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return i.nodeType==1&&i.contentEditable=="false"}Gr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,GU(e,20))};function GU(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>S4(e),t))}function QU(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function P_e(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=ESe(t.focusNode,t.focusOffset),i=LSe(t.focusNode,t.focusOffset);if(n&&i&&n!=i){let o=i.pmViewDesc,s=e.domObserver.lastChangedTextNode;if(n==s||i==s)return s;if(!o||!o.isText(i.nodeValue))return i;if(e.input.compositionNode==i){let r=n.pmViewDesc;if(!(!r||!r.isText(n.nodeValue)))return i}}return n||i}function S4(e,t=!1){if(!(cc&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),QU(e),t||e.docView&&e.docView.dirty){let n=Sx(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function z_e(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const V0=gl&&Md<15||B1&&BSe<604;Zr.copy=Gr.cut=(e,t)=>{let n=t,i=e.state.selection,o=n.type=="cut";if(i.empty)return;let s=V0?null:n.clipboardData,r=i.content(),{dom:l,text:a}=Mx(e,r);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):z_e(e,l),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function j_e(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function H_e(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?K0(e,i.value,null,o,t):K0(e,i.textContent,i.innerHTML,o,t)},50)}function K0(e,t,n,i,o){let s=PU(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",a=>a(e,o,s||hn.empty)))return!0;if(!s)return!1;let r=j_e(s),l=r?e.state.tr.replaceSelectionWith(r,i):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function YU(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Gr.paste=(e,t)=>{let n=t;if(e.composing&&!cc)return;let i=V0?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;i&&K0(e,YU(i),i.getData("text/html"),o,n)?n.preventDefault():H_e(e,n)};class JU{constructor(t,n,i){this.slice=t,this.move=n,this.node=i}}const W_e=sa?"altKey":"ctrlKey";function XU(e,t){let n;return e.someProp("dragCopies",i=>{n=n||i(t)}),n!=null?!n:!t[W_e]}Zr.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let o=e.state.selection,s=o.empty?null:e.posAtCoords(Ev(n)),r;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Kn?o.to-1:o.to))){if(i&&i.mightDrag)r=Kn.create(e.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(r=Kn.create(e.state.doc,d.posBefore))}}let l=(r||e.state.selection).content(),{dom:a,text:u,slice:c}=Mx(e,l);(!n.dataTransfer.files.length||!ar||CU>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(V0?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",V0||n.dataTransfer.setData("text/plain",u),e.dragging=new JU(c,XU(e,n),r)};Zr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Gr.dragover=Gr.dragenter=(e,t)=>t.preventDefault();Gr.drop=(e,t)=>{try{q_e(e,t,e.dragging)}finally{e.dragging=null}};function q_e(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(Ev(t));if(!i)return;let o=e.state.doc.resolve(i.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e,!1)}):s=PU(e,YU(t.dataTransfer),V0?null:t.dataTransfer.getData("text/html"),!1,o);let r=!!(n&&XU(e,t));if(e.someProp("handleDrop",h=>h(e,t,s||hn.empty,r))){t.preventDefault();return}if(!s)return;t.preventDefault();let l=s?wxe(e.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let a=e.state.tr;if(r){let{node:h}=n;h?h.replace(a):a.deleteSelection()}let u=a.mapping.map(l),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=a.doc;if(c?a.replaceRangeWith(u,u,s.content.firstChild):a.replaceRange(u,u,s),a.doc.eq(d))return;let f=a.doc.resolve(u);if(c&&Kn.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new Kn(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,g,v,y)=>h=y),a.setSelection(_x(e,f,a.doc.resolve(h)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}Zr.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&vc(e)},20))};Zr.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Zr.beforeinput=(e,t)=>{if(cc&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:i}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=i||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",s=>s(e,Gf(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Gr)Zr[e]=Gr[e];function Z0(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class _4{constructor(t,n){this.toDOM=t,this.spec=n||wh,this.side=this.spec.side||0}map(t,n,i,o){let{pos:s,deleted:r}=t.mapResult(n.from+o,this.side<0?-1:1);return r?null:new Ar(s-i,s-i,this)}valid(){return!0}eq(t){return this==t||t instanceof _4&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Z0(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ed{constructor(t,n){this.attrs=t,this.spec=n||wh}map(t,n,i,o){let s=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-i,r=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-i;return s>=r?null:new Ar(s,r,this)}valid(t,n){return n.from=t&&(!s||s(l.spec))&&i.push(l.copy(l.from+o,l.to+o))}for(let r=0;rt){let l=this.children[r]+1;this.children[r+2].findInner(t-l,n-l,i,o+l,s)}}map(t,n,i){return this==gr||t.maps.length==0?this:this.mapInner(t,n,0,0,i||wh)}mapInner(t,n,i,o,s){let r;for(let l=0;l{let u=a+i,c;if(c=tV(n,l,u)){for(o||(o=this.children.slice());sl&&d.to=t){this.children[l]==t&&(i=this.children[l+2]);break}let s=t+1,r=s+n.content.size;for(let l=0;ls&&a.type instanceof Ed){let u=Math.max(s,a.from)-s,c=Math.min(r,a.to)-s;uo.map(t,n,wh));return hd.from(i)}forChild(t,n){if(n.isLeaf)return Zo.empty;let i=[];for(let o=0;on instanceof Zo)?t:t.reduce((n,i)=>n.concat(i instanceof Zo?i:i.members),[]))}}forEachSet(t){for(let n=0;n{let v=g-m-(h-f);for(let y=0;yb+c-d)continue;let w=l[y]+c-d;h>=w?l[y+1]=f<=w?-2:-1:f>=c&&v&&(l[y]+=v,l[y+1]+=v)}d+=v}),c=n.maps[u].map(c,-1)}let a=!1;for(let u=0;u=i.content.size){a=!0;continue}let f=n.map(e[u+1]+s,-1),h=f-o,{index:m,offset:g}=i.content.findIndex(d),v=i.maybeChild(m);if(v&&g==d&&g+v.nodeSize==h){let y=l[u+2].mapInner(n,v,c+1,e[u]+s+1,r);y!=gr?(l[u]=d,l[u+1]=h,l[u+2]=y):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=V_e(l,e,t,n,o,s,r),c=M4(u,i,0,r);t=c.local;for(let d=0;dn&&r.to{let u=tV(e,l,a+n);if(u){s=!0;let c=M4(u,l,n+a+1,i);c!=gr&&o.push(a,a+l.nodeSize,c)}});let r=eV(s?nV(e):e,-n).sort(Ch);for(let l=0;l0;)t++;e.splice(t,0,n)}function n5(e){let t=[];return e.someProp("decorations",n=>{let i=n(e.state);i&&i!=gr&&t.push(i)}),e.cursorWrapper&&t.push(Zo.create(e.state.doc,[e.cursorWrapper.deco])),hd.from(t)}const K_e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Z_e=gl&&Md<=11;class G_e{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Q_e{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new G_e,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():_r&&t.composing&&i.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Z_e&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,K_e)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(pF(this.view)){if(this.suppressingSelectionUpdates)return vc(this.view);if(gl&&Md<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Rh(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,i;for(let s=t.focusNode;s;s=F1(s))n.add(s);for(let s=t.anchorNode;s;s=F1(s))if(n.has(s)){i=s;break}let o=i&&this.view.docView.nearestDesc(i);if(o&&o.ignoreMutation({type:"selection",target:i.nodeType==3?i.parentNode:i}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let i=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&pF(t)&&!this.ignoreSelectionChange(i),s=-1,r=-1,l=!1,a=[];if(t.editable)for(let c=0;cc.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||ar&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of a)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(pa&&a.length){let c=a.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||X_e(t,d)!=h)&&f.remove()}}}let u=null;s<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(s>-1&&(t.docView.markDirty(s,r),Y_e(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,eMe(t,a)),this.handleDOMChange(s,r,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(i)||vc(t),this.currentSelection.set(i))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let i=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(i==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!i||i.ignoreMutation(t))return null;if(t.type=="childList"){for(let c=0;cs;y--){let b=o.childNodes[y-1],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){r=y;break}if(!w||w.size)break}let f=e.state.doc,h=e.someProp("domParser")||Eq.fromSchema(e.state.schema),m=f.resolve(l),g=null,v=h.parse(o,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:s,to:r,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:nMe(i),context:m});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),g={anchor:y+l,head:b+l}}return{doc:v,sel:g,from:l,to:a}}const nMe=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName=="BR"&&t.parentNode){if(_r&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let i=document.createElement("div");return i.appendChild(document.createElement("li")),{skip:i}}else if(t.parentNode.lastChild==t||_r&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},iMe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function oMe(e,t,n,i,o){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let I=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,S=Sx(e,I);if(S&&!e.state.selection.eq(S)){if(ar&&cc&&e.input.lastKeyCode===13&&Date.now()-100x(e,Gf(13,"Enter"))))return;let _=e.state.tr.setSelection(S);I=="pointer"?_.setMeta("pointer",!0):I=="key"&&_.scrollIntoView(),s&&_.setMeta("composition",s),e.dispatch(_)}return}let r=e.state.doc.resolve(t),l=r.sharedDepth(n);t=r.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a=e.state.selection,u=tMe(e,t,n,o),c=e.state.doc,d=c.slice(u.from,u.to),f,h;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||cc)&&o.some(I=>I.nodeType==1&&!iMe.test(I.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",I=>I(e,Gf(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(i&&a instanceof si&&!a.empty&&a.$head.sameParent(a.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(u.sel){let I=SF(e,e.state.doc,u.sel);if(I&&!I.eq(e.state.selection)){let S=e.state.tr.setSelection(I);s&&S.setMeta("composition",s),e.dispatch(S)}}return}e.state.selection.frome.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?m.start=e.state.selection.from:m.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),gl&&Md<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=u.doc.resolveNoCache(m.start-u.from),v=u.doc.resolveNoCache(m.endB-u.from),y=c.resolve(m.start),b=g.sameParent(v)&&g.parent.inlineContent&&y.end()>=m.endA;if((B1&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!b&&g.posI(e,Gf(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&rMe(c,m.start,m.endA,g,v)&&e.someProp("handleKeyDown",I=>I(e,Gf(8,"Backspace")))){cc&&ar&&e.domObserver.suppressSelectionUpdates();return}ar&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),cc&&!b&&g.start()!=v.start()&&v.parentOffset==0&&g.depth==v.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,v=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(I){return I(e,Gf(13,"Enter"))})},20));let w=m.start,C=m.endA,T=I=>{let S=I||e.state.tr.replace(w,C,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let _=SF(e,S.doc,u.sel);_&&!(ar&&e.composing&&_.empty&&(m.start!=m.endB||e.input.lastChromeDeletevc(e),20));let I=T(e.state.tr.delete(w,C)),S=c.resolve(m.start).marksAcross(c.resolve(m.endA));S&&I.ensureMarks(S),e.dispatch(I)}else if(m.endA==m.endB&&(N=sMe(g.parent.content.cut(g.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let I=T(e.state.tr);N.type=="add"?I.addMark(w,C,N.mark):I.removeMark(w,C,N.mark),e.dispatch(I)}else if(g.parent.child(g.index()).isText&&g.index()==v.index()-(v.textOffset?0:1)){let I=g.parent.textBetween(g.parentOffset,v.parentOffset),S=()=>T(e.state.tr.insertText(I,w,C));e.someProp("handleTextInput",_=>_(e,w,C,I,S))||e.dispatch(S())}else e.dispatch(T());else e.dispatch(T())}function SF(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:_x(e,t.resolve(n.anchor),t.resolve(n.head))}function sMe(e,t){let n=e.firstChild.marks,i=t.firstChild.marks,o=n,s=i,r,l,a;for(let c=0;cc.mark(l.addToSet(c.marks));else if(o.length==0&&s.length==1)l=s[0],r="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;cn||i5(r,!0,!1)0&&(t||e.indexAfter(i)==e.node(i).childCount);)i--,o++,t=!1;if(n){let s=e.node(i).maybeChild(e.indexAfter(i));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function lMe(e,t,n,i,o){let s=e.findDiffStart(t,n),r=n+e.size,l=n+t.size;if(s==null)return null;let{a,b:u}=e.findDiffEnd(t,r,l);if(o=="end"){let c=Math.max(0,s-Math.min(a,u));i-=a+c-s}if(a=a?s-i:0;s-=c,u=s+(u-a),a=s}else if(u=u?s-i:0;s-=c,a=s+(a-u),u=s}return{start:s,endA:a,endB:u}}class iV{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new A_e,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(EF),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=IF(this),MF(this),this.nodeViews=TF(this),this.docView=aF(this.state.doc,_F(this),n5(this),this.dom,this),this.domObserver=new Q_e(this,(i,o,s,r)=>oMe(this,i,o,s,r)),this.domObserver.start(),x_e(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&wA(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(EF),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let i in this._props)n[i]=this._props[i];n.state=this.state;for(let i in t)n[i]=t[i];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var i;let o=this.state,s=!1,r=!1;t.storedMarks&&this.composing&&(QU(this),r=!0),this.state=t;let l=o.plugins!=t.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=TF(this);uMe(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&wA(this),this.editable=IF(this),MF(this);let a=n5(this),u=_F(this),c=o.plugins!=t.plugins&&!o.doc.eq(t.doc)?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(t.doc,u,a);(d||!t.selection.eq(o.selection))&&(r=!0);let f=c=="preserve"&&r&&this.dom.style.overflowAnchor==null&&OSe(this);if(r){this.domObserver.stop();let h=d&&(gl||ar)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&aMe(o.selection,t.selection);if(d){let g=ar?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=P_e(this)),(s||!this.docView.update(t.doc,u,a,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=aF(t.doc,u,a,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let m=this.input.mouseDown;h||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&a_e(this)&&m.delaySelUpdate())?vc(this,h):(RU(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((i=this.dragging)===null||i===void 0)&&i.node&&!o.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,o),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&PSe(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Kn){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&iF(this,n.getBoundingClientRect(),t)}else iF(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&sn.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return USe(this,t)}coordsAtPos(t,n=1){return IU(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,i=-1){let o=this.docView.posFromDOM(t,n,i);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return QSe(this,n||this.state,t)}pasteHTML(t,n){return K0(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return K0(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return Mx(this,t)}destroy(){this.docView&&(S_e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],n5(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ISe())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return M_e(this,t)}domSelectionRange(){let t=this.domSelection();return t?_r&&this.root.nodeType===11&&DSe(this.dom.ownerDocument)==this.dom&&J_e(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}iV.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function _F(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let i in n)i=="class"?t.class+=" "+n[i]:i=="style"?t.style=(t.style?t.style+";":"")+n[i]:!t[i]&&i!="contenteditable"&&i!="nodeName"&&(t[i]=String(n[i]))}),t.translate||(t.translate="no"),[Ar.node(0,e.state.doc.content.size,t)]}function MF(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ar.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function IF(e){return!e.someProp("editable",t=>t(e.state)===!1)}function aMe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function TF(e){let t=Object.create(null);function n(i){for(let o in i)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function uMe(e,t){let n=0,i=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)i++;return n!=i}function EF(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var I4=200,js=function(){};js.prototype.append=function(t){return t.length?(t=js.from(t),!this.length&&t||t.length=n?js.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};js.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};js.prototype.forEach=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(t,n,i,0):this.forEachInvertedInner(t,n,i,0)};js.prototype.map=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var o=[];return this.forEach(function(s,r){return o.push(t(s,r))},n,i),o};js.from=function(t){return t instanceof js?t:t&&t.length?new oV(t):js.empty};var oV=(function(e){function t(i){e.call(this),this.values=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new t(this.values.slice(o,s))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,s,r,l){for(var a=s;a=r;a--)if(o(this.values[a],l+a)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=I4)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=I4)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(js);js.empty=new oV([]);var cMe=(function(e){function t(n,i){e.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return il&&this.right.forEachInner(i,Math.max(o-l,0),Math.min(this.length,s)-l,r+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,r){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(i,o-l,Math.max(s,l)-l,r+l)===!1||s=s?this.right.slice(i-s,o-s):this.left.slice(i,s).append(this.right.slice(0,o-s))},t.prototype.leafAppend=function(i){var o=this.right.leafAppend(i);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(i){var o=this.left.leafPrepend(i);if(o)return new t(o,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t})(js);const dMe=500;class Ba{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let o,s;n&&(o=this.remapping(i,this.items.length),s=o.maps.length);let r=t.tr,l,a,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(i,f+1),s=o.maps.length),s--,c.push(d);return}if(o){c.push(new hu(d.map));let h=d.step.map(o.slice(s)),m;h&&r.maybeStep(h).doc&&(m=r.mapping.maps[r.mapping.maps.length-1],u.push(new hu(m,void 0,void 0,u.length+c.length))),s--,m&&o.appendMap(m,s)}else r.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(s)):d.selection,a=new Ba(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:r,selection:l}}addTransform(t,n,i,o){let s=[],r=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let c=0;chMe&&(l=fMe(l,u),r-=u),new Ba(l.append(s),r)}remapping(t,n){let i=new H0;return this.items.forEach((o,s)=>{let r=o.mirrorOffset!=null&&s-o.mirrorOffset>=t?i.maps.length-o.mirrorOffset:void 0;i.appendMap(o.map,r)},t,n),i}addMaps(t){return this.eventCount==0?this:new Ba(this.items.append(t.map(n=>new hu(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let i=[],o=Math.max(0,this.items.length-n),s=t.mapping,r=t.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;r=Math.min(r,h);let m=s.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),v=f.selection&&f.selection.map(s.slice(a+1,h));v&&l++,i.push(new hu(m,g,v))}else i.push(new hu(m))},o);let u=[];for(let f=n;fdMe&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),i=n.maps.length,o=[],s=0;return this.items.forEach((r,l)=>{if(l>=t)o.push(r),r.selection&&s++;else if(r.step){let a=r.step.map(n.slice(i)),u=a&&a.getMap();if(i--,u&&n.appendMap(u,i),a){let c=r.selection&&r.selection.map(n.slice(i));c&&s++;let d=new hu(u.invert(),a,c),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else r.map&&i--},this.items.length,0),new Ba(js.from(o.reverse()),s)}}Ba.empty=new Ba(js.empty,0);function fMe(e,t){let n;return e.forEach((i,o)=>{if(i.selection&&t--==0)return n=o,!1}),e.slice(n)}class hu{constructor(t,n,i,o){this.map=t,this.step=n,this.selection=i,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new hu(n.getMap().invert(),n,this.selection)}}}class od{constructor(t,n,i,o,s){this.done=t,this.undone=n,this.prevRanges=i,this.prevTime=o,this.prevComposition=s}}const hMe=20;function pMe(e,t,n,i){let o=n.getMeta(Ah),s;if(o)return o.historyState;n.getMeta(vMe)&&(e=new od(e.done,e.undone,null,0,-1));let r=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(r&&r.getMeta(Ah))return r.getMeta(Ah).redo?new od(e.done.addTransform(n,void 0,i,e9(t)),e.undone,LF(n.mapping.maps),e.prevTime,e.prevComposition):new od(e.done,e.undone.addTransform(n,void 0,i,e9(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(r&&r.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=e.prevTime==0||!r&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-i.newGroupDelay||!mMe(n,e.prevRanges)),u=r?o5(e.prevRanges,n.mapping):LF(n.mapping.maps);return new od(e.done.addTransform(n,a?t.selection.getBookmark():void 0,i,e9(t)),Ba.empty,u,n.time,l??e.prevComposition)}else return(s=n.getMeta("rebased"))?new od(e.done.rebased(n,s),e.undone.rebased(n,s),o5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new od(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),o5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function mMe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((i,o)=>{for(let s=0;s=t[s]&&(n=!0)}),n}function LF(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((i,o,s,r)=>t.push(s,r));return t}function o5(e,t){if(!e)return null;let n=[];for(let i=0;i{let o=Ah.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(i){let s=gMe(o,n,e);s&&i(t?s.scrollIntoView():s)}return!0}}const rV=sV(!1,!0),CA=sV(!0,!0);var Vd={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},T4={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kMe=typeof navigator<"u"&&/Mac/.test(navigator.platform),bMe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ir=0;ir<10;ir++)Vd[48+ir]=Vd[96+ir]=String(ir);for(var ir=1;ir<=24;ir++)Vd[ir+111]="F"+ir;for(var ir=65;ir<=90;ir++)Vd[ir]=String.fromCharCode(ir+32),T4[ir]=String.fromCharCode(ir);for(var r5 in Vd)T4.hasOwnProperty(r5)||(T4[r5]=Vd[r5]);function wMe(e){var t=kMe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||bMe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?T4:Vd)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const CMe=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),AMe=typeof navigator<"u"&&/Win/.test(navigator.platform);function xMe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let i,o,s,r;for(let l=0;le.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function MMe(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const IMe=(e,t,n)=>{let i=MMe(e,n);if(!i)return!1;let o=aV(i);if(!o){let r=i.blockRange(),l=r&&fx(r);return l==null?!1:(t&&t(e.tr.lift(r,l).scrollIntoView()),!0)}let s=o.nodeBefore;if(dV(e,o,t,-1))return!0;if(i.parent.content.size==0&&(R1(s,"end")||Kn.isSelectable(s)))for(let r=i.depth;;r--){let l=hx(e.doc,i.before(r),i.after(r),hn.empty);if(l&&l.slice.size1)break}return s.isAtom&&o.depth==i.depth-1?(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1};function R1(e,t,n=!1){for(let i=e;i;i=t=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const TMe=(e,t,n)=>{let{$head:i,empty:o}=e.selection,s=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;s=aV(i)}let r=s&&s.nodeBefore;return!r||!Kn.isSelectable(r)?!1:(t&&t(e.tr.setSelection(Kn.create(e.doc,s.pos-r.nodeSize)).scrollIntoView()),!0)};function aV(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function EMe(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let i=EMe(e,n);if(!i)return!1;let o=uV(i);if(!o)return!1;let s=o.nodeAfter;if(dV(e,o,t,1))return!0;if(i.parent.content.size==0&&(R1(s,"start")||Kn.isSelectable(s))){let r=hx(e.doc,i.before(),i.after(),hn.empty);if(r&&r.slice.size{let{$head:i,empty:o}=e.selection,s=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let{$head:n,$anchor:i}=e.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(t&&t(e.tr.insertText(` -`).scrollIntoView()),!0)};function Dx(e){for(let t=0;t{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let o=n.node(-1),s=n.indexAfter(-1),r=Dx(o.contentMatchAt(s));if(!r||!o.canReplaceWith(s,s,r))return!1;if(t){let l=n.after(),a=e.tr.replaceWith(l,l,r.createAndFill());a.setSelection(Vi.near(a.doc.resolve(l),1)),t(a.scrollIntoView())}return!0},BMe=(e,t)=>{let n=e.selection,{$from:i,$to:o}=n;if(n instanceof zl||i.parent.inlineContent||o.parent.inlineContent)return!1;let s=Dx(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let r=(!i.parentOffset&&o.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Jy(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let i=n.blockRange(),o=i&&fx(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)};function $Me(e){return(t,n)=>{if(t.selection instanceof Kn&&t.selection.node.isBlock){let{$from:h}=t.selection;return!h.parentOffset||!Jy(t.doc,h.pos)?!1:(n&&n(t.tr.split(h.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let i=t.tr;!t.selection.empty&&(t.selection instanceof si||t.selection instanceof zl)&&i.deleteSelection();let{$from:o}=i.selection,s=i.steps.length,r=[],l,a,u=!1,c=!1;for(let h=o.depth;;h--)if(o.node(h).isBlock){u=o.end(h)==o.pos+(o.depth-h),c=o.start(h)==o.pos-(o.depth-h),a=Dx(o.node(h-1).contentMatchAt(o.indexAfter(h-1))),r.unshift(u&&a?{type:a}:null),l=h;break}else{if(h==1)return!1;r.unshift(null)}let d=o.pos,f=Jy(i.doc,d,r.length,r);if(f||(r[0]=a?{type:a}:null,f=Jy(i.doc,d,r.length,r)),!f)return!1;if(i.split(d,r.length,r),!u&&c&&o.node(l).type!=a){let h=i.mapping.slice(s),m=h.map(o.before(l)),g=i.doc.resolve(m);a&&o.node(l-1).canReplaceWith(g.index(),g.index()+1,a)&&i.setNodeMarkup(h.map(o.before(l)),a)}return n&&n(i.scrollIntoView()),!0}}const cV=$Me(),OMe=(e,t)=>(t&&t(e.tr.setSelection(new zl(e.doc))),!0);function PMe(e,t,n){let i=t.nodeBefore,o=t.nodeAfter,s=t.index();return!i||!o||!i.type.compatibleContent(o.type)?!1:!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(s,s+1)||!(o.isTextblock||zq(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function dV(e,t,n,i){let o=t.nodeBefore,s=t.nodeAfter,r,l,a=o.type.spec.isolating||s.type.spec.isolating;if(!a&&PMe(e,t,n))return!0;let u=!a&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(r=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(r[0]||s.type).validEnd){if(n){let h=t.pos+s.nodeSize,m=Xt.empty;for(let y=r.length-1;y>=0;y--)m=Xt.from(r[y].create(null,m));m=Xt.from(o.copy(m));let g=e.tr.step(new Pl(t.pos-1,h,t.pos,h,new hn(m,1,0),r.length,!0)),v=g.doc.resolve(h+2*r.length);v.nodeAfter&&v.nodeAfter.type==o.type&&zq(g.doc,v.pos)&&g.join(v.pos),n(g.scrollIntoView())}return!0}let c=s.type.spec.isolating||i>0&&a?null:Vi.findFrom(t,1),d=c&&c.$from.blockRange(c.$to),f=d&&fx(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(u&&R1(s,"start",!0)&&R1(o,"end")){let h=o,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let g=s,v=1;for(;!g.isTextblock;g=g.firstChild)v++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let y=Xt.empty;for(let w=m.length-1;w>=0;w--)y=Xt.from(m[w].copy(y));let b=e.tr.step(new Pl(t.pos-m.length,t.pos+s.nodeSize,t.pos+v,t.pos+s.nodeSize-v,new hn(y,m.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function fV(e){return function(t,n){let i=t.selection,o=e<0?i.$from:i.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(t.tr.setSelection(si.create(t.doc,e<0?o.start(s):o.end(s)))),!0):!1}}const hV=fV(-1),pV=fV(1);function Fx(...e){return function(t,n,i){for(let o=0;o"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function VMe(e,t){const n=document.createElement("span");n.className="wm-pill",n.dataset.workMode=e.mode;const i=document.createElement("span");i.className="wm-icon",i.setAttribute("aria-hidden","true"),i.innerHTML=Kr(e.mode==="goal"?"target":"file-edit","sm");const o=document.createElement("span");o.textContent=e.label;const s=document.createElement("button");return s.type="button",s.className="wm-x",s.setAttribute("aria-label",e.dismissLabel),s.title=e.dismissLabel,s.innerHTML=Kr("close","sm"),s.addEventListener("mousedown",r=>r.preventDefault()),s.addEventListener("click",()=>t()),n.append(i,o,s),n}function KMe(e){const t=document.createElement("span");return t.className="wm-placeholder",t.setAttribute("aria-hidden","true"),t.innerHTML=pse(e),t}function ZMe(e){return e.childCount===1&&e.firstChild.content.size===0}function GMe(e,t,n){const i=[];if(t.pill){const o=t.pill;i.push(Ar.widget(1,()=>VMe(o,n),{side:-1,key:`workmode-pill-${o.mode}-${o.label}-${o.dismissLabel}`,ignoreSelection:!0,stopEvent:()=>!0}))}return t.placeholder&&ZMe(e)&&i.push(Ar.widget(1,()=>KMe(t.placeholder),{side:0,key:`composer-placeholder-${t.placeholder}`,ignoreSelection:!0})),i.length>0?Zo.create(e,i):null}function E4(){return Kr("attachment","sm")}function $1(e){return e==="image"?Kr("image","sm"):e==="video"?Kr("video","sm"):E4()}function QMe(e){const t=document.createElement("span");t.className=`attachment-pill attachment-${e.kind}`,t.dataset.attachmentId=e.attId,t.dataset.attachmentKind=e.kind,t.dataset.attachmentName=e.name,(e.kind==="image"||e.kind==="video")&&(t.tabIndex=0,t.setAttribute("aria-haspopup","true"),t.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),o.stopPropagation())}));const n=document.createElement("span");n.className="attachment-pill-icon",n.setAttribute("aria-hidden","true"),n.innerHTML=$1(e.kind),t.append(n);const i=document.createElement("span");return i.className="attachment-pill-name",i.textContent=Su(e.name),t.append(i),t}function gV(){return Kr("quote","sm")}function YMe(e){const t=document.createElement("span");t.className="quote-pill",t.dataset.quoteText=e.text,e.source!==void 0&&e.source.length>0&&(t.dataset.quoteSource=e.source),t.setAttribute("aria-label",e.comment!==void 0&&e.comment.length>0?`${e.text} -${e.comment}`:e.text);const n=document.createElement("span");n.className="quote-pill-icon",n.setAttribute("aria-hidden","true"),n.innerHTML=gV();const i=document.createElement("span");if(i.className="quote-pill-name",i.textContent=N1(e.text),t.append(n,i),e.comment!==void 0&&e.comment.length>0){t.dataset.quoteComment=e.comment;const o=document.createElement("span");o.className="quote-pill-comment",o.textContent=N1(e.comment),t.append(o)}return t}let AA=-1,xA=-1,uy=-1,u5=-1,vV=!1;function BF(e){const t=uy>=0;AA=uy,xA=u5,uy=e.clientX,u5=e.clientY,t&&(uy!==AA||u5!==xA)&&(vV=!0)}function JMe(e){return vV?e.clientX===AA&&e.clientY===xA:!0}let Up=null,c5=null;function XMe(e){const t={};return c5=t,Up=e,()=>{c5===t&&(c5=null,Up=null)}}function Nv(e,t){let n;return()=>{if(n===void 0){const i=getComputedStyle(document.documentElement).getPropertyValue(e).trim(),o=parseFloat(i);n=Number.isFinite(o)?o:t}return n}}const eIe=Nv("--space-1-5",6),tIe=Nv("--p-mention-tip-vmargin",12),nIe=Nv("--duration-tooltip",150),iIe=Nv("--duration-fast",120),yV=Nv("--duration-flash",1e3),oIe=3e4;function kV(e){const t=document.createElement("div");t.className="mention-tip-path-text";const n=e.split(/([/\\])/);let i=n.length-1;for(;i>0&&(n[i]===""||n[i]==="/"||n[i]==="\\");)i--;for(let o=0;o{o.preventDefault(),o.stopPropagation(),(async()=>await Es(e)&&(n.innerHTML=Kr("check","sm"),window.setTimeout(()=>{n.innerHTML=i},yV())))()}),n}function bV(e,t){return e!==null&&t!==null&&typeof Node<"u"&&t instanceof Node&&e.contains(t)}function sIe(e,t={}){const n=document.createElement("div");return n.className="mention-tip-path",n.append(kV(e)),n.append(L4(e,t.copyLabel)),n}function wV(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function rIe(e,t={}){const n=document.createElement("div");n.className="mention-tip-path";const i=document.createElement("span");if(i.className="mention-tip-att-icon",i.setAttribute("aria-hidden","true"),i.innerHTML=E4(),n.append(i),e.path)n.append(kV(e.path));else{const r=document.createElement("div");r.className="mention-tip-path-text";const l=document.createElement("span");if(l.className="mention-tip-base",l.textContent=e.name,r.append(l),e.size!==void 0){const a=document.createElement("span");a.className="mention-tip-att-size",a.textContent=` · ${wV(e.size)}`,r.append(a)}n.append(r)}if(n.append(L4(e.path??e.name,t.copyLabel)),e.error===void 0)return n;const o=document.createElement("div");o.append(n);const s=document.createElement("div");return s.className="mention-tip-att-error",s.textContent=t.errorLabel??e.error,o.append(s),o}function lIe(e){return`${(Math.min(1,Math.max(0,e))*40.84).toFixed(1)} 40.84`}function aIe(e,t={}){const n=document.createElement("div");n.className="mention-tip-media";const i=document.createElement("div");i.className="mention-tip-media-preview";const o=h=>{i.replaceChildren();const m=document.createElement("span");if(m.className="mention-tip-media-placeholder",m.setAttribute("aria-hidden","true"),m.innerHTML=$1(e.kind),i.append(m),h!=="icon"){const g=document.createElement("div");g.className="mention-tip-media-hint",g.textContent=t.stateLabel?.(h)??h,i.append(g)}},s=h=>{if(i.replaceChildren(),e.kind==="video"){const g=document.createElement("video");g.className="mention-tip-media-el",g.src=h,g.muted=!0,g.controls=!0,g.playsInline=!0,g.preload="metadata",g.addEventListener("error",()=>o("unavailable"),{once:!0}),i.append(g);return}const m=document.createElement("img");m.className="mention-tip-media-el",m.src=h,m.alt="",m.addEventListener("error",()=>o("unavailable"),{once:!0}),i.append(m)};o("icon"),n.append(i);const r=document.createElement("div");r.className="mention-tip-media-meta";const l=document.createElement("span");l.className="mention-tip-att-icon",l.setAttribute("aria-hidden","true"),l.innerHTML=$1(e.kind),r.append(l);const a=document.createElement("span");if(a.className="mention-tip-media-name",a.textContent=Su(e.name),r.append(a),e.size!==void 0){const h=document.createElement("span");h.className="mention-tip-att-size",h.textContent=` · ${wV(e.size)}`,r.append(h)}if(n.append(r),e.error!==void 0){const h=document.createElement("div");h.className="mention-tip-media-error",h.textContent=t.errorLabel??e.error,n.append(h)}const u=document.createElement("div");u.className="mention-tip-media-foot";const c=document.createElement("span");c.className="mention-tip-media-state",u.append(c);const d=h=>{if(c.replaceChildren(),c.classList.toggle("is-danger",h.kind==="failed"),h.kind==="uploading"&&h.progress!==void 0){const v=document.createElement("span");v.className="mention-tip-media-ring",v.setAttribute("aria-hidden","true"),v.innerHTML=``,c.append(v)}else if(h.kind==="uploading"){const v=document.createElement("span");v.className="mention-tip-media-spin",v.setAttribute("aria-hidden","true"),c.append(v)}const m=document.createElement("span"),g=t.uploadStateLabel?.(h.kind)??h.kind;m.textContent=h.kind==="uploading"&&h.progress!==void 0?`${g} ${Math.round(h.progress*100)}%`:g,c.append(m)},f=document.createElement("div");if(f.className="mention-tip-media-actions",e.copyValue!==void 0&&e.copyValue!==""){const h=t.copyLabel??"Copy path",m=document.createElement("button");m.type="button",m.className="mention-tip-media-open",m.setAttribute("aria-label",h);const g=Kr("copy","sm");m.innerHTML=`${g}`,m.lastChild.textContent=h,m.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),(async()=>await Es(e.copyValue)&&(m.innerHTML=`${Kr("check","sm")}`,m.lastChild.textContent=h,window.setTimeout(()=>{m.innerHTML=`${g}`,m.lastChild.textContent=h},yV()),t.onCopy?.()))()}),f.append(m)}if(t.onFullscreen){const h=document.createElement("button");h.type="button",h.className="mention-tip-media-open",h.innerHTML=`${Kr("fullscreen","sm")}`,h.lastChild.textContent=t.fullscreenLabel??"View fullscreen";const m=t.onFullscreen;h.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation(),m()}),f.append(h)}return u.append(f),t.uploadState!==void 0&&d(t.uploadState),n.append(u),{root:n,setPreview:s,setPlaceholder:o,setUploadState:d}}function uIe(e,t={}){const n=document.createElement("div");n.className="mention-tip-quote-card";const i=t.source??"",o=t.comment??"";if(i.trim()!==""){const a=document.createElement("div");a.className="mention-tip-quote-source",a.textContent=i,n.append(a)}const s=document.createElement("div");s.className="mention-tip-quote-block";const r=document.createElement("div");if(r.className="mention-tip-quote-block-head",t.quoteLabel!==void 0&&t.quoteLabel!==""){const a=document.createElement("div");a.className="mention-tip-quote-block-label",a.textContent=t.quoteLabel,r.append(a)}r.append(L4(e,t.copyLabel)),s.append(r);const l=document.createElement("div");if(l.className="mention-tip-quote-text",l.textContent=e,s.append(l),n.append(s),o.trim()!==""){const a=document.createElement("div");a.className="mention-tip-quote-block";const u=document.createElement("div");if(u.className="mention-tip-quote-block-head",t.commentLabel!==void 0&&t.commentLabel!==""){const d=document.createElement("div");d.className="mention-tip-quote-block-label",d.textContent=t.commentLabel,u.append(d)}u.append(L4(o,t.copyCommentLabel??t.copyLabel)),a.append(u);const c=document.createElement("div");c.className="mention-tip-quote-comment",c.textContent=o,a.append(c),n.append(a)}return n}function cIe(e,t={}){const n=document.createElement("div");n.className="mention-tip-skill";const i=document.createElement("div");i.className="mention-tip-head";const o=document.createElement("span");if(o.className="mention-tip-name",o.textContent=e.name,i.append(o),e.path&&t.onOpen){const s=document.createElement("button");s.type="button",s.className="mention-tip-open",s.setAttribute("aria-label",t.openLabel??"Open skill file"),s.innerHTML=Kr("external-link","sm");const r=e.path,l=t.onOpen;s.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),l(r)}),i.append(s)}if(n.append(i),e.description){const s=document.createElement("div");s.className="mention-tip-desc",s.textContent=e.description,n.append(s)}return n}function cy(e){const t=e.dataset.mentionKind??(e.classList.contains("mention-skill")?"skill":e.classList.contains("mention-folder")?"folder":"file"),n=e.dataset.mentionName??e.querySelector(".mention-pill-name")?.textContent??"";return{kind:t,name:n,path:e.dataset.mentionPath??""}}function dy(e){const t=e.dataset.attachmentKind,n=t==="folder"||t==="image"||t==="video"?t:"file",i=e.dataset.attachmentName??e.querySelector(".attachment-pill-name")?.textContent??"",o=e.dataset.attachmentSize,s=o===void 0||o===""?void 0:Number(o);return{attId:e.dataset.attachmentId??"",kind:n,name:i,size:s!==void 0&&Number.isFinite(s)?s:void 0}}function RF(e){if(e!==null)return e.error!==void 0?{kind:"failed"}:e.uploading===!0?{kind:"uploading",progress:e.uploadProgress}:{kind:"uploaded"}}function dIe(e){let t=null,n=null,i=null,o=null,s=null,r,l,a;const u=new ResizeObserver(()=>{i&&t?.classList.contains("positioned")&&T(i)});let c=null,d,f=null;const h=new Map,m=new Map;function g(W){const Q=h.get(W);return Q!==void 0&&Date.now()-Qv(ue,ae)),fe=`${ge}|${ue}`;if(g(fe))return;s=fe;let G=m.get(fe);G===void 0&&(G=(async()=>{try{const ae=await e.probePath?.(ue,Q);return(e.probeScope?.()??"")!==ge?!1:(ae===!1?se(!0):(h.set(fe,Date.now()),se(!1)),!0)}finally{m.delete(fe)}})(),m.set(fe,G)),G.then(ae=>{ae&&s===fe&&t?.querySelector(".mention-tip-spinner")?.remove()})}function w(W){e.skillsLoaded?.()!==!1&&(W.tabIndex=-1,W.removeAttribute("role"),W.hasAttribute("href")&&(W.dataset.mentionHref=W.getAttribute("href")??"",W.removeAttribute("href"))),W.classList.add("mention-inert")}function C(W){if(c?.mintedUrl!=null&&URL.revokeObjectURL(c.mintedUrl),c=null,W.classList.contains("quote-pill"))return uIe(W.dataset.quoteText??"",{source:W.dataset.quoteSource,comment:W.dataset.quoteComment,copyLabel:e.copyQuoteLabel?.(),copyCommentLabel:e.copyCommentLabel?.(),quoteLabel:e.quoteBlockLabel?.(),commentLabel:e.commentBlockLabel?.()});if(W.classList.contains("attachment-pill")){const te=dy(W),ge=W.closest(".ProseMirror")!==null?Up?.(te.attId)??null:null;if(te.kind==="image"||te.kind==="video"){const ue=te.kind,se=ge?.previewUrl??W.dataset.attachmentUrl??"",fe=ge?.fileId??(W.dataset.attachmentFileId||void 0),G=ge?.sessionId??(W.dataset.attachmentSessionId||void 0),ae=e.openAttachment!==void 0&&(se!==""||fe!==void 0),K=RF(ge);d=ge;const re=aIe({kind:ue,name:ge?.name??te.name,size:ge?.size??te.size,error:ge?.error,copyValue:ge?.path??te.name},{uploadState:K,uploadStateLabel:e.mediaUploadStateLabel,copyLabel:e.copyPathLabel?.(),fullscreenLabel:e.mediaFullscreenLabel?.(),errorLabel:ge?.error===void 0?void 0:e.attachmentErrorLabel?.(ge.error)??ge.error,stateLabel:e.mediaPreviewStateLabel,onFullscreen:ae?()=>{S(),e.openAttachment?.({url:se,fileId:fe,name:ge?.name??te.name,mediaType:W.dataset.attachmentMediaType||void 0,kind:ue,sessionId:G})}:void 0}),be={setPreview:re.setPreview,setPlaceholder:re.setPlaceholder,setUploadState:re.setUploadState,mintedUrl:null};return c=be,ge?.previewUrl!==void 0?be.setPreview(ge.previewUrl):ge?.uploading===!0?be.setPlaceholder("uploading"):fe!==void 0&&e.resolveAttachmentPreviewUrl?(be.setPlaceholder("loading"),e.resolveAttachmentPreviewUrl({fileId:fe,sessionId:G,kind:ue}).then(ke=>{if(c!==be){ke!==null&&URL.revokeObjectURL(ke);return}if(ke===null){be.setPlaceholder("unavailable");return}be.mintedUrl=ke,be.setPreview(ke)})):be.setPlaceholder("unavailable"),re.root}return rIe({name:ge?.name??te.name,path:ge?.path,size:ge?.size??te.size,error:ge?.error},{copyLabel:e.copyPathLabel?.(),errorLabel:ge?.error===void 0?void 0:e.attachmentErrorLabel?.(ge.error)??ge.error})}const Q=cy(W);if(Q.kind==="skill"){const te=e.resolveSkill?.(Q.name);return!te?.path||!e.openPath?w(W):W.classList.contains("mention-inert")&&!W.closest(".q-body")&&(W.tabIndex=0,W.setAttribute("role","button"),W.dataset.mentionHref!==void 0&&(W.setAttribute("href",W.dataset.mentionHref),delete W.dataset.mentionHref),W.classList.remove("mention-inert")),cIe(te??{name:Q.name,description:""},{openLabel:e.openSkillLabel?.(),onOpen:te?.path&&e.openPath?X=>{S(),e.openPath?.({path:X})}:void 0})}return sIe(Q.path!==""?Q.path:Q.name,{copyLabel:e.copyPathLabel?.()})}function T(W){if(!t)return;const Q=W.getBoundingClientRect(),te=t.offsetWidth,X=t.offsetHeight,ge=eIe(),ue=tIe();let se=Q.top-ge-X,fe="top";sewindow.clearTimeout(l)),t.addEventListener("mouseleave",()=>x()),t.addEventListener("focusin",()=>window.clearTimeout(l)),t.addEventListener("focusout",te=>{const X=te.relatedTarget;X instanceof Node&&(t?.contains(X)||i?.contains(X))||S()}),document.body.append(t),n=document.createElement("span"),n.className="mention-tip-caret",n.setAttribute("aria-hidden","true")),u.observe(t),i?.removeAttribute("aria-describedby"),i=W,i.setAttribute("aria-describedby",t.id),s=null;let Q=null;if(W.classList.contains("attachment-pill")){o=null;const te=dy(W),X=W.closest(".ProseMirror")!==null,ge=X?Up?.(te.attId)??null:null;ge===null?Up&&X&&y(te.attId,!0):(y(te.attId,!1),ge.path&&(te.kind==="file"||te.kind==="folder")&&(Q={path:ge.path,kind:te.kind,strike:ue=>y(te.attId,ue)}))}else if(!W.classList.contains("quote-pill")){const te=cy(W);o=te.kind!=="skill"&&te.path!==""?te.path:null,o!==null&&(Q={path:o,kind:te.kind==="folder"?"folder":"file",actionPath:W.dataset.mentionActionPath})}if(N(C(W)),t.classList.toggle("mention-tip--media",t.querySelector(".mention-tip-media")!==null),t.classList.remove("positioned"),T(W),t.classList.add("positioned"),t.removeAttribute("inert"),Q!==null&&e.probePath){const{path:te,kind:X,actionPath:ge,strike:ue}=Q,se=`${e.probeScope?.()??""}|${ge??te}`;if(!g(se)){const fe=document.createElement("span");fe.className="mention-tip-spinner",fe.setAttribute("aria-hidden","true"),(t.querySelector(".mention-tip-path-text")??t).append(fe),b(te,X,ge,ue)}}a??=new MutationObserver(()=>{i&&!i.isConnected&&S()}),a.disconnect(),a.observe(document.body,{childList:!0,subtree:!0})}function S(){window.clearTimeout(r),window.clearTimeout(l),i?.removeAttribute("aria-describedby"),i=null,o=null,s=null,d=void 0,c?.mintedUrl!=null&&URL.revokeObjectURL(c.mintedUrl),c=null,f=null,a?.disconnect(),t&&u.unobserve(t),t?.classList.remove("positioned"),t?.setAttribute("inert","")}function _(W){window.clearTimeout(r),window.clearTimeout(l);const Q=t?.classList.contains("positioned")?0:nIe();r=window.setTimeout(()=>{W.isConnected&&I(W)},Q)}function x(){window.clearTimeout(r),window.clearTimeout(l),l=window.setTimeout(S,iIe())}function E(W){return W instanceof Element?W.closest(".mention-pill, .attachment-pill, .quote-pill"):null}function M(W){if(JMe(W))return;const Q=E(W.target);if(Q!==f&&(f=Q,!!Q)){if(Q===i){window.clearTimeout(l);return}_(Q)}}function R(W){const Q=E(W.target);if(!Q)return;const te=W.relatedTarget;te instanceof Element&&(Q.contains(te)||t?.contains(te))||(f=null,x())}function q(W){if(W.key==="Enter"||W.key===" "){const Q=E(W.target);if(Q&&(B(Q,W)||P(Q,W)))return}if(W.key==="Escape"){t?.classList.contains("positioned")&&(i&&W.target instanceof Node&&t.contains(W.target)&&i.focus(),S(),W.preventDefault(),W.stopImmediatePropagation());return}if(W.key==="Tab"){if(t?.classList.contains("positioned")&&W.target instanceof Node&&t.contains(W.target)){const te=[...t.querySelectorAll("button")],X=te[0],ge=te[te.length-1];(!W.shiftKey&&W.target===ge||W.shiftKey&&W.target===X)&&(W.preventDefault(),i?.focus(),S());return}if(W.shiftKey)return;if(E(W.target)===i&&t?.classList.contains("positioned")){const te=t.querySelector("button");te&&(W.preventDefault(),te.focus())}return}t&&W.target instanceof Node&&t.contains(W.target)||t?.contains(document.activeElement)||S()}function z(W){bV(t,W?.target??null)||S()}function O(W){t&&W.target instanceof Node&&t.contains(W.target)||S()}function B(W,Q){if(W.closest(".ProseMirror")||W.closest(".q-body")||cy(W).kind!=="skill")return!1;const te=e.resolveSkill?.(cy(W).name);return!te?.path||!e.openPath?(w(W),!1):(Q.preventDefault(),Q.stopPropagation(),S(),e.openPath({path:te.path}),!0)}function P(W,Q){if(!W.classList.contains("attachment-pill")||W.closest(".ProseMirror")||W.closest(".q-body"))return!1;const te=W.dataset.attachmentUrl??"";return te===""||!e.openAttachment?!1:(Q.preventDefault(),Q.stopPropagation(),S(),e.openAttachment({url:te,fileId:W.dataset.attachmentFileId||void 0,name:dy(W).name,mediaType:W.dataset.attachmentMediaType||void 0,kind:W.dataset.attachmentKind||void 0,sessionId:W.dataset.attachmentSessionId||void 0}),!0)}function H(W){const Q=E(W.target);if(Q){if(Q===i){window.clearTimeout(l);return}_(Q)}}function j(W){if(!E(W.target))return;const te=W.relatedTarget;te instanceof Node&&t?.contains(te)||x()}function Z(W){const Q=E(W.target);Q&&(B(Q,W)||P(Q,W))}document.addEventListener("pointermove",BF,{capture:!0,passive:!0}),document.addEventListener("pointermove",M,{passive:!0}),document.addEventListener("mouseout",R),document.addEventListener("focusin",H),document.addEventListener("focusout",j),document.addEventListener("keydown",q,!0),document.addEventListener("scroll",z,!0),document.addEventListener("pointerdown",O),document.addEventListener("click",Z,!0),window.addEventListener("resize",z);const ie=kIe(()=>{if(c===null||i===null||!t?.classList.contains("positioned")||!i.classList.contains("attachment-pill")||!i.closest(".ProseMirror"))return;const W=dy(i),Q=Up?.(W.attId)??null,te=d??null;if((Q?.error??null)!==(te?.error??null)||(Q?.previewUrl??null)!==(te?.previewUrl??null)||Q===null!=(te===null)){N(C(i)),T(i);return}const ge=RF(Q);ge!==void 0&&(d=Q,c.setUploadState(ge))});return()=>{ie(),u.disconnect(),S(),t?.remove(),t=null,n=null,document.removeEventListener("pointermove",BF,{capture:!0}),document.removeEventListener("pointermove",M),document.removeEventListener("mouseout",R),document.removeEventListener("focusin",H),document.removeEventListener("focusout",j),document.removeEventListener("keydown",q,!0),document.removeEventListener("scroll",z,!0),document.removeEventListener("pointerdown",O),document.removeEventListener("click",Z,!0),window.removeEventListener("resize",z)}}const fIe=50,sd=new Map;let CV;function hIe(e){CV=e}function AV(e,t){for(sd.delete(e),sd.set(e,t);sd.size>fIe;){const n=sd.keys().next().value;if(n===void 0)break;const i=sd.get(n);sd.delete(n),i!==void 0&&CV?.(i)}}function xV(e){const t=sd.get(e);return t!==void 0&&sd.delete(e),t}function pIe(e){const t=e.clipboardData;return t?t.files.length>0?!0:Array.from(t.items).some(n=>n.kind==="file"):!1}const mIe=new tm({props:{decorations(e){const t=[];return e.doc.forEach((n,i)=>{const o=n.lastChild;if(o&&(o.type===oi.nodes.mention||o.type===oi.nodes.attachment||o.type===oi.nodes.quote)){const s=i+n.nodeSize-1;t.push(Ar.widget(s,()=>{const r=document.createElement("span");return r.className="mention-caret-anchor",r.textContent="​",r},{side:1,key:`mention-caret-anchor-${s}`}))}}),Zo.create(e.doc,t)}}}),gIe=new tm({props:{decorations(e){const t=xs.getState(e);if(!t)return null;const n=[];return e.doc.descendants((i,o)=>{if(i.type!==oi.nodes.attachment)return!0;const s=t.get(i.attrs.attId);return s===void 0?(n.push(Ar.node(o,o+i.nodeSize,{class:"attachment-missing"})),!1):(s.error!==void 0&&n.push(Ar.node(o,o+i.nodeSize,{class:"attachment-error"})),!1)}),n.length===0?null:Zo.create(e.doc,n)}}}),vIe=new WeakMap,t9=new Map;function d5(e,t){const n={};return t9.set(e,{api:t,token:n}),()=>{t9.get(e)?.token===n&&t9.delete(e)}}function SV(e){return t9.get(e)?.api}const SA=new Set;function yIe(){for(const e of SA)e()}function kIe(e){return SA.add(e),()=>{SA.delete(e)}}function bIe(e,t,n,i){const o=SV(e);if(o){o.updateAttachmentEntry(t,n);return}const s=xV(e);if(s){const a=s.apply(s.tr.setMeta(xs,{type:"patch",attId:t,patch:n}));AV(e,a),i.saveEntries([...xs.getState(a)?.values()??[]]);return}const r=i.loadEntries(),l=r.findIndex(a=>a.attId===t);l!==-1&&(r[l]={...r[l],...n},i.saveEntries(r))}class wIe{dom;constructor(t){this.dom=Uxe(t.attrs)}}class CIe{dom;constructor(t){this.dom=QMe(t.attrs)}}class AIe{dom;constructor(t){this.dom=YMe(t.attrs)}}const xIe=new Eu({...Eu.nodesFromSchema(oi),quote:e=>{const t=e.attrs,n={class:"quote-pill","data-quote-text":t.text,style:"white-space: pre-wrap"};typeof t.comment=="string"&&t.comment.length>0&&(n["data-quote-comment"]=t.comment),typeof t.source=="string"&&t.source.length>0&&(n["data-quote-source"]=t.source);const i=typeof t.source=="string"&&t.source.length>0?`from: ${t.source} +`))),0,0),e.someProp("transformPasted",f=>{l=f(l,e,!0)}),l;let d=e.someProp("clipboardTextParser",f=>f(t,o,i,e));if(d)l=d;else{let f=o.marks(),{schema:h}=e.state,m=Lu.fromSchema(h);r=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let v=r.appendChild(document.createElement("p"));g&&v.appendChild(m.serializeNode(h.text(g,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),r=y_e(n),Mv&&k_e(r);let u=r&&r.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=r.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;r=f}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||Eq.fromSchema(e.state.schema)).parseSlice(r,{preserveWhitespace:!!(a||c),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!m_e.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)l=b_e(wF(l,+c[1],+c[2]),c[4]);else if(l=hn.maxOpen(g_e(l.content,o),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d{l=d(l,e,a)}),l}const m_e=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function g_e(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),s,r=[];if(e.forEach(l=>{if(!r)return;let a=o.findWrapping(l.type),u;if(!a)return r=null;if(u=r.length&&s.length&&jU(a,s,l,r[r.length-1],0))r[r.length-1]=u;else{r.length&&(r[r.length-1]=HU(r[r.length-1],s.length));let c=zU(l,a);r.push(c),o=o.matchType(c.type),s=a}}),r)return Xt.from(r)}return e}function zU(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,Xt.from(e));return e}function jU(e,t,n,i,o){if(o1&&(s=0),o=n&&(l=t<0?r.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(r.contentMatchAt(r.childCount).fillBefore(Xt.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,r.copy(l))}function wF(e,t,n){return tn})),e5.createHTML(e)):e}function y_e(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=qU(),i=n.body,o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&WU[o[1].toLowerCase()])&&(e=s.map(r=>"<"+r+">").join("")+e+s.map(r=>"").reverse().join("")),i.innerHTML=v_e(e),s)for(let r=0;r=0;l-=2){let a=n.nodes[i[l]];if(!a||a.hasRequiredAttrs())break;o=Xt.from(a.create(i[l+1],o)),s++,r++}return new hn(o,s,r)}const Zr={},Gr={},w_e={touchstart:!0,touchmove:!0};class C_e{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function A_e(e){for(let t in Zr){let n=Zr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=i=>{S_e(e,i)&&!Mx(e,i)&&(e.editable||!(i.type in Gr))&&n(e,i)},w_e[t]?{passive:!0}:void 0)}Sr&&e.dom.addEventListener("input",()=>null),bA(e)}function fc(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function x_e(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function bA(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=i=>Mx(e,i))})}function Mx(e,t){return e.someProp("handleDOMEvents",n=>{let i=n[t.type];return i?i(e,t)||t.defaultPrevented:!1})}function S_e(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function __e(e,t){!Mx(e,t)&&Zr[t.type]&&(e.editable||!(t.type in Gr))&&Zr[t.type](e,t)}Gr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!ZU(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(dc&&lr&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),B1&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();e.input.lastIOSEnter=i,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==i&&(e.someProp("handleKeyDown",o=>o(e,Qf(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",i=>i(e,n))||p_e(e,n)?n.preventDefault():fc(e,"key")};Gr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Gr.keypress=(e,t)=>{let n=t;if(ZU(e)||!n.charCode||n.ctrlKey&&!n.altKey||ca&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let i=e.state.selection;if(!(i instanceof si)||!i.$from.sameParent(i.$to)){let o=String.fromCharCode(n.charCode),s=()=>e.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",r=>r(e,i.$from.pos,i.$to.pos,o,s))&&e.dispatch(s()),n.preventDefault()}};function Tv(e){return{left:e.clientX,top:e.clientY}}function M_e(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}function Ix(e,t,n,i,o){if(i==-1)return!1;let s=e.state.doc.resolve(i);for(let r=s.depth+1;r>0;r--)if(e.someProp(t,l=>r>s.depth?l(e,n,s.nodeAfter,s.before(r),o,!0):l(e,n,s.node(r),s.before(r),o,!1)))return!0;return!1}function Ev(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function I_e(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return i&&i.isAtom&&Kn.isSelectable(i)?(Ev(e,new Kn(n)),!0):!1}function T_e(e,t){if(t==-1)return!1;let n=e.state.selection,i,o;n instanceof Kn&&(i=n.node);let s=e.state.doc.resolve(t);for(let r=s.depth+1;r>0;r--){let l=r>s.depth?s.nodeAfter:s.node(r);if(Kn.isSelectable(l)){i&&n.$from.depth>0&&r>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(r);break}}return o!=null?(Ev(e,Kn.create(e.state.doc,o)),!0):!1}function E_e(e,t,n,i,o){return Ix(e,"handleClickOn",t,n,i)||e.someProp("handleClick",s=>s(e,t,i))||(o?T_e(e,n):I_e(e,n))}function L_e(e,t,n,i){return Ix(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",o=>o(e,t,i))}function N_e(e,t,n,i){return Ix(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",o=>o(e,t,i))||D_e(e,n,i)}function D_e(e,t,n){if(n.button!=0)return!1;let i=UU(e,t,!0),o=e.state.doc;return i?(Ev(e,i),i instanceof si&&o.eq(e.state.doc)&&(e.input.mouseDown=new B_e(e,i)),!0):!1}function UU(e,t,n){let i=e.state.doc;if(t==-1)return i.inlineContent?si.create(i,0,i.content.size):null;let o=i.resolve(t);for(let s=o.depth+1;s>0;s--){let r=s>o.depth?o.nodeAfter:o.node(s),l=o.before(s);if(r.inlineContent)return si.create(i,l+1,l+1+r.content.size);if(n&&Kn.isSelectable(r))return Kn.create(i,l)}return null}function Tx(e){return x4(e)}const VU=ca?"metaKey":"ctrlKey";Zr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=Tx(e),o=Date.now(),s="singleClick";o-e.input.lastClick.time<500&&M_e(n,e.input.lastClick)&&!n[VU]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?s="doubleClick":e.input.lastClick.type=="doubleClick"&&(s="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let r=e.posAtCoords(Tv(n));r&&(s=="singleClick"?e.input.mouseDown=new F_e(e,r,n,!!i):(s=="doubleClick"?L_e:N_e)(e,r.pos,r.inside,n)?n.preventDefault():fc(e,"pointer"))};class KU{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class F_e extends KU{constructor(t,n,i,o){super(t),this.pos=n,this.event=i,this.flushed=o,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!i[VU],this.allowDefault=i.shiftKey;let s,r;if(n.inside>-1)s=t.state.doc.nodeAt(n.inside),r=n.inside;else{let c=t.state.doc.resolve(n.pos);s=c.parent,r=c.depth?c.before():0}const l=o?null:i.target,a=l?t.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:u}=t.state;i.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof Kn&&u.from<=r&&u.to>r)&&(this.mightDrag={node:s,pos:r,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ka&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),fc(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||yc(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Tv(t))),this.updateAllowDefault(t),this.allowDefault||!n?fc(this.view,"pointer"):E_e(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Sr&&this.mightDrag&&!this.mightDrag.node.isAtom||lr&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ev(this.view,Vi.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):fc(this.view,"pointer")}move(t){this.updateAllowDefault(t),fc(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class B_e extends KU{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),fc(this.view,"pointer");let n=this.view.posAtCoords(Tv(t)),i=n&&UU(this.view,n.inside,!1);if(!i)return;let{doc:o}=this.view.state,s=this.startSelection,[r,l]=i.from{e.input.lastTouch=Date.now(),Tx(e),fc(e,"pointer")};Zr.touchmove=e=>{e.input.lastTouch=Date.now(),fc(e,"pointer")};Zr.contextmenu=e=>Tx(e);function ZU(e,t){return e.composing?!0:Sr&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const R_e=dc?5e3:-1;Gr.compositionstart=Gr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof si&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||lr&&AU&&O_e(e)))e.markCursor=e.state.storedMarks||n.marks(),x4(e,!0),e.markCursor=null;else if(x4(e,!t.selection.empty),ka&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=e.domSelectionRange();for(let o=i.focusNode,s=i.focusOffset;o&&o.nodeType==1&&s!=0;){let r=s<0?o.lastChild:o.childNodes[s-1];if(!r)break;if(r.nodeType==3){let l=e.domSelection();l&&l.collapse(r,r.nodeValue.length);break}else o=r,s=-1}}e.input.composing=!0}GU(e,R_e)};function O_e(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return i.nodeType==1&&i.contentEditable=="false"}Gr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,GU(e,20))};function GU(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>x4(e),t))}function QU(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function $_e(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=TSe(t.focusNode,t.focusOffset),i=ESe(t.focusNode,t.focusOffset);if(n&&i&&n!=i){let o=i.pmViewDesc,s=e.domObserver.lastChangedTextNode;if(n==s||i==s)return s;if(!o||!o.isText(i.nodeValue))return i;if(e.input.compositionNode==i){let r=n.pmViewDesc;if(!(!r||!r.isText(n.nodeValue)))return i}}return n||i}function x4(e,t=!1){if(!(dc&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),QU(e),t||e.docView&&e.docView.dirty){let n=xx(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function P_e(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const U0=vl&&Md<15||B1&&FSe<604;Zr.copy=Gr.cut=(e,t)=>{let n=t,i=e.state.selection,o=n.type=="cut";if(i.empty)return;let s=U0?null:n.clipboardData,r=i.content(),{dom:l,text:a}=_x(e,r);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):P_e(e,l),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function z_e(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function j_e(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?V0(e,i.value,null,o,t):V0(e,i.textContent,i.innerHTML,o,t)},50)}function V0(e,t,n,i,o){let s=PU(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",a=>a(e,o,s||hn.empty)))return!0;if(!s)return!1;let r=z_e(s),l=r?e.state.tr.replaceSelectionWith(r,i):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function YU(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Gr.paste=(e,t)=>{let n=t;if(e.composing&&!dc)return;let i=U0?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;i&&V0(e,YU(i),i.getData("text/html"),o,n)?n.preventDefault():j_e(e,n)};class JU{constructor(t,n,i){this.slice=t,this.move=n,this.node=i}}const H_e=ca?"altKey":"ctrlKey";function XU(e,t){let n;return e.someProp("dragCopies",i=>{n=n||i(t)}),n!=null?!n:!t[H_e]}Zr.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let o=e.state.selection,s=o.empty?null:e.posAtCoords(Tv(n)),r;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Kn?o.to-1:o.to))){if(i&&i.mightDrag)r=Kn.create(e.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(r=Kn.create(e.state.doc,d.posBefore))}}let l=(r||e.state.selection).content(),{dom:a,text:u,slice:c}=_x(e,l);(!n.dataTransfer.files.length||!lr||CU>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(U0?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",U0||n.dataTransfer.setData("text/plain",u),e.dragging=new JU(c,XU(e,n),r)};Zr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Gr.dragover=Gr.dragenter=(e,t)=>t.preventDefault();Gr.drop=(e,t)=>{try{W_e(e,t,e.dragging)}finally{e.dragging=null}};function W_e(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(Tv(t));if(!i)return;let o=e.state.doc.resolve(i.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e,!1)}):s=PU(e,YU(t.dataTransfer),U0?null:t.dataTransfer.getData("text/html"),!1,o);let r=!!(n&&XU(e,t));if(e.someProp("handleDrop",h=>h(e,t,s||hn.empty,r))){t.preventDefault();return}if(!s)return;t.preventDefault();let l=s?bxe(e.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let a=e.state.tr;if(r){let{node:h}=n;h?h.replace(a):a.deleteSelection()}let u=a.mapping.map(l),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=a.doc;if(c?a.replaceRangeWith(u,u,s.content.firstChild):a.replaceRange(u,u,s),a.doc.eq(d))return;let f=a.doc.resolve(u);if(c&&Kn.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new Kn(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,g,v,y)=>h=y),a.setSelection(Sx(e,f,a.doc.resolve(h)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}Zr.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&yc(e)},20))};Zr.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Zr.beforeinput=(e,t)=>{if(dc&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:i}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=i||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",s=>s(e,Qf(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Gr)Zr[e]=Gr[e];function K0(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class S4{constructor(t,n){this.toDOM=t,this.spec=n||Ch,this.side=this.spec.side||0}map(t,n,i,o){let{pos:s,deleted:r}=t.mapResult(n.from+o,this.side<0?-1:1);return r?null:new Pr(s-i,s-i,this)}valid(){return!0}eq(t){return this==t||t instanceof S4&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&K0(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ed{constructor(t,n){this.attrs=t,this.spec=n||Ch}map(t,n,i,o){let s=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-i,r=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-i;return s>=r?null:new Pr(s,r,this)}valid(t,n){return n.from=t&&(!s||s(l.spec))&&i.push(l.copy(l.from+o,l.to+o))}for(let r=0;rt){let l=this.children[r]+1;this.children[r+2].findInner(t-l,n-l,i,o+l,s)}}map(t,n,i){return this==gr||t.maps.length==0?this:this.mapInner(t,n,0,0,i||Ch)}mapInner(t,n,i,o,s){let r;for(let l=0;l{let u=a+i,c;if(c=tV(n,l,u)){for(o||(o=this.children.slice());sl&&d.to=t){this.children[l]==t&&(i=this.children[l+2]);break}let s=t+1,r=s+n.content.size;for(let l=0;ls&&a.type instanceof Ed){let u=Math.max(s,a.from)-s,c=Math.min(r,a.to)-s;uo.map(t,n,Ch));return hd.from(i)}forChild(t,n){if(n.isLeaf)return Go.empty;let i=[];for(let o=0;on instanceof Go)?t:t.reduce((n,i)=>n.concat(i instanceof Go?i:i.members),[]))}}forEachSet(t){for(let n=0;n{let v=g-m-(h-f);for(let y=0;yb+c-d)continue;let w=l[y]+c-d;h>=w?l[y+1]=f<=w?-2:-1:f>=c&&v&&(l[y]+=v,l[y+1]+=v)}d+=v}),c=n.maps[u].map(c,-1)}let a=!1;for(let u=0;u=i.content.size){a=!0;continue}let f=n.map(e[u+1]+s,-1),h=f-o,{index:m,offset:g}=i.content.findIndex(d),v=i.maybeChild(m);if(v&&g==d&&g+v.nodeSize==h){let y=l[u+2].mapInner(n,v,c+1,e[u]+s+1,r);y!=gr?(l[u]=d,l[u+1]=h,l[u+2]=y):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=U_e(l,e,t,n,o,s,r),c=_4(u,i,0,r);t=c.local;for(let d=0;dn&&r.to{let u=tV(e,l,a+n);if(u){s=!0;let c=_4(u,l,n+a+1,i);c!=gr&&o.push(a,a+l.nodeSize,c)}});let r=eV(s?nV(e):e,-n).sort(Ah);for(let l=0;l0;)t++;e.splice(t,0,n)}function t5(e){let t=[];return e.someProp("decorations",n=>{let i=n(e.state);i&&i!=gr&&t.push(i)}),e.cursorWrapper&&t.push(Go.create(e.state.doc,[e.cursorWrapper.deco])),hd.from(t)}const V_e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},K_e=vl&&Md<=11;class Z_e{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class G_e{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Z_e,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Sr&&t.composing&&i.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),K_e&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,V_e)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(mF(this.view)){if(this.suppressingSelectionUpdates)return yc(this.view);if(vl&&Md<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Oh(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,i;for(let s=t.focusNode;s;s=F1(s))n.add(s);for(let s=t.anchorNode;s;s=F1(s))if(n.has(s)){i=s;break}let o=i&&this.view.docView.nearestDesc(i);if(o&&o.ignoreMutation({type:"selection",target:i.nodeType==3?i.parentNode:i}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let i=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&mF(t)&&!this.ignoreSelectionChange(i),s=-1,r=-1,l=!1,a=[];if(t.editable)for(let c=0;cc.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||lr&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of a)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(ka&&a.length){let c=a.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||J_e(t,d)!=h)&&f.remove()}}}let u=null;s<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(s>-1&&(t.docView.markDirty(s,r),Q_e(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,X_e(t,a)),this.handleDOMChange(s,r,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(i)||yc(t),this.currentSelection.set(i))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let i=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(i==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!i||i.ignoreMutation(t))return null;if(t.type=="childList"){for(let c=0;cs;y--){let b=o.childNodes[y-1],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){r=y;break}if(!w||w.size)break}let f=e.state.doc,h=e.someProp("domParser")||Eq.fromSchema(e.state.schema),m=f.resolve(l),g=null,v=h.parse(o,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:s,to:r,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:tMe(i),context:m});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),g={anchor:y+l,head:b+l}}return{doc:v,sel:g,from:l,to:a}}const tMe=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName=="BR"&&t.parentNode){if(Sr&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let i=document.createElement("div");return i.appendChild(document.createElement("li")),{skip:i}}else if(t.parentNode.lastChild==t||Sr&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},nMe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function iMe(e,t,n,i,o){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let I=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,S=xx(e,I);if(S&&!e.state.selection.eq(S)){if(lr&&dc&&e.input.lastKeyCode===13&&Date.now()-100x(e,Qf(13,"Enter"))))return;let _=e.state.tr.setSelection(S);I=="pointer"?_.setMeta("pointer",!0):I=="key"&&_.scrollIntoView(),s&&_.setMeta("composition",s),e.dispatch(_)}return}let r=e.state.doc.resolve(t),l=r.sharedDepth(n);t=r.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a=e.state.selection,u=eMe(e,t,n,o),c=e.state.doc,d=c.slice(u.from,u.to),f,h;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||dc)&&o.some(I=>I.nodeType==1&&!nMe.test(I.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",I=>I(e,Qf(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(i&&a instanceof si&&!a.empty&&a.$head.sameParent(a.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(u.sel){let I=_F(e,e.state.doc,u.sel);if(I&&!I.eq(e.state.selection)){let S=e.state.tr.setSelection(I);s&&S.setMeta("composition",s),e.dispatch(S)}}return}e.state.selection.frome.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?m.start=e.state.selection.from:m.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),vl&&Md<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=u.doc.resolveNoCache(m.start-u.from),v=u.doc.resolveNoCache(m.endB-u.from),y=c.resolve(m.start),b=g.sameParent(v)&&g.parent.inlineContent&&y.end()>=m.endA;if((B1&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!b&&g.posI(e,Qf(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&sMe(c,m.start,m.endA,g,v)&&e.someProp("handleKeyDown",I=>I(e,Qf(8,"Backspace")))){dc&&lr&&e.domObserver.suppressSelectionUpdates();return}lr&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),dc&&!b&&g.start()!=v.start()&&v.parentOffset==0&&g.depth==v.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,v=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(I){return I(e,Qf(13,"Enter"))})},20));let w=m.start,C=m.endA,T=I=>{let S=I||e.state.tr.replace(w,C,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let _=_F(e,S.doc,u.sel);_&&!(lr&&e.composing&&_.empty&&(m.start!=m.endB||e.input.lastChromeDeleteyc(e),20));let I=T(e.state.tr.delete(w,C)),S=c.resolve(m.start).marksAcross(c.resolve(m.endA));S&&I.ensureMarks(S),e.dispatch(I)}else if(m.endA==m.endB&&(N=oMe(g.parent.content.cut(g.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let I=T(e.state.tr);N.type=="add"?I.addMark(w,C,N.mark):I.removeMark(w,C,N.mark),e.dispatch(I)}else if(g.parent.child(g.index()).isText&&g.index()==v.index()-(v.textOffset?0:1)){let I=g.parent.textBetween(g.parentOffset,v.parentOffset),S=()=>T(e.state.tr.insertText(I,w,C));e.someProp("handleTextInput",_=>_(e,w,C,I,S))||e.dispatch(S())}else e.dispatch(T());else e.dispatch(T())}function _F(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Sx(e,t.resolve(n.anchor),t.resolve(n.head))}function oMe(e,t){let n=e.firstChild.marks,i=t.firstChild.marks,o=n,s=i,r,l,a;for(let c=0;cc.mark(l.addToSet(c.marks));else if(o.length==0&&s.length==1)l=s[0],r="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;cn||n5(r,!0,!1)0&&(t||e.indexAfter(i)==e.node(i).childCount);)i--,o++,t=!1;if(n){let s=e.node(i).maybeChild(e.indexAfter(i));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function rMe(e,t,n,i,o){let s=e.findDiffStart(t,n),r=n+e.size,l=n+t.size;if(s==null)return null;let{a,b:u}=e.findDiffEnd(t,r,l);if(o=="end"){let c=Math.max(0,s-Math.min(a,u));i-=a+c-s}if(a=a?s-i:0;s-=c,u=s+(u-a),a=s}else if(u=u?s-i:0;s-=c,a=s+(a-u),u=s}return{start:s,endA:a,endB:u}}class iV{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new C_e,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(LF),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=TF(this),IF(this),this.nodeViews=EF(this),this.docView=uF(this.state.doc,MF(this),t5(this),this.dom,this),this.domObserver=new G_e(this,(i,o,s,r)=>iMe(this,i,o,s,r)),this.domObserver.start(),A_e(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&bA(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(LF),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let i in this._props)n[i]=this._props[i];n.state=this.state;for(let i in t)n[i]=t[i];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var i;let o=this.state,s=!1,r=!1;t.storedMarks&&this.composing&&(QU(this),r=!0),this.state=t;let l=o.plugins!=t.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=EF(this);aMe(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&bA(this),this.editable=TF(this),IF(this);let a=t5(this),u=MF(this),c=o.plugins!=t.plugins&&!o.doc.eq(t.doc)?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(t.doc,u,a);(d||!t.selection.eq(o.selection))&&(r=!0);let f=c=="preserve"&&r&&this.dom.style.overflowAnchor==null&&OSe(this);if(r){this.domObserver.stop();let h=d&&(vl||lr)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&lMe(o.selection,t.selection);if(d){let g=lr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=$_e(this)),(s||!this.docView.update(t.doc,u,a,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=uF(t.doc,u,a,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let m=this.input.mouseDown;h||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&l_e(this)&&m.delaySelUpdate())?yc(this,h):(RU(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((i=this.dragging)===null||i===void 0)&&i.node&&!o.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,o),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&$Se(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Kn){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&oF(this,n.getBoundingClientRect(),t)}else oF(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&sn.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return qSe(this,t)}coordsAtPos(t,n=1){return IU(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,i=-1){let o=this.docView.posFromDOM(t,n,i);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return GSe(this,n||this.state,t)}pasteHTML(t,n){return V0(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return V0(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return _x(this,t)}destroy(){this.docView&&(x_e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],t5(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,MSe())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return __e(this,t)}domSelectionRange(){let t=this.domSelection();return t?Sr&&this.root.nodeType===11&&NSe(this.dom.ownerDocument)==this.dom&&Y_e(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}iV.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function MF(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let i in n)i=="class"?t.class+=" "+n[i]:i=="style"?t.style=(t.style?t.style+";":"")+n[i]:!t[i]&&i!="contenteditable"&&i!="nodeName"&&(t[i]=String(n[i]))}),t.translate||(t.translate="no"),[Pr.node(0,e.state.doc.content.size,t)]}function IF(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Pr.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function TF(e){return!e.someProp("editable",t=>t(e.state)===!1)}function lMe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function EF(e){let t=Object.create(null);function n(i){for(let o in i)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function aMe(e,t){let n=0,i=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)i++;return n!=i}function LF(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var M4=200,Ws=function(){};Ws.prototype.append=function(t){return t.length?(t=Ws.from(t),!this.length&&t||t.length=n?Ws.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Ws.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ws.prototype.forEach=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(t,n,i,0):this.forEachInvertedInner(t,n,i,0)};Ws.prototype.map=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var o=[];return this.forEach(function(s,r){return o.push(t(s,r))},n,i),o};Ws.from=function(t){return t instanceof Ws?t:t&&t.length?new oV(t):Ws.empty};var oV=(function(e){function t(i){e.call(this),this.values=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new t(this.values.slice(o,s))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,s,r,l){for(var a=s;a=r;a--)if(o(this.values[a],l+a)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=M4)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=M4)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Ws);Ws.empty=new oV([]);var uMe=(function(e){function t(n,i){e.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return il&&this.right.forEachInner(i,Math.max(o-l,0),Math.min(this.length,s)-l,r+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,r){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(i,o-l,Math.max(s,l)-l,r+l)===!1||s=s?this.right.slice(i-s,o-s):this.left.slice(i,s).append(this.right.slice(0,o-s))},t.prototype.leafAppend=function(i){var o=this.right.leafAppend(i);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(i){var o=this.left.leafPrepend(i);if(o)return new t(o,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t})(Ws);const cMe=500;class Pa{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let o,s;n&&(o=this.remapping(i,this.items.length),s=o.maps.length);let r=t.tr,l,a,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(i,f+1),s=o.maps.length),s--,c.push(d);return}if(o){c.push(new pu(d.map));let h=d.step.map(o.slice(s)),m;h&&r.maybeStep(h).doc&&(m=r.mapping.maps[r.mapping.maps.length-1],u.push(new pu(m,void 0,void 0,u.length+c.length))),s--,m&&o.appendMap(m,s)}else r.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(s)):d.selection,a=new Pa(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:r,selection:l}}addTransform(t,n,i,o){let s=[],r=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let c=0;cfMe&&(l=dMe(l,u),r-=u),new Pa(l.append(s),r)}remapping(t,n){let i=new j0;return this.items.forEach((o,s)=>{let r=o.mirrorOffset!=null&&s-o.mirrorOffset>=t?i.maps.length-o.mirrorOffset:void 0;i.appendMap(o.map,r)},t,n),i}addMaps(t){return this.eventCount==0?this:new Pa(this.items.append(t.map(n=>new pu(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let i=[],o=Math.max(0,this.items.length-n),s=t.mapping,r=t.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;r=Math.min(r,h);let m=s.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),v=f.selection&&f.selection.map(s.slice(a+1,h));v&&l++,i.push(new pu(m,g,v))}else i.push(new pu(m))},o);let u=[];for(let f=n;fcMe&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),i=n.maps.length,o=[],s=0;return this.items.forEach((r,l)=>{if(l>=t)o.push(r),r.selection&&s++;else if(r.step){let a=r.step.map(n.slice(i)),u=a&&a.getMap();if(i--,u&&n.appendMap(u,i),a){let c=r.selection&&r.selection.map(n.slice(i));c&&s++;let d=new pu(u.invert(),a,c),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else r.map&&i--},this.items.length,0),new Pa(Ws.from(o.reverse()),s)}}Pa.empty=new Pa(Ws.empty,0);function dMe(e,t){let n;return e.forEach((i,o)=>{if(i.selection&&t--==0)return n=o,!1}),e.slice(n)}class pu{constructor(t,n,i,o){this.map=t,this.step=n,this.selection=i,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new pu(n.getMap().invert(),n,this.selection)}}}class od{constructor(t,n,i,o,s){this.done=t,this.undone=n,this.prevRanges=i,this.prevTime=o,this.prevComposition=s}}const fMe=20;function hMe(e,t,n,i){let o=n.getMeta(xh),s;if(o)return o.historyState;n.getMeta(gMe)&&(e=new od(e.done,e.undone,null,0,-1));let r=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(r&&r.getMeta(xh))return r.getMeta(xh).redo?new od(e.done.addTransform(n,void 0,i,Xy(t)),e.undone,NF(n.mapping.maps),e.prevTime,e.prevComposition):new od(e.done,e.undone.addTransform(n,void 0,i,Xy(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(r&&r.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=e.prevTime==0||!r&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-i.newGroupDelay||!pMe(n,e.prevRanges)),u=r?i5(e.prevRanges,n.mapping):NF(n.mapping.maps);return new od(e.done.addTransform(n,a?t.selection.getBookmark():void 0,i,Xy(t)),Pa.empty,u,n.time,l??e.prevComposition)}else return(s=n.getMeta("rebased"))?new od(e.done.rebased(n,s),e.undone.rebased(n,s),i5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new od(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),i5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function pMe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((i,o)=>{for(let s=0;s=t[s]&&(n=!0)}),n}function NF(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((i,o,s,r)=>t.push(s,r));return t}function i5(e,t){if(!e)return null;let n=[];for(let i=0;i{let o=xh.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(i){let s=mMe(o,n,e);s&&i(t?s.scrollIntoView():s)}return!0}}const rV=sV(!1,!0),wA=sV(!0,!0);var Vd={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},I4={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yMe=typeof navigator<"u"&&/Mac/.test(navigator.platform),kMe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var nr=0;nr<10;nr++)Vd[48+nr]=Vd[96+nr]=String(nr);for(var nr=1;nr<=24;nr++)Vd[nr+111]="F"+nr;for(var nr=65;nr<=90;nr++)Vd[nr]=String.fromCharCode(nr+32),I4[nr]=String.fromCharCode(nr);for(var s5 in Vd)I4.hasOwnProperty(s5)||(I4[s5]=Vd[s5]);function bMe(e){var t=yMe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||kMe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?I4:Vd)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const wMe=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),CMe=typeof navigator<"u"&&/Win/.test(navigator.platform);function AMe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let i,o,s,r;for(let l=0;le.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function _Me(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const MMe=(e,t,n)=>{let i=_Me(e,n);if(!i)return!1;let o=aV(i);if(!o){let r=i.blockRange(),l=r&&dx(r);return l==null?!1:(t&&t(e.tr.lift(r,l).scrollIntoView()),!0)}let s=o.nodeBefore;if(dV(e,o,t,-1))return!0;if(i.parent.content.size==0&&(R1(s,"end")||Kn.isSelectable(s)))for(let r=i.depth;;r--){let l=fx(e.doc,i.before(r),i.after(r),hn.empty);if(l&&l.slice.size1)break}return s.isAtom&&o.depth==i.depth-1?(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1};function R1(e,t,n=!1){for(let i=e;i;i=t=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const IMe=(e,t,n)=>{let{$head:i,empty:o}=e.selection,s=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;s=aV(i)}let r=s&&s.nodeBefore;return!r||!Kn.isSelectable(r)?!1:(t&&t(e.tr.setSelection(Kn.create(e.doc,s.pos-r.nodeSize)).scrollIntoView()),!0)};function aV(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function TMe(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let i=TMe(e,n);if(!i)return!1;let o=uV(i);if(!o)return!1;let s=o.nodeAfter;if(dV(e,o,t,1))return!0;if(i.parent.content.size==0&&(R1(s,"start")||Kn.isSelectable(s))){let r=fx(e.doc,i.before(),i.after(),hn.empty);if(r&&r.slice.size{let{$head:i,empty:o}=e.selection,s=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let{$head:n,$anchor:i}=e.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(t&&t(e.tr.insertText(` +`).scrollIntoView()),!0)};function Nx(e){for(let t=0;t{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let o=n.node(-1),s=n.indexAfter(-1),r=Nx(o.contentMatchAt(s));if(!r||!o.canReplaceWith(s,s,r))return!1;if(t){let l=n.after(),a=e.tr.replaceWith(l,l,r.createAndFill());a.setSelection(Vi.near(a.doc.resolve(l),1)),t(a.scrollIntoView())}return!0},FMe=(e,t)=>{let n=e.selection,{$from:i,$to:o}=n;if(n instanceof Wl||i.parent.inlineContent||o.parent.inlineContent)return!1;let s=Nx(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let r=(!i.parentOffset&&o.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Yy(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let i=n.blockRange(),o=i&&dx(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)};function RMe(e){return(t,n)=>{if(t.selection instanceof Kn&&t.selection.node.isBlock){let{$from:h}=t.selection;return!h.parentOffset||!Yy(t.doc,h.pos)?!1:(n&&n(t.tr.split(h.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let i=t.tr;!t.selection.empty&&(t.selection instanceof si||t.selection instanceof Wl)&&i.deleteSelection();let{$from:o}=i.selection,s=i.steps.length,r=[],l,a,u=!1,c=!1;for(let h=o.depth;;h--)if(o.node(h).isBlock){u=o.end(h)==o.pos+(o.depth-h),c=o.start(h)==o.pos-(o.depth-h),a=Nx(o.node(h-1).contentMatchAt(o.indexAfter(h-1))),r.unshift(u&&a?{type:a}:null),l=h;break}else{if(h==1)return!1;r.unshift(null)}let d=o.pos,f=Yy(i.doc,d,r.length,r);if(f||(r[0]=a?{type:a}:null,f=Yy(i.doc,d,r.length,r)),!f)return!1;if(i.split(d,r.length,r),!u&&c&&o.node(l).type!=a){let h=i.mapping.slice(s),m=h.map(o.before(l)),g=i.doc.resolve(m);a&&o.node(l-1).canReplaceWith(g.index(),g.index()+1,a)&&i.setNodeMarkup(h.map(o.before(l)),a)}return n&&n(i.scrollIntoView()),!0}}const cV=RMe(),OMe=(e,t)=>(t&&t(e.tr.setSelection(new Wl(e.doc))),!0);function $Me(e,t,n){let i=t.nodeBefore,o=t.nodeAfter,s=t.index();return!i||!o||!i.type.compatibleContent(o.type)?!1:!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(s,s+1)||!(o.isTextblock||zq(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function dV(e,t,n,i){let o=t.nodeBefore,s=t.nodeAfter,r,l,a=o.type.spec.isolating||s.type.spec.isolating;if(!a&&$Me(e,t,n))return!0;let u=!a&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(r=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(r[0]||s.type).validEnd){if(n){let h=t.pos+s.nodeSize,m=Xt.empty;for(let y=r.length-1;y>=0;y--)m=Xt.from(r[y].create(null,m));m=Xt.from(o.copy(m));let g=e.tr.step(new Hl(t.pos-1,h,t.pos,h,new hn(m,1,0),r.length,!0)),v=g.doc.resolve(h+2*r.length);v.nodeAfter&&v.nodeAfter.type==o.type&&zq(g.doc,v.pos)&&g.join(v.pos),n(g.scrollIntoView())}return!0}let c=s.type.spec.isolating||i>0&&a?null:Vi.findFrom(t,1),d=c&&c.$from.blockRange(c.$to),f=d&&dx(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(u&&R1(s,"start",!0)&&R1(o,"end")){let h=o,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let g=s,v=1;for(;!g.isTextblock;g=g.firstChild)v++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let y=Xt.empty;for(let w=m.length-1;w>=0;w--)y=Xt.from(m[w].copy(y));let b=e.tr.step(new Hl(t.pos-m.length,t.pos+s.nodeSize,t.pos+v,t.pos+s.nodeSize-v,new hn(y,m.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function fV(e){return function(t,n){let i=t.selection,o=e<0?i.$from:i.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(t.tr.setSelection(si.create(t.doc,e<0?o.start(s):o.end(s)))),!0):!1}}const hV=fV(-1),pV=fV(1);function Dx(...e){return function(t,n,i){for(let o=0;o"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function UMe(e,t){const n=document.createElement("span");n.className="wm-pill",n.dataset.workMode=e.mode;const i=document.createElement("span");i.className="wm-icon",i.setAttribute("aria-hidden","true"),i.innerHTML=Kr(e.mode==="goal"?"target":"file-edit","sm");const o=document.createElement("span");o.textContent=e.label;const s=document.createElement("button");return s.type="button",s.className="wm-x",s.setAttribute("aria-label",e.dismissLabel),s.title=e.dismissLabel,s.innerHTML=Kr("close","sm"),s.addEventListener("mousedown",r=>r.preventDefault()),s.addEventListener("click",()=>t()),n.append(i,o,s),n}function VMe(e,t,n){const i=[];if(t.pill){const o=t.pill;i.push(Pr.widget(1,()=>UMe(o,n),{side:-1,key:`workmode-pill-${o.mode}-${o.label}-${o.dismissLabel}`,ignoreSelection:!0,stopEvent:()=>!0}))}return i.length>0?Go.create(e,i):null}function T4(){return Kr("attachment","sm")}function O1(e){return e==="image"?Kr("image","sm"):e==="video"?Kr("video","sm"):T4()}function KMe(e){const t=document.createElement("span");t.className=`attachment-pill attachment-${e.kind}`,t.dataset.attachmentId=e.attId,t.dataset.attachmentKind=e.kind,t.dataset.attachmentName=e.name,(e.kind==="image"||e.kind==="video")&&(t.tabIndex=0,t.setAttribute("aria-haspopup","true"),t.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),o.stopPropagation())}));const n=document.createElement("span");n.className="attachment-pill-icon",n.setAttribute("aria-hidden","true"),n.innerHTML=O1(e.kind),t.append(n);const i=document.createElement("span");return i.className="attachment-pill-name",i.textContent=_u(e.name),t.append(i),t}function gV(){return Kr("quote","sm")}function ZMe(e){const t=document.createElement("span");t.className="quote-pill",t.dataset.quoteText=e.text,e.source!==void 0&&e.source.length>0&&(t.dataset.quoteSource=e.source),t.setAttribute("aria-label",e.comment!==void 0&&e.comment.length>0?`${e.text} +${e.comment}`:e.text);const n=document.createElement("span");n.className="quote-pill-icon",n.setAttribute("aria-hidden","true"),n.innerHTML=gV();const i=document.createElement("span");if(i.className="quote-pill-name",i.textContent=N1(e.text),t.append(n,i),e.comment!==void 0&&e.comment.length>0){t.dataset.quoteComment=e.comment;const o=document.createElement("span");o.className="quote-pill-comment",o.textContent=N1(e.comment),t.append(o)}return t}let CA=-1,AA=-1,ay=-1,a5=-1,vV=!1;function RF(e){const t=ay>=0;CA=ay,AA=a5,ay=e.clientX,a5=e.clientY,t&&(ay!==CA||a5!==AA)&&(vV=!0)}function GMe(e){return vV?e.clientX===CA&&e.clientY===AA:!0}let Vp=null,u5=null;function QMe(e){const t={};return u5=t,Vp=e,()=>{u5===t&&(u5=null,Vp=null)}}function Lv(e,t){let n;return()=>{if(n===void 0){const i=getComputedStyle(document.documentElement).getPropertyValue(e).trim(),o=parseFloat(i);n=Number.isFinite(o)?o:t}return n}}const YMe=Lv("--space-1-5",6),JMe=Lv("--p-mention-tip-vmargin",12),XMe=Lv("--duration-tooltip",150),eIe=Lv("--duration-fast",120),yV=Lv("--duration-flash",1e3),tIe=3e4;function kV(e){const t=document.createElement("div");t.className="mention-tip-path-text";const n=e.split(/([/\\])/);let i=n.length-1;for(;i>0&&(n[i]===""||n[i]==="/"||n[i]==="\\");)i--;for(let o=0;o{o.preventDefault(),o.stopPropagation(),(async()=>await Ls(e)&&(n.innerHTML=Kr("check","sm"),window.setTimeout(()=>{n.innerHTML=i},yV())))()}),n}function bV(e,t){return e!==null&&t!==null&&typeof Node<"u"&&t instanceof Node&&e.contains(t)}function nIe(e,t={}){const n=document.createElement("div");return n.className="mention-tip-path",n.append(kV(e)),n.append(E4(e,t.copyLabel)),n}function wV(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function iIe(e,t={}){const n=document.createElement("div");n.className="mention-tip-path";const i=document.createElement("span");if(i.className="mention-tip-att-icon",i.setAttribute("aria-hidden","true"),i.innerHTML=T4(),n.append(i),e.path)n.append(kV(e.path));else{const r=document.createElement("div");r.className="mention-tip-path-text";const l=document.createElement("span");if(l.className="mention-tip-base",l.textContent=e.name,r.append(l),e.size!==void 0){const a=document.createElement("span");a.className="mention-tip-att-size",a.textContent=` · ${wV(e.size)}`,r.append(a)}n.append(r)}if(n.append(E4(e.path??e.name,t.copyLabel)),e.error===void 0)return n;const o=document.createElement("div");o.append(n);const s=document.createElement("div");return s.className="mention-tip-att-error",s.textContent=t.errorLabel??e.error,o.append(s),o}function oIe(e){return`${(Math.min(1,Math.max(0,e))*40.84).toFixed(1)} 40.84`}function sIe(e,t={}){const n=document.createElement("div");n.className="mention-tip-media";const i=document.createElement("div");i.className="mention-tip-media-preview";const o=h=>{i.replaceChildren();const m=document.createElement("span");if(m.className="mention-tip-media-placeholder",m.setAttribute("aria-hidden","true"),m.innerHTML=O1(e.kind),i.append(m),h!=="icon"){const g=document.createElement("div");g.className="mention-tip-media-hint",g.textContent=t.stateLabel?.(h)??h,i.append(g)}},s=h=>{if(i.replaceChildren(),e.kind==="video"){const g=document.createElement("video");g.className="mention-tip-media-el",g.src=h,g.muted=!0,g.controls=!0,g.playsInline=!0,g.preload="metadata",g.addEventListener("error",()=>o("unavailable"),{once:!0}),i.append(g);return}const m=document.createElement("img");m.className="mention-tip-media-el",m.src=h,m.alt="",m.addEventListener("error",()=>o("unavailable"),{once:!0}),i.append(m)};o("icon"),n.append(i);const r=document.createElement("div");r.className="mention-tip-media-meta";const l=document.createElement("span");l.className="mention-tip-att-icon",l.setAttribute("aria-hidden","true"),l.innerHTML=O1(e.kind),r.append(l);const a=document.createElement("span");if(a.className="mention-tip-media-name",a.textContent=_u(e.name),r.append(a),e.size!==void 0){const h=document.createElement("span");h.className="mention-tip-att-size",h.textContent=` · ${wV(e.size)}`,r.append(h)}if(n.append(r),e.error!==void 0){const h=document.createElement("div");h.className="mention-tip-media-error",h.textContent=t.errorLabel??e.error,n.append(h)}const u=document.createElement("div");u.className="mention-tip-media-foot";const c=document.createElement("span");c.className="mention-tip-media-state",u.append(c);const d=h=>{if(c.replaceChildren(),c.classList.toggle("is-danger",h.kind==="failed"),h.kind==="uploading"&&h.progress!==void 0){const v=document.createElement("span");v.className="mention-tip-media-ring",v.setAttribute("aria-hidden","true"),v.innerHTML=``,c.append(v)}else if(h.kind==="uploading"){const v=document.createElement("span");v.className="mention-tip-media-spin",v.setAttribute("aria-hidden","true"),c.append(v)}const m=document.createElement("span"),g=t.uploadStateLabel?.(h.kind)??h.kind;m.textContent=h.kind==="uploading"&&h.progress!==void 0?`${g} ${Math.round(h.progress*100)}%`:g,c.append(m)},f=document.createElement("div");if(f.className="mention-tip-media-actions",e.copyValue!==void 0&&e.copyValue!==""){const h=t.copyLabel??"Copy path",m=document.createElement("button");m.type="button",m.className="mention-tip-media-open",m.setAttribute("aria-label",h);const g=Kr("copy","sm");m.innerHTML=`${g}`,m.lastChild.textContent=h,m.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),(async()=>await Ls(e.copyValue)&&(m.innerHTML=`${Kr("check","sm")}`,m.lastChild.textContent=h,window.setTimeout(()=>{m.innerHTML=`${g}`,m.lastChild.textContent=h},yV()),t.onCopy?.()))()}),f.append(m)}if(t.onFullscreen){const h=document.createElement("button");h.type="button",h.className="mention-tip-media-open",h.innerHTML=`${Kr("fullscreen","sm")}`,h.lastChild.textContent=t.fullscreenLabel??"View fullscreen";const m=t.onFullscreen;h.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation(),m()}),f.append(h)}return u.append(f),t.uploadState!==void 0&&d(t.uploadState),n.append(u),{root:n,setPreview:s,setPlaceholder:o,setUploadState:d}}function rIe(e,t={}){const n=document.createElement("div");n.className="mention-tip-quote-card";const i=t.source??"",o=t.comment??"";if(i.trim()!==""){const a=document.createElement("div");a.className="mention-tip-quote-source",a.textContent=i,n.append(a)}const s=document.createElement("div");s.className="mention-tip-quote-block";const r=document.createElement("div");if(r.className="mention-tip-quote-block-head",t.quoteLabel!==void 0&&t.quoteLabel!==""){const a=document.createElement("div");a.className="mention-tip-quote-block-label",a.textContent=t.quoteLabel,r.append(a)}r.append(E4(e,t.copyLabel)),s.append(r);const l=document.createElement("div");if(l.className="mention-tip-quote-text",l.textContent=e,s.append(l),n.append(s),o.trim()!==""){const a=document.createElement("div");a.className="mention-tip-quote-block";const u=document.createElement("div");if(u.className="mention-tip-quote-block-head",t.commentLabel!==void 0&&t.commentLabel!==""){const d=document.createElement("div");d.className="mention-tip-quote-block-label",d.textContent=t.commentLabel,u.append(d)}u.append(E4(o,t.copyCommentLabel??t.copyLabel)),a.append(u);const c=document.createElement("div");c.className="mention-tip-quote-comment",c.textContent=o,a.append(c),n.append(a)}return n}function lIe(e,t={}){const n=document.createElement("div");n.className="mention-tip-skill";const i=document.createElement("div");i.className="mention-tip-head";const o=document.createElement("span");if(o.className="mention-tip-name",o.textContent=e.name,i.append(o),e.path&&t.onOpen){const s=document.createElement("button");s.type="button",s.className="mention-tip-open",s.setAttribute("aria-label",t.openLabel??"Open skill file"),s.innerHTML=Kr("external-link","sm");const r=e.path,l=t.onOpen;s.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),l(r)}),i.append(s)}if(n.append(i),e.description){const s=document.createElement("div");s.className="mention-tip-desc",s.textContent=e.description,n.append(s)}return n}function uy(e){const t=e.dataset.mentionKind??(e.classList.contains("mention-skill")?"skill":e.classList.contains("mention-folder")?"folder":"file"),n=e.dataset.mentionName??e.querySelector(".mention-pill-name")?.textContent??"";return{kind:t,name:n,path:e.dataset.mentionPath??""}}function cy(e){const t=e.dataset.attachmentKind,n=t==="folder"||t==="image"||t==="video"?t:"file",i=e.dataset.attachmentName??e.querySelector(".attachment-pill-name")?.textContent??"",o=e.dataset.attachmentSize,s=o===void 0||o===""?void 0:Number(o);return{attId:e.dataset.attachmentId??"",kind:n,name:i,size:s!==void 0&&Number.isFinite(s)?s:void 0}}function OF(e){if(e!==null)return e.error!==void 0?{kind:"failed"}:e.uploading===!0?{kind:"uploading",progress:e.uploadProgress}:{kind:"uploaded"}}function aIe(e){let t=null,n=null,i=null,o=null,s=null,r,l,a;const u=new ResizeObserver(()=>{i&&t?.classList.contains("positioned")&&T(i)});let c=null,d,f=null;const h=new Map,m=new Map;function g(W){const Q=h.get(W);return Q!==void 0&&Date.now()-Qv(ce,ae)),pe=`${ve}|${ce}`;if(g(pe))return;s=pe;let Z=m.get(pe);Z===void 0&&(Z=(async()=>{try{const ae=await e.probePath?.(ce,Q);return(e.probeScope?.()??"")!==ve?!1:(ae===!1?se(!0):(h.set(pe,Date.now()),se(!1)),!0)}finally{m.delete(pe)}})(),m.set(pe,Z)),Z.then(ae=>{ae&&s===pe&&t?.querySelector(".mention-tip-spinner")?.remove()})}function w(W){e.skillsLoaded?.()!==!1&&(W.tabIndex=-1,W.removeAttribute("role"),W.hasAttribute("href")&&(W.dataset.mentionHref=W.getAttribute("href")??"",W.removeAttribute("href"))),W.classList.add("mention-inert")}function C(W){if(c?.mintedUrl!=null&&URL.revokeObjectURL(c.mintedUrl),c=null,W.classList.contains("quote-pill"))return rIe(W.dataset.quoteText??"",{source:W.dataset.quoteSource,comment:W.dataset.quoteComment,copyLabel:e.copyQuoteLabel?.(),copyCommentLabel:e.copyCommentLabel?.(),quoteLabel:e.quoteBlockLabel?.(),commentLabel:e.commentBlockLabel?.()});if(W.classList.contains("attachment-pill")){const te=cy(W),ve=W.closest(".ProseMirror")!==null?Vp?.(te.attId)??null:null;if(te.kind==="image"||te.kind==="video"){const ce=te.kind,se=ve?.previewUrl??W.dataset.attachmentUrl??"",pe=ve?.fileId??(W.dataset.attachmentFileId||void 0),Z=ve?.sessionId??(W.dataset.attachmentSessionId||void 0),ae=e.openAttachment!==void 0&&(se!==""||pe!==void 0),K=OF(ve);d=ve;const re=sIe({kind:ce,name:ve?.name??te.name,size:ve?.size??te.size,error:ve?.error,copyValue:ve?.path??te.name},{uploadState:K,uploadStateLabel:e.mediaUploadStateLabel,copyLabel:e.copyPathLabel?.(),fullscreenLabel:e.mediaFullscreenLabel?.(),errorLabel:ve?.error===void 0?void 0:e.attachmentErrorLabel?.(ve.error)??ve.error,stateLabel:e.mediaPreviewStateLabel,onFullscreen:ae?()=>{S(),e.openAttachment?.({url:se,fileId:pe,name:ve?.name??te.name,mediaType:W.dataset.attachmentMediaType||void 0,kind:ce,sessionId:Z})}:void 0}),we={setPreview:re.setPreview,setPlaceholder:re.setPlaceholder,setUploadState:re.setUploadState,mintedUrl:null};return c=we,ve?.previewUrl!==void 0?we.setPreview(ve.previewUrl):ve?.uploading===!0?we.setPlaceholder("uploading"):pe!==void 0&&e.resolveAttachmentPreviewUrl?(we.setPlaceholder("loading"),e.resolveAttachmentPreviewUrl({fileId:pe,sessionId:Z,kind:ce}).then(be=>{if(c!==we){be!==null&&URL.revokeObjectURL(be);return}if(be===null){we.setPlaceholder("unavailable");return}we.mintedUrl=be,we.setPreview(be)})):we.setPlaceholder("unavailable"),re.root}return iIe({name:ve?.name??te.name,path:ve?.path,size:ve?.size??te.size,error:ve?.error},{copyLabel:e.copyPathLabel?.(),errorLabel:ve?.error===void 0?void 0:e.attachmentErrorLabel?.(ve.error)??ve.error})}const Q=uy(W);if(Q.kind==="skill"){const te=e.resolveSkill?.(Q.name);return!te?.path||!e.openPath?w(W):W.classList.contains("mention-inert")&&!W.closest(".q-body")&&(W.tabIndex=0,W.setAttribute("role","button"),W.dataset.mentionHref!==void 0&&(W.setAttribute("href",W.dataset.mentionHref),delete W.dataset.mentionHref),W.classList.remove("mention-inert")),lIe(te??{name:Q.name,description:""},{openLabel:e.openSkillLabel?.(),onOpen:te?.path&&e.openPath?X=>{S(),e.openPath?.({path:X})}:void 0})}return nIe(Q.path!==""?Q.path:Q.name,{copyLabel:e.copyPathLabel?.()})}function T(W){if(!t)return;const Q=W.getBoundingClientRect(),te=t.offsetWidth,X=t.offsetHeight,ve=YMe(),ce=JMe();let se=Q.top-ve-X,pe="top";sewindow.clearTimeout(l)),t.addEventListener("mouseleave",()=>x()),t.addEventListener("focusin",()=>window.clearTimeout(l)),t.addEventListener("focusout",te=>{const X=te.relatedTarget;X instanceof Node&&(t?.contains(X)||i?.contains(X))||S()}),document.body.append(t),n=document.createElement("span"),n.className="mention-tip-caret",n.setAttribute("aria-hidden","true")),u.observe(t),i?.removeAttribute("aria-describedby"),i=W,i.setAttribute("aria-describedby",t.id),s=null;let Q=null;if(W.classList.contains("attachment-pill")){o=null;const te=cy(W),X=W.closest(".ProseMirror")!==null,ve=X?Vp?.(te.attId)??null:null;ve===null?Vp&&X&&y(te.attId,!0):(y(te.attId,!1),ve.path&&(te.kind==="file"||te.kind==="folder")&&(Q={path:ve.path,kind:te.kind,strike:ce=>y(te.attId,ce)}))}else if(!W.classList.contains("quote-pill")){const te=uy(W);o=te.kind!=="skill"&&te.path!==""?te.path:null,o!==null&&(Q={path:o,kind:te.kind==="folder"?"folder":"file",actionPath:W.dataset.mentionActionPath})}if(N(C(W)),t.classList.toggle("mention-tip--media",t.querySelector(".mention-tip-media")!==null),t.classList.remove("positioned"),T(W),t.classList.add("positioned"),t.removeAttribute("inert"),Q!==null&&e.probePath){const{path:te,kind:X,actionPath:ve,strike:ce}=Q,se=`${e.probeScope?.()??""}|${ve??te}`;if(!g(se)){const pe=document.createElement("span");pe.className="mention-tip-spinner",pe.setAttribute("aria-hidden","true"),(t.querySelector(".mention-tip-path-text")??t).append(pe),b(te,X,ve,ce)}}a??=new MutationObserver(()=>{i&&!i.isConnected&&S()}),a.disconnect(),a.observe(document.body,{childList:!0,subtree:!0})}function S(){window.clearTimeout(r),window.clearTimeout(l),i?.removeAttribute("aria-describedby"),i=null,o=null,s=null,d=void 0,c?.mintedUrl!=null&&URL.revokeObjectURL(c.mintedUrl),c=null,f=null,a?.disconnect(),t&&u.unobserve(t),t?.classList.remove("positioned"),t?.setAttribute("inert","")}function _(W){window.clearTimeout(r),window.clearTimeout(l);const Q=t?.classList.contains("positioned")?0:XMe();r=window.setTimeout(()=>{W.isConnected&&I(W)},Q)}function x(){window.clearTimeout(r),window.clearTimeout(l),l=window.setTimeout(S,eIe())}function E(W){return W instanceof Element?W.closest(".mention-pill, .attachment-pill, .quote-pill"):null}function M(W){if(GMe(W))return;const Q=E(W.target);if(Q!==f&&(f=Q,!!Q)){if(Q===i){window.clearTimeout(l);return}_(Q)}}function R(W){const Q=E(W.target);if(!Q)return;const te=W.relatedTarget;te instanceof Element&&(Q.contains(te)||t?.contains(te))||(f=null,x())}function q(W){if(W.key==="Enter"||W.key===" "){const Q=E(W.target);if(Q&&(B(Q,W)||P(Q,W)))return}if(W.key==="Escape"){t?.classList.contains("positioned")&&(i&&W.target instanceof Node&&t.contains(W.target)&&i.focus(),S(),W.preventDefault(),W.stopImmediatePropagation());return}if(W.key==="Tab"){if(t?.classList.contains("positioned")&&W.target instanceof Node&&t.contains(W.target)){const te=[...t.querySelectorAll("button")],X=te[0],ve=te[te.length-1];(!W.shiftKey&&W.target===ve||W.shiftKey&&W.target===X)&&(W.preventDefault(),i?.focus(),S());return}if(W.shiftKey)return;if(E(W.target)===i&&t?.classList.contains("positioned")){const te=t.querySelector("button");te&&(W.preventDefault(),te.focus())}return}t&&W.target instanceof Node&&t.contains(W.target)||t?.contains(document.activeElement)||S()}function z(W){bV(t,W?.target??null)||S()}function $(W){t&&W.target instanceof Node&&t.contains(W.target)||S()}function B(W,Q){if(W.closest(".ProseMirror")||W.closest(".q-body")||uy(W).kind!=="skill")return!1;const te=e.resolveSkill?.(uy(W).name);return!te?.path||!e.openPath?(w(W),!1):(Q.preventDefault(),Q.stopPropagation(),S(),e.openPath({path:te.path}),!0)}function P(W,Q){if(!W.classList.contains("attachment-pill")||W.closest(".ProseMirror")||W.closest(".q-body"))return!1;const te=W.dataset.attachmentUrl??"";return te===""||!e.openAttachment?!1:(Q.preventDefault(),Q.stopPropagation(),S(),e.openAttachment({url:te,fileId:W.dataset.attachmentFileId||void 0,name:cy(W).name,mediaType:W.dataset.attachmentMediaType||void 0,kind:W.dataset.attachmentKind||void 0,sessionId:W.dataset.attachmentSessionId||void 0}),!0)}function H(W){const Q=E(W.target);if(Q){if(Q===i){window.clearTimeout(l);return}_(Q)}}function j(W){if(!E(W.target))return;const te=W.relatedTarget;te instanceof Node&&t?.contains(te)||x()}function G(W){const Q=E(W.target);Q&&(B(Q,W)||P(Q,W))}document.addEventListener("pointermove",RF,{capture:!0,passive:!0}),document.addEventListener("pointermove",M,{passive:!0}),document.addEventListener("mouseout",R),document.addEventListener("focusin",H),document.addEventListener("focusout",j),document.addEventListener("keydown",q,!0),document.addEventListener("scroll",z,!0),document.addEventListener("pointerdown",$),document.addEventListener("click",G,!0),window.addEventListener("resize",z);const ne=gIe(()=>{if(c===null||i===null||!t?.classList.contains("positioned")||!i.classList.contains("attachment-pill")||!i.closest(".ProseMirror"))return;const W=cy(i),Q=Vp?.(W.attId)??null,te=d??null;if((Q?.error??null)!==(te?.error??null)||(Q?.previewUrl??null)!==(te?.previewUrl??null)||Q===null!=(te===null)){N(C(i)),T(i);return}const ve=OF(Q);ve!==void 0&&(d=Q,c.setUploadState(ve))});return()=>{ne(),u.disconnect(),S(),t?.remove(),t=null,n=null,document.removeEventListener("pointermove",RF,{capture:!0}),document.removeEventListener("pointermove",M),document.removeEventListener("mouseout",R),document.removeEventListener("focusin",H),document.removeEventListener("focusout",j),document.removeEventListener("keydown",q,!0),document.removeEventListener("scroll",z,!0),document.removeEventListener("pointerdown",$),document.removeEventListener("click",G,!0),window.removeEventListener("resize",z)}}const uIe=50,sd=new Map;let CV;function cIe(e){CV=e}function AV(e,t){for(sd.delete(e),sd.set(e,t);sd.size>uIe;){const n=sd.keys().next().value;if(n===void 0)break;const i=sd.get(n);sd.delete(n),i!==void 0&&CV?.(i)}}function xV(e){const t=sd.get(e);return t!==void 0&&sd.delete(e),t}function dIe(e){const t=e.clipboardData;return t?t.files.length>0?!0:Array.from(t.items).some(n=>n.kind==="file"):!1}const fIe=new tm({props:{decorations(e){const t=[];return e.doc.forEach((n,i)=>{const o=n.lastChild;if(o&&(o.type===oi.nodes.mention||o.type===oi.nodes.attachment||o.type===oi.nodes.quote)){const s=i+n.nodeSize-1;t.push(Pr.widget(s,()=>{const r=document.createElement("span");return r.className="mention-caret-anchor",r.textContent="​",r},{side:1,key:`mention-caret-anchor-${s}`}))}}),Go.create(e.doc,t)}}}),hIe=new tm({props:{decorations(e){const t=Ss.getState(e);if(!t)return null;const n=[];return e.doc.descendants((i,o)=>{if(i.type!==oi.nodes.attachment)return!0;const s=t.get(i.attrs.attId);return s===void 0?(n.push(Pr.node(o,o+i.nodeSize,{class:"attachment-missing"})),!1):(s.error!==void 0&&n.push(Pr.node(o,o+i.nodeSize,{class:"attachment-error"})),!1)}),n.length===0?null:Go.create(e.doc,n)}}}),pIe=new WeakMap,e9=new Map;function c5(e,t){const n={};return e9.set(e,{api:t,token:n}),()=>{e9.get(e)?.token===n&&e9.delete(e)}}function SV(e){return e9.get(e)?.api}const xA=new Set;function mIe(){for(const e of xA)e()}function gIe(e){return xA.add(e),()=>{xA.delete(e)}}function vIe(e,t,n,i){const o=SV(e);if(o){o.updateAttachmentEntry(t,n);return}const s=xV(e);if(s){const a=s.apply(s.tr.setMeta(Ss,{type:"patch",attId:t,patch:n}));AV(e,a),i.saveEntries([...Ss.getState(a)?.values()??[]]);return}const r=i.loadEntries(),l=r.findIndex(a=>a.attId===t);l!==-1&&(r[l]={...r[l],...n},i.saveEntries(r))}class yIe{dom;constructor(t){this.dom=qxe(t.attrs)}}class kIe{dom;constructor(t){this.dom=KMe(t.attrs)}}class bIe{dom;constructor(t){this.dom=ZMe(t.attrs)}}const wIe=new Lu({...Lu.nodesFromSchema(oi),quote:e=>{const t=e.attrs,n={class:"quote-pill","data-quote-text":t.text,style:"white-space: pre-wrap"};typeof t.comment=="string"&&t.comment.length>0&&(n["data-quote-comment"]=t.comment),typeof t.source=="string"&&t.source.length>0&&(n["data-quote-source"]=t.source);const i=typeof t.source=="string"&&t.source.length>0?`from: ${t.source} `:"",o=typeof t.comment=="string"&&t.comment.length>0?` -${t.comment}`:"";return["span",n,`${i}${t.text}${o}`]}},Eu.marksFromSchema(oi));function $F(e,t){const{selection:n}=e.state;if(n.empty||!t.clipboardData)return!1;const i=n.content(),o=ASe(i,l=>xs.getState(e.state)?.get(l));if(!o)return!1;const s=e.someProp("clipboardSerializer")??Eu.fromSchema(e.state.schema),r=document.createElement("div");return r.append(s.serializeFragment(i.content)),t.preventDefault(),t.clipboardData.clearData(),t.clipboardData.setData("text/plain",o.plain),t.clipboardData.setData("text/html",r.innerHTML),t.clipboardData.setData(Ax,kU(o.flavor)),!0}function OF(e,t,n){return[yMe(),DF({"Mod-z":rV,"Mod-y":CA,"Mod-Shift-z":CA,"Cmd-ArrowLeft":hV,"Cmd-ArrowRight":pV,"Cmd-Shift-ArrowLeft":ZD(!0),"Cmd-Shift-ArrowRight":ZD(!1)}),DF(jMe),mIe,...t?[t]:[],gIe,mSe({initialEntries:e,onEntryDropped:n})]}function _A(e){if(e===void 0)return;const t=new Map(e.map(n=>[n.attId,n.kind]));return n=>t.get(n)}function SIe(e,t){let n=!0;const i={pill:null,placeholder:""},o=new tm({props:{decorations(m){return GMe(m.doc,i,()=>t.onWorkModeDismiss?.())}}}),s=m=>[...xs.getState(m)?.values()??[]],r=(m,g)=>{xs.getState(m)!==xs.getState(g)&&(t.attachments?.onRegistryChange?.(s(g)),yIe())};let l=!1;const a=q0(t.initialText,{reviveMentions:!0,attachmentKindFor:_A(t.attachments?.initialEntries)}),u=new iV(e,{state:nh.create({schema:oi,doc:a,plugins:OF(t.attachments?.initialEntries,o,t.attachments?.onEntryDropped),selection:si.atEnd(a)}),editable:()=>n,attributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-disabled":"false",spellcheck:"false",autocomplete:"off"},dispatchTransaction(m){const g=u.state,v=g.apply(m);u.updateState(v),m.docChanged&&t.onChange(U0(v.doc)),r(g,v)},nodeViews:{mention:m=>new wIe(m),attachment:m=>new CIe(m),quote:m=>new AIe(m)},handleKeyDown:(m,g)=>t.handleKeyDown(g),handleDOMEvents:{blur:(m,g)=>(t.onBlur?.(g),!1),copy:(m,g)=>$F(m,g),cut:(m,g)=>$F(m,g)?(m.dispatch(m.state.tr.deleteSelection().scrollIntoView()),!0):!1},clipboardSerializer:xIe,clipboardTextParser:m=>ay(m),clipboardTextSerializer:m=>pU(m),handlePaste:(m,g)=>{const v=g.clipboardData?.getData(Ax),y=v?SSe(v):void 0;if(y){const w=eF(m.state,y);if(w)return g.preventDefault(),m.dispatch(w),!0}if(pIe(g))return g.preventDefault(),!0;const b=g.clipboardData?.getData("text/plain");if(b){g.preventDefault();const w=WMe(b);if(w){const N=eF(m.state,w);if(N)return m.dispatch(N),!0}const C=new Set(xs.getState(m.state)?.keys()??[]),T=YD(b,C);return m.dispatch(m.state.tr.replaceSelection(ay(T,{reviveMentions:!0})).scrollIntoView()),!0}return!1},handleDrop:(m,g,v,y)=>{if(Array.from(g.dataTransfer?.types??[]).includes("Files"))return g.preventDefault(),!0;if(y)return!1;const b=g.dataTransfer?.getData("text/plain");if(b){g.preventDefault();const w=m.posAtCoords({left:g.clientX,top:g.clientY}),C=m.state.tr;w&&C.setSelection(si.create(C.doc,w.pos));const T=new Set(xs.getState(m.state)?.keys()??[]),N=YD(b,T);return m.dispatch(C.replaceSelection(ay(N,{reviveMentions:!0})).scrollIntoView()),!0}return!1}});vIe.set(u.dom,u),hIe(m=>{for(const g of xs.getState(m)?.values()??[])g.previewUrl!==void 0&&t.attachments?.onEntryDropped?.(g)});const c=XMe(m=>{const g=xs.getState(u.state)?.get(m);return g?{name:g.name,path:g.path,size:g.size,error:g.error,uploading:g.uploading,uploadProgress:g.uploadProgress,fileId:g.fileId,sessionId:g.sessionId,previewUrl:g.previewUrl}:null}),d=()=>t.onCompositionStart?.(),f=()=>t.onCompositionEnd?.();return u.dom.addEventListener("compositionstart",d),u.dom.addEventListener("compositionend",f),{dom:u.dom,get selectionStart(){return _u(u.state.doc,u.state.selection.from)},get selectionEnd(){return _u(u.state.doc,u.state.selection.to)},inlineTextRunStart(){return uSe(u.state.doc,u.state.selection.$from)},setSelectionRange(m,g){const{doc:v}=u.state,y=si.create(v,bh(v,m),bh(v,g));u.dispatch(u.state.tr.setSelection(y).scrollIntoView())},focus(m){u.focus()},getText(){return U0(u.state.doc)},setText(m,g){const v=u.state,y=q0(m,{reviveMentions:!0,attachmentKindFor:_A(g?.entries)});if(!l){const b=new Set((g?.entries??[]).map(w=>w.previewUrl).filter(w=>w!==void 0));for(const w of xs.getState(v)?.values()??[])w.previewUrl!==void 0&&!b.has(w.previewUrl)&&t.attachments?.onEntryDropped?.(w)}l=!1,u.updateState(nh.create({schema:oi,doc:y,plugins:OF(g?.entries,o,t.attachments?.onEntryDropped),selection:si.atEnd(y)})),r(v,u.state)},insertNewlineAtCaret(){cV(u.state,m=>u.dispatch(m.scrollIntoView()))},setWorkMode(m){i.pill=m,u.dispatch(u.state.tr)},setPlaceholder(m){i.placeholder=m,u.dispatch(u.state.tr)},insertMention(m,g){u.dispatch(nSe(u.state,m,g)),u.focus()},insertTextAt(m,g,v){const y=bh(u.state.doc,m),b=u.state.tr;b.setSelection(si.create(b.doc,y)),u.dispatch(b.replaceSelection(ay(g,{reviveMentions:v?.reviveMentions??!0})).scrollIntoView())},getSkillMentions(){return cSe(u.state.doc)},insertAttachment(m,g){const v=g===void 0?void 0:{start:g,end:g};u.dispatch(iSe(u.state,m,v)),u.focus()},insertQuote(m,g){u.dispatch(oSe(u.state,m,g)),u.focus()},upsertAttachmentEntry(m){u.dispatch(u.state.tr.setMeta(xs,{type:"upsert",entry:m}))},updateAttachmentEntry(m,g){u.dispatch(u.state.tr.setMeta(xs,{type:"patch",attId:m,patch:g}))},getAttachmentEntries(){return s(u.state)},getOrderedAttachmentIds(){return hSe(u.state.doc)},textOffsetAtCoords(m){const g=u.posAtCoords(m);return g?_u(u.state.doc,g.pos):null},setEditable(m){n=m,u.setProps({editable:()=>n}),u.dom.setAttribute("aria-disabled",String(!m))},stashState(m){l=!0,AV(m,u.state)},restoreState(m){const g=xV(m);if(!g)return!1;const v=u.state;return u.updateState(g.reconfigure({plugins:u.state.plugins})),l=!1,r(v,u.state),!0},destroy(){if(u.dom.removeEventListener("compositionstart",d),u.dom.removeEventListener("compositionend",f),c(),!l)for(const m of xs.getState(u.state)?.values()??[])m.previewUrl!==void 0&&t.attachments?.onEntryDropped?.(m);u.destroy()}}}function f5(e,t,n){if(t===void 0||t.length===0||e.length===0)return[{text:e,hit:!1}];const i=new Set;for(const l of t){const a=l-n;a>=0&&a{const i=e();if(!i)return;const o=i.ownerDocument?.getSelection?.()??document.getSelection(),s=o&&o.rangeCount>0&&!o.isCollapsed?o.getRangeAt(0):null;let r=!1;if(s&&i instanceof Node)try{r=s.intersectsNode(i)}catch{r=!1}if(!s||!r){for(const a of t)a.classList.remove("pill-in-selection");t=new Set;return}const l=new Set;for(const a of i.querySelectorAll(".mention-pill, .attachment-pill, .quote-pill"))try{s.intersectsNode(a)&&l.add(a)}catch{}for(const a of l)t.has(a)||a.classList.add("pill-in-selection");for(const a of t)l.has(a)||a.classList.remove("pill-in-selection");t=l};return document.addEventListener("selectionchange",n),()=>document.removeEventListener("selectionchange",n)}const _Ie=["tabindex","data-quote-text","data-quote-comment","data-quote-comment-sep","data-quote-source","aria-label"],MIe=["innerHTML"],IIe={class:"quote-pill-name"},TIe={key:0,class:"quote-pill-comment"},EIe={key:0,class:"q-sep"},LIe=["data-mention-kind","data-mention-name","data-mention-path","data-mention-action-path","onClick","onKeydown"],NIe=["innerHTML"],DIe={class:"mention-pill-name"},FIe=["data-attachment-id","data-attachment-kind","data-attachment-name"],BIe=["innerHTML"],RIe={class:"attachment-pill-name"},MA=lt({__name:"ComposerText",props:{text:{},interactive:{type:Boolean,default:!0},openFile:{type:Function,default:void 0},attachments:{default:void 0}},setup(e){const t=e,n=D(()=>bx(t.text).map(m=>m.type!=="inline"?m:{type:"inline",text:m.text,segments:mU(m.text).map(g=>g.type==="quote"?{type:"text",value:g.attrs.text}:g)}));function i(m){const g=n.value[m-1],v=n.value[m+1];return g?.type==="quote"||v?.type==="quote"}function o(m){return!t.interactive||m.kind==="folder"?{}:m.kind==="skill"?{tabindex:0,role:"button"}:t.openFile?{tabindex:0,role:"button"}:{}}function s(m){return!t.interactive||m.kind!=="file"?{}:fSe(m.attId,t.attachments)}function r(m){return D1(m.attId,t.attachments)?.kind??m.kind}function l(m){if(m.type!=="mention"||m.attrs.kind==="skill")return;const g=Zf(qp(m.rawDest));return g!==m.attrs.path?g:void 0}function a(m,g){m.type!=="mention"||!t.interactive||m.attrs.kind!=="file"||!t.openFile||(g.preventDefault(),g.stopPropagation(),t.openFile({path:l(m)??m.attrs.path}))}function u(m,g){g.key!=="Enter"&&g.key!==" "||a(m,g)}function c(m){const g=m.getAttribute("data-attachment-id")??"",v=m.getAttribute("data-attachment-kind"),y=m.getAttribute("data-attachment-name")??"";return g===""||v!=="file"&&v!=="folder"&&v!=="image"&&v!=="video"||y===""?null:{attId:g,name:y,kind:v}}function d(m){for(const g of m.querySelectorAll(".mention-pill")){const v=g.getAttribute("data-mention-kind");if(v!=="file"&&v!=="folder"&&v!=="skill")continue;const y=g.getAttribute("data-mention-name")??"",b=g.getAttribute("data-mention-path")??"";g.replaceWith(document.createTextNode(nm({kind:v,name:y,path:b})))}}function f(m){return(m instanceof Element?m:m.parentElement)?.closest(".quote-pill, .mention-pill, .attachment-pill")??null}function h(m){const g=window.getSelection(),v=m.currentTarget;if(!g||g.isCollapsed||g.rangeCount===0||!v)return;const y=g.getRangeAt(0);if(!v.contains(y.commonAncestorContainer))return;const b=y.cloneRange(),w=(x,E)=>{const M=y.cloneRange();return M.selectNodeContents(x),E==="start"?M.setStart(y.startContainer,y.startOffset):M.setEnd(y.endContainer,y.endOffset),M.toString()},C=f(b.startContainer);C!==null&&w(C,"start")!==""&&b.setStartBefore(C);const T=f(b.endContainer);T!==null&&w(T,"end")!==""&&b.setEndAfter(T);const N=b.cloneContents();for(const x of N.querySelectorAll(".attachment-pill")){const E=c(x);x.replaceWith(document.createTextNode(E?.name??x.textContent??""))}for(const x of N.querySelectorAll(".quote-pill")){const E=x.getAttribute("data-quote-text")??x.textContent??"",M=x.getAttribute("data-quote-comment"),R=x.getAttribute("data-quote-comment-sep")??` +${t.comment}`:"";return["span",n,`${i}${t.text}${o}`]}},Lu.marksFromSchema(oi));function $F(e,t){const{selection:n}=e.state;if(n.empty||!t.clipboardData)return!1;const i=n.content(),o=CSe(i,l=>Ss.getState(e.state)?.get(l));if(!o)return!1;const s=e.someProp("clipboardSerializer")??Lu.fromSchema(e.state.schema),r=document.createElement("div");return r.append(s.serializeFragment(i.content)),t.preventDefault(),t.clipboardData.clearData(),t.clipboardData.setData("text/plain",o.plain),t.clipboardData.setData("text/html",r.innerHTML),t.clipboardData.setData(Cx,kU(o.flavor)),!0}function PF(e,t,n){return[vMe(),FF({"Mod-z":rV,"Mod-y":wA,"Mod-Shift-z":wA,"Cmd-ArrowLeft":hV,"Cmd-ArrowRight":pV,"Cmd-Shift-ArrowLeft":GD(!0),"Cmd-Shift-ArrowRight":GD(!1)}),FF(zMe),fIe,...t?[t]:[],hIe,pSe({initialEntries:e,onEntryDropped:n})]}function SA(e){if(e===void 0)return;const t=new Map(e.map(n=>[n.attId,n.kind]));return n=>t.get(n)}function CIe(e,t){let n=!0;const i={pill:null},o=new tm({props:{decorations(m){return VMe(m.doc,i,()=>t.onWorkModeDismiss?.())}}}),s=m=>[...Ss.getState(m)?.values()??[]],r=(m,g)=>{Ss.getState(m)!==Ss.getState(g)&&(t.attachments?.onRegistryChange?.(s(g)),mIe())};let l=!1;const a=W0(t.initialText,{reviveMentions:!0,attachmentKindFor:SA(t.attachments?.initialEntries)}),u=new iV(e,{state:ih.create({schema:oi,doc:a,plugins:PF(t.attachments?.initialEntries,o,t.attachments?.onEntryDropped),selection:si.atEnd(a)}),editable:()=>n,attributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-disabled":"false",spellcheck:"false",autocomplete:"off"},dispatchTransaction(m){const g=u.state,v=g.apply(m);u.updateState(v),m.docChanged&&t.onChange(q0(v.doc)),r(g,v)},nodeViews:{mention:m=>new yIe(m),attachment:m=>new kIe(m),quote:m=>new bIe(m)},handleKeyDown:(m,g)=>t.handleKeyDown(g),handleDOMEvents:{blur:(m,g)=>(t.onBlur?.(g),!1),copy:(m,g)=>$F(m,g),cut:(m,g)=>$F(m,g)?(m.dispatch(m.state.tr.deleteSelection().scrollIntoView()),!0):!1},clipboardSerializer:wIe,clipboardTextParser:m=>ly(m),clipboardTextSerializer:m=>pU(m),handlePaste:(m,g)=>{const v=g.clipboardData?.getData(Cx),y=v?xSe(v):void 0;if(y){const w=tF(m.state,y);if(w)return g.preventDefault(),m.dispatch(w),!0}if(dIe(g))return g.preventDefault(),!0;const b=g.clipboardData?.getData("text/plain");if(b){g.preventDefault();const w=HMe(b);if(w){const N=tF(m.state,w);if(N)return m.dispatch(N),!0}const C=new Set(Ss.getState(m.state)?.keys()??[]),T=JD(b,C);return m.dispatch(m.state.tr.replaceSelection(ly(T,{reviveMentions:!0})).scrollIntoView()),!0}return!1},handleDrop:(m,g,v,y)=>{if(Array.from(g.dataTransfer?.types??[]).includes("Files"))return g.preventDefault(),!0;if(y)return!1;const b=g.dataTransfer?.getData("text/plain");if(b){g.preventDefault();const w=m.posAtCoords({left:g.clientX,top:g.clientY}),C=m.state.tr;w&&C.setSelection(si.create(C.doc,w.pos));const T=new Set(Ss.getState(m.state)?.keys()??[]),N=JD(b,T);return m.dispatch(C.replaceSelection(ly(N,{reviveMentions:!0})).scrollIntoView()),!0}return!1}});pIe.set(u.dom,u),cIe(m=>{for(const g of Ss.getState(m)?.values()??[])g.previewUrl!==void 0&&t.attachments?.onEntryDropped?.(g)});const c=QMe(m=>{const g=Ss.getState(u.state)?.get(m);return g?{name:g.name,path:g.path,size:g.size,error:g.error,uploading:g.uploading,uploadProgress:g.uploadProgress,fileId:g.fileId,sessionId:g.sessionId,previewUrl:g.previewUrl}:null}),d=()=>t.onCompositionStart?.(),f=()=>t.onCompositionEnd?.();return u.dom.addEventListener("compositionstart",d),u.dom.addEventListener("compositionend",f),{dom:u.dom,get selectionStart(){return Mu(u.state.doc,u.state.selection.from)},get selectionEnd(){return Mu(u.state.doc,u.state.selection.to)},inlineTextRunStart(){return aSe(u.state.doc,u.state.selection.$from)},setSelectionRange(m,g){const{doc:v}=u.state,y=si.create(v,wh(v,m),wh(v,g));u.dispatch(u.state.tr.setSelection(y).scrollIntoView())},focus(m){u.focus()},getText(){return q0(u.state.doc)},setText(m,g){const v=u.state,y=W0(m,{reviveMentions:!0,attachmentKindFor:SA(g?.entries)});if(!l){const b=new Set((g?.entries??[]).map(w=>w.previewUrl).filter(w=>w!==void 0));for(const w of Ss.getState(v)?.values()??[])w.previewUrl!==void 0&&!b.has(w.previewUrl)&&t.attachments?.onEntryDropped?.(w)}l=!1,u.updateState(ih.create({schema:oi,doc:y,plugins:PF(g?.entries,o,t.attachments?.onEntryDropped),selection:si.atEnd(y)})),r(v,u.state)},insertNewlineAtCaret(){cV(u.state,m=>u.dispatch(m.scrollIntoView()))},setWorkMode(m){i.pill=m,u.dispatch(u.state.tr)},insertMention(m,g){u.dispatch(tSe(u.state,m,g)),u.focus()},insertTextAt(m,g,v){const y=wh(u.state.doc,m),b=u.state.tr;b.setSelection(si.create(b.doc,y)),u.dispatch(b.replaceSelection(ly(g,{reviveMentions:v?.reviveMentions??!0})).scrollIntoView())},getSkillMentions(){return uSe(u.state.doc)},insertAttachment(m,g){const v=g===void 0?void 0:{start:g,end:g};u.dispatch(nSe(u.state,m,v)),u.focus()},insertQuote(m,g){u.dispatch(iSe(u.state,m,g)),u.focus()},upsertAttachmentEntry(m){u.dispatch(u.state.tr.setMeta(Ss,{type:"upsert",entry:m}))},updateAttachmentEntry(m,g){u.dispatch(u.state.tr.setMeta(Ss,{type:"patch",attId:m,patch:g}))},getAttachmentEntries(){return s(u.state)},getOrderedAttachmentIds(){return fSe(u.state.doc)},textOffsetAtCoords(m){const g=u.posAtCoords(m);return g?Mu(u.state.doc,g.pos):null},setEditable(m){n=m,u.setProps({editable:()=>n}),u.dom.setAttribute("aria-disabled",String(!m))},stashState(m){l=!0,AV(m,u.state)},restoreState(m){const g=xV(m);if(!g)return!1;const v=u.state;return u.updateState(g.reconfigure({plugins:u.state.plugins})),l=!1,r(v,u.state),!0},destroy(){if(u.dom.removeEventListener("compositionstart",d),u.dom.removeEventListener("compositionend",f),c(),!l)for(const m of Ss.getState(u.state)?.values()??[])m.previewUrl!==void 0&&t.attachments?.onEntryDropped?.(m);u.destroy()}}}function d5(e,t,n){if(t===void 0||t.length===0||e.length===0)return[{text:e,hit:!1}];const i=new Set;for(const l of t){const a=l-n;a>=0&&a{const i=e();if(!i)return;const o=i.ownerDocument?.getSelection?.()??document.getSelection(),s=o&&o.rangeCount>0&&!o.isCollapsed?o.getRangeAt(0):null;let r=!1;if(s&&i instanceof Node)try{r=s.intersectsNode(i)}catch{r=!1}if(!s||!r){for(const a of t)a.classList.remove("pill-in-selection");t=new Set;return}const l=new Set;for(const a of i.querySelectorAll(".mention-pill, .attachment-pill, .quote-pill"))try{s.intersectsNode(a)&&l.add(a)}catch{}for(const a of l)t.has(a)||a.classList.add("pill-in-selection");for(const a of t)l.has(a)||a.classList.remove("pill-in-selection");t=l};return document.addEventListener("selectionchange",n),()=>document.removeEventListener("selectionchange",n)}const AIe=["tabindex","data-quote-text","data-quote-comment","data-quote-comment-sep","data-quote-source","aria-label"],xIe=["innerHTML"],SIe={class:"quote-pill-name"},_Ie={key:0,class:"quote-pill-comment"},MIe={key:0,class:"q-sep"},IIe=["data-mention-kind","data-mention-name","data-mention-path","data-mention-action-path","onClick","onKeydown"],TIe=["innerHTML"],EIe={class:"mention-pill-name"},LIe=["data-attachment-id","data-attachment-kind","data-attachment-name"],NIe=["innerHTML"],DIe={class:"attachment-pill-name"},_A=rt({__name:"ComposerText",props:{text:{},interactive:{type:Boolean,default:!0},openFile:{type:Function,default:void 0},attachments:{default:void 0}},setup(e){const t=e,n=D(()=>kx(t.text).map(m=>m.type!=="inline"?m:{type:"inline",text:m.text,segments:mU(m.text).map(g=>g.type==="quote"?{type:"text",value:g.attrs.text}:g)}));function i(m){const g=n.value[m-1],v=n.value[m+1];return g?.type==="quote"||v?.type==="quote"}function o(m){return!t.interactive||m.kind==="folder"?{}:m.kind==="skill"?{tabindex:0,role:"button"}:t.openFile?{tabindex:0,role:"button"}:{}}function s(m){return!t.interactive||m.kind!=="file"?{}:dSe(m.attId,t.attachments)}function r(m){return D1(m.attId,t.attachments)?.kind??m.kind}function l(m){if(m.type!=="mention"||m.attrs.kind==="skill")return;const g=Gf(Up(m.rawDest));return g!==m.attrs.path?g:void 0}function a(m,g){m.type!=="mention"||!t.interactive||m.attrs.kind!=="file"||!t.openFile||(g.preventDefault(),g.stopPropagation(),t.openFile({path:l(m)??m.attrs.path}))}function u(m,g){g.key!=="Enter"&&g.key!==" "||a(m,g)}function c(m){const g=m.getAttribute("data-attachment-id")??"",v=m.getAttribute("data-attachment-kind"),y=m.getAttribute("data-attachment-name")??"";return g===""||v!=="file"&&v!=="folder"&&v!=="image"&&v!=="video"||y===""?null:{attId:g,name:y,kind:v}}function d(m){for(const g of m.querySelectorAll(".mention-pill")){const v=g.getAttribute("data-mention-kind");if(v!=="file"&&v!=="folder"&&v!=="skill")continue;const y=g.getAttribute("data-mention-name")??"",b=g.getAttribute("data-mention-path")??"";g.replaceWith(document.createTextNode(nm({kind:v,name:y,path:b})))}}function f(m){return(m instanceof Element?m:m.parentElement)?.closest(".quote-pill, .mention-pill, .attachment-pill")??null}function h(m){const g=window.getSelection(),v=m.currentTarget;if(!g||g.isCollapsed||g.rangeCount===0||!v)return;const y=g.getRangeAt(0);if(!v.contains(y.commonAncestorContainer))return;const b=y.cloneRange(),w=(x,E)=>{const M=y.cloneRange();return M.selectNodeContents(x),E==="start"?M.setStart(y.startContainer,y.startOffset):M.setEnd(y.endContainer,y.endOffset),M.toString()},C=f(b.startContainer);C!==null&&w(C,"start")!==""&&b.setStartBefore(C);const T=f(b.endContainer);T!==null&&w(T,"end")!==""&&b.setEndAfter(T);const N=b.cloneContents();for(const x of N.querySelectorAll(".attachment-pill")){const E=c(x);x.replaceWith(document.createTextNode(E?.name??x.textContent??""))}for(const x of N.querySelectorAll(".quote-pill")){const E=x.getAttribute("data-quote-text")??x.textContent??"",M=x.getAttribute("data-quote-comment"),R=x.getAttribute("data-quote-comment-sep")??` -`,q=x.getAttribute("data-quote-source"),z=q!==null&&q.length>0?`from: ${kx(q)} +`,q=x.getAttribute("data-quote-source"),z=q!==null&&q.length>0?`from: ${yx(q)} `:"";x.replaceWith(document.createTextNode(z+rU(E)+(M!==null&&M.length>0?R+M:"")))}d(N),m.clipboardData?.setData("text/plain",N.textContent??"");const I=b.cloneContents(),S=[];for(const x of I.querySelectorAll(".attachment-pill")){const E=c(x);if(!E){x.replaceWith(document.createTextNode(x.textContent??""));continue}S.some(M=>M.attId===E.attId)||S.push(E),x.replaceWith(document.createTextNode(Ud(E)))}for(const x of I.querySelectorAll(".q-sep"))x.textContent===` -`&&x.previousSibling instanceof Element&&x.previousSibling.classList.contains("quote-pill")&&x.nextSibling instanceof Element&&x.nextSibling.classList.contains("quote-pill")&&x.replaceWith(document.createTextNode(" "));let _=!1;for(const x of I.querySelectorAll(".quote-pill"))_=!0,x.replaceWith(document.createTextNode(nb({text:x.getAttribute("data-quote-text")??x.textContent??"",comment:x.getAttribute("data-quote-comment")??"",source:x.getAttribute("data-quote-source")??""})));if(S.length>0||_){d(I);const{text:x,attIdRemap:E}=_Se(I.textContent??""),M=S.map(z=>{const O=E[z.attId]??z.attId,B=D1(z.attId,t.attachments);return bU({...z,attId:O},B)}),R=q0(x,{reviveMentions:!0,attachmentKindFor:_A(M)}),q={v:1,slice:hn.maxOpen(R.content).toJSON()??{},attachments:M};m.clipboardData?.setData(Ax,kU(JSON.stringify(q)))}m.preventDefault()}return(m,g)=>(k(),L("span",{class:"composer-text",onCopy:h},[(k(!0),L(De,null,Ct(n.value,(v,y)=>(k(),L(De,{key:y},[v.type==="quote"?(k(),L("span",{key:0,class:"quote-pill",tabindex:e.interactive?0:void 0,"data-quote-text":v.text,"data-quote-comment":v.comment||void 0,"data-quote-comment-sep":v.commentSep,"data-quote-source":v.source||void 0,"aria-label":v.comment?`${v.text} -${v.comment}`:v.text},[A("span",{class:"quote-pill-icon","aria-hidden":"true",innerHTML:p(gV)()},null,8,MIe),A("span",IIe,F(p(N1)(v.text)),1),v.comment?(k(),L("span",TIe,F(p(N1)(v.comment)),1)):ee("",!0)],8,_Ie)):v.type==="sep"?(k(),L(De,{key:1},[i(y)?(k(),L("span",EIe,F(v.text),1)):(k(),L(De,{key:1},[$e(F(v.text),1)],64))],64)):(k(!0),L(De,{key:2},Ct(v.segments,(b,w)=>(k(),L(De,{key:w},[b.type==="mention"?(k(),L("span",ui({key:0,class:`mention-pill mention-${b.attrs.kind}`,"data-mention-kind":b.attrs.kind,"data-mention-name":b.attrs.name,"data-mention-path":b.attrs.path||void 0,"data-mention-action-path":l(b)},{ref_for:!0},o(b.attrs),{onClick:C=>a(b,C),onKeydown:C=>u(b,C)}),[A("span",{class:"mention-pill-icon","aria-hidden":"true",innerHTML:p(tb)(b.attrs.kind,b.attrs.path,b.attrs.name)},null,8,NIe),A("span",DIe,F(p(Su)(b.attrs.name)),1)],16,LIe)):b.type==="attachment"?(k(),L("span",ui({key:1,class:`attachment-pill attachment-${r(b.attrs)}`,"data-attachment-id":b.attrs.attId,"data-attachment-kind":r(b.attrs),"data-attachment-name":b.attrs.name},{ref_for:!0},s(b.attrs)),[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p($1)(r(b.attrs))},null,8,BIe),A("span",RIe,F(p(Su)(b.attrs.name)),1)],16,FIe)):(k(),L(De,{key:2},[$e(F(b.value),1)],64))],64))),128))],64))),128))],32))}}),MV=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],$Ie=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),IA=[...MV].sort((e,t)=>t.length-e.length).join("|"),h5=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${IA}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${IA})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),IV=/[),.;!?,。;!?)]+$/;function OIe(e){const t=e.toLowerCase();return MV.some(n=>t.endsWith(`.${n}`))}function PIe(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${IA}))["']`,"gi");let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=o.split("/").pop();s&&t.set(s,o)}return t}function zIe(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const i=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!i)return null;let o=(i[1]??"").replace(IV,"");if(!o)return null;const s=o.split("/").pop()??o,r=o.includes("/"),l=$Ie.has(s),a=OIe(s);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(s);if(!d)return null;o=d}const u=i[2]??i[3],c=u?Number(u):void 0;return{path:o,line:c!==void 0&&Number.isFinite(c)&&c>0?c:void 0}}function jIe(e,t={}){const n=[];h5.lastIndex=0;let i;for(;(i=h5.exec(e))!==null;){const o=i[0]??"",s=i[1]??"",r=o.indexOf(s);if(r<0)continue;const l=i[2]??i[3];let a=s+(l?o.slice(r+s.length):"");const u=a.replace(IV,""),c=a.length-u.length;a=u;const d=zIe(a,t);if(!d)continue;const f=i.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),c>0&&(h5.lastIndex-=c)}return n}const HIe=/^---[ \t]*$/,WIe=/^---[ \t]*(?:\r\n|\n)/;function qIe(e){const t=WIe.exec(e);if(t===null)return{frontmatter:null,body:e};let n=t[0].length;const i=n;for(;n<=e.length;){let o=e.indexOf(` -`,n);o===-1&&(o=e.length);let s=e.slice(n,o);if(s.endsWith("\r")&&(s=s.slice(0,-1)),HIe.test(s)){const r=e.slice(i,n);if(r==="")return{frontmatter:null,body:e};const l=o=0&&e[i]==="\\";)n++,i--;return n%2===1}const UIe=/\s/,VIe=/\p{Nd}/u;function $h(e,t){const n=e.codePointAt(t);return n===void 0?void 0:String.fromCodePoint(n)}function KIe(e,t){if(t<=0)return;const n=e.charCodeAt(t-1),i=n>=56320&&n<=57343&&t>1?t-2:t-1,o=e.codePointAt(i);return o===void 0?void 0:String.fromCodePoint(o)}function PF(e){return e!==void 0&&UIe.test(e)}function O1(e){return e!==void 0&&VIe.test(e)}function ZIe(e,t){const n=e[t+1];return O1($h(e,t+1))?!0:(n==="-"||n==="+"||n==="."||n==="−"||n==="+"||n==="-")&&O1($h(e,t+2))}function N4(e){return e!==void 0&&e>="A"&&e<="Z"}const TV=new RegExp(String.raw`^(?:AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CUC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SLL|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|UYU|UZS|VED|VES|VND|VUV|WST|XAF|XCD|XOF|XPF|YER|ZAR|ZMW|ZWL|HK|US|SG|AU|CA|NZ|NT|TW|RMB|MEX|TT|BZ|EU|UK)$`);function GIe(e,t){if(!N4(e[t-1]))return!1;let n=t-1;for(;n>0&&N4(e[n-1]);)n--;return TV.test(e.slice(n,t))||O1($h(e,t+1))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")&&!/\p{L}/u.test($h(e,t+1)??"")}function QIe(e,t){if(!N4(e[t-1]))return!1;let n=t-1;for(;n>0&&N4(e[n-1]);)n--;return TV.test(e.slice(n,t))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")}const YIe=/^[-–—,,、;;::~~(([【//]$/;function JIe(e,t){const n=e[t+1];if(n!=="-"&&n!=="+"&&n!=="."||!O1($h(e,t+2)))return!1;const i=e[t-1];return i!==void 0&&YIe.test(i)}function XIe(e){const t=String.raw`[、,,;;::~~\-–—至到//\s()()=*×=]|和|跟|与|及|或|and|or`;let n=e.replace(new RegExp(String.raw`^(?:${t})+`,"u"),"");for(;;){const o=n.replace(new RegExp(String.raw`^\p{L}+(?:${t})+`,"u"),"").replace(/^[\p{L}][\p{L} ]*(?=\p{Nd})/u,"");if(o===n)break;n=o}if(!/\p{Nd}/u.test(n))return!1;const i=String.raw`[-+]?[\p{Nd}][\p{Nd},.'’]*`;return new RegExp(String.raw`^${i}(?:\p{L}+)?(?:(?:${t})+${i}(?:\p{L}+)?)*$`,"u").test(n)}const lu=-1,zF=1,jF=2,HF=3;function eTe(e){const t=e.length,n=new Uint8Array(t),i=new Int32Array(t+1).fill(lu),o=new Int32Array(t+1),s=new Int32Array(t+1),r=[],l=[];{const P=[];for(let ie=0;ie{for(;a=(l[a]?.[1]??0);)a++;const H=l[a];return H!==void 0&&P>=H[0]},c=new Set(' \n\r)。,、;:!?"<>`「」『』【】〔〕()*—–“”‘’'),d=[];for(const P of e.matchAll(/\b(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/gi))d.push(P.index);for(const P of e.matchAll(/\b(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|[\w-]+(?:\.[\w-]+)*\.[a-zA-Z]{2,})(?=(?:\/|\?|:\d))/gi))d.push(P.index);for(const P of e.matchAll(/(?:\.{1,2})?\/[\p{L}\p{Nd}._-]+(?:\/[\p{L}\p{Nd}._-]*)*\?/gu))(P.index===0||!/[\w~/.-]/.test(e[P.index-1]))&&d.push(P.index);d.sort((P,H)=>P-H);let f=-1;for(const P of d){if(PP+7&&!/[\w/?#@~.+&=%-]/.test(e[H+1]??""))break}H++}r.push([P,H]),f=H}const h=[];for(let P=0;P]/.test(ie))continue;let W=H,Q=lu,te=lu;for(;W"){te=W;break}if(!j&&X==="/"&&e[W+1]===">"){te=W+1;break}if(!/\s/.test(X)){Q=W;break}for(;W"){te=W;break}if(j){Q=W;break}if(ge==="/"&&e[W+1]===">"){te=W+1;break}const ue=/^[a-zA-Z_:][\w:.-]*/.exec(e.slice(W));if(!ue){Q=W;break}W+=ue[0].length;let se=W;for(;se`]+/.exec(e.slice(se));if(!G){Q=se;break}W=se+G[0].length}}}if(te!==lu)h.push([P,te+1]),P=te;else if(Q!==lu){const X=e.indexOf("<",P+1);P=(X!==-1&&X",P+2);Q===-1?g=!1:(h.push([P,Q+2]),P=Q+1,j=!0)}else if(H==="!"){if(e[P+2]==="-"&&e[P+3]==="-"){if(m){const Q=e.indexOf("-->",P+4);Q===-1?m=!1:(h.push([P,Q+3]),P=Q+2,j=!0)}}else if(e.startsWith("[CDATA[",P+2)){if(v){const Q=e.indexOf("]]>",P+9);Q===-1?v=!1:(h.push([P,Q+3]),P=Q+2,j=!0)}}else if(y&&/[A-Z]/.test(e[P+2]??"")){const Q=e.indexOf(">",P+3);Q===-1?y=!1:(h.push([P,Q+1]),P=Q,j=!0)}}if(j)continue;if(H!==void 0&&/[a-zA-Z]/.test(H)){const Q=/^[a-zA-Z][a-zA-Z0-9+.-]{1,31}:/.exec(e.slice(P+1));if(Q){let te=P+1+Q[0].length;for(;te"&&e[te]!=="<"&&!/\s/.test(e[te]);)te++;if(e[te]===">"){h.push([P,te+1]),P=te;continue}}}if(H===void 0||!/[\w.!#$%&'*+/=?^`{|}~-]/.test(H))continue;let Z=P+1;for(;Z"&&(h.push([P,Z+1]),P=Z)}}h.sort((P,H)=>P[0]-H[0]);const b=[];for(const[P,H]of h){const j=b[b.length-1];j&&P<=j[1]?j[1]=Math.max(j[1],H):b.push([P,H])}r.push(...b);let w=0;const C=P=>{for(;w=(b[w]?.[1]??0);)w++;const H=b[w];return H!==void 0&&P>=H[0]},T=[];let N=null,I=0,S=!1;for(let P=0;P"&&(S=!1);else if(!(u(P)||C(P))){if(N!==null)e[P]===N&&(N=null);else if(T.length>0&&(e[P]==='"'||e[P]==="'")&&P>0&&/\s/.test(e[P-1]))N=e[P];else if(e[P]==="[")I++;else if(e[P]==="]")I>0&&e[P+1]==="("&&(T.push(P),S=e[P+2]==="<",P++),I=Math.max(0,I-1);else if(e[P]==="("&&T.length>0)T.push(-1);else if(e[P]===")"&&T.length>0){const H=T.pop();if(H!==void 0&&H>=0){const j=e.slice(H+2,P);(/\s/.exec(j)===null||j.startsWith("<")&&/^<(?:\\[<>]|[^<>])*>$/.test(j)||/^[^\s]*\s+("([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\(([^()\\]|\\.)*\))$/.test(j))&&r.push([H,P+1])}}}r.sort((P,H)=>P[0]-H[0]);const _=[];for(const[P,H]of r){const j=_[_.length-1];j&&P<=j[1]?j[1]=Math.max(j[1],H):_.push([P,H])}const x=P=>{let H=0,j=_.length-1;for(;H<=j;){const Z=H+j>>1,ie=_[Z];if(ie===void 0)return!1;if(P=ie[1])H=Z+1;else return!0}return!1},E=new Uint8Array(t);{let P=-1,H=!1,j=!1,Z=0;for(let ie=0;ie<=t;ie++){const W=ie0&&(Q==="{"?Z++:Q==="}"&&Z--)}}for(let P=0;P=0;P--)n[P]===HF&&(M=P),i[P]=M;const R=/^[\p{L}\p{Nd}\\|{([+.¬°-±×÷′-″←-⇿∀-⋿^_<>=-]$/u,q=/[^\p{L}\p{Nd}\s]$/u,z=/[^\s\u0020-\u007E\u0370-\u03FF\u{1D400}-\u{1D7FF}\p{Nd}¬°-±×÷′-″←-⇿∀-⋿]/u,O=/(?:^|\s)[a-z]{2,}/,B=(P,H)=>{const j=$h(e,P+1);if(j===void 0||!R.test(j))return!1;const Z=i[P+1]??lu;if(Z!==lu){const ie=e.slice(P+1,Z);return!(ie.length===((ie.codePointAt(0)??0)>65535?2:1))&&z.test(ie)||/[,;:!?]$/.test(ie)||/^[a-z]{2,}$/.test(ie)?!1:(o[Z]??0)-(o[P+1]??0)===0&&(s[Z]??0)-(s[P+1]??0)===0}return q.test(H)||z.test(H)||O.test(H)};return(P,H=-1)=>{if(e[P]!=="$"||n[P]===zF||e[P+1]==="$"||e[P-1]==="$"&&H!==P||GIe(e,P)||P+1>=t||PF(e[P+1]))return null;const j=i[P+1]??lu;if(j===lu||(o[j]??0)-(o[P+1]??0)>0||(s[j]??0)-(s[P+1]??0)>0)return null;const Z=e.slice(P+1,j);return/^\{[A-Z_][A-Z0-9_]*(?:\}$|[:-])/.test(Z)||e[j+1]==="{"&&/^\{[A-Za-z_][A-Za-z0-9_]*(?:[:-][^{}]*)?\}$/.test(Z)||O1(KIe(e,P))&&XIe(Z)||ZIe(e,P)&&(B(j,Z)||QIe(e,j)||/\s/.test(Z)&&/\p{Nd}$/u.test(Z)&&!/[+\-*/^=_<>|\\¬°-±×÷′-″←-⇿∀-⋿]/.test(Z)||e[j+1]==="$"&&!/\p{L}/u.test(Z)&&/[^\p{L}\p{Nd}\s]$/u.test(Z))?null:{content:Z,end:j+1}}}const WF=new WeakMap;function tTe(e,t){if(e.src[e.pos]!=="$")return!1;let n=WF.get(e);(!n||n.src!==e.src)&&(n={src:e.src,match:eTe(e.src),lastEnd:-1},WF.set(e,n));const i=n.match(e.pos,n.lastEnd);if(!i||i.end>e.posMax)return!1;if(n.lastEnd=i.end,t)return e.pos=i.end,!0;const o=e.push("math_inline","math",0);return o.content=i.content,o.markup="$",o.raw=e.src.slice(e.pos,i.end),o.loading=!1,e.pos=i.end,!0}function nTe(e){return e.set({typographer:!1}),e.inline.ruler.disable("math"),e.inline.ruler.before("escape","math",tTe),e}const iTe=12e4,oTe=6e4,sTe=32,rTe=3e4,qF=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function lTe(e){let t=0,n=0,i=0;qF.lastIndex=0;let o;for(;(o=qF.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,i=Math.max(i,r.length)}return{codeRenderer:e.length>=iTe||n>=oTe||t>=sTe||i>=rTe?"pre":"shiki",codeFenceCount:t,codeChars:n}}async function EV(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return uTe(e)}function aTe(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||EV(e)}function uTe(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}const cTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dTe(e,t){return k(),L("svg",cTe,[...t[0]||(t[0]=[A("path",{d:"M12.0684 2.03418C12.5654 2.03421 12.9687 2.43755 12.9688 2.93457V11.0996H21.0654C21.5625 11.0996 21.9658 11.503 21.9658 12C21.9658 12.497 21.5625 12.9004 21.0654 12.9004H12.9688V21.0654C12.9687 21.5624 12.5654 21.9658 12.0684 21.9658C11.5713 21.9658 11.168 21.5625 11.168 21.0654V12.9004H2.93457C2.43751 12.9004 2.03418 12.4971 2.03418 12C2.03418 11.5029 2.43751 11.0996 2.93457 11.0996H11.168V2.93457C11.168 2.43753 11.5713 2.03418 12.0684 2.03418Z",fill:"currentColor"},null,-1)])])}const fTe=Et({name:"kimi-add",render:dTe}),hTe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function pTe(e,t){return k(),L("svg",hTe,[...t[0]||(t[0]=[A("path",{id:"p0",d:"M 0 -9.9 C -5.468 -9.9 -9.9 -5.468 -9.9 0 C -9.9 1.923 -9.351 3.719 -8.402 5.239 C -8.402 5.239 -9.483 7.821 -9.483 7.821 C -9.896 8.809 -9.171 9.9 -8.099 9.9 C -8.099 9.9 0 9.9 0 9.9 C 5.468 9.9 9.9 5.468 9.9 0 C 9.9 -5.468 5.468 -9.9 0 -9.9 Z M -8.1 0 C -8.1 -4.474 -4.474 -8.1 0 -8.1 C 4.473 -8.1 8.1 -4.474 8.1 0 C 8.1 4.473 4.473 8.1 -0.001 8.1 C -0.001 8.1 -7.648 8.1 -7.648 8.1 L -6.365 5.035 C -6.365 5.035 -6.648 4.629 -6.648 4.629 C -7.563 3.317 -8.1 1.723 -8.1 0 Z",transform:"matrix(1 0 0 1 12 12)",fill:"currentColor","fill-rule":"evenodd"},null,-1),A("path",{id:"p1",d:"M 3.6 0.5 L -2.6 0.5 M 0.5 -2.573 L 0.5 3.573",transform:"translate(11.5 11.5)",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},null,-1)])])}const mTe=Et({name:"kimi-add-conversation",render:pTe}),gTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function vTe(e,t){return k(),L("svg",gTe,[...t[0]||(t[0]=[A("path",{d:"M15.0996 12C15.5967 12 16 12.4033 16 12.9004C15.9998 13.3973 15.5965 13.7998 15.0996 13.7998H8.90039C8.40346 13.7998 8.00021 13.3973 8 12.9004C8 12.4033 8.40333 12 8.90039 12H15.0996Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19 3.2002C20.5464 3.2002 21.7998 4.4536 21.7998 6V7C21.7998 8.03565 21.2363 8.93754 20.4004 9.42188V17C20.4004 19.1539 18.6539 20.9004 16.5 20.9004H7.5C5.34609 20.9004 3.59961 19.1539 3.59961 17V9.42188C2.76374 8.93754 2.2002 8.03565 2.2002 7V6C2.2002 4.4536 3.4536 3.2002 5 3.2002H19ZM5.40039 17C5.40039 18.1598 6.3402 19.0996 7.5 19.0996H16.5C17.6598 19.0996 18.5996 18.1598 18.5996 17V9.7998H5.40039V17ZM4.89746 5.00488C4.39333 5.05621 4 5.48232 4 6V7L4.00488 7.10254C4.05278 7.57297 4.42703 7.94722 4.89746 7.99512L5 8H19C19.5523 8 20 7.55228 20 7V6C20 5.44772 19.5523 5 19 5H5L4.89746 5.00488Z",fill:"currentColor"},null,-1)])])}const yTe=Et({name:"kimi-archive",render:vTe}),kTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bTe(e,t){return k(),L("svg",kTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.386 21.6387C11.7378 21.988 12.3059 21.987 12.6565 21.6364L18.1949 16.098C18.5464 15.7465 18.5464 15.1766 18.1949 14.8252C17.8434 14.4737 17.2736 14.4737 16.9221 14.8252L12.9201 18.8272V3.00002C12.9201 2.50297 12.5171 2.10003 12.0201 2.10003C11.523 2.10003 11.1201 2.50297 11.1201 3.00002V18.8383L7.07554 14.8229C6.7228 14.4727 6.15295 14.4747 5.80275 14.8275C5.45255 15.1802 5.45461 15.7501 5.80735 16.1003L11.386 21.6387Z",fill:"currentColor"},null,-1)])])}const wTe=Et({name:"kimi-arrow-down",render:bTe}),CTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ATe(e,t){return k(),L("svg",CTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.16127 12.814C1.81197 12.4622 1.81299 11.8941 2.16357 11.5435L7.70203 6.00506C8.0535 5.65359 8.62335 5.65359 8.97482 6.00506C9.32629 6.35653 9.32629 6.92638 8.97482 7.27785L4.97276 11.2799H20.8C21.297 11.2799 21.7 11.6829 21.7 12.1799C21.7 12.677 21.297 13.0799 20.8 13.0799H4.96171L8.97712 17.1244C9.32732 17.4772 9.32526 18.047 8.97252 18.3972C8.61978 18.7474 8.04993 18.7454 7.69973 18.3926L2.16127 12.814Z",fill:"currentColor"},null,-1)])])}const xTe=Et({name:"kimi-arrow-left",render:ATe}),STe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function _Te(e,t){return k(),L("svg",STe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.4387 12.814C21.788 12.4622 21.787 11.8941 21.4364 11.5436L15.8979 6.0051C15.5464 5.65363 14.9766 5.65363 14.6251 6.0051C14.2737 6.35657 14.2737 6.92642 14.6251 7.27789L18.6272 11.28H2.79998C2.30293 11.28 1.89998 11.6829 1.89998 12.18C1.89998 12.677 2.30293 13.08 2.79998 13.08H18.6382L14.6228 17.1245C14.2726 17.4772 14.2747 18.0471 14.6274 18.3973C14.9802 18.7475 15.55 18.7454 15.9002 18.3927L21.4387 12.814Z",fill:"currentColor"},null,-1)])])}const MTe=Et({name:"kimi-arrow-right",render:_Te}),ITe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function TTe(e,t){return k(),L("svg",ITe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.386 2.36129C11.7378 2.01198 12.3059 2.013 12.6565 2.36358L18.1949 7.90204C18.5464 8.25351 18.5464 8.82336 18.1949 9.17483C17.8434 9.52631 17.2736 9.52631 16.9221 9.17483L12.9201 5.17277V21C12.9201 21.497 12.5171 21.9 12.0201 21.9C11.523 21.9 11.1201 21.497 11.1201 21V5.16172L7.07554 9.17713C6.7228 9.52733 6.15295 9.52527 5.80275 9.17253C5.45255 8.81979 5.45461 8.24995 5.80735 7.89975L11.386 2.36129Z",fill:"currentColor"},null,-1)])])}const ETe=Et({name:"kimi-arrow-up",render:TTe}),LTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function NTe(e,t){return k(),L("svg",LTe,[...t[0]||(t[0]=[A("path",{d:"M19.3027 5.9053C19.6542 5.55397 20.2247 5.55388 20.5761 5.9053C20.9273 6.25675 20.9273 6.82734 20.5761 7.17874L9.65911 18.0948C9.30773 18.4461 8.73814 18.446 8.38665 18.0948L3.42376 13.1328C3.0726 12.7814 3.07263 12.2118 3.42376 11.8604C3.77524 11.509 4.34575 11.5089 4.6972 11.8604L9.02239 16.1856L19.3027 5.9053Z",fill:"currentColor"},null,-1)])])}const DTe=Et({name:"kimi-check",render:NTe}),FTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function BTe(e,t){return k(),L("svg",FTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.3912 16.7134C11.743 17.0627 12.3111 17.0617 12.6617 16.7111L19.6364 9.73641C19.9878 9.38494 19.9878 8.81509 19.6364 8.46362C19.2849 8.11215 18.7151 8.11215 18.3636 8.46362L12.023 14.8042L5.63407 8.46132C5.28133 8.11112 4.71149 8.11318 4.36129 8.46592C4.01109 8.81866 4.01314 9.3885 4.36588 9.73871L11.3912 16.7134Z",fill:"currentColor"},null,-1)])])}const RTe=Et({name:"kimi-chevron-down",render:BTe}),$Te={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function OTe(e,t){return k(),L("svg",$Te,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.1261 12.6088C16.4754 12.257 16.4743 11.6889 16.1238 11.3383L9.14904 4.36363C8.79757 4.01216 8.22772 4.01216 7.87625 4.36363C7.52477 4.7151 7.52477 5.28495 7.87625 5.63642L14.2169 11.977L7.87395 18.3659C7.52375 18.7187 7.52581 19.2885 7.87855 19.6387C8.23129 19.9889 8.80113 19.9869 9.15133 19.6341L16.1261 12.6088Z",fill:"currentColor"},null,-1)])])}const PTe=Et({name:"kimi-chevron-right",render:OTe}),zTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function jTe(e,t){return k(),L("svg",zTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.3912 8.46132C11.743 8.11202 12.3111 8.11304 12.6617 8.46362L19.6364 15.4383C19.9878 15.7898 19.9878 16.3597 19.6364 16.7111C19.2849 17.0626 18.7151 17.0626 18.3636 16.7111L12.023 10.3705L5.63407 16.7134C5.28133 17.0636 4.71149 17.0616 4.36129 16.7088C4.01109 16.3561 4.01314 15.7862 4.36588 15.436L11.3912 8.46132Z",fill:"currentColor"},null,-1)])])}const HTe=Et({name:"kimi-chevron-up",render:jTe}),WTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qTe(e,t){return k(),L("svg",WTe,[...t[0]||(t[0]=[A("circle",{cx:"12",cy:"12",r:"10.875",stroke:"currentColor","stroke-width":"2.25"},null,-1),A("path",{d:"M7.125 12.6L10.65 16.125L17.025 8.85",stroke:"currentColor","stroke-width":"2.25","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const UTe=Et({name:"kimi-circle-check",render:qTe}),VTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function KTe(e,t){return k(),L("svg",VTe,[...t[0]||(t[0]=[A("path",{d:"M11.8999 6.79965C12.397 6.79965 12.7997 7.20235 12.7997 7.69941V11.7266L14.7359 13.6629C15.0873 14.0143 15.0879 14.584 14.7366 14.9355C14.3852 15.287 13.8148 15.287 13.4633 14.9355L11.2632 12.7355C11.0947 12.5668 11.0002 12.338 11.0001 12.0995V7.69941C11.0001 7.20238 11.4029 6.7997 11.8999 6.79965Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 1.89893C17.4677 1.89893 21.9001 6.33147 21.9002 11.7991C21.9002 17.2669 17.4678 21.6993 12 21.6993C6.53228 21.6993 2.09985 17.2669 2.09985 11.7991C2.09998 6.33147 6.53236 1.89893 12 1.89893ZM20.1 11.7998C20.1 7.32616 16.4737 3.69984 12 3.69984C7.5264 3.69984 3.90008 7.32616 3.90008 11.7998C3.90032 16.2732 7.52655 19.8998 12 19.8998C16.4735 19.8998 20.0998 16.2732 20.1 11.7998Z",fill:"currentColor"},null,-1)])])}const ZTe=Et({name:"kimi-clock",render:KTe}),GTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function QTe(e,t){return k(),L("svg",GTe,[...t[0]||(t[0]=[A("path",{d:"M17.9542 4.77253C18.3056 4.42106 18.8761 4.42106 19.2276 4.77253C19.579 5.12401 19.579 5.69452 19.2276 6.04597L13.2735 12.0001L19.2276 17.9542C19.5791 18.3056 19.5791 18.8761 19.2276 19.2276C18.8761 19.5791 18.3056 19.5791 17.9542 19.2276L12.0001 13.2735L6.04595 19.2276C5.69451 19.5791 5.12399 19.579 4.77252 19.2276C4.42104 18.8761 4.42104 18.3056 4.77252 17.9542L10.7266 12.0001L4.77252 6.04597C4.42104 5.6945 4.42104 5.124 4.77252 4.77253C5.12399 4.42107 5.69448 4.42106 6.04595 4.77253L12.0001 10.7266L17.9542 4.77253Z",fill:"currentColor"},null,-1)])])}const YTe=Et({name:"kimi-close",render:QTe}),JTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XTe(e,t){return k(),L("svg",JTe,[...t[0]||(t[0]=[A("path",{d:"M9.85815 11.957C10.9074 11.957 11.7583 12.8083 11.7585 13.8574V19.8574C11.7585 20.3545 11.3552 20.7578 10.8582 20.7578C10.3611 20.7578 9.95776 20.3545 9.95776 19.8574V13.8574C9.95755 13.8024 9.91325 13.7578 9.85815 13.7578H3.85815C3.3611 13.7578 2.95776 13.3545 2.95776 12.8574C2.95798 12.3605 3.36123 11.957 3.85815 11.957H9.85815Z",fill:"currentColor"},null,-1),A("path",{d:"M12.8582 2.95703C13.3551 2.95703 13.7583 3.36054 13.7585 3.85742V9.85742C13.7585 9.91265 13.8029 9.95703 13.8582 9.95703H19.8582C20.3551 9.95703 20.7583 10.3605 20.7585 10.8574C20.7585 11.3545 20.3552 11.7578 19.8582 11.7578H13.8582C12.8088 11.7578 11.9578 10.9068 11.9578 9.85742V3.85742C11.958 3.36054 12.3612 2.95703 12.8582 2.95703Z",fill:"currentColor"},null,-1)])])}const eEe=Et({name:"kimi-collapse",render:XTe}),tEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nEe(e,t){return k(),L("svg",tEe,[...t[0]||(t[0]=[A("path",{d:"M11.9004 2.19995C17.3678 2.20016 21.7998 6.63285 21.7998 12.1003C21.7996 17.5677 17.3677 21.9995 11.9004 21.9998H3.80078C2.72946 21.9996 2.00334 20.9089 2.41699 19.9207L3.49805 17.3386C2.54871 15.8189 2.00007 14.0226 2 12.1003C2 6.63272 6.43277 2.19995 11.9004 2.19995ZM11.9004 3.99976C7.42688 3.99976 3.7998 7.62684 3.7998 12.1003C3.79989 13.8228 4.33669 15.4175 5.25195 16.7292L5.53516 17.1345L4.25195 20.2H11.8994C16.3727 20.1999 19.9998 16.5736 20 12.1003C20 7.62697 16.3737 3.99997 11.9004 3.99976ZM8.9541 10.8005C9.75473 10.8006 10.4041 11.4491 10.4043 12.2498C10.4043 13.0505 9.75482 13.6998 8.9541 13.7C8.15329 13.7 7.50391 13.0506 7.50391 12.2498C7.50406 11.4491 8.15339 10.8005 8.9541 10.8005ZM15.1533 10.8005C15.9539 10.8006 16.6034 11.4491 16.6035 12.2498C16.6035 13.0505 15.954 13.6998 15.1533 13.7C14.3525 13.7 13.7031 13.0506 13.7031 12.2498C13.7033 11.4491 14.3526 10.8005 15.1533 10.8005Z",fill:"currentColor"},null,-1)])])}const iEe=Et({name:"kimi-comment",render:nEe}),oEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function sEe(e,t){return k(),L("svg",oEe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 7.09961C19.1539 7.09961 20.9004 8.84609 20.9004 11V17C20.9004 19.1539 19.1539 20.9004 17 20.9004H11C8.84609 20.9004 7.09961 19.1539 7.09961 17V11C7.09961 8.84609 8.84609 7.09961 11 7.09961H17ZM11 8.90039C9.8402 8.90039 8.90039 9.8402 8.90039 11V17C8.90039 18.1598 9.8402 19.0996 11 19.0996H17C18.1598 19.0996 19.0996 18.1598 19.0996 17V11C19.0996 9.8402 18.1598 8.90039 17 8.90039H11Z",fill:"currentColor"},null,-1),A("path",{d:"M13 3.09961C14.4447 3.09961 15.705 3.88644 16.3779 5.0498C16.6265 5.47999 16.4789 6.03049 16.0488 6.2793C15.6186 6.52781 15.0681 6.38029 14.8193 5.9502C14.4548 5.32041 13.776 4.90039 13 4.90039H7C5.8402 4.90039 4.90039 5.8402 4.90039 7V13C4.90039 13.776 5.32041 14.4548 5.9502 14.8193C6.38029 15.0681 6.52781 15.6186 6.2793 16.0488C6.03049 16.4789 5.47999 16.6265 5.0498 16.3779C3.88644 15.705 3.09961 14.4447 3.09961 13V7C3.09961 4.84609 4.84609 3.09961 7 3.09961H13Z",fill:"currentColor"},null,-1)])])}const rEe=Et({name:"kimi-copy",render:sEe}),lEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function aEe(e,t){return k(),L("svg",lEe,[...t[0]||(t[0]=[A("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 10.2797 2.43414 8.66074 3.19922 7.24707C3.20172 7.24246 3.20453 7.23801 3.20703 7.2334C3.33385 6.99995 3.47181 6.77351 3.61621 6.55176C3.73214 6.37355 3.85079 6.19744 3.97754 6.02734C5.35905 4.17471 7.36856 2.81959 9.68945 2.27051C9.69952 2.26813 9.70965 2.26602 9.71973 2.26367C9.85224 2.23276 9.98563 2.2043 10.1201 2.17871C10.1542 2.17221 10.1884 2.16631 10.2227 2.16016C10.3466 2.13791 10.4712 2.11724 10.5967 2.09961C10.6301 2.09489 10.6637 2.0913 10.6973 2.08691C10.8216 2.07073 10.9465 2.05552 11.0723 2.04395C11.1125 2.04022 11.153 2.0384 11.1934 2.03516C11.4595 2.0139 11.7284 2 12 2ZM11.9941 3.7998C11.9968 3.86623 12 3.93292 12 4C12 6.76142 9.76142 9 7 9C6.14209 9 5.33517 8.78324 4.62988 8.40234C4.09862 9.48861 3.7998 10.7093 3.7998 12C3.7998 12.4438 3.83644 12.8791 3.9043 13.3037C4.52807 12.5673 5.45945 12.0996 6.5 12.0996C8.37777 12.0996 9.90039 13.6222 9.90039 15.5C9.90039 17.0702 8.83532 18.3903 7.38867 18.7812C8.70267 19.6765 10.2901 20.2002 12 20.2002C12.468 20.2002 12.9264 20.1583 13.373 20.083C13.1323 19.4342 13 18.7327 13 18C13 14.6863 15.6863 12 19 12C19.4098 12 19.8098 12.0416 20.1963 12.1201C20.1969 12.0801 20.2002 12.0401 20.2002 12C20.2002 7.47126 16.5287 3.7998 12 3.7998H11.9941ZM19 13.7998C16.6804 13.7998 14.7998 15.6804 14.7998 18C14.7998 18.5617 14.9112 19.0972 15.1113 19.5869C17.5225 18.597 19.3558 16.4929 19.9727 13.9141C19.6605 13.8399 19.3349 13.7998 19 13.7998ZM6.5 13.9004C5.61634 13.9004 4.90039 14.6163 4.90039 15.5C4.90039 16.3837 5.61634 17.0996 6.5 17.0996C7.38366 17.0996 8.09961 16.3837 8.09961 15.5C8.09961 14.6163 7.38366 13.9004 6.5 13.9004ZM15.5 6.09961C16.8255 6.09961 17.9004 7.17452 17.9004 8.5C17.9004 9.82548 16.8255 10.9004 15.5 10.9004C14.1745 10.9004 13.0996 9.82548 13.0996 8.5C13.0996 7.17452 14.1745 6.09961 15.5 6.09961ZM15.5 7.90039C15.1686 7.90039 14.9004 8.16863 14.9004 8.5C14.9004 8.83137 15.1686 9.09961 15.5 9.09961C15.8314 9.09961 16.0996 8.83137 16.0996 8.5C16.0996 8.16863 15.8314 7.90039 15.5 7.90039ZM10.1992 4C8.35326 4.41375 6.74333 5.44923 5.59961 6.87598C6.02235 7.08306 6.49716 7.2002 7 7.2002C8.76731 7.2002 10.1992 5.76731 10.1992 4Z",fill:"currentColor"},null,-1)])])}const uEe=Et({name:"kimi-dark-mode",render:aEe}),cEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dEe(e,t){return k(),L("svg",cEe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.90002C12.4971 2.90002 12.9 3.30297 12.9 3.80002V12.2939L15.8081 9.38585C16.1595 9.03438 16.7294 9.03438 17.0808 9.38585C17.4323 9.73732 17.4323 10.3072 17.0808 10.6586L12.6364 15.1031C12.4676 15.2719 12.2387 15.3667 12 15.3667C11.7613 15.3667 11.5324 15.2719 11.3636 15.1031L6.91917 10.6586C6.5677 10.3072 6.5677 9.73732 6.91917 9.38585C7.27064 9.03438 7.84049 9.03438 8.19196 9.38585L11.1 12.2939V3.80002C11.1 3.30297 11.503 2.90002 12 2.90002ZM4.00001 13.5874C4.49706 13.5874 4.90001 13.9903 4.90001 14.4874V18.043C4.90001 18.2758 4.99249 18.499 5.1571 18.6636C5.32172 18.8282 5.54498 18.9207 5.77778 18.9207H18.2222C18.455 18.9207 18.6783 18.8283 18.8429 18.6636C19.0075 18.499 19.1 18.2758 19.1 18.043V14.4874C19.1 13.9903 19.5029 13.5874 20 13.5874C20.4971 13.5874 20.9 13.9903 20.9 14.4874V18.043C20.9 18.7531 20.6179 19.4342 20.1157 19.9364C19.6135 20.4386 18.9324 20.7207 18.2222 20.7207H5.77778C5.06759 20.7207 4.38649 20.4386 3.88431 19.9364C3.38213 19.4342 3.10001 18.7531 3.10001 18.043V14.4874C3.10001 13.9903 3.50295 13.5874 4.00001 13.5874Z",fill:"currentColor"},null,-1)])])}const fEe=Et({name:"kimi-download",render:dEe}),hEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pEe(e,t){return k(),L("svg",hEe,[...t[0]||(t[0]=[A("path",{d:"M18.0179 3.09998C18.3963 3.10003 18.7709 3.17491 19.1205 3.31971C19.4701 3.46454 19.7884 3.67614 20.056 3.94373C20.3237 4.21144 20.5362 4.52965 20.681 4.87928C20.8258 5.22887 20.8997 5.60423 20.8997 5.9828C20.8997 6.36118 20.8257 6.73591 20.681 7.08533C20.5362 7.43497 20.3237 7.75317 20.056 8.02088L17.639 10.4379L9.15756 18.9183C8.5296 19.5463 7.74274 19.992 6.8812 20.2074L4.21811 20.8734C3.91148 20.95 3.5871 20.8596 3.36362 20.6361C3.14017 20.4126 3.05063 20.0883 3.12729 19.7816L3.79233 17.1185C4.00771 16.257 4.45344 15.4701 5.08139 14.8422L15.9798 3.94373C16.5203 3.40346 17.2536 3.09998 18.0179 3.09998ZM19.0003 19.1C19.4972 19.1002 19.8997 19.5034 19.8997 20.0004C19.8995 20.4971 19.4971 20.8996 19.0003 20.8998H12.0003C11.5034 20.8998 11.1001 20.4973 11.0999 20.0004C11.0999 19.5033 11.5033 19.1 12.0003 19.1H19.0003ZM18.0179 4.89979C17.7309 4.89979 17.4553 5.01417 17.2523 5.21717L6.35385 16.1146C5.95661 16.5119 5.67469 17.01 5.53842 17.5551L5.23666 18.7631L6.44467 18.4613C6.98971 18.3251 7.48782 18.0431 7.8851 17.6459L18.7826 6.74744C18.883 6.64702 18.9635 6.52821 19.0179 6.39686C19.0723 6.26558 19.0999 6.1247 19.0999 5.9828C19.0999 5.84075 19.0723 5.69916 19.0179 5.56776C18.9635 5.43645 18.883 5.31757 18.7826 5.21717C18.6821 5.11678 18.5631 5.03716 18.432 4.9828C18.3008 4.92845 18.16 4.89983 18.0179 4.89979Z",fill:"currentColor"},null,-1)])])}const mEe=Et({name:"kimi-edit",render:pEe}),gEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function vEe(e,t){return k(),L("svg",gEe,[...t[0]||(t[0]=[A("path",{d:"M5 11.0996C5.49693 11.0996 5.90018 11.5031 5.90039 12V18C5.90039 18.0552 5.94477 18.0996 6 18.0996H12C12.4969 18.0996 12.9002 18.5031 12.9004 19C12.9004 19.4971 12.4971 19.9004 12 19.9004H6C4.95066 19.9004 4.09961 19.0493 4.09961 18V12C4.09982 11.5031 4.50307 11.0996 5 11.0996ZM18 4.09961C19.0492 4.09961 19.9002 4.95084 19.9004 6V12C19.9004 12.4971 19.4971 12.9004 19 12.9004C18.5029 12.9004 18.0996 12.4971 18.0996 12V6C18.0994 5.94495 18.0551 5.90039 18 5.90039H12C11.5029 5.90039 11.0996 5.49706 11.0996 5C11.0998 4.50312 11.5031 4.09961 12 4.09961H18Z",fill:"currentColor"},null,-1)])])}const yEe=Et({name:"kimi-expand",render:vEe}),kEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bEe(e,t){return k(),L("svg",kEe,[...t[0]||(t[0]=[A("g",null,[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1723 2.1001C13.9413 2.10018 14.6793 2.40592 15.2231 2.94971L19.0512 6.77783C19.595 7.32162 19.9007 8.0596 19.9008 8.82861V18.0005C19.9008 20.1544 18.1543 21.9009 16.0004 21.9009H8.0004C5.84649 21.9009 4.10001 20.1544 4.10001 18.0005V6.00049C4.10001 3.84658 5.84649 2.1001 8.0004 2.1001H13.1723ZM8.0004 3.90088C6.8406 3.90088 5.90079 4.84069 5.90079 6.00049V18.0005C5.90079 19.1603 6.8406 20.1001 8.0004 20.1001H16.0004C17.1602 20.1001 18.1 19.1603 18.1 18.0005V9.90088H15.0004C13.3988 9.90088 12.1 8.60211 12.1 7.00049V3.90088H8.0004ZM13.9008 7.00049C13.9008 7.608 14.3929 8.1001 15.0004 8.1001H17.8217C17.8072 8.08375 17.7933 8.06681 17.7777 8.05127L13.9496 4.22314C13.9339 4.20745 13.9173 4.19286 13.9008 4.17822V7.00049Z",fill:"currentColor"})],-1)])])}const UF=Et({name:"kimi-file",render:bEe}),wEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function CEe(e,t){return k(),L("svg",wEe,[...t[0]||(t[0]=[A("path",{d:"M15.4795 15.4971C15.9765 15.4971 16.3799 15.9004 16.3799 16.3975C16.3799 16.8945 15.9765 17.2978 15.4795 17.2979H8.52051C8.02345 17.2979 7.62012 16.8945 7.62012 16.3975C7.62012 15.9004 8.02345 15.4971 8.52051 15.4971H15.4795Z",fill:"currentColor"},null,-1),A("path",{d:"M12.3359 11.0996C12.8329 11.0997 13.2354 11.503 13.2354 12C13.2354 12.497 12.8329 12.9003 12.3359 12.9004H8.52051C8.02345 12.9004 7.62012 12.4971 7.62012 12C7.62012 11.5029 8.02345 11.0996 8.52051 11.0996H12.3359Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1719 2.09961C13.9408 2.09969 14.6789 2.40555 15.2227 2.94922L19.0508 6.77734C19.5946 7.32113 19.9003 8.05911 19.9004 8.82812V18C19.9004 20.1539 18.1539 21.9004 16 21.9004H8C5.84626 21.9002 4.09961 20.1538 4.09961 18V6C4.09961 3.84621 5.84626 2.09981 8 2.09961H13.1719ZM8 3.90039C6.84037 3.90059 5.90039 4.84032 5.90039 6V18C5.90039 19.1597 6.84037 20.0994 8 20.0996H16C17.1598 20.0996 18.0996 19.1598 18.0996 18V9.90039H15C13.3985 9.90019 12.0996 8.6015 12.0996 7V3.90039H8ZM13.9004 7C13.9004 7.60739 14.3927 8.09941 15 8.09961H17.8213C17.8068 8.08333 17.7928 8.06626 17.7773 8.05078L13.9492 4.22266C13.9335 4.20696 13.9169 4.19237 13.9004 4.17773V7Z",fill:"currentColor"},null,-1)])])}const AEe=Et({name:"kimi-file-text",render:CEe}),xEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function SEe(e,t){return k(),L("svg",xEe,[...t[0]||(t[0]=[A("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const _Ee=Et({name:"kimi-folder",render:SEe}),MEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function IEe(e,t){return k(),L("svg",MEe,[...t[0]||(t[0]=[A("g",null,[A("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"})],-1)])])}const TEe=Et({name:"kimi-folder-open",render:IEe}),EEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function LEe(e,t){return k(),L("svg",EEe,[...t[0]||(t[0]=[A("path",{d:"M9.5 3Q10.8 8.2 16 9.5Q10.8 10.8 9.5 16Q8.2 10.8 3 9.5Q8.2 8.2 9.5 3Z",fill:"currentColor"},null,-1),A("path",{d:"M17.25 13.5Q18 16.5 21 17.25Q18 18 17.25 21Q16.5 18 13.5 17.25Q16.5 16.5 17.25 13.5Z",fill:"currentColor"},null,-1)])])}const NEe=Et({name:"kimi-gen-title",render:LEe}),DEe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function FEe(e,t){return k(),L("svg",DEe,[...t[0]||(t[0]=[A("path",{id:"af-p0",d:"M -2.619 -8.3 C -1.815 -8.3 -1.048 -7.97 -0.499 -7.39 C -0.499 -7.39 0.141 -6.712 0.141 -6.712 C 0.141 -6.712 5.75 -6.712 5.75 -6.712 C 7.904 -6.712 9.65 -4.986 9.65 -2.858 C 9.65 -2.858 9.65 -1.71 9.65 -1.71 C 9.65 -1.219 9.247 -0.821 8.75 -0.821 C 8.253 -0.821 7.85 -1.219 7.85 -1.71 C 7.85 -1.71 7.85 -2.858 7.85 -2.858 C 7.849 -4.004 6.91 -4.934 5.75 -4.934 C 5.75 -4.934 -0.207 -4.934 -0.207 -4.934 C -0.484 -4.934 -0.749 -5.047 -0.938 -5.247 C -0.938 -5.247 -1.815 -6.177 -1.815 -6.177 C -2.023 -6.397 -2.315 -6.521 -2.619 -6.521 C -2.619 -6.521 -6.25 -6.521 -6.25 -6.521 C -7.41 -6.521 -8.35 -5.592 -8.35 -4.446 C -8.35 -4.446 -8.35 4.446 -8.35 4.446 C -8.35 5.592 -7.41 6.521 -6.25 6.521 C -6.25 6.521 1.25 6.521 1.25 6.521 C 1.747 6.521 2.15 6.919 2.15 7.41 C 2.15 7.901 1.747 8.3 1.25 8.3 C 1.25 8.3 -6.25 8.3 -6.25 8.3 C -8.404 8.3 -10.15 6.574 -10.15 4.446 C -10.15 4.446 -10.15 -4.446 -10.15 -4.446 C -10.15 -6.574 -8.404 -8.3 -6.25 -8.3 C -6.25 -8.3 -2.619 -8.3 -2.619 -8.3 Z M 3.75 -2.5 C 4.247 -2.5 4.65 -2.097 4.65 -1.6 C 4.65 -1.103 4.247 -0.699 3.75 -0.699 C 3.75 -0.699 -4.25 -0.699 -4.25 -0.699 C -4.747 -0.699 -5.15 -1.103 -5.15 -1.6 C -5.15 -2.097 -4.747 -2.5 -4.25 -2.5 C -4.25 -2.5 3.75 -2.5 3.75 -2.5 Z",transform:"matrix(1 0 0 1 11.75 12)",fill:"currentColor"},null,-1),A("g",{id:"af-p1"},[A("path",{d:"M 2.635 0 L -2.635 0 M 0 -2.635 L 0 2.635",transform:"matrix(1 0 0 1 18.4 16.3)",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1)])])}const BEe=Et({name:"kimi-folder-plus",render:FEe}),REe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function $Ee(e,t){return k(),L("svg",REe,[...t[0]||(t[0]=[A("path",{d:"M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3ZM12 19.2002C15.9764 19.2002 19.2002 15.9764 19.2002 12C19.2002 8.02355 15.9764 4.7998 12 4.7998V19.2002Z",fill:"currentColor"},null,-1)])])}const OEe=Et({name:"kimi-follow-system",render:$Ee}),PEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zEe(e,t){return k(),L("svg",PEe,[...t[0]||(t[0]=[A("path",{d:"M17 2C19.2091 2 21 3.79086 21 6V15.7646C21 17.2361 20.192 18.5884 18.8965 19.2861L13.8965 21.9785C12.7126 22.616 11.2874 22.616 10.1035 21.9785L5.10352 19.2861C3.80802 18.5884 3 17.2361 3 15.7646V6C3 3.79086 4.79086 2 7 2H17ZM7 3.7998C5.78498 3.7998 4.79981 4.78497 4.7998 6V15.7646C4.7998 16.574 5.24443 17.3184 5.95703 17.7021L10.957 20.3936C11.6082 20.7442 12.3918 20.7442 13.043 20.3936L18.043 17.7021C18.7556 17.3184 19.2002 16.574 19.2002 15.7646V6C19.2002 4.78497 18.215 3.7998 17 3.7998H7ZM12 15.6992C12.4968 15.6992 12.8994 16.1028 12.8994 16.5996C12.8994 17.0964 12.4968 17.5 12 17.5C11.5024 17.5 11.0996 17.0964 11.0996 16.5996C11.0996 16.1028 11.5024 15.6992 12 15.6992ZM12 6.49902C12.4969 6.49922 12.8994 6.86908 12.8994 7.3252V13.6729C12.8994 14.129 12.4969 14.4988 12 14.499C11.5029 14.499 11.0996 14.1291 11.0996 13.6729V7.3252C11.0996 6.86896 11.5029 6.49902 12 6.49902Z",fill:"currentColor"},null,-1)])])}const jEe=Et({name:"kimi-full-access",render:zEe}),HEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WEe(e,t){return k(),L("svg",HEe,[...t[0]||(t[0]=[A("path",{d:"M12.5092 2.11279C17.7402 2.37781 21.8998 6.70364 21.8998 12.0005C21.8996 17.4153 17.5524 21.8108 12.1576 21.895C12.1056 21.898 12.0532 21.8999 12.0004 21.8999C11.948 21.8999 11.8954 21.8968 11.8432 21.896L11.8422 21.895C6.44751 21.8107 2.10022 17.4152 2.10001 12.0005C2.10001 6.53287 6.53278 2.1001 12.0004 2.1001L12.5092 2.11279ZM8.92715 13.0005C9.02896 14.9787 9.42581 16.721 9.99356 17.9985C10.3249 18.7441 10.6971 19.292 11.0639 19.6411C11.4259 19.9855 11.741 20.1001 12.0004 20.1001C12.2598 20.1 12.5749 19.9856 12.9369 19.6411C13.3037 19.292 13.6749 18.7441 14.0063 17.9985C14.574 16.721 14.9718 14.9788 15.0736 13.0005H8.92715ZM3.96329 13.0005C4.31462 15.8522 6.14714 18.2427 8.66837 19.3823C8.55544 19.1733 8.44916 18.9552 8.34903 18.73C7.66574 17.1926 7.22657 15.1926 7.12344 13.0005H3.96329ZM16.8764 13.0005C16.7732 15.1926 16.3341 17.1926 15.6508 18.73C15.5506 18.9554 15.4435 19.1732 15.3305 19.3823C17.8522 18.2429 19.6851 15.8525 20.0365 13.0005H16.8764ZM8.66934 4.6167C6.08869 5.78266 4.22826 8.25964 3.93985 11.1997H7.11661C7.20176 8.92954 7.64512 6.85497 8.34903 5.271C8.4494 5.04516 8.5561 4.82619 8.66934 4.6167ZM12.0004 3.8999C11.7411 3.8999 11.4259 4.01454 11.0639 4.35889C10.6971 4.70797 10.3249 5.25587 9.99356 6.00146C9.40671 7.32188 9.00186 9.13885 8.91739 11.1997H15.0834C14.9989 9.13884 14.5931 7.32189 14.0063 6.00146C13.6749 5.2559 13.3037 4.70796 12.9369 4.35889C12.5749 4.0144 12.2598 3.90002 12.0004 3.8999ZM15.3295 4.61572C15.443 4.82559 15.5502 5.04471 15.6508 5.271C16.3547 6.85498 16.799 8.92949 16.8842 11.1997H20.06C19.7715 8.25914 17.9108 5.78143 15.3295 4.61572Z",fill:"currentColor"},null,-1)])])}const qEe=Et({name:"kimi-globe",render:WEe}),UEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VEe(e,t){return k(),L("svg",UEe,[...t[0]||(t[0]=[A("path",{d:"M8 17C8.82834 17 9.5 17.6717 9.5 18.5C9.5 19.3283 8.82834 20 8 20C7.17166 20 6.5 19.3283 6.5 18.5C6.5 17.6717 7.17166 17 8 17ZM16 17C16.8283 17 17.5 17.6717 17.5 18.5C17.5 19.3283 16.8283 20 16 20C15.1717 20 14.5 19.3283 14.5 18.5C14.5 17.6717 15.1717 17 16 17ZM8 10.5C8.82834 10.5 9.5 11.1717 9.5 12C9.5 12.8283 8.82834 13.5 8 13.5C7.17166 13.5 6.5 12.8283 6.5 12C6.5 11.1717 7.17166 10.5 8 10.5ZM16 10.5C16.8283 10.5 17.5 11.1717 17.5 12C17.5 12.8283 16.8283 13.5 16 13.5C15.1717 13.5 14.5 12.8283 14.5 12C14.5 11.1717 15.1717 10.5 16 10.5ZM8 4C8.82834 4 9.5 4.67166 9.5 5.5C9.5 6.32834 8.82834 7 8 7C7.17166 7 6.5 6.32834 6.5 5.5C6.5 4.67166 7.17166 4 8 4ZM16 4C16.8283 4 17.5 4.67166 17.5 5.5C17.5 6.32834 16.8283 7 16 7C15.1717 7 14.5 6.32834 14.5 5.5C14.5 4.67166 15.1717 4 16 4Z",fill:"currentColor"},null,-1)])])}const KEe=Et({name:"kimi-grip",render:VEe}),ZEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GEe(e,t){return k(),L("svg",ZEe,[...t[0]||(t[0]=[A("path",{d:"M7.22264 6.10352C7.22264 5.5078 7.48259 4.95449 7.91405 4.56055C8.34271 4.16918 8.90831 3.96198 9.48241 3.96191C9.64155 3.96191 9.80001 3.97936 9.95507 4.01074C10.0127 3.5042 10.2586 3.04178 10.6338 2.69922C11.0625 2.30778 11.6279 2.09961 12.2021 2.09961C12.7763 2.09966 13.3418 2.30783 13.7705 2.69922C13.9947 2.90401 14.1709 3.15244 14.29 3.42676C14.4947 3.37044 14.7071 3.34182 14.9209 3.3418C15.4951 3.3418 16.0605 3.549 16.4892 3.94043C16.8644 4.28293 17.1093 4.74548 17.167 5.25195C17.3223 5.22045 17.4812 5.20312 17.6406 5.20312C18.2147 5.20318 18.7803 5.41135 19.209 5.80273C19.6402 6.19663 19.9004 6.74922 19.9004 7.34473V14.6543C19.9004 17.413 19.2914 19.0434 18.0137 20.21C16.82 21.2998 15.2175 21.9004 13.5615 21.9004C11.7538 21.9004 10.2315 21.5696 8.95702 20.8535C7.67664 20.1341 6.71683 19.0652 5.97362 17.708L3.3496 12.916C3.18848 12.6213 3.10112 12.2914 3.0996 11.9531C3.09812 11.6147 3.18309 11.2835 3.34179 10.9873C3.5001 10.692 3.72639 10.4416 3.99706 10.251C4.26771 10.0604 4.57776 9.93235 4.90136 9.87305C5.56617 9.75102 6.25934 9.84517 6.86425 10.1445C6.9942 10.2088 7.11461 10.2788 7.22264 10.3477V6.10352ZM9.02343 12.7969C9.02336 13.1912 8.76624 13.5395 8.38964 13.6562C8.0129 13.773 7.60387 13.6309 7.38085 13.3057L6.53514 12.0723C6.51218 12.0529 6.48411 12.0282 6.45018 12.002C6.34595 11.9213 6.20986 11.8289 6.06639 11.7578C5.81525 11.6335 5.51637 11.5904 5.22655 11.6436H5.22557C5.15055 11.6573 5.08558 11.6865 5.03417 11.7227C4.98289 11.7588 4.94815 11.7998 4.92772 11.8379C4.90762 11.8755 4.90023 11.9122 4.90038 11.9453C4.90057 11.9782 4.9084 12.0144 4.9287 12.0518L7.55272 16.8438C8.16912 17.9693 8.90989 18.7622 9.83886 19.2842C10.7737 19.8094 11.9704 20.0996 13.5615 20.0996C14.7902 20.0996 15.9536 19.6533 16.7998 18.8809C17.5619 18.185 18.0996 17.1383 18.0996 14.6543V7.34473C18.0996 7.28204 18.0734 7.20342 17.9951 7.13184C17.9139 7.05771 17.7875 7.00396 17.6406 7.00391C17.4937 7.00391 17.3674 7.05771 17.2861 7.13184C17.2077 7.20347 17.1807 7.28199 17.1807 7.34473V11.0693C17.1805 11.5661 16.778 11.9685 16.2812 11.9688C15.7843 11.9688 15.381 11.5662 15.3808 11.0693V5.48242C15.3808 5.41973 15.3537 5.34107 15.2754 5.26953C15.1941 5.19547 15.0677 5.1416 14.9209 5.1416C14.774 5.14166 14.6476 5.19541 14.5664 5.26953C14.4881 5.34105 14.462 5.41974 14.4619 5.48242V11.0693C14.4617 11.5662 14.0584 11.9688 13.5615 11.9688C13.0646 11.9687 12.6613 11.5662 12.6611 11.0693V4.24121C12.6611 4.17852 12.635 4.09989 12.5566 4.02832C12.4754 3.95419 12.349 3.90045 12.2021 3.90039C12.0552 3.90039 11.9289 3.95421 11.8476 4.02832C11.7692 4.09992 11.7422 4.17849 11.7422 4.24121V11.0693C11.742 11.5661 11.3395 11.9685 10.8428 11.9688C10.3458 11.9688 9.94257 11.5662 9.94237 11.0693V6.10352L9.93651 6.05371C9.92534 6.00177 9.89573 5.94433 9.8369 5.89062C9.75567 5.81647 9.62938 5.76172 9.48241 5.76172C9.33554 5.76179 9.2091 5.81651 9.12792 5.89062C9.04964 5.96222 9.02343 6.04084 9.02343 6.10352V12.7969Z",fill:"currentColor"},null,-1)])])}const QEe=Et({name:"kimi-hand",render:GEe}),YEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function JEe(e,t){return k(),L("svg",YEe,[...t[0]||(t[0]=[A("path",{d:"M4 3.33203C4.55224 3.33203 4.99993 3.7798 5 4.33203V18.0908H20.0674C20.6195 18.0908 21.0671 18.5388 21.0674 19.0908C21.0674 19.6431 20.6197 20.0908 20.0674 20.0908H5C3.89543 20.0908 3 19.1954 3 18.0908V4.33203C3.00007 3.7798 3.44776 3.33203 4 3.33203ZM8.19922 9.28418C8.7515 9.28418 9.19922 9.73189 9.19922 10.2842V15.6045C9.19908 16.1567 8.75142 16.6045 8.19922 16.6045C7.64719 16.6043 7.19936 16.1565 7.19922 15.6045V10.2842C7.19922 9.73202 7.6471 9.28438 8.19922 9.28418ZM17.2227 6.85645C17.7748 6.85658 18.2226 7.3043 18.2227 7.85645V15.6045C18.2225 16.1566 17.7747 16.6044 17.2227 16.6045C16.6705 16.6045 16.2228 16.1566 16.2227 15.6045V7.85645C16.2227 7.30422 16.6704 6.85645 17.2227 6.85645ZM12.7109 3.96387C13.2631 3.96387 13.7107 4.41175 13.7109 4.96387V15.6035C13.7109 16.1558 13.2632 16.6035 12.7109 16.6035C12.1587 16.6035 11.7109 16.1558 11.7109 15.6035V4.96387C11.7111 4.41175 12.1588 3.96387 12.7109 3.96387Z",fill:"currentColor"},null,-1)])])}const XEe=Et({name:"kimi-histogram",render:JEe}),eLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tLe(e,t){return k(),L("svg",eLe,[...t[0]||(t[0]=[A("path",{d:"M8.00916 7.50488C8.47326 7.50488 8.91828 7.68943 9.24646 8.01758C9.57465 8.34577 9.75916 8.79075 9.75916 9.25488C9.75916 9.71901 9.57465 10.164 9.24646 10.4922C8.91828 10.8203 8.47326 11.0049 8.00916 11.0049C7.54507 11.0049 7.10001 10.8203 6.77185 10.4922C6.4437 10.164 6.25916 9.71898 6.25916 9.25488C6.25916 8.79078 6.4437 8.34576 6.77185 8.01758C7.10001 7.68942 7.54507 7.50492 8.00916 7.50488Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.8998 4.09961C20.0537 4.09961 21.8002 5.84609 21.8002 8V16C21.8002 18.1539 20.0537 19.9004 17.8998 19.9004H5.89978C3.74598 19.9003 1.99939 18.1538 1.99939 16V8C1.99939 5.84617 3.74598 4.09974 5.89978 4.09961H17.8998ZM15.4867 12.2539C15.448 12.2184 15.3885 12.2192 15.351 12.2559L11.7338 15.8027C11.0146 16.5079 9.87305 16.5222 9.13708 15.835L6.98669 13.8262C6.95049 13.7924 6.89516 13.791 6.85681 13.8223L3.82361 16.2988C3.96873 17.3168 4.84165 18.0995 5.89978 18.0996H17.8998C18.9375 18.0996 19.7964 17.3466 19.9662 16.3574L15.4867 12.2539ZM5.89978 5.90039C4.74009 5.90052 3.80017 6.84028 3.80017 8V14.002L5.73181 12.4238C6.46046 11.8286 7.51253 11.8634 8.20056 12.5059L10.351 14.5146C10.3897 14.5508 10.4498 14.5497 10.4877 14.5127L14.1049 10.9658C14.819 10.2656 15.9506 10.2466 16.6879 10.9219L19.9994 13.9551V8C19.9994 6.8402 19.0596 5.90039 17.8998 5.90039H5.89978Z",fill:"currentColor"},null,-1)])])}const nLe=Et({name:"kimi-image",render:tLe}),iLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oLe(e,t){return k(),L("svg",iLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.09375 2.81174C5.4825 2.50796 6.04376 2.56488 6.34766 2.93869L20.1855 19.9602C20.4895 20.3341 20.421 20.8836 20.0322 21.1877C19.6435 21.4917 19.0823 21.4355 18.7783 21.0617L17.9971 20.1008H5.99609C3.84224 20.1008 2.0958 18.3552 2.0957 16.2014V8.13889C2.09589 6.26755 3.41429 4.70428 5.17285 4.32639L4.93945 4.03928C4.63577 3.66536 4.7051 3.11573 5.09375 2.81174ZM7.13184 14.1096C7.09416 14.0738 7.03659 14.0713 6.99609 14.1037L3.92871 16.5569C4.09761 17.5472 4.95753 18.301 5.99609 18.301H16.5342L13.373 14.4133L11.9072 15.9455C11.1531 16.7324 9.92202 16.7621 9.13281 16.0119L7.13184 14.1096ZM5.99609 6.03928C4.83643 6.03928 3.89669 6.97927 3.89648 8.13889V14.1408L5.83496 12.5901C6.60469 11.9742 7.69929 12.022 8.41504 12.7024L10.416 14.6037C10.4575 14.6431 10.5218 14.642 10.5615 14.6008L12.1641 12.926L9.78906 10.0051C9.70282 10.2646 9.55682 10.5038 9.35645 10.7004C9.02202 11.0285 8.56767 11.2131 8.09473 11.2131C7.62195 11.213 7.1683 11.0284 6.83398 10.7004C6.49961 10.3724 6.31152 9.92701 6.31152 9.46311C6.3116 8.99941 6.49981 8.55474 6.83398 8.22678C7.12986 7.93654 7.51931 7.75901 7.93262 7.7219L6.56543 6.03928H5.99609Z",fill:"currentColor"},null,-1),A("path",{d:"M18.0049 4.31272C20.1587 4.31288 21.9043 6.0593 21.9043 8.21311V13.718C21.9039 15.4743 19.7248 16.2906 18.5713 14.966L14.9141 10.7658C14.5882 10.3912 14.6278 9.82271 15.002 9.49631C15.3768 9.16994 15.9451 9.20948 16.2715 9.5842L19.9287 13.7844C19.9528 13.812 19.9696 13.8167 19.9775 13.8186C19.9908 13.8216 20.0141 13.8213 20.04 13.8117C20.0655 13.8021 20.0826 13.7875 20.0908 13.7766C20.0955 13.7702 20.1044 13.7552 20.1045 13.718V8.21311C20.1045 7.05341 19.1645 6.11366 18.0049 6.1135H10.6328C10.1361 6.11327 9.73267 5.70981 9.73242 5.21311C9.73242 4.71619 10.136 4.31295 10.6328 4.31272H18.0049Z",fill:"currentColor"},null,-1)])])}const sLe=Et({name:"kimi-image-failed",render:oLe}),rLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lLe(e,t){return k(),L("svg",rLe,[...t[0]||(t[0]=[A("path",{d:"M12 2.1001C17.4676 2.10031 21.8994 6.53286 21.8994 12.0005C21.8992 17.4679 17.4674 21.8997 12 21.8999C6.53237 21.8999 2.09982 17.4681 2.09961 12.0005C2.09961 6.53273 6.53224 2.1001 12 2.1001ZM12 3.8999C7.52636 3.8999 3.89941 7.52684 3.89941 12.0005C3.89963 16.474 7.52649 20.1001 12 20.1001C16.4733 20.0999 20.0994 16.4738 20.0996 12.0005C20.0996 7.52697 16.4735 3.90011 12 3.8999ZM12 9.50049C12.4969 9.50068 12.8994 9.87055 12.8994 10.3267V16.6743C12.8992 17.1303 12.4968 17.5003 12 17.5005C11.503 17.5005 11.0998 17.1304 11.0996 16.6743V10.3267C11.0996 9.87043 11.5029 9.50049 12 9.50049ZM12 6.49951C12.4968 6.49951 12.8994 6.90313 12.8994 7.3999C12.8992 7.8965 12.4966 8.30029 12 8.30029C11.5025 8.30028 11.0998 7.8965 11.0996 7.3999C11.0996 6.90313 11.5024 6.49952 12 6.49951Z",fill:"currentColor"},null,-1)])])}const aLe=Et({name:"kimi-info",render:lLe}),uLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function cLe(e,t){return k(),L("svg",uLe,[...t[0]||(t[0]=[Qd('',10)])])}const dLe=Et({name:"kimi-keyboard",render:cLe}),fLe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function hLe(e,t){return k(),L("svg",fLe,[...t[0]||(t[0]=[A("path",{id:"bar-divider",d:"M 9.3 18.951 L 9.3 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{id:"bar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),A("path",{id:"bar-arrow",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const pLe=Et({name:"kimi-left-panel",render:hLe}),mLe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function gLe(e,t){return k(),L("svg",mLe,[...t[0]||(t[0]=[A("path",{id:"bar-divider",d:"M 9.3 18.951 L 9.3 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{id:"bar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),A("path",{id:"bar-arrow-expand",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const vLe=Et({name:"kimi-left-panel-expand",render:gLe}),yLe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function kLe(e,t){return k(),L("svg",yLe,[...t[0]||(t[0]=[A("path",{id:"rbar-divider",d:"M 14.7 18.951 L 14.7 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{id:"rbar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),A("path",{id:"rbar-arrow",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const bLe=Et({name:"kimi-right-panel",render:kLe}),wLe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function CLe(e,t){return k(),L("svg",wLe,[...t[0]||(t[0]=[A("path",{id:"rbar-divider",d:"M 14.7 18.951 L 14.7 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{id:"rbar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),A("path",{id:"rbar-arrow-expand",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const ALe=Et({name:"kimi-right-panel-expand",render:CLe}),xLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function SLe(e,t){return k(),L("svg",xLe,[...t[0]||(t[0]=[Qd('',1)])])}const _Le=Et({name:"kimi-light-mode",render:SLe}),MLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ILe(e,t){return k(),L("svg",MLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.97427 8.06961C4.99348 7.33581 6.18946 7.1 7.00001 7.1H9.00001C9.49706 7.1 9.90001 7.50294 9.90001 8C9.90001 8.49706 9.49706 8.9 9.00001 8.9H7.00001C6.47755 8.9 5.67353 9.06419 5.02599 9.53039C4.42434 9.96356 3.90001 10.6934 3.90001 12C3.90001 13.3066 4.42434 14.0364 5.02599 14.4696C5.67353 14.9358 6.47755 15.1 7.00001 15.1H9.00001C9.49706 15.1 9.90001 15.5029 9.90001 16C9.90001 16.4971 9.49706 16.9 9.00001 16.9H7.00001C6.18946 16.9 4.99348 16.6642 3.97427 15.9304C2.90917 15.1636 2.10001 13.8934 2.10001 12C2.10001 10.1066 2.90917 8.83644 3.97427 8.06961ZM14.1 8C14.1 7.50294 14.5029 7.1 15 7.1H17C17.8105 7.1 19.0065 7.33581 20.0257 8.06961C21.0908 8.83644 21.9 10.1066 21.9 12C21.9 13.8934 21.0908 15.1636 20.0257 15.9304C19.0065 16.6642 17.8105 16.9 17 16.9H15C14.5029 16.9 14.1 16.4971 14.1 16C14.1 15.5029 14.5029 15.1 15 15.1H17C17.5225 15.1 18.3265 14.9358 18.974 14.4696C19.5757 14.0364 20.1 13.3066 20.1 12C20.1 10.6934 19.5757 9.96356 18.974 9.53039C18.3265 9.06419 17.5225 8.9 17 8.9H15C14.5029 8.9 14.1 8.49706 14.1 8ZM7.10001 12C7.10001 11.5029 7.50295 11.1 8.00001 11.1H16C16.4971 11.1 16.9 11.5029 16.9 12C16.9 12.4971 16.4971 12.9 16 12.9H8.00001C7.50295 12.9 7.10001 12.4971 7.10001 12Z",fill:"currentColor"},null,-1)])])}const TLe=Et({name:"kimi-link",render:ILe}),ELe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function LLe(e,t){return k(),L("svg",ELe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.10001 5.99998C4.10001 5.50292 4.50295 5.09998 5.00001 5.09998H19C19.4971 5.09998 19.9 5.50292 19.9 5.99998C19.9 6.49703 19.4971 6.89998 19 6.89998H5.00001C4.50295 6.89998 4.10001 6.49703 4.10001 5.99998ZM4.10001 12C4.10001 11.5029 4.50295 11.1 5.00001 11.1H19C19.4971 11.1 19.9 11.5029 19.9 12C19.9 12.497 19.4971 12.9 19 12.9H5.00001C4.50295 12.9 4.10001 12.497 4.10001 12ZM4.10001 18C4.10001 17.5029 4.50295 17.1 5.00001 17.1H19C19.4971 17.1 19.9 17.5029 19.9 18C19.9 18.497 19.4971 18.9 19 18.9H5.00001C4.50295 18.9 4.10001 18.497 4.10001 18Z",fill:"currentColor"},null,-1)])])}const NLe=Et({name:"kimi-list",render:LLe}),DLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FLe(e,t){return k(),L("svg",DLe,[...t[0]||(t[0]=[A("g",null,[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18 4.09961C20.1539 4.09961 21.9004 5.84609 21.9004 8V16C21.9004 18.1539 20.1539 19.9004 18 19.9004H6C3.84609 19.9004 2.09961 18.1539 2.09961 16V8C2.09961 5.84609 3.84609 4.09961 6 4.09961H18ZM3.90039 16C3.90039 17.1598 4.8402 18.0996 6 18.0996H18C19.1598 18.0996 20.0996 17.1598 20.0996 16V9.49805L13.5361 13.5361C12.5955 14.1147 11.4075 14.1084 10.4727 13.5205L3.90039 9.38672V16ZM6 5.90039C5.0746 5.90039 4.29039 6.49909 4.01074 7.33008L11.4316 11.9971C11.7861 12.2199 12.2361 12.2222 12.5928 12.0029L20.0195 7.43457C19.7725 6.54993 18.9636 5.90039 18 5.90039H6Z",fill:"currentColor"})],-1)])])}const BLe=Et({name:"kimi-mail",render:FLe}),RLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function $Le(e,t){return k(),L("svg",RLe,[...t[0]||(t[0]=[A("path",{d:"M17 11.0996C17.4971 11.0996 17.9004 11.5029 17.9004 12C17.9004 12.4971 17.4971 12.9004 17 12.9004H7C6.50294 12.9004 6.09961 12.4971 6.09961 12C6.09961 11.5029 6.50294 11.0996 7 11.0996H17Z",fill:"currentColor"},null,-1)])])}const OLe=Et({name:"kimi-minus",render:$Le}),PLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zLe(e,t){return k(),L("svg",PLe,[...t[0]||(t[0]=[A("path",{d:"M15.182 3.32802C15.9304 2.72235 17.0309 2.76978 17.724 3.46767L18.5424 4.29189L18.6722 4.43642C19.2377 5.13495 19.234 6.1404 18.6635 6.83486L18.5326 6.97841L18.0248 7.48232C17.9549 7.55172 17.8793 7.61254 17.8021 7.66884C17.9794 8.18027 17.9316 8.7498 17.6595 9.22841C17.6847 9.24522 17.7091 9.2635 17.7328 9.2831L17.8002 9.3456L17.9847 9.53798C19.8515 11.5442 20.4549 14.0022 19.6224 16.2196C19.1921 17.3657 18.4025 18.3827 17.2992 19.203H19.0873L19.1801 19.2079C19.6337 19.2542 19.9877 19.6375 19.9877 20.1034C19.9876 20.5692 19.6337 20.9527 19.1801 20.9989L19.0873 21.0028H13.0385C13.0244 21.0033 13.0104 21.0031 12.9965 21.0028H4.9115C4.41448 21.0028 4.01117 20.6004 4.01111 20.1034C4.01111 19.6064 4.41444 19.203 4.9115 19.203H12.9047C15.7614 18.5471 17.3679 17.1023 17.9369 15.5868C18.4678 14.1726 18.179 12.4782 16.807 10.9188L16.5189 10.6093L16.4574 10.5399C16.4549 10.5368 16.453 10.5333 16.4506 10.5302L12.3011 14.6522C11.6031 15.3454 10.5023 15.3845 9.75818 14.7733L9.61365 14.6425L7.31091 12.3231C6.5717 11.5786 6.57617 10.376 7.32068 9.63662L12.3676 4.62392L12.5121 4.49404C13.0358 4.06988 13.7318 3.96755 14.3402 4.18251C14.3969 4.10597 14.4591 4.03197 14.5287 3.96279L15.0365 3.45791L15.182 3.32802ZM4.83044 12.9335C5.16112 12.6052 5.68305 12.5863 6.03552 12.8759L6.10291 12.9384L9.07361 15.9286L9.13513 15.997C9.42218 16.3514 9.3992 16.8727 9.06873 17.2011C8.7381 17.5294 8.21712 17.5482 7.86462 17.2587L7.79626 17.1972L4.82654 14.2069L4.76501 14.1376C4.47792 13.7831 4.49979 13.2619 4.83044 12.9335ZM13.6693 5.87978L13.6361 5.90126L8.58826 10.914C8.54935 10.9529 8.54943 11.0165 8.58826 11.0556L10.891 13.3739L10.9242 13.3964C10.9602 13.4111 11.0032 13.404 11.0326 13.3749L16.0795 8.3622L16.1019 8.329C16.1117 8.3049 16.1117 8.2779 16.1019 8.2538L16.0804 8.2206L13.7777 5.90224C13.7486 5.87289 13.7054 5.86535 13.6693 5.87978ZM16.3383 4.71376L16.3051 4.73525L15.7972 5.24013C15.7584 5.27904 15.7585 5.34166 15.7972 5.38076L16.6146 6.20498L16.6478 6.22744C16.6838 6.24221 16.7268 6.23487 16.7562 6.20595L17.264 5.70107L17.2865 5.66787C17.2962 5.64382 17.2963 5.61672 17.2865 5.59267L17.265 5.55947L16.4467 4.73623C16.4174 4.70681 16.3744 4.6992 16.3383 4.71376Z",fill:"currentColor"},null,-1)])])}const jLe=Et({name:"kimi-microscope",render:zLe}),HLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WLe(e,t){return k(),L("svg",HLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.669 7.94435C11.6812 7.94435 11.6912 7.9546 11.6914 7.96681C11.6914 7.96922 11.6926 7.97233 11.6934 7.97462L14.0908 15.1924C14.1283 15.3052 14.0437 15.4219 13.9248 15.4219H12.709C12.6327 15.4217 12.5655 15.3718 12.543 15.2988L11.9639 13.418C11.9526 13.3814 11.9181 13.3565 11.8799 13.3565H9.1504C9.11222 13.3565 9.07868 13.3815 9.06739 13.418L8.48829 15.2988C8.46577 15.3719 8.39778 15.4219 8.3213 15.4219H7.10548C6.98659 15.4219 6.90296 15.3052 6.94044 15.1924L9.30762 8.06446C9.3313 7.99321 9.39855 7.94435 9.47364 7.94435H11.669ZM9.4961 12.041C9.47878 12.0971 9.52043 12.1543 9.57911 12.1543H11.4512C11.5098 12.1543 11.5525 12.0971 11.5352 12.041L10.6113 9.05177H10.4199L9.4961 12.041Z",fill:"currentColor"},null,-1),A("path",{d:"M16.0576 7.94435C16.1539 7.94435 16.2324 8.02289 16.2324 8.11915V15.2481C16.2322 15.3441 16.1537 15.4219 16.0576 15.4219H15.0645C14.9683 15.4219 14.8899 15.3441 14.8897 15.2481V8.11915C14.8897 8.02289 14.9682 7.94435 15.0645 7.94435H16.0576Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.0534 2.091C12.5082 2.091 12.8766 2.45946 12.8766 2.91425L12.874 3.90821H14.3076L14.3102 2.92499C14.3103 2.47035 14.6788 2.10186 15.1334 2.10175C15.5882 2.10175 15.9566 2.47028 15.9567 2.92499L15.9541 3.90821H17.0293C18.4439 3.90854 19.5908 5.05504 19.5908 6.46974V7.90821L21.0852 7.93105C21.54 7.93105 21.9085 8.29951 21.9085 8.7543C21.9084 9.20899 21.54 9.57754 21.0852 9.57754L19.6074 9.5547C19.6019 9.5547 19.5964 9.55383 19.5908 9.55372V11.0215L21.0852 11.0443C21.54 11.0443 21.9084 11.4129 21.9085 11.8676C21.9085 12.3224 21.54 12.6908 21.0852 12.6908L19.6074 12.668C19.6019 12.668 19.5964 12.6671 19.5908 12.667V14.1016L21.0852 14.1244C21.54 14.1244 21.9084 14.4929 21.9085 14.9477C21.9085 15.4024 21.54 15.7709 21.0852 15.7709L19.6074 15.7481C19.6019 15.7481 19.5964 15.7472 19.5908 15.7471V16.8975C19.5907 18.312 18.4438 19.4587 17.0293 19.459H15.9453L15.9875 21.0863C15.9875 21.5409 15.6189 21.9094 15.1643 21.9095C14.7095 21.9095 14.3411 21.541 14.341 21.0863L14.2988 19.459H12.8311L12.8733 21.0863C12.8732 21.541 12.5048 21.9095 12.05 21.9095C11.5955 21.9093 11.2269 21.5409 11.2268 21.0863L11.1846 19.459H9.75098L9.79319 21.0687C9.79319 21.5235 9.42474 21.8919 8.96995 21.8919C8.51536 21.8917 8.14671 21.5233 8.14671 21.0687L8.1045 19.459H6.75489C5.34008 19.459 4.19352 18.3122 4.19337 16.8975V15.7031L2.90033 15.7353C2.4456 15.7353 2.07709 15.3668 2.07709 14.9121C2.0771 14.4574 2.44561 14.0889 2.90033 14.0889L4.19337 14.0567V12.5899L2.91595 12.6221C2.46128 12.6221 2.09289 12.2535 2.09271 11.7988C2.09271 11.344 2.46116 10.9756 2.91595 10.9756L4.19337 10.9434V9.50978L2.91595 9.54198C2.46126 9.54198 2.09287 9.1734 2.09271 8.71874C2.09271 8.26395 2.46116 7.8955 2.91595 7.8955L4.19337 7.86329V6.46974C4.19337 5.05483 5.33999 3.90821 6.75489 3.90821H8.11427L8.11684 2.91425C8.11684 2.45946 8.48529 2.091 8.94008 2.091C9.39483 2.09105 9.76332 2.45949 9.76332 2.91425L9.76075 3.90821H11.2275L11.2301 2.91425C11.2301 2.45955 11.5987 2.09115 12.0534 2.091ZM6.66114 5.55958C6.19983 5.6065 5.83985 5.99605 5.83985 6.46974V16.8975L5.84473 16.9912C5.88868 17.4216 6.23075 17.7639 6.66114 17.8076L6.75489 17.8125H17.0293L17.1221 17.8076C17.5526 17.764 17.8955 17.4217 17.9395 16.9912L17.9434 16.8975V6.46974C17.9434 5.99595 17.5835 5.60637 17.1221 5.55958L17.0293 5.5547H6.75489L6.66114 5.55958Z",fill:"currentColor"},null,-1)])])}const qLe=Et({name:"kimi-model",render:WLe}),ULe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VLe(e,t){return k(),L("svg",ULe,[...t[0]||(t[0]=[A("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),A("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),A("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const KLe=Et({name:"kimi-more",render:VLe}),ZLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GLe(e,t){return k(),L("svg",ZLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 12.0993C8.49691 12.0993 8.90016 12.5028 8.90039 12.9997V17.9997C8.90039 19.6013 7.60163 20.9001 6 20.9001C4.39837 20.9001 3.09961 19.6013 3.09961 17.9997C3.09984 16.3982 4.39852 15.0993 6 15.0993C6.38939 15.0993 6.76033 15.1778 7.09961 15.317V12.9997C7.09984 12.5028 7.50309 12.0993 8 12.0993ZM6 16.9001C5.39263 16.9001 4.90062 17.3923 4.90039 17.9997C4.90039 18.6072 5.39249 19.0993 6 19.0993C6.60751 19.0993 7.09961 18.6072 7.09961 17.9997C7.09938 17.3923 6.60737 16.9001 6 16.9001Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.627 3.35611C19.8025 3.12106 20.9001 4.02068 20.9004 5.21939V15.9997C20.9004 17.6013 19.6016 18.9001 18 18.9001C16.3984 18.9001 15.0996 17.6013 15.0996 15.9997C15.0998 14.3982 16.3985 13.0993 18 13.0993C18.3894 13.0993 18.7603 13.1778 19.0996 13.317V9.21939C19.0993 9.15657 19.0421 9.10946 18.9805 9.12173L12.6768 10.3825C12.1894 10.4799 11.7148 10.1637 11.6172 9.67642C11.52 9.18922 11.8361 8.71439 12.3232 8.61685L18.627 7.35611C18.7868 7.32415 18.9452 7.31502 19.0996 7.32291V5.21939C19.0993 5.15657 19.0421 5.10946 18.9805 5.12173L12.6768 6.38248C12.1894 6.47994 11.7148 6.16372 11.6172 5.67642C11.52 5.18922 11.8361 4.71439 12.3232 4.61685L18.627 3.35611ZM18 14.9001C17.3926 14.9001 16.9006 15.3923 16.9004 15.9997C16.9004 16.6072 17.3925 17.0993 18 17.0993C18.6075 17.0993 19.0996 16.6072 19.0996 15.9997C19.0994 15.3923 18.6074 14.9001 18 14.9001Z",fill:"currentColor"},null,-1),A("path",{d:"M7.32422 5.38931C7.61669 4.87032 8.38346 4.87015 8.67578 5.38931L8.73047 5.50845L8.89551 5.95376L8.97949 6.1481C9.19937 6.58817 9.57968 6.93145 10.0459 7.10415L10.4912 7.26919C11.127 7.50461 11.1666 8.36217 10.6104 8.67544L10.4912 8.73013L10.0459 8.89517C9.5799 9.06783 9.19939 9.41141 8.97949 9.85123L8.89551 10.0456L8.73047 10.4909C8.49495 11.1267 7.63737 11.1665 7.32422 10.61L7.26953 10.4909L7.10449 10.0456C6.93172 9.57931 6.58767 9.19898 6.14746 8.97916L5.9541 8.89517L5.50879 8.73013C4.83054 8.47903 4.83061 7.52037 5.50879 7.26919L5.9541 7.10415L6.14746 7.02017C6.58757 6.80032 6.93176 6.41995 7.10449 5.95376L7.26953 5.50845L7.32422 5.38931Z",fill:"currentColor"},null,-1)])])}const QLe=Et({name:"kimi-music",render:GLe}),YLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function JLe(e,t){return k(),L("svg",YLe,[...t[0]||(t[0]=[A("path",{d:"M17.9551 6.32648C17.955 5.82951 17.5517 5.42706 17.0547 5.42706H15.4844C14.9875 5.42717 14.5851 5.82958 14.585 6.32648V17.6732C14.585 18.1701 14.9874 18.5734 15.4844 18.5735H17.0547C17.5518 18.5735 17.9551 18.1702 17.9551 17.6732V6.32648ZM19.7549 17.6732C19.7549 19.1643 18.5459 20.3734 17.0547 20.3734H15.4844C13.9933 20.3732 12.7842 19.1643 12.7842 17.6732V6.32648C12.7843 4.83546 13.9934 3.62639 15.4844 3.62628H17.0547C18.5458 3.62628 19.7548 4.8354 19.7549 6.32648V17.6732Z",fill:"currentColor"},null,-1),A("path",{d:"M9.41571 6.32648C9.41561 5.82951 9.01231 5.42706 8.51532 5.42706H6.94501C6.44811 5.42717 6.0457 5.82958 6.04559 6.32648V17.6732C6.04559 18.1701 6.44804 18.5734 6.94501 18.5735H8.51532C9.01238 18.5735 9.41571 18.1702 9.41571 17.6732V6.32648ZM11.2155 17.6732C11.2155 19.1643 10.0065 20.3734 8.51532 20.3734H6.94501C5.45393 20.3732 4.24481 19.1643 4.24481 17.6732V6.32648C4.24492 4.83546 5.45399 3.62639 6.94501 3.62628H8.51532C10.0064 3.62628 11.2154 4.8354 11.2155 6.32648V17.6732Z",fill:"currentColor"},null,-1)])])}const XLe=Et({name:"kimi-pause",render:JLe}),eNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tNe(e,t){return k(),L("svg",eNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.0176 4.89998C17.7305 4.89998 17.4552 5.014 17.2522 5.217L6.35429 16.1149C5.957 16.5122 5.67517 17.01 5.53889 17.5551L5.23691 18.763L6.44486 18.4611C6.98994 18.3248 7.48773 18.0429 7.88502 17.6456L18.783 6.74773C18.8834 6.64728 18.9631 6.52797 19.0176 6.39658C19.072 6.26517 19.1 6.12441 19.1 5.98236C19.1 5.84031 19.072 5.69956 19.0176 5.56815C18.9631 5.43676 18.8834 5.31745 18.783 5.217C18.6825 5.11649 18.5631 5.03676 18.4318 4.98237C18.3005 4.92798 18.1597 4.89998 18.0176 4.89998ZM15.9794 3.94421C16.52 3.40366 17.2531 3.09998 18.0176 3.09998C18.3961 3.09998 18.7709 3.17452 19.1207 3.31938C19.4704 3.46424 19.7881 3.67656 20.0558 3.94421C20.3235 4.21192 20.5357 4.52969 20.6805 4.87932C20.8254 5.22895 20.9 5.60375 20.9 5.98236C20.9 6.36098 20.8254 6.73578 20.6805 7.08541C20.5357 7.43504 20.3235 7.75281 20.0558 8.02052L17.6385 10.4378L9.15781 18.9184C8.52984 19.5464 7.74301 19.9919 6.88142 20.2073L4.21828 20.8731C3.91158 20.9498 3.58714 20.8599 3.3636 20.6364C3.14006 20.4128 3.05019 20.0884 3.12686 19.7817L3.79264 17.1185C4.00803 16.257 4.45351 15.4701 5.0815 14.8421L15.9794 3.94421Z",fill:"currentColor"},null,-1)])])}const nNe=Et({name:"kimi-pencil",render:tNe}),iNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oNe(e,t){return k(),L("svg",iNe,[...t[0]||(t[0]=[A("path",{d:"M7.76251 3.10547C8.25776 3.10552 8.74422 3.23849 9.17072 3.49023L19.533 9.60742C20.8536 10.3869 21.2922 12.0901 20.5174 13.4121C20.2785 13.8195 19.9398 14.1604 19.533 14.4004L9.16974 20.5156C7.84721 21.2958 6.14595 20.8511 5.36993 19.5273C5.1196 19.1003 4.98719 18.6142 4.98712 18.1191V5.88672C4.98716 4.3537 6.2273 3.10547 7.76251 3.10547ZM6.7879 18.1191C6.78797 18.2945 6.8343 18.4664 6.92267 18.6172C7.19638 19.0841 7.79336 19.2377 8.25568 18.9648L18.618 12.8496C18.7607 12.7654 18.8803 12.6458 18.9647 12.502C19.2393 12.0334 19.082 11.4311 18.618 11.1572L8.25568 5.04102C8.1061 4.95273 7.93562 4.9063 7.76251 4.90625C7.22703 4.90625 6.78794 5.34218 6.7879 5.88672V18.1191Z",fill:"currentColor"},null,-1)])])}const sNe=Et({name:"kimi-play",render:oNe}),rNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lNe(e,t){return k(),L("svg",rNe,[...t[0]||(t[0]=[A("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{d:"M12 2v10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const aNe=Et({name:"kimi-power",render:lNe}),uNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function cNe(e,t){return k(),L("svg",uNe,[...t[0]||(t[0]=[A("path",{d:"M11.999 15.0049C12.6208 15.0049 13.1259 15.5091 13.126 16.1309C13.126 16.7528 12.6209 17.2578 11.999 17.2578C11.3773 17.2576 10.873 16.7526 10.873 16.1309C10.8732 15.5092 11.3774 15.0051 11.999 15.0049Z",fill:"currentColor"},null,-1),A("path",{d:"M10.1611 7.37109C10.9017 6.79576 11.8605 6.60385 12.7881 6.8457C13.808 7.10861 14.6385 7.93756 14.9014 8.95898C15.2694 10.3845 14.5793 11.8629 13.2598 12.4736C13.0803 12.557 12.75 12.9552 12.75 13.3525V13.502C12.75 13.9172 12.4142 14.2527 11.999 14.2529C11.5837 14.2529 11.248 13.9173 11.248 13.502V13.3525C11.248 12.313 11.9587 11.4215 12.6279 11.1113C13.1777 10.8567 13.6681 10.192 13.4473 9.33496C13.3195 8.84253 12.9038 8.42684 12.4121 8.2998C11.9292 8.17289 11.4573 8.26727 11.0811 8.55859C10.71 8.84626 10.4971 9.28012 10.4971 9.74805C10.4968 10.1632 10.1613 10.499 9.74609 10.499C9.33092 10.499 8.99536 10.1632 8.99512 9.74805C8.99512 8.81152 9.41918 7.94493 10.1611 7.37109Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 3.7998C7.47126 3.7998 3.7998 7.47126 3.7998 12C3.7998 16.5287 7.47126 20.2002 12 20.2002C16.5287 20.2002 20.2002 16.5287 20.2002 12C20.2002 7.47126 16.5287 3.7998 12 3.7998Z",fill:"currentColor"},null,-1)])])}const dNe=Et({name:"kimi-question",render:cNe}),fNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function hNe(e,t){return k(),L("svg",fNe,[...t[0]||(t[0]=[A("path",{d:"M12 2C13.1046 2 14 2.89543 14 4C14 4.78019 13.552 5.45353 12.9004 5.7832V7H16.5C18.1569 7 19.5 8.34315 19.5 10V17C19.5 18.6051 18.2394 19.9158 16.6543 19.9961L16.5 20H7.5L7.3457 19.9961C5.81166 19.9184 4.58163 18.6883 4.50391 17.1543L4.5 17V10C4.5 8.34315 5.84315 7 7.5 7H11.0996V5.7832C10.448 5.45353 10 4.78019 10 4C10 2.89543 10.8954 2 12 2ZM7.5 8.7998C6.83726 8.7998 6.2998 9.33726 6.2998 10V17C6.2998 17.6627 6.83726 18.2002 7.5 18.2002H16.5C17.1627 18.2002 17.7002 17.6627 17.7002 17V10C17.7002 9.33726 17.1627 8.7998 16.5 8.7998H7.5ZM3 10.7666C3.49706 10.7666 3.90039 11.1699 3.90039 11.667V15C3.90039 15.4971 3.49706 15.9004 3 15.9004C2.50294 15.9004 2.09961 15.4971 2.09961 15V11.667C2.09961 11.1699 2.50294 10.7666 3 10.7666ZM21 10.7666C21.4971 10.7666 21.9004 11.1699 21.9004 11.667V15C21.9004 15.4971 21.4971 15.9004 21 15.9004C20.5029 15.9004 20.0996 15.4971 20.0996 15V11.667C20.0996 11.1699 20.5029 10.7666 21 10.7666ZM9.5 11.0996C9.99706 11.0996 10.4004 11.5029 10.4004 12V14.5C10.4004 14.9971 9.99706 15.4004 9.5 15.4004C9.00294 15.4004 8.59961 14.9971 8.59961 14.5V12C8.59961 11.5029 9.00294 11.0996 9.5 11.0996ZM14.5 11.0996C14.9971 11.0996 15.4004 11.5029 15.4004 12V14.5C15.4004 14.9971 14.9971 15.4004 14.5 15.4004C14.0029 15.4004 13.5996 14.9971 13.5996 14.5V12C13.5996 11.5029 14.0029 11.0996 14.5 11.0996ZM12 3.5C11.7239 3.5 11.5 3.72386 11.5 4C11.5 4.27614 11.7239 4.5 12 4.5C12.2761 4.5 12.5 4.27614 12.5 4C12.5 3.72386 12.2761 3.5 12 3.5Z",fill:"currentColor"},null,-1)])])}const pNe=Et({name:"kimi-robot",render:hNe}),mNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function gNe(e,t){return k(),L("svg",mNe,[...t[0]||(t[0]=[A("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const vNe=Et({name:"kimi-search",render:gNe}),yNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kNe(e,t){return k(),L("svg",yNe,[...t[0]||(t[0]=[A("path",{d:"M16.5364 10.1636C16.8879 10.5151 16.8879 11.0849 16.5364 11.4364C16.1849 11.7879 15.6151 11.7879 15.2636 11.4364L12.9 9.07281V17.1C12.9 17.597 12.4971 18 12 18C11.503 18 11.1 17.597 11.1 17.1V9.07281L8.73641 11.4364C8.38494 11.7879 7.81509 11.7879 7.46362 11.4364C7.11214 11.0849 7.11214 10.5151 7.46362 10.1636L11.3636 6.2636C11.7151 5.91211 12.2849 5.91211 12.6364 6.2636L16.5364 10.1636Z",fill:"currentColor"},null,-1)])])}const bNe=Et({name:"kimi-send",render:kNe}),wNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function CNe(e,t){return k(),L("svg",wNe,[...t[0]||(t[0]=[A("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),A("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const ANe=Et({name:"kimi-setting",render:CNe}),xNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function SNe(e,t){return k(),L("svg",xNe,[...t[0]||(t[0]=[A("path",{d:"M17 2C19.2091 2 21 3.79086 21 6V15.7646C21 17.2361 20.192 18.5884 18.8965 19.2861L13.8965 21.9785C12.7126 22.616 11.2874 22.616 10.1035 21.9785L5.10352 19.2861C3.80802 18.5884 3 17.2361 3 15.7646V6C3 3.79086 4.79086 2 7 2H17ZM7 3.7998C5.78498 3.7998 4.79981 4.78497 4.7998 6V15.7646C4.7998 16.574 5.24443 17.3184 5.95703 17.7021L10.957 20.3936C11.6082 20.7442 12.3918 20.7442 13.043 20.3936L18.043 17.7021C18.7556 17.3184 19.2002 16.574 19.2002 15.7646V6C19.2002 4.78497 18.215 3.7998 17 3.7998H7Z",fill:"currentColor"},null,-1),A("path",{d:"M10.1611 7.37109C10.9017 6.79576 11.8605 6.60385 12.7881 6.8457C13.808 7.10861 14.6385 7.93756 14.9014 8.95898C15.2694 10.3845 14.5793 11.8629 13.2598 12.4736C13.0803 12.557 12.75 12.9552 12.75 13.3525V13.502C12.75 13.9172 12.4142 14.2527 11.999 14.2529C11.5837 14.2529 11.248 13.9173 11.248 13.502V13.3525C11.248 12.313 11.9587 11.4215 12.6279 11.1113C13.1777 10.8567 13.6681 10.192 13.4473 9.33496C13.3195 8.84253 12.9038 8.42684 12.4121 8.2998C11.9292 8.17289 11.4573 8.26727 11.0811 8.55859C10.71 8.84626 10.4971 9.28012 10.4971 9.74805C10.4968 10.1632 10.1613 10.499 9.74609 10.499C9.33092 10.499 8.99536 10.1632 8.99512 9.74805C8.99512 8.81152 9.41918 7.94493 10.1611 7.37109Z",fill:"currentColor"},null,-1),A("path",{d:"M11.999 15.0049C12.6208 15.0049 13.1259 15.5091 13.126 16.1309C13.126 16.7528 12.6209 17.2578 11.999 17.2578C11.3773 17.2576 10.873 16.7526 10.873 16.1309C10.8732 15.5092 11.3774 15.0051 11.999 15.0049Z",fill:"currentColor"},null,-1)])])}const _Ne=Et({name:"kimi-shield-question",render:SNe}),MNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function INe(e,t){return k(),L("svg",MNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.90005 12C2.90005 11.503 3.303 11.1 3.80005 11.1H12.2939L9.38588 8.19197C9.03441 7.8405 9.03441 7.27065 9.38588 6.91918C9.73735 6.56771 10.3072 6.56771 10.6587 6.91918L15.1031 11.3636C15.2719 11.5324 15.3667 11.7613 15.3667 12C15.3667 12.2387 15.2719 12.4676 15.1031 12.6364L10.6587 17.0809C10.3072 17.4323 9.73735 17.4323 9.38588 17.0809C9.03441 16.7294 9.03441 16.1595 9.38588 15.8081L12.2939 12.9H3.80005C3.303 12.9 2.90005 12.4971 2.90005 12ZM13.5874 20C13.5874 19.503 13.9904 19.1 14.4874 19.1H18.043C18.2758 19.1 18.4991 19.0075 18.6637 18.8429C18.8283 18.6783 18.9208 18.455 18.9208 18.2222V5.7778C18.9208 5.545 18.8283 5.32174 18.6637 5.15712C18.499 4.9925 18.2758 4.90002 18.043 4.90002H14.4874C13.9904 4.90002 13.5874 4.49708 13.5874 4.00002C13.5874 3.50297 13.9904 3.10003 14.4874 3.10003H18.043C18.7532 3.10003 19.4343 3.38215 19.9365 3.88433C20.4386 4.38651 20.7208 5.06761 20.7208 5.7778V18.2222C20.7208 18.9324 20.4386 19.6135 19.9365 20.1157C19.4343 20.6179 18.7532 20.9 18.043 20.9H14.4874C13.9904 20.9 13.5874 20.4971 13.5874 20Z",fill:"currentColor"},null,-1)])])}const TNe=Et({name:"kimi-sign-in",render:INe}),ENe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function LNe(e,t){return k(),L("svg",ENe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.6364 11.3636C20.9879 11.7151 20.9879 12.2849 20.6364 12.6364L16.1919 17.0808C15.8405 17.4323 15.2706 17.4323 14.9192 17.0808C14.5677 16.7293 14.5677 16.1595 14.9192 15.808L17.8272 12.9H9.33333C8.83627 12.9 8.43333 12.497 8.43333 12C8.43333 11.5029 8.83627 11.1 9.33333 11.1H17.8272L14.9192 8.19193C14.5677 7.84046 14.5677 7.27061 14.9192 6.91914C15.2706 6.56766 15.8405 6.56766 16.1919 6.91914L20.6364 11.3636ZM10.2333 3.99998C10.2333 4.49703 9.83038 4.89998 9.33333 4.89998H5.77777C5.54497 4.89998 5.3217 4.99246 5.15709 5.15707C4.99247 5.32169 4.89999 5.54495 4.89999 5.77775V18.2222C4.89999 18.455 4.99247 18.6783 5.15709 18.8429C5.32171 19.0075 5.54497 19.1 5.77777 19.1H9.33333C9.83038 19.1 10.2333 19.5029 10.2333 20C10.2333 20.497 9.83038 20.9 9.33333 20.9H5.77777C5.06758 20.9 4.38648 20.6179 3.8843 20.1157C3.38212 19.6135 3.09999 18.9324 3.09999 18.2222V5.77775C3.09999 5.06756 3.38212 4.38646 3.8843 3.88428C4.38648 3.3821 5.06758 3.09998 5.77777 3.09998H9.33333C9.83038 3.09998 10.2333 3.50292 10.2333 3.99998Z",fill:"currentColor"},null,-1)])])}const NNe=Et({name:"kimi-sign-out",render:LNe}),DNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FNe(e,t){return k(),L("svg",DNe,[...t[0]||(t[0]=[Qd('',9)])])}const BNe=Et({name:"kimi-sliders",render:FNe}),RNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function $Ne(e,t){return k(),L("svg",RNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.78027 8.90405C7.5 9.45411 7.5 10.1742 7.5 11.6144V12.3856C7.5 13.8258 7.5 14.5459 7.78027 15.096C8.02681 15.5798 8.42019 15.9732 8.90405 16.2197C9.45411 16.5 10.1742 16.5 11.6144 16.5H12.3856C13.8258 16.5 14.5459 16.5 15.096 16.2197C15.5798 15.9732 15.9732 15.5798 16.2197 15.096C16.5 14.5459 16.5 13.8258 16.5 12.3856V11.6144C16.5 10.1742 16.5 9.45411 16.2197 8.90405C15.9732 8.42019 15.5798 8.02681 15.096 7.78027C14.5459 7.5 13.8258 7.5 12.3856 7.5H11.6144C10.1742 7.5 9.45411 7.5 8.90405 7.78027C8.42019 8.02681 8.02681 8.42019 7.78027 8.90405Z",fill:"currentColor"},null,-1)])])}const ONe=Et({name:"kimi-stop",render:$Ne}),PNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zNe(e,t){return k(),L("svg",PNe,[...t[0]||(t[0]=[A("path",{d:"M7.01562 3.41459C7.4446 3.16449 7.9954 3.30924 8.24609 3.73784C8.49645 4.167 8.35189 4.71868 7.92285 4.96928C5.51497 6.37506 3.90054 8.98498 3.90039 11.9703C3.90076 16.4435 7.52672 20.0699 12 20.0699C16.4733 20.0699 20.0992 16.4435 20.0996 11.9703C20.0996 11.2291 20 10.5116 19.8145 9.83159C19.6838 9.35222 19.967 8.85702 20.4463 8.72612C20.9256 8.59541 21.4207 8.87778 21.5518 9.35698C21.7792 10.1901 21.9004 11.0674 21.9004 11.9703C21.9 17.4376 17.4674 21.8697 12 21.8697C6.53261 21.8697 2.09998 17.4376 2.09961 11.9703C2.09976 8.31904 4.07782 5.12972 7.01562 3.41459ZM8.39258 8.24077C8.75015 7.89591 9.3199 7.90591 9.66504 8.26323C10.01 8.62076 9.99985 9.19051 9.64258 9.53569C9.00203 10.1541 8.60558 11.02 8.60547 11.979C8.60584 13.8536 10.1253 15.3736 12 15.3736C13.8746 15.3735 15.3942 13.8536 15.3945 11.979C15.3945 11.6847 15.3577 11.3989 15.2881 11.1285C15.1646 10.6474 15.4536 10.1568 15.9346 10.0328C16.4158 9.9089 16.9071 10.1991 17.0312 10.6802C17.1383 11.096 17.1943 11.5321 17.1943 11.979C17.194 14.8477 14.8688 17.1733 12 17.1734C9.1312 17.1734 6.80506 14.8478 6.80469 11.979C6.8048 10.5117 7.41519 9.18431 8.39258 8.24077ZM11.5459 1.12651C11.8216 0.965605 12.1631 0.963306 12.4414 1.11967L19.1953 4.91752C19.4859 5.08108 19.662 5.39277 19.6533 5.72612C19.6443 6.05972 19.4515 6.36154 19.1523 6.50932L12.9004 9.5933V12.2583C12.9004 12.7554 12.4971 13.1587 12 13.1587C11.5029 13.1587 11.0996 12.7554 11.0996 12.2583V1.90385C11.0999 1.58444 11.2702 1.2878 11.5459 1.12651ZM12.9004 7.58549L16.8252 5.64897L12.9004 3.44194V7.58549Z",fill:"currentColor"},null,-1)])])}const jNe=Et({name:"kimi-target",render:zNe}),HNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WNe(e,t){return k(),L("svg",HNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.9893 6.60743C20.5897 6.60757 21.8877 7.8926 21.8877 9.47736C21.8877 10.7416 21.0607 11.8129 19.9141 12.1955V14.257C19.914 15.8428 18.6152 17.1288 17.0137 17.1289H12.8438V20.1381C12.8437 20.6301 12.4412 21.0293 11.9443 21.0296C11.4473 21.0296 11.044 20.6302 11.0439 20.1381V16.4356C11.0441 15.8343 11.5363 15.3461 12.1436 15.3458H17.0137C17.6211 15.3457 18.1133 14.8585 18.1133 14.257V12.2129C16.9408 11.8451 16.0909 10.7598 16.0908 9.47736C16.0908 7.89251 17.3887 6.60743 18.9893 6.60743ZM18.9893 8.38953C18.3828 8.38953 17.8906 8.87684 17.8906 9.47736C17.8907 10.0778 18.3828 10.5642 18.9893 10.5642C19.5956 10.5641 20.0869 10.0777 20.0869 9.47736C20.0869 8.87693 19.5956 8.38967 18.9893 8.38953Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.89844 6.60743C6.49899 6.60747 7.79688 7.89254 7.79688 9.47736C7.79684 10.7388 6.97371 11.8078 5.83105 12.1926V14.4021C5.83105 15.0036 6.32315 15.4918 6.93066 15.4918H8.37109C8.86789 15.492 9.27038 15.8905 9.27051 16.3824C9.27051 16.8744 8.86797 17.2737 8.37109 17.2739H6.93066C5.32904 17.2739 4.03027 15.9879 4.03027 14.4021V12.2158C2.85382 11.8504 2.00004 10.7627 2 9.47736C2 7.89251 3.29784 6.60743 4.89844 6.60743ZM4.89844 8.38953C4.29196 8.38953 3.7998 8.87684 3.7998 9.47736C3.79985 10.0778 4.29198 10.5642 4.89844 10.5642C5.50485 10.5642 5.99605 10.0778 5.99609 9.47736C5.99609 8.87687 5.50488 8.38958 4.89844 8.38953Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9434 2.9707C13.5439 2.97075 14.8418 4.25581 14.8418 5.84063C14.8418 7.11413 14.0035 8.1923 12.8438 8.56745V13.0135C12.8436 13.5056 12.4403 13.9041 11.9434 13.9041C11.4466 13.9039 11.0431 13.5055 11.043 13.0135V8.56745C9.8836 8.19209 9.04496 7.11387 9.04492 5.84063C9.04492 4.25592 10.343 2.97093 11.9434 2.9707ZM11.9434 4.75281C11.3371 4.75303 10.8447 5.24026 10.8447 5.84063C10.8448 6.44097 11.3371 6.92726 11.9434 6.92749C12.5498 6.92745 13.041 6.44108 13.041 5.84063C13.041 5.24014 12.5498 4.75285 11.9434 4.75281Z",fill:"currentColor"},null,-1)])])}const qNe=Et({name:"kimi-task",render:WNe}),UNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VNe(e,t){return k(),L("svg",UNe,[...t[0]||(t[0]=[A("path",{d:"M16.5293 15.0596C16.9496 15.1021 17.2772 15.4572 17.2773 15.8887C17.2773 16.3202 16.9497 16.6753 16.5293 16.7178L16.4443 16.7217H12C11.5399 16.7216 11.167 16.3488 11.167 15.8887C11.1671 15.4286 11.54 15.0558 12 15.0557H16.4443L16.5293 15.0596Z",fill:"currentColor"},null,-1),A("path",{d:"M6.96582 7.52246C7.27077 7.21751 7.75375 7.1983 8.08105 7.46484L8.14453 7.52246L10.8232 10.2002C11.5102 10.8872 11.5102 12.0014 10.8232 12.6885L8.14453 15.3672L8.08105 15.4248C7.75377 15.6913 7.27075 15.6721 6.96582 15.3672C6.66114 15.0621 6.64234 14.5791 6.90918 14.252L6.96582 14.1885L9.64453 11.5098C9.68057 11.4736 9.68062 11.415 9.64453 11.3789L6.96582 8.7002C6.64116 8.37488 6.6411 7.84774 6.96582 7.52246Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 3.09961C19.1539 3.09966 20.9004 4.84612 20.9004 7V17C20.9004 19.1539 19.1539 20.9003 17 20.9004H7C4.84609 20.9004 3.09961 19.1539 3.09961 17V7C3.09961 4.84609 4.84609 3.09961 7 3.09961H17ZM7 4.90039C5.8402 4.90039 4.90039 5.8402 4.90039 7V17C4.90039 18.1598 5.8402 19.0996 7 19.0996H17C18.1598 19.0996 19.0996 18.1598 19.0996 17V7C19.0996 5.84024 18.1598 4.90044 17 4.90039H7Z",fill:"currentColor"},null,-1)])])}const KNe=Et({name:"kimi-terminal",render:VNe}),ZNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GNe(e,t){return k(),L("svg",ZNe,[...t[0]||(t[0]=[A("path",{d:"M16.9971 3.90597C15.9799 2.99725 14.7342 2.38312 13.394 2.12966C12.0538 1.8762 10.6699 1.99301 9.39111 2.46751C8.11236 2.94202 6.98721 3.75626 6.13676 4.82261C5.2863 5.88896 4.74274 7.16703 4.56457 8.5193C4.40455 9.70501 4.53253 10.9118 4.93767 12.0376C5.34281 13.1634 6.01318 14.175 6.89207 14.9868C7.43557 15.4634 7.87413 16.0477 8.17997 16.7027C8.48581 17.3577 8.65224 18.0691 8.66873 18.7918V18.926C8.66962 19.7412 8.99387 20.5229 9.57035 21.0993C10.1468 21.6758 10.9285 22.0001 11.7437 22.001H12.2604C13.0757 22.0001 13.8573 21.6758 14.4338 21.0993C15.0103 20.5229 15.3345 19.7412 15.3354 18.926V18.4685C15.3479 17.8297 15.4982 17.2011 15.7761 16.6258C16.0539 16.0505 16.4528 15.542 16.9454 15.1351C17.7442 14.4355 18.3853 13.5741 18.826 12.608C19.2668 11.642 19.4973 10.5932 19.5022 9.53136C19.5071 8.46948 19.2863 7.41869 18.8544 6.4486C18.4225 5.4785 17.7894 4.61125 16.9971 3.9043V3.90597ZM12.2604 20.3343H11.7437C11.3704 20.3339 11.0124 20.1853 10.7484 19.9213C10.4844 19.6573 10.3358 19.2993 10.3354 18.926C10.3354 18.926 10.3296 18.7093 10.3287 18.6676H13.6687V18.926C13.6683 19.2993 13.5198 19.6573 13.2558 19.9213C12.9917 20.1853 12.6338 20.3339 12.2604 20.3343ZM15.8437 13.8835C14.8949 14.7064 14.2097 15.7908 13.8737 17.001H12.8354V11.0143C13.3212 10.8426 13.742 10.5249 14.0403 10.1049C14.3387 9.68482 14.4999 9.18285 14.5021 8.66763C14.5021 8.44662 14.4143 8.23466 14.258 8.07838C14.1017 7.9221 13.8897 7.8343 13.6687 7.8343C13.4477 7.8343 13.2358 7.9221 13.0795 8.07838C12.9232 8.23466 12.8354 8.44662 12.8354 8.66763C12.8354 8.88865 12.7476 9.10061 12.5913 9.25689C12.435 9.41317 12.2231 9.50097 12.0021 9.50097C11.7811 9.50097 11.5691 9.41317 11.4128 9.25689C11.2565 9.10061 11.1687 8.88865 11.1687 8.66763C11.1687 8.44662 11.0809 8.23466 10.9247 8.07838C10.7684 7.9221 10.5564 7.8343 10.3354 7.8343C10.1144 7.8343 9.90242 7.9221 9.74614 8.07838C9.58986 8.23466 9.50207 8.44662 9.50207 8.66763C9.5042 9.18285 9.66547 9.68482 9.96381 10.1049C10.2621 10.5249 10.683 10.8426 11.1687 11.0143V17.001H10.0671C9.69123 15.7586 8.98633 14.6411 8.02707 13.7668C7.21286 13.0081 6.63267 12.0324 6.35496 10.9547C6.07725 9.87703 6.1136 8.7424 6.45974 7.68471C6.80588 6.62702 7.44735 5.69042 8.30846 4.98543C9.16956 4.28045 10.2144 3.83649 11.3196 3.70597C11.5487 3.68039 11.779 3.66759 12.0096 3.66763C13.4409 3.66338 14.8226 4.19149 15.8862 5.1493C16.5026 5.69896 16.9952 6.37337 17.3312 7.12782C17.6672 7.88227 17.839 8.69952 17.8352 9.5254C17.8314 10.3513 17.6522 11.1669 17.3092 11.9183C16.9663 12.6696 16.4677 13.3395 15.8462 13.8835H15.8437Z",fill:"currentColor"},null,-1)])])}const QNe=Et({name:"kimi-thinking",render:GNe}),YNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function JNe(e,t){return k(),L("svg",YNe,[...t[0]||(t[0]=[Qd('',6)])])}const XNe=Et({name:"kimi-todo",render:JNe}),eDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tDe(e,t){return k(),L("svg",eDe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.09752 2.19507C8.5421 1.97278 9.08271 2.15298 9.305 2.59756L10.0562 4.10005H13.5C13.9971 4.10005 14.4 4.50299 14.4 5.00005C14.4 5.49711 13.9971 5.90005 13.5 5.90005H12.3106C12.2556 6.2319 12.1667 6.64073 12.0226 7.0987C11.7254 8.04355 11.191 9.20402 10.2334 10.3239C11.4166 11.196 12.5606 11.7524 13.4512 12.0987C13.978 12.3036 14.4136 12.434 14.7124 12.5122L14.7348 12.5181L15.695 10.5976C15.8475 10.2927 16.1591 10.1 16.5 10.1C16.8409 10.1 17.1525 10.2927 17.305 10.5976L20.7969 17.5814L20.8044 17.5959L20.8137 17.615L21.805 19.5976C22.0273 20.0421 21.8471 20.5827 21.4025 20.805C20.9579 21.0273 20.4173 20.8471 20.195 20.4025L19.4438 18.9H13.5562L12.805 20.4025C12.5827 20.8471 12.0421 21.0273 11.5975 20.805C11.1529 20.5827 10.9727 20.0421 11.195 19.5976L12.1863 17.615C12.1917 17.6036 12.1973 17.5924 12.2031 17.5814L13.9146 14.1583C13.6034 14.0667 13.2256 13.9423 12.7988 13.7764C11.7294 13.3605 10.3442 12.6802 8.92538 11.5924C7.79753 12.5167 6.69473 13.0764 5.83285 13.4112C5.33899 13.603 4.92286 13.7216 4.62401 13.7931C4.47449 13.8288 4.35399 13.8529 4.26741 13.8684C4.2241 13.8762 4.18924 13.8818 4.16343 13.8858L4.13156 13.8904L4.12084 13.8919L4.11682 13.8924L4.11514 13.8927C4.11514 13.8927 4.11368 13.8928 4.00001 13L4.11368 13.8928C3.62061 13.9556 3.17 13.6068 3.10722 13.1137C3.0446 12.6219 3.39148 12.1723 3.88256 12.1077L3.94947 12.0967C4.00428 12.0869 4.09114 12.0698 4.20543 12.0424C4.43422 11.9877 4.77156 11.8924 5.18106 11.7334C5.84103 11.477 6.68484 11.0564 7.56458 10.3753C7.15054 9.93496 6.78945 9.48388 6.50421 9.10102C6.26672 8.78224 6.07517 8.50172 5.94227 8.29973C5.87571 8.19858 5.82359 8.11671 5.78748 8.05909C5.76942 8.03027 5.75535 8.00749 5.74545 7.99135L5.73377 7.9722L5.73032 7.96651L5.72864 7.96371C5.71133 7.9349 5.69582 7.9055 5.68208 7.87566C5.49265 7.46416 5.6393 6.96717 6.03659 6.72853C6.09037 6.69623 6.14617 6.6702 6.20315 6.65023C6.59739 6.51205 7.04758 6.66421 7.27129 7.03623L7.27266 7.0385L7.28001 7.05054C7.28695 7.06186 7.29793 7.07964 7.31274 7.10328C7.34239 7.15059 7.38731 7.2212 7.44595 7.31032C7.56343 7.48886 7.73484 7.73997 7.94765 8.02562C8.21085 8.37889 8.52772 8.77187 8.8756 9.14201C9.64226 8.24147 10.0681 7.3133 10.3056 6.55854C10.381 6.3186 10.4372 6.09683 10.4791 5.90005H9.51951C9.50696 5.90031 9.49442 5.90031 9.48191 5.90005H4.00001C3.50296 5.90005 3.10001 5.49711 3.10001 5.00005C3.10001 4.50299 3.50296 4.10005 4.00001 4.10005H8.04378L7.69503 3.40254C7.67314 3.35877 7.65516 3.31407 7.64094 3.26883C7.51078 2.8546 7.69671 2.39547 8.09752 2.19507ZM16.5 13.0125L18.5438 17.1H14.4562L16.5 13.0125Z",fill:"currentColor"},null,-1),A("path",{d:"M15.1 4.00007C15.1 3.50301 15.5029 3.10007 16 3.10007H18C19.6016 3.10007 20.9 4.39844 20.9 6.00007V8.00007C20.9 8.49712 20.497 8.90007 20 8.90007C19.5029 8.90007 19.1 8.49712 19.1 8.00007V6.00007C19.1 5.39255 18.6075 4.90007 18 4.90007H16C15.5029 4.90007 15.1 4.49712 15.1 4.00007Z",fill:"currentColor"},null,-1),A("path",{d:"M3.99998 15.1001C4.49703 15.1001 4.89998 15.503 4.89998 16.0001V18.0001C4.89998 18.6076 5.39246 19.1001 5.99998 19.1001H7.99998C8.49703 19.1001 8.89998 19.503 8.89998 20.0001C8.89998 20.4971 8.49703 20.9001 7.99998 20.9001H5.99998C4.39835 20.9001 3.09998 19.6017 3.09998 18.0001V16.0001C3.09998 15.503 3.50292 15.1001 3.99998 15.1001Z",fill:"currentColor"},null,-1)])])}const nDe=Et({name:"kimi-translate",render:tDe}),iDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oDe(e,t){return k(),L("svg",iDe,[...t[0]||(t[0]=[A("path",{d:"M8.10001 3C8.10001 2.50294 8.50295 2.1 9.00001 2.1H15C15.4971 2.1 15.9 2.50294 15.9 3C15.9 3.49706 15.4971 3.9 15 3.9H9.00001C8.50295 3.9 8.10001 3.49706 8.10001 3Z",fill:"currentColor"},null,-1),A("path",{d:"M10 15.9C9.50295 15.9 9.10001 15.4971 9.10001 15L9.10001 10C9.10001 9.50294 9.50295 9.1 10 9.1C10.4971 9.1 10.9 9.50294 10.9 10L10.9 15C10.9 15.4971 10.4971 15.9 10 15.9Z",fill:"currentColor"},null,-1),A("path",{d:"M13.1 15C13.1 15.4971 13.5029 15.9 14 15.9C14.4971 15.9 14.9 15.4971 14.9 15L14.9 10C14.9 9.50294 14.4971 9.1 14 9.1C13.5029 9.1 13.1 9.50294 13.1 10V15Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.10001 6C2.10001 5.50294 2.50295 5.1 3.00001 5.1H4.99152C4.99785 5.09993 5.00417 5.09993 5.01048 5.1H18.9895C18.9958 5.09993 19.0021 5.09993 19.0085 5.1H21C21.4971 5.1 21.9 5.50294 21.9 6C21.9 6.49706 21.4971 6.9 21 6.9H19.8281L18.8448 18.6993C18.7412 19.9432 17.7013 20.9 16.4531 20.9H7.54686C6.29865 20.9 5.25881 19.9432 5.15515 18.6993L4.17188 6.9H3.00001C2.50295 6.9 2.10001 6.49706 2.10001 6ZM5.97811 6.9L18.0219 6.9L17.0511 18.5498C17.0251 18.8608 16.7652 19.1 16.4531 19.1H7.54686C7.23481 19.1 6.97485 18.8608 6.94893 18.5498L5.97811 6.9Z",fill:"currentColor"},null,-1)])])}const sDe=Et({name:"kimi-trash",render:oDe}),rDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lDe(e,t){return k(),L("svg",rDe,[...t[0]||(t[0]=[A("path",{d:"M7.36336 3.3634C7.71483 3.01192 8.28533 3.01192 8.6368 3.3634C8.98817 3.71488 8.98824 4.2854 8.6368 4.63683L6.17391 7.09972H15.0001C18.2585 7.09977 20.9005 9.74166 20.9005 13.0001C20.9004 16.2585 18.2585 18.9005 15.0001 18.9005H7.00008C6.50307 18.9005 6.09976 18.4971 6.09969 18.0001C6.09969 17.5031 6.50302 17.0997 7.00008 17.0997H15.0001C17.2644 17.0997 19.0996 15.2644 19.0997 13.0001C19.0997 10.7358 17.2644 8.90055 15.0001 8.90051H6.17391L8.6368 11.3634L8.69832 11.4318C8.98668 11.7853 8.96632 12.3073 8.6368 12.6368C8.30728 12.9663 7.78521 12.9867 7.43172 12.6984L7.36336 12.6368L3.36336 8.63683C3.33098 8.60445 3.30286 8.56908 3.27645 8.53332C3.25597 8.50559 3.23607 8.47741 3.21883 8.44738C3.20492 8.42311 3.19221 8.39837 3.18074 8.37316C3.1764 8.36365 3.17109 8.35453 3.16707 8.34484C3.1627 8.33427 3.1593 8.32331 3.15535 8.31261C3.12946 8.24274 3.11237 8.16872 3.10457 8.09191C3.09258 7.97426 3.10262 7.85446 3.1368 7.74035C3.14281 7.72035 3.15094 7.70114 3.15828 7.68176C3.16165 7.67283 3.16341 7.66325 3.16707 7.65441C3.17216 7.64216 3.17806 7.63025 3.18367 7.61828C3.19055 7.60356 3.19744 7.58874 3.20516 7.57433C3.24709 7.49624 3.3012 7.42556 3.36336 7.3634L7.36336 3.3634Z",fill:"currentColor"},null,-1)])])}const aDe=Et({name:"kimi-undo",render:lDe}),uDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function cDe(e,t){return k(),L("svg",uDe,[...t[0]||(t[0]=[A("path",{d:"M11.9997 12.8779C16.0197 12.878 19.4393 15.3848 20.7048 18.8828C21.0812 19.9234 20.2782 20.8962 19.2038 21.0137L18.9861 21.0264H5.0134L4.79562 21.0137C3.7213 20.8961 2.91743 19.9233 3.29367 18.8828C4.55905 15.3847 7.9797 12.8781 11.9997 12.8779ZM11.9997 14.6777C8.84467 14.6779 6.17462 16.5794 5.09152 19.2256H18.9079C17.8248 16.5793 15.1549 14.6778 11.9997 14.6777ZM12.2312 3.00586C14.6088 3.1264 16.4997 5.09239 16.4997 7.5L16.4939 7.73145C16.3734 10.1091 14.4073 11.9999 11.9997 12C9.59225 11.9998 7.62604 10.109 7.50558 7.73145L7.49973 7.5C7.49973 5.01485 9.51462 3.00021 11.9997 3L12.2312 3.00586ZM11.9997 4.7998C10.5087 4.80001 9.29953 6.00896 9.29953 7.5C9.29953 8.99104 10.5087 10.2 11.9997 10.2002C13.4908 10.2001 14.6999 8.99112 14.6999 7.5C14.6999 6.00888 13.4908 4.79989 11.9997 4.7998Z",fill:"currentColor"},null,-1)])])}const dDe=Et({name:"kimi-user",render:cDe}),fDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function hDe(e,t){return k(),L("svg",fDe,[...t[0]||(t[0]=[A("path",{d:"M11.9996 7C11.5026 7 11.0996 7.36985 11.0996 7.82609V14.1739C11.0996 14.6301 11.5026 15 11.9996 15C12.4967 15 12.8996 14.6301 12.8996 14.1739V7.82609C12.8996 7.36985 12.4967 7 11.9996 7Z",fill:"currentColor"},null,-1),A("path",{d:"M12.8996 17.1006C12.8996 17.5974 12.4968 18.001 11.9992 18.001C11.5024 18.001 11.0996 17.5974 11.0996 17.1006C11.0996 16.6038 11.5024 16.2002 11.9992 16.2002C12.4968 16.2002 12.8996 16.6038 12.8996 17.1006Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.5108 3.5501C13.3946 1.61676 10.6041 1.61676 9.48786 3.5501L1.69363 17.0501C0.577423 18.9834 1.97269 21.4001 4.20511 21.4001H19.7936C22.026 21.4001 23.4212 18.9834 22.305 17.0501L14.5108 3.5501ZM11.0467 4.4501C11.4701 3.71676 12.5286 3.71676 12.952 4.4501L20.7462 17.9501C21.1696 18.6834 20.6403 19.6001 19.7936 19.6001H4.20511C3.35833 19.6001 2.82909 18.6834 3.25248 17.9501L11.0467 4.4501Z",fill:"currentColor"},null,-1)])])}const pDe=Et({name:"kimi-warning",render:hDe}),mDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gDe(e,t){return k(),L("svg",mDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6a2 2 0 1 0 4 0a2 2 0 1 0-4 0M4 6h8m4 0h4M6 12a2 2 0 1 0 4 0a2 2 0 1 0-4 0m-2 0h2m4 0h10m-5 6a2 2 0 1 0 4 0a2 2 0 1 0-4 0M4 18h11m4 0h1"},null,-1)])])}const vDe=Et({name:"tabler-adjustments-horizontal",render:gDe}),yDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kDe(e,t){return k(),L("svg",yDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 6l-6 6l6 6"},null,-1)])])}const bDe=Et({name:"tabler-chevron-left",render:kDe}),wDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CDe(e,t){return k(),L("svg",wDe,[...t[0]||(t[0]=[A("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[A("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0"}),A("path",{d:"m9 12l2 2l4-4"})],-1)])])}const ADe=Et({name:"tabler-circle-check",render:CDe}),xDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SDe(e,t){return k(),L("svg",xDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.56 3.69a9 9 0 0 0-2.92 1.95M3.69 8.56A9 9 0 0 0 3 12m.69 3.44a9 9 0 0 0 1.95 2.92m2.92 1.95A9 9 0 0 0 12 21m3.44-.69a9 9 0 0 0 2.92-1.95m1.95-2.92A9 9 0 0 0 21 12m-.69-3.44a9 9 0 0 0-1.95-2.92m-2.92-1.95A9 9 0 0 0 12 3"},null,-1)])])}const _De=Et({name:"tabler-circle-dashed",render:SDe}),MDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IDe(e,t){return k(),L("svg",MDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm4 15h10m-8-4v4m6-4v4"},null,-1)])])}const TDe=Et({name:"tabler-device-desktop",render:IDe}),EDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LDe(e,t){return k(),L("svg",EDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 3h6m-5 6h4m-4-6v6L6 20a.7.7 0 0 0 .5 1h11a.7.7 0 0 0 .5-1L14 9V3"},null,-1)])])}const NDe=Et({name:"tabler-flask",render:LDe}),DDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FDe(e,t){return k(),L("svg",DDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const BDe=Et({name:"tabler-paperclip",render:FDe}),RDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $De(e,t){return k(),L("svg",RDe,[...t[0]||(t[0]=[A("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[A("path",{d:"M11 19H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v4"}),A("path",{d:"M14 15a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-5a1 1 0 0 1-1-1z"})],-1)])])}const ODe=Et({name:"tabler-picture-in-picture",render:$De}),PDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zDe(e,t){return k(),L("svg",PDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 18h5m-5-6h13a3 3 0 0 1 0 6h-4l2-2m0 4l-2-2"},null,-1)])])}const jDe=Et({name:"tabler-text-wrap",render:zDe}),HDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WDe(e,t){return k(),L("svg",HDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h10M4 18h10M4 12h17l-3-3m0 6l3-3"},null,-1)])])}const qDe=Et({name:"tabler-text-wrap-disabled",render:WDe}),UDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VDe(e,t){return k(),L("svg",UDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 6h9m-9 6h9m-8 6h8M4 16a2 2 0 1 1 4 0c0 .591-.5 1-1 1.5L4 20h4M6 10V4L4 6"},null,-1)])])}const KDe=Et({name:"tabler-list-numbers",render:VDe}),ZDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GDe(e,t){return k(),L("svg",ZDe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const QDe=Et({name:"ri-braces-line",render:GDe}),YDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JDe(e,t){return k(),L("svg",YDe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const XDe=Et({name:"ri-calendar-close-line",render:JDe}),eFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tFe(e,t){return k(),L("svg",eFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const nFe=Et({name:"ri-calendar-schedule-line",render:tFe}),iFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oFe(e,t){return k(),L("svg",iFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const sFe=Et({name:"ri-calendar-todo-line",render:oFe}),rFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lFe(e,t){return k(),L("svg",rFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const aFe=Et({name:"ri-code-line",render:lFe}),uFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cFe(e,t){return k(),L("svg",uFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-4-7h8a4 4 0 0 1-8 0m0-2a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m8 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3"},null,-1)])])}const dFe=Et({name:"ri-emotion-line",render:cFe}),fFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hFe(e,t){return k(),L("svg",fFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const pFe=Et({name:"ri-external-link-line",render:hFe}),mFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gFe(e,t){return k(),L("svg",mFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M12 3c5.392 0 9.878 3.88 10.819 9c-.94 5.12-5.427 9-10.819 9s-9.878-3.88-10.818-9C2.122 6.88 6.608 3 12 3m0 16a9.005 9.005 0 0 0 8.778-7a9.005 9.005 0 0 0-17.555 0A9.005 9.005 0 0 0 12 19m0-2.5a4.5 4.5 0 1 1 0-9a4.5 4.5 0 0 1 0 9m0-2a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5"},null,-1)])])}const vFe=Et({name:"ri-eye-line",render:gFe}),yFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kFe(e,t){return k(),L("svg",yFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M17.883 19.297A10.95 10.95 0 0 1 12 21c-5.392 0-9.878-3.88-10.818-9A11 11 0 0 1 4.52 5.935L1.394 2.808l1.414-1.414l19.799 19.798l-1.414 1.415zM5.936 7.35A8.97 8.97 0 0 0 3.223 12a9.005 9.005 0 0 0 13.201 5.838l-2.028-2.028A4.5 4.5 0 0 1 8.19 9.604zm6.978 6.978l-3.242-3.241a2.5 2.5 0 0 0 3.241 3.241m7.893 2.265l-1.431-1.431A8.9 8.9 0 0 0 20.778 12A9.005 9.005 0 0 0 9.552 5.338L7.974 3.76C9.221 3.27 10.58 3 12 3c5.392 0 9.878 3.88 10.819 9a10.95 10.95 0 0 1-2.012 4.593m-9.084-9.084Q11.86 7.5 12 7.5a4.5 4.5 0 0 1 4.492 4.778z"},null,-1)])])}const bFe=Et({name:"ri-eye-off-line",render:kFe}),wFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CFe(e,t){return k(),L("svg",wFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const AFe=Et({name:"ri-file-add-line",render:CFe}),xFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SFe(e,t){return k(),L("svg",xFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const _Fe=Et({name:"ri-flashlight-line",render:SFe}),MFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IFe(e,t){return k(),L("svg",MFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const TFe=Et({name:"ri-sparkling-line",render:IFe}),EFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LFe(e,t){return k(),L("svg",EFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const NFe=Et({name:"ri-folder-fill",render:LFe}),DFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FFe(e,t){return k(),L("svg",DFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const BFe=Et({name:"ri-git-fork-line",render:FFe}),RFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $Fe(e,t){return k(),L("svg",RFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const OFe=Et({name:"ri-git-pull-request-line",render:$Fe}),PFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zFe(e,t){return k(),L("svg",PFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M2 18h7v2H2zm0-7h9v2H2zm0-7h20v2H2zm18.674 9.025l1.156-.391l1 1.732l-.916.805a4 4 0 0 1 0 1.658l.916.805l-1 1.732l-1.156-.391a4 4 0 0 1-1.435.83L19 21h-2l-.24-1.196a4 4 0 0 1-1.434-.83l-1.156.392l-1-1.732l.916-.805a4 4 0 0 1 0-1.658l-.916-.805l1-1.732l1.156.391c.41-.37.898-.655 1.435-.83L17 11h2l.24 1.196a4 4 0 0 1 1.434.83M18 18a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const jFe=Et({name:"ri-list-settings-line",render:zFe}),HFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WFe(e,t){return k(),L("svg",HFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M10 2a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H8v2h5V9a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H8v6h5v-1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H7a1 1 0 0 1-1-1V8H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm9 16h-4v2h4zm0-8h-4v2h4zM9 4H5v2h4z"},null,-1)])])}const qFe=Et({name:"ri-node-tree",render:WFe}),UFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VFe(e,t){return k(),L("svg",UFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m13.827 1.69l8.486 8.485l-1.415 1.414l-.707-.707l-4.242 4.243l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243l1.414-1.414l3.536-.707l4.242-4.243l-.707-.707zm.707 3.536l-4.67 4.67l-2.822.565l6.5 6.5l.564-2.822l4.671-4.67z"},null,-1)])])}const KFe=Et({name:"ri-pushpin-line",render:VFe}),ZFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GFe(e,t){return k(),L("svg",ZFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const QFe=Et({name:"ri-sort-desc",render:GFe}),YFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JFe(e,t){return k(),L("svg",YFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const XFe=Et({name:"ri-star-fill",render:JFe}),eBe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tBe(e,t){return k(),L("svg",eBe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const nBe=Et({name:"ri-star-line",render:tBe}),iBe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oBe(e,t){return k(),L("svg",iBe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const sBe=Et({name:"ri-tools-line",render:oBe}),rBe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lBe(e,t){return k(),L("svg",rBe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m20.97 17.172l-1.414 1.414l-3.535-3.535l-.073.074l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243L5.34 8.761l3.536-.707l.073-.074l-3.536-3.536L6.828 3.03zM10.365 9.394l-.502.502l-2.822.565l6.5 6.5l.564-2.822l.502-.502zm8.411.074l-1.34 1.34l1.414 1.415l1.34-1.34l.707.707l1.415-1.415l-8.486-8.485l-1.414 1.414l.707.707l-1.34 1.34l1.414 1.415l1.34-1.34z"},null,-1)])])}const aBe=Et({name:"ri-unpin-line",render:lBe}),uBe=` +`&&x.previousSibling instanceof Element&&x.previousSibling.classList.contains("quote-pill")&&x.nextSibling instanceof Element&&x.nextSibling.classList.contains("quote-pill")&&x.replaceWith(document.createTextNode(" "));let _=!1;for(const x of I.querySelectorAll(".quote-pill"))_=!0,x.replaceWith(document.createTextNode(tb({text:x.getAttribute("data-quote-text")??x.textContent??"",comment:x.getAttribute("data-quote-comment")??"",source:x.getAttribute("data-quote-source")??""})));if(S.length>0||_){d(I);const{text:x,attIdRemap:E}=SSe(I.textContent??""),M=S.map(z=>{const $=E[z.attId]??z.attId,B=D1(z.attId,t.attachments);return bU({...z,attId:$},B)}),R=W0(x,{reviveMentions:!0,attachmentKindFor:SA(M)}),q={v:1,slice:hn.maxOpen(R.content).toJSON()??{},attachments:M};m.clipboardData?.setData(Cx,kU(JSON.stringify(q)))}m.preventDefault()}return(m,g)=>(k(),L("span",{class:"composer-text",onCopy:h},[(k(!0),L(De,null,Ct(n.value,(v,y)=>(k(),L(De,{key:y},[v.type==="quote"?(k(),L("span",{key:0,class:"quote-pill",tabindex:e.interactive?0:void 0,"data-quote-text":v.text,"data-quote-comment":v.comment||void 0,"data-quote-comment-sep":v.commentSep,"data-quote-source":v.source||void 0,"aria-label":v.comment?`${v.text} +${v.comment}`:v.text},[A("span",{class:"quote-pill-icon","aria-hidden":"true",innerHTML:p(gV)()},null,8,xIe),A("span",SIe,F(p(N1)(v.text)),1),v.comment?(k(),L("span",_Ie,F(p(N1)(v.comment)),1)):ee("",!0)],8,AIe)):v.type==="sep"?(k(),L(De,{key:1},[i(y)?(k(),L("span",MIe,F(v.text),1)):(k(),L(De,{key:1},[Oe(F(v.text),1)],64))],64)):(k(!0),L(De,{key:2},Ct(v.segments,(b,w)=>(k(),L(De,{key:w},[b.type==="mention"?(k(),L("span",di({key:0,class:`mention-pill mention-${b.attrs.kind}`,"data-mention-kind":b.attrs.kind,"data-mention-name":b.attrs.name,"data-mention-path":b.attrs.path||void 0,"data-mention-action-path":l(b)},{ref_for:!0},o(b.attrs),{onClick:C=>a(b,C),onKeydown:C=>u(b,C)}),[A("span",{class:"mention-pill-icon","aria-hidden":"true",innerHTML:p(eb)(b.attrs.kind,b.attrs.path,b.attrs.name)},null,8,TIe),A("span",EIe,F(p(_u)(b.attrs.name)),1)],16,IIe)):b.type==="attachment"?(k(),L("span",di({key:1,class:`attachment-pill attachment-${r(b.attrs)}`,"data-attachment-id":b.attrs.attId,"data-attachment-kind":r(b.attrs),"data-attachment-name":b.attrs.name},{ref_for:!0},s(b.attrs)),[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p(O1)(r(b.attrs))},null,8,NIe),A("span",DIe,F(p(_u)(b.attrs.name)),1)],16,LIe)):(k(),L(De,{key:2},[Oe(F(b.value),1)],64))],64))),128))],64))),128))],32))}}),MV=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],FIe=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),MA=[...MV].sort((e,t)=>t.length-e.length).join("|"),f5=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${MA}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${MA})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),IV=/[),.;!?,。;!?)]+$/;function BIe(e){const t=e.toLowerCase();return MV.some(n=>t.endsWith(`.${n}`))}function RIe(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${MA}))["']`,"gi");let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=o.split("/").pop();s&&t.set(s,o)}return t}function OIe(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const i=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!i)return null;let o=(i[1]??"").replace(IV,"");if(!o)return null;const s=o.split("/").pop()??o,r=o.includes("/"),l=FIe.has(s),a=BIe(s);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(s);if(!d)return null;o=d}const u=i[2]??i[3],c=u?Number(u):void 0;return{path:o,line:c!==void 0&&Number.isFinite(c)&&c>0?c:void 0}}function $Ie(e,t={}){const n=[];f5.lastIndex=0;let i;for(;(i=f5.exec(e))!==null;){const o=i[0]??"",s=i[1]??"",r=o.indexOf(s);if(r<0)continue;const l=i[2]??i[3];let a=s+(l?o.slice(r+s.length):"");const u=a.replace(IV,""),c=a.length-u.length;a=u;const d=OIe(a,t);if(!d)continue;const f=i.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),c>0&&(f5.lastIndex-=c)}return n}const PIe=/^---[ \t]*$/,zIe=/^---[ \t]*(?:\r\n|\n)/;function jIe(e){const t=zIe.exec(e);if(t===null)return{frontmatter:null,body:e};let n=t[0].length;const i=n;for(;n<=e.length;){let o=e.indexOf(` +`,n);o===-1&&(o=e.length);let s=e.slice(n,o);if(s.endsWith("\r")&&(s=s.slice(0,-1)),PIe.test(s)){const r=e.slice(i,n);if(r==="")return{frontmatter:null,body:e};const l=o=0&&e[i]==="\\";)n++,i--;return n%2===1}const HIe=/\s/,WIe=/\p{Nd}/u;function $h(e,t){const n=e.codePointAt(t);return n===void 0?void 0:String.fromCodePoint(n)}function qIe(e,t){if(t<=0)return;const n=e.charCodeAt(t-1),i=n>=56320&&n<=57343&&t>1?t-2:t-1,o=e.codePointAt(i);return o===void 0?void 0:String.fromCodePoint(o)}function zF(e){return e!==void 0&&HIe.test(e)}function $1(e){return e!==void 0&&WIe.test(e)}function UIe(e,t){const n=e[t+1];return $1($h(e,t+1))?!0:(n==="-"||n==="+"||n==="."||n==="−"||n==="+"||n==="-")&&$1($h(e,t+2))}function L4(e){return e!==void 0&&e>="A"&&e<="Z"}const TV=new RegExp(String.raw`^(?:AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CUC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SLL|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|UYU|UZS|VED|VES|VND|VUV|WST|XAF|XCD|XOF|XPF|YER|ZAR|ZMW|ZWL|HK|US|SG|AU|CA|NZ|NT|TW|RMB|MEX|TT|BZ|EU|UK)$`);function VIe(e,t){if(!L4(e[t-1]))return!1;let n=t-1;for(;n>0&&L4(e[n-1]);)n--;return TV.test(e.slice(n,t))||$1($h(e,t+1))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")&&!/\p{L}/u.test($h(e,t+1)??"")}function KIe(e,t){if(!L4(e[t-1]))return!1;let n=t-1;for(;n>0&&L4(e[n-1]);)n--;return TV.test(e.slice(n,t))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")}const ZIe=/^[-–—,,、;;::~~(([【//]$/;function GIe(e,t){const n=e[t+1];if(n!=="-"&&n!=="+"&&n!=="."||!$1($h(e,t+2)))return!1;const i=e[t-1];return i!==void 0&&ZIe.test(i)}function QIe(e){const t=String.raw`[、,,;;::~~\-–—至到//\s()()=*×=]|和|跟|与|及|或|and|or`;let n=e.replace(new RegExp(String.raw`^(?:${t})+`,"u"),"");for(;;){const o=n.replace(new RegExp(String.raw`^\p{L}+(?:${t})+`,"u"),"").replace(/^[\p{L}][\p{L} ]*(?=\p{Nd})/u,"");if(o===n)break;n=o}if(!/\p{Nd}/u.test(n))return!1;const i=String.raw`[-+]?[\p{Nd}][\p{Nd},.'’]*`;return new RegExp(String.raw`^${i}(?:\p{L}+)?(?:(?:${t})+${i}(?:\p{L}+)?)*$`,"u").test(n)}const au=-1,jF=1,HF=2,WF=3;function YIe(e){const t=e.length,n=new Uint8Array(t),i=new Int32Array(t+1).fill(au),o=new Int32Array(t+1),s=new Int32Array(t+1),r=[],l=[];{const P=[];for(let ne=0;ne{for(;a=(l[a]?.[1]??0);)a++;const H=l[a];return H!==void 0&&P>=H[0]},c=new Set(' \n\r)。,、;:!?"<>`「」『』【】〔〕()*—–“”‘’'),d=[];for(const P of e.matchAll(/\b(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/gi))d.push(P.index);for(const P of e.matchAll(/\b(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|[\w-]+(?:\.[\w-]+)*\.[a-zA-Z]{2,})(?=(?:\/|\?|:\d))/gi))d.push(P.index);for(const P of e.matchAll(/(?:\.{1,2})?\/[\p{L}\p{Nd}._-]+(?:\/[\p{L}\p{Nd}._-]*)*\?/gu))(P.index===0||!/[\w~/.-]/.test(e[P.index-1]))&&d.push(P.index);d.sort((P,H)=>P-H);let f=-1;for(const P of d){if(PP+7&&!/[\w/?#@~.+&=%-]/.test(e[H+1]??""))break}H++}r.push([P,H]),f=H}const h=[];for(let P=0;P]/.test(ne))continue;let W=H,Q=au,te=au;for(;W"){te=W;break}if(!j&&X==="/"&&e[W+1]===">"){te=W+1;break}if(!/\s/.test(X)){Q=W;break}for(;W"){te=W;break}if(j){Q=W;break}if(ve==="/"&&e[W+1]===">"){te=W+1;break}const ce=/^[a-zA-Z_:][\w:.-]*/.exec(e.slice(W));if(!ce){Q=W;break}W+=ce[0].length;let se=W;for(;se`]+/.exec(e.slice(se));if(!Z){Q=se;break}W=se+Z[0].length}}}if(te!==au)h.push([P,te+1]),P=te;else if(Q!==au){const X=e.indexOf("<",P+1);P=(X!==-1&&X",P+2);Q===-1?g=!1:(h.push([P,Q+2]),P=Q+1,j=!0)}else if(H==="!"){if(e[P+2]==="-"&&e[P+3]==="-"){if(m){const Q=e.indexOf("-->",P+4);Q===-1?m=!1:(h.push([P,Q+3]),P=Q+2,j=!0)}}else if(e.startsWith("[CDATA[",P+2)){if(v){const Q=e.indexOf("]]>",P+9);Q===-1?v=!1:(h.push([P,Q+3]),P=Q+2,j=!0)}}else if(y&&/[A-Z]/.test(e[P+2]??"")){const Q=e.indexOf(">",P+3);Q===-1?y=!1:(h.push([P,Q+1]),P=Q,j=!0)}}if(j)continue;if(H!==void 0&&/[a-zA-Z]/.test(H)){const Q=/^[a-zA-Z][a-zA-Z0-9+.-]{1,31}:/.exec(e.slice(P+1));if(Q){let te=P+1+Q[0].length;for(;te"&&e[te]!=="<"&&!/\s/.test(e[te]);)te++;if(e[te]===">"){h.push([P,te+1]),P=te;continue}}}if(H===void 0||!/[\w.!#$%&'*+/=?^`{|}~-]/.test(H))continue;let G=P+1;for(;G"&&(h.push([P,G+1]),P=G)}}h.sort((P,H)=>P[0]-H[0]);const b=[];for(const[P,H]of h){const j=b[b.length-1];j&&P<=j[1]?j[1]=Math.max(j[1],H):b.push([P,H])}r.push(...b);let w=0;const C=P=>{for(;w=(b[w]?.[1]??0);)w++;const H=b[w];return H!==void 0&&P>=H[0]},T=[];let N=null,I=0,S=!1;for(let P=0;P"&&(S=!1);else if(!(u(P)||C(P))){if(N!==null)e[P]===N&&(N=null);else if(T.length>0&&(e[P]==='"'||e[P]==="'")&&P>0&&/\s/.test(e[P-1]))N=e[P];else if(e[P]==="[")I++;else if(e[P]==="]")I>0&&e[P+1]==="("&&(T.push(P),S=e[P+2]==="<",P++),I=Math.max(0,I-1);else if(e[P]==="("&&T.length>0)T.push(-1);else if(e[P]===")"&&T.length>0){const H=T.pop();if(H!==void 0&&H>=0){const j=e.slice(H+2,P);(/\s/.exec(j)===null||j.startsWith("<")&&/^<(?:\\[<>]|[^<>])*>$/.test(j)||/^[^\s]*\s+("([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\(([^()\\]|\\.)*\))$/.test(j))&&r.push([H,P+1])}}}r.sort((P,H)=>P[0]-H[0]);const _=[];for(const[P,H]of r){const j=_[_.length-1];j&&P<=j[1]?j[1]=Math.max(j[1],H):_.push([P,H])}const x=P=>{let H=0,j=_.length-1;for(;H<=j;){const G=H+j>>1,ne=_[G];if(ne===void 0)return!1;if(P=ne[1])H=G+1;else return!0}return!1},E=new Uint8Array(t);{let P=-1,H=!1,j=!1,G=0;for(let ne=0;ne<=t;ne++){const W=ne0&&(Q==="{"?G++:Q==="}"&&G--)}}for(let P=0;P=0;P--)n[P]===WF&&(M=P),i[P]=M;const R=/^[\p{L}\p{Nd}\\|{([+.¬°-±×÷′-″←-⇿∀-⋿^_<>=-]$/u,q=/[^\p{L}\p{Nd}\s]$/u,z=/[^\s\u0020-\u007E\u0370-\u03FF\u{1D400}-\u{1D7FF}\p{Nd}¬°-±×÷′-″←-⇿∀-⋿]/u,$=/(?:^|\s)[a-z]{2,}/,B=(P,H)=>{const j=$h(e,P+1);if(j===void 0||!R.test(j))return!1;const G=i[P+1]??au;if(G!==au){const ne=e.slice(P+1,G);return!(ne.length===((ne.codePointAt(0)??0)>65535?2:1))&&z.test(ne)||/[,;:!?]$/.test(ne)||/^[a-z]{2,}$/.test(ne)?!1:(o[G]??0)-(o[P+1]??0)===0&&(s[G]??0)-(s[P+1]??0)===0}return q.test(H)||z.test(H)||$.test(H)};return(P,H=-1)=>{if(e[P]!=="$"||n[P]===jF||e[P+1]==="$"||e[P-1]==="$"&&H!==P||VIe(e,P)||P+1>=t||zF(e[P+1]))return null;const j=i[P+1]??au;if(j===au||(o[j]??0)-(o[P+1]??0)>0||(s[j]??0)-(s[P+1]??0)>0)return null;const G=e.slice(P+1,j);return/^\{[A-Z_][A-Z0-9_]*(?:\}$|[:-])/.test(G)||e[j+1]==="{"&&/^\{[A-Za-z_][A-Za-z0-9_]*(?:[:-][^{}]*)?\}$/.test(G)||$1(qIe(e,P))&&QIe(G)||UIe(e,P)&&(B(j,G)||KIe(e,j)||/\s/.test(G)&&/\p{Nd}$/u.test(G)&&!/[+\-*/^=_<>|\\¬°-±×÷′-″←-⇿∀-⋿]/.test(G)||e[j+1]==="$"&&!/\p{L}/u.test(G)&&/[^\p{L}\p{Nd}\s]$/u.test(G))?null:{content:G,end:j+1}}}const qF=new WeakMap;function JIe(e,t){if(e.src[e.pos]!=="$")return!1;let n=qF.get(e);(!n||n.src!==e.src)&&(n={src:e.src,match:YIe(e.src),lastEnd:-1},qF.set(e,n));const i=n.match(e.pos,n.lastEnd);if(!i||i.end>e.posMax)return!1;if(n.lastEnd=i.end,t)return e.pos=i.end,!0;const o=e.push("math_inline","math",0);return o.content=i.content,o.markup="$",o.raw=e.src.slice(e.pos,i.end),o.loading=!1,e.pos=i.end,!0}function XIe(e){return e.set({typographer:!1}),e.inline.ruler.disable("math"),e.inline.ruler.before("escape","math",JIe),e}const eTe=12e4,tTe=6e4,nTe=32,iTe=3e4,UF=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function oTe(e){let t=0,n=0,i=0;UF.lastIndex=0;let o;for(;(o=UF.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,i=Math.max(i,r.length)}return{codeRenderer:e.length>=eTe||n>=tTe||t>=nTe||i>=iTe?"pre":"shiki",codeFenceCount:t,codeChars:n}}async function EV(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return rTe(e)}function sTe(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||EV(e)}function rTe(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}const lTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function aTe(e,t){return k(),L("svg",lTe,[...t[0]||(t[0]=[A("path",{d:"M12.0684 2.03418C12.5654 2.03421 12.9687 2.43755 12.9688 2.93457V11.0996H21.0654C21.5625 11.0996 21.9658 11.503 21.9658 12C21.9658 12.497 21.5625 12.9004 21.0654 12.9004H12.9688V21.0654C12.9687 21.5624 12.5654 21.9658 12.0684 21.9658C11.5713 21.9658 11.168 21.5625 11.168 21.0654V12.9004H2.93457C2.43751 12.9004 2.03418 12.4971 2.03418 12C2.03418 11.5029 2.43751 11.0996 2.93457 11.0996H11.168V2.93457C11.168 2.43753 11.5713 2.03418 12.0684 2.03418Z",fill:"currentColor"},null,-1)])])}const uTe=Et({name:"kimi-add",render:aTe}),cTe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function dTe(e,t){return k(),L("svg",cTe,[...t[0]||(t[0]=[A("path",{id:"p0",d:"M 0 -9.9 C -5.468 -9.9 -9.9 -5.468 -9.9 0 C -9.9 1.923 -9.351 3.719 -8.402 5.239 C -8.402 5.239 -9.483 7.821 -9.483 7.821 C -9.896 8.809 -9.171 9.9 -8.099 9.9 C -8.099 9.9 0 9.9 0 9.9 C 5.468 9.9 9.9 5.468 9.9 0 C 9.9 -5.468 5.468 -9.9 0 -9.9 Z M -8.1 0 C -8.1 -4.474 -4.474 -8.1 0 -8.1 C 4.473 -8.1 8.1 -4.474 8.1 0 C 8.1 4.473 4.473 8.1 -0.001 8.1 C -0.001 8.1 -7.648 8.1 -7.648 8.1 L -6.365 5.035 C -6.365 5.035 -6.648 4.629 -6.648 4.629 C -7.563 3.317 -8.1 1.723 -8.1 0 Z",transform:"matrix(1 0 0 1 12 12)",fill:"currentColor","fill-rule":"evenodd"},null,-1),A("path",{id:"p1",d:"M 3.6 0.5 L -2.6 0.5 M 0.5 -2.573 L 0.5 3.573",transform:"translate(11.5 11.5)",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},null,-1)])])}const fTe=Et({name:"kimi-add-conversation",render:dTe}),hTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pTe(e,t){return k(),L("svg",hTe,[...t[0]||(t[0]=[A("path",{d:"M15.0996 12C15.5967 12 16 12.4033 16 12.9004C15.9998 13.3973 15.5965 13.7998 15.0996 13.7998H8.90039C8.40346 13.7998 8.00021 13.3973 8 12.9004C8 12.4033 8.40333 12 8.90039 12H15.0996Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19 3.2002C20.5464 3.2002 21.7998 4.4536 21.7998 6V7C21.7998 8.03565 21.2363 8.93754 20.4004 9.42188V17C20.4004 19.1539 18.6539 20.9004 16.5 20.9004H7.5C5.34609 20.9004 3.59961 19.1539 3.59961 17V9.42188C2.76374 8.93754 2.2002 8.03565 2.2002 7V6C2.2002 4.4536 3.4536 3.2002 5 3.2002H19ZM5.40039 17C5.40039 18.1598 6.3402 19.0996 7.5 19.0996H16.5C17.6598 19.0996 18.5996 18.1598 18.5996 17V9.7998H5.40039V17ZM4.89746 5.00488C4.39333 5.05621 4 5.48232 4 6V7L4.00488 7.10254C4.05278 7.57297 4.42703 7.94722 4.89746 7.99512L5 8H19C19.5523 8 20 7.55228 20 7V6C20 5.44772 19.5523 5 19 5H5L4.89746 5.00488Z",fill:"currentColor"},null,-1)])])}const mTe=Et({name:"kimi-archive",render:pTe}),gTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function vTe(e,t){return k(),L("svg",gTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.386 21.6387C11.7378 21.988 12.3059 21.987 12.6565 21.6364L18.1949 16.098C18.5464 15.7465 18.5464 15.1766 18.1949 14.8252C17.8434 14.4737 17.2736 14.4737 16.9221 14.8252L12.9201 18.8272V3.00002C12.9201 2.50297 12.5171 2.10003 12.0201 2.10003C11.523 2.10003 11.1201 2.50297 11.1201 3.00002V18.8383L7.07554 14.8229C6.7228 14.4727 6.15295 14.4747 5.80275 14.8275C5.45255 15.1802 5.45461 15.7501 5.80735 16.1003L11.386 21.6387Z",fill:"currentColor"},null,-1)])])}const yTe=Et({name:"kimi-arrow-down",render:vTe}),kTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bTe(e,t){return k(),L("svg",kTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.16127 12.814C1.81197 12.4622 1.81299 11.8941 2.16357 11.5435L7.70203 6.00506C8.0535 5.65359 8.62335 5.65359 8.97482 6.00506C9.32629 6.35653 9.32629 6.92638 8.97482 7.27785L4.97276 11.2799H20.8C21.297 11.2799 21.7 11.6829 21.7 12.1799C21.7 12.677 21.297 13.0799 20.8 13.0799H4.96171L8.97712 17.1244C9.32732 17.4772 9.32526 18.047 8.97252 18.3972C8.61978 18.7474 8.04993 18.7454 7.69973 18.3926L2.16127 12.814Z",fill:"currentColor"},null,-1)])])}const wTe=Et({name:"kimi-arrow-left",render:bTe}),CTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ATe(e,t){return k(),L("svg",CTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.4387 12.814C21.788 12.4622 21.787 11.8941 21.4364 11.5436L15.8979 6.0051C15.5464 5.65363 14.9766 5.65363 14.6251 6.0051C14.2737 6.35657 14.2737 6.92642 14.6251 7.27789L18.6272 11.28H2.79998C2.30293 11.28 1.89998 11.6829 1.89998 12.18C1.89998 12.677 2.30293 13.08 2.79998 13.08H18.6382L14.6228 17.1245C14.2726 17.4772 14.2747 18.0471 14.6274 18.3973C14.9802 18.7475 15.55 18.7454 15.9002 18.3927L21.4387 12.814Z",fill:"currentColor"},null,-1)])])}const xTe=Et({name:"kimi-arrow-right",render:ATe}),STe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function _Te(e,t){return k(),L("svg",STe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.386 2.36129C11.7378 2.01198 12.3059 2.013 12.6565 2.36358L18.1949 7.90204C18.5464 8.25351 18.5464 8.82336 18.1949 9.17483C17.8434 9.52631 17.2736 9.52631 16.9221 9.17483L12.9201 5.17277V21C12.9201 21.497 12.5171 21.9 12.0201 21.9C11.523 21.9 11.1201 21.497 11.1201 21V5.16172L7.07554 9.17713C6.7228 9.52733 6.15295 9.52527 5.80275 9.17253C5.45255 8.81979 5.45461 8.24995 5.80735 7.89975L11.386 2.36129Z",fill:"currentColor"},null,-1)])])}const MTe=Et({name:"kimi-arrow-up",render:_Te}),ITe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function TTe(e,t){return k(),L("svg",ITe,[...t[0]||(t[0]=[A("path",{d:"M19.3027 5.9053C19.6542 5.55397 20.2247 5.55388 20.5761 5.9053C20.9273 6.25675 20.9273 6.82734 20.5761 7.17874L9.65911 18.0948C9.30773 18.4461 8.73814 18.446 8.38665 18.0948L3.42376 13.1328C3.0726 12.7814 3.07263 12.2118 3.42376 11.8604C3.77524 11.509 4.34575 11.5089 4.6972 11.8604L9.02239 16.1856L19.3027 5.9053Z",fill:"currentColor"},null,-1)])])}const ETe=Et({name:"kimi-check",render:TTe}),LTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function NTe(e,t){return k(),L("svg",LTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.3912 16.7134C11.743 17.0627 12.3111 17.0617 12.6617 16.7111L19.6364 9.73641C19.9878 9.38494 19.9878 8.81509 19.6364 8.46362C19.2849 8.11215 18.7151 8.11215 18.3636 8.46362L12.023 14.8042L5.63407 8.46132C5.28133 8.11112 4.71149 8.11318 4.36129 8.46592C4.01109 8.81866 4.01314 9.3885 4.36588 9.73871L11.3912 16.7134Z",fill:"currentColor"},null,-1)])])}const DTe=Et({name:"kimi-chevron-down",render:NTe}),FTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function BTe(e,t){return k(),L("svg",FTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.1261 12.6088C16.4754 12.257 16.4743 11.6889 16.1238 11.3383L9.14904 4.36363C8.79757 4.01216 8.22772 4.01216 7.87625 4.36363C7.52477 4.7151 7.52477 5.28495 7.87625 5.63642L14.2169 11.977L7.87395 18.3659C7.52375 18.7187 7.52581 19.2885 7.87855 19.6387C8.23129 19.9889 8.80113 19.9869 9.15133 19.6341L16.1261 12.6088Z",fill:"currentColor"},null,-1)])])}const RTe=Et({name:"kimi-chevron-right",render:BTe}),OTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function $Te(e,t){return k(),L("svg",OTe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.3912 8.46132C11.743 8.11202 12.3111 8.11304 12.6617 8.46362L19.6364 15.4383C19.9878 15.7898 19.9878 16.3597 19.6364 16.7111C19.2849 17.0626 18.7151 17.0626 18.3636 16.7111L12.023 10.3705L5.63407 16.7134C5.28133 17.0636 4.71149 17.0616 4.36129 16.7088C4.01109 16.3561 4.01314 15.7862 4.36588 15.436L11.3912 8.46132Z",fill:"currentColor"},null,-1)])])}const PTe=Et({name:"kimi-chevron-up",render:$Te}),zTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function jTe(e,t){return k(),L("svg",zTe,[...t[0]||(t[0]=[A("circle",{cx:"12",cy:"12",r:"10.875",stroke:"currentColor","stroke-width":"2.25"},null,-1),A("path",{d:"M7.125 12.6L10.65 16.125L17.025 8.85",stroke:"currentColor","stroke-width":"2.25","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const HTe=Et({name:"kimi-circle-check",render:jTe}),WTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qTe(e,t){return k(),L("svg",WTe,[...t[0]||(t[0]=[A("path",{d:"M11.8999 6.79965C12.397 6.79965 12.7997 7.20235 12.7997 7.69941V11.7266L14.7359 13.6629C15.0873 14.0143 15.0879 14.584 14.7366 14.9355C14.3852 15.287 13.8148 15.287 13.4633 14.9355L11.2632 12.7355C11.0947 12.5668 11.0002 12.338 11.0001 12.0995V7.69941C11.0001 7.20238 11.4029 6.7997 11.8999 6.79965Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 1.89893C17.4677 1.89893 21.9001 6.33147 21.9002 11.7991C21.9002 17.2669 17.4678 21.6993 12 21.6993C6.53228 21.6993 2.09985 17.2669 2.09985 11.7991C2.09998 6.33147 6.53236 1.89893 12 1.89893ZM20.1 11.7998C20.1 7.32616 16.4737 3.69984 12 3.69984C7.5264 3.69984 3.90008 7.32616 3.90008 11.7998C3.90032 16.2732 7.52655 19.8998 12 19.8998C16.4735 19.8998 20.0998 16.2732 20.1 11.7998Z",fill:"currentColor"},null,-1)])])}const UTe=Et({name:"kimi-clock",render:qTe}),VTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function KTe(e,t){return k(),L("svg",VTe,[...t[0]||(t[0]=[A("path",{d:"M17.9542 4.77253C18.3056 4.42106 18.8761 4.42106 19.2276 4.77253C19.579 5.12401 19.579 5.69452 19.2276 6.04597L13.2735 12.0001L19.2276 17.9542C19.5791 18.3056 19.5791 18.8761 19.2276 19.2276C18.8761 19.5791 18.3056 19.5791 17.9542 19.2276L12.0001 13.2735L6.04595 19.2276C5.69451 19.5791 5.12399 19.579 4.77252 19.2276C4.42104 18.8761 4.42104 18.3056 4.77252 17.9542L10.7266 12.0001L4.77252 6.04597C4.42104 5.6945 4.42104 5.124 4.77252 4.77253C5.12399 4.42107 5.69448 4.42106 6.04595 4.77253L12.0001 10.7266L17.9542 4.77253Z",fill:"currentColor"},null,-1)])])}const ZTe=Et({name:"kimi-close",render:KTe}),GTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function QTe(e,t){return k(),L("svg",GTe,[...t[0]||(t[0]=[A("path",{d:"M9.85815 11.957C10.9074 11.957 11.7583 12.8083 11.7585 13.8574V19.8574C11.7585 20.3545 11.3552 20.7578 10.8582 20.7578C10.3611 20.7578 9.95776 20.3545 9.95776 19.8574V13.8574C9.95755 13.8024 9.91325 13.7578 9.85815 13.7578H3.85815C3.3611 13.7578 2.95776 13.3545 2.95776 12.8574C2.95798 12.3605 3.36123 11.957 3.85815 11.957H9.85815Z",fill:"currentColor"},null,-1),A("path",{d:"M12.8582 2.95703C13.3551 2.95703 13.7583 3.36054 13.7585 3.85742V9.85742C13.7585 9.91265 13.8029 9.95703 13.8582 9.95703H19.8582C20.3551 9.95703 20.7583 10.3605 20.7585 10.8574C20.7585 11.3545 20.3552 11.7578 19.8582 11.7578H13.8582C12.8088 11.7578 11.9578 10.9068 11.9578 9.85742V3.85742C11.958 3.36054 12.3612 2.95703 12.8582 2.95703Z",fill:"currentColor"},null,-1)])])}const YTe=Et({name:"kimi-collapse",render:QTe}),JTe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XTe(e,t){return k(),L("svg",JTe,[...t[0]||(t[0]=[A("path",{d:"M11.9004 2.19995C17.3678 2.20016 21.7998 6.63285 21.7998 12.1003C21.7996 17.5677 17.3677 21.9995 11.9004 21.9998H3.80078C2.72946 21.9996 2.00334 20.9089 2.41699 19.9207L3.49805 17.3386C2.54871 15.8189 2.00007 14.0226 2 12.1003C2 6.63272 6.43277 2.19995 11.9004 2.19995ZM11.9004 3.99976C7.42688 3.99976 3.7998 7.62684 3.7998 12.1003C3.79989 13.8228 4.33669 15.4175 5.25195 16.7292L5.53516 17.1345L4.25195 20.2H11.8994C16.3727 20.1999 19.9998 16.5736 20 12.1003C20 7.62697 16.3737 3.99997 11.9004 3.99976ZM8.9541 10.8005C9.75473 10.8006 10.4041 11.4491 10.4043 12.2498C10.4043 13.0505 9.75482 13.6998 8.9541 13.7C8.15329 13.7 7.50391 13.0506 7.50391 12.2498C7.50406 11.4491 8.15339 10.8005 8.9541 10.8005ZM15.1533 10.8005C15.9539 10.8006 16.6034 11.4491 16.6035 12.2498C16.6035 13.0505 15.954 13.6998 15.1533 13.7C14.3525 13.7 13.7031 13.0506 13.7031 12.2498C13.7033 11.4491 14.3526 10.8005 15.1533 10.8005Z",fill:"currentColor"},null,-1)])])}const eEe=Et({name:"kimi-comment",render:XTe}),tEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nEe(e,t){return k(),L("svg",tEe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 7.09961C19.1539 7.09961 20.9004 8.84609 20.9004 11V17C20.9004 19.1539 19.1539 20.9004 17 20.9004H11C8.84609 20.9004 7.09961 19.1539 7.09961 17V11C7.09961 8.84609 8.84609 7.09961 11 7.09961H17ZM11 8.90039C9.8402 8.90039 8.90039 9.8402 8.90039 11V17C8.90039 18.1598 9.8402 19.0996 11 19.0996H17C18.1598 19.0996 19.0996 18.1598 19.0996 17V11C19.0996 9.8402 18.1598 8.90039 17 8.90039H11Z",fill:"currentColor"},null,-1),A("path",{d:"M13 3.09961C14.4447 3.09961 15.705 3.88644 16.3779 5.0498C16.6265 5.47999 16.4789 6.03049 16.0488 6.2793C15.6186 6.52781 15.0681 6.38029 14.8193 5.9502C14.4548 5.32041 13.776 4.90039 13 4.90039H7C5.8402 4.90039 4.90039 5.8402 4.90039 7V13C4.90039 13.776 5.32041 14.4548 5.9502 14.8193C6.38029 15.0681 6.52781 15.6186 6.2793 16.0488C6.03049 16.4789 5.47999 16.6265 5.0498 16.3779C3.88644 15.705 3.09961 14.4447 3.09961 13V7C3.09961 4.84609 4.84609 3.09961 7 3.09961H13Z",fill:"currentColor"},null,-1)])])}const iEe=Et({name:"kimi-copy",render:nEe}),oEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function sEe(e,t){return k(),L("svg",oEe,[...t[0]||(t[0]=[A("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 10.2797 2.43414 8.66074 3.19922 7.24707C3.20172 7.24246 3.20453 7.23801 3.20703 7.2334C3.33385 6.99995 3.47181 6.77351 3.61621 6.55176C3.73214 6.37355 3.85079 6.19744 3.97754 6.02734C5.35905 4.17471 7.36856 2.81959 9.68945 2.27051C9.69952 2.26813 9.70965 2.26602 9.71973 2.26367C9.85224 2.23276 9.98563 2.2043 10.1201 2.17871C10.1542 2.17221 10.1884 2.16631 10.2227 2.16016C10.3466 2.13791 10.4712 2.11724 10.5967 2.09961C10.6301 2.09489 10.6637 2.0913 10.6973 2.08691C10.8216 2.07073 10.9465 2.05552 11.0723 2.04395C11.1125 2.04022 11.153 2.0384 11.1934 2.03516C11.4595 2.0139 11.7284 2 12 2ZM11.9941 3.7998C11.9968 3.86623 12 3.93292 12 4C12 6.76142 9.76142 9 7 9C6.14209 9 5.33517 8.78324 4.62988 8.40234C4.09862 9.48861 3.7998 10.7093 3.7998 12C3.7998 12.4438 3.83644 12.8791 3.9043 13.3037C4.52807 12.5673 5.45945 12.0996 6.5 12.0996C8.37777 12.0996 9.90039 13.6222 9.90039 15.5C9.90039 17.0702 8.83532 18.3903 7.38867 18.7812C8.70267 19.6765 10.2901 20.2002 12 20.2002C12.468 20.2002 12.9264 20.1583 13.373 20.083C13.1323 19.4342 13 18.7327 13 18C13 14.6863 15.6863 12 19 12C19.4098 12 19.8098 12.0416 20.1963 12.1201C20.1969 12.0801 20.2002 12.0401 20.2002 12C20.2002 7.47126 16.5287 3.7998 12 3.7998H11.9941ZM19 13.7998C16.6804 13.7998 14.7998 15.6804 14.7998 18C14.7998 18.5617 14.9112 19.0972 15.1113 19.5869C17.5225 18.597 19.3558 16.4929 19.9727 13.9141C19.6605 13.8399 19.3349 13.7998 19 13.7998ZM6.5 13.9004C5.61634 13.9004 4.90039 14.6163 4.90039 15.5C4.90039 16.3837 5.61634 17.0996 6.5 17.0996C7.38366 17.0996 8.09961 16.3837 8.09961 15.5C8.09961 14.6163 7.38366 13.9004 6.5 13.9004ZM15.5 6.09961C16.8255 6.09961 17.9004 7.17452 17.9004 8.5C17.9004 9.82548 16.8255 10.9004 15.5 10.9004C14.1745 10.9004 13.0996 9.82548 13.0996 8.5C13.0996 7.17452 14.1745 6.09961 15.5 6.09961ZM15.5 7.90039C15.1686 7.90039 14.9004 8.16863 14.9004 8.5C14.9004 8.83137 15.1686 9.09961 15.5 9.09961C15.8314 9.09961 16.0996 8.83137 16.0996 8.5C16.0996 8.16863 15.8314 7.90039 15.5 7.90039ZM10.1992 4C8.35326 4.41375 6.74333 5.44923 5.59961 6.87598C6.02235 7.08306 6.49716 7.2002 7 7.2002C8.76731 7.2002 10.1992 5.76731 10.1992 4Z",fill:"currentColor"},null,-1)])])}const rEe=Et({name:"kimi-dark-mode",render:sEe}),lEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function aEe(e,t){return k(),L("svg",lEe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.90002C12.4971 2.90002 12.9 3.30297 12.9 3.80002V12.2939L15.8081 9.38585C16.1595 9.03438 16.7294 9.03438 17.0808 9.38585C17.4323 9.73732 17.4323 10.3072 17.0808 10.6586L12.6364 15.1031C12.4676 15.2719 12.2387 15.3667 12 15.3667C11.7613 15.3667 11.5324 15.2719 11.3636 15.1031L6.91917 10.6586C6.5677 10.3072 6.5677 9.73732 6.91917 9.38585C7.27064 9.03438 7.84049 9.03438 8.19196 9.38585L11.1 12.2939V3.80002C11.1 3.30297 11.503 2.90002 12 2.90002ZM4.00001 13.5874C4.49706 13.5874 4.90001 13.9903 4.90001 14.4874V18.043C4.90001 18.2758 4.99249 18.499 5.1571 18.6636C5.32172 18.8282 5.54498 18.9207 5.77778 18.9207H18.2222C18.455 18.9207 18.6783 18.8283 18.8429 18.6636C19.0075 18.499 19.1 18.2758 19.1 18.043V14.4874C19.1 13.9903 19.5029 13.5874 20 13.5874C20.4971 13.5874 20.9 13.9903 20.9 14.4874V18.043C20.9 18.7531 20.6179 19.4342 20.1157 19.9364C19.6135 20.4386 18.9324 20.7207 18.2222 20.7207H5.77778C5.06759 20.7207 4.38649 20.4386 3.88431 19.9364C3.38213 19.4342 3.10001 18.7531 3.10001 18.043V14.4874C3.10001 13.9903 3.50295 13.5874 4.00001 13.5874Z",fill:"currentColor"},null,-1)])])}const uEe=Et({name:"kimi-download",render:aEe}),cEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dEe(e,t){return k(),L("svg",cEe,[...t[0]||(t[0]=[A("path",{d:"M18.0179 3.09998C18.3963 3.10003 18.7709 3.17491 19.1205 3.31971C19.4701 3.46454 19.7884 3.67614 20.056 3.94373C20.3237 4.21144 20.5362 4.52965 20.681 4.87928C20.8258 5.22887 20.8997 5.60423 20.8997 5.9828C20.8997 6.36118 20.8257 6.73591 20.681 7.08533C20.5362 7.43497 20.3237 7.75317 20.056 8.02088L17.639 10.4379L9.15756 18.9183C8.5296 19.5463 7.74274 19.992 6.8812 20.2074L4.21811 20.8734C3.91148 20.95 3.5871 20.8596 3.36362 20.6361C3.14017 20.4126 3.05063 20.0883 3.12729 19.7816L3.79233 17.1185C4.00771 16.257 4.45344 15.4701 5.08139 14.8422L15.9798 3.94373C16.5203 3.40346 17.2536 3.09998 18.0179 3.09998ZM19.0003 19.1C19.4972 19.1002 19.8997 19.5034 19.8997 20.0004C19.8995 20.4971 19.4971 20.8996 19.0003 20.8998H12.0003C11.5034 20.8998 11.1001 20.4973 11.0999 20.0004C11.0999 19.5033 11.5033 19.1 12.0003 19.1H19.0003ZM18.0179 4.89979C17.7309 4.89979 17.4553 5.01417 17.2523 5.21717L6.35385 16.1146C5.95661 16.5119 5.67469 17.01 5.53842 17.5551L5.23666 18.7631L6.44467 18.4613C6.98971 18.3251 7.48782 18.0431 7.8851 17.6459L18.7826 6.74744C18.883 6.64702 18.9635 6.52821 19.0179 6.39686C19.0723 6.26558 19.0999 6.1247 19.0999 5.9828C19.0999 5.84075 19.0723 5.69916 19.0179 5.56776C18.9635 5.43645 18.883 5.31757 18.7826 5.21717C18.6821 5.11678 18.5631 5.03716 18.432 4.9828C18.3008 4.92845 18.16 4.89983 18.0179 4.89979Z",fill:"currentColor"},null,-1)])])}const fEe=Et({name:"kimi-edit",render:dEe}),hEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pEe(e,t){return k(),L("svg",hEe,[...t[0]||(t[0]=[A("path",{d:"M5 11.0996C5.49693 11.0996 5.90018 11.5031 5.90039 12V18C5.90039 18.0552 5.94477 18.0996 6 18.0996H12C12.4969 18.0996 12.9002 18.5031 12.9004 19C12.9004 19.4971 12.4971 19.9004 12 19.9004H6C4.95066 19.9004 4.09961 19.0493 4.09961 18V12C4.09982 11.5031 4.50307 11.0996 5 11.0996ZM18 4.09961C19.0492 4.09961 19.9002 4.95084 19.9004 6V12C19.9004 12.4971 19.4971 12.9004 19 12.9004C18.5029 12.9004 18.0996 12.4971 18.0996 12V6C18.0994 5.94495 18.0551 5.90039 18 5.90039H12C11.5029 5.90039 11.0996 5.49706 11.0996 5C11.0998 4.50312 11.5031 4.09961 12 4.09961H18Z",fill:"currentColor"},null,-1)])])}const mEe=Et({name:"kimi-expand",render:pEe}),gEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function vEe(e,t){return k(),L("svg",gEe,[...t[0]||(t[0]=[A("g",null,[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1723 2.1001C13.9413 2.10018 14.6793 2.40592 15.2231 2.94971L19.0512 6.77783C19.595 7.32162 19.9007 8.0596 19.9008 8.82861V18.0005C19.9008 20.1544 18.1543 21.9009 16.0004 21.9009H8.0004C5.84649 21.9009 4.10001 20.1544 4.10001 18.0005V6.00049C4.10001 3.84658 5.84649 2.1001 8.0004 2.1001H13.1723ZM8.0004 3.90088C6.8406 3.90088 5.90079 4.84069 5.90079 6.00049V18.0005C5.90079 19.1603 6.8406 20.1001 8.0004 20.1001H16.0004C17.1602 20.1001 18.1 19.1603 18.1 18.0005V9.90088H15.0004C13.3988 9.90088 12.1 8.60211 12.1 7.00049V3.90088H8.0004ZM13.9008 7.00049C13.9008 7.608 14.3929 8.1001 15.0004 8.1001H17.8217C17.8072 8.08375 17.7933 8.06681 17.7777 8.05127L13.9496 4.22314C13.9339 4.20745 13.9173 4.19286 13.9008 4.17822V7.00049Z",fill:"currentColor"})],-1)])])}const VF=Et({name:"kimi-file",render:vEe}),yEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kEe(e,t){return k(),L("svg",yEe,[...t[0]||(t[0]=[A("path",{d:"M15.4795 15.4971C15.9765 15.4971 16.3799 15.9004 16.3799 16.3975C16.3799 16.8945 15.9765 17.2978 15.4795 17.2979H8.52051C8.02345 17.2979 7.62012 16.8945 7.62012 16.3975C7.62012 15.9004 8.02345 15.4971 8.52051 15.4971H15.4795Z",fill:"currentColor"},null,-1),A("path",{d:"M12.3359 11.0996C12.8329 11.0997 13.2354 11.503 13.2354 12C13.2354 12.497 12.8329 12.9003 12.3359 12.9004H8.52051C8.02345 12.9004 7.62012 12.4971 7.62012 12C7.62012 11.5029 8.02345 11.0996 8.52051 11.0996H12.3359Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1719 2.09961C13.9408 2.09969 14.6789 2.40555 15.2227 2.94922L19.0508 6.77734C19.5946 7.32113 19.9003 8.05911 19.9004 8.82812V18C19.9004 20.1539 18.1539 21.9004 16 21.9004H8C5.84626 21.9002 4.09961 20.1538 4.09961 18V6C4.09961 3.84621 5.84626 2.09981 8 2.09961H13.1719ZM8 3.90039C6.84037 3.90059 5.90039 4.84032 5.90039 6V18C5.90039 19.1597 6.84037 20.0994 8 20.0996H16C17.1598 20.0996 18.0996 19.1598 18.0996 18V9.90039H15C13.3985 9.90019 12.0996 8.6015 12.0996 7V3.90039H8ZM13.9004 7C13.9004 7.60739 14.3927 8.09941 15 8.09961H17.8213C17.8068 8.08333 17.7928 8.06626 17.7773 8.05078L13.9492 4.22266C13.9335 4.20696 13.9169 4.19237 13.9004 4.17773V7Z",fill:"currentColor"},null,-1)])])}const bEe=Et({name:"kimi-file-text",render:kEe}),wEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function CEe(e,t){return k(),L("svg",wEe,[...t[0]||(t[0]=[A("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const AEe=Et({name:"kimi-folder",render:CEe}),xEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function SEe(e,t){return k(),L("svg",xEe,[...t[0]||(t[0]=[A("g",null,[A("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"})],-1)])])}const _Ee=Et({name:"kimi-folder-open",render:SEe}),MEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function IEe(e,t){return k(),L("svg",MEe,[...t[0]||(t[0]=[A("path",{d:"M9.5 3Q10.8 8.2 16 9.5Q10.8 10.8 9.5 16Q8.2 10.8 3 9.5Q8.2 8.2 9.5 3Z",fill:"currentColor"},null,-1),A("path",{d:"M17.25 13.5Q18 16.5 21 17.25Q18 18 17.25 21Q16.5 18 13.5 17.25Q16.5 16.5 17.25 13.5Z",fill:"currentColor"},null,-1)])])}const TEe=Et({name:"kimi-gen-title",render:IEe}),EEe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function LEe(e,t){return k(),L("svg",EEe,[...t[0]||(t[0]=[A("path",{id:"af-p0",d:"M -2.619 -8.3 C -1.815 -8.3 -1.048 -7.97 -0.499 -7.39 C -0.499 -7.39 0.141 -6.712 0.141 -6.712 C 0.141 -6.712 5.75 -6.712 5.75 -6.712 C 7.904 -6.712 9.65 -4.986 9.65 -2.858 C 9.65 -2.858 9.65 -1.71 9.65 -1.71 C 9.65 -1.219 9.247 -0.821 8.75 -0.821 C 8.253 -0.821 7.85 -1.219 7.85 -1.71 C 7.85 -1.71 7.85 -2.858 7.85 -2.858 C 7.849 -4.004 6.91 -4.934 5.75 -4.934 C 5.75 -4.934 -0.207 -4.934 -0.207 -4.934 C -0.484 -4.934 -0.749 -5.047 -0.938 -5.247 C -0.938 -5.247 -1.815 -6.177 -1.815 -6.177 C -2.023 -6.397 -2.315 -6.521 -2.619 -6.521 C -2.619 -6.521 -6.25 -6.521 -6.25 -6.521 C -7.41 -6.521 -8.35 -5.592 -8.35 -4.446 C -8.35 -4.446 -8.35 4.446 -8.35 4.446 C -8.35 5.592 -7.41 6.521 -6.25 6.521 C -6.25 6.521 1.25 6.521 1.25 6.521 C 1.747 6.521 2.15 6.919 2.15 7.41 C 2.15 7.901 1.747 8.3 1.25 8.3 C 1.25 8.3 -6.25 8.3 -6.25 8.3 C -8.404 8.3 -10.15 6.574 -10.15 4.446 C -10.15 4.446 -10.15 -4.446 -10.15 -4.446 C -10.15 -6.574 -8.404 -8.3 -6.25 -8.3 C -6.25 -8.3 -2.619 -8.3 -2.619 -8.3 Z M 3.75 -2.5 C 4.247 -2.5 4.65 -2.097 4.65 -1.6 C 4.65 -1.103 4.247 -0.699 3.75 -0.699 C 3.75 -0.699 -4.25 -0.699 -4.25 -0.699 C -4.747 -0.699 -5.15 -1.103 -5.15 -1.6 C -5.15 -2.097 -4.747 -2.5 -4.25 -2.5 C -4.25 -2.5 3.75 -2.5 3.75 -2.5 Z",transform:"matrix(1 0 0 1 11.75 12)",fill:"currentColor"},null,-1),A("g",{id:"af-p1"},[A("path",{d:"M 2.635 0 L -2.635 0 M 0 -2.635 L 0 2.635",transform:"matrix(1 0 0 1 18.4 16.3)",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})],-1)])])}const NEe=Et({name:"kimi-folder-plus",render:LEe}),DEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FEe(e,t){return k(),L("svg",DEe,[...t[0]||(t[0]=[A("path",{d:"M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3ZM12 19.2002C15.9764 19.2002 19.2002 15.9764 19.2002 12C19.2002 8.02355 15.9764 4.7998 12 4.7998V19.2002Z",fill:"currentColor"},null,-1)])])}const BEe=Et({name:"kimi-follow-system",render:FEe}),REe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function OEe(e,t){return k(),L("svg",REe,[...t[0]||(t[0]=[A("path",{d:"M17 2C19.2091 2 21 3.79086 21 6V15.7646C21 17.2361 20.192 18.5884 18.8965 19.2861L13.8965 21.9785C12.7126 22.616 11.2874 22.616 10.1035 21.9785L5.10352 19.2861C3.80802 18.5884 3 17.2361 3 15.7646V6C3 3.79086 4.79086 2 7 2H17ZM7 3.7998C5.78498 3.7998 4.79981 4.78497 4.7998 6V15.7646C4.7998 16.574 5.24443 17.3184 5.95703 17.7021L10.957 20.3936C11.6082 20.7442 12.3918 20.7442 13.043 20.3936L18.043 17.7021C18.7556 17.3184 19.2002 16.574 19.2002 15.7646V6C19.2002 4.78497 18.215 3.7998 17 3.7998H7ZM12 15.6992C12.4968 15.6992 12.8994 16.1028 12.8994 16.5996C12.8994 17.0964 12.4968 17.5 12 17.5C11.5024 17.5 11.0996 17.0964 11.0996 16.5996C11.0996 16.1028 11.5024 15.6992 12 15.6992ZM12 6.49902C12.4969 6.49922 12.8994 6.86908 12.8994 7.3252V13.6729C12.8994 14.129 12.4969 14.4988 12 14.499C11.5029 14.499 11.0996 14.1291 11.0996 13.6729V7.3252C11.0996 6.86896 11.5029 6.49902 12 6.49902Z",fill:"currentColor"},null,-1)])])}const $Ee=Et({name:"kimi-full-access",render:OEe}),PEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zEe(e,t){return k(),L("svg",PEe,[...t[0]||(t[0]=[A("path",{d:"M12.5092 2.11279C17.7402 2.37781 21.8998 6.70364 21.8998 12.0005C21.8996 17.4153 17.5524 21.8108 12.1576 21.895C12.1056 21.898 12.0532 21.8999 12.0004 21.8999C11.948 21.8999 11.8954 21.8968 11.8432 21.896L11.8422 21.895C6.44751 21.8107 2.10022 17.4152 2.10001 12.0005C2.10001 6.53287 6.53278 2.1001 12.0004 2.1001L12.5092 2.11279ZM8.92715 13.0005C9.02896 14.9787 9.42581 16.721 9.99356 17.9985C10.3249 18.7441 10.6971 19.292 11.0639 19.6411C11.4259 19.9855 11.741 20.1001 12.0004 20.1001C12.2598 20.1 12.5749 19.9856 12.9369 19.6411C13.3037 19.292 13.6749 18.7441 14.0063 17.9985C14.574 16.721 14.9718 14.9788 15.0736 13.0005H8.92715ZM3.96329 13.0005C4.31462 15.8522 6.14714 18.2427 8.66837 19.3823C8.55544 19.1733 8.44916 18.9552 8.34903 18.73C7.66574 17.1926 7.22657 15.1926 7.12344 13.0005H3.96329ZM16.8764 13.0005C16.7732 15.1926 16.3341 17.1926 15.6508 18.73C15.5506 18.9554 15.4435 19.1732 15.3305 19.3823C17.8522 18.2429 19.6851 15.8525 20.0365 13.0005H16.8764ZM8.66934 4.6167C6.08869 5.78266 4.22826 8.25964 3.93985 11.1997H7.11661C7.20176 8.92954 7.64512 6.85497 8.34903 5.271C8.4494 5.04516 8.5561 4.82619 8.66934 4.6167ZM12.0004 3.8999C11.7411 3.8999 11.4259 4.01454 11.0639 4.35889C10.6971 4.70797 10.3249 5.25587 9.99356 6.00146C9.40671 7.32188 9.00186 9.13885 8.91739 11.1997H15.0834C14.9989 9.13884 14.5931 7.32189 14.0063 6.00146C13.6749 5.2559 13.3037 4.70796 12.9369 4.35889C12.5749 4.0144 12.2598 3.90002 12.0004 3.8999ZM15.3295 4.61572C15.443 4.82559 15.5502 5.04471 15.6508 5.271C16.3547 6.85498 16.799 8.92949 16.8842 11.1997H20.06C19.7715 8.25914 17.9108 5.78143 15.3295 4.61572Z",fill:"currentColor"},null,-1)])])}const jEe=Et({name:"kimi-globe",render:zEe}),HEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WEe(e,t){return k(),L("svg",HEe,[...t[0]||(t[0]=[A("path",{d:"M8 17C8.82834 17 9.5 17.6717 9.5 18.5C9.5 19.3283 8.82834 20 8 20C7.17166 20 6.5 19.3283 6.5 18.5C6.5 17.6717 7.17166 17 8 17ZM16 17C16.8283 17 17.5 17.6717 17.5 18.5C17.5 19.3283 16.8283 20 16 20C15.1717 20 14.5 19.3283 14.5 18.5C14.5 17.6717 15.1717 17 16 17ZM8 10.5C8.82834 10.5 9.5 11.1717 9.5 12C9.5 12.8283 8.82834 13.5 8 13.5C7.17166 13.5 6.5 12.8283 6.5 12C6.5 11.1717 7.17166 10.5 8 10.5ZM16 10.5C16.8283 10.5 17.5 11.1717 17.5 12C17.5 12.8283 16.8283 13.5 16 13.5C15.1717 13.5 14.5 12.8283 14.5 12C14.5 11.1717 15.1717 10.5 16 10.5ZM8 4C8.82834 4 9.5 4.67166 9.5 5.5C9.5 6.32834 8.82834 7 8 7C7.17166 7 6.5 6.32834 6.5 5.5C6.5 4.67166 7.17166 4 8 4ZM16 4C16.8283 4 17.5 4.67166 17.5 5.5C17.5 6.32834 16.8283 7 16 7C15.1717 7 14.5 6.32834 14.5 5.5C14.5 4.67166 15.1717 4 16 4Z",fill:"currentColor"},null,-1)])])}const qEe=Et({name:"kimi-grip",render:WEe}),UEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VEe(e,t){return k(),L("svg",UEe,[...t[0]||(t[0]=[A("path",{d:"M7.22264 6.10352C7.22264 5.5078 7.48259 4.95449 7.91405 4.56055C8.34271 4.16918 8.90831 3.96198 9.48241 3.96191C9.64155 3.96191 9.80001 3.97936 9.95507 4.01074C10.0127 3.5042 10.2586 3.04178 10.6338 2.69922C11.0625 2.30778 11.6279 2.09961 12.2021 2.09961C12.7763 2.09966 13.3418 2.30783 13.7705 2.69922C13.9947 2.90401 14.1709 3.15244 14.29 3.42676C14.4947 3.37044 14.7071 3.34182 14.9209 3.3418C15.4951 3.3418 16.0605 3.549 16.4892 3.94043C16.8644 4.28293 17.1093 4.74548 17.167 5.25195C17.3223 5.22045 17.4812 5.20312 17.6406 5.20312C18.2147 5.20318 18.7803 5.41135 19.209 5.80273C19.6402 6.19663 19.9004 6.74922 19.9004 7.34473V14.6543C19.9004 17.413 19.2914 19.0434 18.0137 20.21C16.82 21.2998 15.2175 21.9004 13.5615 21.9004C11.7538 21.9004 10.2315 21.5696 8.95702 20.8535C7.67664 20.1341 6.71683 19.0652 5.97362 17.708L3.3496 12.916C3.18848 12.6213 3.10112 12.2914 3.0996 11.9531C3.09812 11.6147 3.18309 11.2835 3.34179 10.9873C3.5001 10.692 3.72639 10.4416 3.99706 10.251C4.26771 10.0604 4.57776 9.93235 4.90136 9.87305C5.56617 9.75102 6.25934 9.84517 6.86425 10.1445C6.9942 10.2088 7.11461 10.2788 7.22264 10.3477V6.10352ZM9.02343 12.7969C9.02336 13.1912 8.76624 13.5395 8.38964 13.6562C8.0129 13.773 7.60387 13.6309 7.38085 13.3057L6.53514 12.0723C6.51218 12.0529 6.48411 12.0282 6.45018 12.002C6.34595 11.9213 6.20986 11.8289 6.06639 11.7578C5.81525 11.6335 5.51637 11.5904 5.22655 11.6436H5.22557C5.15055 11.6573 5.08558 11.6865 5.03417 11.7227C4.98289 11.7588 4.94815 11.7998 4.92772 11.8379C4.90762 11.8755 4.90023 11.9122 4.90038 11.9453C4.90057 11.9782 4.9084 12.0144 4.9287 12.0518L7.55272 16.8438C8.16912 17.9693 8.90989 18.7622 9.83886 19.2842C10.7737 19.8094 11.9704 20.0996 13.5615 20.0996C14.7902 20.0996 15.9536 19.6533 16.7998 18.8809C17.5619 18.185 18.0996 17.1383 18.0996 14.6543V7.34473C18.0996 7.28204 18.0734 7.20342 17.9951 7.13184C17.9139 7.05771 17.7875 7.00396 17.6406 7.00391C17.4937 7.00391 17.3674 7.05771 17.2861 7.13184C17.2077 7.20347 17.1807 7.28199 17.1807 7.34473V11.0693C17.1805 11.5661 16.778 11.9685 16.2812 11.9688C15.7843 11.9688 15.381 11.5662 15.3808 11.0693V5.48242C15.3808 5.41973 15.3537 5.34107 15.2754 5.26953C15.1941 5.19547 15.0677 5.1416 14.9209 5.1416C14.774 5.14166 14.6476 5.19541 14.5664 5.26953C14.4881 5.34105 14.462 5.41974 14.4619 5.48242V11.0693C14.4617 11.5662 14.0584 11.9688 13.5615 11.9688C13.0646 11.9687 12.6613 11.5662 12.6611 11.0693V4.24121C12.6611 4.17852 12.635 4.09989 12.5566 4.02832C12.4754 3.95419 12.349 3.90045 12.2021 3.90039C12.0552 3.90039 11.9289 3.95421 11.8476 4.02832C11.7692 4.09992 11.7422 4.17849 11.7422 4.24121V11.0693C11.742 11.5661 11.3395 11.9685 10.8428 11.9688C10.3458 11.9688 9.94257 11.5662 9.94237 11.0693V6.10352L9.93651 6.05371C9.92534 6.00177 9.89573 5.94433 9.8369 5.89062C9.75567 5.81647 9.62938 5.76172 9.48241 5.76172C9.33554 5.76179 9.2091 5.81651 9.12792 5.89062C9.04964 5.96222 9.02343 6.04084 9.02343 6.10352V12.7969Z",fill:"currentColor"},null,-1)])])}const KEe=Et({name:"kimi-hand",render:VEe}),ZEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GEe(e,t){return k(),L("svg",ZEe,[...t[0]||(t[0]=[A("path",{d:"M4 3.33203C4.55224 3.33203 4.99993 3.7798 5 4.33203V18.0908H20.0674C20.6195 18.0908 21.0671 18.5388 21.0674 19.0908C21.0674 19.6431 20.6197 20.0908 20.0674 20.0908H5C3.89543 20.0908 3 19.1954 3 18.0908V4.33203C3.00007 3.7798 3.44776 3.33203 4 3.33203ZM8.19922 9.28418C8.7515 9.28418 9.19922 9.73189 9.19922 10.2842V15.6045C9.19908 16.1567 8.75142 16.6045 8.19922 16.6045C7.64719 16.6043 7.19936 16.1565 7.19922 15.6045V10.2842C7.19922 9.73202 7.6471 9.28438 8.19922 9.28418ZM17.2227 6.85645C17.7748 6.85658 18.2226 7.3043 18.2227 7.85645V15.6045C18.2225 16.1566 17.7747 16.6044 17.2227 16.6045C16.6705 16.6045 16.2228 16.1566 16.2227 15.6045V7.85645C16.2227 7.30422 16.6704 6.85645 17.2227 6.85645ZM12.7109 3.96387C13.2631 3.96387 13.7107 4.41175 13.7109 4.96387V15.6035C13.7109 16.1558 13.2632 16.6035 12.7109 16.6035C12.1587 16.6035 11.7109 16.1558 11.7109 15.6035V4.96387C11.7111 4.41175 12.1588 3.96387 12.7109 3.96387Z",fill:"currentColor"},null,-1)])])}const QEe=Et({name:"kimi-histogram",render:GEe}),YEe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function JEe(e,t){return k(),L("svg",YEe,[...t[0]||(t[0]=[A("path",{d:"M8.00916 7.50488C8.47326 7.50488 8.91828 7.68943 9.24646 8.01758C9.57465 8.34577 9.75916 8.79075 9.75916 9.25488C9.75916 9.71901 9.57465 10.164 9.24646 10.4922C8.91828 10.8203 8.47326 11.0049 8.00916 11.0049C7.54507 11.0049 7.10001 10.8203 6.77185 10.4922C6.4437 10.164 6.25916 9.71898 6.25916 9.25488C6.25916 8.79078 6.4437 8.34576 6.77185 8.01758C7.10001 7.68942 7.54507 7.50492 8.00916 7.50488Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.8998 4.09961C20.0537 4.09961 21.8002 5.84609 21.8002 8V16C21.8002 18.1539 20.0537 19.9004 17.8998 19.9004H5.89978C3.74598 19.9003 1.99939 18.1538 1.99939 16V8C1.99939 5.84617 3.74598 4.09974 5.89978 4.09961H17.8998ZM15.4867 12.2539C15.448 12.2184 15.3885 12.2192 15.351 12.2559L11.7338 15.8027C11.0146 16.5079 9.87305 16.5222 9.13708 15.835L6.98669 13.8262C6.95049 13.7924 6.89516 13.791 6.85681 13.8223L3.82361 16.2988C3.96873 17.3168 4.84165 18.0995 5.89978 18.0996H17.8998C18.9375 18.0996 19.7964 17.3466 19.9662 16.3574L15.4867 12.2539ZM5.89978 5.90039C4.74009 5.90052 3.80017 6.84028 3.80017 8V14.002L5.73181 12.4238C6.46046 11.8286 7.51253 11.8634 8.20056 12.5059L10.351 14.5146C10.3897 14.5508 10.4498 14.5497 10.4877 14.5127L14.1049 10.9658C14.819 10.2656 15.9506 10.2466 16.6879 10.9219L19.9994 13.9551V8C19.9994 6.8402 19.0596 5.90039 17.8998 5.90039H5.89978Z",fill:"currentColor"},null,-1)])])}const XEe=Et({name:"kimi-image",render:JEe}),eLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tLe(e,t){return k(),L("svg",eLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.09375 2.81174C5.4825 2.50796 6.04376 2.56488 6.34766 2.93869L20.1855 19.9602C20.4895 20.3341 20.421 20.8836 20.0322 21.1877C19.6435 21.4917 19.0823 21.4355 18.7783 21.0617L17.9971 20.1008H5.99609C3.84224 20.1008 2.0958 18.3552 2.0957 16.2014V8.13889C2.09589 6.26755 3.41429 4.70428 5.17285 4.32639L4.93945 4.03928C4.63577 3.66536 4.7051 3.11573 5.09375 2.81174ZM7.13184 14.1096C7.09416 14.0738 7.03659 14.0713 6.99609 14.1037L3.92871 16.5569C4.09761 17.5472 4.95753 18.301 5.99609 18.301H16.5342L13.373 14.4133L11.9072 15.9455C11.1531 16.7324 9.92202 16.7621 9.13281 16.0119L7.13184 14.1096ZM5.99609 6.03928C4.83643 6.03928 3.89669 6.97927 3.89648 8.13889V14.1408L5.83496 12.5901C6.60469 11.9742 7.69929 12.022 8.41504 12.7024L10.416 14.6037C10.4575 14.6431 10.5218 14.642 10.5615 14.6008L12.1641 12.926L9.78906 10.0051C9.70282 10.2646 9.55682 10.5038 9.35645 10.7004C9.02202 11.0285 8.56767 11.2131 8.09473 11.2131C7.62195 11.213 7.1683 11.0284 6.83398 10.7004C6.49961 10.3724 6.31152 9.92701 6.31152 9.46311C6.3116 8.99941 6.49981 8.55474 6.83398 8.22678C7.12986 7.93654 7.51931 7.75901 7.93262 7.7219L6.56543 6.03928H5.99609Z",fill:"currentColor"},null,-1),A("path",{d:"M18.0049 4.31272C20.1587 4.31288 21.9043 6.0593 21.9043 8.21311V13.718C21.9039 15.4743 19.7248 16.2906 18.5713 14.966L14.9141 10.7658C14.5882 10.3912 14.6278 9.82271 15.002 9.49631C15.3768 9.16994 15.9451 9.20948 16.2715 9.5842L19.9287 13.7844C19.9528 13.812 19.9696 13.8167 19.9775 13.8186C19.9908 13.8216 20.0141 13.8213 20.04 13.8117C20.0655 13.8021 20.0826 13.7875 20.0908 13.7766C20.0955 13.7702 20.1044 13.7552 20.1045 13.718V8.21311C20.1045 7.05341 19.1645 6.11366 18.0049 6.1135H10.6328C10.1361 6.11327 9.73267 5.70981 9.73242 5.21311C9.73242 4.71619 10.136 4.31295 10.6328 4.31272H18.0049Z",fill:"currentColor"},null,-1)])])}const nLe=Et({name:"kimi-image-failed",render:tLe}),iLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oLe(e,t){return k(),L("svg",iLe,[...t[0]||(t[0]=[A("path",{d:"M12 2.1001C17.4676 2.10031 21.8994 6.53286 21.8994 12.0005C21.8992 17.4679 17.4674 21.8997 12 21.8999C6.53237 21.8999 2.09982 17.4681 2.09961 12.0005C2.09961 6.53273 6.53224 2.1001 12 2.1001ZM12 3.8999C7.52636 3.8999 3.89941 7.52684 3.89941 12.0005C3.89963 16.474 7.52649 20.1001 12 20.1001C16.4733 20.0999 20.0994 16.4738 20.0996 12.0005C20.0996 7.52697 16.4735 3.90011 12 3.8999ZM12 9.50049C12.4969 9.50068 12.8994 9.87055 12.8994 10.3267V16.6743C12.8992 17.1303 12.4968 17.5003 12 17.5005C11.503 17.5005 11.0998 17.1304 11.0996 16.6743V10.3267C11.0996 9.87043 11.5029 9.50049 12 9.50049ZM12 6.49951C12.4968 6.49951 12.8994 6.90313 12.8994 7.3999C12.8992 7.8965 12.4966 8.30029 12 8.30029C11.5025 8.30028 11.0998 7.8965 11.0996 7.3999C11.0996 6.90313 11.5024 6.49952 12 6.49951Z",fill:"currentColor"},null,-1)])])}const sLe=Et({name:"kimi-info",render:oLe}),rLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lLe(e,t){return k(),L("svg",rLe,[...t[0]||(t[0]=[Qd('',10)])])}const aLe=Et({name:"kimi-keyboard",render:lLe}),uLe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function cLe(e,t){return k(),L("svg",uLe,[...t[0]||(t[0]=[A("path",{id:"bar-divider",d:"M 9.3 18.951 L 9.3 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{id:"bar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),A("path",{id:"bar-arrow",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const dLe=Et({name:"kimi-left-panel",render:cLe}),fLe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function hLe(e,t){return k(),L("svg",fLe,[...t[0]||(t[0]=[A("path",{id:"bar-divider",d:"M 9.3 18.951 L 9.3 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{id:"bar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),A("path",{id:"bar-arrow-expand",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const pLe=Et({name:"kimi-left-panel-expand",render:hLe}),mLe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function gLe(e,t){return k(),L("svg",mLe,[...t[0]||(t[0]=[A("path",{id:"rbar-divider",d:"M 14.7 18.951 L 14.7 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{id:"rbar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),A("path",{id:"rbar-arrow",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const vLe=Et({name:"kimi-right-panel",render:gLe}),yLe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"};function kLe(e,t){return k(),L("svg",yLe,[...t[0]||(t[0]=[A("path",{id:"rbar-divider",d:"M 14.7 18.951 L 14.7 4.3",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{id:"rbar-box",d:"M -7.9 -4.8 C -7.9 -6.512 -6.512 -7.9 -4.8 -7.9 L 4.8 -7.9 C 6.512 -7.9 7.9 -6.512 7.9 -4.8 L 7.9 4.8 C 7.9 6.512 6.512 7.9 4.8 7.9 L -4.8 7.9 C -6.512 7.9 -7.9 6.512 -7.9 4.8 L -7.9 -4.8 Z",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"butt","stroke-linejoin":"miter",transform:"matrix(1 0 0 1 11.8 11.8)"},null,-1),A("path",{id:"rbar-arrow-expand",d:"M -1.25 -2.5 L 1.25 0 L -1.25 2.5",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const bLe=Et({name:"kimi-right-panel-expand",render:kLe}),wLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function CLe(e,t){return k(),L("svg",wLe,[...t[0]||(t[0]=[Qd('',1)])])}const ALe=Et({name:"kimi-light-mode",render:CLe}),xLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function SLe(e,t){return k(),L("svg",xLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.97427 8.06961C4.99348 7.33581 6.18946 7.1 7.00001 7.1H9.00001C9.49706 7.1 9.90001 7.50294 9.90001 8C9.90001 8.49706 9.49706 8.9 9.00001 8.9H7.00001C6.47755 8.9 5.67353 9.06419 5.02599 9.53039C4.42434 9.96356 3.90001 10.6934 3.90001 12C3.90001 13.3066 4.42434 14.0364 5.02599 14.4696C5.67353 14.9358 6.47755 15.1 7.00001 15.1H9.00001C9.49706 15.1 9.90001 15.5029 9.90001 16C9.90001 16.4971 9.49706 16.9 9.00001 16.9H7.00001C6.18946 16.9 4.99348 16.6642 3.97427 15.9304C2.90917 15.1636 2.10001 13.8934 2.10001 12C2.10001 10.1066 2.90917 8.83644 3.97427 8.06961ZM14.1 8C14.1 7.50294 14.5029 7.1 15 7.1H17C17.8105 7.1 19.0065 7.33581 20.0257 8.06961C21.0908 8.83644 21.9 10.1066 21.9 12C21.9 13.8934 21.0908 15.1636 20.0257 15.9304C19.0065 16.6642 17.8105 16.9 17 16.9H15C14.5029 16.9 14.1 16.4971 14.1 16C14.1 15.5029 14.5029 15.1 15 15.1H17C17.5225 15.1 18.3265 14.9358 18.974 14.4696C19.5757 14.0364 20.1 13.3066 20.1 12C20.1 10.6934 19.5757 9.96356 18.974 9.53039C18.3265 9.06419 17.5225 8.9 17 8.9H15C14.5029 8.9 14.1 8.49706 14.1 8ZM7.10001 12C7.10001 11.5029 7.50295 11.1 8.00001 11.1H16C16.4971 11.1 16.9 11.5029 16.9 12C16.9 12.4971 16.4971 12.9 16 12.9H8.00001C7.50295 12.9 7.10001 12.4971 7.10001 12Z",fill:"currentColor"},null,-1)])])}const _Le=Et({name:"kimi-link",render:SLe}),MLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ILe(e,t){return k(),L("svg",MLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.10001 5.99998C4.10001 5.50292 4.50295 5.09998 5.00001 5.09998H19C19.4971 5.09998 19.9 5.50292 19.9 5.99998C19.9 6.49703 19.4971 6.89998 19 6.89998H5.00001C4.50295 6.89998 4.10001 6.49703 4.10001 5.99998ZM4.10001 12C4.10001 11.5029 4.50295 11.1 5.00001 11.1H19C19.4971 11.1 19.9 11.5029 19.9 12C19.9 12.497 19.4971 12.9 19 12.9H5.00001C4.50295 12.9 4.10001 12.497 4.10001 12ZM4.10001 18C4.10001 17.5029 4.50295 17.1 5.00001 17.1H19C19.4971 17.1 19.9 17.5029 19.9 18C19.9 18.497 19.4971 18.9 19 18.9H5.00001C4.50295 18.9 4.10001 18.497 4.10001 18Z",fill:"currentColor"},null,-1)])])}const TLe=Et({name:"kimi-list",render:ILe}),ELe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function LLe(e,t){return k(),L("svg",ELe,[...t[0]||(t[0]=[A("g",null,[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18 4.09961C20.1539 4.09961 21.9004 5.84609 21.9004 8V16C21.9004 18.1539 20.1539 19.9004 18 19.9004H6C3.84609 19.9004 2.09961 18.1539 2.09961 16V8C2.09961 5.84609 3.84609 4.09961 6 4.09961H18ZM3.90039 16C3.90039 17.1598 4.8402 18.0996 6 18.0996H18C19.1598 18.0996 20.0996 17.1598 20.0996 16V9.49805L13.5361 13.5361C12.5955 14.1147 11.4075 14.1084 10.4727 13.5205L3.90039 9.38672V16ZM6 5.90039C5.0746 5.90039 4.29039 6.49909 4.01074 7.33008L11.4316 11.9971C11.7861 12.2199 12.2361 12.2222 12.5928 12.0029L20.0195 7.43457C19.7725 6.54993 18.9636 5.90039 18 5.90039H6Z",fill:"currentColor"})],-1)])])}const NLe=Et({name:"kimi-mail",render:LLe}),DLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FLe(e,t){return k(),L("svg",DLe,[...t[0]||(t[0]=[A("path",{d:"M17 11.0996C17.4971 11.0996 17.9004 11.5029 17.9004 12C17.9004 12.4971 17.4971 12.9004 17 12.9004H7C6.50294 12.9004 6.09961 12.4971 6.09961 12C6.09961 11.5029 6.50294 11.0996 7 11.0996H17Z",fill:"currentColor"},null,-1)])])}const BLe=Et({name:"kimi-minus",render:FLe}),RLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function OLe(e,t){return k(),L("svg",RLe,[...t[0]||(t[0]=[A("path",{d:"M15.182 3.32802C15.9304 2.72235 17.0309 2.76978 17.724 3.46767L18.5424 4.29189L18.6722 4.43642C19.2377 5.13495 19.234 6.1404 18.6635 6.83486L18.5326 6.97841L18.0248 7.48232C17.9549 7.55172 17.8793 7.61254 17.8021 7.66884C17.9794 8.18027 17.9316 8.7498 17.6595 9.22841C17.6847 9.24522 17.7091 9.2635 17.7328 9.2831L17.8002 9.3456L17.9847 9.53798C19.8515 11.5442 20.4549 14.0022 19.6224 16.2196C19.1921 17.3657 18.4025 18.3827 17.2992 19.203H19.0873L19.1801 19.2079C19.6337 19.2542 19.9877 19.6375 19.9877 20.1034C19.9876 20.5692 19.6337 20.9527 19.1801 20.9989L19.0873 21.0028H13.0385C13.0244 21.0033 13.0104 21.0031 12.9965 21.0028H4.9115C4.41448 21.0028 4.01117 20.6004 4.01111 20.1034C4.01111 19.6064 4.41444 19.203 4.9115 19.203H12.9047C15.7614 18.5471 17.3679 17.1023 17.9369 15.5868C18.4678 14.1726 18.179 12.4782 16.807 10.9188L16.5189 10.6093L16.4574 10.5399C16.4549 10.5368 16.453 10.5333 16.4506 10.5302L12.3011 14.6522C11.6031 15.3454 10.5023 15.3845 9.75818 14.7733L9.61365 14.6425L7.31091 12.3231C6.5717 11.5786 6.57617 10.376 7.32068 9.63662L12.3676 4.62392L12.5121 4.49404C13.0358 4.06988 13.7318 3.96755 14.3402 4.18251C14.3969 4.10597 14.4591 4.03197 14.5287 3.96279L15.0365 3.45791L15.182 3.32802ZM4.83044 12.9335C5.16112 12.6052 5.68305 12.5863 6.03552 12.8759L6.10291 12.9384L9.07361 15.9286L9.13513 15.997C9.42218 16.3514 9.3992 16.8727 9.06873 17.2011C8.7381 17.5294 8.21712 17.5482 7.86462 17.2587L7.79626 17.1972L4.82654 14.2069L4.76501 14.1376C4.47792 13.7831 4.49979 13.2619 4.83044 12.9335ZM13.6693 5.87978L13.6361 5.90126L8.58826 10.914C8.54935 10.9529 8.54943 11.0165 8.58826 11.0556L10.891 13.3739L10.9242 13.3964C10.9602 13.4111 11.0032 13.404 11.0326 13.3749L16.0795 8.3622L16.1019 8.329C16.1117 8.3049 16.1117 8.2779 16.1019 8.2538L16.0804 8.2206L13.7777 5.90224C13.7486 5.87289 13.7054 5.86535 13.6693 5.87978ZM16.3383 4.71376L16.3051 4.73525L15.7972 5.24013C15.7584 5.27904 15.7585 5.34166 15.7972 5.38076L16.6146 6.20498L16.6478 6.22744C16.6838 6.24221 16.7268 6.23487 16.7562 6.20595L17.264 5.70107L17.2865 5.66787C17.2962 5.64382 17.2963 5.61672 17.2865 5.59267L17.265 5.55947L16.4467 4.73623C16.4174 4.70681 16.3744 4.6992 16.3383 4.71376Z",fill:"currentColor"},null,-1)])])}const $Le=Et({name:"kimi-microscope",render:OLe}),PLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zLe(e,t){return k(),L("svg",PLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.669 7.94435C11.6812 7.94435 11.6912 7.9546 11.6914 7.96681C11.6914 7.96922 11.6926 7.97233 11.6934 7.97462L14.0908 15.1924C14.1283 15.3052 14.0437 15.4219 13.9248 15.4219H12.709C12.6327 15.4217 12.5655 15.3718 12.543 15.2988L11.9639 13.418C11.9526 13.3814 11.9181 13.3565 11.8799 13.3565H9.1504C9.11222 13.3565 9.07868 13.3815 9.06739 13.418L8.48829 15.2988C8.46577 15.3719 8.39778 15.4219 8.3213 15.4219H7.10548C6.98659 15.4219 6.90296 15.3052 6.94044 15.1924L9.30762 8.06446C9.3313 7.99321 9.39855 7.94435 9.47364 7.94435H11.669ZM9.4961 12.041C9.47878 12.0971 9.52043 12.1543 9.57911 12.1543H11.4512C11.5098 12.1543 11.5525 12.0971 11.5352 12.041L10.6113 9.05177H10.4199L9.4961 12.041Z",fill:"currentColor"},null,-1),A("path",{d:"M16.0576 7.94435C16.1539 7.94435 16.2324 8.02289 16.2324 8.11915V15.2481C16.2322 15.3441 16.1537 15.4219 16.0576 15.4219H15.0645C14.9683 15.4219 14.8899 15.3441 14.8897 15.2481V8.11915C14.8897 8.02289 14.9682 7.94435 15.0645 7.94435H16.0576Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.0534 2.091C12.5082 2.091 12.8766 2.45946 12.8766 2.91425L12.874 3.90821H14.3076L14.3102 2.92499C14.3103 2.47035 14.6788 2.10186 15.1334 2.10175C15.5882 2.10175 15.9566 2.47028 15.9567 2.92499L15.9541 3.90821H17.0293C18.4439 3.90854 19.5908 5.05504 19.5908 6.46974V7.90821L21.0852 7.93105C21.54 7.93105 21.9085 8.29951 21.9085 8.7543C21.9084 9.20899 21.54 9.57754 21.0852 9.57754L19.6074 9.5547C19.6019 9.5547 19.5964 9.55383 19.5908 9.55372V11.0215L21.0852 11.0443C21.54 11.0443 21.9084 11.4129 21.9085 11.8676C21.9085 12.3224 21.54 12.6908 21.0852 12.6908L19.6074 12.668C19.6019 12.668 19.5964 12.6671 19.5908 12.667V14.1016L21.0852 14.1244C21.54 14.1244 21.9084 14.4929 21.9085 14.9477C21.9085 15.4024 21.54 15.7709 21.0852 15.7709L19.6074 15.7481C19.6019 15.7481 19.5964 15.7472 19.5908 15.7471V16.8975C19.5907 18.312 18.4438 19.4587 17.0293 19.459H15.9453L15.9875 21.0863C15.9875 21.5409 15.6189 21.9094 15.1643 21.9095C14.7095 21.9095 14.3411 21.541 14.341 21.0863L14.2988 19.459H12.8311L12.8733 21.0863C12.8732 21.541 12.5048 21.9095 12.05 21.9095C11.5955 21.9093 11.2269 21.5409 11.2268 21.0863L11.1846 19.459H9.75098L9.79319 21.0687C9.79319 21.5235 9.42474 21.8919 8.96995 21.8919C8.51536 21.8917 8.14671 21.5233 8.14671 21.0687L8.1045 19.459H6.75489C5.34008 19.459 4.19352 18.3122 4.19337 16.8975V15.7031L2.90033 15.7353C2.4456 15.7353 2.07709 15.3668 2.07709 14.9121C2.0771 14.4574 2.44561 14.0889 2.90033 14.0889L4.19337 14.0567V12.5899L2.91595 12.6221C2.46128 12.6221 2.09289 12.2535 2.09271 11.7988C2.09271 11.344 2.46116 10.9756 2.91595 10.9756L4.19337 10.9434V9.50978L2.91595 9.54198C2.46126 9.54198 2.09287 9.1734 2.09271 8.71874C2.09271 8.26395 2.46116 7.8955 2.91595 7.8955L4.19337 7.86329V6.46974C4.19337 5.05483 5.33999 3.90821 6.75489 3.90821H8.11427L8.11684 2.91425C8.11684 2.45946 8.48529 2.091 8.94008 2.091C9.39483 2.09105 9.76332 2.45949 9.76332 2.91425L9.76075 3.90821H11.2275L11.2301 2.91425C11.2301 2.45955 11.5987 2.09115 12.0534 2.091ZM6.66114 5.55958C6.19983 5.6065 5.83985 5.99605 5.83985 6.46974V16.8975L5.84473 16.9912C5.88868 17.4216 6.23075 17.7639 6.66114 17.8076L6.75489 17.8125H17.0293L17.1221 17.8076C17.5526 17.764 17.8955 17.4217 17.9395 16.9912L17.9434 16.8975V6.46974C17.9434 5.99595 17.5835 5.60637 17.1221 5.55958L17.0293 5.5547H6.75489L6.66114 5.55958Z",fill:"currentColor"},null,-1)])])}const jLe=Et({name:"kimi-model",render:zLe}),HLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WLe(e,t){return k(),L("svg",HLe,[...t[0]||(t[0]=[A("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),A("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),A("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const qLe=Et({name:"kimi-more",render:WLe}),ULe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VLe(e,t){return k(),L("svg",ULe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 12.0993C8.49691 12.0993 8.90016 12.5028 8.90039 12.9997V17.9997C8.90039 19.6013 7.60163 20.9001 6 20.9001C4.39837 20.9001 3.09961 19.6013 3.09961 17.9997C3.09984 16.3982 4.39852 15.0993 6 15.0993C6.38939 15.0993 6.76033 15.1778 7.09961 15.317V12.9997C7.09984 12.5028 7.50309 12.0993 8 12.0993ZM6 16.9001C5.39263 16.9001 4.90062 17.3923 4.90039 17.9997C4.90039 18.6072 5.39249 19.0993 6 19.0993C6.60751 19.0993 7.09961 18.6072 7.09961 17.9997C7.09938 17.3923 6.60737 16.9001 6 16.9001Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.627 3.35611C19.8025 3.12106 20.9001 4.02068 20.9004 5.21939V15.9997C20.9004 17.6013 19.6016 18.9001 18 18.9001C16.3984 18.9001 15.0996 17.6013 15.0996 15.9997C15.0998 14.3982 16.3985 13.0993 18 13.0993C18.3894 13.0993 18.7603 13.1778 19.0996 13.317V9.21939C19.0993 9.15657 19.0421 9.10946 18.9805 9.12173L12.6768 10.3825C12.1894 10.4799 11.7148 10.1637 11.6172 9.67642C11.52 9.18922 11.8361 8.71439 12.3232 8.61685L18.627 7.35611C18.7868 7.32415 18.9452 7.31502 19.0996 7.32291V5.21939C19.0993 5.15657 19.0421 5.10946 18.9805 5.12173L12.6768 6.38248C12.1894 6.47994 11.7148 6.16372 11.6172 5.67642C11.52 5.18922 11.8361 4.71439 12.3232 4.61685L18.627 3.35611ZM18 14.9001C17.3926 14.9001 16.9006 15.3923 16.9004 15.9997C16.9004 16.6072 17.3925 17.0993 18 17.0993C18.6075 17.0993 19.0996 16.6072 19.0996 15.9997C19.0994 15.3923 18.6074 14.9001 18 14.9001Z",fill:"currentColor"},null,-1),A("path",{d:"M7.32422 5.38931C7.61669 4.87032 8.38346 4.87015 8.67578 5.38931L8.73047 5.50845L8.89551 5.95376L8.97949 6.1481C9.19937 6.58817 9.57968 6.93145 10.0459 7.10415L10.4912 7.26919C11.127 7.50461 11.1666 8.36217 10.6104 8.67544L10.4912 8.73013L10.0459 8.89517C9.5799 9.06783 9.19939 9.41141 8.97949 9.85123L8.89551 10.0456L8.73047 10.4909C8.49495 11.1267 7.63737 11.1665 7.32422 10.61L7.26953 10.4909L7.10449 10.0456C6.93172 9.57931 6.58767 9.19898 6.14746 8.97916L5.9541 8.89517L5.50879 8.73013C4.83054 8.47903 4.83061 7.52037 5.50879 7.26919L5.9541 7.10415L6.14746 7.02017C6.58757 6.80032 6.93176 6.41995 7.10449 5.95376L7.26953 5.50845L7.32422 5.38931Z",fill:"currentColor"},null,-1)])])}const KLe=Et({name:"kimi-music",render:VLe}),ZLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GLe(e,t){return k(),L("svg",ZLe,[...t[0]||(t[0]=[A("path",{d:"M17.9551 6.32648C17.955 5.82951 17.5517 5.42706 17.0547 5.42706H15.4844C14.9875 5.42717 14.5851 5.82958 14.585 6.32648V17.6732C14.585 18.1701 14.9874 18.5734 15.4844 18.5735H17.0547C17.5518 18.5735 17.9551 18.1702 17.9551 17.6732V6.32648ZM19.7549 17.6732C19.7549 19.1643 18.5459 20.3734 17.0547 20.3734H15.4844C13.9933 20.3732 12.7842 19.1643 12.7842 17.6732V6.32648C12.7843 4.83546 13.9934 3.62639 15.4844 3.62628H17.0547C18.5458 3.62628 19.7548 4.8354 19.7549 6.32648V17.6732Z",fill:"currentColor"},null,-1),A("path",{d:"M9.41571 6.32648C9.41561 5.82951 9.01231 5.42706 8.51532 5.42706H6.94501C6.44811 5.42717 6.0457 5.82958 6.04559 6.32648V17.6732C6.04559 18.1701 6.44804 18.5734 6.94501 18.5735H8.51532C9.01238 18.5735 9.41571 18.1702 9.41571 17.6732V6.32648ZM11.2155 17.6732C11.2155 19.1643 10.0065 20.3734 8.51532 20.3734H6.94501C5.45393 20.3732 4.24481 19.1643 4.24481 17.6732V6.32648C4.24492 4.83546 5.45399 3.62639 6.94501 3.62628H8.51532C10.0064 3.62628 11.2154 4.8354 11.2155 6.32648V17.6732Z",fill:"currentColor"},null,-1)])])}const QLe=Et({name:"kimi-pause",render:GLe}),YLe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function JLe(e,t){return k(),L("svg",YLe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.0176 4.89998C17.7305 4.89998 17.4552 5.014 17.2522 5.217L6.35429 16.1149C5.957 16.5122 5.67517 17.01 5.53889 17.5551L5.23691 18.763L6.44486 18.4611C6.98994 18.3248 7.48773 18.0429 7.88502 17.6456L18.783 6.74773C18.8834 6.64728 18.9631 6.52797 19.0176 6.39658C19.072 6.26517 19.1 6.12441 19.1 5.98236C19.1 5.84031 19.072 5.69956 19.0176 5.56815C18.9631 5.43676 18.8834 5.31745 18.783 5.217C18.6825 5.11649 18.5631 5.03676 18.4318 4.98237C18.3005 4.92798 18.1597 4.89998 18.0176 4.89998ZM15.9794 3.94421C16.52 3.40366 17.2531 3.09998 18.0176 3.09998C18.3961 3.09998 18.7709 3.17452 19.1207 3.31938C19.4704 3.46424 19.7881 3.67656 20.0558 3.94421C20.3235 4.21192 20.5357 4.52969 20.6805 4.87932C20.8254 5.22895 20.9 5.60375 20.9 5.98236C20.9 6.36098 20.8254 6.73578 20.6805 7.08541C20.5357 7.43504 20.3235 7.75281 20.0558 8.02052L17.6385 10.4378L9.15781 18.9184C8.52984 19.5464 7.74301 19.9919 6.88142 20.2073L4.21828 20.8731C3.91158 20.9498 3.58714 20.8599 3.3636 20.6364C3.14006 20.4128 3.05019 20.0884 3.12686 19.7817L3.79264 17.1185C4.00803 16.257 4.45351 15.4701 5.0815 14.8421L15.9794 3.94421Z",fill:"currentColor"},null,-1)])])}const XLe=Et({name:"kimi-pencil",render:JLe}),eNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tNe(e,t){return k(),L("svg",eNe,[...t[0]||(t[0]=[A("path",{d:"M7.76251 3.10547C8.25776 3.10552 8.74422 3.23849 9.17072 3.49023L19.533 9.60742C20.8536 10.3869 21.2922 12.0901 20.5174 13.4121C20.2785 13.8195 19.9398 14.1604 19.533 14.4004L9.16974 20.5156C7.84721 21.2958 6.14595 20.8511 5.36993 19.5273C5.1196 19.1003 4.98719 18.6142 4.98712 18.1191V5.88672C4.98716 4.3537 6.2273 3.10547 7.76251 3.10547ZM6.7879 18.1191C6.78797 18.2945 6.8343 18.4664 6.92267 18.6172C7.19638 19.0841 7.79336 19.2377 8.25568 18.9648L18.618 12.8496C18.7607 12.7654 18.8803 12.6458 18.9647 12.502C19.2393 12.0334 19.082 11.4311 18.618 11.1572L8.25568 5.04102C8.1061 4.95273 7.93562 4.9063 7.76251 4.90625C7.22703 4.90625 6.78794 5.34218 6.7879 5.88672V18.1191Z",fill:"currentColor"},null,-1)])])}const nNe=Et({name:"kimi-play",render:tNe}),iNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oNe(e,t){return k(),L("svg",iNe,[...t[0]||(t[0]=[A("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),A("path",{d:"M12 2v10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const sNe=Et({name:"kimi-power",render:oNe}),rNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lNe(e,t){return k(),L("svg",rNe,[...t[0]||(t[0]=[A("path",{d:"M11.999 15.0049C12.6208 15.0049 13.1259 15.5091 13.126 16.1309C13.126 16.7528 12.6209 17.2578 11.999 17.2578C11.3773 17.2576 10.873 16.7526 10.873 16.1309C10.8732 15.5092 11.3774 15.0051 11.999 15.0049Z",fill:"currentColor"},null,-1),A("path",{d:"M10.1611 7.37109C10.9017 6.79576 11.8605 6.60385 12.7881 6.8457C13.808 7.10861 14.6385 7.93756 14.9014 8.95898C15.2694 10.3845 14.5793 11.8629 13.2598 12.4736C13.0803 12.557 12.75 12.9552 12.75 13.3525V13.502C12.75 13.9172 12.4142 14.2527 11.999 14.2529C11.5837 14.2529 11.248 13.9173 11.248 13.502V13.3525C11.248 12.313 11.9587 11.4215 12.6279 11.1113C13.1777 10.8567 13.6681 10.192 13.4473 9.33496C13.3195 8.84253 12.9038 8.42684 12.4121 8.2998C11.9292 8.17289 11.4573 8.26727 11.0811 8.55859C10.71 8.84626 10.4971 9.28012 10.4971 9.74805C10.4968 10.1632 10.1613 10.499 9.74609 10.499C9.33092 10.499 8.99536 10.1632 8.99512 9.74805C8.99512 8.81152 9.41918 7.94493 10.1611 7.37109Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 3.7998C7.47126 3.7998 3.7998 7.47126 3.7998 12C3.7998 16.5287 7.47126 20.2002 12 20.2002C16.5287 20.2002 20.2002 16.5287 20.2002 12C20.2002 7.47126 16.5287 3.7998 12 3.7998Z",fill:"currentColor"},null,-1)])])}const aNe=Et({name:"kimi-question",render:lNe}),uNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function cNe(e,t){return k(),L("svg",uNe,[...t[0]||(t[0]=[A("path",{d:"M12 2C13.1046 2 14 2.89543 14 4C14 4.78019 13.552 5.45353 12.9004 5.7832V7H16.5C18.1569 7 19.5 8.34315 19.5 10V17C19.5 18.6051 18.2394 19.9158 16.6543 19.9961L16.5 20H7.5L7.3457 19.9961C5.81166 19.9184 4.58163 18.6883 4.50391 17.1543L4.5 17V10C4.5 8.34315 5.84315 7 7.5 7H11.0996V5.7832C10.448 5.45353 10 4.78019 10 4C10 2.89543 10.8954 2 12 2ZM7.5 8.7998C6.83726 8.7998 6.2998 9.33726 6.2998 10V17C6.2998 17.6627 6.83726 18.2002 7.5 18.2002H16.5C17.1627 18.2002 17.7002 17.6627 17.7002 17V10C17.7002 9.33726 17.1627 8.7998 16.5 8.7998H7.5ZM3 10.7666C3.49706 10.7666 3.90039 11.1699 3.90039 11.667V15C3.90039 15.4971 3.49706 15.9004 3 15.9004C2.50294 15.9004 2.09961 15.4971 2.09961 15V11.667C2.09961 11.1699 2.50294 10.7666 3 10.7666ZM21 10.7666C21.4971 10.7666 21.9004 11.1699 21.9004 11.667V15C21.9004 15.4971 21.4971 15.9004 21 15.9004C20.5029 15.9004 20.0996 15.4971 20.0996 15V11.667C20.0996 11.1699 20.5029 10.7666 21 10.7666ZM9.5 11.0996C9.99706 11.0996 10.4004 11.5029 10.4004 12V14.5C10.4004 14.9971 9.99706 15.4004 9.5 15.4004C9.00294 15.4004 8.59961 14.9971 8.59961 14.5V12C8.59961 11.5029 9.00294 11.0996 9.5 11.0996ZM14.5 11.0996C14.9971 11.0996 15.4004 11.5029 15.4004 12V14.5C15.4004 14.9971 14.9971 15.4004 14.5 15.4004C14.0029 15.4004 13.5996 14.9971 13.5996 14.5V12C13.5996 11.5029 14.0029 11.0996 14.5 11.0996ZM12 3.5C11.7239 3.5 11.5 3.72386 11.5 4C11.5 4.27614 11.7239 4.5 12 4.5C12.2761 4.5 12.5 4.27614 12.5 4C12.5 3.72386 12.2761 3.5 12 3.5Z",fill:"currentColor"},null,-1)])])}const dNe=Et({name:"kimi-robot",render:cNe}),fNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function hNe(e,t){return k(),L("svg",fNe,[...t[0]||(t[0]=[A("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const pNe=Et({name:"kimi-search",render:hNe}),mNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function gNe(e,t){return k(),L("svg",mNe,[...t[0]||(t[0]=[A("path",{d:"M16.5364 10.1636C16.8879 10.5151 16.8879 11.0849 16.5364 11.4364C16.1849 11.7879 15.6151 11.7879 15.2636 11.4364L12.9 9.07281V17.1C12.9 17.597 12.4971 18 12 18C11.503 18 11.1 17.597 11.1 17.1V9.07281L8.73641 11.4364C8.38494 11.7879 7.81509 11.7879 7.46362 11.4364C7.11214 11.0849 7.11214 10.5151 7.46362 10.1636L11.3636 6.2636C11.7151 5.91211 12.2849 5.91211 12.6364 6.2636L16.5364 10.1636Z",fill:"currentColor"},null,-1)])])}const vNe=Et({name:"kimi-send",render:gNe}),yNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kNe(e,t){return k(),L("svg",yNe,[...t[0]||(t[0]=[A("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),A("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const bNe=Et({name:"kimi-setting",render:kNe}),wNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function CNe(e,t){return k(),L("svg",wNe,[...t[0]||(t[0]=[A("path",{d:"M17 2C19.2091 2 21 3.79086 21 6V15.7646C21 17.2361 20.192 18.5884 18.8965 19.2861L13.8965 21.9785C12.7126 22.616 11.2874 22.616 10.1035 21.9785L5.10352 19.2861C3.80802 18.5884 3 17.2361 3 15.7646V6C3 3.79086 4.79086 2 7 2H17ZM7 3.7998C5.78498 3.7998 4.79981 4.78497 4.7998 6V15.7646C4.7998 16.574 5.24443 17.3184 5.95703 17.7021L10.957 20.3936C11.6082 20.7442 12.3918 20.7442 13.043 20.3936L18.043 17.7021C18.7556 17.3184 19.2002 16.574 19.2002 15.7646V6C19.2002 4.78497 18.215 3.7998 17 3.7998H7Z",fill:"currentColor"},null,-1),A("path",{d:"M10.1611 7.37109C10.9017 6.79576 11.8605 6.60385 12.7881 6.8457C13.808 7.10861 14.6385 7.93756 14.9014 8.95898C15.2694 10.3845 14.5793 11.8629 13.2598 12.4736C13.0803 12.557 12.75 12.9552 12.75 13.3525V13.502C12.75 13.9172 12.4142 14.2527 11.999 14.2529C11.5837 14.2529 11.248 13.9173 11.248 13.502V13.3525C11.248 12.313 11.9587 11.4215 12.6279 11.1113C13.1777 10.8567 13.6681 10.192 13.4473 9.33496C13.3195 8.84253 12.9038 8.42684 12.4121 8.2998C11.9292 8.17289 11.4573 8.26727 11.0811 8.55859C10.71 8.84626 10.4971 9.28012 10.4971 9.74805C10.4968 10.1632 10.1613 10.499 9.74609 10.499C9.33092 10.499 8.99536 10.1632 8.99512 9.74805C8.99512 8.81152 9.41918 7.94493 10.1611 7.37109Z",fill:"currentColor"},null,-1),A("path",{d:"M11.999 15.0049C12.6208 15.0049 13.1259 15.5091 13.126 16.1309C13.126 16.7528 12.6209 17.2578 11.999 17.2578C11.3773 17.2576 10.873 16.7526 10.873 16.1309C10.8732 15.5092 11.3774 15.0051 11.999 15.0049Z",fill:"currentColor"},null,-1)])])}const ANe=Et({name:"kimi-shield-question",render:CNe}),xNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function SNe(e,t){return k(),L("svg",xNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.90005 12C2.90005 11.503 3.303 11.1 3.80005 11.1H12.2939L9.38588 8.19197C9.03441 7.8405 9.03441 7.27065 9.38588 6.91918C9.73735 6.56771 10.3072 6.56771 10.6587 6.91918L15.1031 11.3636C15.2719 11.5324 15.3667 11.7613 15.3667 12C15.3667 12.2387 15.2719 12.4676 15.1031 12.6364L10.6587 17.0809C10.3072 17.4323 9.73735 17.4323 9.38588 17.0809C9.03441 16.7294 9.03441 16.1595 9.38588 15.8081L12.2939 12.9H3.80005C3.303 12.9 2.90005 12.4971 2.90005 12ZM13.5874 20C13.5874 19.503 13.9904 19.1 14.4874 19.1H18.043C18.2758 19.1 18.4991 19.0075 18.6637 18.8429C18.8283 18.6783 18.9208 18.455 18.9208 18.2222V5.7778C18.9208 5.545 18.8283 5.32174 18.6637 5.15712C18.499 4.9925 18.2758 4.90002 18.043 4.90002H14.4874C13.9904 4.90002 13.5874 4.49708 13.5874 4.00002C13.5874 3.50297 13.9904 3.10003 14.4874 3.10003H18.043C18.7532 3.10003 19.4343 3.38215 19.9365 3.88433C20.4386 4.38651 20.7208 5.06761 20.7208 5.7778V18.2222C20.7208 18.9324 20.4386 19.6135 19.9365 20.1157C19.4343 20.6179 18.7532 20.9 18.043 20.9H14.4874C13.9904 20.9 13.5874 20.4971 13.5874 20Z",fill:"currentColor"},null,-1)])])}const _Ne=Et({name:"kimi-sign-in",render:SNe}),MNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function INe(e,t){return k(),L("svg",MNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.6364 11.3636C20.9879 11.7151 20.9879 12.2849 20.6364 12.6364L16.1919 17.0808C15.8405 17.4323 15.2706 17.4323 14.9192 17.0808C14.5677 16.7293 14.5677 16.1595 14.9192 15.808L17.8272 12.9H9.33333C8.83627 12.9 8.43333 12.497 8.43333 12C8.43333 11.5029 8.83627 11.1 9.33333 11.1H17.8272L14.9192 8.19193C14.5677 7.84046 14.5677 7.27061 14.9192 6.91914C15.2706 6.56766 15.8405 6.56766 16.1919 6.91914L20.6364 11.3636ZM10.2333 3.99998C10.2333 4.49703 9.83038 4.89998 9.33333 4.89998H5.77777C5.54497 4.89998 5.3217 4.99246 5.15709 5.15707C4.99247 5.32169 4.89999 5.54495 4.89999 5.77775V18.2222C4.89999 18.455 4.99247 18.6783 5.15709 18.8429C5.32171 19.0075 5.54497 19.1 5.77777 19.1H9.33333C9.83038 19.1 10.2333 19.5029 10.2333 20C10.2333 20.497 9.83038 20.9 9.33333 20.9H5.77777C5.06758 20.9 4.38648 20.6179 3.8843 20.1157C3.38212 19.6135 3.09999 18.9324 3.09999 18.2222V5.77775C3.09999 5.06756 3.38212 4.38646 3.8843 3.88428C4.38648 3.3821 5.06758 3.09998 5.77777 3.09998H9.33333C9.83038 3.09998 10.2333 3.50292 10.2333 3.99998Z",fill:"currentColor"},null,-1)])])}const TNe=Et({name:"kimi-sign-out",render:INe}),ENe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function LNe(e,t){return k(),L("svg",ENe,[...t[0]||(t[0]=[Qd('',9)])])}const NNe=Et({name:"kimi-sliders",render:LNe}),DNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FNe(e,t){return k(),L("svg",DNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.78027 8.90405C7.5 9.45411 7.5 10.1742 7.5 11.6144V12.3856C7.5 13.8258 7.5 14.5459 7.78027 15.096C8.02681 15.5798 8.42019 15.9732 8.90405 16.2197C9.45411 16.5 10.1742 16.5 11.6144 16.5H12.3856C13.8258 16.5 14.5459 16.5 15.096 16.2197C15.5798 15.9732 15.9732 15.5798 16.2197 15.096C16.5 14.5459 16.5 13.8258 16.5 12.3856V11.6144C16.5 10.1742 16.5 9.45411 16.2197 8.90405C15.9732 8.42019 15.5798 8.02681 15.096 7.78027C14.5459 7.5 13.8258 7.5 12.3856 7.5H11.6144C10.1742 7.5 9.45411 7.5 8.90405 7.78027C8.42019 8.02681 8.02681 8.42019 7.78027 8.90405Z",fill:"currentColor"},null,-1)])])}const BNe=Et({name:"kimi-stop",render:FNe}),RNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ONe(e,t){return k(),L("svg",RNe,[...t[0]||(t[0]=[A("path",{d:"M7.01562 3.41459C7.4446 3.16449 7.9954 3.30924 8.24609 3.73784C8.49645 4.167 8.35189 4.71868 7.92285 4.96928C5.51497 6.37506 3.90054 8.98498 3.90039 11.9703C3.90076 16.4435 7.52672 20.0699 12 20.0699C16.4733 20.0699 20.0992 16.4435 20.0996 11.9703C20.0996 11.2291 20 10.5116 19.8145 9.83159C19.6838 9.35222 19.967 8.85702 20.4463 8.72612C20.9256 8.59541 21.4207 8.87778 21.5518 9.35698C21.7792 10.1901 21.9004 11.0674 21.9004 11.9703C21.9 17.4376 17.4674 21.8697 12 21.8697C6.53261 21.8697 2.09998 17.4376 2.09961 11.9703C2.09976 8.31904 4.07782 5.12972 7.01562 3.41459ZM8.39258 8.24077C8.75015 7.89591 9.3199 7.90591 9.66504 8.26323C10.01 8.62076 9.99985 9.19051 9.64258 9.53569C9.00203 10.1541 8.60558 11.02 8.60547 11.979C8.60584 13.8536 10.1253 15.3736 12 15.3736C13.8746 15.3735 15.3942 13.8536 15.3945 11.979C15.3945 11.6847 15.3577 11.3989 15.2881 11.1285C15.1646 10.6474 15.4536 10.1568 15.9346 10.0328C16.4158 9.9089 16.9071 10.1991 17.0312 10.6802C17.1383 11.096 17.1943 11.5321 17.1943 11.979C17.194 14.8477 14.8688 17.1733 12 17.1734C9.1312 17.1734 6.80506 14.8478 6.80469 11.979C6.8048 10.5117 7.41519 9.18431 8.39258 8.24077ZM11.5459 1.12651C11.8216 0.965605 12.1631 0.963306 12.4414 1.11967L19.1953 4.91752C19.4859 5.08108 19.662 5.39277 19.6533 5.72612C19.6443 6.05972 19.4515 6.36154 19.1523 6.50932L12.9004 9.5933V12.2583C12.9004 12.7554 12.4971 13.1587 12 13.1587C11.5029 13.1587 11.0996 12.7554 11.0996 12.2583V1.90385C11.0999 1.58444 11.2702 1.2878 11.5459 1.12651ZM12.9004 7.58549L16.8252 5.64897L12.9004 3.44194V7.58549Z",fill:"currentColor"},null,-1)])])}const $Ne=Et({name:"kimi-target",render:ONe}),PNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zNe(e,t){return k(),L("svg",PNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.9893 6.60743C20.5897 6.60757 21.8877 7.8926 21.8877 9.47736C21.8877 10.7416 21.0607 11.8129 19.9141 12.1955V14.257C19.914 15.8428 18.6152 17.1288 17.0137 17.1289H12.8438V20.1381C12.8437 20.6301 12.4412 21.0293 11.9443 21.0296C11.4473 21.0296 11.044 20.6302 11.0439 20.1381V16.4356C11.0441 15.8343 11.5363 15.3461 12.1436 15.3458H17.0137C17.6211 15.3457 18.1133 14.8585 18.1133 14.257V12.2129C16.9408 11.8451 16.0909 10.7598 16.0908 9.47736C16.0908 7.89251 17.3887 6.60743 18.9893 6.60743ZM18.9893 8.38953C18.3828 8.38953 17.8906 8.87684 17.8906 9.47736C17.8907 10.0778 18.3828 10.5642 18.9893 10.5642C19.5956 10.5641 20.0869 10.0777 20.0869 9.47736C20.0869 8.87693 19.5956 8.38967 18.9893 8.38953Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.89844 6.60743C6.49899 6.60747 7.79688 7.89254 7.79688 9.47736C7.79684 10.7388 6.97371 11.8078 5.83105 12.1926V14.4021C5.83105 15.0036 6.32315 15.4918 6.93066 15.4918H8.37109C8.86789 15.492 9.27038 15.8905 9.27051 16.3824C9.27051 16.8744 8.86797 17.2737 8.37109 17.2739H6.93066C5.32904 17.2739 4.03027 15.9879 4.03027 14.4021V12.2158C2.85382 11.8504 2.00004 10.7627 2 9.47736C2 7.89251 3.29784 6.60743 4.89844 6.60743ZM4.89844 8.38953C4.29196 8.38953 3.7998 8.87684 3.7998 9.47736C3.79985 10.0778 4.29198 10.5642 4.89844 10.5642C5.50485 10.5642 5.99605 10.0778 5.99609 9.47736C5.99609 8.87687 5.50488 8.38958 4.89844 8.38953Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9434 2.9707C13.5439 2.97075 14.8418 4.25581 14.8418 5.84063C14.8418 7.11413 14.0035 8.1923 12.8438 8.56745V13.0135C12.8436 13.5056 12.4403 13.9041 11.9434 13.9041C11.4466 13.9039 11.0431 13.5055 11.043 13.0135V8.56745C9.8836 8.19209 9.04496 7.11387 9.04492 5.84063C9.04492 4.25592 10.343 2.97093 11.9434 2.9707ZM11.9434 4.75281C11.3371 4.75303 10.8447 5.24026 10.8447 5.84063C10.8448 6.44097 11.3371 6.92726 11.9434 6.92749C12.5498 6.92745 13.041 6.44108 13.041 5.84063C13.041 5.24014 12.5498 4.75285 11.9434 4.75281Z",fill:"currentColor"},null,-1)])])}const jNe=Et({name:"kimi-task",render:zNe}),HNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WNe(e,t){return k(),L("svg",HNe,[...t[0]||(t[0]=[A("path",{d:"M16.5293 15.0596C16.9496 15.1021 17.2772 15.4572 17.2773 15.8887C17.2773 16.3202 16.9497 16.6753 16.5293 16.7178L16.4443 16.7217H12C11.5399 16.7216 11.167 16.3488 11.167 15.8887C11.1671 15.4286 11.54 15.0558 12 15.0557H16.4443L16.5293 15.0596Z",fill:"currentColor"},null,-1),A("path",{d:"M6.96582 7.52246C7.27077 7.21751 7.75375 7.1983 8.08105 7.46484L8.14453 7.52246L10.8232 10.2002C11.5102 10.8872 11.5102 12.0014 10.8232 12.6885L8.14453 15.3672L8.08105 15.4248C7.75377 15.6913 7.27075 15.6721 6.96582 15.3672C6.66114 15.0621 6.64234 14.5791 6.90918 14.252L6.96582 14.1885L9.64453 11.5098C9.68057 11.4736 9.68062 11.415 9.64453 11.3789L6.96582 8.7002C6.64116 8.37488 6.6411 7.84774 6.96582 7.52246Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 3.09961C19.1539 3.09966 20.9004 4.84612 20.9004 7V17C20.9004 19.1539 19.1539 20.9003 17 20.9004H7C4.84609 20.9004 3.09961 19.1539 3.09961 17V7C3.09961 4.84609 4.84609 3.09961 7 3.09961H17ZM7 4.90039C5.8402 4.90039 4.90039 5.8402 4.90039 7V17C4.90039 18.1598 5.8402 19.0996 7 19.0996H17C18.1598 19.0996 19.0996 18.1598 19.0996 17V7C19.0996 5.84024 18.1598 4.90044 17 4.90039H7Z",fill:"currentColor"},null,-1)])])}const qNe=Et({name:"kimi-terminal",render:WNe}),UNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VNe(e,t){return k(),L("svg",UNe,[...t[0]||(t[0]=[A("path",{d:"M16.9971 3.90597C15.9799 2.99725 14.7342 2.38312 13.394 2.12966C12.0538 1.8762 10.6699 1.99301 9.39111 2.46751C8.11236 2.94202 6.98721 3.75626 6.13676 4.82261C5.2863 5.88896 4.74274 7.16703 4.56457 8.5193C4.40455 9.70501 4.53253 10.9118 4.93767 12.0376C5.34281 13.1634 6.01318 14.175 6.89207 14.9868C7.43557 15.4634 7.87413 16.0477 8.17997 16.7027C8.48581 17.3577 8.65224 18.0691 8.66873 18.7918V18.926C8.66962 19.7412 8.99387 20.5229 9.57035 21.0993C10.1468 21.6758 10.9285 22.0001 11.7437 22.001H12.2604C13.0757 22.0001 13.8573 21.6758 14.4338 21.0993C15.0103 20.5229 15.3345 19.7412 15.3354 18.926V18.4685C15.3479 17.8297 15.4982 17.2011 15.7761 16.6258C16.0539 16.0505 16.4528 15.542 16.9454 15.1351C17.7442 14.4355 18.3853 13.5741 18.826 12.608C19.2668 11.642 19.4973 10.5932 19.5022 9.53136C19.5071 8.46948 19.2863 7.41869 18.8544 6.4486C18.4225 5.4785 17.7894 4.61125 16.9971 3.9043V3.90597ZM12.2604 20.3343H11.7437C11.3704 20.3339 11.0124 20.1853 10.7484 19.9213C10.4844 19.6573 10.3358 19.2993 10.3354 18.926C10.3354 18.926 10.3296 18.7093 10.3287 18.6676H13.6687V18.926C13.6683 19.2993 13.5198 19.6573 13.2558 19.9213C12.9917 20.1853 12.6338 20.3339 12.2604 20.3343ZM15.8437 13.8835C14.8949 14.7064 14.2097 15.7908 13.8737 17.001H12.8354V11.0143C13.3212 10.8426 13.742 10.5249 14.0403 10.1049C14.3387 9.68482 14.4999 9.18285 14.5021 8.66763C14.5021 8.44662 14.4143 8.23466 14.258 8.07838C14.1017 7.9221 13.8897 7.8343 13.6687 7.8343C13.4477 7.8343 13.2358 7.9221 13.0795 8.07838C12.9232 8.23466 12.8354 8.44662 12.8354 8.66763C12.8354 8.88865 12.7476 9.10061 12.5913 9.25689C12.435 9.41317 12.2231 9.50097 12.0021 9.50097C11.7811 9.50097 11.5691 9.41317 11.4128 9.25689C11.2565 9.10061 11.1687 8.88865 11.1687 8.66763C11.1687 8.44662 11.0809 8.23466 10.9247 8.07838C10.7684 7.9221 10.5564 7.8343 10.3354 7.8343C10.1144 7.8343 9.90242 7.9221 9.74614 8.07838C9.58986 8.23466 9.50207 8.44662 9.50207 8.66763C9.5042 9.18285 9.66547 9.68482 9.96381 10.1049C10.2621 10.5249 10.683 10.8426 11.1687 11.0143V17.001H10.0671C9.69123 15.7586 8.98633 14.6411 8.02707 13.7668C7.21286 13.0081 6.63267 12.0324 6.35496 10.9547C6.07725 9.87703 6.1136 8.7424 6.45974 7.68471C6.80588 6.62702 7.44735 5.69042 8.30846 4.98543C9.16956 4.28045 10.2144 3.83649 11.3196 3.70597C11.5487 3.68039 11.779 3.66759 12.0096 3.66763C13.4409 3.66338 14.8226 4.19149 15.8862 5.1493C16.5026 5.69896 16.9952 6.37337 17.3312 7.12782C17.6672 7.88227 17.839 8.69952 17.8352 9.5254C17.8314 10.3513 17.6522 11.1669 17.3092 11.9183C16.9663 12.6696 16.4677 13.3395 15.8462 13.8835H15.8437Z",fill:"currentColor"},null,-1)])])}const KNe=Et({name:"kimi-thinking",render:VNe}),ZNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GNe(e,t){return k(),L("svg",ZNe,[...t[0]||(t[0]=[Qd('',6)])])}const QNe=Et({name:"kimi-todo",render:GNe}),YNe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function JNe(e,t){return k(),L("svg",YNe,[...t[0]||(t[0]=[A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.09752 2.19507C8.5421 1.97278 9.08271 2.15298 9.305 2.59756L10.0562 4.10005H13.5C13.9971 4.10005 14.4 4.50299 14.4 5.00005C14.4 5.49711 13.9971 5.90005 13.5 5.90005H12.3106C12.2556 6.2319 12.1667 6.64073 12.0226 7.0987C11.7254 8.04355 11.191 9.20402 10.2334 10.3239C11.4166 11.196 12.5606 11.7524 13.4512 12.0987C13.978 12.3036 14.4136 12.434 14.7124 12.5122L14.7348 12.5181L15.695 10.5976C15.8475 10.2927 16.1591 10.1 16.5 10.1C16.8409 10.1 17.1525 10.2927 17.305 10.5976L20.7969 17.5814L20.8044 17.5959L20.8137 17.615L21.805 19.5976C22.0273 20.0421 21.8471 20.5827 21.4025 20.805C20.9579 21.0273 20.4173 20.8471 20.195 20.4025L19.4438 18.9H13.5562L12.805 20.4025C12.5827 20.8471 12.0421 21.0273 11.5975 20.805C11.1529 20.5827 10.9727 20.0421 11.195 19.5976L12.1863 17.615C12.1917 17.6036 12.1973 17.5924 12.2031 17.5814L13.9146 14.1583C13.6034 14.0667 13.2256 13.9423 12.7988 13.7764C11.7294 13.3605 10.3442 12.6802 8.92538 11.5924C7.79753 12.5167 6.69473 13.0764 5.83285 13.4112C5.33899 13.603 4.92286 13.7216 4.62401 13.7931C4.47449 13.8288 4.35399 13.8529 4.26741 13.8684C4.2241 13.8762 4.18924 13.8818 4.16343 13.8858L4.13156 13.8904L4.12084 13.8919L4.11682 13.8924L4.11514 13.8927C4.11514 13.8927 4.11368 13.8928 4.00001 13L4.11368 13.8928C3.62061 13.9556 3.17 13.6068 3.10722 13.1137C3.0446 12.6219 3.39148 12.1723 3.88256 12.1077L3.94947 12.0967C4.00428 12.0869 4.09114 12.0698 4.20543 12.0424C4.43422 11.9877 4.77156 11.8924 5.18106 11.7334C5.84103 11.477 6.68484 11.0564 7.56458 10.3753C7.15054 9.93496 6.78945 9.48388 6.50421 9.10102C6.26672 8.78224 6.07517 8.50172 5.94227 8.29973C5.87571 8.19858 5.82359 8.11671 5.78748 8.05909C5.76942 8.03027 5.75535 8.00749 5.74545 7.99135L5.73377 7.9722L5.73032 7.96651L5.72864 7.96371C5.71133 7.9349 5.69582 7.9055 5.68208 7.87566C5.49265 7.46416 5.6393 6.96717 6.03659 6.72853C6.09037 6.69623 6.14617 6.6702 6.20315 6.65023C6.59739 6.51205 7.04758 6.66421 7.27129 7.03623L7.27266 7.0385L7.28001 7.05054C7.28695 7.06186 7.29793 7.07964 7.31274 7.10328C7.34239 7.15059 7.38731 7.2212 7.44595 7.31032C7.56343 7.48886 7.73484 7.73997 7.94765 8.02562C8.21085 8.37889 8.52772 8.77187 8.8756 9.14201C9.64226 8.24147 10.0681 7.3133 10.3056 6.55854C10.381 6.3186 10.4372 6.09683 10.4791 5.90005H9.51951C9.50696 5.90031 9.49442 5.90031 9.48191 5.90005H4.00001C3.50296 5.90005 3.10001 5.49711 3.10001 5.00005C3.10001 4.50299 3.50296 4.10005 4.00001 4.10005H8.04378L7.69503 3.40254C7.67314 3.35877 7.65516 3.31407 7.64094 3.26883C7.51078 2.8546 7.69671 2.39547 8.09752 2.19507ZM16.5 13.0125L18.5438 17.1H14.4562L16.5 13.0125Z",fill:"currentColor"},null,-1),A("path",{d:"M15.1 4.00007C15.1 3.50301 15.5029 3.10007 16 3.10007H18C19.6016 3.10007 20.9 4.39844 20.9 6.00007V8.00007C20.9 8.49712 20.497 8.90007 20 8.90007C19.5029 8.90007 19.1 8.49712 19.1 8.00007V6.00007C19.1 5.39255 18.6075 4.90007 18 4.90007H16C15.5029 4.90007 15.1 4.49712 15.1 4.00007Z",fill:"currentColor"},null,-1),A("path",{d:"M3.99998 15.1001C4.49703 15.1001 4.89998 15.503 4.89998 16.0001V18.0001C4.89998 18.6076 5.39246 19.1001 5.99998 19.1001H7.99998C8.49703 19.1001 8.89998 19.503 8.89998 20.0001C8.89998 20.4971 8.49703 20.9001 7.99998 20.9001H5.99998C4.39835 20.9001 3.09998 19.6017 3.09998 18.0001V16.0001C3.09998 15.503 3.50292 15.1001 3.99998 15.1001Z",fill:"currentColor"},null,-1)])])}const XNe=Et({name:"kimi-translate",render:JNe}),eDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tDe(e,t){return k(),L("svg",eDe,[...t[0]||(t[0]=[A("path",{d:"M8.10001 3C8.10001 2.50294 8.50295 2.1 9.00001 2.1H15C15.4971 2.1 15.9 2.50294 15.9 3C15.9 3.49706 15.4971 3.9 15 3.9H9.00001C8.50295 3.9 8.10001 3.49706 8.10001 3Z",fill:"currentColor"},null,-1),A("path",{d:"M10 15.9C9.50295 15.9 9.10001 15.4971 9.10001 15L9.10001 10C9.10001 9.50294 9.50295 9.1 10 9.1C10.4971 9.1 10.9 9.50294 10.9 10L10.9 15C10.9 15.4971 10.4971 15.9 10 15.9Z",fill:"currentColor"},null,-1),A("path",{d:"M13.1 15C13.1 15.4971 13.5029 15.9 14 15.9C14.4971 15.9 14.9 15.4971 14.9 15L14.9 10C14.9 9.50294 14.4971 9.1 14 9.1C13.5029 9.1 13.1 9.50294 13.1 10V15Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.10001 6C2.10001 5.50294 2.50295 5.1 3.00001 5.1H4.99152C4.99785 5.09993 5.00417 5.09993 5.01048 5.1H18.9895C18.9958 5.09993 19.0021 5.09993 19.0085 5.1H21C21.4971 5.1 21.9 5.50294 21.9 6C21.9 6.49706 21.4971 6.9 21 6.9H19.8281L18.8448 18.6993C18.7412 19.9432 17.7013 20.9 16.4531 20.9H7.54686C6.29865 20.9 5.25881 19.9432 5.15515 18.6993L4.17188 6.9H3.00001C2.50295 6.9 2.10001 6.49706 2.10001 6ZM5.97811 6.9L18.0219 6.9L17.0511 18.5498C17.0251 18.8608 16.7652 19.1 16.4531 19.1H7.54686C7.23481 19.1 6.97485 18.8608 6.94893 18.5498L5.97811 6.9Z",fill:"currentColor"},null,-1)])])}const nDe=Et({name:"kimi-trash",render:tDe}),iDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oDe(e,t){return k(),L("svg",iDe,[...t[0]||(t[0]=[A("path",{d:"M7.36336 3.3634C7.71483 3.01192 8.28533 3.01192 8.6368 3.3634C8.98817 3.71488 8.98824 4.2854 8.6368 4.63683L6.17391 7.09972H15.0001C18.2585 7.09977 20.9005 9.74166 20.9005 13.0001C20.9004 16.2585 18.2585 18.9005 15.0001 18.9005H7.00008C6.50307 18.9005 6.09976 18.4971 6.09969 18.0001C6.09969 17.5031 6.50302 17.0997 7.00008 17.0997H15.0001C17.2644 17.0997 19.0996 15.2644 19.0997 13.0001C19.0997 10.7358 17.2644 8.90055 15.0001 8.90051H6.17391L8.6368 11.3634L8.69832 11.4318C8.98668 11.7853 8.96632 12.3073 8.6368 12.6368C8.30728 12.9663 7.78521 12.9867 7.43172 12.6984L7.36336 12.6368L3.36336 8.63683C3.33098 8.60445 3.30286 8.56908 3.27645 8.53332C3.25597 8.50559 3.23607 8.47741 3.21883 8.44738C3.20492 8.42311 3.19221 8.39837 3.18074 8.37316C3.1764 8.36365 3.17109 8.35453 3.16707 8.34484C3.1627 8.33427 3.1593 8.32331 3.15535 8.31261C3.12946 8.24274 3.11237 8.16872 3.10457 8.09191C3.09258 7.97426 3.10262 7.85446 3.1368 7.74035C3.14281 7.72035 3.15094 7.70114 3.15828 7.68176C3.16165 7.67283 3.16341 7.66325 3.16707 7.65441C3.17216 7.64216 3.17806 7.63025 3.18367 7.61828C3.19055 7.60356 3.19744 7.58874 3.20516 7.57433C3.24709 7.49624 3.3012 7.42556 3.36336 7.3634L7.36336 3.3634Z",fill:"currentColor"},null,-1)])])}const sDe=Et({name:"kimi-undo",render:oDe}),rDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lDe(e,t){return k(),L("svg",rDe,[...t[0]||(t[0]=[A("path",{d:"M11.9997 12.8779C16.0197 12.878 19.4393 15.3848 20.7048 18.8828C21.0812 19.9234 20.2782 20.8962 19.2038 21.0137L18.9861 21.0264H5.0134L4.79562 21.0137C3.7213 20.8961 2.91743 19.9233 3.29367 18.8828C4.55905 15.3847 7.9797 12.8781 11.9997 12.8779ZM11.9997 14.6777C8.84467 14.6779 6.17462 16.5794 5.09152 19.2256H18.9079C17.8248 16.5793 15.1549 14.6778 11.9997 14.6777ZM12.2312 3.00586C14.6088 3.1264 16.4997 5.09239 16.4997 7.5L16.4939 7.73145C16.3734 10.1091 14.4073 11.9999 11.9997 12C9.59225 11.9998 7.62604 10.109 7.50558 7.73145L7.49973 7.5C7.49973 5.01485 9.51462 3.00021 11.9997 3L12.2312 3.00586ZM11.9997 4.7998C10.5087 4.80001 9.29953 6.00896 9.29953 7.5C9.29953 8.99104 10.5087 10.2 11.9997 10.2002C13.4908 10.2001 14.6999 8.99112 14.6999 7.5C14.6999 6.00888 13.4908 4.79989 11.9997 4.7998Z",fill:"currentColor"},null,-1)])])}const aDe=Et({name:"kimi-user",render:lDe}),uDe={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function cDe(e,t){return k(),L("svg",uDe,[...t[0]||(t[0]=[A("path",{d:"M11.9996 7C11.5026 7 11.0996 7.36985 11.0996 7.82609V14.1739C11.0996 14.6301 11.5026 15 11.9996 15C12.4967 15 12.8996 14.6301 12.8996 14.1739V7.82609C12.8996 7.36985 12.4967 7 11.9996 7Z",fill:"currentColor"},null,-1),A("path",{d:"M12.8996 17.1006C12.8996 17.5974 12.4968 18.001 11.9992 18.001C11.5024 18.001 11.0996 17.5974 11.0996 17.1006C11.0996 16.6038 11.5024 16.2002 11.9992 16.2002C12.4968 16.2002 12.8996 16.6038 12.8996 17.1006Z",fill:"currentColor"},null,-1),A("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.5108 3.5501C13.3946 1.61676 10.6041 1.61676 9.48786 3.5501L1.69363 17.0501C0.577423 18.9834 1.97269 21.4001 4.20511 21.4001H19.7936C22.026 21.4001 23.4212 18.9834 22.305 17.0501L14.5108 3.5501ZM11.0467 4.4501C11.4701 3.71676 12.5286 3.71676 12.952 4.4501L20.7462 17.9501C21.1696 18.6834 20.6403 19.6001 19.7936 19.6001H4.20511C3.35833 19.6001 2.82909 18.6834 3.25248 17.9501L11.0467 4.4501Z",fill:"currentColor"},null,-1)])])}const dDe=Et({name:"kimi-warning",render:cDe}),fDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hDe(e,t){return k(),L("svg",fDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6a2 2 0 1 0 4 0a2 2 0 1 0-4 0M4 6h8m4 0h4M6 12a2 2 0 1 0 4 0a2 2 0 1 0-4 0m-2 0h2m4 0h10m-5 6a2 2 0 1 0 4 0a2 2 0 1 0-4 0M4 18h11m4 0h1"},null,-1)])])}const pDe=Et({name:"tabler-adjustments-horizontal",render:hDe}),mDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gDe(e,t){return k(),L("svg",mDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 6l-6 6l6 6"},null,-1)])])}const vDe=Et({name:"tabler-chevron-left",render:gDe}),yDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kDe(e,t){return k(),L("svg",yDe,[...t[0]||(t[0]=[A("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[A("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0"}),A("path",{d:"m9 12l2 2l4-4"})],-1)])])}const bDe=Et({name:"tabler-circle-check",render:kDe}),wDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CDe(e,t){return k(),L("svg",wDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.56 3.69a9 9 0 0 0-2.92 1.95M3.69 8.56A9 9 0 0 0 3 12m.69 3.44a9 9 0 0 0 1.95 2.92m2.92 1.95A9 9 0 0 0 12 21m3.44-.69a9 9 0 0 0 2.92-1.95m1.95-2.92A9 9 0 0 0 21 12m-.69-3.44a9 9 0 0 0-1.95-2.92m-2.92-1.95A9 9 0 0 0 12 3"},null,-1)])])}const ADe=Et({name:"tabler-circle-dashed",render:CDe}),xDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SDe(e,t){return k(),L("svg",xDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm4 15h10m-8-4v4m6-4v4"},null,-1)])])}const _De=Et({name:"tabler-device-desktop",render:SDe}),MDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IDe(e,t){return k(),L("svg",MDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 3h6m-5 6h4m-4-6v6L6 20a.7.7 0 0 0 .5 1h11a.7.7 0 0 0 .5-1L14 9V3"},null,-1)])])}const TDe=Et({name:"tabler-flask",render:IDe}),EDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LDe(e,t){return k(),L("svg",EDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const NDe=Et({name:"tabler-paperclip",render:LDe}),DDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FDe(e,t){return k(),L("svg",DDe,[...t[0]||(t[0]=[A("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[A("path",{d:"M11 19H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v4"}),A("path",{d:"M14 15a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-5a1 1 0 0 1-1-1z"})],-1)])])}const BDe=Et({name:"tabler-picture-in-picture",render:FDe}),RDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ODe(e,t){return k(),L("svg",RDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 18h5m-5-6h13a3 3 0 0 1 0 6h-4l2-2m0 4l-2-2"},null,-1)])])}const $De=Et({name:"tabler-text-wrap",render:ODe}),PDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zDe(e,t){return k(),L("svg",PDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h10M4 18h10M4 12h17l-3-3m0 6l3-3"},null,-1)])])}const jDe=Et({name:"tabler-text-wrap-disabled",render:zDe}),HDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WDe(e,t){return k(),L("svg",HDe,[...t[0]||(t[0]=[A("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 6h9m-9 6h9m-8 6h8M4 16a2 2 0 1 1 4 0c0 .591-.5 1-1 1.5L4 20h4M6 10V4L4 6"},null,-1)])])}const qDe=Et({name:"tabler-list-numbers",render:WDe}),UDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VDe(e,t){return k(),L("svg",UDe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const KDe=Et({name:"ri-braces-line",render:VDe}),ZDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GDe(e,t){return k(),L("svg",ZDe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const QDe=Et({name:"ri-calendar-close-line",render:GDe}),YDe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JDe(e,t){return k(),L("svg",YDe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const XDe=Et({name:"ri-calendar-schedule-line",render:JDe}),eFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tFe(e,t){return k(),L("svg",eFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const nFe=Et({name:"ri-calendar-todo-line",render:tFe}),iFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oFe(e,t){return k(),L("svg",iFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const sFe=Et({name:"ri-code-line",render:oFe}),rFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lFe(e,t){return k(),L("svg",rFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-4-7h8a4 4 0 0 1-8 0m0-2a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m8 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3"},null,-1)])])}const aFe=Et({name:"ri-emotion-line",render:lFe}),uFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cFe(e,t){return k(),L("svg",uFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const dFe=Et({name:"ri-external-link-line",render:cFe}),fFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hFe(e,t){return k(),L("svg",fFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M12 3c5.392 0 9.878 3.88 10.819 9c-.94 5.12-5.427 9-10.819 9s-9.878-3.88-10.818-9C2.122 6.88 6.608 3 12 3m0 16a9.005 9.005 0 0 0 8.778-7a9.005 9.005 0 0 0-17.555 0A9.005 9.005 0 0 0 12 19m0-2.5a4.5 4.5 0 1 1 0-9a4.5 4.5 0 0 1 0 9m0-2a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5"},null,-1)])])}const pFe=Et({name:"ri-eye-line",render:hFe}),mFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gFe(e,t){return k(),L("svg",mFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M17.883 19.297A10.95 10.95 0 0 1 12 21c-5.392 0-9.878-3.88-10.818-9A11 11 0 0 1 4.52 5.935L1.394 2.808l1.414-1.414l19.799 19.798l-1.414 1.415zM5.936 7.35A8.97 8.97 0 0 0 3.223 12a9.005 9.005 0 0 0 13.201 5.838l-2.028-2.028A4.5 4.5 0 0 1 8.19 9.604zm6.978 6.978l-3.242-3.241a2.5 2.5 0 0 0 3.241 3.241m7.893 2.265l-1.431-1.431A8.9 8.9 0 0 0 20.778 12A9.005 9.005 0 0 0 9.552 5.338L7.974 3.76C9.221 3.27 10.58 3 12 3c5.392 0 9.878 3.88 10.819 9a10.95 10.95 0 0 1-2.012 4.593m-9.084-9.084Q11.86 7.5 12 7.5a4.5 4.5 0 0 1 4.492 4.778z"},null,-1)])])}const vFe=Et({name:"ri-eye-off-line",render:gFe}),yFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kFe(e,t){return k(),L("svg",yFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const bFe=Et({name:"ri-file-add-line",render:kFe}),wFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CFe(e,t){return k(),L("svg",wFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const AFe=Et({name:"ri-flashlight-line",render:CFe}),xFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SFe(e,t){return k(),L("svg",xFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const _Fe=Et({name:"ri-sparkling-line",render:SFe}),MFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IFe(e,t){return k(),L("svg",MFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const TFe=Et({name:"ri-folder-fill",render:IFe}),EFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LFe(e,t){return k(),L("svg",EFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const NFe=Et({name:"ri-git-fork-line",render:LFe}),DFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FFe(e,t){return k(),L("svg",DFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const BFe=Et({name:"ri-git-pull-request-line",render:FFe}),RFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OFe(e,t){return k(),L("svg",RFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M2 18h7v2H2zm0-7h9v2H2zm0-7h20v2H2zm18.674 9.025l1.156-.391l1 1.732l-.916.805a4 4 0 0 1 0 1.658l.916.805l-1 1.732l-1.156-.391a4 4 0 0 1-1.435.83L19 21h-2l-.24-1.196a4 4 0 0 1-1.434-.83l-1.156.392l-1-1.732l.916-.805a4 4 0 0 1 0-1.658l-.916-.805l1-1.732l1.156.391c.41-.37.898-.655 1.435-.83L17 11h2l.24 1.196a4 4 0 0 1 1.434.83M18 18a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const $Fe=Et({name:"ri-list-settings-line",render:OFe}),PFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zFe(e,t){return k(),L("svg",PFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M10 2a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H8v2h5V9a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H8v6h5v-1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1H7a1 1 0 0 1-1-1V8H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm9 16h-4v2h4zm0-8h-4v2h4zM9 4H5v2h4z"},null,-1)])])}const jFe=Et({name:"ri-node-tree",render:zFe}),HFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WFe(e,t){return k(),L("svg",HFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m13.827 1.69l8.486 8.485l-1.415 1.414l-.707-.707l-4.242 4.243l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243l1.414-1.414l3.536-.707l4.242-4.243l-.707-.707zm.707 3.536l-4.67 4.67l-2.822.565l6.5 6.5l.564-2.822l4.671-4.67z"},null,-1)])])}const qFe=Et({name:"ri-pushpin-line",render:WFe}),UFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VFe(e,t){return k(),L("svg",UFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const KFe=Et({name:"ri-sort-desc",render:VFe}),ZFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GFe(e,t){return k(),L("svg",ZFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const QFe=Et({name:"ri-star-fill",render:GFe}),YFe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JFe(e,t){return k(),L("svg",YFe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const XFe=Et({name:"ri-star-line",render:JFe}),eBe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tBe(e,t){return k(),L("svg",eBe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const nBe=Et({name:"ri-tools-line",render:tBe}),iBe={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oBe(e,t){return k(),L("svg",iBe,[...t[0]||(t[0]=[A("path",{fill:"currentColor",d:"m20.97 17.172l-1.414 1.414l-3.535-3.535l-.073.074l-.707 3.536l-1.415 1.414l-4.242-4.243l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.243-4.243L5.34 8.761l3.536-.707l.073-.074l-3.536-3.536L6.828 3.03zM10.365 9.394l-.502.502l-2.822.565l6.5 6.5l.564-2.822l.502-.502zm8.411.074l-1.34 1.34l1.414 1.415l1.34-1.34l.707.707l1.415-1.415l-8.486-8.485l-1.414 1.414l.707.707l-1.34 1.34l1.414 1.415l1.34-1.34z"},null,-1)])])}const sBe=Et({name:"ri-unpin-line",render:oBe}),rBe=` -`,cBe=` +`,lBe=` -`,dBe=` +`,aBe=` -`,fBe=` +`,uBe=` -`,hBe=` +`,cBe=` -`,pBe=` +`,dBe=` -`,mBe=` +`,fBe=` -`,gBe=` +`,hBe=` -`,vBe=` +`,pBe=` -`,yBe=` +`,mBe=` -`,kBe=` +`,gBe=` -`,bBe=` +`,vBe=` -`,wBe=` +`,yBe=` -`,CBe=` +`,kBe=` -`,ABe=` +`,bBe=` -`,xBe=` +`,wBe=` -`,SBe=` +`,CBe=` -`,_Be=` +`,ABe=` -`,MBe=` +`,xBe=` -`,IBe=` +`,SBe=` -`,TBe=` +`,_Be=` -`,EBe=` +`,MBe=` -`,LBe=` +`,IBe=` -`,NBe=` +`,TBe=` -`,DBe=` +`,EBe=` -`,FBe=` +`,LBe=` -`,BBe=` +`,NBe=` -`,RBe=` +`,DBe=` -`,$Be=` +`,FBe=` -`,OBe=` +`,BBe=` -`,PBe=` +`,RBe=` @@ -515,27 +515,27 @@ ${v.comment}`:v.text},[A("span",{class:"quote-pill-icon","aria-hidden":"true",in -`,zBe=` +`,OBe=` -`,jBe=` +`,$Be=` -`,HBe=` +`,PBe=` -`,WBe=` +`,zBe=` -`,qBe=` +`,jBe=` @@ -548,98 +548,98 @@ ${v.comment}`:v.text},[A("span",{class:"quote-pill-icon","aria-hidden":"true",in -`,UBe=` +`,HBe=` -`,VBe=` +`,WBe=` -`,KBe=` +`,qBe=` -`,ZBe=` +`,UBe=` -`,GBe=` +`,VBe=` -`,QBe=` +`,KBe=` -`,YBe=` +`,ZBe=` -`,JBe=` +`,GBe=` -`,XBe=` +`,QBe=` -`,eRe=` +`,YBe=` -`,tRe=` +`,JBe=` -`,nRe=` +`,XBe=` -`,iRe=` +`,eRe=` -`,oRe=` +`,tRe=` -`,sRe=` +`,nRe=` -`,rRe=` +`,iRe=` -`,lRe=` +`,oRe=` -`,aRe=` +`,sRe=` -`,uRe=` +`,rRe=` -`,cRe=` +`,lRe=` -`,dRe='',fRe=` +`,aRe='',uRe=` -`,hRe=` +`,cRe=` -`,pRe=` +`,dRe=` -`,mRe=` +`,fRe=` -`,gRe=` +`,hRe=` @@ -647,29 +647,29 @@ ${v.comment}`:v.text},[A("span",{class:"quote-pill-icon","aria-hidden":"true",in -`,vRe=` +`,pRe=` -`,yRe=` +`,mRe=` -`,kRe=` +`,gRe=` -`,bRe=` +`,vRe=` -`,wRe=` +`,yRe=` -`,CRe='',ARe='',xRe='',SRe='',_Re='',MRe='',IRe='',TRe='',ERe='',LRe='',NRe='',DRe='',FRe='',BRe='',RRe='',$Re='',ORe='',PRe='',zRe='',jRe='',HRe='',WRe='',qRe='',URe='',VRe='',KRe='',ZRe='',GRe='',QRe='',YRe='',JRe='',XRe='',e$e={sm:14,md:16,lg:20};function Bt(e,t){return{component:e,svg:t}}const LV={plus:Bt(fTe,uBe),"chat-new":Bt(mTe,cBe),"calendar-close":Bt(XDe,FRe),"calendar-schedule":Bt(nFe,BRe),"calendar-todo":Bt(sFe,RRe),close:Bt(YTe,eU),check:Bt(DTe,Qq),"circle-check":Bt(UTe,kBe),"state-open":Bt(_De,SRe),"state-done":Bt(ADe,xRe),archive:Bt(yTe,dBe),search:Bt(vNe,sRe),copy:Bt(rEe,Gq),"text-wrap":Bt(jDe,ERe),"text-wrap-disabled":Bt(qDe,LRe),"list-numbers":Bt(KDe,NRe),link:Bt(TLe,UBe),"external-link":Bt(pFe,Yq),pip:Bt(ODe,TRe),download:Bt(fEe,xBe),undo:Bt(aDe,kRe),send:Bt(bNe,rRe),image:Bt(nLe,RBe),settings:Bt(ANe,lRe),sliders:Bt(BNe,dRe),"light-mode":Bt(_Le,qBe),"dark-mode":Bt(uEe,ABe),"follow-system":Bt(OEe,EBe),"log-in":Bt(TNe,uRe),"log-out":Bt(NNe,cRe),hand:Bt(QEe,FBe),"full-access":Bt(jEe,LBe),"shield-question":Bt(_Ne,aRe),"chevron-down":Bt(RTe,gBe),"chevron-right":Bt(PTe,vBe),"chevron-left":Bt(bDe,ARe),"chevron-up":Bt(HTe,yBe),"arrow-up":Bt(ETe,mBe),"arrow-down":Bt(wTe,fBe),"arrow-right":Bt(MTe,pBe),"arrow-left":Bt(xTe,hBe),minus:Bt(OLe,ZBe),microscope:Bt(jLe,GBe),flask:Bt(NDe,MRe),"panel-collapse":Bt(pLe,zBe),"panel-collapse-right":Bt(bLe,HBe),"panel-expand":Bt(vLe,jBe),"panel-expand-right":Bt(ALe,WBe),expand:Bt(yEe,SBe),collapse:Bt(eEe,wBe),list:Bt(NLe,VBe),"list-settings":Bt(jFe,VRe),"tree-view":Bt(qFe,KRe),sort:Bt(QFe,GRe),grip:Bt(KEe,DBe),"session-admin":Bt(vDe,CRe),folder:Bt(TEe,Kq),"folder-closed":Bt(_Ee,MBe),"folder-plus":Bt(BEe,TBe),"folder-solid":Bt(NFe,WRe),file:Bt(UF,aA),"file-text":Bt(AEe,_Be),"file-edit":Bt(mEe,Xq),"file-plus":Bt(AFe,jRe),"file-off":Bt(UF,aA),attachment:Bt(BDe,IRe),"image-off":Bt(sLe,$Be),eye:Bt(vFe,PRe),"eye-off":Bt(bFe,zRe),code:Bt(aFe,$Re),terminal:Bt(KNe,pRe),"device-desktop":Bt(TDe,_Re),pencil:Bt(nNe,eRe),tool:Bt(sBe,JRe),glob:Bt(QDe,DRe),globe:Bt(qEe,NBe),translate:Bt(nDe,vRe),"check-list":Bt(XNe,gRe),bolt:Bt(_Fe,HRe),sparkling:Bt(TFe,Zq),keyboard:Bt(dLe,PBe),trash:Bt(sDe,yRe),"git-fork":Bt(BFe,qRe),"git-pull-request":Bt(OFe,URe),message:Bt(iEe,CBe),mail:Bt(BLe,KBe),user:Bt(dDe,bRe),info:Bt(aLe,OBe),"help-circle":Bt(dNe,iRe),"alert-triangle":Bt(pDe,wRe),clock:Bt(ZTe,bBe),robot:Bt(pNe,oRe),sparkles:Bt(qNe,hRe),"gen-title":Bt(NEe,IBe),histogram:Bt(XEe,BBe),music:Bt(QLe,JBe),emoji:Bt(dFe,ORe),target:Bt(jNe,Jq),pause:Bt(XLe,XBe),play:Bt(sNe,tRe),power:Bt(aNe,nRe),pin:Bt(KFe,ZRe),stop:Bt(ONe,fRe),star:Bt(XFe,QRe),"star-outline":Bt(nBe,YRe),unpin:Bt(aBe,XRe),"dots-horizontal":Bt(KLe,YBe),model:Bt(qLe,QBe),thinking:Bt(QNe,mRe)};function t$e(e){return LV[e]}function n$e(e,t){return e.replace(/]*>/,n=>n.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^',``,g.value].join(""):"");function X(se){const fe=[];let G="",ae=!1;for(let K=0;Ky.value.slice(0,200).map(X));function ue(se,fe=55){return!se||se.length<=fe?se:"…"+se.slice(se.length-fe+1)}return(se,fe)=>(k(),L("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(k(),L("div",Q$e,[A("span",null,F(e.error),1),e.closable?(k(),de(p(sn),{key:0,variant:"secondary",size:"sm",onClick:fe[0]||(fe[0]=G=>c("close"))},{default:ce(()=>[$e(F(p(n)("filePreview.close")),1)]),_:1})):ee("",!0)])):!e.file&&!e.loading?(k(),L("div",Y$e,F(p(n)("filePreview.empty")),1)):e.loading?(k(),L("div",J$e,[fe[7]||(fe[7]=A("span",{class:"spinner"},null,-1)),A("span",null,F(p(n)("filePreview.loading")),1)])):e.file?(k(),L(De,{key:3},[U(p(_1),{wrap:"",title:p(n)("common.preview"),closable:e.closable,"close-label":p(n)("filePreview.close"),onClose:fe[6]||(fe[6]=G=>c("close"))},{default:ce(()=>[U(p(Nn),{text:e.file.path},{default:ce(()=>[A("span",X$e,F(ue(e.file.path)),1)]),_:1},8,["text"]),A("span",eOe,[e.file.lineCount?(k(),L("span",tOe,F(p(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ee("",!0),A("span",nOe,F(M(e.file.size)),1)]),h.value==="html"?(k(),de(p(Ms),{key:0,"model-value":B.value,size:"sm",options:[{value:"preview",label:p(n)("filePreview.preview")},{value:"source",label:p(n)("filePreview.source")}],"onUpdate:modelValue":j},null,8,["model-value","options"])):ee("",!0),h.value==="markdown"?(k(),de(p(Ms),{key:1,"model-value":P.value,size:"sm",options:[{value:"preview",label:p(n)("filePreview.preview")},{value:"source",label:p(n)("filePreview.source")}],"onUpdate:modelValue":Z},null,8,["model-value","options"])):ee("",!0),h.value==="image"?(k(),de(p(Ms),{key:2,"model-value":H.value,size:"sm",options:[{value:"fit",label:p(n)("filePreview.fit")},{value:"actual",label:p(n)("filePreview.actual")}],"onUpdate:modelValue":ie},null,8,["model-value","options"])):ee("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(k(),L("div",iOe,[ai(A("input",{"onUpdate:modelValue":fe[1]||(fe[1]=G=>N.value=G),class:"fp-search-input",type:"search",placeholder:p(n)("filePreview.search")},null,8,oOe),[[ur,N.value]]),N.value.trim()?(k(),L("span",sOe,F(S.value.length),1)):ee("",!0),U(p(ln),{size:"sm",disabled:S.value.length===0,label:p(n)("filePreview.prevMatch"),tooltip:p(n)("filePreview.prevMatch"),onClick:fe[2]||(fe[2]=G=>x(-1))},{default:ce(()=>[U(p(Ce),{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label","tooltip"]),U(p(ln),{size:"sm",disabled:S.value.length===0,label:p(n)("filePreview.nextMatch"),tooltip:p(n)("filePreview.nextMatch"),onClick:fe[3]||(fe[3]=G=>x(1))},{default:ce(()=>[U(p(Ce),{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label","tooltip"])])):ee("",!0),U(p(ln),{size:"sm",class:Re({copied:q.value}),label:q.value?p(n)("filePreview.copied"):p(n)("filePreview.copyPath"),tooltip:q.value?p(n)("filePreview.copied"):p(n)("filePreview.copyPath"),onClick:O},{default:ce(()=>[q.value?(k(),de(p(Ce),{key:1,class:"fp-check",name:"check",size:"md"})):(k(),de(p(Ce),{key:0,name:"link",size:"md"}))]),_:1},8,["class","label","tooltip"]),e.externalActions?(k(),de(p(ln),{key:4,size:"sm",label:p(n)("filePreview.openInEditor"),tooltip:p(n)("filePreview.openInEditor"),onClick:fe[4]||(fe[4]=G=>c("openExternal"))},{default:ce(()=>[U(p(Ce),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.externalActions?(k(),de(p(ln),{key:5,size:"sm",label:p(n)("filePreview.reveal"),tooltip:p(n)("filePreview.reveal"),onClick:fe[5]||(fe[5]=G=>c("reveal"))},{default:ce(()=>[U(p(Ce),{name:"folder",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.downloadUrl?(k(),de(p(Nn),{key:6,text:p(n)("filePreview.download")},{default:ce(()=>[A("a",{class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":p(n)("filePreview.download")},[U(p(Ce),{name:"download",size:"md"})],8,rOe)]),_:1},8,["text"])):ee("",!0),!e.file.isBinary&&h.value!=="image"?(k(),de(p(ln),{key:7,size:"sm",class:Re({copied:R.value}),label:R.value?p(n)("filePreview.copied"):p(n)("filePreview.copy"),tooltip:R.value?p(n)("filePreview.copied"):p(n)("filePreview.copy"),onClick:z},{default:ce(()=>[R.value?(k(),de(p(Ce),{key:1,class:"fp-check",name:"check",size:"md"})):(k(),de(p(Ce),{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label","tooltip"])):ee("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(k(),L("div",{key:0,class:Re(["fp-body",{"fp-markdown":P.value==="preview"}]),"data-quote-display-lines":P.value==="preview"||void 0},[P.value==="preview"?(k(),de(p(Sc),{key:e.file?.path,text:g.value,"open-file":u.openFile?d:void 0,"resolve-mention-path":l},null,8,["text","open-file"])):(k(),L("div",aOe,[U(Pa,{code:y.value,path:T.value,"line-numbers":C.value,framed:!1,"line-class":E},null,8,["code","path","line-numbers"])]))],10,lOe)):h.value==="json"?(k(),L("div",{key:1,class:"fp-body fp-code","data-quote-display-lines":w.value||void 0},[U(Pa,{code:y.value,path:T.value,"line-numbers":C.value,framed:!1,"line-class":E},null,8,["code","path","line-numbers"])],8,uOe)):h.value==="html"?(k(),L("div",cOe,[B.value==="preview"?(k(),L("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:te.value,title:e.file.path},null,8,dOe)):(k(),L("div",fOe,[U(Pa,{code:y.value,path:T.value,"line-numbers":C.value,framed:!1,"line-class":E},null,8,["code","path","line-numbers"])]))])):h.value==="pdf"?(k(),L("div",hOe,[Q.value?(k(),L("iframe",{key:0,class:"fp-pdf-frame",src:Q.value,title:e.file.path},null,8,pOe)):(k(),L("div",mOe,[A("span",gOe,F(p(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(k(),L("div",vOe,[A("table",yOe,[A("tbody",null,[(k(!0),L(De,null,Ct(ge.value,(G,ae)=>(k(),L("tr",{key:ae,class:Re(E(ae+1)),"data-line":ae+1},[A("th",null,F(ae+1),1),(k(!0),L(De,null,Ct(G,(K,re)=>(k(),L("td",{key:re},F(K),1))),128))],10,kOe))),128))])])])):h.value==="image"?(k(),L("div",bOe,[W.value?(k(),L("img",{key:0,src:W.value,alt:e.file.path,class:Re(["fp-image",{actual:H.value==="actual"}])},null,10,wOe)):(k(),L("div",COe,[A("span",AOe,[U(p(Ce),{name:"image-off",size:"lg"})]),A("span",xOe,F(p(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):h.value==="text"?(k(),L("div",SOe,[U(Pa,{code:y.value,path:T.value,"line-numbers":C.value,framed:!1,"line-class":E},null,8,["code","path","line-numbers"])])):(k(),L("div",_Oe,[A("div",MOe,[A("span",IOe,[U(p(Ce),{name:"file-off",size:"lg"})]),A("span",TOe,F(p(n)("filePreview.binaryNoPreview",{mime:e.file.mime||p(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):ee("",!0)],512))}}),LOe=xt(EOe,[["__scopeId","data-v-91fc26fa"]]),NOe=["aria-label"],DOe={class:"gload-box"},FOe={class:"gload-text"},BOe=lt({__name:"GlobalLoading",setup(e){const{t}=qt();return(n,i)=>(k(),L("div",{class:"gload",role:"status","aria-label":p(t)("app.connecting")},[A("div",DOe,[i[0]||(i[0]=Qd('',1)),U(p(mo),{size:"md",label:p(t)("app.connecting")},null,8,["label"]),A("div",FOe,F(p(t)("app.connecting")),1)])],8,NOe))}}),ROe=xt(BOe,[["__scopeId","data-v-c183e202"]]),$Oe="/assets/k3_doodle1-27EZ2HSw.riv",OOe={class:"doodle-host"},POe={key:0,class:"doodle-fallback"},zOe=lt({__name:"KimiDoodle",setup(e){const t=V(!1),n=V(null),i=Yk();let o=null,s=null;return yn(async()=>{if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches)try{let r=function(){const g=f.stateMachineNames[0];if(!g)return;const v=(f.stateMachineInputs(g)??[]).find(y=>y.name==="light/dark");v&&(v.value=i.value?1:0)};const[{Rive:l,RuntimeLoader:a},u,c]=await Promise.all([Yo(()=>import("./rive-CeXCFBdn.js").then(g=>g.r),__vite__mapDeps([8,3])),Yo(()=>import("./rive-BxcgqsjB.js"),[]).then(g=>g.default),Yo(()=>import("./rive_fallback-ByshBW-N.js"),[]).then(g=>g.default)]),d=n.value;if(!d)return;a.setWasmUrl(u),a.setWasmFallbackUrl(c);const f=new l({canvas:d,src:$Oe,autoplay:!0,onLoad(){const g=f.stateMachineNames[0];g&&f.play(g),requestAnimationFrame(()=>{n.value&&(r(),f.resizeDrawingSurfaceToCanvas(),s=aP(f,d),t.value=!0)})}}),h=We(i,r),m=()=>f.resizeDrawingSurfaceToCanvas();window.addEventListener("resize",m),o=()=>{s?.(),s=null,h(),window.removeEventListener("resize",m),f.cleanup()}}catch{}}),ti(()=>{o?.(),o=null}),(r,l)=>(k(),L("div",OOe,[t.value?ee("",!0):(k(),L("div",POe,[Un(r.$slots,"fallback",{},void 0,!0)])),A("canvas",{ref_key:"canvasRef",ref:n,class:Re(["doodle-canvas",{ready:t.value}]),role:"img","aria-label":"Kimi"},null,2)]))}}),jOe=xt(zOe,[["__scopeId","data-v-8004c140"]]),HOe="/assets/kimi_avatar_default-srYjF2HV.riv",WOe={key:0,class:"mascot-fallback",viewBox:"5 0 240.776 240.776","aria-hidden":"true"},qOe="light/dark",UOe="click_avator",VOe="hoverspace",KOe=lt({__name:"KimiMascot",setup(e){const t=V(!1),n=V(null),i=Yk();let o=null,s=null,r=null;function l(){o!==null&&hI(o,qOe,i.value?1:0)}yn(async()=>{if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches)try{const[{Rive:c,RuntimeLoader:d},f,h]=await Promise.all([Yo(()=>import("./rive-CeXCFBdn.js").then(b=>b.r),__vite__mapDeps([8,3])),Yo(()=>import("./rive-BxcgqsjB.js"),[]).then(b=>b.default),Yo(()=>import("./rive_fallback-ByshBW-N.js"),[]).then(b=>b.default)]),m=n.value;if(!m)return;d.setWasmUrl(f),d.setWasmFallbackUrl(h);const g=new c({canvas:m,src:HOe,autoplay:!0,onLoad(){const b=g.stateMachineNames[0];b!==void 0&&g.play(b),requestAnimationFrame(()=>{n.value&&(l(),g.resizeDrawingSurfaceToCanvas(),r=aP(g,m),t.value=!0)})}});o=g;const v=We(i,l),y=()=>g.resizeDrawingSurfaceToCanvas();window.addEventListener("resize",y),s=()=>{r?.(),r=null,v(),window.removeEventListener("resize",y),g.cleanup(),o=null}}catch{}}),ti(()=>{s?.(),s=null});function a(c){o!==null&&hI(o,VOe,c)}function u(){o!==null&&Fse(o,UOe)}return(c,d)=>(k(),L("div",{class:"mascot-host",role:"img","aria-label":"Kimi mascot",onPointerenter:d[0]||(d[0]=f=>a(!0)),onPointerleave:d[1]||(d[1]=f=>a(!1)),onClick:u},[t.value?ee("",!0):(k(),L("svg",WOe,[...d[2]||(d[2]=[Qd('',3)])])),A("canvas",{ref_key:"canvasRef",ref:n,class:Re(["mascot-canvas",{ready:t.value}])},null,2)],32))}}),ZOe=xt(KOe,[["__scopeId","data-v-69623d48"]]),GOe=640,QOe=`(max-width: ${GOe}px)`;function Ec(){const e=V(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(QOe);e.value=t.matches;const n=i=>{e.value=i.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Ln(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Ln(()=>t.removeListener(n))),e}const KV=V(typeof window>"u"?0:window.innerWidth);let hy=0,F4=!1;function LA(){KV.value=window.innerWidth}function YOe(){F4||typeof window>"u"||(window.addEventListener("resize",LA),F4=!0,LA())}function JOe(){!F4||typeof window>"u"||(window.removeEventListener("resize",LA),F4=!1)}function ZV(e,t,n){return Math.max(t,e-n)}function NA(e,t,n){return Math.min(n,Math.max(t,e))}function GV(){return yn(()=>{hy+=1,YOe()}),ti(()=>{hy=Math.max(0,hy-1),hy===0&&JOe()}),{viewportWidth:KV}}const XOe=24;function ePe(e){const t=V(null),n=V(!0);let i=null,o=null,s=null,r=0,l=0,a=!1,u=0;function c(){const y=t.value;y&&(y.scrollTop=Math.max(y.scrollTop,r))}function d(){const b=t.value?.firstElementChild??null;b!==s&&(s&&i?.unobserve(s),s=b,b&&i?.observe(b))}function f(){const y=t.value;!y||a||(n.value=r-y.scrollTop-lh(y));return}requestAnimationFrame(()=>{requestAnimationFrame(()=>h(y))})}function g(){n.value=!0,c()}function v(){const y=t.value;y&&(i?.disconnect(),o?.disconnect(),s=null,a=!1,u++,r=0,l=0,typeof ResizeObserver=="function"?(i=new ResizeObserver(()=>{const b=t.value;if(!b)return;const{scrollHeight:w,clientHeight:C}=b,T=w>r+1,N=C{n.value=!0,ht(v)}),We(t,()=>void ht(v)),yn(()=>void ht(v)),Ln(()=>{u++,i?.disconnect(),o?.disconnect()}),{scroller:t,following:n,onScroll:f,pinScroll:m,jumpToBottom:g}}function tPe(e){try{const t=ms(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function nPe(e,t){try{fs(e,String(t))}catch{}}function QV(e){const{storageKey:t,defaultWidth:n,min:i,max:o,reverse:s=!1,axis:r="x",applyLive:l,persist:a}=e;function u(R){return Number.isFinite(R)?Math.min(Ea(o),Math.max(Ea(i),Math.round(R))):n}const c=V(u(tPe(t)??n)),d=V(!1);function f(R){const q=R<=Ea(i),z=R>=Ea(o),O=r==="x"?"col-resize":"row-resize";if(q&&z)return O;const[B,P]=r==="x"?["e-resize","w-resize"]:["s-resize","n-resize"];return z?s?B:P:q?s?P:B:O}const h=V(null),m=D(()=>f(h.value??c.value));function g(R){typeof document>"u"||(document.body.style.cursor=f(R))}function v(R){a&&!a()||nPe(t,R)}function y(R){const q=u(R);c.value=q,v(q)}We(()=>Ea(o),R=>{!d.value&&c.value>R&&y(R)}),We(()=>Ea(i),R=>{!d.value&&c.valuet.value!==null&&(n.value||i.value||o.value||s.value));function l(){const v=e.value;if(!v){t.value=null;return}const y=iPe(v.scrollTop,v.scrollHeight,v.clientHeight,m5(v,"--overlay-scrollbar-track-inset",0),m5(v,"--overlay-scrollbar-thumb-min",24)),b=y===null?null:{top:v.offsetTop+y.top,height:y.height},w=t.value;w!==null&&b!==null&&w.top===b.top&&w.height===b.height||(t.value=b)}let a=null;function u(){o.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{o.value=!1,a=null},oPe)}let c=null;function d(v){const y=e.value,b=t.value;if(!y||!b)return;v.preventDefault(),c?.();const w=v.pointerId;v.target.setPointerCapture?.(v.pointerId);const C=m5(y,"--overlay-scrollbar-track-inset",0),T=y.clientHeight-C*2-b.height,N=y.scrollHeight-y.clientHeight,I=v.clientY,S=y.scrollTop;s.value=!0;const _=M=>{M.pointerId!==w||T<=0||(y.scrollTop=S+(M.clientY-I)/T*N)},x=M=>{M.pointerId===w&&E()},E=()=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointermove",_),window.removeEventListener("pointercancel",x),s.value=!1,c===E&&(c=null)};c=E,window.addEventListener("pointermove",_),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)}function f(){n.value=!0}function h(){n.value=!1}function m(){i.value=!0}function g(){i.value=!1}return ti(()=>{a&&clearTimeout(a),c?.()}),{thumb:t,thumbVisible:r,scrolling:o,update:l,markScrolling:u,onThumbPointerDown:d,onListMouseEnter:f,onListMouseLeave:h,onThumbMouseEnter:m,onThumbMouseLeave:g}}const Ra=V(null),h1=V(!1),sPe=D(()=>Ra.value!==null);function Hx(e){const t=Ra.value;!t||h1.value||(Ra.value=null,t.resolve(e))}async function rPe(){const e=Ra.value;if(!(!e||h1.value)){if(!e.action){Hx(!0);return}h1.value=!0;try{await e.action(),Ra.value===e&&(Ra.value=null),e.resolve(!0)}catch(t){Ra.value===e&&(Ra.value=null),e.reject(t)}finally{h1.value=!1}}}function lPe(e){return h1.value?Promise.resolve(!1):(Ra.value&&Hx(!1),new Promise((t,n)=>{Ra.value={...e,resolve:t,reject:n}}))}function cf(){return{current:Ra,busy:h1,isConfirmOpen:sPe,confirm:lPe,settle:Hx,runAction:rPe}}function aPe(e){const{sessionId:t}=e;function n(f){return ms(KI(f))??""}function i(f,h){const m=KI(f);h?fs(m,h):Sr(m)}function o(f){const h=Ic(GI(f));if(!Array.isArray(h))return[];const m=[];for(const g of h){if(typeof g!="object"||g===null)continue;const v=g;if(typeof v.attId!="string"||typeof v.key!="string"||typeof v.name!="string"||v.kind!=="file"&&v.kind!=="folder"&&v.kind!=="image"&&v.kind!=="video")continue;const y=v.uploading===!0;m.push({attId:v.attId,key:v.key,kind:v.kind,name:v.name,size:typeof v.size=="number"?v.size:void 0,mediaType:typeof v.mediaType=="string"?v.mediaType:void 0,lastModified:typeof v.lastModified=="number"?v.lastModified:void 0,path:typeof v.path=="string"?v.path:void 0,refCount:typeof v.refCount=="number"?v.refCount:0,uploading:!1,fileId:typeof v.fileId=="string"?v.fileId:void 0,sessionId:typeof v.sessionId=="string"?v.sessionId:void 0,error:typeof v.error=="string"?v.error:y?"upload-interrupted":void 0})}return m}let s=null;function r(f,h){const m=GI(f);if(h.length===0){s=null,Sr(m);return}const g=h.map(yU),v=JSON.stringify(g);s?.key===m&&s.json===v||(s={key:m,json:v},Tc(m,g))}const l=V(n(t())),a=V(null);We(l,f=>{i(t(),f)}),We(t,(f,h)=>{f!==h&&(e.onBeforeSessionSave?.(h),i(h,l.value),l.value=n(f))});function u(f){c(f)}function c(f){l.value=f,ht(()=>{const h=a.value;if(!h)return;h.focus();const m=f.length;h.setSelectionRange(m,m)})}function d(){i(t(),"")}return{text:l,editorRef:a,loadForEdit:u,clearDraft:d,loadDraftAttachments:o,saveDraftAttachments:r,saveDraft:i}}function uPe(e){return e?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable===!0:!1}function cPe(e){const{sessionId:t,mobile:n,starting:i,dockedComposer:o,emptyComposer:s}=e,r=V(!1);We(t,()=>{n()||(r.value=!0)}),We([r,o,s,i],()=>{if(!r.value)return;const l=o.value??s.value;if(!l)return;const a=typeof document<"u"?document.activeElement:null;if(uPe(a)){r.value=!1;return}l.focus(),(typeof document>"u"||document.activeElement!==a)&&(r.value=!1)},{flush:"post"})}const B4=100;function dPe(e){const t=Ic(Cn.inputHistory);if(Array.isArray(t)){const n=t.filter(s=>typeof s=="string"&&s.length>0);if(!e||n.length===0)return{};const i=n.length>B4?n.slice(-B4):n,o={[e]:i};return Tc(Cn.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function fPe(e){const{text:t,editorRef:n,sessionId:i}=e,o=V(dPe(i())),s=D(()=>o.value[i()??""]??[]);let r=-1,l="";function a(y){const b=i();if(r=-1,!b)return;const w=y.trim();if(!w)return;const C=o.value[b]??[];if(C.at(-1)===w)return;const T=[...C,w],N=T.length>B4?T.slice(-B4):T;o.value={...o.value,[b]:N},Tc(Cn.inputHistory,o.value)}function u(){return t.value.length===0}function c(){return s.value.length>0&&(r!==-1||u())}function d(y){t.value=y,ht(()=>{const b=n.value;if(!b)return;const w=y.length;b.setSelectionRange(w,w)})}function f(){const y=s.value;if(y.length!==0){if(r===-1)l=t.value,r=y.length-1;else if(r>0)r-=1;else return;d(y[r])}}function h(){if(r===-1)return;const y=s.value;r0}return We(i,()=>{r!==-1&&(r=-1,d(l))}),{push:a,canRecallOlder:c,recallOlder:f,recallNewer:h,resetBrowsing:m,isBrowsing:g,hasHistory:v}}function hPe(e){const{text:t,editorRef:n,skills:i,emitCommand:o,historyPush:s,clearDraft:r,resolveDesc:l}=e,a=V(!1),u=V([]),c=V([]),d=V(0);function f(){const m=t.value;if(/^\/\S*$/.test(m)){const g=Qle(m,MP(i()),l);u.value=g.map(v=>v.item),c.value=g.map(v=>v.ranges),d.value=0,a.value=!0}else a.value=!1}function h(m){if(a.value=!1,m.acceptsInput){t.value=`${m.name} `,ht(()=>{const g=n.value;if(!g)return;const v=t.value.length;g.setSelectionRange(v,v),g.focus()});return}t.value="",r?.(),s(m.name),o(m.name)}return{open:a,items:u,ranges:c,active:d,update:f,select:h}}function pPe(e){const t=e.toLowerCase(),n=[];let i=0;for(const o of e){const s=o.toLowerCase().length;for(let r=0;r=3&&JV(e,t)!==null?1:0}function rB(e,t){const n=t.toLowerCase(),i=[];for(const o of e){const{lower:s,map:r}=pPe(o.name),l=mPe(s,n);if(l===0)continue;const a=l>=2?Array.from({length:n.length},(u,c)=>s.indexOf(n)+c):JV(s,n);i.push({skill:o,tier:l,positions:a.map(u=>r[u])})}return i}function gPe(e,t){return t.includes("/")?!0:e.name.toLowerCase().includes(t)}function lB(e){return e.kind==="directory"||e.path.endsWith("/")?"folder":"file"}function vPe(e){const{text:t,editorRef:n,searchFiles:i,skills:o,insertMention:s}=e,r=V(!1),l=V([]),a=V(""),u=V(!1),c=V([]),d=V(0),f=V(!1),h=D(()=>{const z=a.value,O=[],B=[];for(const ie of l.value){const W={kind:lB(ie),file:ie};(gPe(ie,z)?O:B).push(W)}const P=[],H=[],j=[],Z=[];for(const{skill:ie,tier:W,positions:Q}of c.value){const te={kind:"skill",skill:ie,matchPositions:Q};W===4?P.push(te):W===3?H.push(te):W===2?j.push(te):Z.push(te)}return[...P,...H,...O,...j,...Z,...B]});let m=0,g=null,v=!1;function y(){const z=t.value,O=n.value?.selectionStart??z.length,B=n.value?.inlineTextRunStart?.()??0;let P=O-1;for(;P>=B&&!/\s/.test(z[P]);)P--;P++,P=Math.max(P,B);const H=z.slice(P,O);return!H.startsWith("@")&&!H.startsWith("@")?null:{token:H.slice(1),start:P,end:O}}function b(z){return z.kind==="skill"?`skill:${z.skill.name}`:`${z.kind}:${z.file.path}`}let w=!1,C=!1;We(d,()=>{C||(w=!0)},{flush:"sync"});function T(z){C=!0,d.value=z,C=!1}function N(z){w=!0,T(z)}function I(z){if(z===null||!w){T(0);return}const O=h.value.findIndex(B=>b(B)===z);T(O===-1?0:O)}function S(z,O){const B=h.value[d.value],P=B?b(B):null;u.value=!1,a.value=O.toLowerCase(),l.value=z,I(P)}async function _(z,O){const B=++m,P=performance.now();f.value=!0,r.value=!0;const H=()=>{const j=y();return B===m&&j!==null&&j.token===O&&r.value};try{const j=await z(O);H()&&S(j,O)}catch{H()&&S([],O)}finally{H()&&(console.debug(`[mention] search "${O}" → ${l.value.length} items in ${Math.round(performance.now()-P)}ms`),f.value=!1)}}function x(){const z=y(),O=i();if(v=!1,w=!1,!z){g=null,r.value=!1,f.value=!1,u.value=!1;return}const B=z.token;if(B!==g&&(l.value.length>0&&(u.value=!0),m+=1),g=B,c.value=B.length>0?rB(o?.()??[],B):[],T(0),!O){l.value=[],f.value=!1,u.value=!1,r.value=c.value.length>0;return}if(B.length===0){_(O,B);return}c.value.length>0&&(r.value=!0),_(O,B)}function E(){const z=y();if(!z)return;const O=h.value[d.value],B=O?b(O):null;c.value=z.token.length>0?rB(o?.()??[],z.token):[],I(B)}We(()=>o?.(),()=>{v||E()});function M(z){if(z.kind==="skill")return{kind:"skill",name:z.skill.name};const O=z.file.path;return{kind:lB(z.file),path:O,name:z.file.name||O.split("/").filter(Boolean).pop()||O}}function R(){v=!0,w=!1,r.value=!1,f.value=!1,u.value=!1,l.value=[],g=null,m+=1}function q(z){const O=y();if(!O||z.kind!=="skill"&&u.value)return;if(R(),s){s(M(z),{start:O.start,end:O.end});return}if(z.kind==="skill")return;const B=t.value;t.value=B.slice(0,O.start)+z.file.path+B.slice(O.end),ht(()=>{const P=n.value;if(!P)return;const H=O.start+z.file.path.length;P.setSelectionRange(H,H),P.focus()})}return{open:r,items:h,fileItems:l,fileStale:u,skillItems:c,active:d,loading:f,update:x,close:R,select:q,navigate:N,getToken:y}}const p1=po(new Map);function aB(e){return e.split(/[\\/]+/).filter(Boolean).at(-1)??e}const Dp={diff:{type:"diff",policy:"singleton",title:(e,t)=>t("panel.tabs.diff"),icon:"git-fork",i18nKey:"panel.tabs.diff",restorable:!1},file:{type:"file",policy:"keyed",keyOf:e=>e.path,title:e=>aB(e.path),icon:"file-text",i18nKey:"panel.tabs.file",restorable:!1},agent:{type:"agent",policy:"keyed",keyOf:e=>e.subagentId,title:(e,t)=>t("panel.tabs.agent"),icon:"robot",i18nKey:"panel.tabs.agent",restorable:!0},"turn-diff":{type:"turn-diff",policy:"singleton",title:e=>aB(e.change.path),icon:"file-edit",i18nKey:"panel.tabs.turnDiff",restorable:!1},compaction:{type:"compaction",policy:"keyed",keyOf:e=>e.turnId,title:(e,t)=>t("panel.tabs.compaction"),icon:"list",i18nKey:"panel.tabs.compaction",restorable:!0},btw:{type:"btw",policy:"always",title:(e,t)=>{const n=e.seq;return n===1?t("sideChat.title"):`${t("sideChat.title")} ${n}`},icon:"message",i18nKey:"sideChat.title",restorable:!0},term:{type:"term",policy:"always",title:(e,t)=>e?.title??t("panel.tabs.term"),icon:"terminal",i18nKey:"panel.tabs.term",restorable:!1}},yPe="kimi-web.file-preview-width",zf=320;function kPe({client:e,sideWidth:t,t:n,locale:i,onTabRemoved:o}){const{viewportWidth:s}=GV(),r=D(()=>Math.max(0,s.value-t.value)),l=D(()=>ZV(r.value,zf,zf));function a(Te){return NA(Math.round(Te),zf,l.value)}function u(){return a(r.value/2)}const c=D(()=>u()),d=V(zf),f=D(()=>NA(d.value,zf,l.value)),h=V(!1),m=Ka([]),g=V(null),v=V(!1),y=V(!1),b=V(0),w=D(()=>m.value.find(Te=>Te.id===g.value)??null),C=new Set(["agent","diff","turn-diff","compaction","btw","term"]);i!==void 0&&We(i,()=>{m.value=m.value.map(Te=>C.has(Te.type)?{...Te,title:x(Te.type,Te.payload)}:Te)});let T=0;function N(){return T+=1,`panel-tab-${T}`}function I(Te){const Fe=Dp[Te.type];return Fe.keyOf&&Te.payload!==void 0?Fe.keyOf(Te.payload):null}function S(Te,Fe){const Ke={id:N(),type:Te,title:x(Te,Fe),payload:Fe};return m.value=[...m.value,Ke],Ke}function _(Te){return e.activeAppTasks.value.find(Ke=>Ke.agentId===Te||Ke.id===Te||Ke.backgroundTaskId===Te)?.description||void 0}function x(Te,Fe){if(Te==="agent"&&Fe!==void 0){const Ke=Fe.subagentId,rt=ge(Ke).name??_(Ke);if(rt)return rt}return Dp[Te].title(Fe,n)}let E=null;function M(Te){const Fe=e.activeAppTasks.value.find(Ke=>Ke.agentId===Te||Ke.id===Te||Ke.backgroundTaskId===Te);return!Fe||Fe.kind==="subagent"&&Fe.agentId===Te}function R(Te){return e.activeAppTasks.value.find(Ke=>Ke.agentId===Te||Ke.id===Te||Ke.backgroundTaskId===Te)?.agentId??Te}function q(){const Te=w.value,Fe=v.value&&Te?.type==="agent"&&Te.payload!==void 0?Te.payload:null;E!==null&&Fe!==null&&E.sessionId===Fe.sessionId&&E.subagentId===Fe.subagentId&&E!==null&&M(E.subagentId)||(E&&(e.auxiliaryTranscripts.deactivate(E.sessionId,E.subagentId),E=null),Fe&&M(Fe.subagentId)&&(e.auxiliaryTranscripts.activate(Fe.sessionId,Fe.subagentId),E={sessionId:Fe.sessionId,subagentId:Fe.subagentId}))}We(()=>e.activeAppTasks.value,Te=>{let Fe=!1,Ke=!1,Nt=m.value.map(Lt=>{if(Lt.type!=="agent"||Lt.payload===void 0)return Lt;const Qt=Lt.payload,Ut=Te.find(dt=>dt.backgroundTaskId===Qt.subagentId&&dt.agentId!==void 0),en=Ut&&Ut.agentId!==Qt.subagentId?{...Qt,subagentId:Ut.agentId}:Qt;en!==Qt&&(Fe=!0);const it=x("agent",en);return en===Qt&&it===Lt.title?Lt:(Ke=!0,{...Lt,payload:en,title:it})});if(Fe){const Lt=new Map;for(const Ut of Nt){if(Ut.type!=="agent")continue;const en=I(Ut);if(en===null)continue;const it=Lt.get(en);it?it.push(Ut):Lt.set(en,[Ut])}const Qt=new Set;for(const Ut of Lt.values()){if(Ut.length<2)continue;const en=Ut.find(it=>it.id===g.value)??Ut[0];for(const it of Ut)it.id!==en.id&&Qt.add(it.id)}Qt.size>0&&(Nt=Nt.filter(Ut=>!Qt.has(Ut.id)),Ke=!0)}Ke&&(m.value=Nt),q()});function z(Te,Fe){const Ke=Dp[Te];let rt;if(Ke.policy==="singleton")rt=m.value.find(Nt=>Nt.type===Te);else if(Ke.policy==="keyed"&&Fe!==void 0){const Nt=Ke.keyOf(Fe);rt=m.value.find(Lt=>Lt.type===Te&&I(Lt)===Nt)}if(rt){if(Fe!==void 0&&rt.payload!==Fe){const Nt={...rt,title:x(Te,Fe),payload:Fe};m.value=m.value.map(Lt=>Lt.id===Nt.id?Nt:Lt),rt=Nt}}else rt=S(Te,Fe);return O(rt.id),rt}function O(Te){m.value.some(Fe=>Fe.id===Te)&&(g.value=Te,v.value=!0,b.value+=1,q())}function B(Te,Fe){const Ke=S(Te,Fe);return g.value===null&&(g.value=Ke.id,v.value=!1),Ke}function P(Te){const Fe=m.value.findIndex(rt=>rt.id===Te);if(Fe===-1)return;const Ke=m.value[Fe];if(Ke.type==="btw"&&Ke.payload!==void 0?e.closeSideChat(Ke.payload.agentId):Ke.type==="diff"&&(Ae(),e.clearFileDiff()),m.value=m.value.filter(rt=>rt.id!==Te),g.value===Te){const rt=m.value[Math.min(Fe,m.value.length-1)];g.value=rt?.id??null}m.value.length===0&&(v.value=!1,y.value=!1),b.value+=1,o?.(Ke),q()}function H(){return v.value?(v.value=!1,y.value=!1,b.value+=1,q(),!0):!1}function j(){v.value=!0,b.value+=1,q()}function Z(){g.value!==null&&(y.value=!y.value,y.value&&(v.value=!0),b.value+=1)}function ie(){y.value=!1,b.value+=1}function W(){b.value+=1}function Q(Te){const Fe=e.turns.value.find(Ke=>Ke.id===Te);return Fe?.role==="compaction"&&Fe.text?Fe.text:null}function te(Te){z("compaction",{turnId:Te.turnId})}function X(Te){const Fe=e.auxiliaryTranscripts.getEntry(Te.sessionId,Te.subagentId);return{entry:Fe,version:Fe?.version.value??0}}function ge(Te){const Fe=e.turns.value.flatMap(Ke=>Ke.tools??[]).find(Ke=>Ke.agentId===Te);if(!Fe)return{};try{const Ke=JSON.parse(Fe.arg);return{name:typeof Ke.description=="string"?Ke.description:void 0,subagentType:typeof Ke.subagent_type=="string"?Ke.subagent_type:void 0,prompt:typeof Ke.prompt=="string"?Ke.prompt:void 0,model:typeof Ke.model=="string"?Ke.model:void 0,thinking:typeof Ke.thinking=="string"?Ke.thinking:void 0,status:Fe.status,outputLines:Fe.output}}catch{return{}}}function ue(Te,Fe){const Ke=Te?.channel;if(Ke===void 0||Ke.loading||Ke.snapshot.hasMoreOlder)return Fe;const rt=Ke.snapshot.items.find(Lt=>Lt.kind==="turn"),Nt=rt?.kind==="turn"?rt.prompt:void 0;return Nt!==void 0&&Nt.length>0?Nt:Fe}function se(Te){const Fe={...Te,subagentId:R(Te.subagentId)},{entry:Ke}=X(Fe),rt=e.activeAppTasks.value.find(ci=>ci.agentId===Te.subagentId||ci.id===Te.subagentId||ci.backgroundTaskId===Te.subagentId);if(rt){const ci=wCe(rt,e.findBashCommandForTask(rt));if(rt.kind==="subagent"){const ji=ge(ci.id);ci.prompt??=ue(Ke,ji.prompt),ci.model??=ji.model,ci.thinkingEffort??=ji.thinking}return ci}const Nt=Ke?.channel,Lt=Nt?.agents.find(ci=>ci.agentId===Te.subagentId),Qt=Nt?.refreshError??!1,Ut=Nt===void 0||Nt.loading,en=Nt?.snapshot.meta.activity==="turn",it=ge(Te.subagentId),dt=Nt?.snapshot.items.findLast(ci=>ci.kind==="turn"),wt=dt?.kind==="turn"&&dt.state==="cancelled",dn=dt?.kind==="turn"&&dt.state==="failed"||it.status==="error",Gt=en?"working":wt?"cancelled":dn?"failed":Ut?"queued":Qt&&it.status===void 0?"failed":"completed",ri=en?"running":wt?"cancelled":dn?"failed":Ut?"running":Qt&&it.status===void 0?"failed":"completed";return{id:Te.subagentId,kind:"subagent",name:Lt?.label??it.name??Te.subagentId,subagentType:it.subagentType??(Lt?.type==="sub"?"subagent":Lt?.type),model:it.model,thinkingEffort:it.thinking,prompt:ue(Ke,it.prompt),phase:Gt,status:ri,outputLines:it.outputLines}}function fe(Te){const Fe=X(Te).entry;if(!Fe)return[];const Ke=Fe.channel.agents.find(rt=>rt.agentId===Te.subagentId);return FCe(Fe.channel.snapshot,e.getFileUrl,Ke,{sessionId:Te.sessionId,getSessionMediaUrl:e.getSessionMediaUrl})}const G=Te=>X(Te).entry?.channel.loading??!1,ae=Te=>X(Te).entry?.channel.refreshError??!1,K=Te=>X(Te).entry?.channel.loadingOlder??!1,re=Te=>X(Te).entry?.channel.loadOlderError??!1,be=Te=>X(Te).entry?.channel.snapshot.hasMoreOlder??!1,ke=Te=>X(Te).entry?.channel.snapshot.meta.activity==="turn";function we(Te){const Fe=X(Te).entry;Fe&&Fe.channel.loadOlder().catch(()=>{})}function oe(Te){const Fe=e.activeSessionId.value;if(!Te||!Fe)return;const Ke=R(Te);z("agent",{sessionId:Fe,subagentId:Ke})}const le=V("list"),ye=V(null);function Ae(){le.value="list",ye.value=null}function _e(){m.value.some(Fe=>Fe.type==="diff")||Ae(),z("diff",{}),e.loadGitStatus(e.activeSessionId.value)}function pe(){const Te=m.value.find(Fe=>Fe.type==="diff");Te&&P(Te.id)}async function ne(Te){le.value="detail",ye.value=Te,await e.loadFileDiff(Te)}function Ee(Te){const Fe=w.value;if(v.value&&Fe?.type==="turn-diff"&&Fe.payload!==void 0&&Fe.payload.change===Te.change){P(Fe.id);return}z("turn-diff",{turnId:Te.turnId,change:Te.change})}function qe(Te){z("file",{...Te})}async function ze(Te){const Fe=b.value,Ke=(Lt,Qt)=>{const Ut={parentId:Qt,agentId:Lt.agentId,seq:Lt.seq};b.value===Fe?z("btw",Ut):B("btw",Ut)};if(!e.activeSessionId.value&&e.activeWorkspaceId.value){const Lt=await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,Te);if(!Lt)return{sessionId:null,agentId:null};const Qt=Lt.sessionId;return e.activeSessionId.value!==Qt?(Lt.target&&ft(Qt,{parentId:Qt,agentId:Lt.target.agentId,seq:Lt.target.seq}),{sessionId:Qt,agentId:Lt.target?.agentId??null}):(Lt.target&&Ke(Lt.target,Qt),{sessionId:Qt,agentId:Lt.target?.agentId??null})}const rt=e.activeSessionId.value;if(!rt)return{sessionId:null,agentId:null};const Nt=await e.openSideChatOn(rt,Te);return Nt.target&&!Nt.sent&&Te&&p1.set(Nt.target.agentId,Te),Nt.target&&e.activeSessionId.value!==rt?(ft(rt,{parentId:rt,agentId:Nt.target.agentId,seq:Nt.target.seq}),{sessionId:rt,agentId:Nt.target.agentId}):(Nt.target&&Ke(Nt.target,rt),{sessionId:rt,agentId:Nt.target?.agentId??null})}function ft(Te,Fe){const Ke=gt[Te]??{tabs:[],activeIndex:null,visible:!1};Ke.tabs=[...Ke.tabs.filter(rt=>!(rt.type==="btw"&&rt.payload.agentId===Fe.agentId)),{type:"btw",payload:Fe}],gt[Te]=Ke}const gt={};function _t(Te){const Fe=m.value.filter(rt=>Dp[rt.type].restorable&&rt.payload!==void 0);if(Fe.length===0){delete gt[Te];return}const Ke=Fe.findIndex(rt=>rt.id===g.value);gt[Te]={tabs:Fe.map(rt=>({type:rt.type,payload:rt.payload})),activeIndex:Ke===-1?null:Ke,visible:v.value}}function Pt(Te){const Fe=gt[Te];if(!Fe)return;const Ke=e.sideChatTargetsOfSession(Te);let rt=null;const Nt=new Map;Fe.tabs.forEach((Lt,Qt)=>{let Ut=Lt.payload;if(Lt.type==="agent")Ut={sessionId:Te,subagentId:R(Ut.subagentId)};else if(Lt.type==="btw"){const wt=Ut;if(!Ke.some(dn=>dn.agentId===wt.agentId))return}const en=Dp[Lt.type].keyOf,it=en!==void 0&&Ut!==void 0?`${Lt.type}:${en(Ut)}`:null;if(it!==null){const wt=Nt.get(it);if(wt!==void 0){Fe.activeIndex===Qt&&(rt=wt);return}}const dt=S(Lt.type,Ut);it!==null&&Nt.set(it,dt.id),Fe.activeIndex===Qt&&(rt=dt.id)}),m.value.length!==0&&(g.value=rt??m.value.at(-1).id,v.value=Fe.visible&&rt!==null,q())}const Ht="__draft__:",jt=D(()=>e.activeSessionId.value||`${Ht}${e.activeWorkspaceId.value??"none"}`);return We(jt,(Te,Fe)=>{const Ke=Fe.startsWith(Ht)?null:Fe,rt=Te.startsWith(Ht)?null:Te;Ke&&_t(Ke);const Nt=e.getDraftPromotion(),Lt=Fe.startsWith(Ht)?Fe.slice(Ht.length):null,Qt=!Ke&&rt!==null&&Nt!==null&&Nt.sessionId===rt&&Nt.workspaceId===Lt;Qt||(b.value+=1);const Ut=Qt?m.value.filter(en=>en.type==="term"):[];for(const en of m.value)Ut.includes(en)||o?.(en);m.value=Ut,Ut.length===0?(g.value=null,v.value=!1,y.value=!1):Ut.some(en=>en.id===g.value)||(g.value=Ut.at(-1).id),Ae(),e.clearFileDiff(),q(),rt&&Pt(rt)}),{PREVIEW_WIDTH_KEY:yPe,PREVIEW_MIN:zf,previewDefaultWidth:c,previewMax:l,previewWidth:d,previewPanelWidth:f,panelDragging:h,panelTabs:m,activeTabId:g,activeTab:w,panelVisible:v,panelExpanded:y,panelInteractionVersion:u9(b),openTab:z,closeTab:P,activateTab:O,addTabInBackground:B,hidePanel:H,showPanel:j,toggleExpanded:Z,compactionPanelTextOf:Q,openCompactionPanel:te,agentPanelMemberOf:se,agentPanelTurnsOf:fe,agentPanelLoadingOf:G,agentPanelLoadErrorOf:ae,agentPanelLoadingMoreOf:K,agentPanelLoadMoreErrorOf:re,agentPanelHasMoreOf:be,agentPanelRunningOf:ke,loadOlderAgentMessages:we,openAgentPanel:oe,detailDiffMode:le,detailDiffPath:ye,openDiffDetail:_e,closeDiffDetail:pe,selectDiffFile:ne,openTurnDiff:Ee,openFilePreview:qe,openSideChatTab:ze,leaveChatView:ie,bumpInteractionVersion:W}}const bPe=Cn.sidebarWidth,uB=Cn.sidebarCollapsed,cB=270,g5=220,wPe=480,CPe=320;function APe(e={}){const{viewportWidth:t}=GV(),n=V(cB),i=V(!1),o=V(!1),s=D(()=>{const c=CPe+(Ea(e.previewOpen)?zf:0);return Math.min(wPe,ZV(t.value,g5,c))}),r=D(()=>NA(n.value,g5,s.value));function l(){try{i.value=ms(uB)==="true"}catch{i.value=!1}}function a(){try{fs(uB,String(i.value))}catch{}}function u(){i.value=!i.value,a()}return{SIDEBAR_WIDTH_KEY:bPe,SIDEBAR_DEFAULT:cB,SIDEBAR_MIN:g5,sidebarMax:s,sessionColWidth:n,sidebarCollapsed:i,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:u}}const xPe=40409;function dB(e){return qi(e)&&e.code===xPe}function fB(e){return e.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith("\\\\")}function hB(e){if(e.startsWith("\\\\"))return e;const t=/^[a-zA-Z]:/.test(e)?e.slice(0,2):"",n=[];for(const i of e.slice(t.length).split(/[\\/]+/))if(!(!i||i===".")){if(i===".."){n.pop();continue}n.push(i)}return t?`${t}/${n.join("/")}`:`/${n.join("/")}`}function SPe({client:e,t}){const n=V(null),i=V(null),o=V(!1),s=V(null),r=V(null);let l=0;const a=D(()=>{const w=r.value;return w?e.getFileDownloadUrl(w):null}),u=D(()=>n.value!==null&&r.value!==null);function c(w){return w.length>1?w.replace(/\/+$/,""):w}function d(w){const C=Ak(w,e.status.value.cwd);return C===null||C.split(/[\\/]+/).includes("..")?null:f(C)||null}function f(w){const C=[];for(const T of w.split(/[\\/]+/))if(!(!T||T===".")){if(T===".."){C.pop();continue}C.push(T)}return C.join("/")}function h(w){const C=w.trim();if(!C)return{error:t("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(C))return{error:t("filePreview.errors.unsupportedPath")};if(C.startsWith("~"))return{error:t("filePreview.errors.outsideWorkspace")};const T=c(e.status.value.cwd);if(C.startsWith("/")){if(!T||C!==T&&!C.startsWith(`${T}/`))return{error:t("filePreview.errors.outsideWorkspace")};const I=C===T?"":C.slice(T.length+1);if(I.split(/[\\/]+/).includes(".."))return{error:t("filePreview.errors.outsideWorkspace")};const S=f(I);return S?{path:S}:{error:t("filePreview.errors.isDirectory")}}if(C.split(/[\\/]+/).includes(".."))return{error:t("filePreview.errors.outsideWorkspace")};const N=f(C);return N?{path:N}:{error:t("filePreview.errors.emptyPath")}}async function m(w){const C=++l;if(i.value=null,s.value=null,o.value=!0,n.value=w,r.value=null,typeof w.content=="string"){o.value=!1,i.value={path:w.path,content:w.content,encoding:"utf-8",mime:"text/markdown",isBinary:!1,size:w.content.length};return}if(!fB(w.path)&&w.path.split(/[\\/]+/).includes("..")){const N=c(e.status.value.cwd);N&&(w={...w,path:hB(`${N}/${w.path}`)})}if(fB(w.path)){w={...w,path:hB(w.path)};const N=d(w.path);if(N!==null)w={...w,path:N};else{try{const I=await e.readHostFileContent(w.path);if(C!==l)return;r.value=null,i.value={path:w.path,content:I.content,encoding:I.encoding,mime:I.mime,isBinary:I.isBinary,size:I.size}}catch(I){if(C!==l)return;s.value=dB(I)?t("filePreview.errors.notFound"):o4e(I)?t("filePreview.errors.tooLarge"):I instanceof Error?I.message:t("filePreview.errors.loadFailed")}finally{C===l&&(o.value=!1)}return}}const T=h(w.path);if("error"in T){o.value=!1,s.value=T.error;return}r.value=T.path;try{const N=await e.readFileContent(T.path);if(C!==l)return;N?i.value={...N,path:N.path||T.path}:s.value=t("filePreview.errors.loadFailed")}catch(N){if(C!==l)return;s.value=dB(N)?t("filePreview.errors.notFound"):N instanceof Error?N.message:t("filePreview.errors.loadFailed")}finally{C===l&&(o.value=!1)}}function g(){l+=1,n.value=null,r.value=null,i.value=null,s.value=null,o.value=!1}function v(){g()}function y(){const w=i.value?.path??n.value?.path;w&&e.openWorkspaceFile(w,n.value?.line)}function b(){const w=i.value?.path??n.value?.path;w&&e.revealWorkspaceFile(w)}return{previewTarget:n,previewFile:i,previewLoading:o,previewError:s,previewDownloadUrl:a,previewExternalActions:u,openFilePreview:m,closeFilePreview:v,openPreviewInEditor:y,revealPreviewFile:b}}function _Pe(e){const t=e.replace(/[/\\]+$/,"");return t===""?e:t.split(/[/\\]/).pop()??t}function MPe(e,t){return e!==""?e:t?`${_Pe(t)} | Kimi Code`:"Kimi Code"}function IPe(e){return D(()=>MPe(Ea(e.webTitle),Ea(e.activeWorkspaceRoot)))}function TPe({running:e,title:t="Kimi Code"}){if(Wh){Jp(()=>{typeof document<"u"&&(document.title=Ea(t))});return}const n=["◐","◓","◑","◒"],i=V(0);let o=null;function s(){o===null&&(i.value=0,o=setInterval(()=>{i.value=(i.value+1)%n.length},250))}function r(){o!==null&&(clearInterval(o),o=null),i.value=0}We(e,a=>{a?s():r()},{immediate:!0});const l=D(()=>`${e.value?`${n[i.value]} `:""}${Ea(t)}`);Jp(()=>{typeof document<"u"&&(document.title=l.value)}),Ln(()=>{r()})}function EPe(e,t,n){return e==="idle"&&!t&&!n}function Wx(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function LPe(e,t){return{title:e("settings.notifyTitle"),body:Wx(t,e("settings.notifyFallback"))}}function NPe(e,t,n){return{title:e("settings.notifyQuestionTitle"),body:Wx(n,t,e("settings.notifyQuestionFallback"))}}function DPe(e,t,n){return{title:e("settings.notifyApprovalTitle"),body:Wx(n,t,e("settings.notifyApprovalFallback"))}}const df=Symbol("pinScroll"),XV=Symbol("resolveAgentTaskId"),eK=Symbol("resolveAgentModel"),tK=Symbol("resolveAgentTaskState"),qx=Symbol("resolveDetachableTask"),nK=Symbol("resolveSwarmMembers"),im=Symbol("modelDisplay"),om=Symbol("subagentEffort");function iK(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":"file"}function FPe(e,t){const n=t.kind??"file",i=t.path===null?void 0:Cx(t.path);if(i!==void 0){const s=f1({kind:n,path:i,attId:""}),r=e.findLast(l=>l.key===s&&l.kind===n);if(r){const l=r.size!==void 0&&r.size!==t.size||r.lastModified!==void 0&&t.lastModified!==void 0&&r.lastModified!==t.lastModified;if(!(r.uploading&&l))return{attId:r.attId,entry:null,startUpload:!r.uploading&&(l||r.error!==void 0||r.fileId===void 0)}}}else{let s=e.filter(r=>r.kind===n&&r.path===void 0&&r.error!==void 0&&!r.uploading&&r.name===t.name&&(r.size===void 0||r.size===t.size));if(s.length>1&&t.lastModified!==void 0){const r=s.filter(l=>l.lastModified===t.lastModified);r.length===1&&(s=r)}if(s.length===1)return{attId:s[0].attId,entry:null,startUpload:!0}}const o=Lu();return{attId:o,entry:{attId:o,key:f1({kind:n,path:i,attId:o}),kind:n,name:t.name,size:t.size,mediaType:t.mediaType,lastModified:t.lastModified,path:i,refCount:1,uploading:!0},startUpload:!0}}function BPe(e,t){const n=Cx(t),i=n.split("/").pop()??t,o=i===""?n:`${i}/`,s=f1({kind:"folder",path:n,attId:""}),r=e.find(a=>a.key===s);if(r)return{attId:r.attId,name:o,entry:null};const l=Lu();return{attId:l,name:o,entry:{attId:l,key:s,kind:"folder",name:o,path:n,refCount:1,uploading:!1}}}function RPe(e,t,n){const i=new Map(t.map(l=>[l.attId,l])),o=[],s=[],r=[];for(const l of e){const a=i.get(l);a&&a.kind!=="folder"&&(a.uploading||a.error!==void 0||a.fileId===void 0||n!==void 0&&a.sessionId!==void 0&&a.sessionId!==n.sessionId||(o.push({fileId:a.fileId,kind:a.kind,sessionId:a.sessionId,name:a.name,mediaType:a.mediaType,size:a.size}),a.kind==="file"?s.push(l):r.push(l)))}return{promptAttachments:o,fileAttIds:s,mediaAttIds:r}}function $Pe(e,t,n){let i=!1,o=!1;for(const r of e)r.uploading&&(i=!0),r.error!==void 0&&(o=!0),n!==void 0&&r.sessionId!==void 0&&r.sessionId!==n.sessionId&&(o=!0);let s=!1;if(t!==void 0){const r=new Set(e.map(l=>l.attId));s=t.some(l=>!r.has(l))}return{uploading:i,errored:o,missing:s}}function OPe(e,t,n){return e.map(i=>i.attId===t?{...i,...n}:i)}function oK(e){return e.inlineAttachments!==void 0?[...e.inlineAttachments]:[...e.attachments??[]]}function PPe(e){const t=[];let n=0,i=0;for(const o of e){const s=o.kind==="image"||o.kind==="video";if(!s&&o.kind!=="file")continue;const r=s?`m${++i}`:String(++n);if(o.fileId===void 0)continue;const l=s?o.kind:"file";t.push({attId:r,key:o.sessionId!==void 0?`blob:${o.sessionId}:${o.fileId}`:`blob:${o.fileId}`,kind:l,name:o.name??o.kind,size:o.size,mediaType:o.mediaType,refCount:1,uploading:!1,fileId:o.fileId,sessionId:o.sessionId})}return t}function zPe(e,t){const n=[];let i=0;for(const o of e)o.kind==="file"&&(i+=1,o.fileId!==void 0&&(t.has(String(i))||n.push({att:o,ordinal:i})));return n}function jPe(e,t){const n=[];let i=0;for(const o of e)o.kind!=="image"&&o.kind!=="video"||(i+=1,t.has(`m${i}`)||n.push({att:o,ordinal:i}));return n}function Ux(e,t){const n=t.kind==="file"?void 0:t.sessionId;return{kind:t.kind,url:n?e.getSessionMediaUrl(n,t.fileId):e.getFileUrl(t.fileId),fileId:t.fileId,sessionId:n,name:t.name,mediaType:t.mediaType,size:t.size}}function R4(e){const t=[];for(const n of e??[])n.kind==="video"?t.push({type:"video",source:n.sessionId?{kind:"sessionMedia",fileId:n.fileId}:{kind:"file",fileId:n.fileId}}):n.kind==="file"?t.push({type:"file",fileId:n.fileId,name:n.name??"",mediaType:n.mediaType||"application/octet-stream",size:n.size??0}):t.push({type:"image",source:n.sessionId?{kind:"sessionMedia",fileId:n.fileId}:{kind:"file",fileId:n.fileId}});return t}function HPe(e){const{api:t,uploadImage:n,sessionId:i,insertFolderPaths:o,insertFileAttachment:s,adoptFileAttachment:r,adoptMediaAttachment:l}=e,a=V(null),u=V(!1);function c(z){const O=Ic(ZI(z));if(!Array.isArray(O)||O.length===0)return null;const B=[];for(const P of O)!P||typeof P.fileId!="string"||P.fileId===""||P.kind!=="image"&&P.kind!=="video"&&P.kind!=="file"||B.push({fileId:P.fileId,kind:P.kind,name:typeof P.name=="string"&&P.name!==""?P.name:P.kind,mediaType:typeof P.mediaType=="string"?P.mediaType:void 0,size:typeof P.size=="number"?P.size:void 0,sessionId:typeof P.sessionId=="string"?P.sessionId:void 0});return B.length===0?null:B}let d=null;function f(z){for(const O of z){const B=Ux(t,O);B.kind==="file"?r?.(B):l?.(B)}}function h(z){const O=c(z);O&&((r!==void 0||l!==void 0)&&(d={sid:z,drafts:O}),Sr(ZI(z)))}function m(){const z=d;d=null,!(!z||z.sid!==(i()??""))&&f(z.drafts)}function g(z){return z<1024*1024?"<1mb":z<10*1024*1024?"1-10mb":z<50*1024*1024?"10-50mb":"50mb+"}function v(z,O,B){if(!s||!n()||z.length===0)return;let P=!1;for(const H of z)s(H,iI(H),P?void 0:B)&&(P=!0,iK(H.type),g(H.size),Math.min(z.length,100),void 0)}function y(){a.value?.click()}function b(z){const O=z.target,B=Array.from(O.files??[]);v(B),O.value=""}function w(z){const O=z.clipboardData;if(!O)return;const{items:B,folderPaths:P,hasFolders:H}=Noe(O),j=B.some(W=>W.kind==="file")&&n();(P.length>0||H||j)&&z.preventDefault();let Z=[];const ie=()=>{Z.length!==0&&(v(C(Z)),Z=[])};for(const W of B)W.kind==="folder"?(ie(),o?.([W.path])):j&&Z.push(W.file);ie()}function C(z){return z.map(O=>{if(O.name.includes(".")||iI(O)!==null)return O;const B=O.type.split("/")[1]??"png";return new File([O],`paste-${Date.now()}.${B}`,{type:O.type})})}let T=0;function N(z){!n()||!Array.from(z.dataTransfer?.items??[]).some(B=>B.kind==="file")||(z.preventDefault(),z.stopPropagation(),u.value=!0)}function I(){u.value=!1}function S(z,O,B){let P=[],H=O;const j=()=>{P.length!==0&&(v(P,"drop",H),H=void 0,P=[])};for(const Z of z)Z.kind==="folder"?(j(),o?.([Z.path]),H=void 0):B&&P.push(Z.file);j()}function _(z){T=0,u.value=!1;const{items:O,folderPaths:B}=Sw(z);B.length>0&&(z.preventDefault(),z.stopPropagation());const P=n();P&&(z.preventDefault(),z.stopPropagation()),S(O,{clientX:z.clientX,clientY:z.clientY},!!P)}function x(z){return Array.from(z.dataTransfer?.items??[]).some(O=>O.kind==="file")}function E(z){!n()||!x(z)||(z.preventDefault(),T+=1,u.value=!0)}function M(z){!n()||!x(z)||z.preventDefault()}function R(z){!n()||!x(z)||(T=Math.max(0,T-1),T===0&&(u.value=!1))}function q(z){T=0,u.value=!1;const{items:O,folderPaths:B}=Sw(z);B.length>0&&z.preventDefault();const P=n();P&&z.preventDefault(),S(O,{clientX:z.clientX,clientY:z.clientY},!!P)}return We(i,()=>{h(i()??"")}),h(i()??""),yn(()=>{document.addEventListener("paste",w),document.addEventListener("dragenter",E),document.addEventListener("dragover",M),document.addEventListener("dragleave",R),document.addEventListener("drop",q)}),Ln(()=>{document.removeEventListener("paste",w),document.removeEventListener("dragenter",E),document.removeEventListener("dragover",M),document.removeEventListener("dragleave",R),document.removeEventListener("drop",q)}),{fileInputRef:a,isDragOver:u,openFilePicker:y,handleFileInputChange:b,handleDragOver:N,handleDragLeave:I,handleDrop:_,adoptStoredDrafts:m}}const WPe=3;function sK(e){const t=V("starting"),n=V(!1),i=V(null),o=V(0),s=V(!1);let r=null,l=null,a=null,u=0,c=0,d=!1,f,h=!1,m=null,g=!1;function v(){r&&(clearTimeout(r),r=null),l&&(clearInterval(l),l=null),a&&(clearTimeout(a),a=null)}function y(_){v(),w(),t.value="success",a=setTimeout(()=>{a=null,e.onSuccess?.()},_)}function b(){l&&clearInterval(l),l=setInterval(()=>{o.value>0?o.value--:(l&&clearInterval(l),l=null)},1e3)}function w(){m?.(),m=null}async function C(_){h=!0;try{const x=await e.onPollOAuthLogin();if(g||d)return;if(x===null){if(u+=1,u>=WPe){v(),w(),n.value=!0,t.value="error",e.autoOpen?.settle(!1,{keepNavigated:!0}),Date.now()-c;return}T(_);return}u=0,x.status==="authenticated"?y(1200):x.status==="denied"?(v(),w(),t.value="denied",e.autoOpen?.settle(!1),Date.now()-c,void 0):x.status==="expired"||x.status==="cancelled"?(v(),w(),t.value="expired",e.autoOpen?.settle(!1),Date.now()-c,x.status,void 0):T(_)}finally{h=!1}}function T(_){r&&clearTimeout(r),r=setTimeout(()=>{r=null,C(_)},_*1e3)}function N(){t.value!=="device-code"||i.value===null||d||h||(r&&(clearTimeout(r),r=null),C(i.value.interval))}async function I(_){_!==void 0&&(f=_),v(),w(),i.value=null,n.value=!1,u=0,d=!1,c=Date.now(),t.value="starting",s.value=!1,e.autoOpen?.onGesture?.();const x=await e.onStartOAuthLogin(f);if(g){x!==null&&x.status!=="authenticated"&&e.onCancelOAuthLogin();return}if(!x){t.value="error",e.autoOpen?.settle(!1);return}if(x.status==="authenticated"){e.autoOpen?.settle(!0),y(800);return}if(i.value={flowId:x.flowId,verificationUri:x.verificationUri,verificationUriComplete:x.verificationUriComplete,userCode:x.userCode,expiresIn:x.expiresIn,interval:x.interval},o.value=x.expiresIn,t.value="device-code",e.autoOpen){const E=e.autoOpen.openUrl(x.verificationUriComplete,x.flowId);if(E===!1)s.value=!0;else if(E instanceof Promise){const M=x.flowId;E.then(R=>{!R&&!g&&i.value?.flowId===M&&(s.value=!0)})}}b(),T(x.interval),m=e.authWake?.subscribe(N)??null}function S(){t.value!=="success"&&(v(),w(),e.autoOpen?.settle(!1),t.value==="device-code"&&!d&&(d=!0,e.onCancelOAuthLogin()))}return uv()&&Gd(()=>{g=!0,S()}),{step:t,pollError:n,flow:i,secondsLeft:o,autoOpenBlocked:s,startFlow:I,cancelFlow:S,pollNow:N}}const qPe={state:"idle"};function UPe(e){const t=V(qPe),n=V(ms(Cn.updateSkippedVersion)),i=V(!1);if(typeof e?.getUpdateAutoDownload=="function"&&e.getUpdateAutoDownload().then(s=>{i.value=s}).catch(()=>{}),e!==void 0){let s=!1;e.onUpdateStatus(r=>{s=!0,t.value=r}),e.getUpdateStatus().then(r=>{s||(t.value=r)}).catch(()=>{})}const o=D(()=>{const s=t.value;return!(s.state==="idle"||s.state==="available"&&s.version!==void 0&&s.version===n.value)});return{status:t,visible:o,canCheck:typeof e?.checkForUpdates=="function",autoDownload:i,canToggleAutoDownload:typeof e?.getUpdateAutoDownload=="function"&&typeof e?.setUpdateAutoDownload=="function",setAutoDownload:(s,r)=>{i.value=s,typeof e?.setUpdateAutoDownload=="function"&&e.setUpdateAutoDownload(s).then(()=>{}).catch(()=>{})},skipVersion:()=>{const s=t.value.version;t.value.state==="available"&&s!==void 0&&(n.value=s,fs(Cn.updateSkippedVersion,s))},check:async()=>{if(typeof e?.checkForUpdates!="function")return Promise.resolve({outcome:"unsupported"});const s=await e.checkForUpdates().catch(()=>({outcome:"error",message:"bridge call failed"}));return s.outcome==="available"&&s.version!==void 0&&s.version===n.value&&(n.value=null,Sr(Cn.updateSkippedVersion)),s},download:()=>{e?.downloadUpdate().catch(()=>{})},install:()=>{e?.installUpdate().catch(()=>{})}}}let v5=null;function VPe(){return v5===null&&(v5=UPe(window.kimiDesktop)),v5}class rK{transcript;sessionId;agentId;fetchPage;pageSize;onChange;onGap;onReset;refreshPromise=null;buffered=[];agents_=[];seq_;loadingOlder_=!1;loadOlderError_=!1;refreshError_=!1;constructor(t){this.sessionId=t.sessionId,this.agentId=t.agentId,this.transcript=new V4e(t.agentId),this.fetchPage=t.fetchPage,this.pageSize=t.pageSize??20,this.onChange=t.onChange,this.onGap=t.onGap,this.onReset=t.onReset}get snapshot(){return this.transcript.snapshot()}get seq(){return this.seq_}get agents(){return this.agents_}get loading(){return this.refreshPromise!==null}get loadingOlder(){return this.loadingOlder_||this.loadOlderTask_!==void 0}get loadOlderError(){return this.loadOlderError_}get refreshError(){return this.refreshError_}readChain=Promise.resolve();enqueueRead(t,n){const i=this.readChain.then(t).finally(()=>{n();const o=this.buffered;this.buffered=[];for(const s of o)this.applyOps(s.ops,s.seq);this.onChange?.()});return this.readChain=i.catch(()=>{}),i}refresh(){if(this.refreshPromise!==null)return this.refreshPromise;this.refreshError_=!1;const t=this.enqueueRead(async()=>{try{const n=await this.fetchPage({pageSize:this.pageSize});this.applyPage(n,!0)}catch(n){throw this.refreshError_=!0,n}},()=>{this.refreshPromise=null});return this.refreshPromise=t,this.onChange?.(),t}receiveReset(t,n){this.transcript.receive([{op:"reset",agentId:this.agentId,snapshot:t}]),n!==void 0&&(this.seq_=n),this.refreshError_=!1,this.onReset?.(),this.onChange?.()}applyOps(t,n){if(this.refreshPromise!==null||this.loadingOlder)return this.buffered.push({ops:t,...n!==void 0?{seq:n}:{}}),!1;if(n!==void 0&&this.seq_!==void 0){if(n<=this.seq_)return!0;if(n!==this.seq_+1)return this.onGap?.(),!1}const i=this.transcript.apply(t);return n!==void 0&&(this.seq_=n),i.gap!==void 0&&this.onGap?.(),i.accepted.length>0&&this.onChange?.(),i.gap===void 0}loadOlderTask_;async loadOlder(){if(!this.snapshot.hasMoreOlder||this.loadingOlder)return;const t=this.enqueueRead(async()=>{if(!this.snapshot.hasMoreOlder)return;const n=this.snapshot.items.find(i=>i.kind==="turn");if(n?.kind==="turn"){this.loadingOlder_=!0,this.loadOlderError_=!1,this.onChange?.();try{const i=await this.fetchPage({beforeTurn:n.turnId,pageSize:this.pageSize});this.applyPage(i,!1)}catch(i){throw this.loadOlderError_=!0,i}}},()=>{this.loadingOlder_=!1,this.loadOlderTask_=void 0});this.loadOlderTask_=t;try{await t}finally{this.loadOlderTask_===t&&(this.loadOlderTask_=void 0)}}settleOlder(){return this.loadOlderTask_??Promise.resolve()}applyPage(t,n){this.agents_=t.agents;const i=this.snapshot;if(n){this.receiveReset(t,t.seq);return}const o={...t,items:KPe(t.items,i.items),hasMoreOlder:t.hasMoreOlder};this.transcript.receive([{op:"reset",agentId:this.agentId,snapshot:o}]),this.refreshError_=!1,this.onChange?.()}}function KPe(e,t){const n=new Set,i=[];for(const o of[...e,...t]){const s=o.kind==="turn"?o.turnId:o.kind==="marker"?o.markerId:o.refId;n.has(s)||(n.add(s),i.push(o))}return i}function ZPe(e){const t=_h(new Map),n=_h(new Map),i=new Map,o=new Set;let s=null,r=null;function l(){s!==null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s),s=null),r!==null&&(clearTimeout(r),r=null);for(const w of o)w.version.value+=1;o.clear()}function a(w){o.add(w),!(s!==null||r!==null)&&(typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(l)),r=setTimeout(l,50))}function u(w,C){return`${w}\0${C}`}function c(w,C,T){const N=e.getEventConnection();N!==null&&(N.subscribeTranscript(w,C,T),i.set(w,C))}function d(w,C){const T=u(w,C),N=t.get(T);if(N!==void 0)return N;const I={channel:new rK({sessionId:w,agentId:C,fetchPage:S=>e.api.getSessionTranscript(w,{...S,agentId:C}),onChange:()=>{a(I)},onGap:()=>{f(I)}}),version:V(0),baselineLoaded:!1,resumePromise:null};return t.set(T,I),I}async function f(w){if(w.resumePromise!==null)return w.resumePromise;const C=h(w).finally(()=>{w.resumePromise===C&&(w.resumePromise=null)});return w.resumePromise=C,C}async function h(w){const C=()=>t.get(u(w.channel.sessionId,w.channel.agentId))===w;try{await w.channel.refresh(),w.baselineLoaded=!0,C()&&n.get(w.channel.sessionId)===w.channel.agentId&&c(w.channel.sessionId,w.channel.agentId,w.channel.seq)}catch{C()&&n.get(w.channel.sessionId)===w.channel.agentId&&c(w.channel.sessionId,w.channel.agentId)}}function m(w,C){e.connectEventsIfNeeded();const T=i.get(w);T!==void 0&&T!==C&&(e.getEventConnection()?.unsubscribeTranscript(w,[T]),i.delete(w)),n.set(w,C);const N=d(w,C);return N.baselineLoaded?c(w,C,N.channel.seq):f(N),N}function g(w,C){if(n.get(w)!==C)return;n.delete(w);const T=i.get(w);T!==void 0&&(e.getEventConnection()?.unsubscribeTranscript(w,[T]),i.delete(w));const N=u(w,C),I=t.get(N);I!==void 0&&(t.delete(N),o.delete(I))}function v(w,C,T,N){if(n.get(w)!==C)return;const I=d(w,C);I.channel.receiveReset(T,N),I.baselineLoaded=!0}function y(w,C,T,N){return n.get(w)!==C?!0:d(w,C).channel.applyOps(T,N)}function b(w){n.delete(w),i.delete(w)&&e.getEventConnection()?.unsubscribeTranscript(w);for(const[C,T]of t)T.channel.sessionId===w&&(t.delete(C),o.delete(T))}return{getEntry:(w,C)=>t.get(u(w,C)),desiredAgentBySession:n,activate:m,deactivate:g,receiveReset:v,applyOps:y,forgetSession:b}}const Zm="main",GPe=4;function QPe(e){const t=_h(new Map),n=_h(new Set),i=e.maxResidentSessions??GPe;let o=0;const s=new Map;function r(S){const _=s.get(S);_?.timer!=null&&clearTimeout(_.timer),s.delete(S)}const l=new Set,a=new Set;let u=null,c=null;function d(){u!==null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(u),u=null),c!==null&&(clearTimeout(c),c=null);for(const S of a)S.version.value+=1;a.clear()}function f(S){NCe(S.channel.snapshot,S.thinkingTiming),a.add(S),!(u!==null||c!==null)&&(typeof requestAnimationFrame=="function"&&(u=requestAnimationFrame(d)),c=setTimeout(d,50))}function h(S,_){const x=e.getEventConnection();x!==null&&(x.subscribeTranscript(S,Zm,_),n.add(S))}function m(S){const _=t.get(S);if(_!==void 0)return _;const x=new Map,E={channel:new rK({sessionId:S,agentId:Zm,fetchPage:M=>e.api.getSessionTranscript(S,{...M,agentId:Zm}),onChange:()=>{f(E)},onReset:()=>{DCe(E.channel.snapshot,x)},onGap:()=>{if(E.resumePromise!==null){E.gapRetryPending=!0;return}v(E)}}),thinkingTiming:x,version:V(0),baselineLoaded:!1,resumePromise:null,gapRetryPending:!1,pendingReset:null,opsAfterReset:[],emptyResetRetries:0,recoveredViaEmptyReset:!1,lastTouchedSeq:0};return t.set(S,E),E}function g(S){const _=S.pendingReset;if(S.pendingReset=null,_===null||t.get(S.channel.sessionId)!==S)return;S.channel.receiveReset(_.snapshot,_.seq),S.baselineLoaded=!0,r(S.channel.sessionId),h(S.channel.sessionId,S.channel.seq);const x=S.opsAfterReset;S.opsAfterReset=[];for(const E of x)S.channel.applyOps(E.ops,E.seq)}async function v(S){if(S.resumePromise!==null)return S.resumePromise;const _=y(S).finally(()=>{S.resumePromise===_&&(S.resumePromise=null,g(S),S.gapRetryPending&&(S.gapRetryPending=!1,v(S)))});return S.resumePromise=_,_}async function y(S){const _=S.channel.sessionId;try{await S.channel.settleOlder().catch(()=>{});for(let x=0;x<3;x++){const E=e.getLocalTurnState?.(_);await S.channel.refresh();const M=e.getLocalTurnState?.(_);if(E===void 0||M===void 0||E.generation===M.generation&&E.pending===M.pending)break}!S.baselineLoaded&&S.emptyResetRetries>0&&(S.recoveredViaEmptyReset=!0),S.baselineLoaded=!0,S.emptyResetRetries=0,d(),t.get(_)===S&&(r(_),h(_,S.channel.seq))}catch(x){if(qi(x)&&x.code===40401){e.onSessionGone?.(_);return}if(S.baselineLoaded){t.get(_)===S&&h(_);return}if(t.get(_)!==S)return;if(t.delete(_),a.delete(S),l.has(_)){e.onBaselineError?.(_,x);return}{const E=s.get(_)??{attempt:0,timer:null};E.attempt+=1,s.set(_,E),E.attempt===1?e.onBaselineError?.(_,x):ja("[kimi-code] transcript baseline retry failed",{sessionId:_,attempt:E.attempt,err:x}),E.timer=setTimeout(()=>{E.timer=null,s.get(_)===E&&t.get(_)===void 0&&v(m(_))},Math.min(E.attempt*2e3,15e3))}}}function b(){if(t.size<=i)return;const _=[...t.values()].sort((x,E)=>E.lastTouchedSeq-x.lastTouchedSeq).filter(x=>e.hasPendingLocalWork?.(x.channel.sessionId)!==!0);for(const x of _.slice(i)){const E=x.channel.sessionId;t.delete(E),a.delete(x),n.delete(E)&&e.getEventConnection()?.unsubscribeTranscript(E,[Zm])}}function w(S){e.connectEventsIfNeeded(),r(S),l.delete(S);const _=m(S);return o+=1,_.lastTouchedSeq=o,_.baselineLoaded?h(S,_.channel.seq):v(_),b(),_}function C(S){r(S),l.add(S),b()}function T(S,_,x){const E=t.get(S);if(E!==void 0){if(_.items.length===0){E.emptyResetRetries+=1;const M=E.emptyResetRetries;setTimeout(()=>{t.get(S)===E&&v(E)},Math.min(M*2e3,15e3));return}if(E.resumePromise!==null){E.pendingReset!==null&&(E.opsAfterReset=[]),E.pendingReset={snapshot:_,seq:x};return}if(E.channel.loadingOlder){E.pendingReset!==null&&(E.opsAfterReset=[]),E.pendingReset={snapshot:_,seq:x},E.channel.settleOlder().catch(()=>{}).then(()=>{E.resumePromise===null&&g(E)});return}E.channel.receiveReset(_,x),E.baselineLoaded=!0,r(S)}}function N(S,_,x){const E=t.get(S);return E===void 0?!0:E.pendingReset!==null?(E.opsAfterReset.push({ops:_,...x!==void 0?{seq:x}:{}}),!0):E.channel.applyOps(_,x)}function I(S){r(S),l.delete(S);const _=t.get(S);_!==void 0&&(t.delete(S),a.delete(_)),n.delete(S)&&e.getEventConnection()?.unsubscribeTranscript(S,[Zm])}return{getEntry:S=>t.get(S),activate:w,deactivate:C,receiveReset:T,applyOps:N,forgetSession:I,refreshSession:S=>{const _=t.get(S);return _===void 0?Promise.resolve():v(_)},trimResident:b,subscribedSessions:n}}const pB="main";function YPe(e){let t=null;const n=e.getSharedConnection!==void 0,i=QPe({api:e.api,connectEventsIfNeeded:()=>{n?e.ensureSharedConnection?.():o()},getEventConnection:()=>n?e.getSharedConnection():t,maxResidentSessions:e.maxResidentSessions,onSessionGone:e.onSessionGone,getLocalTurnState:e.getLocalTurnState,hasPendingLocalWork:e.hasPendingLocalWork,onBaselineError:e.onBaselineError});function o(){t===null&&(t=e.api.connectTranscriptChannel({onTranscriptReset:(r,l,a,u)=>{l===pB&&i.receiveReset(r,a,u)},onTranscriptOps:(r,l,a,u)=>l===pB?i.applyOps(r,a,u):!0}))}function s(){n||t===null||t.health().stale&&t.reconnect()}return{pool:i,activate:r=>i.activate(r),deactivate:r=>i.deactivate(r),forgetSession:r=>i.forgetSession(r),trimResident:()=>i.trimResident(),recoverIfStale:s,close:()=>{n||t?.close()}}}const JPe=!1;function mB(e,t){let n=e;for(;n!==null;){const i=n.closest(t);if(i!==null)return i;const o=typeof n.getRootNode=="function"?n.getRootNode():null;n=o!==null&&typeof ShadowRoot<"u"&&o instanceof ShadowRoot?o.host:null}return null}const XPe=".file-preview .fp-body";function gB(e,t){let n=e;for(;n!==null;){if(n===t)return!0;if(n.parentElement){n=n.parentElement;continue}const i=typeof n.getRootNode=="function"?n.getRootNode():null;n=i!==null&&typeof ShadowRoot<"u"&&i instanceof ShadowRoot?i.host:null}return!1}function lK(e,t){if(e===null||e.isCollapsed||e.rangeCount===0||t===null)return!1;const n=e.getRangeAt(0),i=r=>typeof Element<"u"&&r instanceof Element?r:r?.parentElement??null,o=i(n.startContainer),s=i(n.endContainer);return o!==null&&s!==null&&gB(o,t)&&gB(s,t)}function y5(e,t,n,i,o=0){return Math.min(Math.max(e,o+i),Math.max(o+i,o+n-t-i))}function eze(e,t){if(t.length===0||e===null||e.isCollapsed||e.rangeCount!==1)return;const n=e.getRangeAt(0),i=c=>{const d=typeof Element<"u"&&c instanceof Element?c:c?.parentElement??null;if(d===null)return null;const f=mB(d,"[data-line]");if(f===null||mB(f,"[data-quote-display-lines]")!==null)return null;const h=Number.parseInt(f.getAttribute("data-line")??"",10);return Number.isFinite(h)?{n:h,row:f}:null},o=i(n.startContainer),s=i(n.endContainer);if(o===null||s===null)return t;const[r,l]=o.n<=s.n?[o.n,s.n]:[s.n,o.n],a=n.endOffset===0&&l>r&&tze(s.row,n.endContainer)?l-1:l,u=nze(o.row,n.startContainer,n.startOffset)&&r{const{codeToTokens:P}=await import("./index-DzigsE_1.js").then(H=>H.i);return{codeToTokens:P}},[]),$=n.value?"github-dark":"github-light",B=c.value;if(B){const[P,H]=await Promise.all([B.before?z(B.before,{lang:q,theme:$}):Promise.resolve(null),B.after?z(B.after,{lang:q,theme:$}):Promise.resolve(null)]);if(R!==y)return;f.value=P?.tokens??null,h.value=H?.tokens??null}else{const P=u.value.length>0?await z(u.value.join(` +`),{lang:q,theme:$}):null;if(R!==y)return;d.value=P?.tokens??null}}catch{R===y&&m()}}function w(){if(g!==null)return;const R=Math.max(0,UOe-(Date.now()-v));g=setTimeout(()=>{g=null,b()},R)}const C=D(()=>u.value.join(` +`)),T=D(()=>c.value?.before??null),N=D(()=>c.value?.after??null);We([C,T,N],w),We([i,n,()=>t.fullTexts],()=>{y++,m(),w()}),kn(b),Ln(()=>{y++,g!==null&&clearTimeout(g),g=null});const I=D(()=>{let R=0;if(Array.isArray(t.lineNumbers))for(const q of t.lineNumbers)q>R&&(R=q);else for(const q of t.lines??[])q.oldNo!==void 0&&q.oldNo>R&&(R=q.oldNo),q.newNo!==void 0&&q.newNo>R&&(R=q.newNo);return Math.max(4,String(R).length)});function S(R){if(R.type==="del"){if(R.oldNo===void 0)return null;const z=t.fullTexts?R.oldNo-1:_.value.get(R.oldNo);return z===void 0?null:f.value?.[z]??null}if(R.newNo===void 0)return null;const q=t.fullTexts?R.newNo-1:x.value.get(R.newNo);return q===void 0?null:h.value?.[q]??null}const _=D(()=>{const R=new Map;let q=0;for(const z of t.lines??[])z.oldNo!==void 0&&R.set(z.oldNo,q++);return R}),x=D(()=>{const R=new Map;let q=0;for(const z of t.lines??[])z.newNo!==void 0&&R.set(z.newNo,q++);return R});function E(R){const q={};R.color&&(q.color=R.color);const z=R.fontStyle??0;return z&1&&(q.fontStyle="italic"),z&2&&(q.fontWeight="var(--weight-semibold)"),z&4&&(q.textDecoration="underline"),q}function M(R){return R.type==="add"?"+":R.type==="del"?"-":" "}return(R,q)=>(k(),L("div",{class:Re(["hl-code",{gutter:s.value,"plain-pad":!o.value&&!a.value,framed:e.framed}]),style:sn({"--gutter-ch":`${I.value}ch`})},[A("div",OOe,[o.value?(k(!0),L(De,{key:0},Ct(e.lines??[],(z,$)=>(k(),L("div",{key:$,class:Re(["hl-row",`row-${z.type}`])},[s.value?(k(),L(De,{key:0},[r.value?(k(),L("span",$Oe,F(z.oldNo??""),1)):ee("",!0),l.value?(k(),L("span",POe,F(z.newNo??""),1)):ee("",!0)],64)):ee("",!0),A("span",zOe,F(M(z)),1),A("span",jOe,[S(z)?(k(!0),L(De,{key:0},Ct(S(z)??[],(B,P)=>(k(),L("span",{key:P,style:sn(E(B))},F(B.content),5))),128)):(k(),L(De,{key:1},[Oe(F(z.text),1)],64))])],2))),128)):(k(!0),L(De,{key:1},Ct(u.value,(z,$)=>(k(),L("div",{key:$,class:Re(["hl-row",e.lineClass?.(a.value?.[$]??-1)]),"data-line":a.value?.[$]},[a.value?(k(),L("span",WOe,F(a.value[$]??""),1)):ee("",!0),A("span",qOe,[d.value?.[$]?(k(!0),L(De,{key:0},Ct(d.value[$]??[],(B,P)=>(k(),L("span",{key:P,style:sn(E(B))},F(B.content),5))),128)):(k(),L(De,{key:1},[Oe(F(z),1)],64))])],10,HOe))),128))])],6))}}),Wa=St(VOe,[["__scopeId","data-v-dad8dd61"]]),KOe={key:0,class:"fp-empty fp-error"},ZOe={key:1,class:"fp-empty"},GOe={key:2,class:"fp-loading"},QOe={class:"fp-path"},YOe={class:"fp-meta"},JOe={key:0,class:"fp-lines"},XOe={class:"fp-size"},e$e={key:3,class:"fp-search"},t$e=["placeholder"],n$e={key:0,class:"fp-search-count"},i$e=["href","aria-label"],o$e=["data-quote-display-lines"],s$e={key:1,class:"fp-code"},r$e=["data-quote-display-lines"],l$e={key:2,class:"fp-body"},a$e=["srcdoc","title"],u$e={key:1,class:"fp-code"},c$e={key:3,class:"fp-body fp-pdf-wrap"},d$e=["src","title"],f$e={key:1,class:"fp-binary-card"},h$e={class:"fp-binary-label"},p$e={key:4,class:"fp-body fp-table-wrap"},m$e={class:"fp-table"},g$e=["data-line"],v$e={key:5,class:"fp-body fp-image-wrap"},y$e=["src","alt"],k$e={key:1,class:"fp-binary-card"},b$e={class:"fp-binary-icon"},w$e={class:"fp-binary-label"},C$e={key:6,class:"fp-body fp-code"},A$e={key:7,class:"fp-body fp-binary-wrap"},x$e={class:"fp-binary-card"},S$e={class:"fp-binary-icon"},_$e={class:"fp-binary-label"},M$e=rt({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Ut(),i=Yt(h4,async se=>se),o=D(()=>Qoe(u.file?.path??""));function s(se){if(/^(https?:|data:|blob:)/i.test(se)||se.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(se)||se.startsWith("\\\\"))return se;const pe=o.value;return pe?hI(se,pe):se}async function r(se){const pe=s(se);return i?i(pe):pe}ii(h4,r);function l(se){return se.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(se)||se.startsWith("\\\\")?se:hI(se,o.value)}function a(se){const pe=l(se.path);return pe===se.path?se:{...se,path:pe}}const u=e,c=t;function d(se){u.openFile?.(a(se))}const f=V(null),h=D(()=>{const se=u.file;if(!se)return"binary";const pe=se.mime??"",Z=se.languageId??"",ae=se.path.toLowerCase();return pe==="text/markdown"||Z==="markdown"||Z==="md"||ae.endsWith(".mdx")?"markdown":pe==="application/json"||Z==="json"?"json":pe==="text/html"||Z==="html"||ae.endsWith(".html")||ae.endsWith(".htm")?"html":pe==="application/pdf"||ae.endsWith(".pdf")?"pdf":pe==="text/csv"||Z==="csv"||ae.endsWith(".csv")?"csv":pe.startsWith("image/")?"image":se.isBinary?"binary":pe.startsWith("text/")||Z!==""?"text":"binary"});function m(se){const pe=atob(se),Z=Uint8Array.from(pe,ae=>ae.charCodeAt(0));return new TextDecoder().decode(Z)}const g=D(()=>{const se=u.file;if(!se)return"";if(se.encoding==="base64")try{return m(se.content)}catch{return se.content}return se.content}),v=D(()=>{if(h.value!=="json"||!u.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),y=D(()=>u.file?(h.value==="json"?v.value:g.value).split(` +`):[]),b=D(()=>u.file?h.value==="json"?v.value:g.value:""),w=D(()=>h.value==="json"&&v.value!==g.value),C=D(()=>y.value.map((se,pe)=>pe+1)),T=D(()=>u.file&&b.value.length<=KC?u.file.path:void 0),N=V(""),I=V(0),S=D(()=>{const se=N.value.trim().toLowerCase();if(!se)return[];const pe=[];return y.value.forEach((Z,ae)=>{Z.toLowerCase().includes(se)&&pe.push(ae+1)}),pe});We(N,()=>{I.value=0});function _(se,pe=!1){se&&ft(()=>{const Z=f.value?.querySelector(".fp-body"),ae=Z?.querySelector(`[data-line="${se}"]`);if(!Z||!ae)return;pe&&(Z.scrollTop=0);const K=Z.getBoundingClientRect(),re=ae.getBoundingClientRect(),we=re.top-K.top+Z.scrollTop;Z.scrollTop=we-Z.clientHeight/2+re.height/2})}We(()=>[u.file?.path,u.line],()=>_(u.line,!0),{immediate:!0});function x(se){const pe=S.value;pe.length!==0&&(I.value=(I.value+se+pe.length)%pe.length,_(pe[I.value]))}function E(se){const pe=S.value;return{target:u.line===se,hit:pe.includes(se),active:pe[I.value]===se}}function M(se){return se<1024?`${se} B`:se<1024*1024?`${(se/1024).toFixed(1)} KB`:`${(se/(1024*1024)).toFixed(1)} MB`}const R=V(!1),q=V(!1);function z(){u.file&&Ls(b.value).then(se=>{se&&(R.value=!0,setTimeout(()=>{R.value=!1},1400))})}function $(){u.file&&Ls(u.file.path).then(se=>{se&&(q.value=!0,setTimeout(()=>{q.value=!1},1400))})}const B=V("preview"),P=V("preview"),H=V("fit");function j(se){B.value=se}function G(se){P.value=se}function ne(se){H.value=se}We(h,se=>{B.value=se==="html"?"preview":"source",P.value="preview",H.value="fit"});const W=D(()=>{const se=u.file;return!se||h.value!=="image"?null:se.encoding==="base64"?`data:${se.mime};base64,${se.content}`:se.mime==="image/svg+xml"?`data:${se.mime};charset=utf-8,${encodeURIComponent(se.content)}`:null}),Q=D(()=>{const se=u.file;return!se||h.value!=="pdf"?null:u.downloadUrl?u.downloadUrl:se.encoding==="base64"?`data:${se.mime};base64,${se.content}`:null}),te=D(()=>u.file?["",'',``,g.value].join(""):"");function X(se){const pe=[];let Z="",ae=!1;for(let K=0;Ky.value.slice(0,200).map(X));function ce(se,pe=55){return!se||se.length<=pe?se:"…"+se.slice(se.length-pe+1)}return(se,pe)=>(k(),L("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(k(),L("div",KOe,[A("span",null,F(e.error),1),e.closable?(k(),de(p(rn),{key:0,variant:"secondary",size:"sm",onClick:pe[0]||(pe[0]=Z=>c("close"))},{default:ue(()=>[Oe(F(p(n)("filePreview.close")),1)]),_:1})):ee("",!0)])):!e.file&&!e.loading?(k(),L("div",ZOe,F(p(n)("filePreview.empty")),1)):e.loading?(k(),L("div",GOe,[pe[7]||(pe[7]=A("span",{class:"spinner"},null,-1)),A("span",null,F(p(n)("filePreview.loading")),1)])):e.file?(k(),L(De,{key:3},[U(p(_1),{wrap:"",title:p(n)("common.preview"),closable:e.closable,"close-label":p(n)("filePreview.close"),onClose:pe[6]||(pe[6]=Z=>c("close"))},{default:ue(()=>[U(p(Nn),{text:e.file.path},{default:ue(()=>[A("span",QOe,F(ce(e.file.path)),1)]),_:1},8,["text"]),A("span",YOe,[e.file.lineCount?(k(),L("span",JOe,F(p(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ee("",!0),A("span",XOe,F(M(e.file.size)),1)]),h.value==="html"?(k(),de(p(Is),{key:0,"model-value":B.value,size:"sm",options:[{value:"preview",label:p(n)("filePreview.preview")},{value:"source",label:p(n)("filePreview.source")}],"onUpdate:modelValue":j},null,8,["model-value","options"])):ee("",!0),h.value==="markdown"?(k(),de(p(Is),{key:1,"model-value":P.value,size:"sm",options:[{value:"preview",label:p(n)("filePreview.preview")},{value:"source",label:p(n)("filePreview.source")}],"onUpdate:modelValue":G},null,8,["model-value","options"])):ee("",!0),h.value==="image"?(k(),de(p(Is),{key:2,"model-value":H.value,size:"sm",options:[{value:"fit",label:p(n)("filePreview.fit")},{value:"actual",label:p(n)("filePreview.actual")}],"onUpdate:modelValue":ne},null,8,["model-value","options"])):ee("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(k(),L("div",e$e,[ai(A("input",{"onUpdate:modelValue":pe[1]||(pe[1]=Z=>N.value=Z),class:"fp-search-input",type:"search",placeholder:p(n)("filePreview.search")},null,8,t$e),[[ar,N.value]]),N.value.trim()?(k(),L("span",n$e,F(S.value.length),1)):ee("",!0),U(p(an),{size:"sm",disabled:S.value.length===0,label:p(n)("filePreview.prevMatch"),tooltip:p(n)("filePreview.prevMatch"),onClick:pe[2]||(pe[2]=Z=>x(-1))},{default:ue(()=>[U(p(Ce),{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label","tooltip"]),U(p(an),{size:"sm",disabled:S.value.length===0,label:p(n)("filePreview.nextMatch"),tooltip:p(n)("filePreview.nextMatch"),onClick:pe[3]||(pe[3]=Z=>x(1))},{default:ue(()=>[U(p(Ce),{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label","tooltip"])])):ee("",!0),U(p(an),{size:"sm",class:Re({copied:q.value}),label:q.value?p(n)("filePreview.copied"):p(n)("filePreview.copyPath"),tooltip:q.value?p(n)("filePreview.copied"):p(n)("filePreview.copyPath"),onClick:$},{default:ue(()=>[q.value?(k(),de(p(Ce),{key:1,class:"fp-check",name:"check",size:"md"})):(k(),de(p(Ce),{key:0,name:"link",size:"md"}))]),_:1},8,["class","label","tooltip"]),e.externalActions?(k(),de(p(an),{key:4,size:"sm",label:p(n)("filePreview.openInEditor"),tooltip:p(n)("filePreview.openInEditor"),onClick:pe[4]||(pe[4]=Z=>c("openExternal"))},{default:ue(()=>[U(p(Ce),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.externalActions?(k(),de(p(an),{key:5,size:"sm",label:p(n)("filePreview.reveal"),tooltip:p(n)("filePreview.reveal"),onClick:pe[5]||(pe[5]=Z=>c("reveal"))},{default:ue(()=>[U(p(Ce),{name:"folder",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.downloadUrl?(k(),de(p(Nn),{key:6,text:p(n)("filePreview.download")},{default:ue(()=>[A("a",{class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":p(n)("filePreview.download")},[U(p(Ce),{name:"download",size:"md"})],8,i$e)]),_:1},8,["text"])):ee("",!0),!e.file.isBinary&&h.value!=="image"?(k(),de(p(an),{key:7,size:"sm",class:Re({copied:R.value}),label:R.value?p(n)("filePreview.copied"):p(n)("filePreview.copy"),tooltip:R.value?p(n)("filePreview.copied"):p(n)("filePreview.copy"),onClick:z},{default:ue(()=>[R.value?(k(),de(p(Ce),{key:1,class:"fp-check",name:"check",size:"md"})):(k(),de(p(Ce),{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label","tooltip"])):ee("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(k(),L("div",{key:0,class:Re(["fp-body",{"fp-markdown":P.value==="preview"}]),"data-quote-display-lines":P.value==="preview"||void 0},[P.value==="preview"?(k(),de(p(_c),{key:e.file?.path,text:g.value,"open-file":u.openFile?d:void 0,"resolve-mention-path":l},null,8,["text","open-file"])):(k(),L("div",s$e,[U(Wa,{code:y.value,path:T.value,"line-numbers":C.value,framed:!1,"line-class":E},null,8,["code","path","line-numbers"])]))],10,o$e)):h.value==="json"?(k(),L("div",{key:1,class:"fp-body fp-code","data-quote-display-lines":w.value||void 0},[U(Wa,{code:y.value,path:T.value,"line-numbers":C.value,framed:!1,"line-class":E},null,8,["code","path","line-numbers"])],8,r$e)):h.value==="html"?(k(),L("div",l$e,[B.value==="preview"?(k(),L("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:te.value,title:e.file.path},null,8,a$e)):(k(),L("div",u$e,[U(Wa,{code:y.value,path:T.value,"line-numbers":C.value,framed:!1,"line-class":E},null,8,["code","path","line-numbers"])]))])):h.value==="pdf"?(k(),L("div",c$e,[Q.value?(k(),L("iframe",{key:0,class:"fp-pdf-frame",src:Q.value,title:e.file.path},null,8,d$e)):(k(),L("div",f$e,[A("span",h$e,F(p(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(k(),L("div",p$e,[A("table",m$e,[A("tbody",null,[(k(!0),L(De,null,Ct(ve.value,(Z,ae)=>(k(),L("tr",{key:ae,class:Re(E(ae+1)),"data-line":ae+1},[A("th",null,F(ae+1),1),(k(!0),L(De,null,Ct(Z,(K,re)=>(k(),L("td",{key:re},F(K),1))),128))],10,g$e))),128))])])])):h.value==="image"?(k(),L("div",v$e,[W.value?(k(),L("img",{key:0,src:W.value,alt:e.file.path,class:Re(["fp-image",{actual:H.value==="actual"}])},null,10,y$e)):(k(),L("div",k$e,[A("span",b$e,[U(p(Ce),{name:"image-off",size:"lg"})]),A("span",w$e,F(p(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):h.value==="text"?(k(),L("div",C$e,[U(Wa,{code:y.value,path:T.value,"line-numbers":C.value,framed:!1,"line-class":E},null,8,["code","path","line-numbers"])])):(k(),L("div",A$e,[A("div",x$e,[A("span",S$e,[U(p(Ce),{name:"file-off",size:"lg"})]),A("span",_$e,F(p(n)("filePreview.binaryNoPreview",{mime:e.file.mime||p(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):ee("",!0)],512))}}),I$e=St(M$e,[["__scopeId","data-v-91fc26fa"]]),T$e=["aria-label"],E$e={class:"gload-box"},L$e={class:"gload-text"},N$e=rt({__name:"GlobalLoading",setup(e){const{t}=Ut();return(n,i)=>(k(),L("div",{class:"gload",role:"status","aria-label":p(t)("app.connecting")},[A("div",E$e,[i[0]||(i[0]=Qd('',1)),U(p(uo),{size:"md",label:p(t)("app.connecting")},null,8,["label"]),A("div",L$e,F(p(t)("app.connecting")),1)])],8,T$e))}}),D$e=St(N$e,[["__scopeId","data-v-c183e202"]]),F$e="/assets/k3_doodle1-27EZ2HSw.riv",B$e={class:"doodle-host"},R$e={key:0,class:"doodle-fallback"},O$e=rt({__name:"KimiDoodle",setup(e){const t=V(!1),n=V(null),i=Qk();let o=null,s=null;return kn(async()=>{if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches)try{let r=function(){const g=f.stateMachineNames[0];if(!g)return;const v=(f.stateMachineInputs(g)??[]).find(y=>y.name==="light/dark");v&&(v.value=i.value?1:0)};const[{Rive:l,RuntimeLoader:a},u,c]=await Promise.all([Jo(()=>import("./rive-CeXCFBdn.js").then(g=>g.r),__vite__mapDeps([8,3])),Jo(()=>import("./rive-BxcgqsjB.js"),[]).then(g=>g.default),Jo(()=>import("./rive_fallback-ByshBW-N.js"),[]).then(g=>g.default)]),d=n.value;if(!d)return;a.setWasmUrl(u),a.setWasmFallbackUrl(c);const f=new l({canvas:d,src:F$e,autoplay:!0,onLoad(){const g=f.stateMachineNames[0];g&&f.play(g),requestAnimationFrame(()=>{n.value&&(r(),f.resizeDrawingSurfaceToCanvas(),s=aP(f,d),t.value=!0)})}}),h=We(i,r),m=()=>f.resizeDrawingSurfaceToCanvas();window.addEventListener("resize",m),o=()=>{s?.(),s=null,h(),window.removeEventListener("resize",m),f.cleanup()}}catch{}}),Xn(()=>{o?.(),o=null}),(r,l)=>(k(),L("div",B$e,[t.value?ee("",!0):(k(),L("div",R$e,[Wn(r.$slots,"fallback",{},void 0,!0)])),A("canvas",{ref_key:"canvasRef",ref:n,class:Re(["doodle-canvas",{ready:t.value}]),role:"img","aria-label":"Kimi"},null,2)]))}}),$$e=St(O$e,[["__scopeId","data-v-8004c140"]]),P$e="/assets/kimi_avatar_default-srYjF2HV.riv",z$e={key:0,class:"mascot-fallback",viewBox:"5 0 240.776 240.776","aria-hidden":"true"},j$e="light/dark",H$e="click_avator",W$e="hoverspace",q$e=rt({__name:"KimiMascot",setup(e){const t=V(!1),n=V(null),i=Qk();let o=null,s=null,r=null;function l(){o!==null&&pI(o,j$e,i.value?1:0)}kn(async()=>{if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches)try{const[{Rive:c,RuntimeLoader:d},f,h]=await Promise.all([Jo(()=>import("./rive-CeXCFBdn.js").then(b=>b.r),__vite__mapDeps([8,3])),Jo(()=>import("./rive-BxcgqsjB.js"),[]).then(b=>b.default),Jo(()=>import("./rive_fallback-ByshBW-N.js"),[]).then(b=>b.default)]),m=n.value;if(!m)return;d.setWasmUrl(f),d.setWasmFallbackUrl(h);const g=new c({canvas:m,src:P$e,autoplay:!0,onLoad(){const b=g.stateMachineNames[0];b!==void 0&&g.play(b),requestAnimationFrame(()=>{n.value&&(l(),g.resizeDrawingSurfaceToCanvas(),r=aP(g,m),t.value=!0)})}});o=g;const v=We(i,l),y=()=>g.resizeDrawingSurfaceToCanvas();window.addEventListener("resize",y),s=()=>{r?.(),r=null,v(),window.removeEventListener("resize",y),g.cleanup(),o=null}}catch{}}),Xn(()=>{s?.(),s=null});function a(c){o!==null&&pI(o,W$e,c)}function u(){o!==null&&Dse(o,H$e)}return(c,d)=>(k(),L("div",{class:"mascot-host",role:"img","aria-label":"Kimi mascot",onPointerenter:d[0]||(d[0]=f=>a(!0)),onPointerleave:d[1]||(d[1]=f=>a(!1)),onClick:u},[t.value?ee("",!0):(k(),L("svg",z$e,[...d[2]||(d[2]=[Qd('',3)])])),A("canvas",{ref_key:"canvasRef",ref:n,class:Re(["mascot-canvas",{ready:t.value}])},null,2)],32))}}),U$e=St(q$e,[["__scopeId","data-v-69623d48"]]),V$e=640,K$e=`(max-width: ${V$e}px)`;function Lc(){const e=V(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(K$e);e.value=t.matches;const n=i=>{e.value=i.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Ln(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Ln(()=>t.removeListener(n))),e}const KV=V(typeof window>"u"?0:window.innerWidth);let fy=0,D4=!1;function EA(){KV.value=window.innerWidth}function Z$e(){D4||typeof window>"u"||(window.addEventListener("resize",EA),D4=!0,EA())}function G$e(){!D4||typeof window>"u"||(window.removeEventListener("resize",EA),D4=!1)}function ZV(e,t,n){return Math.max(t,e-n)}function LA(e,t,n){return Math.min(n,Math.max(t,e))}function GV(){return kn(()=>{fy+=1,Z$e()}),Xn(()=>{fy=Math.max(0,fy-1),fy===0&&G$e()}),{viewportWidth:KV}}const Q$e=24;function Y$e(e){const t=V(null),n=V(!0);let i=null,o=null,s=null,r=0,l=0,a=!1,u=0;function c(){const y=t.value;y&&(y.scrollTop=Math.max(y.scrollTop,r))}function d(){const b=t.value?.firstElementChild??null;b!==s&&(s&&i?.unobserve(s),s=b,b&&i?.observe(b))}function f(){const y=t.value;!y||a||(n.value=r-y.scrollTop-lh(y));return}requestAnimationFrame(()=>{requestAnimationFrame(()=>h(y))})}function g(){n.value=!0,c()}function v(){const y=t.value;y&&(i?.disconnect(),o?.disconnect(),s=null,a=!1,u++,r=0,l=0,typeof ResizeObserver=="function"?(i=new ResizeObserver(()=>{const b=t.value;if(!b)return;const{scrollHeight:w,clientHeight:C}=b,T=w>r+1,N=C{n.value=!0,ft(v)}),We(t,()=>void ft(v)),kn(()=>void ft(v)),Ln(()=>{u++,i?.disconnect(),o?.disconnect()}),{scroller:t,following:n,onScroll:f,pinScroll:m,jumpToBottom:g}}function J$e(e){try{const t=ps(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function X$e(e,t){try{ds(e,String(t))}catch{}}function QV(e){const{storageKey:t,defaultWidth:n,min:i,max:o,reverse:s=!1,axis:r="x",applyLive:l,persist:a}=e;function u(R){return Number.isFinite(R)?Math.min(Fa(o),Math.max(Fa(i),Math.round(R))):n}const c=V(u(J$e(t)??n)),d=V(!1);function f(R){const q=R<=Fa(i),z=R>=Fa(o),$=r==="x"?"col-resize":"row-resize";if(q&&z)return $;const[B,P]=r==="x"?["e-resize","w-resize"]:["s-resize","n-resize"];return z?s?B:P:q?s?P:B:$}const h=V(null),m=D(()=>f(h.value??c.value));function g(R){typeof document>"u"||(document.body.style.cursor=f(R))}function v(R){a&&!a()||X$e(t,R)}function y(R){const q=u(R);c.value=q,v(q)}We(()=>Fa(o),R=>{!d.value&&c.value>R&&y(R)}),We(()=>Fa(i),R=>{!d.value&&c.valuet.value!==null&&(n.value||i.value||o.value||s.value));function l(){const v=e.value;if(!v){t.value=null;return}const y=ePe(v.scrollTop,v.scrollHeight,v.clientHeight,p5(v,"--overlay-scrollbar-track-inset",0),p5(v,"--overlay-scrollbar-thumb-min",24)),b=y===null?null:{top:v.offsetTop+y.top,height:y.height},w=t.value;w!==null&&b!==null&&w.top===b.top&&w.height===b.height||(t.value=b)}let a=null;function u(){o.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{o.value=!1,a=null},tPe)}let c=null;function d(v){const y=e.value,b=t.value;if(!y||!b)return;v.preventDefault(),c?.();const w=v.pointerId;v.target.setPointerCapture?.(v.pointerId);const C=p5(y,"--overlay-scrollbar-track-inset",0),T=y.clientHeight-C*2-b.height,N=y.scrollHeight-y.clientHeight,I=v.clientY,S=y.scrollTop;s.value=!0;const _=M=>{M.pointerId!==w||T<=0||(y.scrollTop=S+(M.clientY-I)/T*N)},x=M=>{M.pointerId===w&&E()},E=()=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointermove",_),window.removeEventListener("pointercancel",x),s.value=!1,c===E&&(c=null)};c=E,window.addEventListener("pointermove",_),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)}function f(){n.value=!0}function h(){n.value=!1}function m(){i.value=!0}function g(){i.value=!1}return Xn(()=>{a&&clearTimeout(a),c?.()}),{thumb:t,thumbVisible:r,scrolling:o,update:l,markScrolling:u,onThumbPointerDown:d,onListMouseEnter:f,onListMouseLeave:h,onThumbMouseEnter:m,onThumbMouseLeave:g}}const za=V(null),h1=V(!1),nPe=D(()=>za.value!==null);function jx(e){const t=za.value;!t||h1.value||(za.value=null,t.resolve(e))}async function iPe(){const e=za.value;if(!(!e||h1.value)){if(!e.action){jx(!0);return}h1.value=!0;try{await e.action(),za.value===e&&(za.value=null),e.resolve(!0)}catch(t){za.value===e&&(za.value=null),e.reject(t)}finally{h1.value=!1}}}function oPe(e){return h1.value?Promise.resolve(!1):(za.value&&jx(!1),new Promise((t,n)=>{za.value={...e,resolve:t,reject:n}}))}function cf(){return{current:za,busy:h1,isConfirmOpen:nPe,confirm:oPe,settle:jx,runAction:iPe}}function sPe(e){const{sessionId:t}=e;function n(f){return ps(ZI(f))??""}function i(f,h){const m=ZI(f);h?ds(m,h):xr(m)}function o(f){const h=Tc(QI(f));if(!Array.isArray(h))return[];const m=[];for(const g of h){if(typeof g!="object"||g===null)continue;const v=g;if(typeof v.attId!="string"||typeof v.key!="string"||typeof v.name!="string"||v.kind!=="file"&&v.kind!=="folder"&&v.kind!=="image"&&v.kind!=="video")continue;const y=v.uploading===!0;m.push({attId:v.attId,key:v.key,kind:v.kind,name:v.name,size:typeof v.size=="number"?v.size:void 0,mediaType:typeof v.mediaType=="string"?v.mediaType:void 0,lastModified:typeof v.lastModified=="number"?v.lastModified:void 0,path:typeof v.path=="string"?v.path:void 0,refCount:typeof v.refCount=="number"?v.refCount:0,uploading:!1,fileId:typeof v.fileId=="string"?v.fileId:void 0,sessionId:typeof v.sessionId=="string"?v.sessionId:void 0,error:typeof v.error=="string"?v.error:y?"upload-interrupted":void 0})}return m}let s=null;function r(f,h){const m=QI(f);if(h.length===0){s=null,xr(m);return}const g=h.map(yU),v=JSON.stringify(g);s?.key===m&&s.json===v||(s={key:m,json:v},Ec(m,g))}const l=V(n(t())),a=V(null);We(l,f=>{i(t(),f)}),We(t,(f,h)=>{f!==h&&(e.onBeforeSessionSave?.(h),i(h,l.value),l.value=n(f))});function u(f){c(f)}function c(f){l.value=f,ft(()=>{const h=a.value;if(!h)return;h.focus();const m=f.length;h.setSelectionRange(m,m)})}function d(){i(t(),"")}return{text:l,editorRef:a,loadForEdit:u,clearDraft:d,loadDraftAttachments:o,saveDraftAttachments:r,saveDraft:i}}function rPe(e){return e?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable===!0:!1}function lPe(e){const{sessionId:t,mobile:n,starting:i,dockedComposer:o,emptyComposer:s}=e,r=V(!1);We(t,()=>{n()||(r.value=!0)}),We([r,o,s,i],()=>{if(!r.value)return;const l=o.value??s.value;if(!l)return;const a=typeof document<"u"?document.activeElement:null;if(rPe(a)){r.value=!1;return}l.focus(),(typeof document>"u"||document.activeElement!==a)&&(r.value=!1)},{flush:"post"})}const F4=100;function aPe(e){const t=Tc(xn.inputHistory);if(Array.isArray(t)){const n=t.filter(s=>typeof s=="string"&&s.length>0);if(!e||n.length===0)return{};const i=n.length>F4?n.slice(-F4):n,o={[e]:i};return Ec(xn.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function uPe(e){const{text:t,editorRef:n,sessionId:i}=e,o=V(aPe(i())),s=D(()=>o.value[i()??""]??[]);let r=-1,l="";function a(y){const b=i();if(r=-1,!b)return;const w=y.trim();if(!w)return;const C=o.value[b]??[];if(C.at(-1)===w)return;const T=[...C,w],N=T.length>F4?T.slice(-F4):T;o.value={...o.value,[b]:N},Ec(xn.inputHistory,o.value)}function u(){return t.value.length===0}function c(){return s.value.length>0&&(r!==-1||u())}function d(y){t.value=y,ft(()=>{const b=n.value;if(!b)return;const w=y.length;b.setSelectionRange(w,w)})}function f(){const y=s.value;if(y.length!==0){if(r===-1)l=t.value,r=y.length-1;else if(r>0)r-=1;else return;d(y[r])}}function h(){if(r===-1)return;const y=s.value;r0}return We(i,()=>{r!==-1&&(r=-1,d(l))}),{push:a,canRecallOlder:c,recallOlder:f,recallNewer:h,resetBrowsing:m,isBrowsing:g,hasHistory:v}}function cPe(e){const{text:t,editorRef:n,skills:i,emitCommand:o,historyPush:s,clearDraft:r,resolveDesc:l}=e,a=V(!1),u=V([]),c=V([]),d=V(0);function f(){const m=t.value;if(/^\/\S*$/.test(m)){const g=Gle(m,MP(i()),l);u.value=g.map(v=>v.item),c.value=g.map(v=>v.ranges),d.value=0,a.value=!0}else a.value=!1}function h(m){if(a.value=!1,m.acceptsInput){t.value=`${m.name} `,ft(()=>{const g=n.value;if(!g)return;const v=t.value.length;g.setSelectionRange(v,v),g.focus()});return}t.value="",r?.(),s(m.name),o(m.name)}return{open:a,items:u,ranges:c,active:d,update:f,select:h}}function dPe(e){const t=e.toLowerCase(),n=[];let i=0;for(const o of e){const s=o.toLowerCase().length;for(let r=0;r=3&&JV(e,t)!==null?1:0}function lB(e,t){const n=t.toLowerCase(),i=[];for(const o of e){const{lower:s,map:r}=dPe(o.name),l=fPe(s,n);if(l===0)continue;const a=l>=2?Array.from({length:n.length},(u,c)=>s.indexOf(n)+c):JV(s,n);i.push({skill:o,tier:l,positions:a.map(u=>r[u])})}return i}function hPe(e,t){return t.includes("/")?!0:e.name.toLowerCase().includes(t)}function aB(e){return e.kind==="directory"||e.path.endsWith("/")?"folder":"file"}function pPe(e){const{text:t,editorRef:n,searchFiles:i,skills:o,insertMention:s}=e,r=V(!1),l=V([]),a=V(""),u=V(!1),c=V([]),d=V(0),f=V(!1),h=D(()=>{const z=a.value,$=[],B=[];for(const ne of l.value){const W={kind:aB(ne),file:ne};(hPe(ne,z)?$:B).push(W)}const P=[],H=[],j=[],G=[];for(const{skill:ne,tier:W,positions:Q}of c.value){const te={kind:"skill",skill:ne,matchPositions:Q};W===4?P.push(te):W===3?H.push(te):W===2?j.push(te):G.push(te)}return[...P,...H,...$,...j,...G,...B]});let m=0,g=null,v=!1;function y(){const z=t.value,$=n.value?.selectionStart??z.length,B=n.value?.inlineTextRunStart?.()??0;let P=$-1;for(;P>=B&&!/\s/.test(z[P]);)P--;P++,P=Math.max(P,B);const H=z.slice(P,$);return!H.startsWith("@")&&!H.startsWith("@")?null:{token:H.slice(1),start:P,end:$}}function b(z){return z.kind==="skill"?`skill:${z.skill.name}`:`${z.kind}:${z.file.path}`}let w=!1,C=!1;We(d,()=>{C||(w=!0)},{flush:"sync"});function T(z){C=!0,d.value=z,C=!1}function N(z){w=!0,T(z)}function I(z){if(z===null||!w){T(0);return}const $=h.value.findIndex(B=>b(B)===z);T($===-1?0:$)}function S(z,$){const B=h.value[d.value],P=B?b(B):null;u.value=!1,a.value=$.toLowerCase(),l.value=z,I(P)}async function _(z,$){const B=++m,P=performance.now();f.value=!0,r.value=!0;const H=()=>{const j=y();return B===m&&j!==null&&j.token===$&&r.value};try{const j=await z($);H()&&S(j,$)}catch{H()&&S([],$)}finally{H()&&(console.debug(`[mention] search "${$}" → ${l.value.length} items in ${Math.round(performance.now()-P)}ms`),f.value=!1)}}function x(){const z=y(),$=i();if(v=!1,w=!1,!z){g=null,r.value=!1,f.value=!1,u.value=!1;return}const B=z.token;if(B!==g&&(l.value.length>0&&(u.value=!0),m+=1),g=B,c.value=B.length>0?lB(o?.()??[],B):[],T(0),!$){l.value=[],f.value=!1,u.value=!1,r.value=c.value.length>0;return}if(B.length===0){_($,B);return}c.value.length>0&&(r.value=!0),_($,B)}function E(){const z=y();if(!z)return;const $=h.value[d.value],B=$?b($):null;c.value=z.token.length>0?lB(o?.()??[],z.token):[],I(B)}We(()=>o?.(),()=>{v||E()});function M(z){if(z.kind==="skill")return{kind:"skill",name:z.skill.name};const $=z.file.path;return{kind:aB(z.file),path:$,name:z.file.name||$.split("/").filter(Boolean).pop()||$}}function R(){v=!0,w=!1,r.value=!1,f.value=!1,u.value=!1,l.value=[],g=null,m+=1}function q(z){const $=y();if(!$||z.kind!=="skill"&&u.value)return;if(R(),s){s(M(z),{start:$.start,end:$.end});return}if(z.kind==="skill")return;const B=t.value;t.value=B.slice(0,$.start)+z.file.path+B.slice($.end),ft(()=>{const P=n.value;if(!P)return;const H=$.start+z.file.path.length;P.setSelectionRange(H,H),P.focus()})}return{open:r,items:h,fileItems:l,fileStale:u,skillItems:c,active:d,loading:f,update:x,close:R,select:q,navigate:N,getToken:y}}const p1=ao(new Map);function uB(e){return e.split(/[\\/]+/).filter(Boolean).at(-1)??e}const Fp={diff:{type:"diff",policy:"singleton",title:(e,t)=>t("panel.tabs.diff"),icon:"git-fork",i18nKey:"panel.tabs.diff",restorable:!1},file:{type:"file",policy:"keyed",keyOf:e=>e.path,title:e=>uB(e.path),icon:"file-text",i18nKey:"panel.tabs.file",restorable:!1},agent:{type:"agent",policy:"keyed",keyOf:e=>e.subagentId,title:(e,t)=>t("panel.tabs.agent"),icon:"robot",i18nKey:"panel.tabs.agent",restorable:!0},"turn-diff":{type:"turn-diff",policy:"singleton",title:e=>uB(e.change.path),icon:"file-edit",i18nKey:"panel.tabs.turnDiff",restorable:!1},compaction:{type:"compaction",policy:"keyed",keyOf:e=>e.turnId,title:(e,t)=>t("panel.tabs.compaction"),icon:"list",i18nKey:"panel.tabs.compaction",restorable:!0},btw:{type:"btw",policy:"always",title:(e,t)=>{const n=e.seq;return n===1?t("sideChat.title"):`${t("sideChat.title")} ${n}`},icon:"message",i18nKey:"sideChat.title",restorable:!0},term:{type:"term",policy:"always",title:(e,t)=>e?.title??t("panel.tabs.term"),icon:"terminal",i18nKey:"panel.tabs.term",restorable:!1}},mPe="kimi-web.file-preview-width",jf=320;function gPe({client:e,sideWidth:t,t:n,locale:i,onTabRemoved:o}){const{viewportWidth:s}=GV(),r=D(()=>Math.max(0,s.value-t.value)),l=D(()=>ZV(r.value,jf,jf));function a(Te){return LA(Math.round(Te),jf,l.value)}function u(){return a(r.value/2)}const c=D(()=>u()),d=V(jf),f=D(()=>LA(d.value,jf,l.value)),h=V(!1),m=Ya([]),g=V(null),v=V(!1),y=V(!1),b=V(0),w=D(()=>m.value.find(Te=>Te.id===g.value)??null),C=new Set(["agent","diff","turn-diff","compaction","btw","term"]);i!==void 0&&We(i,()=>{m.value=m.value.map(Te=>C.has(Te.type)?{...Te,title:x(Te.type,Te.payload)}:Te)});let T=0;function N(){return T+=1,`panel-tab-${T}`}function I(Te){const Fe=Fp[Te.type];return Fe.keyOf&&Te.payload!==void 0?Fe.keyOf(Te.payload):null}function S(Te,Fe){const Ve={id:N(),type:Te,title:x(Te,Fe),payload:Fe};return m.value=[...m.value,Ve],Ve}function _(Te){return e.activeAppTasks.value.find(Ve=>Ve.agentId===Te||Ve.id===Te||Ve.backgroundTaskId===Te)?.description||void 0}function x(Te,Fe){if(Te==="agent"&&Fe!==void 0){const Ve=Fe.subagentId,lt=ve(Ve).name??_(Ve);if(lt)return lt}return Fp[Te].title(Fe,n)}let E=null;function M(Te){const Fe=e.activeAppTasks.value.find(Ve=>Ve.agentId===Te||Ve.id===Te||Ve.backgroundTaskId===Te);return!Fe||Fe.kind==="subagent"&&Fe.agentId===Te}function R(Te){return e.activeAppTasks.value.find(Ve=>Ve.agentId===Te||Ve.id===Te||Ve.backgroundTaskId===Te)?.agentId??Te}function q(){const Te=w.value,Fe=v.value&&Te?.type==="agent"&&Te.payload!==void 0?Te.payload:null;E!==null&&Fe!==null&&E.sessionId===Fe.sessionId&&E.subagentId===Fe.subagentId&&E!==null&&M(E.subagentId)||(E&&(e.auxiliaryTranscripts.deactivate(E.sessionId,E.subagentId),E=null),Fe&&M(Fe.subagentId)&&(e.auxiliaryTranscripts.activate(Fe.sessionId,Fe.subagentId),E={sessionId:Fe.sessionId,subagentId:Fe.subagentId}))}We(()=>e.activeAppTasks.value,Te=>{let Fe=!1,Ve=!1,Ft=m.value.map(Lt=>{if(Lt.type!=="agent"||Lt.payload===void 0)return Lt;const Vt=Lt.payload,qt=Te.find(dt=>dt.backgroundTaskId===Vt.subagentId&&dt.agentId!==void 0),nn=qt&&qt.agentId!==Vt.subagentId?{...Vt,subagentId:qt.agentId}:Vt;nn!==Vt&&(Fe=!0);const it=x("agent",nn);return nn===Vt&&it===Lt.title?Lt:(Ve=!0,{...Lt,payload:nn,title:it})});if(Fe){const Lt=new Map;for(const qt of Ft){if(qt.type!=="agent")continue;const nn=I(qt);if(nn===null)continue;const it=Lt.get(nn);it?it.push(qt):Lt.set(nn,[qt])}const Vt=new Set;for(const qt of Lt.values()){if(qt.length<2)continue;const nn=qt.find(it=>it.id===g.value)??qt[0];for(const it of qt)it.id!==nn.id&&Vt.add(it.id)}Vt.size>0&&(Ft=Ft.filter(qt=>!Vt.has(qt.id)),Ve=!0)}Ve&&(m.value=Ft),q()});function z(Te,Fe){const Ve=Fp[Te];let lt;if(Ve.policy==="singleton")lt=m.value.find(Ft=>Ft.type===Te);else if(Ve.policy==="keyed"&&Fe!==void 0){const Ft=Ve.keyOf(Fe);lt=m.value.find(Lt=>Lt.type===Te&&I(Lt)===Ft)}if(lt){if(Fe!==void 0&<.payload!==Fe){const Ft={...lt,title:x(Te,Fe),payload:Fe};m.value=m.value.map(Lt=>Lt.id===Ft.id?Ft:Lt),lt=Ft}}else lt=S(Te,Fe);return $(lt.id),lt}function $(Te){m.value.some(Fe=>Fe.id===Te)&&(g.value=Te,v.value=!0,b.value+=1,q())}function B(Te,Fe){const Ve=S(Te,Fe);return g.value===null&&(g.value=Ve.id,v.value=!1),Ve}function P(Te){const Fe=m.value.findIndex(lt=>lt.id===Te);if(Fe===-1)return;const Ve=m.value[Fe];if(Ve.type==="btw"&&Ve.payload!==void 0?e.closeSideChat(Ve.payload.agentId):Ve.type==="diff"&&(Ae(),e.clearFileDiff()),m.value=m.value.filter(lt=>lt.id!==Te),g.value===Te){const lt=m.value[Math.min(Fe,m.value.length-1)];g.value=lt?.id??null}m.value.length===0&&(v.value=!1,y.value=!1),b.value+=1,o?.(Ve),q()}function H(){return v.value?(v.value=!1,y.value=!1,b.value+=1,q(),!0):!1}function j(){v.value=!0,b.value+=1,q()}function G(){g.value!==null&&(y.value=!y.value,y.value&&(v.value=!0),b.value+=1)}function ne(){y.value=!1,b.value+=1}function W(){b.value+=1}function Q(Te){const Fe=e.turns.value.find(Ve=>Ve.id===Te);return Fe?.role==="compaction"&&Fe.text?Fe.text:null}function te(Te){z("compaction",{turnId:Te.turnId})}function X(Te){const Fe=e.auxiliaryTranscripts.getEntry(Te.sessionId,Te.subagentId);return{entry:Fe,version:Fe?.version.value??0}}function ve(Te){const Fe=e.turns.value.flatMap(Ve=>Ve.tools??[]).find(Ve=>Ve.agentId===Te);if(!Fe)return{};try{const Ve=JSON.parse(Fe.arg);return{name:typeof Ve.description=="string"?Ve.description:void 0,subagentType:typeof Ve.subagent_type=="string"?Ve.subagent_type:void 0,prompt:typeof Ve.prompt=="string"?Ve.prompt:void 0,model:typeof Ve.model=="string"?Ve.model:void 0,thinking:typeof Ve.thinking=="string"?Ve.thinking:void 0,status:Fe.status,outputLines:Fe.output}}catch{return{}}}function ce(Te,Fe){const Ve=Te?.channel;if(Ve===void 0||Ve.loading||Ve.snapshot.hasMoreOlder)return Fe;const lt=Ve.snapshot.items.find(Lt=>Lt.kind==="turn"),Ft=lt?.kind==="turn"?lt.prompt:void 0;return Ft!==void 0&&Ft.length>0?Ft:Fe}function se(Te){const Fe={...Te,subagentId:R(Te.subagentId)},{entry:Ve}=X(Fe),lt=e.activeAppTasks.value.find(mi=>mi.agentId===Te.subagentId||mi.id===Te.subagentId||mi.backgroundTaskId===Te.subagentId);if(lt){const mi=bCe(lt,e.findBashCommandForTask(lt));if(lt.kind==="subagent"){const Hi=ve(mi.id);mi.prompt??=ce(Ve,Hi.prompt),mi.model??=Hi.model,mi.thinkingEffort??=Hi.thinking}return mi}const Ft=Ve?.channel,Lt=Ft?.agents.find(mi=>mi.agentId===Te.subagentId),Vt=Ft?.refreshError??!1,qt=Ft===void 0||Ft.loading,nn=Ft?.snapshot.meta.activity==="turn",it=ve(Te.subagentId),dt=Ft?.snapshot.items.findLast(mi=>mi.kind==="turn"),At=dt?.kind==="turn"&&dt.state==="cancelled",un=dt?.kind==="turn"&&dt.state==="failed"||it.status==="error",Qt=nn?"working":At?"cancelled":un?"failed":qt?"queued":Vt&&it.status===void 0?"failed":"completed",ei=nn?"running":At?"cancelled":un?"failed":qt?"running":Vt&&it.status===void 0?"failed":"completed";return{id:Te.subagentId,kind:"subagent",name:Lt?.label??it.name??Te.subagentId,subagentType:it.subagentType??(Lt?.type==="sub"?"subagent":Lt?.type),model:it.model,thinkingEffort:it.thinking,prompt:ce(Ve,it.prompt),phase:Qt,status:ei,outputLines:it.outputLines}}function pe(Te){const Fe=X(Te).entry;if(!Fe)return[];const Ve=Fe.channel.agents.find(lt=>lt.agentId===Te.subagentId);return DCe(Fe.channel.snapshot,e.getFileUrl,Ve,{sessionId:Te.sessionId,getSessionMediaUrl:e.getSessionMediaUrl})}const Z=Te=>X(Te).entry?.channel.loading??!1,ae=Te=>X(Te).entry?.channel.refreshError??!1,K=Te=>X(Te).entry?.channel.loadingOlder??!1,re=Te=>X(Te).entry?.channel.loadOlderError??!1,we=Te=>X(Te).entry?.channel.snapshot.hasMoreOlder??!1,be=Te=>X(Te).entry?.channel.snapshot.meta.activity==="turn";function ke(Te){const Fe=X(Te).entry;Fe&&Fe.channel.loadOlder().catch(()=>{})}function oe(Te){const Fe=e.activeSessionId.value;if(!Te||!Fe)return;const Ve=R(Te);z("agent",{sessionId:Fe,subagentId:Ve})}const le=V("list"),ye=V(null);function Ae(){le.value="list",ye.value=null}function Me(){m.value.some(Fe=>Fe.type==="diff")||Ae(),z("diff",{}),e.loadGitStatus(e.activeSessionId.value)}function fe(){const Te=m.value.find(Fe=>Fe.type==="diff");Te&&P(Te.id)}async function ie(Te){le.value="detail",ye.value=Te,await e.loadFileDiff(Te)}function Ee(Te){const Fe=w.value;if(v.value&&Fe?.type==="turn-diff"&&Fe.payload!==void 0&&Fe.payload.change===Te.change){P(Fe.id);return}z("turn-diff",{turnId:Te.turnId,change:Te.change})}function qe(Te){z("file",{...Te})}async function ze(Te){const Fe=b.value,Ve=(Lt,Vt)=>{const qt={parentId:Vt,agentId:Lt.agentId,seq:Lt.seq};b.value===Fe?z("btw",qt):B("btw",qt)};if(!e.activeSessionId.value&&e.activeWorkspaceId.value){const Lt=await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,Te);if(!Lt)return{sessionId:null,agentId:null};const Vt=Lt.sessionId;return e.activeSessionId.value!==Vt?(Lt.target&&ht(Vt,{parentId:Vt,agentId:Lt.target.agentId,seq:Lt.target.seq}),{sessionId:Vt,agentId:Lt.target?.agentId??null}):(Lt.target&&Ve(Lt.target,Vt),{sessionId:Vt,agentId:Lt.target?.agentId??null})}const lt=e.activeSessionId.value;if(!lt)return{sessionId:null,agentId:null};const Ft=await e.openSideChatOn(lt,Te);return Ft.target&&!Ft.sent&&Te&&p1.set(Ft.target.agentId,Te),Ft.target&&e.activeSessionId.value!==lt?(ht(lt,{parentId:lt,agentId:Ft.target.agentId,seq:Ft.target.seq}),{sessionId:lt,agentId:Ft.target.agentId}):(Ft.target&&Ve(Ft.target,lt),{sessionId:lt,agentId:Ft.target?.agentId??null})}function ht(Te,Fe){const Ve=gt[Te]??{tabs:[],activeIndex:null,visible:!1};Ve.tabs=[...Ve.tabs.filter(lt=>!(lt.type==="btw"&<.payload.agentId===Fe.agentId)),{type:"btw",payload:Fe}],gt[Te]=Ve}const gt={};function _t(Te){const Fe=m.value.filter(lt=>Fp[lt.type].restorable&<.payload!==void 0);if(Fe.length===0){delete gt[Te];return}const Ve=Fe.findIndex(lt=>lt.id===g.value);gt[Te]={tabs:Fe.map(lt=>({type:lt.type,payload:lt.payload})),activeIndex:Ve===-1?null:Ve,visible:v.value}}function $t(Te){const Fe=gt[Te];if(!Fe)return;const Ve=e.sideChatTargetsOfSession(Te);let lt=null;const Ft=new Map;Fe.tabs.forEach((Lt,Vt)=>{let qt=Lt.payload;if(Lt.type==="agent")qt={sessionId:Te,subagentId:R(qt.subagentId)};else if(Lt.type==="btw"){const At=qt;if(!Ve.some(un=>un.agentId===At.agentId))return}const nn=Fp[Lt.type].keyOf,it=nn!==void 0&&qt!==void 0?`${Lt.type}:${nn(qt)}`:null;if(it!==null){const At=Ft.get(it);if(At!==void 0){Fe.activeIndex===Vt&&(lt=At);return}}const dt=S(Lt.type,qt);it!==null&&Ft.set(it,dt.id),Fe.activeIndex===Vt&&(lt=dt.id)}),m.value.length!==0&&(g.value=lt??m.value.at(-1).id,v.value=Fe.visible&<!==null,q())}const jt="__draft__:",Ht=D(()=>e.activeSessionId.value||`${jt}${e.activeWorkspaceId.value??"none"}`);return We(Ht,(Te,Fe)=>{const Ve=Fe.startsWith(jt)?null:Fe,lt=Te.startsWith(jt)?null:Te;Ve&&_t(Ve);const Ft=e.getDraftPromotion(),Lt=Fe.startsWith(jt)?Fe.slice(jt.length):null,Vt=!Ve&<!==null&&Ft!==null&&Ft.sessionId===lt&&Ft.workspaceId===Lt;Vt||(b.value+=1);const qt=Vt?m.value.filter(nn=>nn.type==="term"):[];for(const nn of m.value)qt.includes(nn)||o?.(nn);m.value=qt,qt.length===0?(g.value=null,v.value=!1,y.value=!1):qt.some(nn=>nn.id===g.value)||(g.value=qt.at(-1).id),Ae(),e.clearFileDiff(),q(),lt&&$t(lt)}),{PREVIEW_WIDTH_KEY:mPe,PREVIEW_MIN:jf,previewDefaultWidth:c,previewMax:l,previewWidth:d,previewPanelWidth:f,panelDragging:h,panelTabs:m,activeTabId:g,activeTab:w,panelVisible:v,panelExpanded:y,panelInteractionVersion:a9(b),openTab:z,closeTab:P,activateTab:$,addTabInBackground:B,hidePanel:H,showPanel:j,toggleExpanded:G,compactionPanelTextOf:Q,openCompactionPanel:te,agentPanelMemberOf:se,agentPanelTurnsOf:pe,agentPanelLoadingOf:Z,agentPanelLoadErrorOf:ae,agentPanelLoadingMoreOf:K,agentPanelLoadMoreErrorOf:re,agentPanelHasMoreOf:we,agentPanelRunningOf:be,loadOlderAgentMessages:ke,openAgentPanel:oe,detailDiffMode:le,detailDiffPath:ye,openDiffDetail:Me,closeDiffDetail:fe,selectDiffFile:ie,openTurnDiff:Ee,openFilePreview:qe,openSideChatTab:ze,leaveChatView:ne,bumpInteractionVersion:W}}const vPe=xn.sidebarWidth,cB=xn.sidebarCollapsed,dB=270,m5=220,yPe=480,kPe=320;function bPe(e={}){const{viewportWidth:t}=GV(),n=V(dB),i=V(!1),o=V(!1),s=D(()=>{const c=kPe+(Fa(e.previewOpen)?jf:0);return Math.min(yPe,ZV(t.value,m5,c))}),r=D(()=>LA(n.value,m5,s.value));function l(){try{i.value=ps(cB)==="true"}catch{i.value=!1}}function a(){try{ds(cB,String(i.value))}catch{}}function u(){i.value=!i.value,a()}return{SIDEBAR_WIDTH_KEY:vPe,SIDEBAR_DEFAULT:dB,SIDEBAR_MIN:m5,sidebarMax:s,sessionColWidth:n,sidebarCollapsed:i,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:u}}const wPe=40409;function fB(e){return qi(e)&&e.code===wPe}function hB(e){return e.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith("\\\\")}function pB(e){if(e.startsWith("\\\\"))return e;const t=/^[a-zA-Z]:/.test(e)?e.slice(0,2):"",n=[];for(const i of e.slice(t.length).split(/[\\/]+/))if(!(!i||i===".")){if(i===".."){n.pop();continue}n.push(i)}return t?`${t}/${n.join("/")}`:`/${n.join("/")}`}function CPe({client:e,t}){const n=V(null),i=V(null),o=V(!1),s=V(null),r=V(null);let l=0;const a=D(()=>{const w=r.value;return w?e.getFileDownloadUrl(w):null}),u=D(()=>n.value!==null&&r.value!==null);function c(w){return w.length>1?w.replace(/\/+$/,""):w}function d(w){const C=Ck(w,e.status.value.cwd);return C===null||C.split(/[\\/]+/).includes("..")?null:f(C)||null}function f(w){const C=[];for(const T of w.split(/[\\/]+/))if(!(!T||T===".")){if(T===".."){C.pop();continue}C.push(T)}return C.join("/")}function h(w){const C=w.trim();if(!C)return{error:t("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(C))return{error:t("filePreview.errors.unsupportedPath")};if(C.startsWith("~"))return{error:t("filePreview.errors.outsideWorkspace")};const T=c(e.status.value.cwd);if(C.startsWith("/")){if(!T||C!==T&&!C.startsWith(`${T}/`))return{error:t("filePreview.errors.outsideWorkspace")};const I=C===T?"":C.slice(T.length+1);if(I.split(/[\\/]+/).includes(".."))return{error:t("filePreview.errors.outsideWorkspace")};const S=f(I);return S?{path:S}:{error:t("filePreview.errors.isDirectory")}}if(C.split(/[\\/]+/).includes(".."))return{error:t("filePreview.errors.outsideWorkspace")};const N=f(C);return N?{path:N}:{error:t("filePreview.errors.emptyPath")}}async function m(w){const C=++l;if(i.value=null,s.value=null,o.value=!0,n.value=w,r.value=null,typeof w.content=="string"){o.value=!1,i.value={path:w.path,content:w.content,encoding:"utf-8",mime:"text/markdown",isBinary:!1,size:w.content.length};return}if(!hB(w.path)&&w.path.split(/[\\/]+/).includes("..")){const N=c(e.status.value.cwd);N&&(w={...w,path:pB(`${N}/${w.path}`)})}if(hB(w.path)){w={...w,path:pB(w.path)};const N=d(w.path);if(N!==null)w={...w,path:N};else{try{const I=await e.readHostFileContent(w.path);if(C!==l)return;r.value=null,i.value={path:w.path,content:I.content,encoding:I.encoding,mime:I.mime,isBinary:I.isBinary,size:I.size}}catch(I){if(C!==l)return;s.value=fB(I)?t("filePreview.errors.notFound"):i4e(I)?t("filePreview.errors.tooLarge"):I instanceof Error?I.message:t("filePreview.errors.loadFailed")}finally{C===l&&(o.value=!1)}return}}const T=h(w.path);if("error"in T){o.value=!1,s.value=T.error;return}r.value=T.path;try{const N=await e.readFileContent(T.path);if(C!==l)return;N?i.value={...N,path:N.path||T.path}:s.value=t("filePreview.errors.loadFailed")}catch(N){if(C!==l)return;s.value=fB(N)?t("filePreview.errors.notFound"):N instanceof Error?N.message:t("filePreview.errors.loadFailed")}finally{C===l&&(o.value=!1)}}function g(){l+=1,n.value=null,r.value=null,i.value=null,s.value=null,o.value=!1}function v(){g()}function y(){const w=i.value?.path??n.value?.path;w&&e.openWorkspaceFile(w,n.value?.line)}function b(){const w=i.value?.path??n.value?.path;w&&e.revealWorkspaceFile(w)}return{previewTarget:n,previewFile:i,previewLoading:o,previewError:s,previewDownloadUrl:a,previewExternalActions:u,openFilePreview:m,closeFilePreview:v,openPreviewInEditor:y,revealPreviewFile:b}}function APe(e){const t=e.replace(/[/\\]+$/,"");return t===""?e:t.split(/[/\\]/).pop()??t}function xPe(e,t){return e!==""?e:t?`${APe(t)} | Kimi Code`:"Kimi Code"}function SPe(e){return D(()=>xPe(Fa(e.webTitle),Fa(e.activeWorkspaceRoot)))}function _Pe({running:e,title:t="Kimi Code"}){if(qh){p0(()=>{typeof document<"u"&&(document.title=Fa(t))});return}const n=["◐","◓","◑","◒"],i=V(0);let o=null;function s(){o===null&&(i.value=0,o=setInterval(()=>{i.value=(i.value+1)%n.length},250))}function r(){o!==null&&(clearInterval(o),o=null),i.value=0}We(e,a=>{a?s():r()},{immediate:!0});const l=D(()=>`${e.value?`${n[i.value]} `:""}${Fa(t)}`);p0(()=>{typeof document<"u"&&(document.title=l.value)}),Ln(()=>{r()})}function MPe(e,t,n){return e==="idle"&&!t&&!n}function Hx(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function IPe(e,t){return{title:e("settings.notifyTitle"),body:Hx(t,e("settings.notifyFallback"))}}function TPe(e,t,n){return{title:e("settings.notifyQuestionTitle"),body:Hx(n,t,e("settings.notifyQuestionFallback"))}}function EPe(e,t,n){return{title:e("settings.notifyApprovalTitle"),body:Hx(n,t,e("settings.notifyApprovalFallback"))}}const df=Symbol("pinScroll"),XV=Symbol("resolveAgentTaskId"),eK=Symbol("resolveAgentModel"),tK=Symbol("resolveAgentTaskState"),Wx=Symbol("resolveDetachableTask"),nK=Symbol("resolveSwarmMembers"),im=Symbol("modelDisplay"),om=Symbol("subagentEffort");function iK(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":"file"}function LPe(e,t){const n=t.kind??"file",i=t.path===null?void 0:wx(t.path);if(i!==void 0){const s=f1({kind:n,path:i,attId:""}),r=e.findLast(l=>l.key===s&&l.kind===n);if(r){const l=r.size!==void 0&&r.size!==t.size||r.lastModified!==void 0&&t.lastModified!==void 0&&r.lastModified!==t.lastModified;if(!(r.uploading&&l))return{attId:r.attId,entry:null,startUpload:!r.uploading&&(l||r.error!==void 0||r.fileId===void 0)}}}else{let s=e.filter(r=>r.kind===n&&r.path===void 0&&r.error!==void 0&&!r.uploading&&r.name===t.name&&(r.size===void 0||r.size===t.size));if(s.length>1&&t.lastModified!==void 0){const r=s.filter(l=>l.lastModified===t.lastModified);r.length===1&&(s=r)}if(s.length===1)return{attId:s[0].attId,entry:null,startUpload:!0}}const o=Nu();return{attId:o,entry:{attId:o,key:f1({kind:n,path:i,attId:o}),kind:n,name:t.name,size:t.size,mediaType:t.mediaType,lastModified:t.lastModified,path:i,refCount:1,uploading:!0},startUpload:!0}}function NPe(e,t){const n=wx(t),i=n.split("/").pop()??t,o=i===""?n:`${i}/`,s=f1({kind:"folder",path:n,attId:""}),r=e.find(a=>a.key===s);if(r)return{attId:r.attId,name:o,entry:null};const l=Nu();return{attId:l,name:o,entry:{attId:l,key:s,kind:"folder",name:o,path:n,refCount:1,uploading:!1}}}function DPe(e,t,n){const i=new Map(t.map(l=>[l.attId,l])),o=[],s=[],r=[];for(const l of e){const a=i.get(l);a&&a.kind!=="folder"&&(a.uploading||a.error!==void 0||a.fileId===void 0||n!==void 0&&a.sessionId!==void 0&&a.sessionId!==n.sessionId||(o.push({fileId:a.fileId,kind:a.kind,sessionId:a.sessionId,name:a.name,mediaType:a.mediaType,size:a.size}),a.kind==="file"?s.push(l):r.push(l)))}return{promptAttachments:o,fileAttIds:s,mediaAttIds:r}}function FPe(e,t,n){let i=!1,o=!1;for(const r of e)r.uploading&&(i=!0),r.error!==void 0&&(o=!0),n!==void 0&&r.sessionId!==void 0&&r.sessionId!==n.sessionId&&(o=!0);let s=!1;if(t!==void 0){const r=new Set(e.map(l=>l.attId));s=t.some(l=>!r.has(l))}return{uploading:i,errored:o,missing:s}}function BPe(e,t,n){return e.map(i=>i.attId===t?{...i,...n}:i)}function oK(e){return e.inlineAttachments!==void 0?[...e.inlineAttachments]:[...e.attachments??[]]}function RPe(e){const t=[];let n=0,i=0;for(const o of e){const s=o.kind==="image"||o.kind==="video";if(!s&&o.kind!=="file")continue;const r=s?`m${++i}`:String(++n);if(o.fileId===void 0)continue;const l=s?o.kind:"file";t.push({attId:r,key:o.sessionId!==void 0?`blob:${o.sessionId}:${o.fileId}`:`blob:${o.fileId}`,kind:l,name:o.name??o.kind,size:o.size,mediaType:o.mediaType,refCount:1,uploading:!1,fileId:o.fileId,sessionId:o.sessionId})}return t}function OPe(e,t){const n=[];let i=0;for(const o of e)o.kind==="file"&&(i+=1,o.fileId!==void 0&&(t.has(String(i))||n.push({att:o,ordinal:i})));return n}function $Pe(e,t){const n=[];let i=0;for(const o of e)o.kind!=="image"&&o.kind!=="video"||(i+=1,t.has(`m${i}`)||n.push({att:o,ordinal:i}));return n}function qx(e,t){const n=t.kind==="file"?void 0:t.sessionId;return{kind:t.kind,url:n?e.getSessionMediaUrl(n,t.fileId):e.getFileUrl(t.fileId),fileId:t.fileId,sessionId:n,name:t.name,mediaType:t.mediaType,size:t.size}}function B4(e){const t=[];for(const n of e??[])n.kind==="video"?t.push({type:"video",source:n.sessionId?{kind:"sessionMedia",fileId:n.fileId}:{kind:"file",fileId:n.fileId}}):n.kind==="file"?t.push({type:"file",fileId:n.fileId,name:n.name??"",mediaType:n.mediaType||"application/octet-stream",size:n.size??0}):t.push({type:"image",source:n.sessionId?{kind:"sessionMedia",fileId:n.fileId}:{kind:"file",fileId:n.fileId}});return t}function PPe(e){const{api:t,uploadImage:n,sessionId:i,insertFolderPaths:o,insertFileAttachment:s,adoptFileAttachment:r,adoptMediaAttachment:l}=e,a=V(null),u=V(!1);function c(z){const $=Tc(GI(z));if(!Array.isArray($)||$.length===0)return null;const B=[];for(const P of $)!P||typeof P.fileId!="string"||P.fileId===""||P.kind!=="image"&&P.kind!=="video"&&P.kind!=="file"||B.push({fileId:P.fileId,kind:P.kind,name:typeof P.name=="string"&&P.name!==""?P.name:P.kind,mediaType:typeof P.mediaType=="string"?P.mediaType:void 0,size:typeof P.size=="number"?P.size:void 0,sessionId:typeof P.sessionId=="string"?P.sessionId:void 0});return B.length===0?null:B}let d=null;function f(z){for(const $ of z){const B=qx(t,$);B.kind==="file"?r?.(B):l?.(B)}}function h(z){const $=c(z);$&&((r!==void 0||l!==void 0)&&(d={sid:z,drafts:$}),xr(GI(z)))}function m(){const z=d;d=null,!(!z||z.sid!==(i()??""))&&f(z.drafts)}function g(z){return z<1024*1024?"<1mb":z<10*1024*1024?"1-10mb":z<50*1024*1024?"10-50mb":"50mb+"}function v(z,$,B){if(!s||!n()||z.length===0)return;let P=!1;for(const H of z)s(H,nI(H),P?void 0:B)&&(P=!0,iK(H.type),g(H.size),Math.min(z.length,100),void 0)}function y(){a.value?.click()}function b(z){const $=z.target,B=Array.from($.files??[]);v(B),$.value=""}function w(z){const $=z.clipboardData;if(!$)return;const{items:B,folderPaths:P,hasFolders:H}=Noe($),j=B.some(W=>W.kind==="file")&&n();(P.length>0||H||j)&&z.preventDefault();let G=[];const ne=()=>{G.length!==0&&(v(C(G)),G=[])};for(const W of B)W.kind==="folder"?(ne(),o?.([W.path])):j&&G.push(W.file);ne()}function C(z){return z.map($=>{if($.name.includes(".")||nI($)!==null)return $;const B=$.type.split("/")[1]??"png";return new File([$],`paste-${Date.now()}.${B}`,{type:$.type})})}let T=0;function N(z){!n()||!Array.from(z.dataTransfer?.items??[]).some(B=>B.kind==="file")||(z.preventDefault(),z.stopPropagation(),u.value=!0)}function I(){u.value=!1}function S(z,$,B){let P=[],H=$;const j=()=>{P.length!==0&&(v(P,"drop",H),H=void 0,P=[])};for(const G of z)G.kind==="folder"?(j(),o?.([G.path]),H=void 0):B&&P.push(G.file);j()}function _(z){T=0,u.value=!1;const{items:$,folderPaths:B}=xw(z);B.length>0&&(z.preventDefault(),z.stopPropagation());const P=n();P&&(z.preventDefault(),z.stopPropagation()),S($,{clientX:z.clientX,clientY:z.clientY},!!P)}function x(z){return Array.from(z.dataTransfer?.items??[]).some($=>$.kind==="file")}function E(z){!n()||!x(z)||(z.preventDefault(),T+=1,u.value=!0)}function M(z){!n()||!x(z)||z.preventDefault()}function R(z){!n()||!x(z)||(T=Math.max(0,T-1),T===0&&(u.value=!1))}function q(z){T=0,u.value=!1;const{items:$,folderPaths:B}=xw(z);B.length>0&&z.preventDefault();const P=n();P&&z.preventDefault(),S($,{clientX:z.clientX,clientY:z.clientY},!!P)}return We(i,()=>{h(i()??"")}),h(i()??""),kn(()=>{document.addEventListener("paste",w),document.addEventListener("dragenter",E),document.addEventListener("dragover",M),document.addEventListener("dragleave",R),document.addEventListener("drop",q)}),Ln(()=>{document.removeEventListener("paste",w),document.removeEventListener("dragenter",E),document.removeEventListener("dragover",M),document.removeEventListener("dragleave",R),document.removeEventListener("drop",q)}),{fileInputRef:a,isDragOver:u,openFilePicker:y,handleFileInputChange:b,handleDragOver:N,handleDragLeave:I,handleDrop:_,adoptStoredDrafts:m}}const zPe=3;function sK(e){const t=V("starting"),n=V(!1),i=V(null),o=V(0),s=V(!1);let r=null,l=null,a=null,u=0,c=0,d=!1,f,h=!1,m=null,g=!1;function v(){r&&(clearTimeout(r),r=null),l&&(clearInterval(l),l=null),a&&(clearTimeout(a),a=null)}function y(_){v(),w(),t.value="success",a=setTimeout(()=>{a=null,e.onSuccess?.()},_)}function b(){l&&clearInterval(l),l=setInterval(()=>{o.value>0?o.value--:(l&&clearInterval(l),l=null)},1e3)}function w(){m?.(),m=null}async function C(_){h=!0;try{const x=await e.onPollOAuthLogin();if(g||d)return;if(x===null){if(u+=1,u>=zPe){v(),w(),n.value=!0,t.value="error",e.autoOpen?.settle(!1,{keepNavigated:!0}),Date.now()-c;return}T(_);return}u=0,x.status==="authenticated"?y(1200):x.status==="denied"?(v(),w(),t.value="denied",e.autoOpen?.settle(!1),Date.now()-c,void 0):x.status==="expired"||x.status==="cancelled"?(v(),w(),t.value="expired",e.autoOpen?.settle(!1),Date.now()-c,x.status,void 0):T(_)}finally{h=!1}}function T(_){r&&clearTimeout(r),r=setTimeout(()=>{r=null,C(_)},_*1e3)}function N(){t.value!=="device-code"||i.value===null||d||h||(r&&(clearTimeout(r),r=null),C(i.value.interval))}async function I(_){_!==void 0&&(f=_),v(),w(),i.value=null,n.value=!1,u=0,d=!1,c=Date.now(),t.value="starting",s.value=!1,e.autoOpen?.onGesture?.();const x=await e.onStartOAuthLogin(f);if(g){x!==null&&x.status!=="authenticated"&&e.onCancelOAuthLogin();return}if(!x){t.value="error",e.autoOpen?.settle(!1);return}if(x.status==="authenticated"){e.autoOpen?.settle(!0),y(800);return}if(i.value={flowId:x.flowId,verificationUri:x.verificationUri,verificationUriComplete:x.verificationUriComplete,userCode:x.userCode,expiresIn:x.expiresIn,interval:x.interval},o.value=x.expiresIn,t.value="device-code",e.autoOpen){const E=e.autoOpen.openUrl(x.verificationUriComplete,x.flowId);if(E===!1)s.value=!0;else if(E instanceof Promise){const M=x.flowId;E.then(R=>{!R&&!g&&i.value?.flowId===M&&(s.value=!0)})}}b(),T(x.interval),m=e.authWake?.subscribe(N)??null}function S(){t.value!=="success"&&(v(),w(),e.autoOpen?.settle(!1),t.value==="device-code"&&!d&&(d=!0,e.onCancelOAuthLogin()))}return av()&&Gd(()=>{g=!0,S()}),{step:t,pollError:n,flow:i,secondsLeft:o,autoOpenBlocked:s,startFlow:I,cancelFlow:S,pollNow:N}}const jPe={state:"idle"};function HPe(e){const t=V(jPe),n=V(ps(xn.updateSkippedVersion)),i=V(!1);if(typeof e?.getUpdateAutoDownload=="function"&&e.getUpdateAutoDownload().then(s=>{i.value=s}).catch(()=>{}),e!==void 0){let s=!1;e.onUpdateStatus(r=>{s=!0,t.value=r}),e.getUpdateStatus().then(r=>{s||(t.value=r)}).catch(()=>{})}const o=D(()=>{const s=t.value;return!(s.state==="idle"||s.state==="available"&&s.version!==void 0&&s.version===n.value)});return{status:t,visible:o,canCheck:typeof e?.checkForUpdates=="function",autoDownload:i,canToggleAutoDownload:typeof e?.getUpdateAutoDownload=="function"&&typeof e?.setUpdateAutoDownload=="function",setAutoDownload:(s,r)=>{i.value=s,typeof e?.setUpdateAutoDownload=="function"&&e.setUpdateAutoDownload(s).then(()=>{}).catch(()=>{})},skipVersion:()=>{const s=t.value.version;t.value.state==="available"&&s!==void 0&&(n.value=s,ds(xn.updateSkippedVersion,s))},check:async()=>{if(typeof e?.checkForUpdates!="function")return Promise.resolve({outcome:"unsupported"});const s=await e.checkForUpdates().catch(()=>({outcome:"error",message:"bridge call failed"}));return s.outcome==="available"&&s.version!==void 0&&s.version===n.value&&(n.value=null,xr(xn.updateSkippedVersion)),s},download:()=>{e?.downloadUpdate().catch(()=>{})},install:()=>{e?.installUpdate().catch(()=>{})}}}let g5=null;function WPe(){return g5===null&&(g5=HPe(window.kimiDesktop)),g5}class rK{transcript;sessionId;agentId;fetchPage;pageSize;onChange;onGap;onReset;refreshPromise=null;buffered=[];agents_=[];seq_;loadingOlder_=!1;loadOlderError_=!1;refreshError_=!1;constructor(t){this.sessionId=t.sessionId,this.agentId=t.agentId,this.transcript=new U4e(t.agentId),this.fetchPage=t.fetchPage,this.pageSize=t.pageSize??20,this.onChange=t.onChange,this.onGap=t.onGap,this.onReset=t.onReset}get snapshot(){return this.transcript.snapshot()}get seq(){return this.seq_}get agents(){return this.agents_}get loading(){return this.refreshPromise!==null}get loadingOlder(){return this.loadingOlder_||this.loadOlderTask_!==void 0}get loadOlderError(){return this.loadOlderError_}get refreshError(){return this.refreshError_}readChain=Promise.resolve();enqueueRead(t,n){const i=this.readChain.then(t).finally(()=>{n();const o=this.buffered;this.buffered=[];for(const s of o)this.applyOps(s.ops,s.seq);this.onChange?.()});return this.readChain=i.catch(()=>{}),i}refresh(){if(this.refreshPromise!==null)return this.refreshPromise;this.refreshError_=!1;const t=this.enqueueRead(async()=>{try{const n=await this.fetchPage({pageSize:this.pageSize});this.applyPage(n,!0)}catch(n){throw this.refreshError_=!0,n}},()=>{this.refreshPromise=null});return this.refreshPromise=t,this.onChange?.(),t}receiveReset(t,n){this.transcript.receive([{op:"reset",agentId:this.agentId,snapshot:t}]),n!==void 0&&(this.seq_=n),this.refreshError_=!1,this.onReset?.(),this.onChange?.()}applyOps(t,n){if(this.refreshPromise!==null||this.loadingOlder)return this.buffered.push({ops:t,...n!==void 0?{seq:n}:{}}),!1;if(n!==void 0&&this.seq_!==void 0){if(n<=this.seq_)return!0;if(n!==this.seq_+1)return this.onGap?.(),!1}const i=this.transcript.apply(t);return n!==void 0&&(this.seq_=n),i.gap!==void 0&&this.onGap?.(),i.accepted.length>0&&this.onChange?.(),i.gap===void 0}loadOlderTask_;async loadOlder(){if(!this.snapshot.hasMoreOlder||this.loadingOlder)return;const t=this.enqueueRead(async()=>{if(!this.snapshot.hasMoreOlder)return;const n=this.snapshot.items.find(i=>i.kind==="turn");if(n?.kind==="turn"){this.loadingOlder_=!0,this.loadOlderError_=!1,this.onChange?.();try{const i=await this.fetchPage({beforeTurn:n.turnId,pageSize:this.pageSize});this.applyPage(i,!1)}catch(i){throw this.loadOlderError_=!0,i}}},()=>{this.loadingOlder_=!1,this.loadOlderTask_=void 0});this.loadOlderTask_=t;try{await t}finally{this.loadOlderTask_===t&&(this.loadOlderTask_=void 0)}}settleOlder(){return this.loadOlderTask_??Promise.resolve()}applyPage(t,n){this.agents_=t.agents;const i=this.snapshot;if(n){this.receiveReset(t,t.seq);return}const o={...t,items:qPe(t.items,i.items),hasMoreOlder:t.hasMoreOlder};this.transcript.receive([{op:"reset",agentId:this.agentId,snapshot:o}]),this.refreshError_=!1,this.onChange?.()}}function qPe(e,t){const n=new Set,i=[];for(const o of[...e,...t]){const s=o.kind==="turn"?o.turnId:o.kind==="marker"?o.markerId:o.refId;n.has(s)||(n.add(s),i.push(o))}return i}function UPe(e){const t=Mh(new Map),n=Mh(new Map),i=new Map,o=new Set;let s=null,r=null;function l(){s!==null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s),s=null),r!==null&&(clearTimeout(r),r=null);for(const w of o)w.version.value+=1;o.clear()}function a(w){o.add(w),!(s!==null||r!==null)&&(typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(l)),r=setTimeout(l,50))}function u(w,C){return`${w}\0${C}`}function c(w,C,T){const N=e.getEventConnection();N!==null&&(N.subscribeTranscript(w,C,T),i.set(w,C))}function d(w,C){const T=u(w,C),N=t.get(T);if(N!==void 0)return N;const I={channel:new rK({sessionId:w,agentId:C,fetchPage:S=>e.api.getSessionTranscript(w,{...S,agentId:C}),onChange:()=>{a(I)},onGap:()=>{f(I)}}),version:V(0),baselineLoaded:!1,resumePromise:null};return t.set(T,I),I}async function f(w){if(w.resumePromise!==null)return w.resumePromise;const C=h(w).finally(()=>{w.resumePromise===C&&(w.resumePromise=null)});return w.resumePromise=C,C}async function h(w){const C=()=>t.get(u(w.channel.sessionId,w.channel.agentId))===w;try{await w.channel.refresh(),w.baselineLoaded=!0,C()&&n.get(w.channel.sessionId)===w.channel.agentId&&c(w.channel.sessionId,w.channel.agentId,w.channel.seq)}catch{C()&&n.get(w.channel.sessionId)===w.channel.agentId&&c(w.channel.sessionId,w.channel.agentId)}}function m(w,C){e.connectEventsIfNeeded();const T=i.get(w);T!==void 0&&T!==C&&(e.getEventConnection()?.unsubscribeTranscript(w,[T]),i.delete(w)),n.set(w,C);const N=d(w,C);return N.baselineLoaded?c(w,C,N.channel.seq):f(N),N}function g(w,C){if(n.get(w)!==C)return;n.delete(w);const T=i.get(w);T!==void 0&&(e.getEventConnection()?.unsubscribeTranscript(w,[T]),i.delete(w));const N=u(w,C),I=t.get(N);I!==void 0&&(t.delete(N),o.delete(I))}function v(w,C,T,N){if(n.get(w)!==C)return;const I=d(w,C);I.channel.receiveReset(T,N),I.baselineLoaded=!0}function y(w,C,T,N){return n.get(w)!==C?!0:d(w,C).channel.applyOps(T,N)}function b(w){n.delete(w),i.delete(w)&&e.getEventConnection()?.unsubscribeTranscript(w);for(const[C,T]of t)T.channel.sessionId===w&&(t.delete(C),o.delete(T))}return{getEntry:(w,C)=>t.get(u(w,C)),desiredAgentBySession:n,activate:m,deactivate:g,receiveReset:v,applyOps:y,forgetSession:b}}const Km="main",VPe=4;function KPe(e){const t=Mh(new Map),n=Mh(new Set),i=e.maxResidentSessions??VPe;let o=0;const s=new Map;function r(S){const _=s.get(S);_?.timer!=null&&clearTimeout(_.timer),s.delete(S)}const l=new Set,a=new Set;let u=null,c=null;function d(){u!==null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(u),u=null),c!==null&&(clearTimeout(c),c=null);for(const S of a)S.version.value+=1;a.clear()}function f(S){LCe(S.channel.snapshot,S.thinkingTiming),a.add(S),!(u!==null||c!==null)&&(typeof requestAnimationFrame=="function"&&(u=requestAnimationFrame(d)),c=setTimeout(d,50))}function h(S,_){const x=e.getEventConnection();x!==null&&(x.subscribeTranscript(S,Km,_),n.add(S))}function m(S){const _=t.get(S);if(_!==void 0)return _;const x=new Map,E={channel:new rK({sessionId:S,agentId:Km,fetchPage:M=>e.api.getSessionTranscript(S,{...M,agentId:Km}),onChange:()=>{f(E)},onReset:()=>{NCe(E.channel.snapshot,x)},onGap:()=>{if(E.resumePromise!==null){E.gapRetryPending=!0;return}v(E)}}),thinkingTiming:x,version:V(0),baselineLoaded:!1,resumePromise:null,gapRetryPending:!1,pendingReset:null,opsAfterReset:[],emptyResetRetries:0,recoveredViaEmptyReset:!1,lastTouchedSeq:0};return t.set(S,E),E}function g(S){const _=S.pendingReset;if(S.pendingReset=null,_===null||t.get(S.channel.sessionId)!==S)return;S.channel.receiveReset(_.snapshot,_.seq),S.baselineLoaded=!0,r(S.channel.sessionId),h(S.channel.sessionId,S.channel.seq);const x=S.opsAfterReset;S.opsAfterReset=[];for(const E of x)S.channel.applyOps(E.ops,E.seq)}async function v(S){if(S.resumePromise!==null)return S.resumePromise;const _=y(S).finally(()=>{S.resumePromise===_&&(S.resumePromise=null,g(S),S.gapRetryPending&&(S.gapRetryPending=!1,v(S)))});return S.resumePromise=_,_}async function y(S){const _=S.channel.sessionId;try{await S.channel.settleOlder().catch(()=>{});for(let x=0;x<3;x++){const E=e.getLocalTurnState?.(_);await S.channel.refresh();const M=e.getLocalTurnState?.(_);if(E===void 0||M===void 0||E.generation===M.generation&&E.pending===M.pending)break}!S.baselineLoaded&&S.emptyResetRetries>0&&(S.recoveredViaEmptyReset=!0),S.baselineLoaded=!0,S.emptyResetRetries=0,d(),t.get(_)===S&&(r(_),h(_,S.channel.seq))}catch(x){if(qi(x)&&x.code===40401){e.onSessionGone?.(_);return}if(S.baselineLoaded){t.get(_)===S&&h(_);return}if(t.get(_)!==S)return;if(t.delete(_),a.delete(S),l.has(_)){e.onBaselineError?.(_,x);return}{const E=s.get(_)??{attempt:0,timer:null};E.attempt+=1,s.set(_,E),E.attempt===1?e.onBaselineError?.(_,x):Ua("[kimi-code] transcript baseline retry failed",{sessionId:_,attempt:E.attempt,err:x}),E.timer=setTimeout(()=>{E.timer=null,s.get(_)===E&&t.get(_)===void 0&&v(m(_))},Math.min(E.attempt*2e3,15e3))}}}function b(){if(t.size<=i)return;const _=[...t.values()].sort((x,E)=>E.lastTouchedSeq-x.lastTouchedSeq).filter(x=>e.hasPendingLocalWork?.(x.channel.sessionId)!==!0);for(const x of _.slice(i)){const E=x.channel.sessionId;t.delete(E),a.delete(x),n.delete(E)&&e.getEventConnection()?.unsubscribeTranscript(E,[Km])}}function w(S){e.connectEventsIfNeeded(),r(S),l.delete(S);const _=m(S);return o+=1,_.lastTouchedSeq=o,_.baselineLoaded?h(S,_.channel.seq):v(_),b(),_}function C(S){r(S),l.add(S),b()}function T(S,_,x){const E=t.get(S);if(E!==void 0){if(_.items.length===0){E.emptyResetRetries+=1;const M=E.emptyResetRetries;setTimeout(()=>{t.get(S)===E&&v(E)},Math.min(M*2e3,15e3));return}if(E.resumePromise!==null){E.pendingReset!==null&&(E.opsAfterReset=[]),E.pendingReset={snapshot:_,seq:x};return}if(E.channel.loadingOlder){E.pendingReset!==null&&(E.opsAfterReset=[]),E.pendingReset={snapshot:_,seq:x},E.channel.settleOlder().catch(()=>{}).then(()=>{E.resumePromise===null&&g(E)});return}E.channel.receiveReset(_,x),E.baselineLoaded=!0,r(S)}}function N(S,_,x){const E=t.get(S);return E===void 0?!0:E.pendingReset!==null?(E.opsAfterReset.push({ops:_,...x!==void 0?{seq:x}:{}}),!0):E.channel.applyOps(_,x)}function I(S){r(S),l.delete(S);const _=t.get(S);_!==void 0&&(t.delete(S),a.delete(_)),n.delete(S)&&e.getEventConnection()?.unsubscribeTranscript(S,[Km])}return{getEntry:S=>t.get(S),activate:w,deactivate:C,receiveReset:T,applyOps:N,forgetSession:I,refreshSession:S=>{const _=t.get(S);return _===void 0?Promise.resolve():v(_)},trimResident:b,subscribedSessions:n}}const mB="main";function ZPe(e){let t=null;const n=e.getSharedConnection!==void 0,i=KPe({api:e.api,connectEventsIfNeeded:()=>{n?e.ensureSharedConnection?.():o()},getEventConnection:()=>n?e.getSharedConnection():t,maxResidentSessions:e.maxResidentSessions,onSessionGone:e.onSessionGone,getLocalTurnState:e.getLocalTurnState,hasPendingLocalWork:e.hasPendingLocalWork,onBaselineError:e.onBaselineError});function o(){t===null&&(t=e.api.connectTranscriptChannel({onTranscriptReset:(r,l,a,u)=>{l===mB&&i.receiveReset(r,a,u)},onTranscriptOps:(r,l,a,u)=>l===mB?i.applyOps(r,a,u):!0}))}function s(){n||t===null||t.health().stale&&t.reconnect()}return{pool:i,activate:r=>i.activate(r),deactivate:r=>i.deactivate(r),forgetSession:r=>i.forgetSession(r),trimResident:()=>i.trimResident(),recoverIfStale:s,close:()=>{n||t?.close()}}}const GPe=!1;function gB(e,t){let n=e;for(;n!==null;){const i=n.closest(t);if(i!==null)return i;const o=typeof n.getRootNode=="function"?n.getRootNode():null;n=o!==null&&typeof ShadowRoot<"u"&&o instanceof ShadowRoot?o.host:null}return null}const QPe=".file-preview .fp-body";function vB(e,t){let n=e;for(;n!==null;){if(n===t)return!0;if(n.parentElement){n=n.parentElement;continue}const i=typeof n.getRootNode=="function"?n.getRootNode():null;n=i!==null&&typeof ShadowRoot<"u"&&i instanceof ShadowRoot?i.host:null}return!1}function lK(e,t){if(e===null||e.isCollapsed||e.rangeCount===0||t===null)return!1;const n=e.getRangeAt(0),i=r=>typeof Element<"u"&&r instanceof Element?r:r?.parentElement??null,o=i(n.startContainer),s=i(n.endContainer);return o!==null&&s!==null&&vB(o,t)&&vB(s,t)}function v5(e,t,n,i,o=0){return Math.min(Math.max(e,o+i),Math.max(o+i,o+n-t-i))}function YPe(e,t){if(t.length===0||e===null||e.isCollapsed||e.rangeCount!==1)return;const n=e.getRangeAt(0),i=c=>{const d=typeof Element<"u"&&c instanceof Element?c:c?.parentElement??null;if(d===null)return null;const f=gB(d,"[data-line]");if(f===null||gB(f,"[data-quote-display-lines]")!==null)return null;const h=Number.parseInt(f.getAttribute("data-line")??"",10);return Number.isFinite(h)?{n:h,row:f}:null},o=i(n.startContainer),s=i(n.endContainer);if(o===null||s===null)return t;const[r,l]=o.n<=s.n?[o.n,s.n]:[s.n,o.n],a=n.endOffset===0&&l>r&&JPe(s.row,n.endContainer)?l-1:l,u=XPe(o.row,n.startContainer,n.startOffset)&&r`> ${t}`).join(` -`)}function lze(e){return`${rze(e)} +`)}function oze(e){return`${ize(e)} -`}function aze(e,t){return lze(e)+(t?.trim()??"")}function Fp(e){const t=hU(e);if(t.length===0)return e;let n="",i=0;const o=s=>{if(!/\S/.test(s)){n+=s;return}if(n.length>0){n=`${n.replace(/\n{0,2}$/,"")} +`}function sze(e,t){return oze(e)+(t?.trim()??"")}function Bp(e){const t=hU(e);if(t.length===0)return e;let n="",i=0;const o=s=>{if(!/\S/.test(s)){n+=s;return}if(n.length>0){n=`${n.replace(/\n{0,2}$/,"")} `,n+=s.replace(/^\n+/,"");return}n+=s};for(const s of t)o(e.slice(i,s.start)),i=s.end,e[i]===" "&&(i+=1),n.length>0&&!n.endsWith(` `)&&(n=`${n.replace(/[ \n]+$/,"")} -`),s.attrs.source!==void 0&&s.attrs.source.length>0&&(n+=`from: ${kx(s.attrs.source)} -`),n+=aze(s.attrs.text,s.attrs.comment);return o(e.slice(i)),n}function uze(e){const t=V(null),n=V(!1);let i;function o(m){}function s(m){n.value=!1,m!==void 0&&(m.clientX||m.clientY)&&(m.clientX,m.clientY)}function r(){n.value=!1}function l(m){m.key!=="Escape"&&(m.target instanceof Element&&m.target.closest(".sab")||(n.value=!0))}const a=250;let u=null;function c(){u!==null&&(clearTimeout(u),u=null)}function d(){u!==null&&clearTimeout(u),u=setTimeout(()=>{u=null;const m=document.activeElement;if(m instanceof Element&&m.closest(".sab"))return;const g=window.getSelection();if(g&&!g.isCollapsed&&!lK(g,e.root.value)){t.value=null;return}},a)}yn(()=>{}),Ln(()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("keyup",l),c()});function f(){t.value=null,c()}function h(m){t.value=null;const g=i;i=void 0,window.getSelection()?.removeAllRanges(),e.onAction(m,g)}return{selectionBubble:t,selectionKeyboard:n,onMouseup:s,onPointerdown:r,onBubbleClose:f,onBubbleAction:h}}const uK="kimi-web.turn-folding";function cze(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function dze(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function fze(){return cze(uK)==="1"}const cK=V(fze());function hze(e){cK.value=e,dze(uK,e?"1":"0")}function Vx(){return{turnFolding:cK,setTurnFolding:hze}}const dK="kimi-web.activity-run-folding";function pze(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function mze(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function gze(){return pze(dK)!=="0"}const fK=V(gze());function vze(e){fK.value=e,mze(dK,e?"1":"0")}function Kx(){return{activityRunFolding:fK,setActivityRunFolding:vze}}const yze={class:"ep-search"},kze=["placeholder"],bze={class:"ep-scroll"},wze={key:0,class:"ep-grid"},Cze=["onClick"],Aze={key:1,class:"ep-empty"},xze={class:"ep-label"},Sze={class:"ep-grid"},_ze=["onClick"],Mze={class:"ep-label"},Ize={class:"ep-grid"},Tze=["onClick"],vB="kimi-web.recent-emojis",Eze=lt({__name:"SessionEmojiPicker",props:{current:{default:null},removable:{type:Boolean,default:!0}},emits:["pick"],setup(e,{expose:t,emit:n}){const{t:i}=qt(),{handleCompositionStart:o,handleCompositionEnd:s,isComposingKeyEvent:r}=kl(),l=e,a=n,u=["⏳","⚠️","🐛","✨","🔥","🚀","🎯","🧪","📝","🔍","🛠️","💡","📦","🎨","🔒","📈","🧹","🚧","✅","❓","🌙","☕","🐳","🗂️","📊","🤖","🧩","⚙️","🌱","📌","💥","🕐"],c={faces:"sidebar.emojiGroupFaces",nature:"sidebar.emojiGroupNature",food:"sidebar.emojiGroupFood",activity:"sidebar.emojiGroupActivity",objects:"sidebar.emojiGroupObjects",symbols:"sidebar.emojiGroupSymbols"},d=goe.map(N=>({id:N,labelKey:c[N],emojis:WO.filter(I=>I.group===N).map(I=>I.emoji)})),f=V(h());function h(){try{const N=JSON.parse(localStorage.getItem(vB)??"[]");return Array.isArray(N)?N.filter(I=>typeof I=="string"):[]}catch{return[]}}function m(N,I){f.value=boe(f.value,N);try{localStorage.setItem(vB,JSON.stringify(f.value))}catch{}a("pick",N,I)}const g=V(""),v=D(()=>g.value.trim().length>0),y=D(()=>yoe(g.value)),b=V(null);yn(()=>b.value?.focus());function w(N){if(r(N))return;const I=y.value[0];v.value&&I&&m(I)}function C(){let N=l.current??void 0;for(;N===void 0||N===l.current;)N=u[Math.floor(Math.random()*u.length)];m(N,"random")}const T=V(null);return t({el:D(()=>T.value?.el),isComposingKeyEvent:r}),(N,I)=>(k(),de(p(zs),{ref_key:"menuRef",ref:T,class:"emoji-picker",role:"dialog","aria-label":p(i)("sidebar.sessionEmojiTitle"),onKeydown:I[4]||(I[4]=Tt(()=>{},["stop"]))},{default:ce(()=>[A("div",yze,[U(p(Ce),{name:"search",size:"sm"}),ai(A("input",{ref_key:"inputRef",ref:b,"onUpdate:modelValue":I[0]||(I[0]=S=>g.value=S),class:"ep-input",type:"text",placeholder:p(i)("sidebar.searchEmoji"),autocomplete:"off",spellcheck:"false",onKeydown:Qo(w,["enter"]),onCompositionstart:I[1]||(I[1]=(...S)=>p(o)&&p(o)(...S)),onCompositionend:I[2]||(I[2]=(...S)=>p(s)&&p(s)(...S))},null,40,kze),[[ur,g.value]])]),A("div",bze,[v.value?(k(),L(De,{key:0},[y.value.length?(k(),L("div",wze,[(k(!0),L(De,null,Ct(y.value,S=>(k(),L("button",{key:S,class:Re(["ep-e",{sel:S===e.current}]),type:"button",onClick:_=>m(S)},F(S),11,Cze))),128))])):(k(),L("div",Aze,F(p(i)("sidebar.noEmojiResults")),1))],64)):(k(),L(De,{key:1},[f.value.length?(k(),L(De,{key:0},[A("div",xze,F(p(i)("sidebar.recentEmojis")),1),A("div",Sze,[(k(!0),L(De,null,Ct(f.value,S=>(k(),L("button",{key:S,class:Re(["ep-e",{sel:S===e.current}]),type:"button",onClick:_=>m(S)},F(S),11,_ze))),128))])],64)):ee("",!0),(k(!0),L(De,null,Ct(p(d),S=>(k(),L(De,{key:S.id},[A("div",Mze,F(p(i)(S.labelKey)),1),A("div",Ize,[(k(!0),L(De,null,Ct(S.emojis,_=>(k(),L("button",{key:_,class:Re(["ep-e",{sel:_===e.current}]),type:"button",onClick:x=>m(_)},F(_),11,Tze))),128))])],64))),128))],64))]),U(p(nn),{separator:""}),U(p(nn),{role:"button",disabled:!(e.current&&e.removable),onClick:I[3]||(I[3]=S=>a("pick",null))},{default:ce(()=>[U(p(Ce),{name:"close",size:"sm"}),$e(" "+F(p(i)("sidebar.removeEmoji")),1)]),_:1},8,["disabled"]),U(p(nn),{role:"button",onClick:C},{default:ce(()=>[U(p(Ce),{name:"sparkles",size:"sm"}),$e(" "+F(p(i)("sidebar.randomEmoji")),1)]),_:1})]),_:1},8,["aria-label"]))}}),Lze=xt(Eze,[["__scopeId","data-v-23e78b23"]]),Nze=1e3,Dze=4096,yB=32*1024;function Fze(e,t,n){let i=null,o;const s=new Set;async function r(y){try{const w=await n.api.listTasks(y),C=e.tasksBySession[y]??[],T=new Map(C.map(S=>[S.id,S])),N=new Map(C.filter(S=>S.backgroundTaskId!==void 0).map(S=>[S.backgroundTaskId,S])),I=w.map(S=>{const _=T.get(S.id)??N.get(S.id),x=S.completedAt===void 0&&_?.completedAt===void 0&&_?.status==="running"&&S.status!=="running";return{...S,runInBackground:S.runInBackground===!0||_?.runInBackground===!0?!0:S.runInBackground,completedAt:S.completedAt??_?.completedAt??(x?new Date().toISOString():void 0),completedAtEstimated:S.completedAt!==void 0?void 0:_?.completedAt!==void 0?_.completedAtEstimated:x?!0:void 0}});e.tasksBySession={...e.tasksBySession,[y]:YI(I,C)},await l(y,w)}catch{}}async function l(y,b){if(e.activeSessionId!==y)return;const w=b??e.tasksBySession[y]??[],C=n.api,T=new Map;if(await Promise.all(w.map(async I=>{if((I.status==="completed"||I.status==="failed"||I.status==="cancelled")&&!s.has(I.id)&&!((I.outputLines?.length??0)>0))try{const _=await C.getTask(y,I.id,{withOutput:!0,outputBytes:yB});_.outputPreview!==void 0&&T.set(I.id,{preview:_.outputPreview,bytes:_.outputBytes}),s.add(I.id)}catch{}})),T.size===0)return;const N=e.tasksBySession[y]??[];e.tasksBySession={...e.tasksBySession,[y]:N.map(I=>{const S=T.get(I.id)??(I.backgroundTaskId!==void 0?T.get(I.backgroundTaskId):void 0);return S?{...I,outputPreview:S.preview,outputBytes:S.bytes}:I})}}async function a(y){if(e.activeSessionId!==y)return!0;const b=n.api;let w;try{w=await b.listTasks(y)}catch{return!1}const C=!w.some(x=>x.status==="running"),T=new Map;await Promise.all(w.map(async x=>{const E=x.status==="running",M=x.status==="completed"||x.status==="failed"||x.status==="cancelled";if(!(!E&&!M)&&!(M&&(s.has(x.id)||(x.outputLines?.length??0)>0)))try{const R=await b.getTask(y,x.id,{withOutput:!0,outputBytes:E?Dze:yB});R.outputPreview!==void 0&&T.set(x.id,{preview:R.outputPreview,bytes:R.outputBytes}),M&&s.add(x.id)}catch{}}));const N=e.tasksBySession[y]??[],I=new Map(N.map(x=>[x.id,x])),S=new Map(N.filter(x=>x.backgroundTaskId!==void 0).map(x=>[x.backgroundTaskId,x])),_=w.map(x=>{const E=I.get(x.id)??S.get(x.id),M=T.get(x.id),R=x.completedAt===void 0&&E?.completedAt===void 0&&E?.status==="running"&&x.status!=="running";return{...x,runInBackground:x.runInBackground===!0||E?.runInBackground===!0?!0:x.runInBackground,outputLines:E?.outputLines,text:E?.text,completedAt:x.completedAt??E?.completedAt??(R?new Date().toISOString():void 0),completedAtEstimated:x.completedAt!==void 0?void 0:E?.completedAt!==void 0?E.completedAtEstimated:R?!0:void 0,outputPreview:M?.preview??E?.outputPreview,outputBytes:M?.bytes??E?.outputBytes}});return e.tasksBySession={...e.tasksBySession,[y]:YI(_,N)},C}function u(y){i!==null&&o===y||(c(),o=y,a(y),i=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===y?a(y).then(b=>{b&&!t.value.some(w=>w.status==="running")&&e.activeSessionId===y&&o===y&&c()}):c())},Nze))}function c(){i!==null&&(clearInterval(i),i=null),h!==null&&(clearTimeout(h),h=null,m=void 0),o=void 0,s.clear()}const d=V(0);let f=null;We(()=>t.value.some(y=>y.status==="running"),y=>{y&&f===null?f=setInterval(()=>{d.value=(d.value+1)%Number.MAX_SAFE_INTEGER},1e3):!y&&f!==null&&(clearInterval(f),f=null)},{immediate:!0});let h=null,m;function g(y){if(h!==null&&m===y)return;i!==null&&o!==y&&c(),h!==null&&clearTimeout(h),m=y;let b=0;const w=()=>{a(y).then(C=>{if(m===y){if(t.value.some(T=>T.status==="running")){h!==null&&clearTimeout(h),h=null,m=void 0;return}if(C){h!==null&&clearTimeout(h),h=null,m=void 0,o===y&&c();return}if(b+=1,b>=10){h!==null&&clearTimeout(h),h=null,m=void 0,o===y&&c();return}h=setTimeout(w,1500)}})};h=setTimeout(w,1500)}const v=D(()=>{const y=e.activeSessionId;return y?{sid:y,hasRunning:t.value.some(b=>b.status==="running")}:{sid:void 0,hasRunning:!1}});return We(v,({sid:y,hasRunning:b})=>{b&&y!==void 0?(h!==null&&(clearTimeout(h),h=null,m=void 0),u(y)):y!==void 0?g(y):c()},{immediate:!0}),{taskClock:D(()=>d.value),loadTasksForSession:r}}function Bze(e,t){const{api:n,pushOperationFailure:i,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:r,resolveThinkingForPrompt:l,refreshSessionStatus:a}=t,u=V({}),c={},d=_h(new Set),f=new Set,h=new Map;function m(pe){return pe!==void 0&&d.has(pe)}function g(pe){return u.value[pe]??[]}function v(pe){for(const[ne,Ee]of Object.entries(u.value))if(Ee.some(qe=>qe.agentId===pe))return ne}function y(pe,ne){return h.get(ne)===pe}const b=D(()=>{const pe=e.activeSessionId;if(!pe)return null;const ne=g(pe).at(-1);return ne?{parentId:pe,agentId:ne.agentId}:null}),w=D(()=>b.value?.parentId??null),C=D(()=>b.value!==null);function T(pe){return!!e.sideChatSendingByAgent[pe]}function N(pe){if(e.sideChatSendingByAgent[pe])return!0;const ne=v(pe);return ne?(e.tasksBySession[ne]??[]).some(Ee=>Ee.id===pe&&Ee.status==="running"):!1}const I=D(()=>{const pe=b.value;return pe?T(pe.agentId):!1}),S=D(()=>{const pe=b.value;return pe?N(pe.agentId):!1}),_=pe=>n.getFileUrl(pe),x=[],E=new Map;function M(pe){let ne=E.get(pe);return ne||(ne=CAe(),E.set(pe,ne)),ne({messages:e.sideChatMessagesByAgent[pe]??[],approvals:x,getFileUrl:_,sessionActive:N(pe)})}const R=D(()=>{const pe=b.value;return pe?M(pe.agentId):[]});function q(pe,ne){e.sideChatMessagesByAgent[pe]=ne(e.sideChatMessagesByAgent[pe]??[])}function z(pe,ne){q(pe,Ee=>[...Ee,ne])}function O(pe,ne){q(pe,Ee=>{const qe=Ee.find(ze=>ze.id===ne);return qe?.promptId!==void 0||qe?.userMessageId!==void 0?Ee:Ee.filter(ze=>ze.id!==ne)})}function B(pe,ne){const Ee=e.sideChatUserMessageIdsBySession[pe]??[];Ee.includes(ne)||(e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[pe]:[...Ee,ne]})}function P(pe,ne,Ee,qe){q(pe,ze=>{const ft=ze.findIndex(Ht=>Ht.id===ne);if(ft===-1)return ze;const gt=ze.findIndex((Ht,jt)=>jt!==ft&&Ht.role==="user"&&(Ht.id===qe||Ht.userMessageId===qe||Ht.promptId===Ee)),_t=ze[ft],Pt=gt===-1?_t:ze[gt];return ze.flatMap((Ht,jt)=>jt===gt?[]:jt!==ft?[Ht]:[{...Pt,id:_t.id,promptId:Ee,userMessageId:qe,metadata:{...Pt.metadata,..._t.metadata}}])})}function H(pe,ne){B(ne.sessionId,ne.userMessageId??ne.id),q(pe,Ee=>{const qe=Ee.findIndex(gt=>gt.role==="user"&&(gt.userMessageId===(ne.userMessageId??ne.id)||gt.promptId!==void 0&>.promptId===ne.promptId));if(qe===-1)return[...Ee,ne];const ze=Ee[qe],ft=[...Ee];return ft[qe]={...ne,id:ze.id,promptId:ne.promptId??ze.promptId,userMessageId:ne.userMessageId??ne.id,metadata:{...ne.metadata,...ze.metadata}},ft})}function j(pe,ne,Ee){if(!Ee||!v(pe))return;const qe=Z.get(pe);if(qe!==void 0){qe.push({text:Ee});return}q(pe,ze=>{const ft=ze.at(-1);if(ft?.role==="assistant"){const gt=ft.content,_t=gt.at(-1);return _t?.type==="text"?[...ze.slice(0,-1),{...ft,content:[...gt.slice(0,-1),{type:"text",text:`${_t.text}${Ee}`}]}]:[...ze.slice(0,-1),{...ft,content:[...gt,{type:"text",text:Ee}]}]}return[...ze,{id:o(),sessionId:ne,role:"assistant",content:[{type:"text",text:Ee}],createdAt:new Date().toISOString()}]})}const Z=new Map,ie=new Map,W=new Map,Q=new Set,te=new Set;async function X(pe){const ne=g(pe);await Promise.all(ne.map(Ee=>ge(pe,Ee)))}async function ge(pe,ne){if(Q.has(ne.agentId)){te.add(ne.agentId);return}Q.add(ne.agentId);const Ee=e.sideChatMessagesByAgent[ne.agentId]??[],qe=Ee.findLast(ze=>ze.metadata?.["kimiWeb.optimisticUserMessage"]===!0)?.promptId;Z.set(ne.agentId,[]);try{const ze=await n.getSessionTranscript(pe,{agentId:ne.agentId});if(!g(pe).some(Fe=>Fe.agentId===ne.agentId))return;const ft=new Map(ze.tasks.map(Fe=>[Fe.taskId,Fe])),gt=ze.items.flatMap(Fe=>Fe.kind==="turn"?nx(Fe,ze.attachments,ft,void 0,void 0,pe):[]),_t=(e.sideChatMessagesByAgent[ne.agentId]??[]).slice(Ee.length).filter(Fe=>{const Ke=Fe.promptId??Fe.metadata?.["kimiWeb.promptId"];return Ke===void 0?!0:!ze.prompts.some(rt=>rt.promptId===Ke&&rt.status!=="queued")}),Ht=(e.sideChatMessagesByAgent[ne.agentId]??[]).slice(0,Ee.length).filter(Fe=>{if(Fe.metadata?.["kimiWeb.optimisticUserMessage"]!==!0)return!1;const Ke=Fe.promptId??Fe.metadata?.["kimiWeb.promptId"];return Ke===void 0?!0:!ze.prompts.some(rt=>rt.promptId===Ke&&rt.status!=="queued")});e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[ne.agentId]:[...gt,...Ht,..._t]};const jt=Z.get(ne.agentId)??[];Z.delete(ne.agentId);const Te=jt.filter(Fe=>Fe.terminal!==!0).map(Fe=>Fe.text).join("");if(Te.length>0){const Fe=(e.sideChatMessagesByAgent[ne.agentId]??[]).at(-1),Ke=Fe?.role==="assistant"&&Fe.content[0]?.type==="text"?Fe.content[0].text:"";let rt=0;const Nt=Math.min(Ke.length,Te.length);for(let Qt=Nt;Qt>0;Qt--)if(Ke.endsWith(Te.slice(0,Qt))){rt=Qt;break}rt<16&&(rt=0);const Lt=Te.slice(rt);Lt.length>0&&j(ne.agentId,pe,Lt)}for(const Fe of jt)Fe.terminal===!0&&ue(ne.agentId,pe,Fe.text);if(qe!==void 0&&e.sideChatSendingByAgent[ne.agentId]===!0&&ze.meta.activity!=="turn"){const Fe=ze.prompts.find(Ke=>Ke.promptId===qe);Fe!==void 0&&Fe.status!=="queued"&&Fe.status!=="running"&&ue(ne.agentId,pe)}}catch{const ze=Z.get(ne.agentId)??[];if(Z.delete(ne.agentId),!g(pe).some(ft=>ft.agentId===ne.agentId))return;for(const ft of ze)ft.terminal===!0?ue(ne.agentId,pe,ft.text):j(ne.agentId,pe,ft.text)}finally{Z.delete(ne.agentId),Q.delete(ne.agentId),te.delete(ne.agentId)&&ge(pe,ne)}}function ue(pe,ne,Ee,qe){if(!g(ne).some(Pt=>Pt.agentId===pe))return;if(qe===!0&&!f.has(pe)){se(pe,ne,Ee);return}if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[pe]:!1},f.add(pe),!Ee)return;const ze=Z.get(pe);if(ze!==void 0){ze.push({text:Ee,terminal:!0});return}const gt=(e.sideChatMessagesByAgent[pe]??[]).at(-1);(gt?.role==="assistant"?gt.content.findLast(Pt=>Pt.type==="text")?.text??"":"").trim().length>0||j(pe,ne,Ee)}async function se(pe,ne,Ee){if((ie.get(pe)??0)>0){W.set(pe,{outputPreview:Ee});return}const ze=(e.sideChatMessagesByAgent[pe]??[]).findLast(_t=>_t.metadata?.["kimiWeb.optimisticUserMessage"]===!0)?.promptId;let ft;try{const _t=await n.getSessionTranscript(ne,{agentId:pe});if(ze!==void 0){const Pt=_t.prompts.find(Te=>Te.promptId===ze),Ht=Pt!==void 0&&Pt.status!=="queued"&&Pt.status!=="running",jt=_t.prompts.some(Te=>Te.status==="queued"||Te.status==="running");ft=Ht&&!jt&&_t.meta.activity!=="turn"}else ft=_t.meta.activity!=="turn"}catch{return}!ft||(e.sideChatMessagesByAgent[pe]??[]).findLast(_t=>_t.metadata?.["kimiWeb.optimisticUserMessage"]===!0)?.promptId!==ze||ue(pe,ne,Ee)}async function fe(pe){const ne=e.activeSessionId;if(!ne)return!1;const Ee=g(ne).at(-1);if(Ee)return pe&&pe.trim()?oe(ne,Ee.agentId,pe):!0;const qe=await we(ne,pe);return qe.target!==null&&qe.sent}const G=new Map;function ae(pe){return G.get(pe)??0}const K=V({});function re(pe,ne){if(ne){K.value={...K.value,[pe]:ne};return}if(K.value[pe]===void 0)return;const{[pe]:Ee,...qe}=K.value;K.value=qe}function be(pe){return K.value[pe]??""}function ke(pe,ne){if(K.value[pe]!==ne)return;const{[pe]:Ee,...qe}=K.value;K.value=qe}async function we(pe,ne){const Ee=ae(pe);let qe;try{({agentId:qe}=await n.startBtw(pe))}catch(gt){return i("openSideChat",gt,{sessionId:pe}),{target:null,sent:!1}}if(ae(pe)!==Ee)return{target:null,sent:!1};d.add(qe),e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[qe]:e.sideChatMessagesByAgent[qe]??[]};const ze=(c[pe]??0)+1;c[pe]=ze;const ft={agentId:qe,seq:ze};if(u.value={...u.value,[pe]:[...g(pe),ft]},s(),r()?.markSideChannelAgent(pe,qe),ne&&ne.trim()){const gt=await oe(pe,qe,ne.trim());return ae(pe)!==Ee||!g(pe).some(_t=>_t.agentId===qe)?{target:null,sent:gt}:{target:ft,sent:gt}}return{target:ft,sent:!0}}async function oe(pe,ne,Ee){const qe=Ee.trim();if(!qe)return!1;const ze=pe;f.delete(ne),d.add(ne),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[ne]:!0};const ft=o(),gt={id:ft,sessionId:ze,role:"user",content:[{type:"text",text:qe}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};z(ne,gt),ie.set(ne,(ie.get(ne)??0)+1);let _t,Pt=!1;try{const Ht=e.sessions.find(Ke=>Ke.id===ze),jt=(Ht?.model&&Ht.model.length>0?Ht.model:e.defaultModel)??void 0,Te=await l(ze,jt)??e.thinking;_t=e.pendingThinkingBySession[ze],Pt=!0;const Fe=await n.submitPrompt(ze,{content:[{type:"text",text:qe}],agentId:ne,model:jt,thinking:Te,permissionMode:e.permission,planMode:e.planModeBySession[ze]??!1,swarmMode:e.swarmModeBySession[ze]??!1});return Te!==void 0&&Tu(e,ze,_t),g(ze).some(Ke=>Ke.agentId===ne)&&(P(ne,ft,Fe.promptId,Fe.userMessageId),B(ze,Fe.userMessageId)),!0}catch(Ht){Tu(e,ze,_t)&&a(ze),i("sendSideChatPrompt",Ht,{sessionId:ze}),g(ze).some(Te=>Te.agentId===ne)&&(O(ne,ft),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[ne]:!1});const jt=!Pt||Ht instanceof ku;return jt&&g(ze).some(Te=>Te.agentId===ne)&&f.add(ne),!jt}finally{const Ht=(ie.get(ne)??1)-1;Ht>0?ie.set(ne,Ht):ie.delete(ne);const jt=W.get(ne);Ht===0&&jt!==void 0&&(W.delete(ne),se(ne,ze,jt.outputPreview))}}function le(pe){if(E.delete(pe),p1.delete(pe),d.delete(pe),f.delete(pe),ie.delete(pe),W.delete(pe),Object.prototype.hasOwnProperty.call(e.sideChatMessagesByAgent,pe)){const{[pe]:ne,...Ee}=e.sideChatMessagesByAgent;e.sideChatMessagesByAgent=Ee}if(Object.prototype.hasOwnProperty.call(e.sideChatSendingByAgent,pe)){const{[pe]:ne,...Ee}=e.sideChatSendingByAgent;e.sideChatSendingByAgent=Ee}}function ye(pe){if(pe!==void 0){const ze=v(pe);if(!ze)return;le(pe),h.set(pe,ze),u.value={...u.value,[ze]:g(ze).filter(ft=>ft.agentId!==pe)};return}const ne=e.activeSessionId;if(!ne)return;for(const ze of g(ne))le(ze.agentId),h.set(ze.agentId,ne);const{[ne]:Ee,...qe}=u.value;u.value=qe}async function Ae(pe){const ne=b.value;return ne?oe(ne.parentId,ne.agentId,pe):!1}function _e(pe){if(G.set(pe,ae(pe)+1),e.sideChatUserMessageIdsBySession[pe]!==void 0){const{[pe]:qe,...ze}=e.sideChatUserMessageIdsBySession;e.sideChatUserMessageIdsBySession=ze}if(delete c[pe],K.value[pe]!==void 0){const{[pe]:qe,...ze}=K.value;K.value=ze}for(const qe of g(pe))le(qe.agentId);for(const[qe,ze]of h)ze===pe&&h.delete(qe);const{[pe]:ne,...Ee}=u.value;u.value=Ee}return{sideChatTargetBySession:u,sideChatTargetsOfSession:g,isClosedSideChatAgent:y,sideChatSessionId:w,sideChatVisible:C,sideChatSending:I,sideChatRunning:S,sideChatTurns:R,sideChatSendingOf:T,sideChatRunningOf:N,sideChatTurnsOf:M,appendSideChatAssistantText:j,finishSideChatAgent:ue,reconcileSideChatUserMessage:H,resyncSideChat:X,wasSideChatAgent:m,openSideChat:fe,openSideChatOn:we,closeSideChat:ye,sendSideChatPrompt:Ae,sendSideChatPromptOn:oe,saveSideChatDraft:re,sideChatDraft:be,clearSideChatDraftIfUnchanged:ke,clearSideChatForSession:_e}}/*! +`),s.attrs.source!==void 0&&s.attrs.source.length>0&&(n+=`from: ${yx(s.attrs.source)} +`),n+=sze(s.attrs.text,s.attrs.comment);return o(e.slice(i)),n}function rze(e){const t=V(null),n=V(!1);let i;function o(m){}function s(m){n.value=!1,m!==void 0&&(m.clientX||m.clientY)&&(m.clientX,m.clientY)}function r(){n.value=!1}function l(m){m.key!=="Escape"&&(m.target instanceof Element&&m.target.closest(".sab")||(n.value=!0))}const a=250;let u=null;function c(){u!==null&&(clearTimeout(u),u=null)}function d(){u!==null&&clearTimeout(u),u=setTimeout(()=>{u=null;const m=document.activeElement;if(m instanceof Element&&m.closest(".sab"))return;const g=window.getSelection();if(g&&!g.isCollapsed&&!lK(g,e.root.value)){t.value=null;return}},a)}kn(()=>{}),Ln(()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("keyup",l),c()});function f(){t.value=null,c()}function h(m){t.value=null;const g=i;i=void 0,window.getSelection()?.removeAllRanges(),e.onAction(m,g)}return{selectionBubble:t,selectionKeyboard:n,onMouseup:s,onPointerdown:r,onBubbleClose:f,onBubbleAction:h}}const uK="kimi-web.turn-folding";function lze(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function aze(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function uze(){return lze(uK)==="1"}const cK=V(uze());function cze(e){cK.value=e,aze(uK,e?"1":"0")}function Ux(){return{turnFolding:cK,setTurnFolding:cze}}const dK="kimi-web.activity-run-folding";function dze(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function fze(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function hze(){return dze(dK)!=="0"}const fK=V(hze());function pze(e){fK.value=e,fze(dK,e?"1":"0")}function Vx(){return{activityRunFolding:fK,setActivityRunFolding:pze}}const mze={class:"ep-search"},gze=["placeholder"],vze={class:"ep-scroll"},yze={key:0,class:"ep-grid"},kze=["onClick"],bze={key:1,class:"ep-empty"},wze={class:"ep-label"},Cze={class:"ep-grid"},Aze=["onClick"],xze={class:"ep-label"},Sze={class:"ep-grid"},_ze=["onClick"],yB="kimi-web.recent-emojis",Mze=rt({__name:"SessionEmojiPicker",props:{current:{default:null},removable:{type:Boolean,default:!0}},emits:["pick"],setup(e,{expose:t,emit:n}){const{t:i}=Ut(),{handleCompositionStart:o,handleCompositionEnd:s,isComposingKeyEvent:r}=bl(),l=e,a=n,u=["⏳","⚠️","🐛","✨","🔥","🚀","🎯","🧪","📝","🔍","🛠️","💡","📦","🎨","🔒","📈","🧹","🚧","✅","❓","🌙","☕","🐳","🗂️","📊","🤖","🧩","⚙️","🌱","📌","💥","🕐"],c={faces:"sidebar.emojiGroupFaces",nature:"sidebar.emojiGroupNature",food:"sidebar.emojiGroupFood",activity:"sidebar.emojiGroupActivity",objects:"sidebar.emojiGroupObjects",symbols:"sidebar.emojiGroupSymbols"},d=goe.map(N=>({id:N,labelKey:c[N],emojis:q$.filter(I=>I.group===N).map(I=>I.emoji)})),f=V(h());function h(){try{const N=JSON.parse(localStorage.getItem(yB)??"[]");return Array.isArray(N)?N.filter(I=>typeof I=="string"):[]}catch{return[]}}function m(N,I){f.value=boe(f.value,N);try{localStorage.setItem(yB,JSON.stringify(f.value))}catch{}a("pick",N,I)}const g=V(""),v=D(()=>g.value.trim().length>0),y=D(()=>yoe(g.value)),b=V(null);kn(()=>b.value?.focus());function w(N){if(r(N))return;const I=y.value[0];v.value&&I&&m(I)}function C(){let N=l.current??void 0;for(;N===void 0||N===l.current;)N=u[Math.floor(Math.random()*u.length)];m(N,"random")}const T=V(null);return t({el:D(()=>T.value?.el),isComposingKeyEvent:r}),(N,I)=>(k(),de(p(Hs),{ref_key:"menuRef",ref:T,class:"emoji-picker",role:"dialog","aria-label":p(i)("sidebar.sessionEmojiTitle"),onKeydown:I[4]||(I[4]=Tt(()=>{},["stop"]))},{default:ue(()=>[A("div",mze,[U(p(Ce),{name:"search",size:"sm"}),ai(A("input",{ref_key:"inputRef",ref:b,"onUpdate:modelValue":I[0]||(I[0]=S=>g.value=S),class:"ep-input",type:"text",placeholder:p(i)("sidebar.searchEmoji"),autocomplete:"off",spellcheck:"false",onKeydown:Yo(w,["enter"]),onCompositionstart:I[1]||(I[1]=(...S)=>p(o)&&p(o)(...S)),onCompositionend:I[2]||(I[2]=(...S)=>p(s)&&p(s)(...S))},null,40,gze),[[ar,g.value]])]),A("div",vze,[v.value?(k(),L(De,{key:0},[y.value.length?(k(),L("div",yze,[(k(!0),L(De,null,Ct(y.value,S=>(k(),L("button",{key:S,class:Re(["ep-e",{sel:S===e.current}]),type:"button",onClick:_=>m(S)},F(S),11,kze))),128))])):(k(),L("div",bze,F(p(i)("sidebar.noEmojiResults")),1))],64)):(k(),L(De,{key:1},[f.value.length?(k(),L(De,{key:0},[A("div",wze,F(p(i)("sidebar.recentEmojis")),1),A("div",Cze,[(k(!0),L(De,null,Ct(f.value,S=>(k(),L("button",{key:S,class:Re(["ep-e",{sel:S===e.current}]),type:"button",onClick:_=>m(S)},F(S),11,Aze))),128))])],64)):ee("",!0),(k(!0),L(De,null,Ct(p(d),S=>(k(),L(De,{key:S.id},[A("div",xze,F(p(i)(S.labelKey)),1),A("div",Sze,[(k(!0),L(De,null,Ct(S.emojis,_=>(k(),L("button",{key:_,class:Re(["ep-e",{sel:_===e.current}]),type:"button",onClick:x=>m(_)},F(_),11,_ze))),128))])],64))),128))],64))]),U(p(tn),{separator:""}),U(p(tn),{role:"button",disabled:!(e.current&&e.removable),onClick:I[3]||(I[3]=S=>a("pick",null))},{default:ue(()=>[U(p(Ce),{name:"close",size:"sm"}),Oe(" "+F(p(i)("sidebar.removeEmoji")),1)]),_:1},8,["disabled"]),U(p(tn),{role:"button",onClick:C},{default:ue(()=>[U(p(Ce),{name:"sparkles",size:"sm"}),Oe(" "+F(p(i)("sidebar.randomEmoji")),1)]),_:1})]),_:1},8,["aria-label"]))}}),Ize=St(Mze,[["__scopeId","data-v-23e78b23"]]),Tze=1e3,Eze=4096,kB=32*1024;function Lze(e,t,n){let i=null,o;const s=new Set;async function r(y){try{const w=await n.api.listTasks(y),C=e.tasksBySession[y]??[],T=new Map(C.map(S=>[S.id,S])),N=new Map(C.filter(S=>S.backgroundTaskId!==void 0).map(S=>[S.backgroundTaskId,S])),I=w.map(S=>{const _=T.get(S.id)??N.get(S.id),x=S.completedAt===void 0&&_?.completedAt===void 0&&_?.status==="running"&&S.status!=="running";return{...S,runInBackground:S.runInBackground===!0||_?.runInBackground===!0?!0:S.runInBackground,completedAt:S.completedAt??_?.completedAt??(x?new Date().toISOString():void 0),completedAtEstimated:S.completedAt!==void 0?void 0:_?.completedAt!==void 0?_.completedAtEstimated:x?!0:void 0}});e.tasksBySession={...e.tasksBySession,[y]:JI(I,C)},await l(y,w)}catch{}}async function l(y,b){if(e.activeSessionId!==y)return;const w=b??e.tasksBySession[y]??[],C=n.api,T=new Map;if(await Promise.all(w.map(async I=>{if((I.status==="completed"||I.status==="failed"||I.status==="cancelled")&&!s.has(I.id)&&!((I.outputLines?.length??0)>0))try{const _=await C.getTask(y,I.id,{withOutput:!0,outputBytes:kB});_.outputPreview!==void 0&&T.set(I.id,{preview:_.outputPreview,bytes:_.outputBytes}),s.add(I.id)}catch{}})),T.size===0)return;const N=e.tasksBySession[y]??[];e.tasksBySession={...e.tasksBySession,[y]:N.map(I=>{const S=T.get(I.id)??(I.backgroundTaskId!==void 0?T.get(I.backgroundTaskId):void 0);return S?{...I,outputPreview:S.preview,outputBytes:S.bytes}:I})}}async function a(y){if(e.activeSessionId!==y)return!0;const b=n.api;let w;try{w=await b.listTasks(y)}catch{return!1}const C=!w.some(x=>x.status==="running"),T=new Map;await Promise.all(w.map(async x=>{const E=x.status==="running",M=x.status==="completed"||x.status==="failed"||x.status==="cancelled";if(!(!E&&!M)&&!(M&&(s.has(x.id)||(x.outputLines?.length??0)>0)))try{const R=await b.getTask(y,x.id,{withOutput:!0,outputBytes:E?Eze:kB});R.outputPreview!==void 0&&T.set(x.id,{preview:R.outputPreview,bytes:R.outputBytes}),M&&s.add(x.id)}catch{}}));const N=e.tasksBySession[y]??[],I=new Map(N.map(x=>[x.id,x])),S=new Map(N.filter(x=>x.backgroundTaskId!==void 0).map(x=>[x.backgroundTaskId,x])),_=w.map(x=>{const E=I.get(x.id)??S.get(x.id),M=T.get(x.id),R=x.completedAt===void 0&&E?.completedAt===void 0&&E?.status==="running"&&x.status!=="running";return{...x,runInBackground:x.runInBackground===!0||E?.runInBackground===!0?!0:x.runInBackground,outputLines:E?.outputLines,text:E?.text,completedAt:x.completedAt??E?.completedAt??(R?new Date().toISOString():void 0),completedAtEstimated:x.completedAt!==void 0?void 0:E?.completedAt!==void 0?E.completedAtEstimated:R?!0:void 0,outputPreview:M?.preview??E?.outputPreview,outputBytes:M?.bytes??E?.outputBytes}});return e.tasksBySession={...e.tasksBySession,[y]:JI(_,N)},C}function u(y){i!==null&&o===y||(c(),o=y,a(y),i=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===y?a(y).then(b=>{b&&!t.value.some(w=>w.status==="running")&&e.activeSessionId===y&&o===y&&c()}):c())},Tze))}function c(){i!==null&&(clearInterval(i),i=null),h!==null&&(clearTimeout(h),h=null,m=void 0),o=void 0,s.clear()}const d=V(0);let f=null;We(()=>t.value.some(y=>y.status==="running"),y=>{y&&f===null?f=setInterval(()=>{d.value=(d.value+1)%Number.MAX_SAFE_INTEGER},1e3):!y&&f!==null&&(clearInterval(f),f=null)},{immediate:!0});let h=null,m;function g(y){if(h!==null&&m===y)return;i!==null&&o!==y&&c(),h!==null&&clearTimeout(h),m=y;let b=0;const w=()=>{a(y).then(C=>{if(m===y){if(t.value.some(T=>T.status==="running")){h!==null&&clearTimeout(h),h=null,m=void 0;return}if(C){h!==null&&clearTimeout(h),h=null,m=void 0,o===y&&c();return}if(b+=1,b>=10){h!==null&&clearTimeout(h),h=null,m=void 0,o===y&&c();return}h=setTimeout(w,1500)}})};h=setTimeout(w,1500)}const v=D(()=>{const y=e.activeSessionId;return y?{sid:y,hasRunning:t.value.some(b=>b.status==="running")}:{sid:void 0,hasRunning:!1}});return We(v,({sid:y,hasRunning:b})=>{b&&y!==void 0?(h!==null&&(clearTimeout(h),h=null,m=void 0),u(y)):y!==void 0?g(y):c()},{immediate:!0}),{taskClock:D(()=>d.value),loadTasksForSession:r}}function Nze(e,t){const{api:n,pushOperationFailure:i,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:r,resolveThinkingForPrompt:l,refreshSessionStatus:a}=t,u=V({}),c={},d=Mh(new Set),f=new Set,h=new Map;function m(fe){return fe!==void 0&&d.has(fe)}function g(fe){return u.value[fe]??[]}function v(fe){for(const[ie,Ee]of Object.entries(u.value))if(Ee.some(qe=>qe.agentId===fe))return ie}function y(fe,ie){return h.get(ie)===fe}const b=D(()=>{const fe=e.activeSessionId;if(!fe)return null;const ie=g(fe).at(-1);return ie?{parentId:fe,agentId:ie.agentId}:null}),w=D(()=>b.value?.parentId??null),C=D(()=>b.value!==null);function T(fe){return!!e.sideChatSendingByAgent[fe]}function N(fe){if(e.sideChatSendingByAgent[fe])return!0;const ie=v(fe);return ie?(e.tasksBySession[ie]??[]).some(Ee=>Ee.id===fe&&Ee.status==="running"):!1}const I=D(()=>{const fe=b.value;return fe?T(fe.agentId):!1}),S=D(()=>{const fe=b.value;return fe?N(fe.agentId):!1}),_=fe=>n.getFileUrl(fe),x=[],E=new Map;function M(fe){let ie=E.get(fe);return ie||(ie=wAe(),E.set(fe,ie)),ie({messages:e.sideChatMessagesByAgent[fe]??[],approvals:x,getFileUrl:_,sessionActive:N(fe)})}const R=D(()=>{const fe=b.value;return fe?M(fe.agentId):[]});function q(fe,ie){e.sideChatMessagesByAgent[fe]=ie(e.sideChatMessagesByAgent[fe]??[])}function z(fe,ie){q(fe,Ee=>[...Ee,ie])}function $(fe,ie){q(fe,Ee=>{const qe=Ee.find(ze=>ze.id===ie);return qe?.promptId!==void 0||qe?.userMessageId!==void 0?Ee:Ee.filter(ze=>ze.id!==ie)})}function B(fe,ie){const Ee=e.sideChatUserMessageIdsBySession[fe]??[];Ee.includes(ie)||(e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[fe]:[...Ee,ie]})}function P(fe,ie,Ee,qe){q(fe,ze=>{const ht=ze.findIndex(jt=>jt.id===ie);if(ht===-1)return ze;const gt=ze.findIndex((jt,Ht)=>Ht!==ht&&jt.role==="user"&&(jt.id===qe||jt.userMessageId===qe||jt.promptId===Ee)),_t=ze[ht],$t=gt===-1?_t:ze[gt];return ze.flatMap((jt,Ht)=>Ht===gt?[]:Ht!==ht?[jt]:[{...$t,id:_t.id,promptId:Ee,userMessageId:qe,metadata:{...$t.metadata,..._t.metadata}}])})}function H(fe,ie){B(ie.sessionId,ie.userMessageId??ie.id),q(fe,Ee=>{const qe=Ee.findIndex(gt=>gt.role==="user"&&(gt.userMessageId===(ie.userMessageId??ie.id)||gt.promptId!==void 0&>.promptId===ie.promptId));if(qe===-1)return[...Ee,ie];const ze=Ee[qe],ht=[...Ee];return ht[qe]={...ie,id:ze.id,promptId:ie.promptId??ze.promptId,userMessageId:ie.userMessageId??ie.id,metadata:{...ie.metadata,...ze.metadata}},ht})}function j(fe,ie,Ee){if(!Ee||!v(fe))return;const qe=G.get(fe);if(qe!==void 0){qe.push({text:Ee});return}q(fe,ze=>{const ht=ze.at(-1);if(ht?.role==="assistant"){const gt=ht.content,_t=gt.at(-1);return _t?.type==="text"?[...ze.slice(0,-1),{...ht,content:[...gt.slice(0,-1),{type:"text",text:`${_t.text}${Ee}`}]}]:[...ze.slice(0,-1),{...ht,content:[...gt,{type:"text",text:Ee}]}]}return[...ze,{id:o(),sessionId:ie,role:"assistant",content:[{type:"text",text:Ee}],createdAt:new Date().toISOString()}]})}const G=new Map,ne=new Map,W=new Map,Q=new Set,te=new Set;async function X(fe){const ie=g(fe);await Promise.all(ie.map(Ee=>ve(fe,Ee)))}async function ve(fe,ie){if(Q.has(ie.agentId)){te.add(ie.agentId);return}Q.add(ie.agentId);const Ee=e.sideChatMessagesByAgent[ie.agentId]??[],qe=Ee.findLast(ze=>ze.metadata?.["kimiWeb.optimisticUserMessage"]===!0)?.promptId;G.set(ie.agentId,[]);try{const ze=await n.getSessionTranscript(fe,{agentId:ie.agentId});if(!g(fe).some(Fe=>Fe.agentId===ie.agentId))return;const ht=new Map(ze.tasks.map(Fe=>[Fe.taskId,Fe])),gt=ze.items.flatMap(Fe=>Fe.kind==="turn"?tx(Fe,ze.attachments,ht,void 0,void 0,fe):[]),_t=(e.sideChatMessagesByAgent[ie.agentId]??[]).slice(Ee.length).filter(Fe=>{const Ve=Fe.promptId??Fe.metadata?.["kimiWeb.promptId"];return Ve===void 0?!0:!ze.prompts.some(lt=>lt.promptId===Ve&<.status!=="queued")}),jt=(e.sideChatMessagesByAgent[ie.agentId]??[]).slice(0,Ee.length).filter(Fe=>{if(Fe.metadata?.["kimiWeb.optimisticUserMessage"]!==!0)return!1;const Ve=Fe.promptId??Fe.metadata?.["kimiWeb.promptId"];return Ve===void 0?!0:!ze.prompts.some(lt=>lt.promptId===Ve&<.status!=="queued")});e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[ie.agentId]:[...gt,...jt,..._t]};const Ht=G.get(ie.agentId)??[];G.delete(ie.agentId);const Te=Ht.filter(Fe=>Fe.terminal!==!0).map(Fe=>Fe.text).join("");if(Te.length>0){const Fe=(e.sideChatMessagesByAgent[ie.agentId]??[]).at(-1),Ve=Fe?.role==="assistant"&&Fe.content[0]?.type==="text"?Fe.content[0].text:"";let lt=0;const Ft=Math.min(Ve.length,Te.length);for(let Vt=Ft;Vt>0;Vt--)if(Ve.endsWith(Te.slice(0,Vt))){lt=Vt;break}lt<16&&(lt=0);const Lt=Te.slice(lt);Lt.length>0&&j(ie.agentId,fe,Lt)}for(const Fe of Ht)Fe.terminal===!0&&ce(ie.agentId,fe,Fe.text);if(qe!==void 0&&e.sideChatSendingByAgent[ie.agentId]===!0&&ze.meta.activity!=="turn"){const Fe=ze.prompts.find(Ve=>Ve.promptId===qe);Fe!==void 0&&Fe.status!=="queued"&&Fe.status!=="running"&&ce(ie.agentId,fe)}}catch{const ze=G.get(ie.agentId)??[];if(G.delete(ie.agentId),!g(fe).some(ht=>ht.agentId===ie.agentId))return;for(const ht of ze)ht.terminal===!0?ce(ie.agentId,fe,ht.text):j(ie.agentId,fe,ht.text)}finally{G.delete(ie.agentId),Q.delete(ie.agentId),te.delete(ie.agentId)&&ve(fe,ie)}}function ce(fe,ie,Ee,qe){if(!g(ie).some($t=>$t.agentId===fe))return;if(qe===!0&&!f.has(fe)){se(fe,ie,Ee);return}if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[fe]:!1},f.add(fe),!Ee)return;const ze=G.get(fe);if(ze!==void 0){ze.push({text:Ee,terminal:!0});return}const gt=(e.sideChatMessagesByAgent[fe]??[]).at(-1);(gt?.role==="assistant"?gt.content.findLast($t=>$t.type==="text")?.text??"":"").trim().length>0||j(fe,ie,Ee)}async function se(fe,ie,Ee){if((ne.get(fe)??0)>0){W.set(fe,{outputPreview:Ee});return}const ze=(e.sideChatMessagesByAgent[fe]??[]).findLast(_t=>_t.metadata?.["kimiWeb.optimisticUserMessage"]===!0)?.promptId;let ht;try{const _t=await n.getSessionTranscript(ie,{agentId:fe});if(ze!==void 0){const $t=_t.prompts.find(Te=>Te.promptId===ze),jt=$t!==void 0&&$t.status!=="queued"&&$t.status!=="running",Ht=_t.prompts.some(Te=>Te.status==="queued"||Te.status==="running");ht=jt&&!Ht&&_t.meta.activity!=="turn"}else ht=_t.meta.activity!=="turn"}catch{return}!ht||(e.sideChatMessagesByAgent[fe]??[]).findLast(_t=>_t.metadata?.["kimiWeb.optimisticUserMessage"]===!0)?.promptId!==ze||ce(fe,ie,Ee)}async function pe(fe){const ie=e.activeSessionId;if(!ie)return!1;const Ee=g(ie).at(-1);if(Ee)return fe&&fe.trim()?oe(ie,Ee.agentId,fe):!0;const qe=await ke(ie,fe);return qe.target!==null&&qe.sent}const Z=new Map;function ae(fe){return Z.get(fe)??0}const K=V({});function re(fe,ie){if(ie){K.value={...K.value,[fe]:ie};return}if(K.value[fe]===void 0)return;const{[fe]:Ee,...qe}=K.value;K.value=qe}function we(fe){return K.value[fe]??""}function be(fe,ie){if(K.value[fe]!==ie)return;const{[fe]:Ee,...qe}=K.value;K.value=qe}async function ke(fe,ie){const Ee=ae(fe);let qe;try{({agentId:qe}=await n.startBtw(fe))}catch(gt){return i("openSideChat",gt,{sessionId:fe}),{target:null,sent:!1}}if(ae(fe)!==Ee)return{target:null,sent:!1};d.add(qe),e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[qe]:e.sideChatMessagesByAgent[qe]??[]};const ze=(c[fe]??0)+1;c[fe]=ze;const ht={agentId:qe,seq:ze};if(u.value={...u.value,[fe]:[...g(fe),ht]},s(),r()?.markSideChannelAgent(fe,qe),ie&&ie.trim()){const gt=await oe(fe,qe,ie.trim());return ae(fe)!==Ee||!g(fe).some(_t=>_t.agentId===qe)?{target:null,sent:gt}:{target:ht,sent:gt}}return{target:ht,sent:!0}}async function oe(fe,ie,Ee){const qe=Ee.trim();if(!qe)return!1;const ze=fe;f.delete(ie),d.add(ie),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[ie]:!0};const ht=o(),gt={id:ht,sessionId:ze,role:"user",content:[{type:"text",text:qe}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};z(ie,gt),ne.set(ie,(ne.get(ie)??0)+1);let _t,$t=!1;try{const jt=e.sessions.find(Ve=>Ve.id===ze),Ht=(jt?.model&&jt.model.length>0?jt.model:e.defaultModel)??void 0,Te=await l(ze,Ht)??e.thinking;_t=e.pendingThinkingBySession[ze],$t=!0;const Fe=await n.submitPrompt(ze,{content:[{type:"text",text:qe}],agentId:ie,model:Ht,thinking:Te,permissionMode:e.permission,planMode:e.planModeBySession[ze]??!1,swarmMode:e.swarmModeBySession[ze]??!1});return Te!==void 0&&Eu(e,ze,_t),g(ze).some(Ve=>Ve.agentId===ie)&&(P(ie,ht,Fe.promptId,Fe.userMessageId),B(ze,Fe.userMessageId)),!0}catch(jt){Eu(e,ze,_t)&&a(ze),i("sendSideChatPrompt",jt,{sessionId:ze}),g(ze).some(Te=>Te.agentId===ie)&&($(ie,ht),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[ie]:!1});const Ht=!$t||jt instanceof bu;return Ht&&g(ze).some(Te=>Te.agentId===ie)&&f.add(ie),!Ht}finally{const jt=(ne.get(ie)??1)-1;jt>0?ne.set(ie,jt):ne.delete(ie);const Ht=W.get(ie);jt===0&&Ht!==void 0&&(W.delete(ie),se(ie,ze,Ht.outputPreview))}}function le(fe){if(E.delete(fe),p1.delete(fe),d.delete(fe),f.delete(fe),ne.delete(fe),W.delete(fe),Object.prototype.hasOwnProperty.call(e.sideChatMessagesByAgent,fe)){const{[fe]:ie,...Ee}=e.sideChatMessagesByAgent;e.sideChatMessagesByAgent=Ee}if(Object.prototype.hasOwnProperty.call(e.sideChatSendingByAgent,fe)){const{[fe]:ie,...Ee}=e.sideChatSendingByAgent;e.sideChatSendingByAgent=Ee}}function ye(fe){if(fe!==void 0){const ze=v(fe);if(!ze)return;le(fe),h.set(fe,ze),u.value={...u.value,[ze]:g(ze).filter(ht=>ht.agentId!==fe)};return}const ie=e.activeSessionId;if(!ie)return;for(const ze of g(ie))le(ze.agentId),h.set(ze.agentId,ie);const{[ie]:Ee,...qe}=u.value;u.value=qe}async function Ae(fe){const ie=b.value;return ie?oe(ie.parentId,ie.agentId,fe):!1}function Me(fe){if(Z.set(fe,ae(fe)+1),e.sideChatUserMessageIdsBySession[fe]!==void 0){const{[fe]:qe,...ze}=e.sideChatUserMessageIdsBySession;e.sideChatUserMessageIdsBySession=ze}if(delete c[fe],K.value[fe]!==void 0){const{[fe]:qe,...ze}=K.value;K.value=ze}for(const qe of g(fe))le(qe.agentId);for(const[qe,ze]of h)ze===fe&&h.delete(qe);const{[fe]:ie,...Ee}=u.value;u.value=Ee}return{sideChatTargetBySession:u,sideChatTargetsOfSession:g,isClosedSideChatAgent:y,sideChatSessionId:w,sideChatVisible:C,sideChatSending:I,sideChatRunning:S,sideChatTurns:R,sideChatSendingOf:T,sideChatRunningOf:N,sideChatTurnsOf:M,appendSideChatAssistantText:j,finishSideChatAgent:ce,reconcileSideChatUserMessage:H,resyncSideChat:X,wasSideChatAgent:m,openSideChat:pe,openSideChatOn:ke,closeSideChat:ye,sendSideChatPrompt:Ae,sendSideChatPromptOn:oe,saveSideChatDraft:re,sideChatDraft:we,clearSideChatDraftIfUnchanged:be,clearSideChatForSession:Me}}/*! * pinia v4.0.3 * (c) 2026 Eduardo San Martin Morote * @license MIT - */let hK;const lb=e=>hK=e,pK=Symbol();function kB(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}function Rze(){const e=ak(!0),t=e.run(()=>V({}));let n=[],i=[];const o=Et({install(s){lb(o),o._a=s,s.provide(pK,o),s.config.globalProperties.$pinia=o,i.forEach(r=>n.push(r)),i=[]},use(s){return this._a?n.push(s):i.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const DA=()=>{};function bB(e,t,n,i=DA){e.add(t);const o=()=>{e.delete(t)&&i()};return!n&&uv()&&Gd(o),o}function wp(e,...t){e.forEach(n=>{n(...t)})}const $ze=e=>e(),wB=Symbol(),k5=Symbol();function FA(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,i)=>e.set(i,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!Object.hasOwn(t,n))continue;const i=t[n],o=e[n];kB(o)&&kB(i)&&Object.hasOwn(e,n)&&!Ao(i)&&!Mu(i)?e[n]=FA(o,i):e[n]=i}return e}const Oze=Symbol();function Pze(e){return!e||typeof e!="object"||!Object.hasOwn(e,Oze)}const{assign:Jc}=Object;function zze(e){return!!(Ao(e)&&e.effect)}function jze(e,t,n,i){const{state:o,actions:s,getters:r}=t,l=n.state.value[e];let a;function u(){l||(n.state.value[e]=o?o():{});const c=bQ(n.state.value[e]);return Jc(c,s,Object.keys(r||{}).reduce((d,f)=>(d[f]=Et(D(()=>{lb(n);const h=n._s.get(e);return r[f].call(h,h)})),d),{}))}return a=mK(e,u,t,n,i,!0),a}function mK(e,t,n={},i,o,s){let r;const l=Jc({actions:{}},n),a={deep:!0};let u,c,d=new Set,f=new Set,h;const m=i.state.value[e];!s&&!m&&(i.state.value[e]={});let g;function v(I){let S;u=c=!1,typeof I=="function"?(I(i.state.value[e]),S={type:"patch function",storeId:e,events:h}):(FA(i.state.value[e],I),S={type:"patch object",payload:I,storeId:e,events:h});const _=g=Symbol();ht().then(()=>{g===_&&(u=!0)}),c=!0,wp(d,S,i.state.value[e])}const y=s?function(){const{state:S}=n,_=S?S():{};this.$patch(x=>{Jc(x,_)})}:DA;function b(){r.stop(),d.clear(),f.clear(),i._s.delete(e)}const w=(I,S="")=>{if(wB in I)return I[k5]=S,I;const _=function(){lb(i);const x=Array.from(arguments),E=new Set,M=new Set;function R(O){E.add(O)}function q(O){M.add(O)}wp(f,{args:x,name:_[k5],store:T,after:R,onError:q});let z;try{z=I.apply(this&&this.$id===e?this:T,x)}catch(O){throw wp(M,O),O}return z instanceof Promise?z.then(O=>(wp(E,O),O)).catch(O=>(wp(M,O),Promise.reject(O))):(wp(E,z),z)};return _[wB]=!0,_[k5]=S,_},C={_p:i,$id:e,$onAction:bB.bind(null,f),$patch:v,$reset:y,$subscribe(I,S={}){if(d.has(I))return DA;const _=bB(d,I,S.detached,()=>x()),x=r.run(()=>We(()=>i.state.value[e],E=>{(S.flush==="sync"?c:u)&&I({storeId:e,type:"direct",events:h},E)},Jc({},a,S)));return _},$dispose:b},T=po(C);i._s.set(e,T);const N=(i._a&&i._a.runWithContext||$ze)(()=>i._e.run(()=>(r=ak()).run(()=>t({action:w}))));for(const I in N){const S=N[I];Ao(S)&&!zze(S)||Mu(S)?s||(m&&Pze(S)&&(Ao(S)?S.value=m[I]:((S instanceof Set||S instanceof Map)&&S.clear(),FA(S,m[I]))),i.state.value[e][I]=S):typeof S=="function"&&(N[I]=w(S,I),l.actions[I]=S)}return Jc(T,N),Jc(wi(T),N),Object.defineProperty(T,"$state",{get:()=>i.state.value[e],set:I=>{v(S=>{Jc(S,I)})}}),i._p.forEach(I=>{const S=r.run(()=>I({store:T,app:i._a,pinia:i,options:l}));Jc(T,S)}),m&&s&&n.hydrate&&n.hydrate(T.$state,m),u=!0,c=!0,T}/*! #__NO_SIDE_EFFECTS__ */function Fv(e,t,n){let i;const o=typeof t=="function";i=o?n:t;function s(r,l){const a=NQ();return r=r||(a?Jt(pK,null):null),r&&lb(r),r=hK,r._s.has(e)||(o?mK(e,t,i,r):jze(e,i,r)),r._s.get(e)}return s.$id=e,s}const Hze={api:()=>{throw new Error("[@moonshot-ai/app-client] client deps not installed — call setKimiClientDeps() at app bootstrap")},t:e=>e},Va=globalThis.__kimiAppClientDeps??={current:Hze};function Wze(e){Va.current=e}const qze=new Proxy({},{get(e,t){return Va.current.api()[t]}});function Kt(){return qze}function li(e,t){return Va.current.t(e,t)}function Uze(e,t){Va.current.traceClientEvent?.(e,t)}function aa(e,t){Va.current.traceKeyEvent?.(e,t)}function Vze(){return Va.current.sessionExportTraceToJsonl?.()??""}function Y0(e){Va.current.onSessionDestroyed?.(e)}function Kze(e,t,n){Va.current.onWorkspaceDestroyed?.(e,t,n)}function Zze(e){return Va.current.consumeSessionIntent?.(e)??e}function Gze(e){return Va.current.onPluginsShelfEvent?(Va.current.onPluginsShelfEvent(e),!0):!1}const sm=Rze(),gK=Cn.starredModels;function Qze(){try{const e=ms(gK);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Yze(e){try{fs(gK,JSON.stringify(e))}catch{}}const Jze=Fv("kimi.models",()=>{const e=V([]),t=V(Qze()),n=V([]),i=V({}),o=V({}),s=V({}),r=V({}),l=new Set,a=new Set,u=V(null);function c(b){e.value=b}function d(b){n.value=b}function f(b){u.value=b}function h(b,w){i.value={...i.value,[b]:w}}function m(b,w){o.value={...o.value,[b]:w}}function g(b){const w=new Set(t.value);w.has(b)?w.delete(b):w.add(b),t.value=Array.from(w),Yze(t.value)}async function v(b){if(l.has(b))return;l.add(b);const w={...s.value};delete w[b],s.value=w;try{const C=await Kt().listSkills(b);h(b,C)}catch{}finally{l.delete(b),s.value={...s.value,[b]:!0}}}async function y(b){if(a.has(b))return;a.add(b);const w={...r.value};delete w[b],r.value=w;try{const C=await Kt().listSkillsForWorkspace(b);m(b,C)}catch{}finally{a.delete(b),r.value={...r.value,[b]:!0}}}return{models:e,starredModelIds:t,providers:n,draftModel:u,skillsBySession:i,skillsByWorkspace:o,skillsFetchedBySession:s,skillsFetchedByWorkspace:r,setModels:c,setProviders:d,setDraftModel:f,setSkillsForSession:h,setSkillsForWorkspace:m,toggleStarModel:g,loadSkillsForSession:v,loadSkillsForWorkspace:y}});function BA(){return Jze(sm)}const CB=new Error("profile persist failed");function Xze(e,t){const{api:n,pushOperationFailure:i,refreshSessionStatus:o,persistSessionProfile:s,savePlanModeToStorage:r,activity:l,updateSession:a,loadConfig:u,checkAuth:c,beginLocalTurn:d,settleLocalTurn:f,mainTranscriptTailTurnId:h,mainTranscriptTailPromptCreatedAt:m,settleIfFateProven:g}=t,v=BA();function y(ue){if(!(ue==null||ue.length===0))return v.models.find(se=>se.id===ue)??v.models.find(se=>se.model===ue)}function b(){const ue=e.activeSessionId?e.sessions.find(fe=>fe.id===e.activeSessionId):void 0,se=ue===void 0?v.draftModel??e.defaultModel:ue.model||e.defaultModel;return y(se)?.id??se??void 0}function w(ue){if(ue===void 0)return;const se=y(ue);return se===void 0?void 0:fh(se)}function C(ue,se){const fe=ue==null?void 0:e.thinkingBySession[ue];return fe!==void 0?N9(se,fe)?fe:fh(se):I6(e.config?.thinking,se)??fh(se)}function T(ue,se){if(se===void 0)return;const fe=y(se);return fe===void 0?void 0:C(ue,fe)}async function N(ue,se){return ue!=null&&e.thinkingBySession[ue]===void 0&&await o(ue),T(ue,se)}function I(ue){e.thinking=ue;const se=e.activeSessionId;return ue!==void 0&&se!==null&&se!==void 0?(e.thinkingBySession={...e.thinkingBySession,[se]:ue},xw(e,se)):se==null&&(e.draftThinkingExplicit=ue!==void 0),ue}function S(){const ue=e.activeSessionId,se=y(b());if(ue==null){if(e.draftThinkingExplicit){if(se===void 0||e.thinking!==void 0&&N9(se,e.thinking))return;e.draftThinkingExplicit=!1}}else e.draftThinkingExplicit&&(e.draftThinkingExplicit=!1);se!==void 0&&(e.thinking=C(ue,se))}We([()=>e.activeSessionId,()=>b(),()=>{const ue=e.activeSessionId;return ue==null?void 0:e.thinkingBySession[ue]},()=>e.config?.thinking],S);async function _(){try{v.setModels(await n.listModels()),S()}catch(ue){i("loadModels",ue)}}async function x(){try{v.setProviders(await n.listProviders())}catch(ue){i("loadProviders",ue)}}async function E(ue){const se=e.activeSessionId,fe=y(ue),G=e.thinking,ae=se?e.sessions.find(ke=>ke.id===se)?.model:void 0,K=b()!==(fe?.id??ue),re=Toe(fe,G,K,se?void 0:e.config?.thinking);if(!se)return v.setDraftModel(ue),e.thinking=re,K&&(e.draftThinkingExplicit=!1),!0;a(se,ke=>({...ke,model:ue}));let be;re!==G&&(e.thinking=re,re!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[se]:re},be=xw(e,se)));try{await n.updateSession(se,{model:ue,thinking:re!==G?re:void 0})}catch(ke){return a(se,we=>({...we,model:ae??we.model})),re!==G&&(e.thinking=G,G!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[se]:G}),Tu(e,se,be)&&o(se)),i("setModel",ke,{sessionId:se}),!1}return Tu(e,se,be),await o(se),!0}async function M(ue,se,fe,G,ae){const K=G??e.activeSessionId;if(!K)return!1;const re=l.value==="idle"&&!e.inFlightBySession[K],be=`msg_skill_opt_${Date.now().toString(36)}`,ke=re?d(K):void 0;let we=!1,oe=!1;if(re){e.inFlightBySession={...e.inFlightBySession,[K]:!0};const le={id:be,sessionId:K,role:"user",content:[{type:"text",text:`/${ue}${se?` ${se}`:""}`},...R4(fe)],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,"kimiWeb.anchorTurnId":h?.(K),"kimiWeb.anchorPromptCreatedAt":m?.(K),origin:{kind:"skill_activation",trigger:"user-slash",skillName:ue,skillArgs:se}}};e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[K]:[...e.optimisticMessagesBySession[K]??[],le]}}try{if(ae?.skipThinkingPersist!==!0){const le=e.sessions.find(pe=>pe.id===K)?.model,ye=(le&&le.length>0?le:e.defaultModel)??void 0,Ae=e.planArmedBySession[K]??!1;if(!await s({thinking:await N(K,ye)??e.thinking,swarmMode:e.swarmModeBySession?.[K]??!1,permissionMode:e.permission,...Ae?{planMode:!0}:{}},K))throw CB;Ae&&(e.planArmedBySession={...e.planArmedBySession,[K]:!1},r(),e.planModeBySession={...e.planModeBySession,[K]:!0})}return we=!0,await n.activateSkill(K,ue,se,R4(fe)),oe=!0,!0}catch(le){if(re)if(e.inFlightBySession={...e.inFlightBySession,[K]:!1},!we||le instanceof ku){const Ae=(e.optimisticMessagesBySession[K]??[]).filter(pe=>pe.id!==be),_e={...e.optimisticMessagesBySession};Ae.length>0?_e[K]=Ae:delete _e[K],e.optimisticMessagesBySession=_e}else{const Ae=e.optimisticMessagesBySession[K];Ae!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[K]:Ae.map(_e=>_e.id===be?{..._e,metadata:{..._e.metadata,"kimiWeb.uncertain":!0}}:_e)})}return le!==CB&&i("activateSkill",le,{sessionId:K}),!(!we||le instanceof ku)}finally{ke!==void 0&&f(K,ke),oe&&ke!==void 0&&g?.(K)}}async function R(ue){return n.getProvider(ue)}async function q(ue){try{return await n.addProvider(ue),await Promise.all([x(),_(),u()]),await c(),null}catch(se){return vu("[kimi-code] operation failed: addProvider",se),se instanceof Error?se.message:String(se)}}async function z(ue,se){try{return await n.updateProvider(ue,se),await Promise.all([x(),_(),u()]),null}catch(fe){return vu("[kimi-code] operation failed: updateProvider",fe),fe instanceof Error?fe.message:String(fe)}}async function O(ue){try{const se=await n.deleteProvider(ue);return await Promise.all([x(),_(),u()]),await c(),se}catch(se){return i("deleteProvider",se),null}}async function B(ue){try{const se=await n.refreshProvider(ue);for(const fe of se.failed)i("refreshProvider",new Error(fe.reason),{message:fe.provider});await Promise.all([x(),_(),u()])}catch(se){i("refreshProvider",se)}}async function P(){try{const ue=await n.refreshAllProviders();for(const se of ue.failed)i("refreshAllProviders",new Error(se.reason),{message:se.provider});await Promise.all([x(),_(),u()])}catch(ue){i("refreshAllProviders",ue)}}async function H(){try{return{kind:"ok",items:await n.listCatalogProviders()}}catch(ue){return ue instanceof ku&&ue.code===void 0?{kind:"unsupported"}:(vu("[kimi-code] operation failed: loadCatalogProviders",ue),{kind:"error"})}}async function j(ue){try{return await n.importCatalogProvider(ue),await Promise.all([x(),_(),u()]),await c(),null}catch(se){return vu("[kimi-code] operation failed: importCatalogProvider",se),se instanceof Error?se.message:String(se)}}async function Z(ue){try{const se=await n.importCustomRegistry(ue);return await Promise.all([x(),_(),u()]),await c(),se}catch(se){return vu("[kimi-code] operation failed: importCustomRegistry",se),se instanceof Error?se.message:String(se)}}async function ie(ue){try{return await n.startOAuthLogin(ue)}catch{return null}}async function W(){return n.getOAuthRegion()}async function Q(){try{return await n.pollOAuthLogin()}catch(ue){return ja("[kimi-code] pollOAuthLogin failed",ue),null}}async function te(){try{await n.cancelOAuthLogin()}catch{}}async function X(){try{return await n.getUsage()}catch(ue){return{kind:"error",message:ue instanceof Error?ue.message:String(ue)}}}function ge(ue){const se=I(ue);s({thinking:se})}return{models:D(()=>v.models),starredModelIds:D(()=>v.starredModelIds),providers:D(()=>v.providers),draftModel:D(()=>v.draftModel),skillsBySession:D(()=>v.skillsBySession),skillsByWorkspace:D(()=>v.skillsByWorkspace),skillsFetchedBySession:D(()=>v.skillsFetchedBySession),skillsFetchedByWorkspace:D(()=>v.skillsFetchedByWorkspace),loadSkillsForSession:v.loadSkillsForSession,loadSkillsForWorkspace:v.loadSkillsForWorkspace,loadModels:_,loadProviders:x,setModel:E,thinkingLevelForModelId:w,thinkingLevelForSessionId:T,resolveThinkingForPrompt:N,toggleStarModel:v.toggleStarModel,activateSkill:M,addProvider:q,updateProvider:z,deleteProvider:O,getProvider:R,loadCatalogProviders:H,importCatalogProvider:j,importCustomRegistry:Z,refreshProvider:B,refreshAllProviders:P,startOAuthLogin:ie,pollOAuthLogin:Q,cancelOAuthLogin:te,getOAuthRegion:W,getUsage:X,setThinking:ge}}let l0=null;function eje(e){l0=e}function tje(e){l0!==null&&e!==l0.sessionId&&(l0=null)}function nje(){return l0}const ije=Fv("kimi.approvals",()=>{const e=V({}),t=V({});function n(c){Il(e.value,c)}function i(c){Il(t.value,c)}function o(c,d){e.value[c]=d}function s(c,d){t.value[c]=d}function r(c,d){const f=e.value[c]??[];e.value[c]=f.filter(h=>h.approvalId!==d)}function l(c,d){const f=t.value[c]??[];t.value[c]=f.filter(h=>h.questionId!==d)}function a(c){delete e.value[c]}function u(c){delete t.value[c]}return{approvalsBySession:e,questionsBySession:t,applyApprovalsDiff:n,applyQuestionsDiff:i,setSessionApprovals:o,setSessionQuestions:s,removePendingApproval:r,removePendingQuestion:l,clearSessionApprovals:a,clearSessionQuestions:u}});function or(){return ije(sm)}const oje=Fv("kimi.sessions",()=>{const e=V([]),t=V(void 0),n=V(NP());function i(h){e.value=h}function o(h,m){e.value=e.value.map(g=>g.id===h?m(g):g)}function s(h){e.value=dP(e.value,h)}function r(h){e.value=[...e.value,h]}function l(h){e.value=e.value.filter(m=>m.id!==h)}function a(h){t.value=h}function u(h){const m=ase(n.value,h);m!==n.value&&(n.value=m,D3(m))}function c(h){const m=use(n.value,h);m!==n.value&&(n.value=m,D3(m))}function d(h){const m=new Set(h),g=n.value.filter(v=>!m.has(v));g.length!==n.value.length&&(n.value=g,D3(g))}function f(h){n.value.includes(h)?c(h):u(h)}return{sessions:e,activeSessionId:t,pinnedSessionIds:n,setSessions:i,updateSession:o,upsertSessionSorted:s,appendSession:r,removeSession:l,setActiveSessionId:a,pinSession:u,unpinSession:c,unpinSessions:d,togglePinSession:f}});function wr(){return oje(sm)}const sje=40409;function rje(e){return!e||e.state!=="open"&&e.state!=="closed"&&e.state!=="merged"?null:{number:e.number,state:e.state,url:e.url}}function lje(e,t){return e==null||t==null?e==null&&t==null:e.number===t.number&&e.state===t.state&&e.url===t.url}const aje=Fv("kimi.files",()=>{const e=V(null),t=V([]),n=V(!1),i=V(null),o=V(!1),s=V({});async function r(d){const f=wr().activeSessionId;if(!f)return null;try{const m=await Kt().readFile(f,{path:d});return{path:m.path,content:m.content,encoding:m.encoding,mime:m.mime,languageId:m.languageId,isBinary:m.isBinary,size:m.size,lineCount:m.lineCount}}catch(h){if(ja("[kimi-code] readFileContent failed for",d,h),qi(h)&&h.code===sje)throw h;return null}}async function l(d){const f=wr().activeSessionId;if(f){e.value=d,t.value=[],i.value=null,o.value=!1,n.value=!0;try{const m=await Kt().getFileDiff(f,d);if(e.value!==d||wr().activeSessionId!==f)return;const g=oAe(m.diff);if(t.value=g,g.length===0){const y=await r(d).catch(()=>null);if(e.value!==d||wr().activeSessionId!==f)return;o.value=y!==null&&y.size===0;return}n.value=!1;const v=await PCe(g,{truncated:m.truncated,readNewText:async()=>{const y=await r(d).catch(()=>null);return!y||y.isBinary||y.encoding!=="utf-8"?null:y.content}});if(e.value!==d||wr().activeSessionId!==f)return;i.value=v}catch(h){e.value===d&&(t.value=[]),ja("[loadFileDiff] diff unavailable for",d,h)}finally{e.value===d&&(n.value=!1)}}}function a(){e.value=null,t.value=[],i.value=null,o.value=!1,n.value=!1}async function u(d){try{const h=await Kt().getGitStatus(d);s.value[d]=h;const m=rje(h.pullRequest);wr().updateSession(d,g=>lje(g.pullRequest,m)?g:{...g,pullRequest:m})}catch{}}function c(d){delete s.value[d]}return{selectedDiffPath:e,fileDiffLines:t,fileDiffLoading:n,fileDiffTexts:i,fileDiffEmptyFile:o,gitStatusBySession:s,readFileContent:r,loadFileDiff:l,clearFileDiff:a,loadGitStatus:u,clearSessionGitStatus:c}});function tr(){return aje(sm)}const kg=5,Zx=5,kd=50,AB=40401,uje=40402,cje=40410,xB=40409,dje=40902,fje=2e3,hje=10;function b5(e){return qi(e)&&e.code===dje}const pje=40904;function SB(e){return qi(e)&&e.code===pje}const mje=40406;function gje(e){return qi(e)&&e.code===mje}function vje(e){const t=e.trim();if(t.length<2)return t;const n=t[0];return(n==='"'||n==="'")&&t[t.length-1]===n?t.slice(1,-1).trim():t}const Df=po({}),py=po({}),w5=po({}),C5=po({}),au=po(new Set),Bv=new Map,Oh=new Map,$4=new Map;let yje=0;const jf=new Map,kje=3,Ju=new Map,bg=new Map,wg=new Map,bje=3,n9=new Map;function wje(e){const t=n9.get(e);if(!(t!==void 0&&(t.done||t.attempts>=bje))){n9.set(e,{attempts:(t?.attempts??0)+1,done:!1});try{Kt().generateSessionTitle(e,{source:"first_turn"}).then(n=>{n!==null&&n9.set(e,{attempts:0,done:!0})}).catch(()=>{})}catch{}}}let _B=0;function Cje(){return _B+=1,`${Date.now().toString(36)}-${_B}`}function vK(e){return{generation:Bv.get(e)??0,pending:(Oh.get(e)?.size??0)>0}}function RA(e){const t=++yje;Bv.set(e,t);const n=Oh.get(e)??new Set;return n.add(t),Oh.set(e,n),t}function $A(e,t){const n=Oh.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Oh.delete(e);const i=$4.get(e);$4.delete(e),i?.()}function Aje(e){Bv.delete(e),Oh.delete(e),$4.delete(e),jf.delete(e),Ju.delete(e),wg.delete(e),bg.delete(e)}function xje(e,t){return!t.pending&&t.generation===(Bv.get(e)??0)}function Sje(e,t){if((Oh.get(e)?.size??0)===0){t();return}$4.set(e,t)}function _je(e,t){const{confirm:n}=cf(),{taskPoller:i,sideChat:o,modelProvider:s,pushOperationFailure:r,notify:l,activity:a,sessionsKnownEmpty:u,setSessions:c,updateSession:d,upsertSessionSorted:f,appendSession:h,forgetSession:m,unpinSessions:g,setActiveSessionId:v,nextOptimisticMsgId:y,lastMainUserPromptText:b,mainTranscriptTailTurnId:w,mainTranscriptTailPromptCreatedAt:C,settleIfFateProven:T,getEventConn:N,subscribeSessionEvents:I,noteSessionWatermark:S,refreshMainTranscript:_,hasLoadedMessages:x,resolveTaskRestId:E,refreshSessionStatus:M,refreshSessionGoal:R,refillSessionGoalOnReload:q,refreshSessionPlans:z,settlePlanReviewLocally:O,persistSessionProfile:B,mergedWorkspaces:P,workspacesView:H,status:j,workspaceIdForSession:Z,savePermissionToStorage:ie,savePlanModeToStorage:W,saveSwarmModeToStorage:Q,saveGoalModeToStorage:te,draftModes:X,saveUnread:ge,saveActiveWorkspaceToStorage:ue,saveHiddenWorkspacesToStorage:se,goalErrorMessage:fe,initialized:G,connectIssue:ae}=t;let K=0,re=!1;function be(Y,ve){i.loadTasksForSession(Y),tr().loadGitStatus(Y),ve?.skipStatus!==!0&&M(Y),R(Y),z(Y),ke(Y),Object.prototype.hasOwnProperty.call(s.skillsBySession.value,Y)||s.loadSkillsForSession(Y)}function ke(Y){Kt().getSessionWarnings(Y).then(ve=>{if(!e.sessions.some(Ye=>Ye.id===Y))return;const Be=bg.get(Y)??new Set;bg.set(Y,Be);const He=li("warnings.noteLabel");for(const Ye of ve){const Xe=`${Ye.code} ${Ye.message}`;Be.has(Xe)||(Be.add(Xe),l({severity:Ye.severity,title:`${He}: ${Ye.message}`}))}}).catch(()=>{})}function we(Y,ve){const Be=bg.get(Y)??new Set;Be.add(ve),bg.set(Y,Be)}let oe=0;async function le(Y){try{const ve=await Kt().getUserInfo();if(Y!==oe||e.managedProviderStatus!=="authenticated")return;e.managedUserInfo=ve.kind==="ok"?ve.userInfo:null,ve.kind==="ok"?e.managedMembership=ve.userInfo.userLevel===hje?"free":"member":e.managedMembership=ve.status===402?"free":null}catch{if(Y!==oe)return;e.managedProviderStatus==="authenticated"&&(e.managedUserInfo=null,e.managedMembership=null)}}async function ye(){e.managedProviderStatus==="authenticated"&&await le(++oe)}async function Ae(){const Y=++oe;try{const Be=await Kt().getAuth();return e.authReady=Be.ready,e.defaultModel=Be.defaultModel,e.managedProviderStatus=Be.managedProvider?.status??null,e.managedProviderStatus==="authenticated"?le(Y):(e.managedUserInfo=null,e.managedMembership=null),ae.value=null,"proceed"}catch(ve){return qi(ve)&&(ve.code===401||ve.code===qH)?(ae.value=null,"server-auth-required"):(ae.value=(ve instanceof Error?ve.message:String(ve)).slice(0,140),"retry")}}async function _e(){let Y=!0;for(;;){const ve=await Ae();if(ve!=="retry")return ve;Y&&(ae.value=null,Y=!1),await new Promise(Be=>{setTimeout(Be,fje)})}}async function pe(){try{const Y=Kt();e.config=await Y.getConfig()}catch{}}async function ne(Y){try{const Be=await Kt().setConfig(Y);return e.config=Be,e.defaultModel=Be.defaultModel??null,!0}catch(ve){return r("setConfig",ve),!1}}const Ee=100;async function qe(Y){const ve=Kt(),Be=[];let He,Ye;for(;Y?.shouldContinue?.()!==!1;){let Xe;try{Xe=await ve.listSessions({pageSize:Ee,beforeId:He,excludeEmpty:!0})}catch(vt){if(Be.length===0)throw vt;Ye=vt;break}if(Be.push(...Xe.items),!Xe.hasMore||Xe.items.length===0)break;He=Xe.items[Xe.items.length-1].id}return{sessions:Be,error:Ye}}const ze=new Set;function ft(Y){for(const vt of Y)S(vt.id,vt.lastSeq);const ve=ni.size===0?Y:Y.filter(vt=>!ni.has(vt.id)),Be=new Set(ve.map(vt=>vt.id)),He=e.sessions.filter(vt=>ze.has(vt.id)&&!Be.has(vt.id)&&!ni.has(vt.id)),Ye=He.length===0?ve:[...ve,...He].sort((vt,$t)=>new Date($t.updatedAt).getTime()-new Date(vt.updatedAt).getTime()),Xe=new Map(e.sessions.map(vt=>[vt.id,vt]));c(Ye.map(vt=>{const $t=Xe.get(vt.id);if($t===void 0)return vt;const Vt=wN(vt.usage)&&!wN($t.usage),pn=vt.pullRequest??$t.pullRequest,In=(vt.model??"")===""?$t.model:vt.model;return!Vt&&pn===vt.pullRequest&&In===vt.model?vt:{...vt,usage:Vt?$t.usage:vt.usage,pullRequest:pn,model:In}}))}function gt(Y){const ve=[...Y],Be=new Set(ve.map(He=>He.id));for(const He of e.sessions)Be.has(He.id)||(ve.push(He),Be.add(He.id));return ve.sort((He,Ye)=>new Date(Ye.updatedAt).getTime()-new Date(He.updatedAt).getTime()),ve}async function _t(){const Y=Kt(),ve={groupPageSize:kg,hasPrompt:!0};let Be;try{Be=await Y.listSessionGroupsV2(ve)}catch(an){r("load",an);return}const He=[...Be.groups];let Ye=Be.nextPageToken;for(;Ye!==null;){let an;try{an=await Y.listSessionGroupsV2({...ve,pageToken:Ye})}catch(An){r("load",An);return}He.push(...an.groups),Ye=an.nextPageToken}const Xe=new Map(He.map(an=>[an.workspace.id,an])),vt=new Map(He.filter(an=>an.workspace.cwd!==null).map(an=>[Tl(an.workspace.cwd),an])),$t=[],Vt=new Set,pn={},In={},Bn={};for(const an of e.workspaces){const An=Xe.get(an.id)??vt.get(Tl(an.root));if(An===void 0){pn[an.id]=!1,In[an.id]=void 0,Bn[an.id]=kg;continue}const Hn=An.sessions.filter(Wn=>!ni.has(Wn.id)&&(Wn.meta.last_prompt??"").length>0).map(Wn=>Q2(Wn.workspace.cwd===null?{...Wn,workspace:{...Wn.workspace,cwd:an.root}}:Wn));for(const Wn of Hn)Vt.has(Wn.id)||($t.push(Wn),Vt.add(Wn.id));pn[an.id]=An.sessions.length0?Hn[Hn.length-1].id:void 0,Bn[an.id]=Math.max(Hn.length,kg)}e.sessionsHasMoreByWorkspace=pn,e.sessionsCursorByWorkspace=In,e.sessionsInitialCountByWorkspace=Bn,e.sessionsFullyLoaded=!1;for(const an of He)for(const An of an.sessions){const Hn=An.activity.status;(Hn==="running"||Hn==="approval"||Hn==="question")&&Pt.push(An.id)}return $t.sort((an,An)=>new Date(An.updatedAt).getTime()-new Date(an.updatedAt).getTime()),$t}const Pt=[];async function Ht(Y){const ve=e.lastSeqBySession[Y]??0;let Be;try{Be=await Kt().getSession(Y)}catch{return}(e.lastSeqBySession[Y]??0)>ve||d(Y,He=>({...He,busy:Be.busy,mainTurnActive:Be.mainTurnActive??He.mainTurnActive,pendingInteraction:Be.pendingInteraction??He.pendingInteraction,lastTurnReason:Be.lastTurnReason??He.lastTurnReason}))}async function jt(){if(Pt.length=0,e.workspaces.length===0){const ve=await qe(),Be=ve.error===void 0?ve.sessions:gt(ve.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=ve.error===void 0,ve.error!==void 0&&r("load",ve.error),Be}return _t()}async function Te(Y){if(!e.sessionsLoadingMoreByWorkspace[Y]&&e.sessionsHasMoreByWorkspace[Y]!==!1&&e.sessionsCursorByWorkspace[Y]!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Y]:!0};try{let ve=e.sessionsCursorByWorkspace[Y],Be;for(let vt=0;vt<3&&ve!==void 0&&(Be=await Kt().listSessions({workspaceId:Y,pageSize:Zx,beforeId:ve,excludeEmpty:!0}),e.sessionsCursorByWorkspace[Y]!==ve);vt+=1)Be=void 0,ve=e.sessionsCursorByWorkspace[Y];if(Be===void 0)return;const He=new Set(e.sessions.map(vt=>vt.id)),Ye=Be.items.filter(vt=>!He.has(vt.id)&&!ni.has(vt.id));for(const vt of Ye)ze.add(vt.id);Ye.length>0&&c([...e.sessions,...Ye]);const Xe=Be.items.filter(vt=>!ni.has(vt.id)).at(-1);e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Y]:Xe?.id??ve},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Y]:Be.hasMore}}catch(ve){r("loadMoreSessions",ve)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Y]:!1}}}}function Fe(Y){return e.sessions.filter(ve=>!ve.parentSessionId&&Z(ve)===Y)}const Ke=5;function rt(Y,ve){const Be=new Set(e.sessions.map(Xe=>Xe.id)),He=Y.items.filter(Xe=>!Be.has(Xe.id)&&!ni.has(Xe.id)&&(Xe.meta.last_prompt??"").length>0).map(Q2);for(const Xe of He)ze.add(Xe.id);He.length>0&&c([...e.sessions,...He]);for(const Xe of Y.items)if(Be.has(Xe.id)&&Xe.git!==void 0){const vt=Xe.git.pull_request;d(Xe.id,$t=>$t.pullRequest===vt?$t:{...$t,pullRequest:vt})}if(Y.items.length>0){const Xe=Math.min(...Y.items.map(vt=>vt.meta.updated_at));e.flatSessionsFrontier=ve?.resetFrontier===!0||e.flatSessionsFrontier===null?Xe:Math.min(e.flatSessionsFrontier,Xe)}e.flatSessionsNextPageToken=Y.nextPageToken,e.flatSessionsHasMore=Y.hasMore;const Ye=new Set(H.value.map(Xe=>Xe.id));return Y.items.filter(Xe=>(Xe.meta.last_prompt??"").length>0&&!ni.has(Xe.id)&&Ye.has(Z({workspaceId:Xe.workspace.id,cwd:Xe.workspace.cwd??""}))).length}async function Nt(){const Y=await Kt().listSessionsV2({pageSize:kd,include:"git"});rt(Y,{resetFrontier:!0}),e.flatSessionsSeeded=!0}async function Lt(){if(!(e.flatSessionsSeeded||e.flatSessionsLoading)){e.flatSessionsLoading=!0;try{await Nt()}catch(Y){r("ensureFlatSessions",Y)}finally{e.flatSessionsLoading=!1}}}async function Qt(){if(!(e.flatSessionsLoading||e.flatSessionsLoadingMore)&&e.flatSessionsHasMore){e.flatSessionsLoadingMore=!0;try{if(!e.flatSessionsSeeded){await Nt();return}if(e.flatSessionsNextPageToken===null)return;for(let Y=0;Y0)break}}catch(Y){r("loadMoreFlatSessions",Y)}finally{e.flatSessionsLoadingMore=!1}}}async function Ut(){const Y=await Kt().listSessionsV2({pageSize:kd,include:"git",archived:!0}),ve=new Set,Be=Y.items.filter(Ye=>(Ye.meta.last_prompt??"").length>0).filter(Ye=>!mi.has(Ye.id)).filter(Ye=>ve.has(Ye.id)?!1:(ve.add(Ye.id),!0)).map(Q2),He=e.doneSessions.filter(Ye=>ni.has(Ye.id)&&!ve.has(Ye.id));e.doneSessions=[...He,...Be],e.doneSessionsNextPageToken=Y.nextPageToken,e.doneSessionsHasMore=Y.hasMore}async function en(){if(!(e.doneSessionsSeeded||e.doneSessionsLoading)){e.doneSessionsLoading=!0;try{await Ut(),e.doneSessionsSeeded=!0}catch(Y){r("ensureDoneSessions",Y)}finally{e.doneSessionsLoading=!1}}}async function it(){if(!(e.doneSessionsLoading||e.doneSessionsLoadingMore)&&e.doneSessionsHasMore){e.doneSessionsLoadingMore=!0;try{if(!e.doneSessionsSeeded){await Ut(),e.doneSessionsSeeded=!0;return}let Y=3;for(;;){const ve=e.doneSessionsNextPageToken;if(ve===null)return;let Be;try{Be=await Kt().listSessionsV2({pageSize:kd,pageToken:ve,include:"git",archived:!0})}catch(Xe){if(!gN(Xe))throw Xe;e.doneSessionsNextPageToken=null,await Ut();return}const He=new Set(e.doneSessions.map(Xe=>Xe.id)),Ye=Be.items.filter(Xe=>!He.has(Xe.id)&&!mi.has(Xe.id)&&(Xe.meta.last_prompt??"").length>0).map(Q2);if(Ye.length>0&&(e.doneSessions=[...e.doneSessions,...Ye]),e.doneSessionsNextPageToken=Be.nextPageToken,e.doneSessionsHasMore=Be.hasMore,Y-=1,Ye.length>0||!Be.hasMore||Y<=0)return}}catch(Y){r("loadMoreDoneSessions",Y)}finally{e.doneSessionsLoadingMore=!1}}}async function dt(Y,ve,Be,He){if(e.sessionsCursorByWorkspace[Y]===ve){const Xe=new Date(Be).getTime();let vt;for(const $t of e.sessions){if(Z($t)!==Y)continue;const Vt=new Date($t.updatedAt).getTime();Vt<=Xe||(vt===void 0||Vt0&&Fe(Y).lengthIn.id)),pn=$t.items.filter(In=>!Vt.has(In.id)&&!ni.has(In.id));for(const In of pn)ze.add(In.id);pn.length>0&&c([...e.sessions,...pn].sort((In,Bn)=>new Date(Bn.updatedAt).getTime()-new Date(In.updatedAt).getTime())),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Y]:$t.items.length>0?$t.items[$t.items.length-1].id:void 0},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Y]:$t.hasMore}}catch($t){r("loadMoreSessions",$t);break}else await Te(Y);if(Ye-=1,Fe(Y).length===vt&&e.sessionsCursorByWorkspace[Y]===Xe)break}}async function wt(){if(e.sessionsFullyLoaded)return;const Y=await qe().catch(He=>(ja("[kimi-code] loadAllSessions failed; search covers only loaded sessions",He),null));if(Y===null)return;const ve=Y.error===void 0?Y.sessions:gt(Y.sessions);if(ft(ve),e.sessionsFullyLoaded=Y.error===void 0,Y.error!==void 0)return;const Be={};for(const He of e.workspaces)Be[He.id]=!1;e.sessionsHasMoreByWorkspace=Be}async function dn(){const Y=await Kt().getMeta().catch(()=>null);Y!==null&&(e.serverVersion=Y.serverVersion,e.availableOpenInApps=Y.openInApps,e.dangerousBypassAuth=Y.dangerousBypassAuth,e.experimentalFlags=Y.experimentalFlags,e.backend=Y.backend,e.webTitle=Y.webTitle)}async function Gt(){const Y=Date.now();let ve="accepted";aa("app:load:start"),e.loading=!0,ze.clear();const Be=!G.value;let He=!0;try{if(Be&&await _e()==="server-auth-required"){He=!1,ve="auth-required";return}const Ye=Kt();await Promise.all([Ye.getHealth().catch(()=>null),dn(),s.loadModels()]),Be||await Ae(),await pe(),await ri();const Xe=await jt();Xe!==void 0&&ft(Xe);const vt=e.sessions;if(Pt.length>0){const An=Pt.splice(0);await Promise.allSettled(An.map(Hn=>Ht(Hn)))}if(!Be&&Xe!==void 0&&e.flatSessionsSeeded){e.flatSessionsSeeded=!1,e.flatSessionsNextPageToken=null,e.flatSessionsHasMore=!0,e.flatSessionsFrontier=null;try{await Nt()}catch(An){r("ensureFlatSessions",An)}}const $t=NP().filter(An=>!e.sessions.some(Hn=>Hn.id===An));if($t.length>0){const An=await Promise.all($t.map(Wn=>_o(Wn))),Hn=$t.filter((Wn,Di)=>An[Di]==="stale");Hn.length>0&&g(Hn)}e.activeSessionId!==void 0&&!e.sessions.some(An=>An.id===e.activeSessionId)&&await no(e.activeSessionId)==="not-found"&&(v(void 0),Ti(void 0,"replace")),e.activeSessionId!==void 0&&await M(e.activeSessionId);for(const An of e.sessions)(An.mainTurnActive??An.busy)&&e.goalBySession[An.id]===void 0&&q(An.id);const Vt=vt[0],pn=e.activeWorkspaceId;!(pn!==null&&P.value.some(An=>An.id===pn))&&Vt&&ji(Z(Vt)),Qn();const Bn=typeof window<"u"&&gI(ys());Bn&&(e.mainView="sessionAdmin");const an=typeof window<"u"?vI(ys()):void 0;!e.activeSessionId&&an!==void 0&&(e.sessions.some(Hn=>Hn.id===an)||await no(an)==="ok")&&await Zi(an,{urlMode:"replace",skipTrack:!0}),!e.activeSessionId&&vt.length>0&&await Zi(vt[0].id,{urlMode:Bn?"none":"replace",skipTrack:!0})}catch(Ye){ve="failed",r("load",Ye)}finally{e.loading=!1,He&&(G.value=!0),aa("app:load:complete",{status:ve,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-Y})}}async function ri(){try{const Y=Kt(),[ve,Be]=await Promise.all([Y.listWorkspaces().catch(()=>[]),Y.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=ci(ve),e.fsHome=Be.home||null,e.recentRoots=Be.recentRoots}catch{}}function ci(Y){const ve=x2();return Object.keys(ve).length===0?Y:Y.map(Be=>{const He=ve[Be.root];return He!==void 0?{...Be,name:He}:Be})}function ji(Y){e.activeWorkspaceId=Y,ue(Y)}function xi(Y){e.mainView="chat",ji(Y);const ve=e.sessions.filter(Be=>Z(Be)===Y);if(ve.length>0){const Be=ve[0];Be&&Be.id!==e.activeSessionId&&Zi(Be.id,{skipTrack:!0})}else v(void 0),Ti(void 0,"push")}function Uo(Y){const ve=x2()[Y.root],Be=ve!==void 0?{...Y,name:ve}:Y,He=Tl(Be.root);e.hiddenWorkspaceRoots.some(vt=>Tl(vt)===He)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(vt=>Tl(vt)!==He),se(e.hiddenWorkspaceRoots));const Ye=e.workspaces.findIndex(vt=>vt.id===Be.id||vt.root===Be.root);if(Ye===-1){e.workspaces=[Be,...e.workspaces];return}const Xe=[...e.workspaces];Xe[Ye]=Be,e.workspaces=Xe}function ot(Y){if(Y.type==="workspaceCreated"||Y.type==="workspaceUpdated"){Uo(Y.workspace);return}const ve=e.workspaces.find(He=>He.id===Y.workspaceId)?.root??Y.root;if(ve&&!e.hiddenWorkspaceRoots.includes(ve)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,ve],se(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(He=>He.id!==Y.workspaceId&&He.root!==ve),e.activeWorkspaceId===Y.workspaceId||e.activeWorkspaceId===ve){const He=H.value[0]?.id??null;if(e.activeWorkspaceId=He,He)ue(He);else try{Sr(Cn.activeWorkspace)}catch{}v(void 0),e.sessionLoading=!1,tr().clearFileDiff(),Ti(void 0,"replace")}}function Ue(){v(void 0),e.mainView="chat",Ti(void 0,"push")}function st(Y,ve){ve?.entry!==void 0&&(e.draftEntry=ve.entry),ji(Y),Ue(),tr().clearFileDiff()}async function _n(Y){const ve=P.value.find(Bn=>Bn.id===Y);if(!ve)return null;Zze("sidebar");const Be=e.thinking,He=e.draftThinkingExplicit,Ye=Kt();let Xe,vt=ve.root;try{const Bn=await Ye.addWorkspace({root:ve.root});Xe=Bn.id,vt=Bn.root,Uo(Bn)}catch{}const $t=BA().draftModel??void 0,Vt=await Ye.createSession({workspaceId:Xe,cwd:vt,model:$t});BA().setDraftModel(null);const pn=$t!==void 0&&(!Vt.model||Vt.model.length===0)?{...Vt,model:$t}:Vt;f(pn);const In=Vt.id;return Be!==void 0&&He&&(e.thinkingBySession={...e.thinkingBySession,[In]:Be},xw(e,In)),eje({workspaceId:Y,sessionId:In}),e.draftThinkingExplicit=!1,ji(Vt.workspaceId??Xe??Y),await Zi(Vt.id,{skipTrack:!0,skipStatusRefresh:!0}),X.planMode&&(e.planArmedBySession={...e.planArmedBySession,[In]:!0},W()),X.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[In]:!0},Q()),X.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[In]:!0},te()),X.planMode=!1,X.swarmMode=!1,X.goalMode=!1,In}async function bt(Y,ve,Be){if(au.has(Y))return null;au.add(Y);let He=null;try{const Ye=await _n(Y);return!Ye||(He=Ye,await yi(Ye,ve,Be)==="rejected")?null:Ye}catch(Ye){return r("startSessionAndSendPrompt",Ye),He}finally{au.delete(Y)}}async function Zn(Y,ve,Be,He){if(au.has(Y))return{sessionId:null,activated:!1};au.add(Y);let Ye=null;try{const Xe=await _n(Y);if(!Xe)return{sessionId:null,activated:!1};Ye=Xe;const vt=e.planArmedBySession[Xe]??!1,$t=e.swarmModeBySession[Xe]??!1,Vt=e.sessions.find(An=>An.id===Xe),pn=(Vt?.model&&Vt.model.length>0?Vt.model:e.defaultModel)??void 0,In=await s.resolveThinkingForPrompt(Xe,pn)??e.thinking;if(!await B({model:pn,planMode:vt,swarmMode:$t,permissionMode:e.permission,thinking:In},Xe))return{sessionId:Xe,activated:!1};vt&&(e.planArmedBySession={...e.planArmedBySession,[Xe]:!1},W(),e.planModeBySession={...e.planModeBySession,[Xe]:!0});const an=await s.activateSkill(ve,Be,He,Xe,{skipThinkingPersist:!0});return{sessionId:Xe,activated:an}}catch(Xe){return r("startSessionAndActivateSkill",Xe),{sessionId:Ye,activated:!1}}finally{au.delete(Y)}}async function vs(Y,ve){if(au.has(Y))return null;au.add(Y);let Be=null;try{const He=await _n(Y);if(!He)return null;Be=He;const Ye=await o.openSideChatOn(He,ve);return Ye.target&&!Ye.sent&&ve&&p1.set(Ye.target.agentId,ve),{sessionId:He,target:Ye.target}}catch(He){return r("startSessionAndOpenSideChat",He),Be?{sessionId:Be,target:null}:null}finally{au.delete(Y)}}async function go(Y){const ve=vje(Y);if(!ve)return!1;const Be=Kt();try{const He=await Be.addWorkspace({root:ve});return Uo(He),st(He.id,{entry:"workspace"}),!0}catch(He){return ja("[kimi-code] addWorkspaceByPath failed for",ve,He),!1}}async function Ls(Y){try{return await Kt().browseFs(Y)}catch{return{path:"",parent:null,entries:[]}}}async function Hs(){try{return await Kt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function ys(){return{pathname:Mse(window.location.pathname)}}function Vo(Y,ve){if(ve==="none"||typeof window>"u"||!window.history||ys().pathname===Y)return;const Be=rP(Y,window.location.search);try{ve==="push"?window.history.pushState(null,"",Be):window.history.replaceState(null,"",Be)}catch{}}function Ti(Y,ve){e.mainView==="chat"&&Vo(Xse(Y),ve)}function Tr(){e.mainView!=="sessionAdmin"&&(e.mainView="sessionAdmin",Vo(fP,"push"))}function vo(Y){e.mainView==="sessionAdmin"&&(e.mainView="chat",Ti(e.activeSessionId,Y?.urlMode??"push"))}async function no(Y){try{const ve=await Kt().getSession(Y);return!ve.archived&&ni.has(Y)?"not-found":(S(ve.id,ve.lastSeq),e.sessions.some(Be=>Be.id===ve.id)||(ze.add(ve.id),h(ve)),"ok")}catch(ve){return qi(ve)&&ve.code===AB?"not-found":"error"}}async function _o(Y){try{const ve=await Kt().getSession(Y);return ve.archived||ni.has(Y)?"stale":(e.sessions.some(Be=>Be.id===ve.id)||h(ve),"ok")}catch(ve){return qi(ve)&&ve.code===AB?"stale":"retry"}}function Er(){if(gI(ys())){e.mainView="sessionAdmin";return}e.mainView="chat";const Y=vI(ys());if(Y===void 0){v(void 0);return}if(Y!==e.activeSessionId){if(e.sessions.some(ve=>ve.id===Y)){Zi(Y,{urlMode:"none",skipTrack:!0});return}(async()=>{if(await no(Y)==="ok"){await Zi(Y,{urlMode:"none",skipTrack:!0});return}const ve=e.sessions[0];ve?await Zi(ve.id,{urlMode:"replace",skipTrack:!0}):(v(void 0),Ti(void 0,"replace"))})()}}let Bo=!1;function Qn(){Bo||typeof window>"u"||(Bo=!0,window.addEventListener("popstate",Er))}async function Zi(Y,ve){const Be=ve?.source??"sidebar";if(!e.sessions.some($t=>$t.id===Y)){const $t=++K;if(await no(Y)!=="ok"||$t!==K)return}const He=x(Y),Ye=!He&&u.has(Y);u.delete(Y);const Xe=e.activeSessionId!==Y,vt=!He&&!Ye;try{(ve?.urlMode??"push")==="push"&&(e.mainView="chat"),Ti(Y,ve?.urlMode??"push"),e.sessionLoading=vt,v(Y),!ve?.skipTrack&&Xe&&void 0,e.unreadBySession[Y]&&(e.unreadBySession={...e.unreadBySession,[Y]:!1},ge({[Y]:!1})),tr().clearFileDiff();const $t=e.sessions.find(Vt=>Vt.id===Y);if($t){const Vt=Z($t);e.activeWorkspaceId!==Vt&&ji(Vt)}I(Y),be(Y,{skipStatus:ve?.skipStatusRefresh===!0}),vt&&(t.whenMainTranscriptBaseline?.(Y)??Promise.resolve()).finally(()=>{e.activeSessionId===Y&&(e.sessionLoading=!1)})}catch($t){r("selectSession",$t,{sessionId:Y})}finally{!vt&&e.activeSessionId===Y&&(e.sessionLoading=!1)}}async function yi(Y,ve,Be){const He=RA(Y);e.inFlightBySession={...e.inFlightBySession,[Y]:!0};const Ye=y();let Xe=e.pendingThinkingBySession[Y],vt=!1,$t=!1;try{const Vt=Kt(),pn=[];if(ve&&pn.push({type:"text",text:ve}),pn.push(...R4(Be)),pn.length===0)return e.inFlightBySession={...e.inFlightBySession,[Y]:!1},"rejected";const In={id:Ye,sessionId:Y,role:"user",content:pn,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,"kimiWeb.anchorTurnId":w?.(Y),"kimiWeb.anchorPromptCreatedAt":C?.(Y)}};e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:[...e.optimisticMessagesBySession[Y]??[],In]};const Bn=e.sessions.find(xl=>xl.id===Y),an=(Bn?.model&&Bn.model.length>0?Bn.model:e.defaultModel)??void 0,An=e.planArmedBySession[Y]??!1,Hn=An||(e.planModeBySession[Y]??!1),Wn=e.swarmModeBySession[Y]??!1,Di=e.goalModeBySession[Y]??!1;An&&(e.planArmedBySession={...e.planArmedBySession,[Y]:!1},W(),(e.planModeBySession[Y]??!1)||(await Vt.updateSession(Y,{planMode:!0}),e.planModeBySession={...e.planModeBySession,[Y]:!0})),Di&&ve&&(await Vt.updateSession(Y,{goalObjective:ve.trim(),planMode:!1}),e.planModeBySession={...e.planModeBySession,[Y]:!1});const ao=await s.resolveThinkingForPrompt(Y,an)??e.thinking;Xe=e.pendingThinkingBySession[Y],vt=!0;const dr=await Vt.submitPrompt(Y,{content:pn,model:an,thinking:ao,permissionMode:e.permission,planMode:Hn&&!(Di&&ve),swarmMode:Wn});if(ao!==void 0&&Tu(e,Y,Xe),Di&&ve&&(e.goalModeBySession={...e.goalModeBySession,[Y]:!1},te()),e.inFlightBySession[Y]===!0&&(Bv.get(Y)??0)===He){e.promptIdBySession={...e.promptIdBySession,[Y]:dr.promptId},e.abortPromptIdBySession={...e.abortPromptIdBySession,[Y]:dr.promptId};const xl=e.optimisticMessagesBySession[Y];xl!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:xl.map(wa=>wa.id===Ye?{...wa,metadata:{...wa.metadata,"kimiWeb.promptId":dr.promptId}}:wa)}),N()?.bindNextPromptId(Y,dr.promptId)}return $t=!0,"ok"}catch(Vt){e.inFlightBySession={...e.inFlightBySession,[Y]:!1};const pn=!vt||qi(Vt);if(pn){const In=(e.optimisticMessagesBySession[Y]??[]).filter(an=>an.id!==Ye),Bn={...e.optimisticMessagesBySession};In.length>0?Bn[Y]=In:delete Bn[Y],e.optimisticMessagesBySession=Bn}else{const In=e.optimisticMessagesBySession[Y];In!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:In.map(Bn=>Bn.id===Ye?{...Bn,metadata:{...Bn.metadata,"kimiWeb.uncertain":!0}}:Bn)})}return Tu(e,Y,Xe)&&M(Y),r("sendPrompt",Vt,{sessionId:Y}),pn?"rejected":"uncertain"}finally{$A(Y,He),$t&&T?.(Y)}}async function Hi(Y,ve,Be){const He=e.activeSessionId;return He?a.value!=="idle"||e.inFlightBySession[He]?(Ns(Y,ve,Be),"queued"):(e.queuedBySession[He]?.length??0)>0||(Ju.get(He)??0)>0?(Ns(Y,ve,Be),Ws(He),"queued"):yi(He,Y,ve):"rejected"}async function io(Y,ve,Be){Ju.set(Y,(Ju.get(Y)??0)+1);try{if(a.value==="idle"&&!e.inFlightBySession[Y])return await yi(Y,ve,Be);const He=[];ve&&He.push({type:"text",text:ve}),He.push(...R4(Be));const Ye=y(),Xe={id:Ye,sessionId:Y,role:"user",content:He,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,"kimiWeb.anchorTurnId":w?.(Y),"kimiWeb.anchorPromptCreatedAt":C?.(Y),"kimiWeb.steered":!0}};e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:[...e.optimisticMessagesBySession[Y]??[],Xe]};const vt=RA(Y);let $t=!1;try{const Vt=Kt(),pn=e.sessions.find(Wn=>Wn.id===Y),In=(pn?.model&&pn.model.length>0?pn.model:e.defaultModel)??void 0,Bn=await s.resolveThinkingForPrompt(Y,In)??e.thinking,an=e.pendingThinkingBySession[Y];$t=!0;const An=await Vt.submitPrompt(Y,{content:He,model:In,thinking:Bn,permissionMode:e.permission,planMode:e.planModeBySession[Y]??!1,swarmMode:e.swarmModeBySession[Y]??!1});Bn!==void 0&&Tu(e,Y,an);const Hn=e.optimisticMessagesBySession[Y];if(Hn!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Hn.map(Wn=>Wn.id===Ye?{...Wn,metadata:{...Wn.metadata,"kimiWeb.promptId":An.promptId}}:Wn)}),An.status!=="queued"){const Wn=e.optimisticMessagesBySession[Y];return Wn!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Wn.map(Di=>Di.id===Ye?{...Di,metadata:{...Di.metadata,"kimiWeb.promptId":An.promptId,"kimiWeb.steered":void 0}}:Di)}),e.promptIdBySession={...e.promptIdBySession,[Y]:An.promptId},e.abortPromptIdBySession={...e.abortPromptIdBySession,[Y]:An.promptId},N()?.bindNextPromptId(Y,An.promptId),"ok"}try{const Wn=await Vt.steerPrompts(Y,[An.promptId]);if(Wn.steered!==!0||!Wn.promptIds.includes(An.promptId)){const Di=e.optimisticMessagesBySession[Y];Di!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Di.map(ao=>ao.id===Ye?{...ao,metadata:{...ao.metadata,"kimiWeb.steered":void 0}}:ao)})}}catch(Wn){if(qi(Wn)&&Wn.code===40402){const Di=e.optimisticMessagesBySession[Y];Di!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Di.map(ao=>ao.id===Ye?{...ao,metadata:{...ao.metadata,"kimiWeb.steered":void 0}}:ao)})}else{const Di=e.optimisticMessagesBySession[Y];if(Di!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Di.map(ao=>ao.id===Ye?{...ao,metadata:{...ao.metadata,"kimiWeb.uncertain":!0}}:ao)}),!qi(Wn))throw Wn}}return"ok"}catch(Vt){if(qi(Vt)||!$t){const pn=(e.optimisticMessagesBySession[Y]??[]).filter(Bn=>Bn.id!==Ye),In={...e.optimisticMessagesBySession};pn.length>0?In[Y]=pn:delete In[Y],e.optimisticMessagesBySession=In}else{const pn=e.optimisticMessagesBySession[Y];pn!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:pn.map(In=>In.id===Ye?{...In,metadata:{...In.metadata,"kimiWeb.uncertain":!0}}:In)})}return r("steer",Vt,{sessionId:Y}),qi(Vt)||!$t?"rejected":"uncertain"}finally{$A(Y,vt)}}finally{const He=(Ju.get(Y)??1)-1;He<=0?Ju.delete(Y):Ju.set(Y,He)}}function ki(Y){(Ju.get(Y)??0)>0||e.inFlightBySession[Y]||(e.turnActiveBySession[Y]??!1)!==!0&&Ws(Y)}async function di(Y,ve){const Be=e.activeSessionId;if(!Be)return;const Ye=(wg.get(Be)??Promise.resolve()).catch(()=>{}).then(()=>bi(Be,Y,ve));return wg.set(Be,Ye),Ye}async function bi(Y,ve,Be){const He=e.queuedBySession[Y]??[],Ye=[],Xe=[];let vt=0,$t=0;for(const an of He){const An=an.text.trim();An&&Ye.push(QD(An,vt,$t)),an.attachments?.length&&(Xe.push(...an.attachments),vt+=an.attachments.filter(Hn=>Hn.kind==="file").length,$t+=an.attachments.filter(Hn=>Hn.kind==="image"||Hn.kind==="video").length)}const Vt=ve.trim();if(Vt&&Ye.push(QD(Vt,vt,$t)),Be?.length&&Xe.push(...Be),Ye.length===0&&Xe.length===0)return;He.length>0&&(e.queuedBySession={...e.queuedBySession,[Y]:[]});const pn=Ye.join(` + */let hK;const rb=e=>hK=e,pK=Symbol();function bB(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}function Dze(){const e=lk(!0),t=e.run(()=>V({}));let n=[],i=[];const o=Et({install(s){rb(o),o._a=s,s.provide(pK,o),s.config.globalProperties.$pinia=o,i.forEach(r=>n.push(r)),i=[]},use(s){return this._a?n.push(s):i.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const NA=()=>{};function wB(e,t,n,i=NA){e.add(t);const o=()=>{e.delete(t)&&i()};return!n&&av()&&Gd(o),o}function Cp(e,...t){e.forEach(n=>{n(...t)})}const Fze=e=>e(),CB=Symbol(),y5=Symbol();function DA(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,i)=>e.set(i,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!Object.hasOwn(t,n))continue;const i=t[n],o=e[n];bB(o)&&bB(i)&&Object.hasOwn(e,n)&&!Ao(i)&&!Iu(i)?e[n]=DA(o,i):e[n]=i}return e}const Bze=Symbol();function Rze(e){return!e||typeof e!="object"||!Object.hasOwn(e,Bze)}const{assign:Jc}=Object;function Oze(e){return!!(Ao(e)&&e.effect)}function $ze(e,t,n,i){const{state:o,actions:s,getters:r}=t,l=n.state.value[e];let a;function u(){l||(n.state.value[e]=o?o():{});const c=bQ(n.state.value[e]);return Jc(c,s,Object.keys(r||{}).reduce((d,f)=>(d[f]=Et(D(()=>{rb(n);const h=n._s.get(e);return r[f].call(h,h)})),d),{}))}return a=mK(e,u,t,n,i,!0),a}function mK(e,t,n={},i,o,s){let r;const l=Jc({actions:{}},n),a={deep:!0};let u,c,d=new Set,f=new Set,h;const m=i.state.value[e];!s&&!m&&(i.state.value[e]={});let g;function v(I){let S;u=c=!1,typeof I=="function"?(I(i.state.value[e]),S={type:"patch function",storeId:e,events:h}):(DA(i.state.value[e],I),S={type:"patch object",payload:I,storeId:e,events:h});const _=g=Symbol();ft().then(()=>{g===_&&(u=!0)}),c=!0,Cp(d,S,i.state.value[e])}const y=s?function(){const{state:S}=n,_=S?S():{};this.$patch(x=>{Jc(x,_)})}:NA;function b(){r.stop(),d.clear(),f.clear(),i._s.delete(e)}const w=(I,S="")=>{if(CB in I)return I[y5]=S,I;const _=function(){rb(i);const x=Array.from(arguments),E=new Set,M=new Set;function R($){E.add($)}function q($){M.add($)}Cp(f,{args:x,name:_[y5],store:T,after:R,onError:q});let z;try{z=I.apply(this&&this.$id===e?this:T,x)}catch($){throw Cp(M,$),$}return z instanceof Promise?z.then($=>(Cp(E,$),$)).catch($=>(Cp(M,$),Promise.reject($))):(Cp(E,z),z)};return _[CB]=!0,_[y5]=S,_},C={_p:i,$id:e,$onAction:wB.bind(null,f),$patch:v,$reset:y,$subscribe(I,S={}){if(d.has(I))return NA;const _=wB(d,I,S.detached,()=>x()),x=r.run(()=>We(()=>i.state.value[e],E=>{(S.flush==="sync"?c:u)&&I({storeId:e,type:"direct",events:h},E)},Jc({},a,S)));return _},$dispose:b},T=ao(C);i._s.set(e,T);const N=(i._a&&i._a.runWithContext||Fze)(()=>i._e.run(()=>(r=lk()).run(()=>t({action:w}))));for(const I in N){const S=N[I];Ao(S)&&!Oze(S)||Iu(S)?s||(m&&Rze(S)&&(Ao(S)?S.value=m[I]:((S instanceof Set||S instanceof Map)&&S.clear(),DA(S,m[I]))),i.state.value[e][I]=S):typeof S=="function"&&(N[I]=w(S,I),l.actions[I]=S)}return Jc(T,N),Jc(yi(T),N),Object.defineProperty(T,"$state",{get:()=>i.state.value[e],set:I=>{v(S=>{Jc(S,I)})}}),i._p.forEach(I=>{const S=r.run(()=>I({store:T,app:i._a,pinia:i,options:l}));Jc(T,S)}),m&&s&&n.hydrate&&n.hydrate(T.$state,m),u=!0,c=!0,T}/*! #__NO_SIDE_EFFECTS__ */function Dv(e,t,n){let i;const o=typeof t=="function";i=o?n:t;function s(r,l){const a=NQ();return r=r||(a?Yt(pK,null):null),r&&rb(r),r=hK,r._s.has(e)||(o?mK(e,t,i,r):$ze(e,i,r)),r._s.get(e)}return s.$id=e,s}const Pze={api:()=>{throw new Error("[@moonshot-ai/app-client] client deps not installed — call setKimiClientDeps() at app bootstrap")},t:e=>e},Qa=globalThis.__kimiAppClientDeps??={current:Pze};function zze(e){Qa.current=e}const jze=new Proxy({},{get(e,t){return Qa.current.api()[t]}});function Zt(){return jze}function li(e,t){return Qa.current.t(e,t)}function Hze(e,t){Qa.current.traceClientEvent?.(e,t)}function ha(e,t){Qa.current.traceKeyEvent?.(e,t)}function Wze(){return Qa.current.sessionExportTraceToJsonl?.()??""}function Q0(e){Qa.current.onSessionDestroyed?.(e)}function qze(e,t,n){Qa.current.onWorkspaceDestroyed?.(e,t,n)}function Uze(e){return Qa.current.consumeSessionIntent?.(e)??e}function Vze(e){return Qa.current.onPluginsShelfEvent?(Qa.current.onPluginsShelfEvent(e),!0):!1}const sm=Dze(),gK=xn.starredModels;function Kze(){try{const e=ps(gK);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Zze(e){try{ds(gK,JSON.stringify(e))}catch{}}const Gze=Dv("kimi.models",()=>{const e=V([]),t=V(Kze()),n=V([]),i=V({}),o=V({}),s=V({}),r=V({}),l=new Set,a=new Set,u=V(null);function c(b){e.value=b}function d(b){n.value=b}function f(b){u.value=b}function h(b,w){i.value={...i.value,[b]:w}}function m(b,w){o.value={...o.value,[b]:w}}function g(b){const w=new Set(t.value);w.has(b)?w.delete(b):w.add(b),t.value=Array.from(w),Zze(t.value)}async function v(b){if(l.has(b))return;l.add(b);const w={...s.value};delete w[b],s.value=w;try{const C=await Zt().listSkills(b);h(b,C)}catch{}finally{l.delete(b),s.value={...s.value,[b]:!0}}}async function y(b){if(a.has(b))return;a.add(b);const w={...r.value};delete w[b],r.value=w;try{const C=await Zt().listSkillsForWorkspace(b);m(b,C)}catch{}finally{a.delete(b),r.value={...r.value,[b]:!0}}}return{models:e,starredModelIds:t,providers:n,draftModel:u,skillsBySession:i,skillsByWorkspace:o,skillsFetchedBySession:s,skillsFetchedByWorkspace:r,setModels:c,setProviders:d,setDraftModel:f,setSkillsForSession:h,setSkillsForWorkspace:m,toggleStarModel:g,loadSkillsForSession:v,loadSkillsForWorkspace:y}});function FA(){return Gze(sm)}const AB=new Error("profile persist failed");function Qze(e,t){const{api:n,pushOperationFailure:i,refreshSessionStatus:o,persistSessionProfile:s,savePlanModeToStorage:r,activity:l,updateSession:a,loadConfig:u,checkAuth:c,beginLocalTurn:d,settleLocalTurn:f,mainTranscriptTailTurnId:h,mainTranscriptTailPromptCreatedAt:m,settleIfFateProven:g}=t,v=FA();function y(ce){if(!(ce==null||ce.length===0))return v.models.find(se=>se.id===ce)??v.models.find(se=>se.model===ce)}function b(){const ce=e.activeSessionId?e.sessions.find(pe=>pe.id===e.activeSessionId):void 0,se=ce===void 0?v.draftModel??e.defaultModel:ce.model||e.defaultModel;return y(se)?.id??se??void 0}function w(ce){if(ce===void 0)return;const se=y(ce);return se===void 0?void 0:hh(se)}function C(ce,se){const pe=ce==null?void 0:e.thinkingBySession[ce];return pe!==void 0?L9(se,pe)?pe:hh(se):M6(e.config?.thinking,se)??hh(se)}function T(ce,se){if(se===void 0)return;const pe=y(se);return pe===void 0?void 0:C(ce,pe)}async function N(ce,se){return ce!=null&&e.thinkingBySession[ce]===void 0&&await o(ce),T(ce,se)}function I(ce){e.thinking=ce;const se=e.activeSessionId;return ce!==void 0&&se!==null&&se!==void 0?(e.thinkingBySession={...e.thinkingBySession,[se]:ce},Aw(e,se)):se==null&&(e.draftThinkingExplicit=ce!==void 0),ce}function S(){const ce=e.activeSessionId,se=y(b());if(ce==null){if(e.draftThinkingExplicit){if(se===void 0||e.thinking!==void 0&&L9(se,e.thinking))return;e.draftThinkingExplicit=!1}}else e.draftThinkingExplicit&&(e.draftThinkingExplicit=!1);se!==void 0&&(e.thinking=C(ce,se))}We([()=>e.activeSessionId,()=>b(),()=>{const ce=e.activeSessionId;return ce==null?void 0:e.thinkingBySession[ce]},()=>e.config?.thinking],S);async function _(){try{v.setModels(await n.listModels()),S()}catch(ce){i("loadModels",ce)}}async function x(){try{v.setProviders(await n.listProviders())}catch(ce){i("loadProviders",ce)}}async function E(ce){const se=e.activeSessionId,pe=y(ce),Z=e.thinking,ae=se?e.sessions.find(be=>be.id===se)?.model:void 0,K=b()!==(pe?.id??ce),re=Toe(pe,Z,K,se?void 0:e.config?.thinking);if(!se)return v.setDraftModel(ce),e.thinking=re,K&&(e.draftThinkingExplicit=!1),!0;a(se,be=>({...be,model:ce}));let we;re!==Z&&(e.thinking=re,re!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[se]:re},we=Aw(e,se)));try{await n.updateSession(se,{model:ce,thinking:re!==Z?re:void 0})}catch(be){return a(se,ke=>({...ke,model:ae??ke.model})),re!==Z&&(e.thinking=Z,Z!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[se]:Z}),Eu(e,se,we)&&o(se)),i("setModel",be,{sessionId:se}),!1}return Eu(e,se,we),await o(se),!0}async function M(ce,se,pe,Z,ae){const K=Z??e.activeSessionId;if(!K)return!1;const re=l.value==="idle"&&!e.inFlightBySession[K],we=`msg_skill_opt_${Date.now().toString(36)}`,be=re?d(K):void 0;let ke=!1,oe=!1;if(re){e.inFlightBySession={...e.inFlightBySession,[K]:!0};const le={id:we,sessionId:K,role:"user",content:[{type:"text",text:`/${ce}${se?` ${se}`:""}`},...B4(pe)],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,"kimiWeb.anchorTurnId":h?.(K),"kimiWeb.anchorPromptCreatedAt":m?.(K),origin:{kind:"skill_activation",trigger:"user-slash",skillName:ce,skillArgs:se}}};e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[K]:[...e.optimisticMessagesBySession[K]??[],le]}}try{if(ae?.skipThinkingPersist!==!0){const le=e.sessions.find(fe=>fe.id===K)?.model,ye=(le&&le.length>0?le:e.defaultModel)??void 0,Ae=e.planArmedBySession[K]??!1;if(!await s({thinking:await N(K,ye)??e.thinking,swarmMode:e.swarmModeBySession?.[K]??!1,permissionMode:e.permission,...Ae?{planMode:!0}:{}},K))throw AB;Ae&&(e.planArmedBySession={...e.planArmedBySession,[K]:!1},r(),e.planModeBySession={...e.planModeBySession,[K]:!0})}return ke=!0,await n.activateSkill(K,ce,se,B4(pe)),oe=!0,!0}catch(le){if(re)if(e.inFlightBySession={...e.inFlightBySession,[K]:!1},!ke||le instanceof bu){const Ae=(e.optimisticMessagesBySession[K]??[]).filter(fe=>fe.id!==we),Me={...e.optimisticMessagesBySession};Ae.length>0?Me[K]=Ae:delete Me[K],e.optimisticMessagesBySession=Me}else{const Ae=e.optimisticMessagesBySession[K];Ae!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[K]:Ae.map(Me=>Me.id===we?{...Me,metadata:{...Me.metadata,"kimiWeb.uncertain":!0}}:Me)})}return le!==AB&&i("activateSkill",le,{sessionId:K}),!(!ke||le instanceof bu)}finally{be!==void 0&&f(K,be),oe&&be!==void 0&&g?.(K)}}async function R(ce){return n.getProvider(ce)}async function q(ce){try{return await n.addProvider(ce),await Promise.all([x(),_(),u()]),await c(),null}catch(se){return yu("[kimi-code] operation failed: addProvider",se),se instanceof Error?se.message:String(se)}}async function z(ce,se){try{return await n.updateProvider(ce,se),await Promise.all([x(),_(),u()]),null}catch(pe){return yu("[kimi-code] operation failed: updateProvider",pe),pe instanceof Error?pe.message:String(pe)}}async function $(ce){try{const se=await n.deleteProvider(ce);return await Promise.all([x(),_(),u()]),await c(),se}catch(se){return i("deleteProvider",se),null}}async function B(ce){try{const se=await n.refreshProvider(ce);for(const pe of se.failed)i("refreshProvider",new Error(pe.reason),{message:pe.provider});await Promise.all([x(),_(),u()])}catch(se){i("refreshProvider",se)}}async function P(){try{const ce=await n.refreshAllProviders();for(const se of ce.failed)i("refreshAllProviders",new Error(se.reason),{message:se.provider});await Promise.all([x(),_(),u()])}catch(ce){i("refreshAllProviders",ce)}}async function H(){try{return{kind:"ok",items:await n.listCatalogProviders()}}catch(ce){return ce instanceof bu&&ce.code===void 0?{kind:"unsupported"}:(yu("[kimi-code] operation failed: loadCatalogProviders",ce),{kind:"error"})}}async function j(ce){try{return await n.importCatalogProvider(ce),await Promise.all([x(),_(),u()]),await c(),null}catch(se){return yu("[kimi-code] operation failed: importCatalogProvider",se),se instanceof Error?se.message:String(se)}}async function G(ce){try{const se=await n.importCustomRegistry(ce);return await Promise.all([x(),_(),u()]),await c(),se}catch(se){return yu("[kimi-code] operation failed: importCustomRegistry",se),se instanceof Error?se.message:String(se)}}async function ne(ce){try{return await n.startOAuthLogin(ce)}catch{return null}}async function W(){return n.getOAuthRegion()}async function Q(){try{return await n.pollOAuthLogin()}catch(ce){return Ua("[kimi-code] pollOAuthLogin failed",ce),null}}async function te(){try{await n.cancelOAuthLogin()}catch{}}async function X(){try{return await n.getUsage()}catch(ce){return{kind:"error",message:ce instanceof Error?ce.message:String(ce)}}}function ve(ce){const se=I(ce);s({thinking:se})}return{models:D(()=>v.models),starredModelIds:D(()=>v.starredModelIds),providers:D(()=>v.providers),draftModel:D(()=>v.draftModel),skillsBySession:D(()=>v.skillsBySession),skillsByWorkspace:D(()=>v.skillsByWorkspace),skillsFetchedBySession:D(()=>v.skillsFetchedBySession),skillsFetchedByWorkspace:D(()=>v.skillsFetchedByWorkspace),loadSkillsForSession:v.loadSkillsForSession,loadSkillsForWorkspace:v.loadSkillsForWorkspace,loadModels:_,loadProviders:x,setModel:E,thinkingLevelForModelId:w,thinkingLevelForSessionId:T,resolveThinkingForPrompt:N,toggleStarModel:v.toggleStarModel,activateSkill:M,addProvider:q,updateProvider:z,deleteProvider:$,getProvider:R,loadCatalogProviders:H,importCatalogProvider:j,importCustomRegistry:G,refreshProvider:B,refreshAllProviders:P,startOAuthLogin:ne,pollOAuthLogin:Q,cancelOAuthLogin:te,getOAuthRegion:W,getUsage:X,setThinking:ve}}let s0=null;function Yze(e){s0=e}function Jze(e){s0!==null&&e!==s0.sessionId&&(s0=null)}function Xze(){return s0}const eje=Dv("kimi.approvals",()=>{const e=V({}),t=V({});function n(c){Ll(e.value,c)}function i(c){Ll(t.value,c)}function o(c,d){e.value[c]=d}function s(c,d){t.value[c]=d}function r(c,d){const f=e.value[c]??[];e.value[c]=f.filter(h=>h.approvalId!==d)}function l(c,d){const f=t.value[c]??[];t.value[c]=f.filter(h=>h.questionId!==d)}function a(c){delete e.value[c]}function u(c){delete t.value[c]}return{approvalsBySession:e,questionsBySession:t,applyApprovalsDiff:n,applyQuestionsDiff:i,setSessionApprovals:o,setSessionQuestions:s,removePendingApproval:r,removePendingQuestion:l,clearSessionApprovals:a,clearSessionQuestions:u}});function ir(){return eje(sm)}const tje=Dv("kimi.sessions",()=>{const e=V([]),t=V(void 0),n=V(NP());function i(h){e.value=h}function o(h,m){e.value=e.value.map(g=>g.id===h?m(g):g)}function s(h){e.value=dP(e.value,h)}function r(h){e.value=[...e.value,h]}function l(h){e.value=e.value.filter(m=>m.id!==h)}function a(h){t.value=h}function u(h){const m=ase(n.value,h);m!==n.value&&(n.value=m,N3(m))}function c(h){const m=use(n.value,h);m!==n.value&&(n.value=m,N3(m))}function d(h){const m=new Set(h),g=n.value.filter(v=>!m.has(v));g.length!==n.value.length&&(n.value=g,N3(g))}function f(h){n.value.includes(h)?c(h):u(h)}return{sessions:e,activeSessionId:t,pinnedSessionIds:n,setSessions:i,updateSession:o,upsertSessionSorted:s,appendSession:r,removeSession:l,setActiveSessionId:a,pinSession:u,unpinSession:c,unpinSessions:d,togglePinSession:f}});function wr(){return tje(sm)}const nje=40409;function ije(e){return!e||e.state!=="open"&&e.state!=="closed"&&e.state!=="merged"?null:{number:e.number,state:e.state,url:e.url}}function oje(e,t){return e==null||t==null?e==null&&t==null:e.number===t.number&&e.state===t.state&&e.url===t.url}const sje=Dv("kimi.files",()=>{const e=V(null),t=V([]),n=V(!1),i=V(null),o=V(!1),s=V({});async function r(d){const f=wr().activeSessionId;if(!f)return null;try{const m=await Zt().readFile(f,{path:d});return{path:m.path,content:m.content,encoding:m.encoding,mime:m.mime,languageId:m.languageId,isBinary:m.isBinary,size:m.size,lineCount:m.lineCount}}catch(h){if(Ua("[kimi-code] readFileContent failed for",d,h),qi(h)&&h.code===nje)throw h;return null}}async function l(d){const f=wr().activeSessionId;if(f){e.value=d,t.value=[],i.value=null,o.value=!1,n.value=!0;try{const m=await Zt().getFileDiff(f,d);if(e.value!==d||wr().activeSessionId!==f)return;const g=iAe(m.diff);if(t.value=g,g.length===0){const y=await r(d).catch(()=>null);if(e.value!==d||wr().activeSessionId!==f)return;o.value=y!==null&&y.size===0;return}n.value=!1;const v=await $Ce(g,{truncated:m.truncated,readNewText:async()=>{const y=await r(d).catch(()=>null);return!y||y.isBinary||y.encoding!=="utf-8"?null:y.content}});if(e.value!==d||wr().activeSessionId!==f)return;i.value=v}catch(h){e.value===d&&(t.value=[]),Ua("[loadFileDiff] diff unavailable for",d,h)}finally{e.value===d&&(n.value=!1)}}}function a(){e.value=null,t.value=[],i.value=null,o.value=!1,n.value=!1}async function u(d){try{const h=await Zt().getGitStatus(d);s.value[d]=h;const m=ije(h.pullRequest);wr().updateSession(d,g=>oje(g.pullRequest,m)?g:{...g,pullRequest:m})}catch{}}function c(d){delete s.value[d]}return{selectedDiffPath:e,fileDiffLines:t,fileDiffLoading:n,fileDiffTexts:i,fileDiffEmptyFile:o,gitStatusBySession:s,readFileContent:r,loadFileDiff:l,clearFileDiff:a,loadGitStatus:u,clearSessionGitStatus:c}});function er(){return sje(sm)}const yg=5,Kx=5,kd=50,xB=40401,rje=40402,lje=40410,SB=40409,aje=40902,uje=2e3,cje=10;function k5(e){return qi(e)&&e.code===aje}const dje=40904;function _B(e){return qi(e)&&e.code===dje}const fje=40406;function hje(e){return qi(e)&&e.code===fje}function pje(e){const t=e.trim();if(t.length<2)return t;const n=t[0];return(n==='"'||n==="'")&&t[t.length-1]===n?t.slice(1,-1).trim():t}const Ff=ao({}),hy=ao({}),b5=ao({}),w5=ao({}),uu=ao(new Set),Fv=new Map,Ph=new Map,R4=new Map;let mje=0;const Hf=new Map,gje=3,Xu=new Map,kg=new Map,bg=new Map,vje=3,t9=new Map;function yje(e){const t=t9.get(e);if(!(t!==void 0&&(t.done||t.attempts>=vje))){t9.set(e,{attempts:(t?.attempts??0)+1,done:!1});try{Zt().generateSessionTitle(e,{source:"first_turn"}).then(n=>{n!==null&&t9.set(e,{attempts:0,done:!0})}).catch(()=>{})}catch{}}}let MB=0;function kje(){return MB+=1,`${Date.now().toString(36)}-${MB}`}function vK(e){return{generation:Fv.get(e)??0,pending:(Ph.get(e)?.size??0)>0}}function BA(e){const t=++mje;Fv.set(e,t);const n=Ph.get(e)??new Set;return n.add(t),Ph.set(e,n),t}function RA(e,t){const n=Ph.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Ph.delete(e);const i=R4.get(e);R4.delete(e),i?.()}function bje(e){Fv.delete(e),Ph.delete(e),R4.delete(e),Hf.delete(e),Xu.delete(e),bg.delete(e),kg.delete(e)}function wje(e,t){return!t.pending&&t.generation===(Fv.get(e)??0)}function Cje(e,t){if((Ph.get(e)?.size??0)===0){t();return}R4.set(e,t)}function Aje(e,t){const{confirm:n}=cf(),{taskPoller:i,sideChat:o,modelProvider:s,pushOperationFailure:r,notify:l,activity:a,sessionsKnownEmpty:u,setSessions:c,updateSession:d,upsertSessionSorted:f,appendSession:h,forgetSession:m,unpinSessions:g,setActiveSessionId:v,nextOptimisticMsgId:y,lastMainUserPromptText:b,mainTranscriptTailTurnId:w,mainTranscriptTailPromptCreatedAt:C,settleIfFateProven:T,getEventConn:N,subscribeSessionEvents:I,noteSessionWatermark:S,refreshMainTranscript:_,hasLoadedMessages:x,resolveTaskRestId:E,refreshSessionStatus:M,refreshSessionGoal:R,refillSessionGoalOnReload:q,refreshSessionPlans:z,settlePlanReviewLocally:$,persistSessionProfile:B,mergedWorkspaces:P,workspacesView:H,status:j,workspaceIdForSession:G,savePermissionToStorage:ne,savePlanModeToStorage:W,saveSwarmModeToStorage:Q,saveGoalModeToStorage:te,draftModes:X,saveUnread:ve,saveActiveWorkspaceToStorage:ce,saveHiddenWorkspacesToStorage:se,goalErrorMessage:pe,initialized:Z,connectIssue:ae}=t;let K=0,re=!1;function we(Y,ge){i.loadTasksForSession(Y),er().loadGitStatus(Y),ge?.skipStatus!==!0&&M(Y),R(Y),z(Y),be(Y),Object.prototype.hasOwnProperty.call(s.skillsBySession.value,Y)||s.loadSkillsForSession(Y)}function be(Y){Zt().getSessionWarnings(Y).then(ge=>{if(!e.sessions.some(Qe=>Qe.id===Y))return;const Be=kg.get(Y)??new Set;kg.set(Y,Be);const He=li("warnings.noteLabel");for(const Qe of ge){const Xe=`${Qe.code} ${Qe.message}`;Be.has(Xe)||(Be.add(Xe),l({severity:Qe.severity,title:`${He}: ${Qe.message}`}))}}).catch(()=>{})}function ke(Y,ge){const Be=kg.get(Y)??new Set;Be.add(ge),kg.set(Y,Be)}let oe=0;async function le(Y){try{const ge=await Zt().getUserInfo();if(Y!==oe||e.managedProviderStatus!=="authenticated")return;e.managedUserInfo=ge.kind==="ok"?ge.userInfo:null,ge.kind==="ok"?e.managedMembership=ge.userInfo.userLevel===cje?"free":"member":e.managedMembership=ge.status===402?"free":null}catch{if(Y!==oe)return;e.managedProviderStatus==="authenticated"&&(e.managedUserInfo=null,e.managedMembership=null)}}async function ye(){e.managedProviderStatus==="authenticated"&&await le(++oe)}async function Ae(){const Y=++oe;try{const Be=await Zt().getAuth();return e.authReady=Be.ready,e.defaultModel=Be.defaultModel,e.managedProviderStatus=Be.managedProvider?.status??null,e.managedProviderStatus==="authenticated"?le(Y):(e.managedUserInfo=null,e.managedMembership=null),ae.value=null,"proceed"}catch(ge){return qi(ge)&&(ge.code===401||ge.code===qH)?(ae.value=null,"server-auth-required"):(ae.value=(ge instanceof Error?ge.message:String(ge)).slice(0,140),"retry")}}async function Me(){let Y=!0;for(;;){const ge=await Ae();if(ge!=="retry")return ge;Y&&(ae.value=null,Y=!1),await new Promise(Be=>{setTimeout(Be,uje)})}}async function fe(){try{const Y=Zt();e.config=await Y.getConfig()}catch{}}async function ie(Y){try{const Be=await Zt().setConfig(Y);return e.config=Be,e.defaultModel=Be.defaultModel??null,!0}catch(ge){return r("setConfig",ge),!1}}const Ee=100;async function qe(Y){const ge=Zt(),Be=[];let He,Qe;for(;Y?.shouldContinue?.()!==!1;){let Xe;try{Xe=await ge.listSessions({pageSize:Ee,beforeId:He,excludeEmpty:!0})}catch(yt){if(Be.length===0)throw yt;Qe=yt;break}if(Be.push(...Xe.items),!Xe.hasMore||Xe.items.length===0)break;He=Xe.items[Xe.items.length-1].id}return{sessions:Be,error:Qe}}const ze=new Set;function ht(Y){for(const yt of Y)S(yt.id,yt.lastSeq);const ge=ni.size===0?Y:Y.filter(yt=>!ni.has(yt.id)),Be=new Set(ge.map(yt=>yt.id)),He=e.sessions.filter(yt=>ze.has(yt.id)&&!Be.has(yt.id)&&!ni.has(yt.id)),Qe=He.length===0?ge:[...ge,...He].sort((yt,Rt)=>new Date(Rt.updatedAt).getTime()-new Date(yt.updatedAt).getTime()),Xe=new Map(e.sessions.map(yt=>[yt.id,yt]));c(Qe.map(yt=>{const Rt=Xe.get(yt.id);if(Rt===void 0)return yt;const Kt=CN(yt.usage)&&!CN(Rt.usage),wn=yt.pullRequest??Rt.pullRequest,Sn=(yt.model??"")===""?Rt.model:yt.model;return!Kt&&wn===yt.pullRequest&&Sn===yt.model?yt:{...yt,usage:Kt?Rt.usage:yt.usage,pullRequest:wn,model:Sn}}))}function gt(Y){const ge=[...Y],Be=new Set(ge.map(He=>He.id));for(const He of e.sessions)Be.has(He.id)||(ge.push(He),Be.add(He.id));return ge.sort((He,Qe)=>new Date(Qe.updatedAt).getTime()-new Date(He.updatedAt).getTime()),ge}async function _t(){const Y=Zt(),ge={groupPageSize:yg,hasPrompt:!0};let Be;try{Be=await Y.listSessionGroupsV2(ge)}catch(mn){r("load",mn);return}const He=[...Be.groups];let Qe=Be.nextPageToken;for(;Qe!==null;){let mn;try{mn=await Y.listSessionGroupsV2({...ge,pageToken:Qe})}catch(fn){r("load",fn);return}He.push(...mn.groups),Qe=mn.nextPageToken}const Xe=new Map(He.map(mn=>[mn.workspace.id,mn])),yt=new Map(He.filter(mn=>mn.workspace.cwd!==null).map(mn=>[Nl(mn.workspace.cwd),mn])),Rt=[],Kt=new Set,wn={},Sn={},Un={};for(const mn of e.workspaces){const fn=Xe.get(mn.id)??yt.get(Nl(mn.root));if(fn===void 0){wn[mn.id]=!1,Sn[mn.id]=void 0,Un[mn.id]=yg;continue}const Qn=fn.sessions.filter(On=>!ni.has(On.id)&&(On.meta.last_prompt??"").length>0).map(On=>G2(On.workspace.cwd===null?{...On,workspace:{...On.workspace,cwd:mn.root}}:On));for(const On of Qn)Kt.has(On.id)||(Rt.push(On),Kt.add(On.id));wn[mn.id]=fn.sessions.length0?Qn[Qn.length-1].id:void 0,Un[mn.id]=Math.max(Qn.length,yg)}e.sessionsHasMoreByWorkspace=wn,e.sessionsCursorByWorkspace=Sn,e.sessionsInitialCountByWorkspace=Un,e.sessionsFullyLoaded=!1;for(const mn of He)for(const fn of mn.sessions){const Qn=fn.activity.status;(Qn==="running"||Qn==="approval"||Qn==="question")&&$t.push(fn.id)}return Rt.sort((mn,fn)=>new Date(fn.updatedAt).getTime()-new Date(mn.updatedAt).getTime()),Rt}const $t=[];async function jt(Y){const ge=e.lastSeqBySession[Y]??0;let Be;try{Be=await Zt().getSession(Y)}catch{return}(e.lastSeqBySession[Y]??0)>ge||d(Y,He=>({...He,busy:Be.busy,mainTurnActive:Be.mainTurnActive??He.mainTurnActive,pendingInteraction:Be.pendingInteraction??He.pendingInteraction,lastTurnReason:Be.lastTurnReason??He.lastTurnReason}))}async function Ht(){if($t.length=0,e.workspaces.length===0){const ge=await qe(),Be=ge.error===void 0?ge.sessions:gt(ge.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=ge.error===void 0,ge.error!==void 0&&r("load",ge.error),Be}return _t()}async function Te(Y){if(!e.sessionsLoadingMoreByWorkspace[Y]&&e.sessionsHasMoreByWorkspace[Y]!==!1&&e.sessionsCursorByWorkspace[Y]!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Y]:!0};try{let ge=e.sessionsCursorByWorkspace[Y],Be;for(let yt=0;yt<3&&ge!==void 0&&(Be=await Zt().listSessions({workspaceId:Y,pageSize:Kx,beforeId:ge,excludeEmpty:!0}),e.sessionsCursorByWorkspace[Y]!==ge);yt+=1)Be=void 0,ge=e.sessionsCursorByWorkspace[Y];if(Be===void 0)return;const He=new Set(e.sessions.map(yt=>yt.id)),Qe=Be.items.filter(yt=>!He.has(yt.id)&&!ni.has(yt.id));for(const yt of Qe)ze.add(yt.id);Qe.length>0&&c([...e.sessions,...Qe]);const Xe=Be.items.filter(yt=>!ni.has(yt.id)).at(-1);e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Y]:Xe?.id??ge},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Y]:Be.hasMore}}catch(ge){r("loadMoreSessions",ge)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Y]:!1}}}}function Fe(Y){return e.sessions.filter(ge=>!ge.parentSessionId&&G(ge)===Y)}const Ve=5;function lt(Y,ge){const Be=new Set(e.sessions.map(Xe=>Xe.id)),He=Y.items.filter(Xe=>!Be.has(Xe.id)&&!ni.has(Xe.id)&&(Xe.meta.last_prompt??"").length>0).map(G2);for(const Xe of He)ze.add(Xe.id);He.length>0&&c([...e.sessions,...He]);for(const Xe of Y.items)if(Be.has(Xe.id)&&Xe.git!==void 0){const yt=Xe.git.pull_request;d(Xe.id,Rt=>Rt.pullRequest===yt?Rt:{...Rt,pullRequest:yt})}if(Y.items.length>0){const Xe=Math.min(...Y.items.map(yt=>yt.meta.updated_at));e.flatSessionsFrontier=ge?.resetFrontier===!0||e.flatSessionsFrontier===null?Xe:Math.min(e.flatSessionsFrontier,Xe)}e.flatSessionsNextPageToken=Y.nextPageToken,e.flatSessionsHasMore=Y.hasMore;const Qe=new Set(H.value.map(Xe=>Xe.id));return Y.items.filter(Xe=>(Xe.meta.last_prompt??"").length>0&&!ni.has(Xe.id)&&Qe.has(G({workspaceId:Xe.workspace.id,cwd:Xe.workspace.cwd??""}))).length}async function Ft(){const Y=await Zt().listSessionsV2({pageSize:kd,include:"git"});lt(Y,{resetFrontier:!0}),e.flatSessionsSeeded=!0}async function Lt(){if(!(e.flatSessionsSeeded||e.flatSessionsLoading)){e.flatSessionsLoading=!0;try{await Ft()}catch(Y){r("ensureFlatSessions",Y)}finally{e.flatSessionsLoading=!1}}}async function Vt(){if(!(e.flatSessionsLoading||e.flatSessionsLoadingMore)&&e.flatSessionsHasMore){e.flatSessionsLoadingMore=!0;try{if(!e.flatSessionsSeeded){await Ft();return}if(e.flatSessionsNextPageToken===null)return;for(let Y=0;Y0)break}}catch(Y){r("loadMoreFlatSessions",Y)}finally{e.flatSessionsLoadingMore=!1}}}async function qt(){const Y=await Zt().listSessionsV2({pageSize:kd,include:"git",archived:!0}),ge=new Set,Be=Y.items.filter(Qe=>(Qe.meta.last_prompt??"").length>0).filter(Qe=>!gi.has(Qe.id)).filter(Qe=>ge.has(Qe.id)?!1:(ge.add(Qe.id),!0)).map(G2),He=e.doneSessions.filter(Qe=>ni.has(Qe.id)&&!ge.has(Qe.id));e.doneSessions=[...He,...Be],e.doneSessionsNextPageToken=Y.nextPageToken,e.doneSessionsHasMore=Y.hasMore}async function nn(){if(!(e.doneSessionsSeeded||e.doneSessionsLoading)){e.doneSessionsLoading=!0;try{await qt(),e.doneSessionsSeeded=!0}catch(Y){r("ensureDoneSessions",Y)}finally{e.doneSessionsLoading=!1}}}async function it(){if(!(e.doneSessionsLoading||e.doneSessionsLoadingMore)&&e.doneSessionsHasMore){e.doneSessionsLoadingMore=!0;try{if(!e.doneSessionsSeeded){await qt(),e.doneSessionsSeeded=!0;return}let Y=3;for(;;){const ge=e.doneSessionsNextPageToken;if(ge===null)return;let Be;try{Be=await Zt().listSessionsV2({pageSize:kd,pageToken:ge,include:"git",archived:!0})}catch(Xe){if(!vN(Xe))throw Xe;e.doneSessionsNextPageToken=null,await qt();return}const He=new Set(e.doneSessions.map(Xe=>Xe.id)),Qe=Be.items.filter(Xe=>!He.has(Xe.id)&&!gi.has(Xe.id)&&(Xe.meta.last_prompt??"").length>0).map(G2);if(Qe.length>0&&(e.doneSessions=[...e.doneSessions,...Qe]),e.doneSessionsNextPageToken=Be.nextPageToken,e.doneSessionsHasMore=Be.hasMore,Y-=1,Qe.length>0||!Be.hasMore||Y<=0)return}}catch(Y){r("loadMoreDoneSessions",Y)}finally{e.doneSessionsLoadingMore=!1}}}async function dt(Y,ge,Be,He){if(e.sessionsCursorByWorkspace[Y]===ge){const Xe=new Date(Be).getTime();let yt;for(const Rt of e.sessions){if(G(Rt)!==Y)continue;const Kt=new Date(Rt.updatedAt).getTime();Kt<=Xe||(yt===void 0||Kt0&&Fe(Y).lengthSn.id)),wn=Rt.items.filter(Sn=>!Kt.has(Sn.id)&&!ni.has(Sn.id));for(const Sn of wn)ze.add(Sn.id);wn.length>0&&c([...e.sessions,...wn].sort((Sn,Un)=>new Date(Un.updatedAt).getTime()-new Date(Sn.updatedAt).getTime())),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Y]:Rt.items.length>0?Rt.items[Rt.items.length-1].id:void 0},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Y]:Rt.hasMore}}catch(Rt){r("loadMoreSessions",Rt);break}else await Te(Y);if(Qe-=1,Fe(Y).length===yt&&e.sessionsCursorByWorkspace[Y]===Xe)break}}async function At(){if(e.sessionsFullyLoaded)return;const Y=await qe().catch(He=>(Ua("[kimi-code] loadAllSessions failed; search covers only loaded sessions",He),null));if(Y===null)return;const ge=Y.error===void 0?Y.sessions:gt(Y.sessions);if(ht(ge),e.sessionsFullyLoaded=Y.error===void 0,Y.error!==void 0)return;const Be={};for(const He of e.workspaces)Be[He.id]=!1;e.sessionsHasMoreByWorkspace=Be}async function un(){const Y=await Zt().getMeta().catch(()=>null);Y!==null&&(e.serverVersion=Y.serverVersion,e.availableOpenInApps=Y.openInApps,e.dangerousBypassAuth=Y.dangerousBypassAuth,e.experimentalFlags=Y.experimentalFlags,e.backend=Y.backend,e.webTitle=Y.webTitle)}async function Qt(){const Y=Date.now();let ge="accepted";ha("app:load:start"),e.loading=!0,ze.clear();const Be=!Z.value;let He=!0;try{if(Be&&await Me()==="server-auth-required"){He=!1,ge="auth-required";return}const Qe=Zt();await Promise.all([Qe.getHealth().catch(()=>null),un(),s.loadModels()]),Be||await Ae(),await fe(),await ei();const Xe=await Ht();Xe!==void 0&&ht(Xe);const yt=e.sessions;if($t.length>0){const fn=$t.splice(0);await Promise.allSettled(fn.map(Qn=>jt(Qn)))}if(!Be&&Xe!==void 0&&e.flatSessionsSeeded){e.flatSessionsSeeded=!1,e.flatSessionsNextPageToken=null,e.flatSessionsHasMore=!0,e.flatSessionsFrontier=null;try{await Ft()}catch(fn){r("ensureFlatSessions",fn)}}const Rt=NP().filter(fn=>!e.sessions.some(Qn=>Qn.id===fn));if(Rt.length>0){const fn=await Promise.all(Rt.map(On=>fo(On))),Qn=Rt.filter((On,Ci)=>fn[Ci]==="stale");Qn.length>0&&g(Qn)}e.activeSessionId!==void 0&&!e.sessions.some(fn=>fn.id===e.activeSessionId)&&await go(e.activeSessionId)==="not-found"&&(v(void 0),Ei(void 0,"replace")),e.activeSessionId!==void 0&&await M(e.activeSessionId);for(const fn of e.sessions)(fn.mainTurnActive??fn.busy)&&e.goalBySession[fn.id]===void 0&&q(fn.id);const Kt=yt[0],wn=e.activeWorkspaceId;!(wn!==null&&P.value.some(fn=>fn.id===wn))&&Kt&&Hi(G(Kt)),qn();const Un=typeof window<"u"&&vI(Fs());Un&&(e.mainView="sessionAdmin");const mn=typeof window<"u"?yI(Fs()):void 0;!e.activeSessionId&&mn!==void 0&&(e.sessions.some(Qn=>Qn.id===mn)||await go(mn)==="ok")&&await to(mn,{urlMode:"replace",skipTrack:!0}),!e.activeSessionId&&yt.length>0&&await to(yt[0].id,{urlMode:Un?"none":"replace",skipTrack:!0})}catch(Qe){ge="failed",r("load",Qe)}finally{e.loading=!1,He&&(Z.value=!0),ha("app:load:complete",{status:ge,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-Y})}}async function ei(){try{const Y=Zt(),[ge,Be]=await Promise.all([Y.listWorkspaces().catch(()=>[]),Y.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=mi(ge),e.fsHome=Be.home||null,e.recentRoots=Be.recentRoots}catch{}}function mi(Y){const ge=A2();return Object.keys(ge).length===0?Y:Y.map(Be=>{const He=ge[Be.root];return He!==void 0?{...Be,name:He}:Be})}function Hi(Y){e.activeWorkspaceId=Y,ce(Y)}function wi(Y){e.mainView="chat",Hi(Y);const ge=e.sessions.filter(Be=>G(Be)===Y);if(ge.length>0){const Be=ge[0];Be&&Be.id!==e.activeSessionId&&to(Be.id,{skipTrack:!0})}else v(void 0),Ei(void 0,"push")}function Vo(Y){const ge=A2()[Y.root],Be=ge!==void 0?{...Y,name:ge}:Y,He=Nl(Be.root);e.hiddenWorkspaceRoots.some(yt=>Nl(yt)===He)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(yt=>Nl(yt)!==He),se(e.hiddenWorkspaceRoots));const Qe=e.workspaces.findIndex(yt=>yt.id===Be.id||yt.root===Be.root);if(Qe===-1){e.workspaces=[Be,...e.workspaces];return}const Xe=[...e.workspaces];Xe[Qe]=Be,e.workspaces=Xe}function ot(Y){if(Y.type==="workspaceCreated"||Y.type==="workspaceUpdated"){Vo(Y.workspace);return}const ge=e.workspaces.find(He=>He.id===Y.workspaceId)?.root??Y.root;if(ge&&!e.hiddenWorkspaceRoots.includes(ge)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,ge],se(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(He=>He.id!==Y.workspaceId&&He.root!==ge),e.activeWorkspaceId===Y.workspaceId||e.activeWorkspaceId===ge){const He=H.value[0]?.id??null;if(e.activeWorkspaceId=He,He)ce(He);else try{xr(xn.activeWorkspace)}catch{}v(void 0),e.sessionLoading=!1,er().clearFileDiff(),Ei(void 0,"replace")}}function Ue(){v(void 0),e.mainView="chat",Ei(void 0,"push")}function st(Y,ge){ge?.entry!==void 0&&(e.draftEntry=ge.entry),Hi(Y),Ue(),er().clearFileDiff()}async function In(Y){const ge=P.value.find(Un=>Un.id===Y);if(!ge)return null;Uze("sidebar");const Be=e.thinking,He=e.draftThinkingExplicit,Qe=Zt();let Xe,yt=ge.root;try{const Un=await Qe.addWorkspace({root:ge.root});Xe=Un.id,yt=Un.root,Vo(Un)}catch{}const Rt=FA().draftModel??void 0,Kt=await Qe.createSession({workspaceId:Xe,cwd:yt,model:Rt});FA().setDraftModel(null);const wn=Rt!==void 0&&(!Kt.model||Kt.model.length===0)?{...Kt,model:Rt}:Kt;f(wn);const Sn=Kt.id;return Be!==void 0&&He&&(e.thinkingBySession={...e.thinkingBySession,[Sn]:Be},Aw(e,Sn)),Yze({workspaceId:Y,sessionId:Sn}),e.draftThinkingExplicit=!1,Hi(Kt.workspaceId??Xe??Y),await to(Kt.id,{skipTrack:!0,skipStatusRefresh:!0}),X.planMode&&(e.planArmedBySession={...e.planArmedBySession,[Sn]:!0},W()),X.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Sn]:!0},Q()),X.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Sn]:!0},te()),X.planMode=!1,X.swarmMode=!1,X.goalMode=!1,Sn}async function kt(Y,ge,Be){if(uu.has(Y))return null;uu.add(Y);let He=null;try{const Qe=await In(Y);return!Qe||(He=Qe,await fi(Qe,ge,Be)==="rejected")?null:Qe}catch(Qe){return r("startSessionAndSendPrompt",Qe),He}finally{uu.delete(Y)}}async function ui(Y,ge,Be,He){if(uu.has(Y))return{sessionId:null,activated:!1};uu.add(Y);let Qe=null;try{const Xe=await In(Y);if(!Xe)return{sessionId:null,activated:!1};Qe=Xe;const yt=e.planArmedBySession[Xe]??!1,Rt=e.swarmModeBySession[Xe]??!1,Kt=e.sessions.find(fn=>fn.id===Xe),wn=(Kt?.model&&Kt.model.length>0?Kt.model:e.defaultModel)??void 0,Sn=await s.resolveThinkingForPrompt(Xe,wn)??e.thinking;if(!await B({model:wn,planMode:yt,swarmMode:Rt,permissionMode:e.permission,thinking:Sn},Xe))return{sessionId:Xe,activated:!1};yt&&(e.planArmedBySession={...e.planArmedBySession,[Xe]:!1},W(),e.planModeBySession={...e.planModeBySession,[Xe]:!0});const mn=await s.activateSkill(ge,Be,He,Xe,{skipThinkingPersist:!0});return{sessionId:Xe,activated:mn}}catch(Xe){return r("startSessionAndActivateSkill",Xe),{sessionId:Qe,activated:!1}}finally{uu.delete(Y)}}async function _o(Y,ge){if(uu.has(Y))return null;uu.add(Y);let Be=null;try{const He=await In(Y);if(!He)return null;Be=He;const Qe=await o.openSideChatOn(He,ge);return Qe.target&&!Qe.sent&&ge&&p1.set(Qe.target.agentId,ge),{sessionId:He,target:Qe.target}}catch(He){return r("startSessionAndOpenSideChat",He),Be?{sessionId:Be,target:null}:null}finally{uu.delete(Y)}}async function co(Y){const ge=pje(Y);if(!ge)return!1;const Be=Zt();try{const He=await Be.addWorkspace({root:ge});return Vo(He),st(He.id,{entry:"workspace"}),!0}catch(He){return Ua("[kimi-code] addWorkspaceByPath failed for",ge,He),!1}}async function Ns(Y){try{return await Zt().browseFs(Y)}catch{return{path:"",parent:null,entries:[]}}}async function Ds(){try{return await Zt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Fs(){return{pathname:_se(window.location.pathname)}}function Fo(Y,ge){if(ge==="none"||typeof window>"u"||!window.history||Fs().pathname===Y)return;const Be=rP(Y,window.location.search);try{ge==="push"?window.history.pushState(null,"",Be):window.history.replaceState(null,"",Be)}catch{}}function Ei(Y,ge){e.mainView==="chat"&&Fo(Jse(Y),ge)}function ur(){e.mainView!=="sessionAdmin"&&(e.mainView="sessionAdmin",Fo(fP,"push"))}function Mo(Y){e.mainView==="sessionAdmin"&&(e.mainView="chat",Ei(e.activeSessionId,Y?.urlMode??"push"))}async function go(Y){try{const ge=await Zt().getSession(Y);return!ge.archived&&ni.has(Y)?"not-found":(S(ge.id,ge.lastSeq),e.sessions.some(Be=>Be.id===ge.id)||(ze.add(ge.id),h(ge)),"ok")}catch(ge){return qi(ge)&&ge.code===xB?"not-found":"error"}}async function fo(Y){try{const ge=await Zt().getSession(Y);return ge.archived||ni.has(Y)?"stale":(e.sessions.some(Be=>Be.id===ge.id)||h(ge),"ok")}catch(ge){return qi(ge)&&ge.code===xB?"stale":"retry"}}function Ir(){if(vI(Fs())){e.mainView="sessionAdmin";return}e.mainView="chat";const Y=yI(Fs());if(Y===void 0){v(void 0);return}if(Y!==e.activeSessionId){if(e.sessions.some(ge=>ge.id===Y)){to(Y,{urlMode:"none",skipTrack:!0});return}(async()=>{if(await go(Y)==="ok"){await to(Y,{urlMode:"none",skipTrack:!0});return}const ge=e.sessions[0];ge?await to(ge.id,{urlMode:"replace",skipTrack:!0}):(v(void 0),Ei(void 0,"replace"))})()}}let Bo=!1;function qn(){Bo||typeof window>"u"||(Bo=!0,window.addEventListener("popstate",Ir))}async function to(Y,ge){const Be=ge?.source??"sidebar";if(!e.sessions.some(Rt=>Rt.id===Y)){const Rt=++K;if(await go(Y)!=="ok"||Rt!==K)return}const He=x(Y),Qe=!He&&u.has(Y);u.delete(Y);const Xe=e.activeSessionId!==Y,yt=!He&&!Qe;try{(ge?.urlMode??"push")==="push"&&(e.mainView="chat"),Ei(Y,ge?.urlMode??"push"),e.sessionLoading=yt,v(Y),!ge?.skipTrack&&Xe&&void 0,e.unreadBySession[Y]&&(e.unreadBySession={...e.unreadBySession,[Y]:!1},ve({[Y]:!1})),er().clearFileDiff();const Rt=e.sessions.find(Kt=>Kt.id===Y);if(Rt){const Kt=G(Rt);e.activeWorkspaceId!==Kt&&Hi(Kt)}I(Y),we(Y,{skipStatus:ge?.skipStatusRefresh===!0}),yt&&(t.whenMainTranscriptBaseline?.(Y)??Promise.resolve()).finally(()=>{e.activeSessionId===Y&&(e.sessionLoading=!1)})}catch(Rt){r("selectSession",Rt,{sessionId:Y})}finally{!yt&&e.activeSessionId===Y&&(e.sessionLoading=!1)}}async function fi(Y,ge,Be){const He=BA(Y);e.inFlightBySession={...e.inFlightBySession,[Y]:!0};const Qe=y();let Xe=e.pendingThinkingBySession[Y],yt=!1,Rt=!1;try{const Kt=Zt(),wn=[];if(ge&&wn.push({type:"text",text:ge}),wn.push(...B4(Be)),wn.length===0)return e.inFlightBySession={...e.inFlightBySession,[Y]:!1},"rejected";const Sn={id:Qe,sessionId:Y,role:"user",content:wn,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,"kimiWeb.anchorTurnId":w?.(Y),"kimiWeb.anchorPromptCreatedAt":C?.(Y)}};e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:[...e.optimisticMessagesBySession[Y]??[],Sn]};const Un=e.sessions.find(Jl=>Jl.id===Y),mn=(Un?.model&&Un.model.length>0?Un.model:e.defaultModel)??void 0,fn=e.planArmedBySession[Y]??!1,Qn=fn||(e.planModeBySession[Y]??!1),On=e.swarmModeBySession[Y]??!1,Ci=e.goalModeBySession[Y]??!1;fn&&(e.planArmedBySession={...e.planArmedBySession,[Y]:!1},W(),(e.planModeBySession[Y]??!1)||(await Kt.updateSession(Y,{planMode:!0}),e.planModeBySession={...e.planModeBySession,[Y]:!0})),Ci&&ge&&(await Kt.updateSession(Y,{goalObjective:ge.trim(),planMode:!1}),e.planModeBySession={...e.planModeBySession,[Y]:!1});const io=await s.resolveThinkingForPrompt(Y,mn)??e.thinking;Xe=e.pendingThinkingBySession[Y],yt=!0;const hr=await Kt.submitPrompt(Y,{content:wn,model:mn,thinking:io,permissionMode:e.permission,planMode:Qn&&!(Ci&&ge),swarmMode:On});if(io!==void 0&&Eu(e,Y,Xe),Ci&&ge&&(e.goalModeBySession={...e.goalModeBySession,[Y]:!1},te()),e.inFlightBySession[Y]===!0&&(Fv.get(Y)??0)===He){e.promptIdBySession={...e.promptIdBySession,[Y]:hr.promptId},e.abortPromptIdBySession={...e.abortPromptIdBySession,[Y]:hr.promptId};const Jl=e.optimisticMessagesBySession[Y];Jl!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Jl.map(Tl=>Tl.id===Qe?{...Tl,metadata:{...Tl.metadata,"kimiWeb.promptId":hr.promptId}}:Tl)}),N()?.bindNextPromptId(Y,hr.promptId)}return Rt=!0,"ok"}catch(Kt){e.inFlightBySession={...e.inFlightBySession,[Y]:!1};const wn=!yt||qi(Kt);if(wn){const Sn=(e.optimisticMessagesBySession[Y]??[]).filter(mn=>mn.id!==Qe),Un={...e.optimisticMessagesBySession};Sn.length>0?Un[Y]=Sn:delete Un[Y],e.optimisticMessagesBySession=Un}else{const Sn=e.optimisticMessagesBySession[Y];Sn!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Sn.map(Un=>Un.id===Qe?{...Un,metadata:{...Un.metadata,"kimiWeb.uncertain":!0}}:Un)})}return Eu(e,Y,Xe)&&M(Y),r("sendPrompt",Kt,{sessionId:Y}),wn?"rejected":"uncertain"}finally{RA(Y,He),Rt&&T?.(Y)}}async function Zi(Y,ge,Be){const He=e.activeSessionId;return He?a.value!=="idle"||e.inFlightBySession[He]?(gs(Y,ge,Be),"queued"):(e.queuedBySession[He]?.length??0)>0||(Xu.get(He)??0)>0?(gs(Y,ge,Be),qs(He),"queued"):fi(He,Y,ge):"rejected"}async function no(Y,ge,Be){Xu.set(Y,(Xu.get(Y)??0)+1);try{if(a.value==="idle"&&!e.inFlightBySession[Y])return await fi(Y,ge,Be);const He=[];ge&&He.push({type:"text",text:ge}),He.push(...B4(Be));const Qe=y(),Xe={id:Qe,sessionId:Y,role:"user",content:He,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,"kimiWeb.anchorTurnId":w?.(Y),"kimiWeb.anchorPromptCreatedAt":C?.(Y),"kimiWeb.steered":!0}};e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:[...e.optimisticMessagesBySession[Y]??[],Xe]};const yt=BA(Y);let Rt=!1;try{const Kt=Zt(),wn=e.sessions.find(On=>On.id===Y),Sn=(wn?.model&&wn.model.length>0?wn.model:e.defaultModel)??void 0,Un=await s.resolveThinkingForPrompt(Y,Sn)??e.thinking,mn=e.pendingThinkingBySession[Y];Rt=!0;const fn=await Kt.submitPrompt(Y,{content:He,model:Sn,thinking:Un,permissionMode:e.permission,planMode:e.planModeBySession[Y]??!1,swarmMode:e.swarmModeBySession[Y]??!1});Un!==void 0&&Eu(e,Y,mn);const Qn=e.optimisticMessagesBySession[Y];if(Qn!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Qn.map(On=>On.id===Qe?{...On,metadata:{...On.metadata,"kimiWeb.promptId":fn.promptId}}:On)}),fn.status!=="queued"){const On=e.optimisticMessagesBySession[Y];return On!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:On.map(Ci=>Ci.id===Qe?{...Ci,metadata:{...Ci.metadata,"kimiWeb.promptId":fn.promptId,"kimiWeb.steered":void 0}}:Ci)}),e.promptIdBySession={...e.promptIdBySession,[Y]:fn.promptId},e.abortPromptIdBySession={...e.abortPromptIdBySession,[Y]:fn.promptId},N()?.bindNextPromptId(Y,fn.promptId),"ok"}try{const On=await Kt.steerPrompts(Y,[fn.promptId]);if(On.steered!==!0||!On.promptIds.includes(fn.promptId)){const Ci=e.optimisticMessagesBySession[Y];Ci!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Ci.map(io=>io.id===Qe?{...io,metadata:{...io.metadata,"kimiWeb.steered":void 0}}:io)})}}catch(On){if(qi(On)&&On.code===40402){const Ci=e.optimisticMessagesBySession[Y];Ci!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Ci.map(io=>io.id===Qe?{...io,metadata:{...io.metadata,"kimiWeb.steered":void 0}}:io)})}else{const Ci=e.optimisticMessagesBySession[Y];if(Ci!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:Ci.map(io=>io.id===Qe?{...io,metadata:{...io.metadata,"kimiWeb.uncertain":!0}}:io)}),!qi(On))throw On}}return"ok"}catch(Kt){if(qi(Kt)||!Rt){const wn=(e.optimisticMessagesBySession[Y]??[]).filter(Un=>Un.id!==Qe),Sn={...e.optimisticMessagesBySession};wn.length>0?Sn[Y]=wn:delete Sn[Y],e.optimisticMessagesBySession=Sn}else{const wn=e.optimisticMessagesBySession[Y];wn!==void 0&&(e.optimisticMessagesBySession={...e.optimisticMessagesBySession,[Y]:wn.map(Sn=>Sn.id===Qe?{...Sn,metadata:{...Sn.metadata,"kimiWeb.uncertain":!0}}:Sn)})}return r("steer",Kt,{sessionId:Y}),qi(Kt)||!Rt?"rejected":"uncertain"}finally{RA(Y,yt)}}finally{const He=(Xu.get(Y)??1)-1;He<=0?Xu.delete(Y):Xu.set(Y,He)}}function Ko(Y){(Xu.get(Y)??0)>0||e.inFlightBySession[Y]||(e.turnActiveBySession[Y]??!1)!==!0&&qs(Y)}async function ri(Y,ge){const Be=e.activeSessionId;if(!Be)return;const Qe=(bg.get(Be)??Promise.resolve()).catch(()=>{}).then(()=>Li(Be,Y,ge));return bg.set(Be,Qe),Qe}async function Li(Y,ge,Be){const He=e.queuedBySession[Y]??[],Qe=[],Xe=[];let yt=0,Rt=0;for(const mn of He){const fn=mn.text.trim();fn&&Qe.push(YD(fn,yt,Rt)),mn.attachments?.length&&(Xe.push(...mn.attachments),yt+=mn.attachments.filter(Qn=>Qn.kind==="file").length,Rt+=mn.attachments.filter(Qn=>Qn.kind==="image"||Qn.kind==="video").length)}const Kt=ge.trim();if(Kt&&Qe.push(YD(Kt,yt,Rt)),Be?.length&&Xe.push(...Be),Qe.length===0&&Xe.length===0)return;He.length>0&&(e.queuedBySession={...e.queuedBySession,[Y]:[]});const wn=Qe.join(` -`),In=()=>{if(He.length===0)return;const an=e.queuedBySession[Y]??[];e.queuedBySession={...e.queuedBySession,[Y]:[...He,...an]}},Bn=await io(Y,pn,Xe);Bn==="rejected"&&In(),Bn!=="ok"&&ki(Y)}async function oo(Y){const ve=e.activeSessionId;if(!ve)return;const Be=(e.queuedBySession[ve]??[])[Y];if(Be===void 0)return;const He=Be.id??Be.text,Xe=(wg.get(ve)??Promise.resolve()).catch(()=>{}).then(()=>so(ve,He));return wg.set(ve,Xe),Xe}async function so(Y,ve){const Be=e.queuedBySession[Y]??[],He=Be.findIndex(Vt=>(Vt.id??Vt.text)===ve),Ye=He>=0?Be[He]:void 0;if(Ye===void 0)return;const Xe=Ye.attachments??[];if(Ye.text.trim().length===0&&Xe.length===0)return;const vt=[...Be];vt.splice(He,1),e.queuedBySession={...e.queuedBySession,[Y]:vt};const $t=await io(Y,Ye.text,Xe);if($t==="rejected"&&e.sessions.some(Vt=>Vt.id===Y)){const pn=[...e.queuedBySession[Y]??[]];pn.splice(Math.min(He,pn.length),0,Ye),e.queuedBySession={...e.queuedBySession,[Y]:pn}}$t!=="ok"&&ki(Y)}async function Mn(Y,ve,Be){try{const Ye=await Kt().uploadFile({file:Y,name:ve,onProgress:Be});return{fileId:Ye.id,name:Ye.name,mediaType:Ye.mediaType}}catch(He){return r("uploadImage",He),null}}function Ns(Y,ve,Be){const He=e.activeSessionId;if(!He)return;const Ye=e.queuedBySession[He]??[],Xe={text:Y,attachments:ve,editText:Be,id:Cje()};e.queuedBySession={...e.queuedBySession,[He]:[...Ye,Xe]}}function Ws(Y){if((Ju.get(Y)??0)>0)return;const[ve,...Be]=e.queuedBySession[Y]??[];ve!==void 0&&(e.queuedBySession={...e.queuedBySession,[Y]:Be},yi(Y,ve.text,ve.attachments).then(He=>{if(He==="ok"){jf.delete(Y);return}if(He==="uncertain"){jf.delete(Y);return}if(!e.sessions.some(Vt=>Vt.id===Y)){jf.delete(Y);return}const Ye=ve.id??ve.text,Xe=jf.get(Y),vt=Xe!==void 0&&Xe.key===Ye?Xe.count+1:1;if(vt>=kje){jf.delete(Y),(e.queuedBySession[Y]?.length??0)>0&&Ws(Y);return}jf.set(Y,{key:Ye,count:vt});const $t=e.queuedBySession[Y]??[];e.queuedBySession={...e.queuedBySession,[Y]:[ve,...$t]}}))}function Jo(Y,ve){const Be=e.inFlightBySession[Y]===!0;e.inFlightBySession={...e.inFlightBySession,[Y]:!1};const He=e.optimisticMessagesBySession[Y];if(He!==void 0&&He.length>0){const Xe={...e.optimisticMessagesBySession};if(ve?.retireOptimistic==="all"){const vt=He.filter($t=>$t.metadata?.["kimiWeb.uncertain"]===!0);vt.length>0?Xe[Y]=vt:delete Xe[Y],e.optimisticMessagesBySession=Xe}else{const vt=He.findIndex($t=>$t.metadata?.["kimiWeb.uncertain"]!==!0);if(vt!==-1){const $t=[...He.slice(0,vt),...He.slice(vt+1)];$t.length>0?Xe[Y]=$t:delete Xe[Y],e.optimisticMessagesBySession=Xe}}}if(e.promptIdBySession[Y]!==void 0){const Xe={...e.promptIdBySession};delete Xe[Y],e.promptIdBySession=Xe}if(e.abortPromptIdBySession?.[Y]!==void 0){const Xe={...e.abortPromptIdBySession};delete Xe[Y],e.abortPromptIdBySession=Xe}return(Be||ve?.turnWasActive===!0||(e.turnActiveBySession[Y]??!1))&&ve?.skipDrain!==!0&&Ws(Y),Be}async function ks(){const Y=e.activeSessionId;if(!Y)return!1;const ve=e.sessions.find($t=>$t.id===Y);let Be=e.abortPromptIdBySession?.[Y];if(Be===void 0){const $t=ve?.currentPromptId;$t!==void 0&&$t.length>0&&!$t.startsWith("pr_")&&(Be=$t)}const He=Kt();let Ye=!1;const Xe=()=>{e.inFlightBySession={...e.inFlightBySession,[Y]:!1},e.turnActiveBySession={...e.turnActiveBySession,[Y]:!1}};if(Be!==void 0)try{if((await He.abortPrompt(Y,Be)).aborted)return!0;Ye=!0;const Vt={...e.promptIdBySession};delete Vt[Y],e.promptIdBySession=Vt;const pn={...e.abortPromptIdBySession};delete pn[Y],e.abortPromptIdBySession=pn,Xe()}catch($t){if(qi($t)&&$t.code===uje){Ye=!0;const Vt={...e.promptIdBySession};delete Vt[Y],e.promptIdBySession=Vt;const pn={...e.abortPromptIdBySession};delete pn[Y],e.abortPromptIdBySession=pn,Xe()}else return r("abortCurrentPrompt",$t,{sessionId:Y}),!1}if(Ye||!((e.inFlightBySession[Y]??!1)||(e.turnActiveBySession[Y]??!1)||(ve?.mainTurnActive??!1)))return!1;try{return(await He.abortSession(Y)).aborted===!0}catch($t){return r("abortCurrentPrompt",$t,{sessionId:Y}),!1}}async function ro(Y,ve){const Be=e.activeSessionId;if(!Be||py[Y])return;py[Y]=!0;const He=e.approvalsBySession[Be]?.find(Ye=>Ye.approvalId===Y&&Ye.toolName==="ExitPlanMode")?.toolCallId;try{const Ye=Kt(),Xe={decision:ve.decision,scope:ve.scope,feedback:ve.feedback,selectedLabel:ve.selectedLabel};await Ye.respondApproval(Be,Y,Xe),or().removePendingApproval(Be,Y),He!==void 0&&(O(Be,He,{state:ve.decision,selectedOption:ve.selectedLabel,feedback:ve.feedback}),z(Be,He))}catch(Ye){b5(Ye)?(or().removePendingApproval(Be,Y),He!==void 0&&z(Be,He)):r("respondApproval",Ye,{sessionId:Be})}finally{delete py[Y]}}async function eo(Y,ve){const Be=e.activeSessionId;if(Be&&!Df[Y]){Df[Y]="answer";try{await Kt().respondQuestion(Be,Y,ve),or().removePendingQuestion(Be,Y)}catch(He){b5(He)?or().removePendingQuestion(Be,Y):r("respondQuestion",He,{sessionId:Be})}finally{delete Df[Y]}}}async function to(Y){const ve=e.activeSessionId;if(ve&&!Df[Y]){Df[Y]="dismiss";try{await Kt().dismissQuestion(ve,Y),or().removePendingQuestion(ve,Y)}catch(Be){b5(Be)?or().removePendingQuestion(ve,Y):r("dismissQuestion",Be,{sessionId:ve})}finally{delete Df[Y]}}}async function Gi(Y){const ve=e.activeSessionId;if(ve&&!w5[Y]){w5[Y]=!0;try{const Be=Kt(),He=(e.tasksBySession[ve]??[]).find(Xe=>Xe.id===Y)?.backgroundTaskId??E?.(ve,Y);await Be.cancelTask(ve,He??Y);const Ye=e.tasksBySession[ve]??[];e.tasksBySession={...e.tasksBySession,[ve]:Ye.map(Xe=>(He!==void 0?Xe.backgroundTaskId===He||Xe.id===He:Xe.id===Y||Xe.backgroundTaskId===Y)?{...Xe,status:"cancelled",completedAt:Xe.completedAt??new Date().toISOString(),completedAtEstimated:Xe.completedAt===void 0?!0:Xe.completedAtEstimated}:Xe)}}catch(Be){SB(Be)||r("cancelTask",Be,{sessionId:ve})}finally{delete w5[Y]}}}function je(Y,ve){return Y.parentToolCallId===ve&&Y.status==="running"&&Y.runInBackground!==!0}function xe(Y,ve){return(e.tasksBySession[Y]??[]).find(Be=>je(Be,ve))}async function Pe(Y){const ve=e.activeSessionId;if(ve&&!C5[Y]){C5[Y]=!0;try{const Be=Kt();let He=xe(ve,Y),Ye;if(He===void 0){let Vt;try{Vt=await Be.listTasks(ve)}catch(pn){r("detachTask",pn,{sessionId:ve});return}He=Vt.find(pn=>je(pn,Y)),Ye=He?.id}if(He===void 0)return;const Xe=He;Ye??=Xe.backgroundTaskId??E?.(ve,Xe.id)??Xe.id;const vt=await Be.detachTask(ve,Ye),$t=e.tasksBySession[ve]??[];e.tasksBySession={...e.tasksBySession,[ve]:$t.map(Vt=>Vt.id!==Xe.id||(Vt.backgroundTaskId??E?.(ve,Vt.id)??Vt.id)!==Ye?Vt:vt.status==="running"?{...Vt,runInBackground:!0}:{...Vt,status:vt.status,completedAt:Vt.completedAt??new Date().toISOString(),completedAtEstimated:Vt.completedAt===void 0?!0:Vt.completedAtEstimated})}}catch(Be){!gje(Be)&&!SB(Be)&&r("detachTask",Be,{sessionId:ve})}finally{delete C5[Y]}}}function rn(Y){const ve=e.activeSessionId;ve?(e.planArmedBySession={...e.planArmedBySession,[ve]:Y},W(),!Y&&(e.planModeBySession[ve]??!1)&&(e.planModeBySession={...e.planModeBySession,[ve]:!1},vse(e,ve),B({planMode:!1},ve))):X.planMode=Y}function Yn(){const Y=e.activeSessionId,ve=Y?(e.planArmedBySession[Y]??!1)||(e.planModeBySession[Y]??!1):X.planMode;rn(!ve)}function ei(Y){const ve=e.activeSessionId;ve?(e.swarmModeBySession={...e.swarmModeBySession,[ve]:Y},Q(),uae(e,ve),B({swarmMode:Y})):X.swarmMode=Y}async function Qi(){const Y=e.activeSessionId,Be=!(Y?e.swarmModeBySession[Y]??!1:X.swarmMode);Be&&e.permission==="manual"&&!await n({title:li("workspace.swarmEnableTitle"),message:li("workspace.swarmEnableConfirm"),variant:"primary"})||ei(Be)}function Vn(Y){const ve=e.activeSessionId;ve?(e.goalModeBySession={...e.goalModeBySession,[ve]:Y},te()):X.goalMode=Y}function qs(){const Y=e.activeSessionId,ve=Y?e.goalModeBySession[Y]??!1:X.goalMode;Vn(!ve)}async function bs(Y){const ve=Y.trim();if(!ve||e.permission==="manual"&&!await n({title:li("workspace.goalStartTitle"),message:li("workspace.goalStartConfirm",{objective:ve}),variant:"primary"}))return null;let Be=e.activeSessionId,He=null;if(!Be){const Ye=e.activeWorkspaceId,Xe=Ye&&H.value.some(vt=>vt.id===Ye)?Ye:H.value[0]?.id??null;if(!Xe)return null;try{Be=await _n(Xe)??void 0,He=Be??null}catch(vt){return r("createGoal",vt),null}if(!Be)return null}try{await Kt().updateSession(Be,{goalObjective:ve,planMode:!1}),e.planModeBySession={...e.planModeBySession,[Be]:!1}}catch(Ye){return r("createGoal",Ye,{sessionId:Be,message:fe(Ye)}),He}return e.goalModeBySession[Be]&&(e.goalModeBySession={...e.goalModeBySession,[Be]:!1},te()),e.activeSessionId===Be?await Hi(ve):await yi(Be,ve),He}function Je(Y){const ve=e.activeSessionId;ve&&Promise.resolve(Kt().updateSession(ve,{goalControl:Y})).catch(Be=>{r("controlGoal",Be,{sessionId:ve,message:fe(Be)})})}function Ve(Y){e.permission=Y,ie(Y),B({permissionMode:Y})}function St(Y){const ve=[...e.warnings];ve.splice(Y,1),e.warnings=ve}async function Rt(Y,ve){try{await Kt().updateSession(Y,{title:ve}),d(Y,He=>({...He,title:ve})),e.doneSessions.some(He=>He.id===Y)&&(e.doneSessions=e.doneSessions.map(He=>He.id===Y?{...He,title:ve}:He))}catch(Be){r("renameSession",Be,{sessionId:Y})}}async function Fn(Y){const ve=await Kt().generateSessionTitle(Y,{force:!0,source:"digest"});return ve===null?l({severity:"info",title:li("sidebar.genTitleUnavailable")}):e.doneSessions.some(Be=>Be.id===Y)&&(e.doneSessions=e.doneSessions.map(Be=>Be.id===Y?{...Be,title:ve}:Be)),ve}async function fi(Y,ve){const Be=e.workspaces.find(Ye=>Ye.id===Y)?.root,He=()=>{e.workspaces=e.workspaces.map(Ye=>Ye.id===Y?{...Ye,name:ve}:Ye)};try{if(await Kt().updateWorkspace(Y,{name:ve}),Be!==void 0){const Ye=x2();Be in Ye&&(delete Ye[Be],QI(Ye))}He()}catch(Ye){if(Be!==void 0&&qi(Ye)&&Ye.code===cje){QI({...x2(),[Be]:ve}),He();return}r("renameWorkspace",Ye)}}async function Mo(Y){const ve=e.workspaces.find(Xe=>Xe.id===Y)?.root??P.value.find(Xe=>Xe.id===Y)?.root??Y,Be=e.activeSessionId?e.sessions.find(Xe=>Xe.id===e.activeSessionId):void 0,He=e.activeWorkspaceId===Y||e.activeWorkspaceId===ve,Ye=!!(Be&&(Be.cwd===ve||Be.workspaceId===Y||Z(Be)===Y));ve&&!e.hiddenWorkspaceRoots.includes(ve)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,ve],se(e.hiddenWorkspaceRoots));try{await Kt().deleteWorkspace(Y)}catch(Xe){ja("[kimi-code] deleteWorkspace registry cleanup failed for",Y,Xe)}if(e.workspaces=e.workspaces.filter(Xe=>Xe.id!==Y&&Xe.root!==ve),He||Ye){const Xe=H.value[0]?.id??null;if(e.activeWorkspaceId=Xe,Xe)ue(Xe);else try{Sr(Cn.activeWorkspace)}catch{}}(He||Ye)&&(v(void 0),e.sessionLoading=!1,tr().clearFileDiff(),Ti(void 0,"replace"))}const Io=500,ni=new Set;function Ro(Y){if(!ni.has(Y)){if(ni.size>=Io){const ve=ni.values().next().value;ve!==void 0&&ni.delete(ve)}ni.add(Y)}}const mi=new Set;function cr(Y){if(!mi.has(Y)){if(mi.size>=Io){const ve=mi.values().next().value;ve!==void 0&&mi.delete(ve)}mi.add(Y)}}const Ni=new Map;function Us(Y){if(Ni.has(Y)&&Ni.delete(Y),Ni.size>=Io){const ve=Ni.keys().next().value;ve!==void 0&&Ni.delete(ve)}Ni.set(Y,Date.now())}const Vs=new Set,Ds=new Set;async function $o(Y,ve){const Be=new Set(Y);if(ve){for(const vt of Y)Ro(vt);const Ye=new Date().toISOString(),Xe=e.sessions.filter(vt=>Be.has(vt.id));Xe.length>0&&(e.doneSessions=[...Xe.map(vt=>({...vt,archived:!0,archivedAt:Ye})),...e.doneSessions.filter(vt=>!Be.has(vt.id))]);for(const vt of Y)m(vt),n9.delete(vt);if(e.activeSessionId!==void 0&&Be.has(e.activeSessionId)){const vt=e.sessions[0];vt?await Zi(vt.id,{urlMode:"replace",skipTrack:!0}):(v(void 0),Ti(void 0,"replace"))}return}for(const Ye of Y)ni.delete(Ye),cr(Ye),Us(Ye);const He=e.doneSessions.filter(Ye=>Be.has(Ye.id));e.doneSessions=e.doneSessions.filter(Ye=>!Be.has(Ye.id));for(const Ye of He)e.sessions.some(Xe=>Xe.id===Ye.id)||(ze.add(Ye.id),f({...Ye,archived:!1}))}async function zu(Y){try{const ve=Kt();Ds.delete(Y),Vs.add(Y);const Be=e.sessions.find(Xe=>Xe.id===Y),He=Be!==void 0?Z(Be):void 0,Ye=He!==void 0?Fe(He).length:0;await ve.archiveSession(Y),await $o([Y],!0),Be!==void 0&&He!==void 0&&dt(He,Y,Be.updatedAt,Ye),Vs.delete(Y),Ds.delete(Y)}catch(ve){Vs.delete(Y),Ds.delete(Y)||r("archiveSession",ve,{sessionId:Y})}}async function Ks(Y,ve){if(Ni.has(Y)){let Xe;try{Xe=(await Kt().getSession(Y)).archived}catch{return!1}if(!Xe)return!1}Vs.delete(Y)&&Ds.add(Y),mi.delete(Y),Ni.delete(Y),Ro(Y);const Be=e.sessions.find(Xe=>Xe.id===Y);if(Be===void 0&&e.activeSessionId!==Y)return!0;const He=ve??(Be!==void 0?Z(Be):void 0),Ye=He!==void 0?Fe(He).length:0;return await $o([Y],!0),Be!==void 0&&He!==void 0&&dt(He,Y,Be.updatedAt,Ye),!0}async function Ul(Y){if(re)return!1;const ve=Y??e.activeSessionId;if(!ve){const He=li("commands.export.noSession");return aa("export:failed",{status:"no-session"}),r("exportSession",new Error(He),{message:He}),!1}re=!0;const Be=Date.now();aa("export:start",{sessionId:ve});try{const He=Vze(),{blob:Ye,fileName:Xe}=await Kt().exportSession(ve,He,{desktop:Wh});if(typeof document>"u")throw new Error("Document is unavailable");const vt=URL.createObjectURL(Ye);let $t;try{$t=document.createElement("a"),$t.href=vt,$t.download=Xe,document.body.append($t),$t.click()}finally{$t?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(vt)}catch{}},0)}return aa("export:accepted",{sessionId:ve,status:"accepted",zipBytes:Ye.size,durationMs:Date.now()-Be}),!0}catch(He){const Ye=typeof He=="object"&&He!==null?He:void 0;return aa("export:failed",{sessionId:ve,status:"failed",durationMs:Date.now()-Be,errorName:typeof Ye?.name=="string"?Ye.name:typeof He,errorCode:typeof Ye?.code=="number"?Ye.code:void 0,requestId:typeof Ye?.requestId=="string"?Ye.requestId:void 0,phase:typeof Ye?.phase=="string"?Ye.phase:void 0,httpStatus:typeof Ye?.status=="number"?Ye.status:void 0}),r("exportSession",He,{sessionId:ve,...qi(He)&&He.code===s4e?{message:li("commands.export.tooLarge",{sessionId:ve})}:{}}),!1}finally{re=!1}}async function pf(Y){try{const ve=await Kt().restoreSession(Y);return f(ve),await $o([Y],!1),!0}catch(ve){return r("restoreSession",ve,{sessionId:Y}),!1}}function Vl(Y){return Kt().listSessions({archivedOnly:!0,beforeId:Y?.beforeId,pageSize:Y?.pageSize??50})}async function Ko(){try{await Kt().logout(),await Ae(),await Gt()}catch(Y){r("logout",Y)}}function Fs(Y){const ve=e.activeSessionId;ve&&Kt().compactSession(ve,Y).catch(Be=>{r("compact",Be,{sessionId:ve})})}async function Cl(Y){const ve=Y??e.activeSessionId;if(ve)try{const Be=await Kt().forkSession(ve);f(Be),await Zi(Be.id,{skipTrack:!0})}catch(Be){r("fork",Be,{sessionId:ve})}}async function Ya(Y=1){const ve=e.activeSessionId;if(!ve)return null;const Be=b(ve);try{await Kt().undoSession(ve,Y),delete e.turnErrorBySession[ve],delete e.turnRetryBySession[ve];const He=e.sessionLastTurnReasonSeqBySession[ve];return Kt().getSession(ve).then(Ye=>{e.sessionLastTurnReasonSeqBySession[ve]===He&&d(ve,Xe=>({...Xe,lastTurnReason:Ye.lastTurnReason}))}).catch(()=>{}),await _(ve).catch(()=>{}),{text:Be}}catch(He){return r("undo",He,{sessionId:ve}),null}}function Lr(Y){const ve=e.activeSessionId;if(!ve)return;const Be=e.queuedBySession[ve]??[];if(Y<0||Y>=Be.length)return;const He=[...Be];He.splice(Y,1),e.queuedBySession={...e.queuedBySession,[ve]:He}}function lo(Y,ve){const Be=e.activeSessionId;if(!Be)return;const He=e.queuedBySession[Be]??[];if(Y===ve||Y<0||Y>=He.length||ve<0||ve>=He.length)return;const Ye=[...He],[Xe]=Ye.splice(Y,1);Xe!==void 0&&(Ye.splice(ve,0,Xe),e.queuedBySession={...e.queuedBySession,[Be]:Ye})}async function Ja(Y){const ve=e.activeSessionId;if(!ve)return[];try{return(await Kt().listDirectory(ve,{path:Y,includeGitStatus:!0})).items}catch{return[]}}async function Zs(Y,ve){const Be=e.activeSessionId;if(!Be){let He=Y;if(!Al(Y)){const Ye=e.activeWorkspaceId,Xe=Ye&&H.value.some($t=>$t.id===Ye)?Ye:H.value[0]?.id??null,vt=Xe?P.value.find($t=>$t.id===Xe)?.root:void 0;if(!vt)return!0;He=`${vt.replace(/[\\/]+$/,"")}/${Y}`}try{return await yo(He),!0}catch(Ye){return!(qi(Ye)&&Ye.code===xB)}}try{if(Al(Y))return await yo(Y),!0;const He=Kt();return ve==="folder"?await He.listDirectory(Be,{path:Y}):await He.readFile(Be,{path:Y,length:1}),!0}catch(He){return!(qi(He)&&He.code===xB)}}async function yo(Y){return Kt().readHostFileContent(Y)}const Xo=10485760;function Yr(Y){const ve=e.activeSessionId;return ve?Kt().getFileDownloadUrl(ve,Y):null}async function Kl(Y,ve){const Be=e.activeSessionId;if(!Be)return!1;try{return await Kt().openFile(Be,{path:Y,line:ve}),!0}catch(He){return r("openFile",He,{sessionId:Be}),!1}}async function Zl(Y){const ve=e.activeSessionId;if(!ve)return;const Be=j.value.cwd||".";try{await Kt().openInApp(ve,Y,Be)}catch(He){r("openInApp",He,{sessionId:ve})}}async function Nr(Y){const ve=e.activeSessionId;if(!ve)return!1;try{return await Kt().revealFile(ve,{path:Y}),!0}catch(Be){return r("revealFile",Be,{sessionId:ve}),!1}}function Al(Y){return Y.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(Y)||Y.startsWith("\\\\")}async function Xa(Y){if(/^(https?:|data:|blob:)/i.test(Y))return Y;const ve=e.activeSessionId;if(!ve)return Y;let Be=Y;if(Al(Be)){const He=e.sessions.find(Xe=>Xe.id===ve)?.cwd,Ye=He?Ak(Be,He):null;if(Ye)Be=Ye;else try{const Xe=await yo(Be);return!Xe.isBinary||Xe.encoding!=="base64"?Y:`data:${Xe.mime};base64,${Xe.content}`}catch{return Y}}try{const Ye=await Kt().readFile(ve,{path:Be,length:Xo});return!Ye.isBinary||Ye.encoding!=="base64"||Ye.truncated?Y:`data:${Ye.mime};base64,${Ye.content}`}catch{return Y}}let Gl=!1;async function ju(Y){const ve=e.sessions.find(He=>He.id===e.activeSessionId),Be=ve===void 0?e.activeWorkspaceId:Z(ve);if(!Be)return[];try{const He=Kt();if(!Gl)try{return(await He.suggestFiles(Be,{query:Y,limit:20})).items.map(vt=>({path:vt.path,name:vt.name,kind:vt.kind,matchPositions:vt.matchPositions}))}catch(Xe){if(!qi(Xe)||Xe.code!==404)throw Xe;Gl=!0}return(await He.searchFiles(Be,{query:Y,limit:20})).items.map(Xe=>({path:Xe.path,name:Xe.name,kind:Xe.kind,matchPositions:Xe.matchPositions}))}catch{return[]}}return{checkAuth:Ae,probeManagedMembership:ye,loadConfig:pe,updateConfig:ne,listAllSessionsGlobal:qe,load:Gt,refreshServerMeta:dn,loadWorkspaces:ri,loadMoreSessions:Te,loadAllSessions:wt,ensureFlatSessions:Lt,loadMoreFlatSessions:Qt,ensureDoneSessions:en,loadMoreDoneSessions:it,selectWorkspace:ji,openWorkspace:xi,upsertWorkspacePreserveOrder:Uo,applyWorkspaceEvent:ot,clearActiveSession:Ue,openWorkspaceDraft:st,startSessionAndSendPrompt:bt,startSessionAndActivateSkill:Zn,startSessionAndOpenSideChat:vs,getDraftPromotion:nje,addWorkspaceByPath:go,browseFs:Ls,getFsHome:Hs,writeSessionUrl:Ti,openSessionAdmin:Tr,closeSessionAdmin:vo,fetchSessionIntoList:no,onSessionRoutePopState:Er,bindSessionRoute:Qn,selectSession:Zi,submitPromptInternal:yi,finishPromptLocal:Jo,maybeGenerateSessionTitle:wje,localTurnStartState:vK,isLocalTurnSnapshotCurrent:xje,afterLocalTurnStartsSettle:Sje,sendPrompt:Hi,steerPrompt:di,steerQueued:oo,resumeQueueIfIdle:ki,uploadImage:Mn,enqueue:Ns,unqueue:Lr,reorderQueue:lo,abortCurrentPrompt:ks,respondApproval:ro,respondQuestion:eo,dismissQuestion:to,pendingQuestionActions:Df,pendingApprovalActions:py,cancelTask:Gi,detachTask:Pe,refreshSessionWarnings:ke,markSessionWarningShown:we,setPlanMode:rn,togglePlanMode:Yn,setSwarmMode:ei,toggleSwarmMode:Qi,setGoalMode:Vn,toggleGoalMode:qs,createGoal:bs,controlGoal:Je,setPermission:Ve,dismissWarning:St,renameSession:Rt,regenerateSessionTitle:Fn,renameWorkspace:fi,deleteWorkspace:Mo,archiveSession:zu,applySessionsArchivedLocally:$o,applyRemoteSessionArchived:Ks,exportSession:Ul,restoreSession:pf,loadArchivedSessions:Vl,logout:Ko,compact:Fs,forkSession:Cl,undo:Ya,listDir:Ja,readHostFileContent:yo,probeWorkspacePath:Zs,getFileDownloadUrl:Yr,openWorkspaceFile:Kl,openInApp:Zl,revealWorkspaceFile:Nr,resolveImageUrl:Xa,searchFiles:ju,refreshSessionSidecars:be,isStartingFirstPrompt:()=>au.size>0}}const Mje=20,Ije=300,Tje=1e4,MB=5e3;function yK(e){const[t,n,i]=e.split("-").map(Number);return new Date(t??0,(n??1)-1,i??1,0,0,0,0).getTime()}function kK(e){const[t,n,i]=e.split("-").map(Number);return new Date(t??0,(n??1)-1,i??1,23,59,59,999).getTime()}function Eje(e,t,n){return{workspaceIds:e.workspaceIds.length>0?[...e.workspaceIds]:void 0,archived:e.status==="all"?"all":e.status==="done",updatedAfter:e.updatedFrom!==""?yK(e.updatedFrom):void 0,updatedBefore:e.updatedTo!==""?kK(e.updatedTo):void 0,sort:"meta.updated_at_desc",page:t,pageSize:n}}function Lje(e){return{workspaceIds:e.workspaceIds.length>0?[...e.workspaceIds]:void 0,archived:e.status==="all"?"all":e.status==="done",updatedAfter:e.updatedFrom!==""?yK(e.updatedFrom):void 0,updatedBefore:e.updatedTo!==""?kK(e.updatedTo):void 0,sort:"meta.updated_at_desc"}}function my(e){return JSON.stringify([[...e.workspaceIds].toSorted(),e.status,e.updatedFrom,e.updatedTo])}function Nje(e){const t=po({filters:{workspaceIds:[],status:"all",updatedFrom:"",updatedTo:""},page:1,pageSize:Mje,items:[],total:0,loading:!1,seeded:!1,selectedIds:new Set,selectedArchivedById:new Map,allMatching:!1,materializingAll:!1});let n=0,i=null;async function o(){i!==null&&(clearTimeout(i),i=null);const I=++n;t.loading=!0;try{const S=await Kt().listSessionsV2(Eje(t.filters,t.page,t.pageSize));if(I!==n)return;t.items=S.items,t.total=S.total;for(const x of S.items)t.selectedArchivedById.has(x.id)&&t.selectedArchivedById.set(x.id,x.meta.archived);const _=Math.max(1,Math.ceil(S.total/t.pageSize));t.page>_&&(t.page=_,o())}catch(S){if(I!==n)return;e.pushOperationFailure("sessionAdmin",S)}finally{I===n&&(t.loading=!1)}}function s(){i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,o()},Ije)}function r(){t.seeded||(t.seeded=!0,o())}async function l(){await o()}function a(I){t.allMatching&&my(I)!==my(t.filters)&&y(),t.filters.workspaceIds=[...I.workspaceIds],t.filters.status=I.status,t.filters.updatedFrom=I.updatedFrom,t.filters.updatedTo=I.updatedTo,t.page=1,t.seeded=!0,o()}function u(I){t.allMatching&&y(),t.filters.workspaceIds=[...I],t.page=1,s()}function c(I){t.allMatching&&y(),t.filters.status=I,t.page=1,s()}function d(I,S){t.allMatching&&y(),t.filters.updatedFrom=I,t.filters.updatedTo=S,t.page=1,s()}function f(I){I!==t.page&&(t.page=I,s())}function h(I){I!==t.pageSize&&(t.pageSize=I,t.page=1,s())}function m(I,S){if(t.selectedIds.has(I)){t.selectedIds.delete(I),t.selectedArchivedById.delete(I),t.selectedIds.size===0&&(t.allMatching=!1);return}t.selectedIds.add(I),t.selectedArchivedById.set(I,S)}function g(I){const S=I.length>0&&I.every(_=>t.selectedIds.has(_.id));for(const _ of I)S?(t.selectedIds.delete(_.id),t.selectedArchivedById.delete(_.id)):(t.selectedIds.add(_.id),t.selectedArchivedById.set(_.id,_.archived));t.selectedIds.size===0&&(t.allMatching=!1)}function v(I){t.selectedIds=new Set(I.map(S=>S.id)),t.selectedArchivedById=new Map(I.map(S=>[S.id,S.archived])),t.allMatching=!1}function y(){t.selectedIds=new Set,t.selectedArchivedById=new Map,t.allMatching=!1}async function b(){if(t.allMatching||t.materializingAll)return;t.materializingAll=!0;const I=Lje(t.filters),S=my(t.filters);try{const _=[];let x;for(;;){const E=await Kt().listSessionIdsV2({...I,pageSize:Tje,pageToken:x});if(_.push(...E.items),!E.hasMore||E.nextPageToken===null)break;x=E.nextPageToken}if(my(t.filters)!==S)return;for(const E of _)t.selectedIds.add(E.id),t.selectedArchivedById.set(E.id,E.archived);t.allMatching=!0}catch(_){e.pushOperationFailure("sessionAdmin",_)}finally{t.materializingAll=!1}}function w(I){const S=[];for(const[_,x]of t.selectedArchivedById)x===I&&S.push(_);return S}async function C(I,S,_){const x=[];let E=0,M=0;for(let R=0;RB.ok).map(B=>B.id);x.push(...O),E+=z.succeeded,M+=z.failed}catch(z){M+=I.length-R,e.pushOperationFailure(S?"archiveSessions":"restoreSessions",z);break}}if(x.length>0){await e.applySessionsArchivedLocally(x,S);for(const R of x)t.selectedIds.delete(R),t.selectedArchivedById.delete(R);t.selectedIds.size===0&&(t.allMatching=!1),await l()}return{okIds:x,succeeded:E,failed:M}}async function T(I){return C(I,!0,S=>Kt().archiveSessions(S))}async function N(I){return C(I,!1,S=>Kt().restoreSessions(S))}return{state:t,ensureSeeded:r,refresh:l,applyFilters:a,setWorkspaceIds:u,setStatus:c,setTimeRange:d,setPage:f,setPageSize:h,toggleSelection:m,togglePageSelection:g,setSelection:v,clearSelection:y,selectAllMatching:b,selectedIdsByArchived:w,archiveSessions:T,restoreSessions:N}}function Dje(e){if(e.startsWith("kimi-complete-"))return"turn_complete";if(e.startsWith("kimi-question-"))return"question";if(e.startsWith("kimi-approval-"))return"approval"}function IB(e,t){const n=ms(e);return n===null?t:n==="1"}const Fje="/favicon.ico",Bje=Fv("kimi.notifications",()=>{const e=V(IB(Cn.notifyEnabled,!0)),t=V(IB(Cn.notifySound,!0)),n=V(typeof Notification<"u"?Notification.permission:"denied");async function i(c){if(!c){e.value=!1,fs(Cn.notifyEnabled,"0");return}if(typeof Notification>"u")return;let d=Notification.permission;if(d==="default")try{d=await Notification.requestPermission()}catch{}n.value=d,d==="granted"&&(e.value=!0,fs(Cn.notifyEnabled,"1"))}function o(c){t.value=c,fs(Cn.notifySound,c?"1":"0")}function s(c,d,f){if(!e.value||typeof Notification>"u")return;const h=Notification.permission;if(h!=="denied"){if(h==="default"){Notification.requestPermission().then(m=>{n.value=m,m==="granted"&&r(c,d,f)});return}r(c,d,f)}}function r(c,d,f){if(!c.isUserWatching)try{const h=new Notification(d.title,{body:d.body,tag:f,icon:Fje,silent:!t.value}),m=Dje(f);m!==void 0&&void 0,h.onclick=()=>{try{window.kimiDesktop?.showWindow?.(),window.focus()}catch{}m!==void 0&&void 0,c.onClick(),h.close()}}catch{}}function l(c,d){s(d,LPe(li,d.sessionTitle),`kimi-complete-${c}-${d.promptId??Date.now()}`)}function a(c){s(c,NPe(li,c.sessionTitle,c.questionPreview),`kimi-question-${c.questionId}`)}function u(c){s(c,DPe(li,c.sessionTitle,c.toolName),`kimi-approval-${c.approvalId}`)}return{notifyEnabled:e,notifySound:t,notifyPermission:n,setNotifyEnabled:i,setNotifySound:o,maybeNotifyCompletion:l,maybeNotifyQuestion:a,maybeNotifyApproval:u}});function pd(){return Bje(sm)}const gy=X1(),bK=Cn.permission,wK=Cn.activeWorkspace,CK=Cn.planArmed,AK=Cn.swarmMode,xK=Cn.goalMode,O4=Cn.onboarded;Sr(Cn.codeFont);Sr(Cn.accent);Sr(Cn.theme);Sr(Cn.thinking);Sr(Cn.notifyOnComplete);Sr(Cn.notifyOnQuestion);Sr(Cn.notifyOnApproval);Sr(Cn.soundOnComplete);function Rje(){try{const e=ms(bK);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function $je(e){try{fs(bK,e)}catch{}}function vy(e){const t=ms(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const i={};for(const[o,s]of Object.entries(n))s===!0&&(i[o]=!0);return i}catch{return{}}}function Gx(e,t){try{const n={};for(const[i,o]of Object.entries(t))o&&(n[i]=!0);fs(e,JSON.stringify(n))}catch{}}function Qx(){Gx(CK,Se.planArmedBySession)}function SK(){Gx(AK,Se.swarmModeBySession)}function _K(){Gx(xK,Se.goalModeBySession)}function Oje(){try{return ms(wK)}catch{return null}}const MK=Cn.hiddenWorkspaces;function Pje(){try{const e=ms(MK);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function zje(e){try{fs(MK,JSON.stringify(e))}catch{}}function jje(e){try{fs(wK,e)}catch{}}function Hje(e,t){if(t&&e.startsWith(t)){const i=e.slice(t.length);return i?`~${i}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Se=po({...Bwe(),get sessions(){return wr().sessions},set sessions(e){wr().setSessions(e)},get activeSessionId(){return wr().activeSessionId},set activeSessionId(e){wr().setActiveSessionId(e)},get approvalsBySession(){return or().approvalsBySession},get questionsBySession(){return or().questionsBySession},get gitStatusBySession(){return tr().gitStatusBySession},connected:!1,serverVersion:"",webTitle:"",dangerousBypassAuth:!1,backend:"v1",experimentalFlags:{},workspaceName:"kimi-code",connection:"disconnected",permission:Rje(),thinking:void 0,draftThinkingExplicit:!1,thinkingBySession:{},pendingThinkingBySession:{},planModeBySession:vy(Cn.planMode),planArmedBySession:vy(CK),pendingPlanBySession:{},swarmModeBySession:vy(AK),pendingSwarmBySession:{},goalModeBySession:vy(xK),loading:!1,sessionLoading:!1,queuedBySession:{},promptIdBySession:{},abortPromptIdBySession:{},inFlightBySession:{},optimisticMessagesBySession:{},sessionLastTurnReasonSeqBySession:{},unreadBySession:R6(),authReady:!1,defaultModel:null,managedProviderStatus:null,managedUserInfo:null,managedMembership:null,workspaces:[],activeWorkspaceId:Oje(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Pje(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatUserMessageIdsBySession:{},sideChatSendingByAgent:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1,flatSessionsNextPageToken:null,flatSessionsHasMore:!0,flatSessionsLoading:!1,flatSessionsLoadingMore:!1,flatSessionsSeeded:!1,flatSessionsFrontier:null,doneSessions:[],doneSessionsNextPageToken:null,doneSessionsHasMore:!0,doneSessionsLoading:!1,doneSessionsLoadingMore:!1,doneSessionsSeeded:!1,draftEntry:"newChat",mainView:"chat"}),yc=po({}),Yx=po({}),a0=new Map,Cg=new Map;function Wje(e,t){return`${e}\0${t??"*"}`}function P4(e,t,n){Yx[t]=n;const i=yc[e]?.[t];i&&(yc[e]={...yc[e],[t]:{...i,review:n}})}async function P1(e,t){if(t!==void 0){P1(e);return}const n=Wje(e,t),i=(a0.get(n)??0)+1;a0.set(n,i),t!==void 0&&Cg.set(e,(Cg.get(e)??0)+1);const o=Cg.get(e)??0;try{const s=await Kt().getSessionPlans(e,{agentId:"main",toolCallId:t});if(a0.get(n)!==i||t===void 0&&(Cg.get(e)??0)!==o||!Se.sessions.some(l=>l.id===e))return;const r=Object.fromEntries(s.map(l=>[l.toolCallId,l]));for(const[l,a]of Object.entries(r)){const u=Yx[l];u&&(!a.review||a.review.state==="pending")&&(r[l]={...a,review:u})}yc[e]=t===void 0?r:{...yc[e],...r}}catch(s){ja("[refreshSessionPlans] plan history unavailable for",e,s)}}function qje(e){const t=`${e}\0`;for(const n of a0.keys())n.startsWith(t)&&a0.delete(n);Cg.delete(e),delete yc[e]}function Uje(e){delete yc[e]}const Rv=po({planMode:!1,swarmMode:!1,goalMode:!1});function Jx(e){Se.sessions=e}function $v(e,t){Se.sessions=Se.sessions.map(n=>n.id===e?t(n):n)}function Vje(e){Se.sessions=dP(Se.sessions,e)}function Kje(e){Se.sessions=[...Se.sessions,e]}function Zje(e){Se.sessions=Se.sessions.filter(t=>t.id!==e)}function IK(){const e=Se.activeSessionId;e&&Se.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Se.unreadBySession[e]=!1,$6({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Cn.unread&&(Se.unreadBySession=R6(),IK())});function OA(){zr!==null&&zr.health().stale&&(aa("ws:stale-reconnect",{sessionId:Se.activeSessionId,status:"stale"}),Uze("ws: stale socket on focus, reconnecting",{activeSessionId:Se.activeSessionId}),zr.reconnect()),jo.recoverIfStale()}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(IK(),OA())});typeof window<"u"&&(window.addEventListener("focus",OA),window.addEventListener("online",OA));function TK(e){tje(e),Se.activeSessionId=e}const m1=new Map,z4=new Map,i9=new Map;function Xx(e){zr?.unsubscribe(e),gu.forgetSession(e),jo.forgetSession(e),_i.clearSideChatForSession(e),HA.delete(e),qK(e),u0.discard(({meta:t})=>t.sessionId===e),Zje(e),qje(e),or().clearSessionApprovals(e),or().clearSessionQuestions(e),delete Se.tasksBySession[e],delete Se.goalBySession[e],tr().clearSessionGitStatus(e),delete Se.lastSeqBySession[e],delete Se.compactionBySession[e],delete Se.optimisticMessagesBySession[e],Ag.delete(e),iv.delete(e),o9.delete(e),m1.delete(e),z4.delete(e),i9.delete(e),J0.delete(e);{const t=rd.get(e);t?.timer!=null&&clearTimeout(t.timer),rd.delete(e)}X0.delete(e),ev.delete(e);for(const t of[...j4.keys()])t.startsWith(`${e}:`)&&j4.delete(t);delete Se.sessionLastTurnReasonSeqBySession[e],eS.delete(e),Aje(e),delete Se.queuedBySession[e],delete Se.promptIdBySession[e],delete Se.abortPromptIdBySession[e],delete Se.inFlightBySession[e],delete Se.turnActiveBySession[e],delete Se.turnErrorBySession[e],delete Se.turnRetryBySession[e],delete Se.planModeBySession[e],delete Se.planArmedBySession[e],delete Se.pendingPlanBySession[e],delete Se.swarmModeBySession[e],delete Se.pendingSwarmBySession[e],delete Se.goalModeBySession[e],delete Se.thinkingBySession[e],delete Se.pendingThinkingBySession[e],Qx(),SK(),_K(),wr().unpinSession(e)}function EK(e){const t=Se.activeSessionId===e;Xx(e),Y0(e),t&&(zt.clearActiveSession(),Se.sessionLoading=!1)}const LK=V(!1),NK=V(null);async function fc(e,t){const n=J0.get(e)??0;let i;try{i=await Kt().getSessionStatus(e)}catch{return!1}if((J0.get(e)??0)!==n)return!1;if($v(e,o=>({...o,model:i.model||o.model,usage:{...o.usage,contextTokens:i.contextTokens,contextLimit:i.maxContextTokens}})),t?.throughShield!==void 0){const o=t.throughShield.swarm===!0&&(t.throughTokens?.swarm===void 0||Se.pendingSwarmBySession[e]===t.throughTokens.swarm),s=t.throughShield.plan===!0&&(t.throughTokens?.plan===void 0||Se.pendingPlanBySession[e]===t.throughTokens.plan);o?Se.swarmModeBySession={...Se.swarmModeBySession,[e]:i.swarmMode}:t.throughShield.swarm!==!0&&Gw(Se,e,i.swarmMode),s?Se.planModeBySession={...Se.planModeBySession,[e]:i.planMode}:t.throughShield.plan!==!0&&Iw(Se,e,i.planMode)}else Gw(Se,e,i.swarmMode),Iw(Se,e,i.planMode);return Sr(Cn.planMode),i.thinkingEffort.length>0&&T6(Se,e,i.thinkingEffort),!0}const kc=new Set,xh=new Set,g1=new Map;function DK(e,t){xh.add(e),g1.set(e,t),t==="active"&&kc.add(e),ab(e).finally(()=>{xh.delete(e),kc.delete(e);const n=g1.get(e);g1.delete(e),n!==void 0&&n!==t&&Se.goalBySession[e]===void 0&&DK(e,n)})}function Gje(e){xh.has(e)||(xh.add(e),kc.add(e),ab(e).finally(()=>{xh.delete(e),kc.delete(e)}))}async function ab(e){const t=Se.goalVersionBySession[e]??0;let n;try{n=await Kt().getSessionGoal(e)}catch{return}(Se.goalVersionBySession[e]??0)===t&&(n===null||n.status==="complete"?delete Se.goalBySession[e]:Se.goalBySession[e]=n)}const rd=new Map;function FK(e,t,n){const i=rd.get(e),o={thinking:t.thinking??i?.tokens.thinking,swarm:t.swarm??i?.tokens.swarm,plan:t.plan??i?.tokens.plan},s={swarm:t.swarm!==void 0||i?.fields.swarm===!0,plan:t.plan!==void 0||i?.fields.plan===!0};i?.timer!=null&&clearTimeout(i.timer);const r={attempt:n,timer:null,tokens:o,fields:s};rd.set(e,r),r.timer=setTimeout(()=>{r.timer=null,fc(e,{throughShield:r.fields,throughTokens:r.tokens}).then(l=>{if(l){rd.get(e)===r&&rd.delete(e),Tu(Se,e,r.tokens.thinking),Zw(Se,e,r.tokens.swarm),Mw(Se,e,r.tokens.plan);return}if(rd.get(e)===r){if(!Se.sessions.some(a=>a.id===e)){rd.delete(e);return}FK(e,t,n+1)}})},Math.min(n*2e3,15e3))}function BK(e,t){const n=t??Se.activeSessionId;if(!n)return Promise.resolve(!1);const i=e.thinking!==void 0?Se.pendingThinkingBySession[n]:void 0,o=e.swarmMode!==void 0?Se.pendingSwarmBySession[n]:void 0,s=e.planMode!==void 0?Se.pendingPlanBySession[n]:void 0;return Promise.resolve(Kt().updateSession(n,e)).then(()=>fc(n,{throughShield:{swarm:e.swarmMode!==void 0,plan:e.planMode!==void 0},throughTokens:{swarm:o,plan:s}})).then(r=>r?(Tu(Se,n,i),Zw(Se,n,o),Mw(Se,n,s),!0):(FK(n,{thinking:i,swarm:o,plan:s},1),!0)).catch(r=>(Tu(Se,n,i)&&fc(n),Zw(Se,n,o)&&fc(n),Mw(Se,n,s)&&fc(n),rm("persistSessionProfile",r,{sessionId:n}),!1))}function RK(e){try{return ms(e)??""}catch{return""}}function Qje(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("kimi_onboarded")==="1"}const $K=Qje();if($K&&RK(O4)!=="1")try{fs(O4,"1")}catch{}const OK=V($K||RK(O4)==="1");function Yje(e){OK.value=e;try{fs(O4,e?"1":"0")}catch{}e&&window.kimiDesktop?.setOnboarded?.()}let zr=null;const gu=ZPe({api:Kt(),connectEventsIfNeeded:ub,getEventConnection:()=>zr}),jo=YPe({api:Kt(),getSharedConnection:()=>zr,ensureSharedConnection:ub,onSessionGone:e=>EK(e),getLocalTurnState:e=>zt.localTurnStartState(e),hasPendingLocalWork:e=>Se.inFlightBySession[e]===!0||(Se.queuedBySession[e]??[]).length>0||(Se.optimisticMessagesBySession[e]??[]).length>0,onBaselineError:(e,t)=>rm("loadSessionTranscript",t,{sessionId:e})});function ka(){const e=Se.activeSessionId;if(!e)return null;const t=jo.pool.getEntry(e);return t?.version.value,t!==void 0&&t.baselineLoaded?t:null}function PK(e){const t=jo.pool.getEntry(e)?.channel.snapshot.items.findLast(n=>n.kind==="turn");return t?.kind==="turn"?t.turnId:void 0}function zK(e){const t=jo.pool.getEntry(e)?.channel.snapshot.prompts;if(t===void 0||t.length===0)return;let n;for(const i of t)(n===void 0||i.createdAt>n)&&(n=i.createdAt);return n}let TB=0;function jK(){return TB+=1,`msg_opt_${Date.now().toString(36)}_${TB}`}function EB(e,t,n){const i={sessions:Se.sessions,activeSessionId:Se.activeSessionId,approvalsBySession:Se.approvalsBySession,planReviewByToolCallId:Se.planReviewByToolCallId,questionsBySession:Se.questionsBySession,tasksBySession:Se.tasksBySession,goalBySession:Se.goalBySession,goalVersionBySession:Se.goalVersionBySession,lastSeqBySession:Se.lastSeqBySession,turnActiveBySession:Se.turnActiveBySession,turnErrorBySession:Se.turnErrorBySession,turnRetryBySession:Se.turnRetryBySession,compactionBySession:Se.compactionBySession,config:Se.config,warnings:Se.warnings},o=Pwe(i,e,{sessionId:t,seq:n},{t:(s,r)=>r===void 0?li(s):li(s,r)});o.sessions!==i.sessions&&Jx(o.sessions),o.activeSessionId!==i.activeSessionId&&TK(o.activeSessionId),or().applyApprovalsDiff(o.approvalsBySession),Il(Se.planReviewByToolCallId,o.planReviewByToolCallId),or().applyQuestionsDiff(o.questionsBySession),Il(Se.tasksBySession,o.tasksBySession),Il(Se.goalBySession,o.goalBySession),Il(Se.goalVersionBySession,o.goalVersionBySession),Il(Se.lastSeqBySession,o.lastSeqBySession),Il(Se.turnActiveBySession,o.turnActiveBySession),Il(Se.turnErrorBySession,o.turnErrorBySession),Il(Se.turnRetryBySession,o.turnRetryBySession),Il(Se.compactionBySession,o.compactionBySession),o.config!==i.config&&(Se.config=o.config??null),zwe(o.warnings,i.warnings)||(Se.warnings=o.warnings),e.type==="goalUpdated"&&kc.delete(t),e.type==="configChanged"&&(Se.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(hi.loadModels(),hi.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&Gw(Se,e.sessionId,e.swarmMode),e.planMode!==void 0&&Iw(Se,e.sessionId,e.planMode),e.thinking!==void 0&&T6(Se,e.sessionId,e.thinking)),e.type==="sessionUpdated"&&"archived"in e.session&&m1.set(e.session.id,n),e.type==="sessionArchived"&&m1.set(e.sessionId,n),e.type==="sessionMetaUpdated"&&"title"in e&&z4.set(e.sessionId,n),(e.type==="sessionWorkChanged"||e.type==="turnActiveChanged")&&"lastTurnReason"in e&&(Se.sessionLastTurnReasonSeqBySession[e.sessionId]=n),e.type==="sessionDeleted"&&(Xx(e.sessionId),Y0(e.sessionId)),e.type==="sessionUpdated"&&e.session.archived===!0&&Y0(e.session.id)}function Jje(e,t){const n=Se.lastSeqBySession[t.sessionId]??0,i=Se.turnActiveBySession[t.sessionId]??!1,o=e.type==="approvalResolved"||e.type==="approvalExpired"?Se.approvalsBySession[t.sessionId]?.find(a=>a.approvalId===e.approvalId&&a.toolName==="ExitPlanMode")?.toolCallId:void 0,s=_i.sideChatTargetBySession.value[t.sessionId]??[],r=e.type==="messageCreated"&&e.message.role==="user"&&e.agentId!==void 0&&Object.prototype.hasOwnProperty.call(Se.sideChatMessagesByAgent,e.agentId),l=e.type==="messageCreated"&&e.message.role==="user"&&e.agentId!==void 0&&_i.isClosedSideChatAgent(t.sessionId,e.agentId);if(r||l){EB({type:"unknown",raw:{_noop:!0}},t.sessionId,t.seq),r&&e.type==="messageCreated"&&_i.reconcileSideChatUserMessage(e.agentId,e.message);return}EB(e,t.sessionId,t.seq);for(const{agentId:a}of s){const u=t.sessionId;e.type==="agentDelta"&&e.agentId===a?e.delta.text&&_i.appendSideChatAssistantText(a,u,e.delta.text):e.type==="taskProgress"&&e.taskId===a&&_i.appendSideChatAssistantText(a,u,e.outputChunk)}if(e.type==="agentTurnEnded"&&_i.wasSideChatAgent(e.agentId)?_i.finishSideChatAgent(e.agentId,t.sessionId):e.type==="taskCompleted"&&_i.wasSideChatAgent(e.taskId)&&_i.finishSideChatAgent(e.taskId,t.sessionId,e.outputPreview,!0),e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&i||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&WWe(e.sessionId),t.seq>n&&(e.type==="turnActiveChanged"||e.type==="approvalRequested"||e.type==="questionRequested"||e.type==="promptCompleted"&&e.reason==="blocked"||e.type==="promptAborted"||e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1||!e.busy)&&i)&&Hf(t.sessionId),o!==void 0){const a=e.type==="approvalResolved"?{state:e.decision,selectedOption:e.selectedLabel,feedback:e.feedback}:{state:"cancelled"};P4(t.sessionId,o,a),P1(t.sessionId,o)}}const u0=UCe(({appEvent:e,meta:t})=>Jje(e,t),({appEvent:e})=>jCe(e),{coalesce:KCe}),Xje=3e4;let LB=0,vr=null;const J0=new Map;function eHe(e){J0.set(e,(J0.get(e)??0)+1)}const Vp=new Map,X0=new Map,ev=new Map,j4=new Map;let H4=0,v1=null;function tHe(){v1!==null&&(clearTimeout(v1),v1=null)}function NB(e){if(!Se.connected||v1!==null)return;const t=Math.min(Xje,1e3*2**H4);H4+=1,ja("[kimi-code] session work reconciliation incomplete; retrying",e),v1=setTimeout(()=>{v1=null,Se.connected&&PA()},t)}function nHe(e,t){const n=new Map(e.map(u=>[u.id,u]));let i=!1,o=!1;const s={...Se.turnActiveBySession},r=[],l=new Map,a=Se.sessions.map(u=>{const c=n.get(u.id);if(c===void 0)return u;const d=t.workEventSeqBySession.get(u.id)??0,f=t.turnEventSeqBySession.get(u.id)??0,h=t.pendingEventBySession.get(u.id),m=d>c.lastSeq,g=f>c.lastSeq,v=h!==void 0&&h.seq>c.lastSeq,y=m||g&&u.mainTurnActive===!0?u.busy||u.mainTurnActive===!0:c.busy,b=m||g?u.mainTurnActive:c.mainTurnActive??(y?u.mainTurnActive:!1),w=v?h.source==="work"?u.pendingInteraction:(Se.approvalsBySession[u.id]?.length??0)>0?"approval":(Se.questionsBySession[u.id]?.length??0)>0?"question":"none":c.pendingInteraction??(y?u.pendingInteraction:"none");(v&&h.source==="work"||!v&&(c.pendingInteraction!==void 0||c.busy===!1))&&w!==void 0&&l.set(u.id,w);const C=m?u.lastTurnReason:c.lastTurnReason;tS(u.id,c.lastSeq);const T=t.turnStartBySession.get(u.id);return(b===!1||b===void 0&&!y)&&t.witnessedTurnBySession.has(u.id)&&T!==void 0&&zt.isLocalTurnSnapshotCurrent(u.id,T)&&r.push(u.id),b===!0&&!s[u.id]?(s[u.id]=!0,o=!0):(b===!1||!y)&&s[u.id]&&(delete s[u.id],o=!0),u.busy===y&&u.mainTurnActive===b&&u.pendingInteraction===w&&u.lastTurnReason===C?u:(i=!0,{...u,busy:y,mainTurnActive:b,pendingInteraction:w,lastTurnReason:C})});i&&Jx(a),o&&Il(Se.turnActiveBySession,s);for(const[u,c]of l)c==="none"?(or().clearSessionApprovals(u),or().clearSessionQuestions(u)):c==="question"&&or().clearSessionApprovals(u);for(const u of r){const c=jo.pool.getEntry(u);if(c!==void 0)jo.pool.refreshSession(u).catch(()=>{setTimeout(()=>{jo.pool.getEntry(u)===c&&jo.pool.refreshSession(u).catch(()=>{})},2e3)});else{const d=Se.sessions.find(f=>f.id===u)?.lastTurnReason;UA(u,d==="cancelled"||d==="failed"?"aborted":"idle",!0)}}}async function PA(){const e={workEventSeqBySession:new Map,turnEventSeqBySession:new Map,pendingEventBySession:new Map,turnStartBySession:new Map(Se.sessions.map(t=>[t.id,zt.localTurnStartState(t.id)])),witnessedTurnBySession:new Set(Se.sessions.filter(t=>Se.inFlightBySession[t.id]||Se.turnActiveBySession[t.id]).map(t=>t.id))};vr=e;try{const t=await zt.listAllSessionsGlobal({shouldContinue:()=>vr===e&&Se.connected});if(vr!==e||!Se.connected)return;u0.flush(),nHe(t.sessions,e),vr=null,t.error!==void 0?NB(t.error):H4=0}catch(t){if(vr!==e||!Se.connected)return;vr=null,NB(t)}}function ub(){if(zr!==null||typeof WebSocket>"u")return;aa("ws:connection",{status:"connecting"}),Se.connection="connecting",zr=Kt().connectEvents({onEvent(t,n){const i=tv.get(n.sessionId);if(i!==void 0&&n.seq>=i.throughSeq&&tv.delete(n.sessionId),t.type==="sessionArchived"){zt.applyRemoteSessionArchived(t.sessionId,t.workspaceId).then(l=>{l&&Y0(t.sessionId)});return}if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){if(t.type==="workspaceDeleted"){const l=Se.sessions.filter(a=>a.workspaceId===t.workspaceId||a.cwd===t.root).map(a=>a.id);Kze(t.workspaceId,t.root,l)}zt.applyWorkspaceEvent(t);return}if((t.type==="pluginsChanged"||t.type==="capabilityChanged")&&Gze(t))return;const o=t.type==="sessionWorkChanged",s=t.type==="turnActiveChanged",r=t.type==="approvalRequested"||t.type==="approvalResolved"||t.type==="approvalExpired"||t.type==="questionRequested"||t.type==="questionAnswered"||t.type==="questionDismissed";if((o||s||r)&&n.seq>0){const l=Vp.get(n.sessionId)??0;if(n.seq<=l)return;Vp.set(n.sessionId,n.seq)}if(vr!==null&&(o||s||r))if(o){const l=vr.workEventSeqBySession.get(n.sessionId)??0;if(n.seq>l&&vr.workEventSeqBySession.set(n.sessionId,n.seq),t.pendingInteraction!==void 0||!t.busy){const a=vr.pendingEventBySession.get(n.sessionId);(a===void 0||n.seq>a.seq)&&vr.pendingEventBySession.set(n.sessionId,{seq:n.seq,source:"work"})}}else if(s){const l=vr.turnEventSeqBySession.get(n.sessionId)??0;n.seq>l&&vr.turnEventSeqBySession.set(n.sessionId,n.seq)}else{const l=vr.pendingEventBySession.get(n.sessionId);(l===void 0||n.seq>l.seq)&&vr.pendingEventBySession.set(n.sessionId,{seq:n.seq,source:"interaction"})}for(const l of VCe({appEvent:t,meta:n}))u0(l)},onResync(t,n,i){const o=(i9.get(t)??0)+1;i9.set(t,o),aa("ws:resync",{sessionId:t,status:"required",seq:n}),u0.flush(),Se.lastSeqBySession[t]=n,Vp.delete(t),_i.resyncSideChat(t),(async()=>{const s=Se.sessions.find(u=>u.id===t),r=m1.get(t),l=z4.get(t),a=Se.sessionLastTurnReasonSeqBySession[t];try{const u=await Kt().getSession(t);if(i9.get(t)!==o)return;const c=Se.sessions.find(d=>d.id===t);if(u.archived===!0&&c?.archived!==!0&&s?.archived!==!0&&m1.get(t)===r){await zt.applyRemoteSessionArchived(t,u.workspaceId),Y0(t);return}$v(t,d=>({...d,title:z4.get(t)===l?u.title:d.title,archived:m1.get(t)===r?d.archived||u.archived:d.archived,busy:d.busy!==s?.busy?d.busy:u.busy,mainTurnActive:d.mainTurnActive!==s?.mainTurnActive?d.mainTurnActive:u.mainTurnActive??d.mainTurnActive,pendingInteraction:d.pendingInteraction!==s?.pendingInteraction?d.pendingInteraction:u.pendingInteraction??d.pendingInteraction,lastTurnReason:Se.sessionLastTurnReasonSeqBySession[t]===a?u.lastTurnReason:d.lastTurnReason}))}catch(u){if(qi(u)&&u.code===40401){EK(t);return}}zt.loadWorkspaces(),PA()})(),i!==void 0&&(nv=i)},onError(t,n,i){aa("ws:error",{status:"failed",errorCode:t,fatal:i}),Sh({severity:"error",title:li("warnings.wsTitle"),message:n,details:[To("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){aa("ws:connection",{status:t?"connected":"disconnected"}),Se.connected=t,Se.connection=t?"connected":"disconnected",t||(vr=null,Vp.clear(),tHe(),H4=0),t&&(LB+=1,uHe(),zt.refreshServerMeta())},onReplayComplete(){u0.flush(),LB>1&&PA();const t=Se.activeSessionId;t!==void 0&&!Ta.includes(t)&&VK(t)},onTranscriptReset(t,n,i,o){gu.receiveReset(t,n,i,o),n==="main"&&jo.pool.receiveReset(t,i,o)},onTranscriptOps(t,n,i,o){const s=gu.applyOps(t,n,i,o);return n==="main"?jo.pool.applyOps(t,i,o):s}})}const eS=new Set;function To(e,t){if(!(t==null||t===""))return{label:li(`warnings.details.${e}`),value:HK(t)}}function HK(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function iHe(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function oHe(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function sHe(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function rHe(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function DB(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function lHe(e,t,n){const i=Wk(t),o=qi(t),s=i||o?t.timestamp:void 0,r=i||o?t.durationMs:void 0,l=[To("operation",e),To("sessionId",n??Se.activeSessionId),To("connection",Se.connection),To("timestamp",rHe(s??Date.now()))];return i?l.push(To("duration",DB(r)),To("request",`${t.method} ${t.path}`),To("endpoint",t.url),To("requestId",t.requestId),To("phase",t.phase),To("timeout",`${t.timeoutMs}ms`),To("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),To("contentType",t.contentType),To("responsePreview",t.bodyPreview),To("cause",t.cause)):o?l.push(To("duration",DB(r)),To("code",t.code),To("requestId",t.requestId),To("message",t.message),To("details",t.details)):l.push(To("errorName",iHe(t)),To("message",oHe(t)??HK(t)),To("stack",sHe(t))),l.filter(a=>a!==void 0)}function aHe(e,t,n={}){const i=Wk(t),o=qi(t),s=i4e(t),r=n.title??li(i?s?"warnings.daemonTimeoutTitle":"warnings.daemonNetworkTitle":o?"warnings.daemonApiTitle":"warnings.operationFailedTitle"),l=n.message??(i?li(s?"warnings.daemonTimeoutMessage":"warnings.daemonNetworkMessage"):o?t.message:li("warnings.operationFailedMessage"));return{severity:"error",title:r,message:l,details:lHe(e,t,n.sessionId)}}function Sh(e){Se.warnings=[...Se.warnings,e]}function uHe(){const e=li("warnings.wsTitle"),t=Se.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Se.warnings.length&&(Se.warnings=t)}function rm(e,t,n){vu(`[kimi-code] operation failed: ${e}`,t);const i=qi(t),o=Wk(t);aa("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:i?t.code:void 0,requestId:i||o?t.requestId:void 0,phase:o?t.phase:void 0,httpStatus:o?t.status:void 0}),Sh(aHe(e,t,n))}const cHe={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function dHe(e){if(!qi(e)||e.code===void 0)return;const t=cHe[e.code];return t?li(t):void 0}function WK(e){return jo.pool.getEntry(e)?.baselineLoaded===!0}function fHe(e){return WK(e)?Promise.resolve():new Promise(t=>{const n=We(()=>{const i=jo.pool.getEntry(e);return i===void 0?!0:(i.version.value,i.baselineLoaded===!0)},i=>{i&&(n(),t())})})}const hHe=4,Ta=[],W4=new Map,tv=new Map;let nv;function A5(e){const t=Ta.indexOf(e);for(t!==-1&&Ta.splice(t,1),Ta.unshift(e);Ta.length>hHe;){let n=-1;for(let s=Ta.length-1;s>=0;s--)if(Ta[s]!==Se.activeSessionId){n=s;break}if(n===-1)break;const[i]=Ta.splice(n,1);if(i===void 0)break;const o=tv.get(i)?.seq??Se.lastSeqBySession[i];o!==void 0&&W4.set(i,{seq:o,...nv!==void 0?{epoch:nv}:{}}),zr?.unsubscribe(i)}}function qK(e){const t=Ta.indexOf(e);t!==-1&&Ta.splice(t,1),W4.delete(e),tv.delete(e)}const Ag=new Map;function UK(e,t){$v(e,n=>({...n,title:t.title??n.title,archived:t.archived??n.archived,archivedAt:t.archivedAt??n.archivedAt,updatedAt:t.updatedAt!==void 0&&t.updatedAt>n.updatedAt?t.updatedAt:n.updatedAt,lastPrompt:t.lastPrompt??n.lastPrompt,messageCount:t.messageCount??n.messageCount}))}const x5=new Map;function Hf(e){if(x5.has(e))return;const t=(async()=>{try{const n=await Kt().getSession(e);n!=null&&UK(e,n)}catch{}finally{x5.delete(e)}})();x5.set(e,t)}function tS(e,t){t>(Se.lastSeqBySession[e]??0)&&(Se.lastSeqBySession[e]=t),t>(Vp.get(e)??0)&&Vp.set(e,t)}const S5=new Map;function VK(e){if(ub(),!zr)return;const t=W4.get(e);t!==void 0&&(W4.delete(e),tv.set(e,{seq:t.seq,throughSeq:Math.max(Se.lastSeqBySession[e]??0,t.seq)}));const n=Se.sessions.find(s=>s.id===e)?.lastSeq??0,i=t?.seq??Se.lastSeqBySession[e]??(n>0?n:void 0);if(i!==void 0){const s=t?.epoch??nv;zr.subscribe(e,s===void 0?{seq:i}:{seq:i,epoch:s}),A5(e);return}if(eS.has(e)){zr.subscribe(e,{seq:0}),A5(e);return}if(S5.has(e))return;A5(e);const o=(async()=>{try{const s=await Kt().getSession(e);UK(e,s);const r=typeof s.lastSeq=="number"&&Number.isFinite(s.lastSeq)?s.lastSeq:0;if(tS(e,r),!Ta.includes(e))return;const l=Math.max(Se.lastSeqBySession[e]??0,r),a=nv;zr?.subscribe(e,a===void 0?{seq:l}:{seq:l,epoch:a})}catch(s){qK(e),(!qi(s)||s.code!==40401)&&ja("session-event subscribe skipped: watermark fetch failed",s)}finally{S5.delete(e)}})();S5.set(e,o)}function Ph(e,t){return(Se.inFlightBySession[e]??!1)||(Se.turnActiveBySession[e]??!1)||(t??Se.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function Vh(e){try{const t=new Date(e),i=Date.now()-t.getTime(),o=i/36e5;if(i<6e4)return li("sessions.justNow");if(o<1)return`${Math.round(i/6e4)}m`;if(o<24)return`${Math.round(o)}h`;const s=i/864e5;return s<7?`${Math.round(s)}d`:s<30?`${Math.round(s/7)}w`:s<365?`${Math.round(s/30)}mo`:`${Math.round(s/365)}y`}catch{return e}}const pHe=3e4,Zd=V(0);let _5=null;function mHe(){_5===null&&(_5=setInterval(()=>{Zd.value=(Zd.value+1)%Number.MAX_SAFE_INTEGER},pHe),_5.unref?.())}function gHe(e){return{questionId:e.questionId,sessionId:e.sessionId,toolCallId:e.toolCallId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel,otherDescription:t.otherDescription}))}}const vHe=D(()=>{const e=ka(),t=new Map;if(e===null)return t;const n=new Map,i=[];for(const o of e.channel.snapshot.items)if(o.kind==="turn")for(const s of o.steps)for(const r of s.frames){if(r.kind!=="tool")continue;if(r.name==="Bash"||r.name==="bash"){const a=r.input;typeof a?.command=="string"&&n.set(r.toolCallId,a.command)}const l=tx(r.output);l!==void 0&&l.length>0&&i.push({toolCallId:r.toolCallId,output:l.join(` -`)})}if(n.size===0)return t;for(const{toolCallId:o,output:s}of i){const r=/task_id:\s*(\S+)/.exec(s);if(!r?.[1])continue;const l=n.get(o);l&&t.set(r[1],l)}return t});function KK(e){return vHe.value.get(e.id)}const yHe=D(()=>{const e=ka(),t=new Map;if(e===null)return t;for(const n of e.channel.snapshot.items)if(n.kind==="turn")for(const i of n.steps)for(const o of i.frames){if(o.kind!=="tool")continue;const s=o.input,r=typeof s?.prompt=="string"?s.prompt:void 0;r&&!t.has(o.toolCallId)&&t.set(o.toolCallId,r);const l=s?.items;if(!r&&Array.isArray(l)&&!t.has(o.toolCallId)){const a=l.filter(u=>typeof u=="string");a.length>0&&t.set(o.toolCallId,a)}}return t});function ZK(e){if(!e.parentToolCallId)return;const t=yHe.value.get(e.parentToolCallId);return Array.isArray(t)?e.swarmIndex!==void 0?t[e.swarmIndex]:void 0:t}function kHe(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":e.status==="cancelled"?t="cancelled":t="fail";let n="",i;if(e.status==="running"&&e.startedAt){i=Date.now()-new Date(e.startedAt).getTime();const l=Math.round(i/1e3),a=Math.floor(l/60),u=l%60;n=li("tasks.timingRunning",{time:`${a}:${String(u).padStart(2,"0")}`})}else e.completedAt&&e.startedAt&&!e.completedAtEstimated?(i=new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime(),n=li("tasks.timingDone",{time:Fu(i,{h:li("status.timeUnitHour"),m:li("status.timeUnitMinute"),s:li("status.timeUnitSecond")})})):n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??KK(e),r=e.kind==="bash"&&s?`$ ${s}`:e.kind==="subagent"?ZK(e)??e.subagentType:void 0;return{id:e.id,agentId:e.agentId,backgroundTaskId:e.backgroundTaskId,name:e.description,kind:e.kind,state:t,timing:n,durationMs:i,meta:r,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId,swarmIndex:e.swarmIndex,completedAt:e.completedAt,createdAt:e.createdAt,model:e.model,thinkingEffort:e.thinkingEffort}}const bHe=D(()=>{const e=Se.sessions.find(n=>n.id===Se.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Se.workspaceName,branch:t}}),wHe=D(()=>(Zd.value,Se.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Vh(e.updatedAt),busy:Ph(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason,workspaceId:Qr(e),cwd:e.cwd})))),CHe=D(()=>Se.activeSessionId??""),AHe=D(()=>{const e=Se.activeSessionId;if(e)return hi.skillsBySession.value[e]??[];const t=Ov.value;return t?hi.skillsByWorkspace.value[t]??[]:[]}),xHe=D(()=>{const e=Se.activeSessionId;if(e)return hi.skillsFetchedBySession.value[e]===!0;const t=Ov.value;return t?hi.skillsFetchedByWorkspace.value[t]===!0:!1}),nS=D(()=>{const e=Se.activeSessionId;return e?Se.inFlightBySession[e]??!1:!1}),SHe=D(()=>zt.isStartingFirstPrompt()),_i=Bze(Se,{api:Kt(),pushOperationFailure:rm,nextOptimisticMsgId:jK,connectEventsIfNeeded:ub,getEventConn:()=>zr,resolveThinkingForPrompt:(e,t)=>hi.resolveThinkingForPrompt(e,t),refreshSessionStatus:fc}),iv=new Map,o9=new Map;function GK(e){let t=iv.get(e);return t===void 0&&(t={parents:new Map,swarmIndexes:new Map},iv.set(e,t)),t}const lm=D(()=>{const e=Se.activeSessionId;if(!e)return[];const t=new Set((_i.sideChatTargetBySession.value[e]??[]).map(o=>o.agentId)),n=o=>o!==void 0&&(t.has(o)||_i.isClosedSideChatAgent(e,o)),i=ka();if(i!==null){const o=wAe(i.channel.snapshot,e,GK(e)),s=new Map((Se.tasksBySession[e]??[]).map(r=>[r.id,r]));return o.filter(r=>!n(r.agentId??r.id)).map(r=>{const l=s.get(r.id)??(r.backgroundTaskId!==void 0?s.get(r.backgroundTaskId):void 0);if(l===void 0)return r;const a=r.status==="running"&&l.status!=="running"&&r.startedAt!==void 0&&(l.completedAtEstimated===!0?l.startedAt!==void 0&&l.startedAt>=r.startedAt:l.completedAt!==void 0&&l.completedAt>=r.startedAt),u=a||r.id===l.id;return{...r,status:a?l.status:r.status,subagentPhase:a?l.status==="completed"?"completed":l.status==="cancelled"?"cancelled":"failed":r.subagentPhase,completedAt:u?l.completedAt??r.completedAt:r.completedAt,completedAtEstimated:l.completedAt!==void 0&&u?void 0:r.completedAtEstimated,outputPreview:u?l.outputPreview??r.outputPreview:r.outputPreview,outputBytes:u?l.outputBytes??r.outputBytes:r.outputBytes,model:r.model??l.model,thinkingEffort:r.thinkingEffort??l.thinkingEffort,command:r.command??l.command}})}return(Se.tasksBySession[e]??[]).filter(o=>!n(o.agentId??o.id))}),_He=D(()=>{const e=Se.activeSessionId;return e?Se.tasksBySession[e]??[]:[]}),QK=Fze(Se,lm,{api:Kt()}),cb=D(()=>{const e=Se.activeSessionId;if(!e)return!1;const t=ka();return t!==null?t.channel.snapshot.meta.activity==="turn":(Se.turnActiveBySession[e]??!1)||(Se.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}),MHe=D(()=>{const e=Se.activeSessionId;if(!e)return;const t=ka();if(t!==null){const n=t.channel.snapshot;if(n.meta.activity==="turn")return;const i=n.items.findLast(a=>a.kind==="turn");if(i?.kind!=="turn"||i.state!=="failed"||i.error===void 0)return;const o=n.items.findLast(a=>a.kind==="marker"&&a.marker==="notice"&&a.payload?.level==="error"),s=o?.kind==="marker"?o.payload:void 0,r=s?.event??s,l=r?.details??{};return{code:typeof r?.code=="string"?r.code:void 0,message:i.error,name:typeof r?.name=="string"?r.name:void 0,retryable:typeof r?.retryable=="boolean"?r.retryable:void 0,statusCode:typeof l.statusCode=="number"?l.statusCode:void 0,requestId:typeof l.requestId=="string"?l.requestId:void 0}}return Se.turnErrorBySession[e]}),IHe=D(()=>{const e=Se.activeSessionId;if(!e||!cb.value)return;const t=ka();if(t!==null){const i=t.channel.snapshot.items.findLast(s=>s.kind==="turn"),o=i?.state==="running"?i.steps.at(-1)?.retry:void 0;return o===void 0?void 0:{failedAttempt:o.failedAttempt,nextAttempt:o.nextAttempt,maxAttempts:o.maxAttempts,delayMs:o.delayMs,errorName:o.errorName,statusCode:o.statusCode}}return Se.turnRetryBySession[e]}),zA=e=>Kt().getFileUrl(e),jA=(e,t)=>Kt().getSessionMediaUrl(e,t),THe=nAe();function YK(e){return Array.isArray(e)?e.filter(t=>typeof t=="object"&&t!==null&&t.type==="text").map(t=>t.text).join(""):""}function EHe(e){for(let t=e.items.length-1;t>=0;t--){const n=e.items[t];if(n.kind==="marker"){const i=n.at;if(typeof i=="string")return i;continue}if(n.kind==="turn"){let i;const o=s=>{typeof s=="string"&&(i===void 0||s>i)&&(i=s)};o(n.endedAt),o(n.startedAt);for(const s of n.steps)o(s.endedAt),o(s.startedAt);if(i!==void 0)return i}}}function LHe(e,t){if(t===void 0)return;const n=e.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n.startedAt:void 0}function db(e,t){const n=LHe(e,t?.["kimiWeb.anchorTurnId"]),i=t?.["kimiWeb.anchorPromptCreatedAt"];return typeof i=="string"&&(n===void 0||i>=n)?{at:i,exclusive:!0}:n!==void 0?{at:n,exclusive:!1}:void 0}function iS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){const r=t.find(l=>!o.has(l.promptId)&&l.status!=="queued"&&(s.floor===void 0||(s.floor.exclusive?l.createdAt>s.floor.at:l.createdAt>=s.floor.at))&&YK(l.content)===s.text);r!==void 0&&(o.add(r.promptId),i.set(s.id,r.promptId))}return i}function NHe(e,t,n,i,o){const s=t===void 0?-1:e.findIndex(r=>r.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="marker"||r.marker!=="skill")return!1;if(o!==void 0){const a=r.at;if(typeof a!="string"||a<=o)return!1}const l=r.payload?.origin;return l?.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function JK(e,t,n,i,o){const s=t===void 0?-1:e.findIndex(r=>r.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="turn"||o?.terminalOnly===!0&&r.state==="running")return!1;const l=r.origin.payload??r.origin;return l.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function oS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){const r=s.anchorTurnId===void 0?-1:t.findIndex(a=>a.kind==="turn"&&a.turnId===s.anchorTurnId);if(s.anchorTurnId!==void 0&&r===-1)continue;const l=t.slice(r+1).find(a=>{if(a.kind==="turn"){if(o.has(a.turnId))return!1;const u=a.origin.payload??a.origin;return u.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}if(a.kind==="marker"&&a.marker==="skill"){if(o.has(a.markerId))return!1;if(s.promptFloor!==void 0){const c=a.at;if(typeof c!="string"||c<=s.promptFloor)return!1}const u=a.payload?.origin;return u?.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}return!1});if(l!==void 0){const a=l.kind==="turn"?l.turnId:l.markerId;o.add(a),i.set(s.id,a)}}return i}const XK=D(()=>{const e=Se.activeSessionId;if(!e)return[];const t=ka();if(t===null)return[];const n=THe(t.channel.snapshot,{sessionId:e,getFileUrl:zA,getSessionMediaUrl:jA,plansByToolCallId:yc[e],planReviewByToolCallId:Se.planReviewByToolCallId,agentCreatedAt:Se.sessions.find(u=>u.id===e)?.createdAt,pendingInteractionAtByStepId:xg.get(e),thinkingTiming:t.thinkingTiming}),i=Se.optimisticMessagesBySession[e]??[];if(i.length===0)return n;const o=t.channel.snapshot.items.filter(u=>u.kind==="turn"),s=iS(i.filter(u=>u.metadata?.["kimiWeb.uncertain"]===!0&&u.metadata?.["kimiWeb.promptId"]===void 0&&u.metadata?.origin?.kind!=="skill_activation").map(u=>({id:u.id,text:u.content.filter(c=>c.type==="text").map(c=>"text"in c?c.text:"").join(""),floor:db(t.channel.snapshot.items,u.metadata)})),t.channel.snapshot.prompts,X0.get(e)),r=oS(i.filter(u=>u.metadata?.["kimiWeb.uncertain"]===!0&&u.metadata?.origin?.kind==="skill_activation").map(u=>{const c=u.metadata?.origin;return{id:u.id,anchorTurnId:u.metadata?.["kimiWeb.anchorTurnId"],promptFloor:u.metadata?.["kimiWeb.anchorPromptCreatedAt"],skillName:c?.skillName,skillArgs:c?.skillArgs}}),t.channel.snapshot.items,ev.get(e)),l=i.filter(u=>{const c=u.metadata?.["kimiWeb.promptId"];if(c!==void 0){if(u.metadata?.["kimiWeb.steered"]===!0&&t.channel.snapshot.items.some(b=>b.kind==="turn"&&b.steps.some(w=>w.frames.some(C=>C.kind==="text"&&C.role==="user"&&(C.promptIds?.includes(c)??!1)))))return!1;const v=t.channel.snapshot.prompts.find(y=>y.promptId===c);if(v!==void 0)return v.status==="queued"||u.metadata?.["kimiWeb.steered"]===!0}const d=u.metadata?.origin;if(d?.kind==="skill_activation"){if(u.metadata?.["kimiWeb.uncertain"]===!0)return!r.has(u.id);const v=u.metadata?.["kimiWeb.anchorTurnId"];return!JK(t.channel.snapshot.items,v,d.skillName,d.skillArgs)}if(u.metadata?.["kimiWeb.uncertain"]===!0)return!s.has(u.id);const f=u.metadata?.["kimiWeb.anchorTurnId"],h=f===void 0?-1:o.findIndex(v=>v.kind==="turn"&&v.turnId===f);if(f!==void 0&&h===-1)return!0;const m=o.slice(h+1),g=u.content.filter(v=>v.type==="text").map(v=>"text"in v?v.text:"").join("");return!m.some(v=>v.kind==="turn"&&((v.prompt??"")===g||g===""&&(v.attachmentIds?.length??0)>0))});if(l.length===0)return n;const a=n.filter(u=>u.role!=="compaction").length+1;return[...n,...l.flatMap((u,c)=>Qk([u],[],zA,!1,{},{},{startNo:a+c,getSessionMediaUrl:jA}))]}),DHe=D(()=>nS.value||cb.value),xg=_h(new Map);{const e=jo;We(()=>Se.activeSessionId,(i,o)=>{o!==void 0&&o!==i&&e.deactivate(o),i&&e.activate(i)},{immediate:!0}),We(()=>[Se.activeSessionId,...[...e.pool.subscribedSessions].flatMap(i=>[e.pool.getEntry(i)?.version.value??-1,...(_i.sideChatTargetBySession.value[i]??[]).map(o=>gu.getEntry(i,o.agentId)?.version.value??-1),gu.desiredAgentBySession.get(i),gu.getEntry(i,gu.desiredAgentBySession.get(i)??"")?.version.value??-1])],()=>{for(const i of e.pool.subscribedSessions){const o=e.pool.getEntry(i);if(o===void 0||!o.baselineLoaded)continue;const s=o.channel.snapshot.meta;let r=!1;const l=s.modes?.plan!==void 0;Se.pendingPlanBySession[i]===void 0&&(Se.planModeBySession[i]??!1)!==l&&(Se.planModeBySession={...Se.planModeBySession,[i]:l},r=!0);const a=s.modes?.swarm!==void 0;Se.pendingSwarmBySession[i]===void 0&&(Se.swarmModeBySession[i]??!1)!==a&&(Se.swarmModeBySession={...Se.swarmModeBySession,[i]:a},r=!0);const u=s.agent?.model;if(u!==void 0){const N=Se.sessions.find(I=>I.id===i);N!==void 0&&N.model!==u&&(Se.sessions=Se.sessions.map(I=>I.id===i?{...I,model:u}:I),r=!0)}const c=s.agent?.thinkingEffort;c!==void 0&&(Se.pendingThinkingBySession[i]===void 0&&Se.thinkingBySession[i]!==c&&(r=!0),T6(Se,i,c)),r&&eHe(i);const d=o.channel.snapshot;if(d.hasMoreOlder===!0&&!o.channel.loadingOlder){const N=bAe(d),I=GK(i);if(d.tasks.some(_=>_.kind==="subagent"&&_.agentId!==void 0&&_.state==="running"&&!I.parents.has(_.agentId)&&!N.has(_.agentId))){const _=o9.get(i)??0;Date.now()-_>3e4&&o.channel.loadOlder().catch(()=>{o9.set(i,Date.now()),setTimeout(()=>{const x=e.pool.getEntry(i);x!==void 0&&(x.version.value+=1)},3e4)})}}const f=s.goal,h=Se.goalBySession[i];if(f===void 0||f.status==="complete"){const N=h!==void 0;N&&delete Se.goalBySession[i];const I=xh.has(i);(N||I)&&(Se.goalVersionBySession[i]=(Se.goalVersionBySession[i]??0)+1,kc.delete(i),g1.delete(i))}else h!==void 0&&h.status!==f.status?(Se.goalBySession[i]={...h,status:f.status},Se.goalVersionBySession[i]=(Se.goalVersionBySession[i]??0)+1):h===void 0&&(xh.has(i)?g1.get(i)!==f.status&&(g1.set(i,f.status),Se.goalVersionBySession[i]=(Se.goalVersionBySession[i]??0)+1,f.status==="active"?kc.add(i):kc.delete(i)):DK(i,f.status));const m=[],g=[],v={};for(const N of o.channel.snapshot.interactions){const I=Ep(N,i);I!==void 0&&m.push(I);const S=Um(N,i);S!==void 0&&g.push(S);const _=N.request,x=_?.display,E=typeof N.toolCallId=="string"?N.toolCallId:typeof _?.toolCallId=="string"?_.toolCallId:void 0;E!==void 0&&x?.kind==="plan_review"&&typeof x.plan=="string"&&x.plan.length>0&&(v[E]={plan:x.plan,path:typeof x.path=="string"?x.path:void 0})}const y=new Set;for(const N of _i.sideChatTargetBySession.value[i]??[])y.add(N.agentId);const b=gu.desiredAgentBySession.get(i);b!==void 0&&y.add(b);const w=[...y].map(N=>gu.getEntry(i,N)).filter(N=>N?.baselineLoaded===!0);for(const N of w){const I=`${i}:${N.channel.agentId}`;let S=j4.get(I);if(S===void 0)S=new Set(N.channel.snapshot.interactions.map(E=>E.interactionId)),j4.set(I,S);else{for(const E of N.channel.snapshot.interactions){if(E.state!=="pending"||S.has(E.interactionId))continue;S.add(E.interactionId);const M=Ep(E,i);M!==void 0&&I5(i,M);const R=Um(E,i);R!==void 0&&M5(i,R)}for(const E of[...S])N.channel.snapshot.interactions.some(M=>M.interactionId===E)||S.delete(E)}const _=new Set(m.map(E=>E.approvalId)),x=new Set(g.map(E=>E.questionId));for(const E of N.channel.snapshot.interactions){const M=Ep(E,i);if(M!==void 0&&!_.has(M.approvalId)){const q=(Se.approvalsBySession[i]??[]).find(z=>z.approvalId===M.approvalId);m.push(q??M)}const R=Um(E,i);if(R!==void 0&&!x.has(R.questionId)){const q=(Se.questionsBySession[i]??[]).find(z=>z.questionId===R.questionId);g.push(q??R)}}}const C=new Set(o.channel.snapshot.interactions.map(N=>N.interactionId)),T=new Set(w.flatMap(N=>N.channel.snapshot.interactions.filter(I=>I.state!=="pending").map(I=>I.interactionId)));for(const N of Se.approvalsBySession[i]??[])C.has(N.approvalId)||T.has(N.approvalId)||m.some(I=>I.approvalId===N.approvalId)||m.push(N);for(const N of Se.questionsBySession[i]??[])C.has(N.questionId)||T.has(N.questionId)||g.some(I=>I.questionId===N.questionId)||g.push(N);or().setSessionApprovals(i,m),or().setSessionQuestions(i,g),i===Se.activeSessionId&&Il(Se.planReviewByToolCallId,v)}},{immediate:!0});const t=new Map,n=(i,o,s)=>{let r=!1;for(const l of o.interactions){if(l.state==="pending"||s.has(l.interactionId)||l.request?.toolName!=="ExitPlanMode")continue;s.add(l.interactionId),r=!0;const a=l.request,u=typeof l.toolCallId=="string"?l.toolCallId:typeof a?.toolCallId=="string"?a.toolCallId:void 0,c=l.state;if(u!==void 0&&(c==="approved"||c==="rejected"||c==="cancelled")){const d=l.response;P4(i,u,{state:c,selectedOption:typeof d?.selectedOption=="string"?d.selectedOption:void 0,feedback:typeof d?.feedback=="string"?d.feedback:void 0})}}return r};We(()=>[...e.pool.subscribedSessions].map(i=>e.pool.getEntry(i)?.version.value??-1),()=>{for(const i of[...t.keys()])e.pool.subscribedSessions.has(i)||(t.delete(i),xg.delete(i),iv.delete(i),o9.delete(i));for(const i of e.pool.subscribedSessions){const o=e.pool.getEntry(i);if(o===void 0||!o.baselineLoaded)continue;const s=o.channel.snapshot,r=s.items.filter(S=>S.kind==="turn"),l=s.interactions.filter(S=>S.state==="pending"),a=new Map(s.prompts.map(S=>[S.promptId,S.status])),u=t.get(i),c=r.at(-1),d=c?.kind==="turn"?c.turnId:void 0,f=c?.kind==="turn"?c.state:void 0;t.set(i,{activity:s.meta.activity,lastTurnId:d,lastTurnState:f,maxTurnOrdinal:r.reduce((S,_)=>_.kind==="turn"?Math.max(S,_.ordinal):S,-1),firstItemId:s.items[0]===void 0?void 0:SN(s.items[0]),seenPendingInteractionIds:new Set(l.map(S=>S.interactionId)),settledPlanInteractionIds:u?.settledPlanInteractionIds??new Set,seenNoticeIds:new Set(s.items.filter(S=>S.kind==="marker"&&S.marker==="notice").map(S=>S.kind==="marker"?S.markerId:"")),promptStatusById:a});const h=l.some(S=>!u?.seenPendingInteractionIds.has(S.interactionId));if(l.length>0&&h){const S=s.items.findLast(x=>x.kind==="turn"&&x.state==="running"),_=S?.kind==="turn"?S.steps.findLast(x=>x.state==="running"):void 0;if(_!==void 0){const x=new Map(xg.get(i));x.set(_.stepId,EHe(s)??new Date().toISOString()),xg.set(i,x)}}if(u===void 0){if(o.recoveredViaEmptyReset){o.recoveredViaEmptyReset=!1;for(const _ of l){Hf(i);const x=Ep(_,i);x!==void 0&&I5(i,x);const E=Um(_,i);E!==void 0&&M5(i,E)}if(i!==Se.activeSessionId)for(const _ of s.items){if(_.kind!=="marker"||_.marker!=="notice")continue;const x=_.payload;x?.level==="error"&&(Sh(qC(x.event??x,li)),zt.markSessionWarningShown(i,`${typeof x.event?.code=="string"?x.event.code:""} ${typeof x.message=="string"?x.message:""}`))}}const S=s9(i,s);s.meta.activity!=="turn"&&!s.prompts.some(_=>_.status==="running"||_.status==="queued")&&S.settle&&zt.finishPromptLocal(i,{skipDrain:!S.drain}),n(i,s,t.get(i).settledPlanInteractionIds)&&P1(i);continue}let m=!1;const g=r.reduce((S,_)=>_.kind==="turn"?Math.max(S,_.ordinal):S,-1),y=u.lastTurnId!==void 0&&u.lastTurnId!==d&&!r.some(S=>S.kind==="turn"&&S.turnId===u.lastTurnId)&&g_.kind==="turn"&&_.turnId===u.lastTurnId);S?.kind==="turn"&&u.lastTurnState==="running"&&S.state!=="running"&&b.push(S);for(const _ of r)_.kind==="turn"&&_.ordinal>u.maxTurnOrdinal&&_.state!=="running"&&b.push(_)}!y&&r.some(S=>S.kind==="turn"&&S.state==="running"&&S.ordinal>u.maxTurnOrdinal)&&Hf(i);const w=u.activity==="turn"&&s.meta.activity!=="turn";if(b.length>0||w){const S=b.filter(_=>Ag.get(i)!==_.turnId);for(const[_,x]of S.entries()){Ag.set(i,x.turnId);const E=x.state==="cancelled"||x.state==="failed",M=_===S.length-1,R=M?s9(i,s):{settle:!1,drain:!1};UA(i,E?"aborted":"idle",!0,{drain:M&&R.drain,settleLocal:R.settle}),Hf(i)}if(b.length>0&&l.length===0&&xg.delete(i),b.length===0&&c?.kind==="turn"&&Ag.get(i)!==c.turnId){Ag.set(i,c.turnId);const _=c.state==="cancelled"||c.state==="failed",x=s9(i,s);UA(i,_?"aborted":"idle",!0,{drain:x.drain,settleLocal:x.settle}),Hf(i)}}for(const S of l){if(u.seenPendingInteractionIds.has(S.interactionId))continue;Hf(i);const _=Ep(S,i);_!==void 0&&I5(i,_);const x=Um(S,i);x!==void 0&&M5(i,x)}{const S=u.firstItemId===void 0?0:s.items.findIndex(x=>SN(x)===u.firstItemId),_=S>0?s.items.slice(S):s.items;for(const x of _){if(x.kind!=="marker"||x.marker!=="notice"||u.seenNoticeIds.has(x.markerId))continue;const E=x.payload,M=`${typeof E?.event?.code=="string"?E.event.code:""} ${typeof E?.message=="string"?E.message:""}`;if(E?.level==="error"){if(zt.markSessionWarningShown(i,M),i===Se.activeSessionId)continue;Sh(qC(E?.event??E??{},li));continue}E?.level!=="warning"&&E?.level!=="info"||(Sh({severity:E.level,title:li("warnings.noteLabel"),message:typeof E.message=="string"?E.message:void 0}),zt.markSessionWarningShown(i,M))}}for(const S of u.seenPendingInteractionIds){if(l.some(x=>x.interactionId===S))continue;const _=s.interactions.find(x=>x.interactionId===S);if(_!==void 0&&_.request?.toolName==="ExitPlanMode"){u.settledPlanInteractionIds.add(S),m=!0;const x=_.request,E=typeof _.toolCallId=="string"?_.toolCallId:typeof x?.toolCallId=="string"?x.toolCallId:void 0,M=_.state;if(E!==void 0&&(M==="approved"||M==="rejected"||M==="cancelled")){const R=_.response;P4(i,E,{state:M,selectedOption:typeof R?.selectedOption=="string"?R.selectedOption:void 0,feedback:typeof R?.feedback=="string"?R.feedback:void 0})}}}n(i,s,u.settledPlanInteractionIds)&&(m=!0),m&&P1(i);for(const S of s.prompts){if(S.status==="running"||S.status==="queued")continue;const _=u.promptStatusById.get(S.promptId);(S.status==="blocked"||S.status==="aborted")&&_!==S.status&&d===u.lastTurnId&&(Hf(i),Se.promptIdBySession[i]===S.promptId&&zt.finishPromptLocal(i))}const C=Se.optimisticMessagesBySession[i];if(C!==void 0&&C.some(S=>S.metadata?.["kimiWeb.steered"]===!0)){const S=C.filter(_=>{if(_.metadata?.["kimiWeb.steered"]!==!0)return!0;const x=_.metadata?.["kimiWeb.promptId"];return x===void 0?!0:!s.items.some(E=>E.kind==="turn"&&E.steps.some(M=>M.frames.some(R=>R.kind==="text"&&R.role==="user"&&(R.promptIds?.includes(x)??!1))))});if(S.length!==C.length){const _={...Se.optimisticMessagesBySession};S.length>0?_[i]=S:delete _[i],Se.optimisticMessagesBySession=_,s.meta.activity!=="turn"&&((_[i]??[]).some(M=>M.metadata?.["kimiWeb.uncertain"]===!0)||(Se.queuedBySession[i]??[]).length>0&&queueMicrotask(()=>zt.resumeQueueIfIdle(i)))}}const T=Se.optimisticMessagesBySession[i];if(T!==void 0&&T.some(S=>S.metadata?.["kimiWeb.uncertain"]===!0)){const S=X0.get(i)??new Set;for(const q of[...S])s.prompts.some(z=>z.promptId===q)||S.delete(q);X0.set(i,S);const _=iS(T.filter(q=>q.metadata?.["kimiWeb.uncertain"]===!0&&!(q.metadata?.["kimiWeb.steered"]===!0&&q.metadata?.["kimiWeb.promptId"]!==void 0)&&q.metadata?.origin?.kind!=="skill_activation").map(q=>({id:q.id,text:q.content.filter(z=>z.type==="text").map(z=>"text"in z?z.text:"").join(""),floor:db(s.items,q.metadata)})),s.prompts,S),x=new Set([..._.entries()].filter(([q])=>{const z=T.find(O=>O.id===q);return z!==void 0&&z.metadata?.["kimiWeb.steered"]!==!0}).map(([,q])=>q));for(const q of x)S.add(q);const E=ev.get(i)??new Set;for(const q of[...E])s.items.some(O=>O.kind==="turn"&&O.turnId===q||O.kind==="marker"&&O.markerId===q)||E.delete(q);ev.set(i,E);const M=oS(T.filter(q=>q.metadata?.["kimiWeb.uncertain"]===!0&&q.metadata?.origin?.kind==="skill_activation").map(q=>{const z=q.metadata?.origin;return{id:q.id,anchorTurnId:q.metadata?.["kimiWeb.anchorTurnId"],promptFloor:q.metadata?.["kimiWeb.anchorPromptCreatedAt"],skillName:z?.skillName,skillArgs:z?.skillArgs}}),s.items,E);for(const q of M.values())E.add(q);const R=T.filter(q=>{if(q.metadata?.["kimiWeb.uncertain"]!==!0)return!0;if(q.metadata?.["kimiWeb.steered"]===!0&&q.metadata?.["kimiWeb.promptId"]!==void 0){const O=q.metadata?.["kimiWeb.promptId"],B=s.prompts.find(ie=>ie.promptId===O);if(B===void 0||B.status==="queued")return!0;if(B.status==="blocked"||B.status==="aborted")return!1;const P=q.content.filter(ie=>ie.type==="text").map(ie=>"text"in ie?ie.text:"").join(""),H=q.metadata?.["kimiWeb.anchorTurnId"],j=H===void 0?-1:s.items.findIndex(ie=>ie.kind==="turn"&&ie.turnId===H);return!(j===-1?s.items:s.items.slice(j+1)).some(ie=>ie.kind==="turn"&&(ie.steps.some(W=>W.frames.some(Q=>Q.kind==="text"&&Q.role==="user"&&(Q.promptIds?.includes(O)??!1)))||(ie.prompt??"")===P||P===""&&(ie.attachmentIds?.length??0)>0))}return q.metadata?.origin?.kind==="skill_activation"?!M.has(q.id):!_.has(q.id)});if(R.length!==T.length){const q={...Se.optimisticMessagesBySession};R.length>0?q[i]=R:delete q[i],Se.optimisticMessagesBySession=q,s.meta.activity!=="turn"&&((q[i]??[]).some(B=>B.metadata?.["kimiWeb.uncertain"]===!0)||(Se.queuedBySession[i]??[]).length>0&&queueMicrotask(()=>zt.resumeQueueIfIdle(i)))}}const I=s.prompts.find(S=>S.status==="running")??s.prompts.find(S=>S.status==="queued");I!==void 0&&Se.abortPromptIdBySession[i]!==I.promptId?Se.abortPromptIdBySession[i]=I.promptId:I===void 0&&Se.abortPromptIdBySession[i]!==void 0&&delete Se.abortPromptIdBySession[i]}jo.trimResident()},{immediate:!0})}const HA=new Map,FHe=D(()=>{QK.taskClock.value;const e=lm.value.map(kHe),t=Se.activeSessionId;if(t){let n=HA.get(t);n||(n=new Map,HA.set(t,n));const i=e.filter(r=>r.kind==="subagent"&&r.runInBackground);for(const r of i){const l=r.agentId??r.id;if(r.agentId!==void 0&&r.backgroundTaskId!==void 0&&!n.has(l)){const a=n.get(r.backgroundTaskId);a!==void 0&&(n.delete(r.backgroundTaskId),n.set(l,a))}}const o=i.filter(r=>!n.has(r.agentId??r.id)).sort((r,l)=>(r.createdAt??"").localeCompare(l.createdAt??""));let s=n.size===0?0:Math.max(...n.values())+1;for(const r of o)n.set(r.agentId??r.id,s++);for(const r of i)r.swarmIndex=n.get(r.agentId??r.id)}return e}),eZ=D(()=>fAe(lm.value)),BHe=D(()=>pAe(lm.value)),Bp=D(()=>{const e=Se.activeSessionId;return e?Se.goalBySession[e]??null:null}),RHe=D(()=>{if(!Se.activeSessionId)return[];const t=ka();return t===null?[]:(t.channel.snapshot.todos.at(-1)?.items??[]).map(i=>({title:i.title,status:i.status}))}),$He=D(()=>{const e=Se.activeSessionId;if(!e)return null;const t=ka();if(t!==null){const n=t.channel.snapshot.items.findLast(o=>o.kind==="marker"&&o.marker==="compaction"),i=n?.payload;return n===void 0||i?.phase!=="started"?null:{status:"running",trigger:i.trigger==="manual"?"manual":"auto"}}return Se.compactionBySession[e]??null}),OHe=D(()=>Se.connection),PHe=D(()=>Se.loading),zHe=D(()=>Se.sessionLoading),jHe=D(()=>ka()?.channel.loadingOlder??!1),HHe=D(()=>Se.activeSessionId?ka()?.channel.snapshot.hasMoreOlder===!0:!1),WHe=D(()=>ka()?.channel.loadOlderError??!1),qHe=D(()=>Se.serverVersion),tZ=D(()=>Se.webTitle),UHe=D(()=>Se.experimentalFlags),VHe=D(()=>Se.backend),KHe=D(()=>Se.dangerousBypassAuth);function ZHe(){Se.dangerousBypassAuth=!1}const GHe=D(()=>Se.permission),QHe=D(()=>Se.thinking),nZ=D(()=>{const e=Se.activeSessionId;return e?Se.planModeBySession[e]??!1:Rv.planMode}),YHe=D(()=>{const e=Se.activeSessionId;return e?Se.planArmedBySession[e]??!1:Rv.planMode}),JHe=D(()=>{const e=Se.activeSessionId;return e?Se.swarmModeBySession[e]??!1:Rv.swarmMode}),XHe=D(()=>{const e=Se.activeSessionId;return e?Se.goalModeBySession[e]??!1:Rv.goalMode}),eWe=D(()=>{const e=Se.activeSessionId,t=(e?yc[e]:void 0)??{},n={},i=new Set;for(const s of XK.value)for(const r of s.tools??[]){if(r.name!=="ExitPlanMode")continue;i.add(r.id);const l=t[r.id];if(l){n[r.id]=l;continue}const a=Se.planReviewByToolCallId[r.id],u=tWe(r.arg),c=a?.plan??u?.plan,d=r.planPath??a?.path;!c&&!d||(n[r.id]={agentId:"main",toolCallId:r.id,turnId:s.id,source:"interaction",plan:c??"",path:d,options:u?.options,review:Yx[r.id]})}return{...Object.fromEntries(Object.entries(t).filter(([s])=>!i.has(s))),...n}});function tWe(e){try{const t=JSON.parse(e);return{plan:typeof t.plan=="string"?t.plan:void 0,options:Array.isArray(t.options)?t.options:void 0}}catch{return}}const nWe=D(()=>{const e=hAe(eZ.value);return{plan:nZ.value,goal:Bp.value&&Bp.value.status!=="complete"?{status:Bp.value.status,turnsUsed:Bp.value.turnsUsed,elapsedMs:Bp.value.wallClockMs}:null,swarm:e.total>0?e:null}}),iWe=D(()=>{const e=Se.activeSessionId;if(!e)return[];const t=Kt();return(Se.queuedBySession[e]??[]).map(n=>({id:n.id??n.text,text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(i=>Ux(t,i)),editText:n.editText}))}),oWe=D(()=>Se.warnings),sWe=D(()=>{const e=Se.activeSessionId;return e?(Se.questionsBySession[e]??[]).map(gHe):[]}),rWe=D(()=>{const e=Se.activeSessionId;return e?(Se.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:VW(t),agentName:t.agentName,toolCallId:t.toolCallId})):[]}),sS=D(()=>{const e=Se.activeSessionId;return e?(Se.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Se.questionsBySession[e]??[]).length>0?"awaiting-question":nS.value||cb.value?"running":"idle":"idle"}),hi=Xze(Se,{api:Kt(),pushOperationFailure:rm,refreshSessionStatus:fc,persistSessionProfile:BK,savePlanModeToStorage:Qx,activity:sS,updateSession:$v,loadConfig:()=>zt.loadConfig(),checkAuth:()=>zt.checkAuth(),beginLocalTurn:RA,settleLocalTurn:$A,mainTranscriptTailTurnId:PK,mainTranscriptTailPromptCreatedAt:zK,settleIfFateProven:aZ}),WA=D(()=>{const e=Se.activeSessionId;if(!e)return null;const t=Se.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),lWe=D(()=>{const e=Se.activeSessionId;return e?Se.gitStatusBySession[e]?.pullRequest??null:null}),aWe=D(()=>{const e=Se.activeSessionId;if(!e)return[];const t=Se.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,i])=>({path:n,status:i})).sort((n,i)=>n.path.localeCompare(i.path)):[]}),uWe=D(()=>{const e=Se.activeSessionId;if(!e)return null;const t=Se.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),iZ=D(()=>{const e=Se.sessions.find(r=>r.id===Se.activeSessionId),t=WA.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?hi.draftModel.value:null,i=(e?.model&&e.model.length>0?e.model:n??Se.defaultModel)??"—",o=hi.models.value.find(r=>r.id===i)??hi.models.value.find(r=>r.model===i);return{model:o?.displayName||o?.model||(i.includes("/")?i.split("/").pop():i),modelId:o?.id??i,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Se.permission,branch:t,cwd:e?.cwd??"",isGitRepo:WA.value!==null}}),cWe=D(()=>tr().fileDiffLines),dWe=D(()=>Se.sessions.find(t=>t.id===Se.activeSessionId)?.usage.totalCostUsd??0),fWe=D(()=>Se.authReady),hWe=D(()=>Se.defaultModel),pWe=D(()=>Se.managedProviderStatus),mWe=D(()=>Se.managedUserInfo),gWe=D(()=>Se.managedMembership),vWe=D(()=>Se.config),yWe=D(()=>{const e=Se.activeSessionId;if(!e)return{};const t=Se.gitStatusBySession[e];return t?{...t.entries}:{}}),kWe=D(()=>{const e=new Map;for(const t of Se.workspaces){const n=Tl(t.root);e.has(n)||e.set(n,t.id)}return e});function Qr(e){return kWe.value.get(Tl(e.cwd))??e.workspaceId??e.cwd}const fb=D(()=>Aoe({workspaces:Se.workspaces,sessions:Se.sessions,hiddenWorkspaceRoots:Se.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:Se.sessionsHasMoreByWorkspace})),q4=V(iae()),U4=V(oae());function bWe(e){U4.value!==e&&(U4.value=e,sae(e))}const ov=V(rae());We(()=>Se.sessions,e=>{const t=Dae(e,Qr),{next:n,changed:i}=Nae(ov.value,t);i&&(ov.value=n,LP(n))});const oZ=D(()=>Fae(fb.value,ov.value));We(()=>[fb.value.map(e=>e.id).join("\0"),Se.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],i=Iae(n,q4.value,oZ.value);i!==null&&(q4.value=i,EP(i));const{next:o,changed:s}=Bae(ov.value,new Set(n));s&&(ov.value=o,LP(o))});const hb=D(()=>wr().pinnedSessionIds);function wWe(e){wr().pinSession(e)}function CWe(e){wr().unpinSession(e)}function AWe(e){wr().unpinSessions(e)}function xWe(e){wr().togglePinSession(e)}const yl=D(()=>{const e=fb.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Hje(t.root,Se.fsHome),sessionCount:t.sessionCount}));return U4.value==="recent"?Lae(e,oZ.value):Tae(e,q4.value)}),Ov=D(()=>{const e=Se.activeWorkspaceId,t=yl.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});We(Ov,e=>{e&&(Object.prototype.hasOwnProperty.call(hi.skillsByWorkspace.value,e)||hi.loadSkillsForWorkspace(e))},{immediate:!0});const sZ=D(()=>{const e=Ov.value;return e?yl.value.find(t=>t.id===e)??null:null}),SWe=IPe({webTitle:tZ,activeWorkspaceRoot:()=>sZ.value?.root??null}),_We=D(()=>{Zd.value;const e=new Set(yl.value.map(n=>n.id)),t=new Map(yl.value.map(n=>[n.id,n.name]));return Se.sessions.filter(n=>!n.parentSessionId&&e.has(Qr(n))).map(n=>{const i=Qr(n);return{id:n.id,title:n.title,time:Vh(n.updatedAt),busy:Ph(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:i,workspaceName:t.get(i)}})}),qA=V(kd),pb=D(()=>{Zd.value;const e=new Set(yl.value.map(r=>r.id)),t=new Map(yl.value.map(r=>[r.id,r.name])),n=new Set(hb.value),i=(r,l)=>new Date(l.updatedAt).getTime()-new Date(r.updatedAt).getTime(),o=Se.flatSessionsFrontier,s=[];for(const r of Se.sessions)r.parentSessionId||r.archived||n.has(r.id)||!e.has(Qr(r))||!(pv({busy:Ph(r.id,r.mainTurnActive),unread:aS.value[r.id]??!1,questionCount:sv.value[r.id]?.questions??0,approvalCount:sv.value[r.id]?.approvals??0,pendingInteraction:r.pendingInteraction,lastTurnReason:r.lastTurnReason})!=="idle")&&o!==null&&new Date(r.updatedAt).getTime(){const l=Qr(r);return{id:r.id,title:r.title,time:Vh(r.updatedAt),busy:Ph(r.id,r.mainTurnActive),pendingInteraction:r.pendingInteraction,lastTurnReason:r.lastTurnReason,lastPrompt:r.lastPrompt,updatedAt:r.updatedAt,workspaceId:l,workspaceName:t.get(l),cwdLabel:r.cwd?Mc(r.cwd):"-",pullRequest:r.pullRequest}})});function MWe(e){return pv({busy:e.busy,unread:aS.value[e.id]??!1,questionCount:sv.value[e.id]?.questions??0,approvalCount:sv.value[e.id]?.approvals??0,pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})!=="idle"}const rS=D(()=>{const e=pb.value;let t=qA.value;for(let n=e.length-1;n>=t;n--)if(MWe(e[n])){t=n+1;break}return t}),IWe=D(()=>pb.value.slice(0,rS.value)),TWe=D(()=>Se.flatSessionsHasMore||rS.valuepb.value.length&&Se.flatSessionsHasMore&&zt.loadMoreFlatSessions()}const V4=V(kd),lS=D(()=>{Zd.value;const e=new Set(yl.value.map(n=>n.id)),t=new Map(yl.value.map(n=>[n.id,n.name]));return Se.doneSessions.filter(n=>e.has(Qr(n))).map(n=>{const i=Qr(n),o=Se.sessions.find(r=>r.id===n.id),s=o!==void 0&&new Date(o.updatedAt).getTime()>new Date(n.updatedAt).getTime()?o.updatedAt:n.updatedAt;return{id:n.id,title:n.title,time:Vh(s),busy:o?.busy??n.busy,pendingInteraction:o?.pendingInteraction??n.pendingInteraction,lastTurnReason:o?.lastTurnReason??n.lastTurnReason,lastPrompt:n.lastPrompt,updatedAt:s,workspaceId:i,workspaceName:t.get(i),archived:!0,cwdLabel:n.cwd?Mc(n.cwd):"-",pullRequest:n.pullRequest}}).sort((n,i)=>new Date(i.updatedAt).getTime()-new Date(n.updatedAt).getTime())}),LWe=D(()=>lS.value.slice(0,V4.value)),NWe=D(()=>Se.doneSessionsHasMore||V4.valuelS.value.length&&Se.doneSessionsHasMore&&zt.loadMoreDoneSessions()}const FWe=D(()=>{const e=Se.activeSessionId;return e?Se.sessions.find(t=>t.id===e)?.archived===!0:!1});function BWe(e,t=6){if(!e)return[];const n=new Map(yl.value.map(r=>[r.id,r.name])),i=(r,l)=>({id:r.id,title:r.title,time:Vh(l??r.updatedAt),busy:l===void 0&&Ph(r.id,r.mainTurnActive),pendingInteraction:l===void 0?r.pendingInteraction:void 0,lastTurnReason:l===void 0?r.lastTurnReason:void 0,lastPrompt:r.lastPrompt,updatedAt:l??r.updatedAt,workspaceId:e,workspaceName:n.get(e),archived:l!==void 0,cwdLabel:r.cwd?Mc(r.cwd):"-",pullRequest:r.pullRequest}),o=Se.sessions.filter(r=>!r.parentSessionId&&!r.archived&&Qr(r)===e).sort((r,l)=>new Date(l.updatedAt).getTime()-new Date(r.updatedAt).getTime()),s=Se.doneSessions.filter(r=>Qr(r)===e);return[...o.map(r=>i(r)),...s.map(r=>i(r,r.updatedAt))].slice(0,t)}function rZ(e){Zd.value;const t=new Set(hb.value),n=new Map,i=new Map;for(const o of Se.sessions.toSorted((s,r)=>new Date(r.updatedAt).getTime()-new Date(s.updatedAt).getTime())){if(o.parentSessionId||o.archived)continue;const s=Qr(o);if(e&&t.has(o.id)){i.set(s,(i.get(s)??0)+1);continue}const r={id:o.id,title:o.title,time:Vh(o.updatedAt),busy:Ph(o.id,o.mainTurnActive),pendingInteraction:o.pendingInteraction,lastTurnReason:o.lastTurnReason,updatedAt:o.updatedAt},l=n.get(s)??[];l.push(r),n.set(s,l)}return yl.value.map(o=>({workspace:o,sessions:n.get(o.id)??[],pinnedCount:i.get(o.id)??0,hasMore:Se.sessionsHasMoreByWorkspace[o.id]??!1,loadingMore:Se.sessionsLoadingMoreByWorkspace[o.id]??!1,initialCount:Se.sessionsInitialCountByWorkspace[o.id]??kg}))}const RWe=D(()=>rZ(!0)),$We=D(()=>rZ(!1)),OWe=D(()=>{Zd.value;const e=new Set(yl.value.map(o=>o.id)),t=new Map(yl.value.map(o=>[o.id,o.name])),n=Se.sessions.filter(o=>!o.parentSessionId&&!o.archived&&e.has(Qr(o)));return cse(n,hb.value).pinned.toSorted((o,s)=>new Date(s.updatedAt).getTime()-new Date(o.updatedAt).getTime()).map(o=>{const s=Qr(o);return{id:o.id,title:o.title,time:Vh(o.updatedAt),busy:Ph(o.id,o.mainTurnActive),pendingInteraction:o.pendingInteraction,lastTurnReason:o.lastTurnReason,updatedAt:o.updatedAt,workspaceId:s,workspaceName:t.get(s),pinned:!0,cwdLabel:o.cwd?Mc(o.cwd):"-",pullRequest:o.pullRequest}})});function PWe(e){q4.value=e,EP(e)}const lZ=D(()=>{const e={};for(const[t,n]of Object.entries(Se.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Se.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),sv=D(()=>{const e={};for(const[t,n]of Object.entries(Se.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Se.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),aS=D(()=>{const e={};for(const[t,n]of Object.entries(Se.unreadBySession))n&&(e[t]=!0);return e}),zWe=D(()=>{const e={},t=lZ.value;for(const n of Se.sessions){const i=t[n.id]??0;if(i<=0)continue;const o=Qr(n);e[o]=(e[o]??0)+i}return e}),jWe=D(()=>Se.recentRoots),HWe=D(()=>Se.availableOpenInApps),zt=_je(Se,{taskPoller:QK,sideChat:_i,modelProvider:hi,pushOperationFailure:rm,notify:Sh,activity:sS,sessionsKnownEmpty:eS,setSessions:Jx,updateSession:$v,upsertSessionSorted:Vje,appendSession:Kje,forgetSession:Xx,unpinSessions:AWe,setActiveSessionId:TK,nextOptimisticMsgId:jK,lastMainUserPromptText:e=>{const t=jo.pool.getEntry(e);if(t===void 0)return null;const n=t.channel.snapshot.items.findLast(i=>i.kind==="turn"&&i.origin.kind==="user");return n?.kind==="turn"?n.prompt??null:null},mainTranscriptTailTurnId:PK,mainTranscriptTailPromptCreatedAt:zK,settleIfFateProven:aZ,getEventConn:()=>zr,subscribeSessionEvents:VK,noteSessionWatermark:tS,refreshMainTranscript:async e=>{const t=jo.pool.getEntry(e);t!==void 0&&(await t.channel.settleOlder().catch(()=>{}),await jo.pool.refreshSession(e).catch(()=>{}),await jo.pool.refreshSession(e))},hasLoadedMessages:WK,resolveTaskRestId:(e,t)=>lm.value.find(n=>n.id===t)?.backgroundTaskId,whenMainTranscriptBaseline:fHe,refreshSessionStatus:fc,refreshSessionGoal:ab,refillSessionGoalOnReload:Gje,refreshSessionPlans:P1,settlePlanReviewLocally:P4,persistSessionProfile:BK,mergedWorkspaces:fb,workspacesView:yl,status:iZ,workspaceIdForSession:Qr,savePermissionToStorage:$je,savePlanModeToStorage:Qx,saveSwarmModeToStorage:SK,saveGoalModeToStorage:_K,draftModes:Rv,saveUnread:$6,saveActiveWorkspaceToStorage:jje,saveHiddenWorkspacesToStorage:zje,goalErrorMessage:dHe,initialized:LK,connectIssue:NK}),Yi=Nje({pushOperationFailure:rm,applySessionsArchivedLocally:zt.applySessionsArchivedLocally});We(()=>Se.mainView,e=>{e==="sessionAdmin"&&Yi.ensureSeeded()});function uS(e){return e===Se.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function WWe(e){Se.turnActiveBySession[e]&&delete Se.turnActiveBySession[e],Se.inFlightBySession[e]&&(Se.inFlightBySession[e]=!1)}function qWe(e,t){const n=e.metadata?.origin;if(n?.kind==="skill_activation"){const a=e.metadata?.["kimiWeb.anchorTurnId"];return JK(t.items,a,n.skillName,n.skillArgs,{terminalOnly:!0})||NHe(t.items,a,n.skillName,n.skillArgs,e.metadata?.["kimiWeb.anchorPromptCreatedAt"])}const i=e.content.filter(a=>a.type==="text").map(a=>"text"in a?a.text:"").join(""),o=e.metadata?.["kimiWeb.anchorTurnId"],s=o===void 0?-1:t.items.findIndex(a=>a.kind==="turn"&&a.turnId===o);if(o!==void 0&&s===-1)return!1;if(t.items.slice(s+1).some(a=>a.kind==="turn"&&a.state!=="running"&&((a.prompt??"")===i||i===""&&(a.attachmentIds?.length??0)>0)))return!0;const l=db(t.items,e.metadata);return t.prompts.some(a=>a.status!=="queued"&&a.status!=="running"&&(l===void 0||(l.exclusive?a.createdAt>l.at:a.createdAt>=l.at))&&YK(a.content)===i)}function s9(e,t){const n=Se.optimisticMessagesBySession[e]??[],i=n.findLast(c=>c.metadata?.["kimiWeb.uncertain"]!==!0);let o;const s=Se.promptIdBySession[e];if(vK(e).pending)o=!1;else if(s!==void 0){const c=t.prompts.find(d=>d.promptId===s);o=c!==void 0&&c.status!=="queued"&&c.status!=="running"}else Se.inFlightBySession[e]===!0?o=i===void 0||qWe(i,t):o=!0;const r=n.filter(c=>c.metadata?.["kimiWeb.uncertain"]===!0&&c.metadata?.origin?.kind!=="skill_activation"),l=n.filter(c=>c.metadata?.["kimiWeb.uncertain"]===!0&&c.metadata?.origin?.kind==="skill_activation"),a=iS(r.map(c=>({id:c.id,text:c.content.filter(d=>d.type==="text").map(d=>"text"in d?d.text:"").join(""),floor:db(t.items,c.metadata)})),t.prompts,X0.get(e)).size===r.length&&oS(l.map(c=>{const d=c.metadata?.origin;return{id:c.id,anchorTurnId:c.metadata?.["kimiWeb.anchorTurnId"],promptFloor:c.metadata?.["kimiWeb.anchorPromptCreatedAt"],skillName:d?.skillName,skillArgs:d?.skillArgs}}),t.items,ev.get(e)).size===l.length;return{settle:o,drain:o&&a}}function aZ(e){const t=jo.pool.getEntry(e);if(t===void 0||!t.baselineLoaded)return;const n=s9(e,t.channel.snapshot);n.settle&&zt.finishPromptLocal(e,{skipDrain:!n.drain})}function UA(e,t,n,i){const o=Se.promptIdBySession[e],s=Se.goalBySession[e]?.status==="active"||kc.has(e);if(i?.settleLocal!==!1){const a=Se.optimisticMessagesBySession[e];let u=[];if(a!==void 0&&a.length>0){const c=jo.pool.getEntry(e)?.channel.snapshot;if(u=a.filter(d=>{const f=d.metadata?.["kimiWeb.promptId"];if(f===void 0||c===void 0)return!1;const h=c.prompts.find(m=>m.promptId===f);if(h===void 0){const m=d.content.filter(b=>b.type==="text").map(b=>"text"in b?b.text:"").join(""),g=d.metadata?.["kimiWeb.anchorTurnId"],v=g===void 0?-1:c.items.findIndex(b=>b.kind==="turn"&&b.turnId===g);return g!==void 0&&v===-1?!0:!(v===-1?c.items:c.items.slice(v+1)).some(b=>b.kind==="turn"&&((b.prompt??"")===m||m===""&&(b.attachmentIds?.length??0)>0))}return h.status==="queued"?!0:d.metadata?.["kimiWeb.steered"]!==!0?!1:!c.items.some(m=>m.kind==="turn"&&m.steps.some(g=>g.frames.some(v=>v.kind==="text"&&v.role==="user"&&(v.promptIds?.includes(f)??!1))))}),u.length>0){const d={...Se.optimisticMessagesBySession},f=a.filter(h=>!u.includes(h));f.length>0?d[e]=f:delete d[e],Se.optimisticMessagesBySession=d}}if(zt.finishPromptLocal(e,{turnWasActive:n,retireOptimistic:"all",skipDrain:i?.drain===!1}),u.length>0){const c=Se.optimisticMessagesBySession[e]??[],d=new Set(u.map(g=>g.id)),f=new Set((a??[]).map(g=>g.id)),h=c.filter(g=>!f.has(g.id)),m=[];for(const g of a??[])(d.has(g.id)||c.some(v=>v.id===g.id))&&m.push(g);Se.optimisticMessagesBySession={...Se.optimisticMessagesBySession,[e]:[...m,...h]}}}(Se.experimentalFlags?.auto_session_title??Se.config?.experimental?.auto_session_title)===!0&&zt.maybeGenerateSessionTitle(e),tr().loadGitStatus(e),ab(e),zt.refreshSessionWarnings(e),e===Se.activeSessionId?fc(e):t==="idle"&&!s&&(Se.unreadBySession[e]=!0,$6({[e]:!0}));const r=(Se.approvalsBySession[e]??[]).length>0,l=(Se.questionsBySession[e]??[]).length>0;!s&&EPe(t,r,l)&&pd().maybeNotifyCompletion(e,{isUserWatching:uS(e),sessionTitle:Se.sessions.find(a=>a.id===e)?.title??"",promptId:o,onClick:()=>{zt.selectSession(e,{source:"notification"})}})}function M5(e,t){const n=t.questions[0],i=n?.header?.trim()??"",o=n?.question?.trim()??"",s=i&&o?`${i}: ${o}`:o||i;pd().maybeNotifyQuestion({isUserWatching:uS(e),sessionTitle:Se.sessions.find(r=>r.id===e)?.title??"",questionPreview:s,questionId:t.questionId,onClick:()=>{zt.selectSession(e,{source:"notification"})}})}function I5(e,t){pd().maybeNotifyApproval({isUserWatching:uS(e),sessionTitle:Se.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{zt.selectSession(e,{source:"notification"})}})}function Ga(){return mHe(),{workspace:bHe,sessions:wHe,activeSessionId:CHe,workspacesView:yl,workspaceSortMode:U4,visibleWorkspace:sZ,activeWorkspaceId:Ov,sessionsForView:_We,workspaceGroups:RWe,mobileWorkspaceGroups:$We,pinnedSessions:OWe,pinnedSessionIds:hb,flatSessions:IWe,flatSessionsHasMore:TWe,flatSessionsLoadingMore:D(()=>Se.flatSessionsLoadingMore),doneSessions:LWe,doneSessionsHasMore:NWe,doneSessionsLoadingMore:D(()=>Se.doneSessionsLoadingMore),activeSessionArchived:FWe,recentSessionsForWorkspace:BWe,draftEntry:D(()=>Se.draftEntry),mainView:D(()=>Se.mainView),attentionBySession:lZ,pendingBySession:sv,attentionByWorkspace:zWe,unreadBySession:aS,recentRoots:jWe,turns:XK,tasks:FHe,activeAppTasks:lm,activeRestTasks:_He,findBashCommandForTask:KK,findSubagentPromptForTask:ZK,auxiliaryTranscripts:gu,getFileUrl:zA,getSessionMediaUrl:jA,todos:RHe,goal:Bp,sessionPlans:eWe,refreshSessionPlans:P1,invalidateSessionPlans:Uje,swarms:eZ,swarmMembersByToolCallId:BHe,activationBadges:nWe,compaction:$He,status:iZ,sessionCost:dWe,fileDiff:cWe,selectedDiffPath:D(()=>tr().selectedDiffPath),fileDiffLoading:D(()=>tr().fileDiffLoading),fileDiffTexts:D(()=>tr().fileDiffTexts),fileDiffEmptyFile:D(()=>tr().fileDiffEmptyFile),changes:aWe,gitInfo:WA,gitDiffStats:uWe,activePullRequest:lWe,changesByPath:yWe,pendingApprovals:rWe,availableOpenInApps:HWe,connection:OHe,loading:PHe,sessionLoading:zHe,loadingMoreMessages:jHe,hasMoreMessages:HHe,loadMoreMessagesError:WHe,serverVersion:qHe,webTitle:tZ,documentBaseTitle:SWe,backend:VHe,dangerousBypassAuth:KHe,experimentalFlags:UHe,clearDangerousBypassAuth:ZHe,initialized:LK,connectIssue:NK,permission:GHe,thinking:QHe,planMode:nZ,planArmed:YHe,swarmMode:JHe,goalMode:XHe,queued:iWe,warnings:oWe,questions:sWe,activity:sS,turnActive:cb,activeTurnError:MHe,activeTurnRetry:IHe,inFlight:nS,working:DHe,isStartingFirstPrompt:SHe,models:hi.models,starredModelIds:hi.starredModelIds,providers:hi.providers,fontScale:gy.fontScale,setFontScale:gy.setFontScale,colorScheme:gy.colorScheme,setColorScheme:gy.setColorScheme,notifyEnabled:D(()=>pd().notifyEnabled),notifySound:D(()=>pd().notifySound),notifyPermission:D(()=>pd().notifyPermission),setNotifyEnabled:e=>pd().setNotifyEnabled(e),setNotifySound:e=>pd().setNotifySound(e),onboarded:OK,setOnboarded:Yje,load:zt.load,selectSession:zt.selectSession,clearActiveSession:zt.clearActiveSession,openSessionAdmin:e=>{e!==void 0&&Yi.applyFilters({workspaceIds:[e],status:"all",updatedFrom:"",updatedTo:""}),zt.openSessionAdmin()},closeSessionAdmin:zt.closeSessionAdmin,sessionAdminItems:D(()=>Yi.state.items),sessionAdminTotal:D(()=>Yi.state.total),sessionAdminLoading:D(()=>Yi.state.loading),sessionAdminFilters:D(()=>Yi.state.filters),sessionAdminPage:D(()=>Yi.state.page),sessionAdminPageSize:D(()=>Yi.state.pageSize),refreshSessionAdminSessions:Yi.refresh,applySessionAdminFilters:Yi.applyFilters,setSessionAdminWorkspaceFilter:Yi.setWorkspaceIds,setSessionAdminStatusFilter:Yi.setStatus,setSessionAdminTimeRange:Yi.setTimeRange,setSessionAdminPage:Yi.setPage,setSessionAdminPageSize:Yi.setPageSize,sessionAdminSelectedIds:D(()=>Yi.state.selectedIds),sessionAdminSelectedCount:D(()=>Yi.state.selectedIds.size),sessionAdminOpenSelectedIds:D(()=>Yi.selectedIdsByArchived(!1)),sessionAdminDoneSelectedIds:D(()=>Yi.selectedIdsByArchived(!0)),toggleSessionAdminSelection:Yi.toggleSelection,toggleSessionAdminPageSelection:Yi.togglePageSelection,setSessionAdminSelection:Yi.setSelection,clearSessionAdminSelection:Yi.clearSelection,selectSessionAdminAllMatching:Yi.selectAllMatching,sessionAdminAllMatching:D(()=>Yi.state.allMatching),sessionAdminMaterializingAll:D(()=>Yi.state.materializingAll),archiveSessions:Yi.archiveSessions,restoreSessions:Yi.restoreSessions,loadOlderMessages:async e=>{const t=jo.pool.getEntry(e)?.channel;t?.snapshot.hasMoreOlder===!0&&await t.loadOlder().catch(()=>{})},loadWorkspaces:zt.loadWorkspaces,loadMoreSessions:zt.loadMoreSessions,loadAllSessions:zt.loadAllSessions,ensureFlatSessions:zt.ensureFlatSessions,loadMoreFlatSessions:EWe,ensureDoneSessions:zt.ensureDoneSessions,loadMoreDoneSessions:DWe,selectWorkspace:zt.selectWorkspace,openWorkspace:zt.openWorkspace,openWorkspaceDraft:zt.openWorkspaceDraft,startSessionAndSendPrompt:zt.startSessionAndSendPrompt,startSessionAndActivateSkill:zt.startSessionAndActivateSkill,startSessionAndOpenSideChat:zt.startSessionAndOpenSideChat,getDraftPromotion:zt.getDraftPromotion,addWorkspaceByPath:zt.addWorkspaceByPath,browseFs:zt.browseFs,getFsHome:zt.getFsHome,sendPrompt:zt.sendPrompt,steerPrompt:zt.steerPrompt,steerQueued:zt.steerQueued,sideChatVisible:_i.sideChatVisible,sideChatSessionId:_i.sideChatSessionId,sideChatTurns:_i.sideChatTurns,sideChatRunning:_i.sideChatRunning,sideChatSending:_i.sideChatSending,openSideChat:_i.openSideChat,closeSideChat:_i.closeSideChat,sendSideChatPrompt:_i.sendSideChatPrompt,sideChatTargetsOfSession:_i.sideChatTargetsOfSession,sideChatTurnsOf:_i.sideChatTurnsOf,sideChatRunningOf:_i.sideChatRunningOf,sideChatSendingOf:_i.sideChatSendingOf,openSideChatOn:_i.openSideChatOn,sendSideChatPromptOn:_i.sendSideChatPromptOn,saveSideChatDraft:_i.saveSideChatDraft,sideChatDraft:_i.sideChatDraft,clearSideChatDraftIfUnchanged:_i.clearSideChatDraftIfUnchanged,uploadImage:zt.uploadImage,abortCurrentPrompt:zt.abortCurrentPrompt,respondApproval:zt.respondApproval,respondQuestion:zt.respondQuestion,dismissQuestion:zt.dismissQuestion,pendingQuestionActions:zt.pendingQuestionActions,pendingApprovalActions:zt.pendingApprovalActions,cancelTask:zt.cancelTask,detachTask:zt.detachTask,setPermission:zt.setPermission,setThinking:hi.setThinking,setPlanMode:zt.setPlanMode,togglePlanMode:zt.togglePlanMode,setSwarmMode:zt.setSwarmMode,toggleSwarmMode:zt.toggleSwarmMode,setGoalMode:zt.setGoalMode,toggleGoalMode:zt.toggleGoalMode,createGoal:zt.createGoal,controlGoal:zt.controlGoal,enqueue:zt.enqueue,dismissWarning:zt.dismissWarning,renameSession:zt.renameSession,regenerateSessionTitle:zt.regenerateSessionTitle,renameWorkspace:zt.renameWorkspace,deleteWorkspace:zt.deleteWorkspace,reorderWorkspaces:PWe,setWorkspaceSortMode:bWe,pinSession:wWe,unpinSession:CWe,togglePinSession:xWe,archiveSession:zt.archiveSession,exportSession:zt.exportSession,restoreSession:zt.restoreSession,loadArchivedSessions:zt.loadArchivedSessions,compact:zt.compact,forkSession:zt.forkSession,undo:zt.undo,unqueue:zt.unqueue,reorderQueue:zt.reorderQueue,searchFiles:zt.searchFiles,loadGitStatus:tr().loadGitStatus,loadFileDiff:tr().loadFileDiff,clearFileDiff:tr().clearFileDiff,listDir:zt.listDir,readFileContent:tr().readFileContent,readHostFileContent:zt.readHostFileContent,probeWorkspacePath:zt.probeWorkspacePath,getFileDownloadUrl:zt.getFileDownloadUrl,openWorkspaceFile:zt.openWorkspaceFile,openInApp:zt.openInApp,revealWorkspaceFile:zt.revealWorkspaceFile,resolveImageUrl:zt.resolveImageUrl,loadModels:hi.loadModels,loadProviders:hi.loadProviders,skills:AHe,skillsLoaded:xHe,activateSkill:hi.activateSkill,setModel:hi.setModel,toggleStarModel:hi.toggleStarModel,addProvider:hi.addProvider,updateProvider:hi.updateProvider,getProvider:hi.getProvider,deleteProvider:hi.deleteProvider,refreshProvider:hi.refreshProvider,refreshAllProviders:hi.refreshAllProviders,loadCatalogProviders:hi.loadCatalogProviders,importCatalogProvider:hi.importCatalogProvider,importCustomRegistry:hi.importCustomRegistry,authReady:fWe,defaultModel:hWe,managedProviderStatus:pWe,managedUserInfo:mWe,managedMembership:gWe,notify:Sh,config:vWe,loadConfig:zt.loadConfig,updateConfig:zt.updateConfig,checkAuth:zt.checkAuth,probeManagedMembership:zt.probeManagedMembership,startOAuthLogin:hi.startOAuthLogin,pollOAuthLogin:hi.pollOAuthLogin,cancelOAuthLogin:hi.cancelOAuthLogin,getOAuthRegion:hi.getOAuthRegion,getUsage:hi.getUsage,logout:zt.logout}}const UWe={class:"row"},VWe={key:0,class:"lead"},KWe={class:"left"},ZWe=["readonly","onKeydown"],GWe={key:0,class:"gen-dots","aria-hidden":"true"},QWe=["aria-label"],YWe={key:1,class:"act"},JWe={key:0,class:"ts"},XWe={key:1,class:"st"},eqe={key:1,class:"unread-dot"},tqe={key:2,class:"ha"},nqe={key:0,class:"sub"},iqe={class:"sub-text"},oqe=["aria-label"],sqe={class:"menu-time"},rqe=lt({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1},stateTag:{default:void 0}},emits:["select","rename","generateTitle","renameStateChange","archive","restore","fork","export","pin"],setup(e,{expose:t,emit:n}){const{t:i}=qt(),{sidebarTabs:o}=em(),s=e,r=n;function l(Te){const Fe=new Date(Te);if(Number.isNaN(Fe.getTime()))return Te;const Ke=rt=>String(rt).padStart(2,"0");return`${Fe.getFullYear()}-${Ke(Fe.getMonth()+1)}-${Ke(Fe.getDate())} ${Ke(Fe.getHours())}:${Ke(Fe.getMinutes())}`}const a=D(()=>s.session.updatedAt?l(s.session.updatedAt):s.session.time),u=D(()=>s.session.cwdLabel!==void 0),c=D(()=>te.value?"idle":pv({busy:s.session.busy,unread:s.unread,questionCount:s.questionCount,approvalCount:s.approvalCount,pendingInteraction:s.session.pendingInteraction,lastTurnReason:s.session.lastTurnReason})),d=D(()=>c.value==="awaiting-question"),f=D(()=>c.value==="awaiting-approval"),h=D(()=>c.value==="aborted"),m=D(()=>c.value==="running"),g=D(()=>c.value==="unread"),v=D(()=>c.value!=="idle"),y=V(!1),b=V(null),w=V({});function C(Te){const Fe=Te.target;b.value?.el?.contains(Fe)||N()}async function T(){O(),y.value=!0,setTimeout(()=>document.addEventListener("mousedown",C),0),window.addEventListener("resize",N),await ht()}function N(){y.value=!1,document.removeEventListener("mousedown",C),window.removeEventListener("resize",N)}Ln(()=>{document.removeEventListener("mousedown",C),document.removeEventListener("mousedown",B),window.removeEventListener("keydown",P,!0),window.removeEventListener("resize",N),window.removeEventListener("resize",O)});const I=D(()=>cP(s.session.title)),S=D(()=>{const Te=I.value.emoji;return Te?s.session.title.slice(Te.length):s.session.title}),_=V(!1),x=V("menu"),E=V(null),M=V({});let R=null;function q(Te,Fe,Ke){const rt=E.value?.el,Nt=4,Lt=8,Qt=rt?.offsetHeight??0,Ut=rt?.offsetWidth??0;let en=Te.bottom+Nt,it=!1;en+Qt>window.innerHeight-Lt&&(en=Math.max(Lt,Te.top-Qt-Nt),it=!0);const dt=Ke??(Fe==="left"?Te.left:Te.right-Ut),wt=Math.max(Lt,Math.min(dt,window.innerWidth-Ut-Lt)),dn=Ke===void 0?Fe:`${Math.round(Math.min(Math.max(Ke-wt,0),Ut))}px`;M.value={top:`${Math.round(en)}px`,left:`${Math.round(wt)}px`,transformOrigin:`${dn} ${it?"bottom":"top"}`,"--menu-pop-shift":it?"2px":"-2px"}}async function z(Te,Fe,Ke="left",rt){const Nt=Fe??Te?.getBoundingClientRect();if(Nt){if(_.value){O();return}N(),R=Te??null,_.value=!0,setTimeout(()=>document.addEventListener("mousedown",B),0),window.addEventListener("keydown",P,!0),window.addEventListener("resize",O),await ht(),q(Nt,Ke,rt)}}function O(){_.value=!1,R=null,document.removeEventListener("mousedown",B),window.removeEventListener("keydown",P,!0),window.removeEventListener("resize",O)}function B(Te){const Fe=Te.target;E.value?.el?.contains(Fe)||R?.contains(Fe)||O()}function P(Te){Te.key==="Escape"&&(E.value?.isComposingKeyEvent(Te)||(Te.preventDefault(),Te.stopPropagation(),O()))}function H(Te){return Te.clientX||Te.clientY?new DOMRect(Te.clientX,Te.clientY,0,0):void 0}function j(Te){Te.stopPropagation(),x.value="icon";const Fe=Te;z(Fe.currentTarget,H(Fe),"left",Fe.clientX||void 0)}function Z(Te){x.value="menu";const Fe=b.value?.el,Ke=Te,rt=H(Ke)??Fe?.getBoundingClientRect();N(),z(Fe,rt,"left",Ke.clientX||void 0)}function ie(Te,Fe){if(O(),Te===I.value.emoji)return;const Ke=Jse(s.session.title,Te);Ke&&Ke!==s.session.title&&(x.value,r("rename",s.session.id,Ke))}const W=Ga(),Q=D(()=>(W.experimentalFlags.value.auto_session_title??W.config.value?.experimental?.auto_session_title)===!0),te=V(!1),X=V(""),ge=V(null),ue=V(null),se=V(!1);let fe="",G=null;const{handleCompositionStart:ae,handleCompositionEnd:K,isComposingKeyEvent:re}=kl();async function be(){N(),O(),te.value=!0,X.value=s.session.title,await ht();try{ge.value?.focus(),ge.value?.select()}catch{}}function ke(){if(!te.value)return;const Te=X.value.trim();Te&&Te!==G&&Te!==s.session.title&&r("rename",s.session.id,Te),te.value=!1}function we(){se.value||ke()}function oe(Te){re(Te)||se.value||ke()}function le(Te){re(Te)||ye()}function ye(){se.value=!1,te.value=!1}function Ae(Te){const Fe=ue.value;if(!(Fe===null||!(Te.target instanceof Node)||Fe.contains(Te.target))){if(se.value){se.value=!1,te.value=!1;return}ke()}}We(te,Te=>{Te?document.addEventListener("pointerdown",Ae,!0):document.removeEventListener("pointerdown",Ae,!0)}),Ln(()=>document.removeEventListener("pointerdown",Ae,!0));function _e(){se.value||(se.value=!0,fe=X.value,G=null,X.value="",r("generateTitle",s.session.id,Te=>{se.value=!1,te.value&&(X.value=Te??fe,G=Te,ht(()=>{try{ge.value?.focus(),ge.value?.select()}catch{}}))}))}We(te,Te=>r("renameStateChange",Te));async function pe(Te){te.value||(Te.preventDefault(),Te.stopPropagation(),y.value&&N(),await T(),ne(Te))}function ne(Te){const Fe=b.value?.el,Ke=8,rt=Fe?.offsetHeight??0,Nt=Fe?.offsetWidth??0;let Lt=Te.clientY,Qt=!1;Lt+rt>window.innerHeight-Ke&&(Lt=Math.max(Ke,Te.clientY-rt),Qt=!0);let Ut=Te.clientX,en=!1;Ut+Nt>window.innerWidth-Ke&&(Ut=Math.max(Ke,Te.clientX-Nt),en=!0),w.value={top:`${Math.round(Lt)}px`,left:`${Math.round(Ut)}px`,transformOrigin:`${Qt?"bottom":"top"} ${en?"right":"left"}`,"--menu-pop-shift":Qt?"2px":"-2px"}}const Ee=V(!1),qe=V(!1);async function ze(){const Te=await Es(s.session.id);Ee.value=Te,qe.value=!Te,setTimeout(()=>{Ee.value=!1,qe.value=!1,N()},1500)}function ft(){N(),r("fork",s.session.id)}function gt(){N(),r("export",s.session.id)}function _t(){N(),r("pin",s.session.id)}function Pt(){N(),r("archive",s.session.id)}function Ht(){N(),r("restore",s.session.id)}t({closeMenu:N});function jt(){const Te=s.session.pullRequest?.url;Te&&window.open(Te,"_blank","noopener")}return(Te,Fe)=>(k(),L("div",{class:Re(["se",{on:e.active,flat:u.value}]),onClick:Fe[8]||(Fe[8]=Ke=>r("select",e.session.id)),onContextmenu:pe},[A("div",UWe,[u.value?ee("",!0):(k(),L("span",VWe)),A("div",KWe,[te.value?(k(),L("div",{key:0,ref_key:"renameWrapRef",ref:ue,class:Re(["rename-wrap",{generating:se.value}]),onClick:Fe[4]||(Fe[4]=Tt(()=>{},["stop"]))},[ai(A("input",{ref_key:"renameInputRef",ref:ge,"onUpdate:modelValue":Fe[0]||(Fe[0]=Ke=>X.value=Ke),class:"rename-input",readonly:se.value,onKeydown:[Qo(Tt(oe,["stop"]),["enter"]),Qo(Tt(le,["stop"]),["esc"])],onCompositionstart:Fe[1]||(Fe[1]=(...Ke)=>p(ae)&&p(ae)(...Ke)),onCompositionend:Fe[2]||(Fe[2]=(...Ke)=>p(K)&&p(K)(...Ke)),onBlur:we},null,40,ZWe),[[ur,X.value]]),se.value?(k(),L("span",GWe,[...Fe[9]||(Fe[9]=[A("i",null,null,-1),A("i",null,null,-1),A("i",null,null,-1)])])):ee("",!0),Q.value?(k(),de(p(Nn),{key:1,text:p(i)("sidebar.genTitle")},{default:ce(()=>[U(p(ln),{class:"gen-title-btn",size:"sm",label:p(i)("sidebar.genTitle"),disabled:se.value,onMousedown:Fe[3]||(Fe[3]=Tt(()=>{},["prevent","stop"])),onClick:Tt(_e,["stop"])},{default:ce(()=>[U(p(Ce),{name:"gen-title"})]),_:1},8,["label","disabled"])]),_:1},8,["text"])):ee("",!0)],2)):(k(),L("span",{key:1,class:"t",onDblclick:Tt(be,["stop"])},[I.value.emoji?(k(),L("button",{key:0,type:"button",class:"emoji","aria-label":p(i)("sidebar.setEmoji"),onClick:Tt(j,["stop"]),onDblclick:Fe[5]||(Fe[5]=Tt(()=>{},["stop"]))},F(I.value.emoji),41,QWe)):ee("",!0),$e(F(S.value),1)],32))]),te.value?ee("",!0):(k(),L("span",YWe,[U(p(Nn),{text:p(i)("workspace.awaitingAnswerTitle")},{default:ce(()=>[d.value?(k(),de(p(ul),{key:0,variant:"info",size:"sm"},{default:ce(()=>[$e(F(p(i)("workspace.awaitingAnswer")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),U(p(Nn),{text:p(i)("workspace.awaitingPermissionTitle")},{default:ce(()=>[f.value?(k(),de(p(ul),{key:0,variant:"warning",size:"sm"},{default:ce(()=>[$e(F(p(i)("workspace.awaitingPermission")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),U(p(Nn),{text:p(i)("workspace.abortedTitle")},{default:ce(()=>[h.value?(k(),de(p(ul),{key:0,variant:"danger",size:"sm"},{default:ce(()=>[$e(F(p(i)("workspace.aborted")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),v.value?m.value||g.value?(k(),L("span",XWe,[m.value?(k(),de(p(mo),{key:0,size:"sm"})):(k(),L("span",eqe))])):ee("",!0):(k(),L("span",JWe,F(e.session.time),1)),te.value?ee("",!0):(k(),L("span",tqe,[e.stateTag==="done"?(k(),de(p(Nn),{key:0,text:p(i)("sidebar.reopen")},{default:ce(()=>[U(p(ln),{class:"reopen-btn",size:"sm",label:p(i)("sidebar.reopen"),onClick:Tt(Ht,["stop"])},{default:ce(()=>[U(p(Ce),{name:"undo"})]),_:1},8,["label"])]),_:1},8,["text"])):(k(),L(De,{key:1},[U(p(Nn),{text:e.session.pinned?p(i)("sidebar.unpin"):p(i)("sidebar.pin")},{default:ce(()=>[U(p(ln),{class:"pin-btn",size:"sm",label:e.session.pinned?p(i)("sidebar.unpin"):p(i)("sidebar.pin"),onClick:Tt(_t,["stop"])},{default:ce(()=>[U(p(Ce),{name:e.session.pinned?"unpin":"pin"},null,8,["name"])]),_:1},8,["label"])]),_:1},8,["text"]),U(p(Nn),{text:p(o)?p(i)("sidebar.complete"):p(i)("sidebar.archive")},{default:ce(()=>[U(p(ln),{class:Re(p(o)?"complete-btn":"archive-btn"),size:"sm",label:p(o)?p(i)("sidebar.complete"):p(i)("sidebar.archive"),onClick:Tt(Pt,["stop"])},{default:ce(()=>[U(p(Ce),{name:p(o)?"state-done":"archive"},null,8,["name"])]),_:1},8,["class","label"])]),_:1},8,["text"])],64))]))]))]),e.session.cwdLabel!==void 0?(k(),L("div",nqe,[U(p(Ce),{class:"sub-icon",name:"folder-closed",size:"sm"}),A("span",iqe,F(e.session.cwdLabel),1),e.session.pullRequest?(k(),L("button",{key:0,type:"button",class:Re(["pr",`pr--${e.session.pullRequest.state}`]),"aria-label":`PR #${e.session.pullRequest.number}`,onClick:Tt(jt,["stop"])},[U(p(Ce),{name:"git-pull-request",size:"sm"}),A("span",null,"#"+F(e.session.pullRequest.number),1)],10,oqe)):ee("",!0)])):ee("",!0),(k(),de(cs,{to:"body"},[U(ko,{name:"menu-pop"},{default:ce(()=>[y.value?(k(),de(p(zs),{key:0,ref_key:"menuRef",ref:b,class:"menu",style:on(w.value),onClick:Fe[6]||(Fe[6]=Tt(()=>{},["stop"]))},{default:ce(()=>[U(p(nn),{danger:qe.value,onClick:ze},{default:ce(()=>[U(p(Ce),{name:"copy",size:"sm"}),$e(" "+F(qe.value?p(i)("sidebar.copyFailed"):Ee.value?p(i)("sidebar.copied"):p(i)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),U(p(nn),{separator:""}),U(p(nn),{onClick:be},{default:ce(()=>[U(p(Ce),{name:"pencil",size:"sm"}),$e(" "+F(p(i)("sidebar.rename")),1)]),_:1}),U(p(nn),{onClick:Z},{default:ce(()=>[U(p(Ce),{name:"emoji",size:"sm"}),$e(" "+F(p(i)("sidebar.setEmoji")),1)]),_:1}),U(p(nn),{onClick:ft},{default:ce(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),$e(" "+F(p(i)("sidebar.fork")),1)]),_:1}),U(p(nn),{onClick:gt},{default:ce(()=>[U(p(Ce),{name:"download",size:"sm"}),$e(" "+F(p(i)("sidebar.export")),1)]),_:1}),e.stateTag!=="done"?(k(),de(p(nn),{key:0,onClick:_t},{default:ce(()=>[U(p(Ce),{name:e.session.pinned?"unpin":"pin",size:"sm"},null,8,["name"]),$e(" "+F(e.session.pinned?p(i)("sidebar.unpin"):p(i)("sidebar.pin")),1)]),_:1})):ee("",!0),e.stateTag==="done"?(k(),de(p(nn),{key:1,onClick:Ht},{default:ce(()=>[U(p(Ce),{name:"undo",size:"sm"}),$e(" "+F(p(i)("sidebar.reopen")),1)]),_:1})):(k(),de(p(nn),{key:2,onClick:Pt},{default:ce(()=>[U(p(Ce),{name:p(o)?"state-done":"archive",size:"sm"},null,8,["name"]),$e(" "+F(p(o)?p(i)("sidebar.markDone"):p(i)("sidebar.archive")),1)]),_:1})),U(p(nn),{separator:""}),A("div",sqe,F(p(i)("sidebar.lastActive",{time:a.value})),1)]),_:1},8,["style"])):ee("",!0)]),_:1})])),(k(),de(cs,{to:"body"},[U(ko,{name:"menu-pop"},{default:ce(()=>[_.value?(k(),de(Lze,{key:0,ref_key:"pickerRef",ref:E,class:"picker",style:on(M.value),current:I.value.emoji,removable:I.value.rest.length>0,onClick:Fe[7]||(Fe[7]=Tt(()=>{},["stop"])),onPick:ie},null,8,["style","current","removable"])):ee("",!0)]),_:1})]))],34))}}),c0=xt(rqe,[["__scopeId","data-v-5086001d"]]),lqe={class:"pinned-label"},aqe={class:"pinned-title"},uqe=["draggable","onDragstart"],cqe=["aria-label","aria-valuenow","aria-valuemin","aria-valuemax"],dqe=lt({__name:"PinnedSessionList",props:{sessions:{},activeId:{},pendingBySession:{},unreadBySession:{},stateTag:{},flashSessionId:{}},emits:["selectSession","renameSession","generateSessionTitle","archiveSession","forkSession","exportSession","pinSession","dropPin","sessionDragStart","sessionDragEnd"],setup(e,{expose:t,emit:n}){const{t:i}=qt(),o=e,s=n,r=V(Jle());function l(){r.value=!r.value,Kw(r.value)}function a(){r.value&&(r.value=!1,Kw(!1))}t({expand:a});const u=D(()=>!r.value&&ise(o.sessions.length)),c=V(window.innerHeight);function d(){c.value=window.innerHeight}yn(()=>window.addEventListener("resize",d)),ti(()=>window.removeEventListener("resize",d));const f=V(null),h=V(null);function m(){return f.value?.parentElement?.nextElementSibling??null}const g=V(void 0);function v(){const Te=h.value,Fe=m();if(!Te||!Fe){g.value=void 0;return}g.value=Te.getBoundingClientRect().height+Fe.getBoundingClientRect().height}const y=V(null),b=V(null),w=V(null);function C(){const Te=m();if(!Te)return;const Fe=Te.querySelectorAll(".se"),Ke=[];let rt=0;for(let Qt=0;Qt{ht(()=>{v(),C();const Te=m();typeof ResizeObserver=="function"&&Te&&(T=new ResizeObserver(v),T.observe(Te)),typeof MutationObserver=="function"&&Te&&(N=new MutationObserver(C),N.observe(Te,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]})),Te?.addEventListener("transitionend",I)})}),ti(()=>{T?.disconnect(),N?.disconnect(),m()?.removeEventListener("transitionend",I)});const S=V(null);function _(Te){S.value=Te,Q!==null&&Te!==Q&&(R.value=!0),h.value?.style.setProperty("max-height",`${Te}px`)}const x=V(null),E=V([]);let M=!1;const R=V(ms(Cn.sidebarPinnedHeight)!==null),q=D(()=>ese(E.value)),z=D(()=>nse(b.value,w.value,y.value)),O=D(()=>sse(c.value,g.value,q.value,z.value)),{width:B,dragging:P,cursor:H,clamp:j,setWidth:Z,onPointerDown:ie}=QV({storageKey:Cn.sidebarPinnedHeight,defaultWidth:cI(window.innerHeight),min:()=>q.value,max:()=>M?I3(O.value,x.value,q.value):O.value,axis:"y",applyLive:_,persist:()=>R.value});We([c,O],()=>{R.value||(B.value=j(cI(c.value)))});let W=null,Q=null,te=!1;function X(Te){const Fe=h.value;Fe&&(C(),M=!0,W=B.value,te=R.value,Q=j(Fe.getBoundingClientRect().height),B.value=Q),ie(Te)}We(P,Te=>{if(Te)return;M=!1;const Fe=S.value;W!==null&&lse(Q,Fe)&&(B.value=j(W),R.value=te),W=null,Q=null,S.value=null});const ge=D(()=>u.value||P.value);We([h,ge,B],([Te,Fe,Ke])=>{Te&&(Fe?Te.style.setProperty("max-height",`${Ke}px`):Te.style.removeProperty("max-height"))},{immediate:!0});function ue(Te){if(Te.key!=="ArrowUp"&&Te.key!=="ArrowDown")return;Te.preventDefault(),C();const Fe=h.value,Ke=I3(O.value,Fe?.scrollHeight??null,q.value),rt=Fe?j(Fe.getBoundingClientRect().height):B.value,Nt=(Te.key==="ArrowDown"?1:-1)*(Te.shiftKey?48:16),Lt=rse(rt,Nt,Ke,q.value);Lt!==rt&&(R.value=!0,Z(Lt))}const se=D(()=>{if(S.value!==null)return S.value;const Te=x.value;return Te===null?B.value:Math.min(B.value,Te)}),fe=V(!1),G=V(!1),{thumb:ae,thumbVisible:K,update:re,markScrolling:be,onThumbPointerDown:ke,onListMouseEnter:we,onListMouseLeave:oe,onThumbMouseEnter:le,onThumbMouseLeave:ye}=YV(h);function Ae(Te=h.value){if(!Te)return;x.value=Te.scrollHeight;const Fe=[Te.children.item(0),Te.children.item(1)].map(Ke=>Ke?Ke.getBoundingClientRect().height:null);(Fe.length!==E.value.length||Fe.some((Ke,rt)=>Ke!==E.value[rt]))&&(E.value=Fe),fe.value=Te.scrollTop>0,G.value=Te.scrollTop+Te.clientHeight{Fe&&pe?.disconnect(),pe=null,Te&&typeof ResizeObserver=="function"&&(pe=new ResizeObserver(()=>Ae()),pe.observe(Te)),Te?Ae(Te):(x.value=null,E.value=[],fe.value=!1,G.value=!1,re())}),W1(()=>Ae()),ti(()=>pe?.disconnect());const{fontScale:ne}=X1();We(ne,()=>{ht(()=>{Ae(),C()})});const Ee=V(null),qe=V(null);function ze(Te,Fe){if(!Fe.dataTransfer)return;Fe.dataTransfer.effectAllowed="move",Fe.dataTransfer.setData("text/plain",Te),Ee.value=Te;const Ke=o.sessions.find(rt=>rt.id===Te)?.workspaceId;Ke!==void 0&&s("sessionDragStart",Te,Ke)}function ft(){Ee.value=null,s("sessionDragEnd")}We(()=>o.sessions,Te=>{Ee.value!==null&&!Te.some(Fe=>Fe.id===Ee.value)&&(Ee.value=null)});const gt=V(!1);function _t(Te){return Te.dataTransfer?.types.includes(D9)??!1}function Pt(Te){_t(Te)&&(Te.preventDefault(),Te.dataTransfer&&(Te.dataTransfer.dropEffect="move"),gt.value=!0)}function Ht(Te){gt.value=!1;const Fe=Te.dataTransfer?.getData(D9);Fe&&s("dropPin",Fe)}function jt(Te){Te.currentTarget.contains(Te.relatedTarget)||(gt.value=!1)}return(Te,Fe)=>(k(),L("div",{ref_key:"pinnedRootEl",ref:f,class:Re(["pinned",{"drop-active":gt.value}]),onDragover:Pt,onDrop:Ht,onDragleave:jt},[A("div",lqe,[A("span",aqe,F(p(i)("sidebar.pinned")),1),U(p(ln),{class:Re(["pinned-toggle",{"pinned-toggle--on":r.value}]),size:"sm",label:r.value?p(i)("sidebar.expandPinned"):p(i)("sidebar.collapsePinned"),tooltip:r.value?p(i)("sidebar.expandPinned"):p(i)("sidebar.collapsePinned"),onClick:Tt(l,["stop"])},{default:ce(()=>[r.value?(k(),de(p(Ce),{key:0,name:"chevron-right"})):(k(),de(p(Ce),{key:1,name:"chevron-down"}))]),_:1},8,["class","label","tooltip"])]),r.value?ee("",!0):(k(),L("div",{key:0,class:Re(["pinned-rows-wrap",{scrolled:fe.value,"more-below":G.value}]),onMouseenter:Fe[10]||(Fe[10]=(...Ke)=>p(we)&&p(we)(...Ke)),onMouseleave:Fe[11]||(Fe[11]=(...Ke)=>p(oe)&&p(oe)(...Ke))},[A("div",{ref_key:"pinnedRowsEl",ref:h,class:"pinned-rows",onScroll:_e},[(k(!0),L(De,null,Ct(e.sessions,Ke=>(k(),L("div",{key:Ke.id,class:Re(["pin-row",{dragging:Ee.value===Ke.id}]),draggable:qe.value!==Ke.id,onDragstart:rt=>ze(Ke.id,rt),onDragend:ft},[U(c0,{session:Ke,active:Ke.id===e.activeId,"approval-count":e.pendingBySession[Ke.id]?.approvals??0,"question-count":e.pendingBySession[Ke.id]?.questions??0,unread:e.unreadBySession[Ke.id]??!1,"state-tag":o.stateTag,"data-session-id":Ke.id,class:Re({"se-locate-flash":e.flashSessionId===Ke.id}),onRenameStateChange:rt=>qe.value=rt?Ke.id:null,onSelect:Fe[0]||(Fe[0]=rt=>s("selectSession",rt)),onRename:Fe[1]||(Fe[1]=(rt,Nt)=>s("renameSession",rt,Nt)),onGenerateTitle:Fe[2]||(Fe[2]=(rt,Nt)=>s("generateSessionTitle",rt,Nt)),onArchive:Fe[3]||(Fe[3]=rt=>s("archiveSession",rt)),onFork:Fe[4]||(Fe[4]=rt=>s("forkSession",rt)),onExport:Fe[5]||(Fe[5]=rt=>s("exportSession",rt)),onPin:Fe[6]||(Fe[6]=rt=>s("pinSession",rt))},null,8,["session","active","approval-count","question-count","unread","state-tag","data-session-id","class","onRenameStateChange"])],42,uqe))),128))],544),Fe[12]||(Fe[12]=A("span",{class:"pinned-seam pinned-seam--top","aria-hidden":"true"},null,-1)),Fe[13]||(Fe[13]=A("span",{class:"pinned-seam pinned-seam--bottom","aria-hidden":"true"},null,-1)),p(ae)?(k(),L("span",{key:0,class:Re(["pinned-thumb",{visible:p(K)}]),style:on({top:`${p(ae).top}px`,height:`${p(ae).height}px`}),"aria-hidden":"true",onPointerdown:Fe[7]||(Fe[7]=(...Ke)=>p(ke)&&p(ke)(...Ke)),onMouseenter:Fe[8]||(Fe[8]=(...Ke)=>p(le)&&p(le)(...Ke)),onMouseleave:Fe[9]||(Fe[9]=(...Ke)=>p(ye)&&p(ye)(...Ke))},null,38)):ee("",!0)],34)),ge.value?(k(),L("div",{key:1,class:Re(["pinned-resize",{dragging:p(P)}]),style:on({cursor:p(H)}),role:"separator","aria-orientation":"horizontal","aria-label":p(i)("sidebar.resizePinnedAria"),"aria-valuenow":Math.round(se.value),"aria-valuemin":q.value,"aria-valuemax":p(I3)(O.value,x.value,q.value),tabindex:"0",onPointerdown:X,onKeydown:ue},[...Fe[14]||(Fe[14]=[A("span",{class:"pinned-resize-bar","aria-hidden":"true"},null,-1)])],46,cqe)):ee("",!0)],34))}}),fqe=xt(dqe,[["__scopeId","data-v-7139df48"]]);function FB(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue(e);return Number.parseFloat(n)||t}function hqe(e){return e?FB("--resize-handle-step-lg",48):FB("--resize-handle-step",16)}const pqe=["aria-label","aria-valuenow","aria-valuemin","aria-valuemax"],mqe=lt({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{},applyLive:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),{width:s,dragging:r,cursor:l,setWidth:a,onPointerDown:u}=QV({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse,applyLive:n.applyLive});i("update:width",s.value),We(s,d=>i("update:width",d)),We(r,d=>i("update:dragging",d));function c(d){if(d.key!=="ArrowLeft"&&d.key!=="ArrowRight")return;d.preventDefault();const f=d.key==="ArrowRight"?1:-1,h=n.reverse?-f:f;a(s.value+h*hqe(d.shiftKey))}return(d,f)=>(k(),L("div",{class:Re(["rh",{dragging:p(r)}]),style:on({cursor:p(l)}),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??p(o)("layout.resizeHandleAria"),"aria-valuenow":Math.round(p(s)),"aria-valuemin":e.min,"aria-valuemax":e.max,tabindex:"0",onPointerdown:f[0]||(f[0]=(...h)=>p(u)&&p(u)(...h)),onKeydown:c},[...f[1]||(f[1]=[A("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],46,pqe))}}),uZ=xt(mqe,[["__scopeId","data-v-c42027cd"]]),gqe={key:0,class:"actions"},vqe=["onClick"],yqe=["onClick"],kqe={key:1,class:"details"},bqe=lt({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt();function s(x){return typeof x=="object"&&x!==null}function r(x){return s(x)?x.title:x}function l(x){return s(x)?x.message??"":""}function a(x){return s(x)?x.details:void 0}function u(x){return s(x)?x.severity==="error":x.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function c(x){return s(x)?x.severity==="error"?"danger":x.severity==="success"?"success":x.severity==="info"?"info":"warning":u(x)?"danger":"warning"}function d(x){return s(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function f(x){if(!s(x))return x;const E=[x.title];x.message&&E.push(x.message);const M=x.details??[];if(M.length>0){E.push("",`${o("warnings.diagnostics")}:`);for(const R of M)E.push(`${R.label}: ${R.value}`)}return E.join(` -`)}let h=1;const m=V([]),g=new Map,v=new Map;function y(x){const E=u(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function b(x,E){const M=g.get(x)??{handle:null,deadline:0,remaining:0};M.handle=setTimeout(()=>_(x),E),M.deadline=Date.now()+E,g.set(x,M)}function w(x){const E=g.get(x);E&&E.handle!==null&&clearTimeout(E.handle),g.delete(x)}function C(x){const E=g.get(x);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function T(x){if(m.value.find(R=>R.id===x)?.detailsOpen)return;const M=g.get(x);!M||M.handle!==null||b(x,M.remaining)}const N=D(()=>rr.value+Mp.value>0);We(N,x=>{for(const E of m.value)x?C(E.id):T(E.id)});function I(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?C(x.id):T(x.id)}async function S(x){if(!await Es(f(x.warning)))return;x.copied=!0;const M=v.get(x.id);M&&clearTimeout(M),v.set(x.id,setTimeout(()=>{x.copied=!1,v.delete(x.id)},1400))}function _(x){w(x);const E=v.get(x);E&&clearTimeout(E),v.delete(x);const M=m.value.findIndex(R=>R.id===x);M!==-1&&(m.value=m.value.filter(R=>R.id!==x),i("dismiss",M))}return We(()=>n.warnings,x=>{const E=[...m.value];m.value=x.map(M=>{const R=d(M),q=E.findIndex(B=>B.key===R),z=q===-1?void 0:E.splice(q,1)[0];if(z)return z.warning=M,z;const O={id:h++,key:R,warning:M,detailsOpen:!1,copied:!1};return b(O.id,y(M)),N.value&&C(O.id),O});for(const M of E){w(M.id);const R=v.get(M.id);R&&clearTimeout(R),v.delete(M.id)}},{immediate:!0,flush:"post"}),Ln(()=>{g.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),g.clear(),v.forEach(x=>clearTimeout(x)),v.clear()}),(x,E)=>(k(),de(U$,{name:"toast",tag:"div",class:Re(["toasts",{"below-overlay":N.value}]),role:"status","aria-live":"polite"},{default:ce(()=>[(k(!0),L(De,null,Ct(m.value,M=>(k(),de(p(Zie),{key:M.id,variant:c(M.warning),title:r(M.warning),message:l(M.warning),"dismiss-label":p(o)("warnings.dismiss"),onDismiss:R=>_(M.id),onPointerenter:R=>C(M.id),onPointerleave:R=>T(M.id)},{default:ce(()=>[a(M.warning)?.length?(k(),L("div",gqe,[A("button",{class:"link",type:"button",onClick:R=>I(M)},F(M.detailsOpen?p(o)("warnings.hideDetails"):p(o)("warnings.showDetails")),9,vqe),A("button",{class:"link",type:"button",onClick:R=>S(M)},F(M.copied?p(o)("warnings.copied"):p(o)("warnings.copyDetails")),9,yqe)])):ee("",!0),M.detailsOpen&&a(M.warning)?.length?(k(),L("dl",kqe,[(k(!0),L(De,null,Ct(a(M.warning),R=>(k(),L("div",{key:`${R.label}:${R.value}`,class:"detail-row"},[A("dt",null,F(R.label),1),A("dd",null,F(R.value),1)]))),128))])):ee("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1},8,["class"]))}}),wqe=xt(bqe,[["__scopeId","data-v-f46ca0b3"]]),Cqe=["draggable"],Aqe={class:"gh-top"},xqe={class:"gh-name"},Sqe=["inert"],_qe={key:0,class:"show-more-row"},Mqe=["disabled"],Iqe={class:"show-more-label"},Tqe={key:1,class:"show-more-sep","aria-hidden":"true"},Eqe={class:"show-more-label"},Lqe={key:1,class:"group-empty"},Nqe=lt({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},sortable:{type:Boolean},isCollapsed:{type:Function},visibleLimit:{type:Function},flashSessionId:{},pinnedDragSession:{},stateTag:{}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","generateSessionTitle","archiveSession","forkSession","exportSession","pinSession","dropPinnedSession","expand","collapse","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t,s=D({get:()=>i.renameValue,set:x=>o("updateRenameValue",x)}),r=V(!1),l=D(()=>i.pinnedDragSession!=null),a=D(()=>i.pinnedDragSession?.workspaceId===i.group.workspace.id);function u(x){if(i.pinnedDragSession!=null){if(!a.value){x.dataTransfer&&(x.dataTransfer.dropEffect="none");return}x.preventDefault(),x.dataTransfer&&(x.dataTransfer.dropEffect="move"),r.value=!0}}function c(x){i.pinnedDragSession==null||!a.value||(x.preventDefault(),r.value=!1,o("dropPinnedSession",i.pinnedDragSession.id))}function d(x){x.currentTarget.contains(x.relatedTarget)||(r.value=!1)}const f=D(()=>i.visibleLimit(i.group.workspace.id)??i.group.initialCount),h=D(()=>{const x=i.group.sessions.slice(0,f.value);if(i.activeId&&!x.some(E=>E.id===i.activeId)){const E=i.group.sessions.find(M=>M.id===i.activeId);if(E)return[...x,E]}return x}),m=D(()=>i.group.sessions.length>f.value||i.group.hasMore||i.group.loadingMore),g=D(()=>f.value>i.group.initialCount);function v(x){i.renameInputRef.value=x instanceof HTMLInputElement?x:null}const{handleCompositionStart:y,handleCompositionEnd:b,isComposingKeyEvent:w}=kl();function C(x){w(x)||o("confirmRename")}function T(x){w(x)||o("cancelRename")}const N=V(null);function I(x){i.renamingId!==i.group.workspace.id&&o("groupContextmenu",i.group.workspace,x)}function S(x){i.sortable!==!1&&x.dataTransfer&&(x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",i.group.workspace.id),o("wsDragstart",i.group.workspace.id))}function _(x,E){E.dataTransfer&&(E.dataTransfer.effectAllowed="move",E.dataTransfer.setData(D9,x),E.dataTransfer.setData("text/plain",x))}return(x,E)=>(k(),L("div",{class:Re(["group",{dragging:e.dragging,"pinned-drag-active":l.value&&a.value,"pinned-drop-hover":r.value,"pinned-drop-blocked":l.value&&!a.value}]),onDragover:u,onDrop:c,onDragleave:d},[A("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId&&e.activeId==="",collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:e.sortable!==!1&&e.renamingId!==e.group.workspace.id,onClick:E[7]||(E[7]=Tt(M=>o("groupClick",e.group.workspace.id,M),["stop"])),onContextmenu:I,onDragstart:S,onDragend:E[8]||(E[8]=M=>o("wsDragend"))},[A("div",Aqe,[e.isCollapsed(e.group.workspace.id)?(k(),de(p(Ce),{key:0,class:"gh-folder",name:"folder-closed"})):(k(),de(p(Ce),{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(k(),de(p(Nn),{key:2,text:e.group.workspace.root},{default:ce(()=>[A("span",xqe,F(e.group.workspace.name),1)]),_:1},8,["text"])):ai((k(),L("input",{key:3,ref:v,"onUpdate:modelValue":E[0]||(E[0]=M=>s.value=M),class:"gh-rename",type:"text",onKeydown:[Qo(C,["enter"]),Qo(T,["esc"])],onCompositionstart:E[1]||(E[1]=(...M)=>p(y)&&p(y)(...M)),onCompositionend:E[2]||(E[2]=(...M)=>p(b)&&p(b)(...M)),onBlur:E[3]||(E[3]=M=>o("cancelRename")),onClick:E[4]||(E[4]=Tt(()=>{},["stop"]))},null,544)),[[ur,s.value]]),e.renamingId!==e.group.workspace.id?(k(),L("div",{key:4,class:Re(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[U(p(ln),{class:Re(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:p(n)("sidebar.options"),tooltip:p(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:E[5]||(E[5]=Tt(M=>o("toggleWsMenu",e.group.workspace,M),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"dots-horizontal"})]),_:1},8,["class","label","tooltip","aria-expanded"]),U(p(ln),{class:"gh-add",size:"sm",label:p(n)("workspace.newInGroup"),tooltip:p(n)("workspace.newInGroup"),onClick:E[6]||(E[6]=Tt(M=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"chat-new"})]),_:1},8,["label","tooltip"])],2)):ee("",!0)])],42,Cqe),A("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(k(!0),L(De,null,Ct(h.value,M=>(k(),de(c0,{key:M.id,session:M,active:M.id===e.activeId,"approval-count":e.pendingBySession[M.id]?.approvals??0,"question-count":e.pendingBySession[M.id]?.questions??0,unread:e.unreadBySession[M.id]??!1,"state-tag":i.stateTag,draggable:N.value!==M.id,"data-session-id":M.id,class:Re({"se-locate-flash":e.flashSessionId===M.id}),onDragstart:R=>_(M.id,R),onRenameStateChange:R=>N.value=R?M.id:null,onSelect:E[9]||(E[9]=R=>o("selectSession",R)),onRename:E[10]||(E[10]=(R,q)=>o("renameSession",R,q)),onGenerateTitle:E[11]||(E[11]=(R,q)=>o("generateSessionTitle",R,q)),onArchive:E[12]||(E[12]=R=>o("archiveSession",R)),onFork:E[13]||(E[13]=R=>o("forkSession",R)),onExport:E[14]||(E[14]=R=>o("exportSession",R)),onPin:E[15]||(E[15]=R=>o("pinSession",R))},null,8,["session","active","approval-count","question-count","unread","state-tag","draggable","data-session-id","class","onDragstart","onRenameStateChange"]))),128)),m.value||g.value?(k(),L("div",_qe,[m.value?(k(),L("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:E[16]||(E[16]=Tt(M=>o("expand",e.group.workspace.id),["stop"]))},[U(p(Ce),{name:"chevron-down",size:"sm"}),A("span",Iqe,F(e.group.loadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,Mqe)):ee("",!0),m.value&&g.value?(k(),L("span",Tqe,"·")):ee("",!0),g.value?(k(),L("button",{key:2,class:"show-more",onClick:E[17]||(E[17]=Tt(M=>o("collapse",e.group.workspace.id),["stop"]))},[U(p(Ce),{name:"chevron-up",size:"sm"}),A("span",Eqe,F(p(n)("sidebar.showLess")),1)])):ee("",!0)])):ee("",!0),e.group.sessions.length===0?(k(),L("div",Lqe,F(e.group.pinnedCount>0?p(n)("sidebar.allPinned",{count:e.group.pinnedCount}):p(n)("sidebar.noSessions")),1)):ee("",!0)],10,Sqe)],34))}}),Dqe=xt(Nqe,[["__scopeId","data-v-643ef903"]]),Fqe=["aria-label"],Bqe={class:"sa-select-label"},Rqe={class:"sa-check"},$qe=lt({__name:"FilterSelect",props:{modelValue:{},options:{},ariaLabel:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=e,o=n,s=V(null),{open:r,menuStyle:l,toggle:a,close:u}=kS(s);t({open:r});const c=D(()=>i.options.find(f=>f.value===i.modelValue)?.label??"");function d(f){f!==i.modelValue&&o("update:modelValue",f),u()}return(f,h)=>(k(),L(De,null,[A("button",{class:Re(["sa-select",{"is-open":p(r)}]),type:"button","aria-label":e.ariaLabel,onClick:h[0]||(h[0]=(...m)=>p(a)&&p(a)(...m))},[A("span",Bqe,F(c.value),1),U(p(Ce),{class:"sa-select-chev",name:"chevron-down",size:"sm"})],10,Fqe),U(ko,{name:"menu-pop"},{default:ce(()=>[p(r)?(k(),de(p(zs),{key:0,ref_key:"menuRef",ref:s,class:"sa-menu",style:on(p(l)),onClick:h[1]||(h[1]=Tt(()=>{},["stop"]))},{default:ce(()=>[(k(!0),L(De,null,Ct(e.options,m=>(k(),de(p(nn),{key:m.value,onClick:g=>d(m.value)},{default:ce(()=>[A("span",Rqe,[m.value===e.modelValue?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),m.dot?(k(),L("span",{key:0,class:Re(["sa-dot",`sa-dot--${m.dot}`])},null,2)):ee("",!0),$e(" "+F(m.label),1)]),_:2},1032,["onClick"]))),128))]),_:1},8,["style"])):ee("",!0)]),_:1})],64))}}),VA=xt($qe,[["__scopeId","data-v-d0588d0e"]]),Oqe=["aria-label","onKeydown"],Pqe={class:"sa-tag-name"},zqe=["aria-label","onClick"],jqe={key:0,class:"sa-tag-more"},Hqe={key:1,class:"sa-select-label"},Wqe={class:"sa-search"},qqe=["placeholder","aria-label"],Uqe={class:"sa-opts"},Vqe={class:"sa-ws-name"},Kqe={key:0,class:"sa-menu-empty"},Zqe=lt({__name:"MultiSelectMenu",props:{options:{},modelValue:{},ariaLabel:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=qt(),r=V(null),{open:l,menuStyle:a,toggle:u}=kS(r);t({open:l});const c=D(()=>new Set(i.modelValue)),d=D(()=>i.options.length>0&&c.value.size===i.options.length),f=D(()=>i.options.filter(I=>c.value.has(I.id))),h=D(()=>f.value.slice(0,2)),m=D(()=>f.value.length-h.value.length),g=V(""),v=V(null),y=D(()=>{const I=g.value.trim().toLowerCase();return I===""?i.options:i.options.filter(S=>S.name.toLowerCase().includes(I))});We(l,I=>{I?ht(()=>v.value?.focus()):g.value=""});function b(I){o("update:modelValue",i.options.filter(S=>I.has(S.id)).map(S=>S.id))}function w(I){const S=new Set(c.value);S.has(I)?S.delete(I):S.add(I),b(S)}function C(I){const S=new Set(c.value);S.delete(I),b(S)}function T(){b(d.value?new Set:new Set(i.options.map(I=>I.id)))}function N(I){u(I)}return(I,S)=>(k(),L(De,null,[A("div",{class:Re(["sa-select",{"is-open":p(l)}]),role:"button",tabindex:"0","aria-label":e.ariaLabel,onClick:S[2]||(S[2]=(..._)=>p(u)&&p(u)(..._)),onKeydown:[Qo(Tt(N,["prevent"]),["enter"]),Qo(Tt(N,["prevent"]),["space"])]},[f.value.length>0?(k(),L(De,{key:0},[(k(!0),L(De,null,Ct(h.value,_=>(k(),L("span",{key:_.id,class:"sa-tag"},[A("span",Pqe,F(_.name),1),A("button",{class:"sa-tag-x",type:"button","aria-label":p(s)("admin.removeTag",{name:_.name}),onClick:Tt(x=>C(_.id),["stop"]),onKeydown:[S[0]||(S[0]=Qo(Tt(()=>{},["stop"]),["enter"])),S[1]||(S[1]=Qo(Tt(()=>{},["stop"]),["space"]))]},[U(p(Ce),{name:"close",size:"sm"})],40,zqe)]))),128)),m.value>0?(k(),L("span",jqe,"+"+F(m.value),1)):ee("",!0)],64)):(k(),L("span",Hqe,F(p(s)("admin.allWorkspaces")),1)),U(p(Ce),{class:"sa-select-chev",name:"chevron-down",size:"sm"})],42,Oqe),U(ko,{name:"menu-pop"},{default:ce(()=>[p(l)?(k(),de(p(zs),{key:0,ref_key:"menuRef",ref:r,class:"sa-menu",style:on(p(a)),role:"dialog",onClick:S[4]||(S[4]=Tt(()=>{},["stop"]))},{default:ce(()=>[A("div",Wqe,[U(p(Ce),{name:"search",size:"sm"}),ai(A("input",{ref_key:"searchRef",ref:v,"onUpdate:modelValue":S[3]||(S[3]=_=>g.value=_),class:"sa-search-input",type:"text",placeholder:p(s)("admin.searchWorkspace"),"aria-label":p(s)("admin.searchWorkspace")},null,8,qqe),[[ur,g.value]])]),U(p(nn),{role:"button",active:d.value,onClick:T},{default:ce(()=>[$e(F(p(s)("admin.selectAll")),1)]),_:1},8,["active"]),U(p(nn),{separator:""}),A("div",Uqe,[(k(!0),L(De,null,Ct(y.value,_=>(k(),de(p(nn),{key:_.id,role:"button",active:c.value.has(_.id),onClick:x=>w(_.id)},{default:ce(()=>[A("span",Vqe,F(_.name),1)]),_:2},1032,["active","onClick"]))),128)),y.value.length===0?(k(),L("div",Kqe,F(p(s)("admin.noWorkspaceMatch")),1)):ee("",!0)])]),_:1},8,["style"])):ee("",!0)]),_:1})],64))}}),Gqe=xt(Zqe,[["__scopeId","data-v-967a19b0"]]),Qqe={class:"sa-menu-head"},Yqe=lt({__name:"SessionAdminMenu",props:{mode:{},targetArchived:{type:Boolean},counts:{}},emits:["action"],setup(e,{expose:t,emit:n}){const i=n,{t:o}=qt(),s=V(null),{open:r,menuStyle:l,toggleAnchored:a,openAt:u,close:c}=kS(s);function d(f){c(),i("action",f)}return t({openAt:u,toggleAnchored:a,close:c}),(f,h)=>(k(),de(ko,{name:"menu-pop"},{default:ce(()=>[p(r)?(k(),de(p(zs),{key:0,ref_key:"menuRef",ref:s,class:"sa-menu",style:on(p(l)),onClick:h[11]||(h[11]=Tt(()=>{},["stop"]))},{default:ce(()=>[e.mode==="single"?(k(),L(De,{key:0},[U(p(nn),{onClick:h[0]||(h[0]=m=>d("open"))},{default:ce(()=>[U(p(Ce),{name:"external-link",size:"sm"}),$e(" "+F(p(o)("admin.open")),1)]),_:1}),U(p(nn),{onClick:h[1]||(h[1]=m=>d("rename"))},{default:ce(()=>[U(p(Ce),{name:"pencil",size:"sm"}),$e(" "+F(p(o)("admin.rename")),1)]),_:1}),U(p(nn),{onClick:h[2]||(h[2]=m=>d("fork"))},{default:ce(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),$e(" "+F(p(o)("admin.fork")),1)]),_:1}),U(p(nn),{onClick:h[3]||(h[3]=m=>d("export"))},{default:ce(()=>[U(p(Ce),{name:"download",size:"sm"}),$e(" "+F(p(o)("admin.export")),1)]),_:1}),U(p(nn),{separator:""}),e.targetArchived?(k(),de(p(nn),{key:0,onClick:h[4]||(h[4]=m=>d("restore"))},{default:ce(()=>[U(p(Ce),{name:"undo",size:"sm"}),$e(" "+F(p(o)("admin.reopen")),1)]),_:1})):(k(),de(p(nn),{key:1,onClick:h[5]||(h[5]=m=>d("archive"))},{default:ce(()=>[U(p(Ce),{name:"state-done",size:"sm"}),$e(" "+F(p(o)("admin.markDone")),1)]),_:1}))],64)):e.mode==="rowActions"?(k(),L(De,{key:1},[U(p(nn),{onClick:h[6]||(h[6]=m=>d("rename"))},{default:ce(()=>[U(p(Ce),{name:"pencil",size:"sm"}),$e(" "+F(p(o)("admin.rename")),1)]),_:1}),U(p(nn),{onClick:h[7]||(h[7]=m=>d("fork"))},{default:ce(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),$e(" "+F(p(o)("admin.fork")),1)]),_:1}),U(p(nn),{onClick:h[8]||(h[8]=m=>d("export"))},{default:ce(()=>[U(p(Ce),{name:"download",size:"sm"}),$e(" "+F(p(o)("admin.export")),1)]),_:1})],64)):(k(),L(De,{key:2},[A("div",Qqe,F(p(o)("admin.batchSelected",{n:e.counts?.total??0})),1),U(p(nn),{disabled:(e.counts?.open??0)===0,onClick:h[9]||(h[9]=m=>d("archive"))},{default:ce(()=>[U(p(Ce),{name:"state-done",size:"sm"}),$e(" "+F(p(o)("admin.markDoneCount",{n:e.counts?.open??0})),1)]),_:1},8,["disabled"]),U(p(nn),{disabled:(e.counts?.done??0)===0,onClick:h[10]||(h[10]=m=>d("restore"))},{default:ce(()=>[U(p(Ce),{name:"undo",size:"sm"}),$e(" "+F(p(o)("admin.reopenCount",{n:e.counts?.done??0})),1)]),_:1},8,["disabled"])],64))]),_:1},8,["style"])):ee("",!0)]),_:1}))}}),Jqe=xt(Yqe,[["__scopeId","data-v-b35c02be"]]),Xqe={class:"sa-pager"},eUe={class:"sa-total"},tUe={class:"sa-pager-right"},nUe={key:0,class:"sa-pages"},iUe=["disabled","title","aria-label"],oUe={key:0,class:"sa-ellipsis"},sUe=["onClick"],rUe=["disabled","title","aria-label"],lUe=lt({__name:"SessionAdminPagination",props:{page:{},pageSize:{},total:{}},emits:["update:page","update:pageSize"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=[10,20,50,100],r=D(()=>Math.max(1,Math.ceil(n.total/n.pageSize))),l=D(()=>Fst(n.page,r.value)),a=D(()=>s.map(c=>({value:String(c),label:o("admin.pageSize",{n:c})}))),u=D({get:()=>String(n.pageSize),set:c=>i("update:pageSize",Number(c))});return(c,d)=>(k(),L("div",Xqe,[A("span",eUe,F(p(o)("admin.total",{n:e.total})),1),A("div",tUe,[U(VA,{modelValue:u.value,"onUpdate:modelValue":d[0]||(d[0]=f=>u.value=f),options:a.value,"aria-label":p(o)("admin.pageSize",{n:e.pageSize})},null,8,["modelValue","options","aria-label"]),e.total>0?(k(),L("div",nUe,[A("button",{class:"sa-pg",type:"button",disabled:e.page===1,title:p(o)("admin.prevPage"),"aria-label":p(o)("admin.prevPage"),onClick:d[1]||(d[1]=f=>i("update:page",e.page-1))},[U(p(Ce),{name:"chevron-left",size:"sm"})],8,iUe),(k(!0),L(De,null,Ct(l.value,(f,h)=>(k(),L(De,{key:h},[f==="…"?(k(),L("span",oUe,"…")):(k(),L("button",{key:1,class:Re(["sa-pg",{cur:f===e.page}]),type:"button",onClick:m=>i("update:page",f)},F(f),11,sUe))],64))),128)),A("button",{class:"sa-pg",type:"button",disabled:e.page===r.value,title:p(o)("admin.nextPage"),"aria-label":p(o)("admin.nextPage"),onClick:d[2]||(d[2]=f=>i("update:page",e.page+1))},[U(p(Ce),{name:"chevron-right",size:"sm"})],8,rUe)])):ee("",!0)])]))}}),aUe=xt(lUe,[["__scopeId","data-v-d8059995"]]),uUe={key:0},cUe={class:"sa-col-cb"},dUe=["aria-label"],fUe={key:0,colspan:"7",class:"sa-batch"},hUe={class:"sa-batch-inner"},pUe={class:"sa-batch-count"},mUe=["disabled"],gUe=["disabled"],vUe=["disabled"],yUe={class:"sa-c-time"},kUe={class:"sa-c-time"},bUe=["onContextmenu"],wUe={class:"sa-col-cb"},CUe=["aria-label","onClick"],AUe=["onKeydown","onBlur"],xUe=["title"],SUe={class:"sa-ws"},_Ue=["title"],MUe={class:"sa-c-time"},IUe={class:"sa-time sa-time--full"},TUe={class:"sa-time sa-time--compact"},EUe={class:"sa-c-time"},LUe={class:"sa-time sa-time--full"},NUe={class:"sa-time sa-time--compact"},DUe={key:1,class:"sa-time sa-none"},FUe={class:"sa-act"},BUe={key:1,class:"sa-state"},RUe={key:2,class:"sa-state"},$Ue={class:"sa-empty"},OUe=lt({__name:"SessionAdminTable",props:{items:{},total:{},loading:{type:Boolean},workspaces:{},batchRunning:{}},emits:["archiveSessions","restoreSessions"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=Ga(),r=D(()=>new Map(n.workspaces.map(H=>[H.id,H.name])));function l(H){return H.meta.title??H.meta.last_prompt??H.id.slice(0,12)}function a(H){const j=r.value.get(H.workspace.id);return j!==void 0?j:H.workspace.cwd!==null?Mc(H.workspace.cwd):"—"}function u(H){return H.meta.archived?YB(H.meta.archived_at??H.meta.updated_at):null}function c(H){return H.meta.archived?JB(H.meta.archived_at??H.meta.updated_at):null}const d=D(()=>s.sessionAdminSelectedIds.value),f=D(()=>s.sessionAdminSelectedCount.value),h=D(()=>s.sessionAdminOpenSelectedIds.value),m=D(()=>s.sessionAdminDoneSelectedIds.value),g=D(()=>s.sessionAdminAllMatching.value),v=D(()=>s.sessionAdminMaterializingAll.value),y=D(()=>({total:f.value,open:h.value.length,done:m.value.length})),b=D(()=>n.items.map(H=>({id:H.id,archived:H.meta.archived}))),w=D(()=>b.value.length>0&&b.value.every(H=>d.value.has(H.id))),C=D(()=>!w.value&&b.value.some(H=>d.value.has(H.id)));function T(){s.toggleSessionAdminPageSelection(b.value)}const N=V(null),I=V(""),S=V(null);function _(H){N.value=H.id,I.value=l(H),ht(()=>{S.value?.focus(),S.value?.select()})}async function x(H){if(N.value!==H.id)return;const j=I.value.trim();N.value=null,!(j===""||j===l(H))&&(await s.renameSession(H.id,j),await s.refreshSessionAdminSessions())}function E(H,j){H.stopPropagation(),H.key==="Enter"?x(j):H.key==="Escape"&&(N.value=null)}const M=V("single"),R=V(null),q=V(null);function z(H,j){j.preventDefault(),d.value.has(H.id)&&d.value.size>1?(M.value="multi",R.value=null):(s.setSessionAdminSelection([{id:H.id,archived:H.meta.archived}]),M.value="single",R.value=H),q.value?.openAt(j.clientX,j.clientY)}function O(H,j){M.value="rowActions",R.value=H,q.value?.toggleAnchored(j,"right")}function B(H){H.meta.archived?i("restoreSessions",[H.id]):i("archiveSessions",[H.id])}function P(H){if(M.value==="multi"){H==="archive"?i("archiveSessions",[...h.value]):H==="restore"&&i("restoreSessions",[...m.value]);return}const j=R.value;if(j!==null)switch(H){case"open":s.selectSession(j.id);break;case"rename":_(j);break;case"fork":s.forkSession(j.id);break;case"export":s.exportSession(j.id);break;case"archive":i("archiveSessions",[j.id]);break;case"restore":i("restoreSessions",[j.id]);break}}return(H,j)=>(k(),L(De,null,[A("div",{class:Re(["sa-table-card",{"is-loading":e.loading&&e.items.length>0}])},[e.items.length>0?(k(),L("table",uUe,[j[5]||(j[5]=A("colgroup",null,[A("col",{class:"sa-col-cb"}),A("col",{class:"sa-col-title"}),A("col",{class:"sa-col-ws"}),A("col",{class:"sa-col-status"}),A("col"),A("col",{class:"sa-col-time"}),A("col",{class:"sa-col-time"}),A("col",{class:"sa-col-act"})],-1)),A("thead",null,[A("tr",null,[A("th",cUe,[A("button",{class:Re(["sa-cb",{on:w.value,ind:C.value}]),type:"button","aria-label":p(o)("admin.selectPageAll"),onClick:T},[w.value?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):C.value?(k(),de(p(Ce),{key:1,name:"minus",size:"sm"})):ee("",!0)],10,dUe)]),f.value>0?(k(),L("th",fUe,[A("div",hUe,[A("span",pUe,F(g.value?p(o)("admin.allMatchingSelected",{n:f.value}):p(o)("admin.batchSelected",{n:f.value})),1),g.value?(k(),L("button",{key:0,class:"sa-batch-link",type:"button",onClick:j[0]||(j[0]=Z=>p(s).clearSessionAdminSelection())},F(p(o)("admin.clearSelection")),1)):w.value&&e.total>f.value?(k(),L("button",{key:1,class:"sa-batch-link",type:"button",disabled:v.value,onClick:j[1]||(j[1]=Z=>p(s).selectSessionAdminAllMatching())},F(v.value?p(o)("admin.materializingAll"):p(o)("admin.selectAllMatching",{total:e.total})),9,mUe)):ee("",!0),A("button",{class:"sa-btn-q sa-btn-q--primary",type:"button",disabled:y.value.open===0||e.batchRunning!==null,onClick:j[2]||(j[2]=Z=>i("archiveSessions",[...h.value]))},[e.batchRunning==="archive"?(k(),de(p(mo),{key:0,size:"sm"})):(k(),de(p(Ce),{key:1,name:"state-done",size:"sm"})),$e(" "+F(p(o)("admin.markDone")),1)],8,gUe),A("button",{class:"sa-btn-q",type:"button",disabled:y.value.done===0||e.batchRunning!==null,onClick:j[3]||(j[3]=Z=>i("restoreSessions",[...m.value]))},[e.batchRunning==="restore"?(k(),de(p(mo),{key:0,size:"sm"})):(k(),de(p(Ce),{key:1,name:"undo",size:"sm"})),$e(" "+F(p(o)("admin.reopen")),1)],8,vUe)])])):(k(),L(De,{key:1},[A("th",null,F(p(o)("admin.colTitle")),1),A("th",null,F(p(o)("admin.colWorkspace")),1),A("th",null,F(p(o)("admin.colStatus")),1),A("th",null,F(p(o)("admin.colPrompt")),1),A("th",yUe,F(p(o)("admin.colUpdated")),1),A("th",kUe,F(p(o)("admin.colCompleted")),1),A("th",null,F(p(o)("admin.colActions")),1)],64))])]),A("tbody",null,[(k(!0),L(De,null,Ct(e.items,Z=>(k(),L("tr",{key:Z.id,onContextmenu:ie=>z(Z,ie)},[A("td",wUe,[A("button",{class:Re(["sa-cb",{on:d.value.has(Z.id)}]),type:"button","aria-label":Z.id,onClick:ie=>p(s).toggleSessionAdminSelection(Z.id,Z.meta.archived)},[d.value.has(Z.id)?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)],10,CUe)]),A("td",null,[N.value===Z.id?ai((k(),L("input",{key:0,ref_for:!0,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":j[4]||(j[4]=ie=>I.value=ie),class:"sa-rename",type:"text",onKeydown:ie=>E(ie,Z),onBlur:ie=>void x(Z)},null,40,AUe)),[[ur,I.value]]):(k(),L("span",{key:1,class:"sa-title",title:l(Z)},F(l(Z)),9,xUe))]),A("td",null,[A("span",SUe,[A("span",null,F(a(Z)),1)])]),A("td",null,[A("span",{class:Re(["sa-st",Z.meta.archived?"sa-st--done":"sa-st--open"])},[U(p(Ce),{name:Z.meta.archived?"state-done":"state-open",size:"sm"},null,8,["name"]),$e(" "+F(Z.meta.archived?p(o)("admin.statusDone"):p(o)("admin.statusOpen")),1)],2)]),A("td",{class:"sa-prompt",title:Z.meta.last_prompt??void 0},[A("span",{class:Re({"sa-none":Z.meta.last_prompt===null})},F(Z.meta.last_prompt??"—"),3)],8,_Ue),A("td",MUe,[A("span",IUe,F(p(YB)(Z.meta.updated_at)),1),A("span",TUe,F(p(JB)(Z.meta.updated_at)),1)]),A("td",EUe,[u(Z)!==null?(k(),L(De,{key:0},[A("span",LUe,F(u(Z)),1),A("span",NUe,F(c(Z)),1)],64)):(k(),L("span",DUe,"—"))]),A("td",null,[A("div",FUe,[U(p(ln),{size:"sm",label:Z.meta.archived?p(o)("admin.reopen"):p(o)("admin.markDone"),tooltip:Z.meta.archived?p(o)("admin.reopen"):p(o)("admin.markDone"),onClick:ie=>B(Z)},{default:ce(()=>[U(p(Ce),{name:Z.meta.archived?"undo":"state-done"},null,8,["name"])]),_:2},1032,["label","tooltip","onClick"]),U(p(ln),{size:"sm",label:p(o)("admin.moreActions"),tooltip:p(o)("admin.moreActions"),onClick:ie=>O(Z,ie)},{default:ce(()=>[U(p(Ce),{name:"dots-horizontal"})]),_:1},8,["label","tooltip","onClick"])])])],40,bUe))),128))])])):e.loading?(k(),L("div",BUe,[U(p(mo),{size:"lg",label:p(o)("admin.loading")},null,8,["label"])])):(k(),L("div",RUe,[A("p",$Ue,F(p(o)("admin.empty")),1)]))],2),U(Jqe,{ref_key:"adminMenuRef",ref:q,mode:M.value,"target-archived":R.value?.meta.archived,counts:y.value,onAction:P},null,8,["mode","target-archived","counts"])],64))}}),PUe=xt(OUe,[["__scopeId","data-v-dd5dbf42"]]),zUe={class:"activity-notice",role:"status"},jUe={"aria-hidden":"true"},HUe={class:"an-label"},WUe=lt({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(k(),L("div",zUe,[A("span",jUe,[U(p(mo),{size:"sm"})]),A("span",HUe,F(e.label),1)]))}}),qUe=xt(WUe,[["__scopeId","data-v-fd031610"]]),UUe=["aria-expanded"],VUe={class:"think-title"},KUe={key:0,class:"think-time"},ZUe=["inert"],GUe={class:"think-text"},QUe=lt({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},startedAt:{default:void 0},durationMs:{default:void 0},instantReveal:{type:Boolean,default:!1}},setup(e){const t=e,n=V(!1),{t:i}=qt();We(()=>t.streaming,(d,f)=>{f&&!d&&(n.value=!1)});const o=V(Date.now());We(()=>[t.streaming,t.startedAt],([d,f],h,m)=>{if(!d||!f)return;o.value=Date.now();const g=setInterval(()=>{o.value=Date.now()},1e3);m(()=>clearInterval(g))},{immediate:!0});const s=D(()=>{if(t.streaming&&t.startedAt){const d=Date.parse(t.startedAt);return Number.isFinite(d)?Fu(o.value-d):""}if(t.durationMs!==void 0){const d=Fu(t.durationMs);return d?`· ${d}`:""}return""}),r=Jt(df,()=>{}),l=V(null),a=V(null),u=V(!1);function c(){if(!n.value){const f=(a.value?.scrollHeight??0)>(typeof window<"u"?window.innerHeight:0);u.value=t.instantReveal||t.streaming&&f}if(n.value=!n.value,n.value,t.streaming)return;const d=l.value;d&&ht(()=>r(d))}return(d,f)=>(k(),L("div",{class:Re(["think",{mob:e.mobile,open:n.value,streaming:e.streaming}])},[A("button",{ref_key:"headEl",ref:l,class:"think-head",type:"button","aria-expanded":n.value,onClick:c},[U(p(Ce),{class:"think-bulb",name:"thinking",size:"sm"}),A("span",VUe,F(e.streaming?p(i)("thinking.streaming"):p(i)("thinking.panelTitle")),1),s.value?(k(),L("span",KUe,F(s.value),1)):ee("",!0),U(p(Ce),{class:"think-car",name:"chevron-right",size:"sm"})],8,UUe),A("div",{class:Re(["think-body",{open:n.value,instant:u.value}]),inert:!n.value},[A("div",{ref_key:"bodyInnerEl",ref:a,class:"think-body-inner"},[A("pre",GUe,F(e.text),1)],512)],10,ZUe)],2))}}),cS=xt(QUe,[["__scopeId","data-v-39bd75ea"]]),qo=Symbol("panelApi"),BB="__draft__:",YUe={class:"op"},JUe={key:0,class:"op-empty"},XUe=lt({__name:"OutputPanel",props:{lines:{default:void 0},emptyText:{default:""}},setup(e){const t=e,n=D(()=>t.lines??[]);return(i,o)=>(k(),L("div",YUe,[n.value.length===0&&e.emptyText?(k(),L("div",JUe,F(e.emptyText),1)):ee("",!0),(k(!0),L(De,null,Ct(n.value,(s,r)=>(k(),L("div",{key:r},F(s),1))),128))]))}}),wl=xt(XUe,[["__scopeId","data-v-ad2b6614"]]),eVe={class:"head-row"},tVe=["disabled","aria-label","aria-expanded"],nVe={class:"lead","aria-hidden":"true"},iVe={class:"main"},oVe={class:"task"},sVe={key:0,class:"type"},rVe={class:"tail"},lVe=["aria-label"],aVe=["aria-expanded"],uVe=lt({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["detach"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t,s=Jt(qo);function r(E){if(!E)return{};try{const M=JSON.parse(E);return{description:typeof M.description=="string"?M.description:void 0,subagentType:typeof M.subagent_type=="string"?M.subagent_type:void 0,runInBackground:M.run_in_background===!0}}catch{return{}}}const l=D(()=>r(i.tool.arg)),a=D(()=>i.tool.status),u=D(()=>l.value.description||l.value.subagentType||Kh(i.tool.name)),c=D(()=>l.value.description?l.value.subagentType:""),d=Jt(XV),f=Jt(eK),h=D(()=>i.tool.agentId??d?.(i.tool.id)),m=D(()=>h.value!==void 0),g=Jt(tK),v=D(()=>l.value.runInBackground?g?.(i.tool.id,h.value):void 0),y=D(()=>{const E=v.value;return E==="run"?"running":E==="done"?"ok":E==="fail"?"error":E==="cancelled"?"cancelled":a.value}),b=D(()=>n(`tools.agent.status.${y.value}`)),w=D(()=>f?.(i.tool.id,h.value)),C=D(()=>[l.value.runInBackground?n("tools.agent.background"):n("tools.agent.foreground"),c.value,w.value?.display,w.value?.effort].filter(E=>E).join(" · ")),T=D(()=>!!i.tool.output&&i.tool.output.length>0),N=D(()=>m.value||T.value),I=V(!1),S=Jt(qx,void 0),_=D(()=>l.value.runInBackground!==!0&&a.value==="running"&&S!==void 0&&S(i.tool.id)!==!1);function x(){if(h.value!==void 0){s?.openAgent(h.value);return}T.value&&(I.value=!I.value)}return(E,M)=>(k(),L("div",{class:Re(["agent-card",{err:y.value==="error"}])},[A("div",eVe,[A("button",{class:"head",type:"button",disabled:!N.value,"aria-label":m.value?p(n)("tasks.openDetail"):void 0,"aria-expanded":m.value?void 0:I.value,onClick:x},[A("span",nVe,[U(p(Ce),{name:"robot",size:"sm"})]),A("span",iVe,[A("span",oVe,F(u.value),1),C.value?(k(),L("span",sVe,F(C.value),1)):ee("",!0)]),A("span",rVe,[A("span",{class:Re(["st",y.value]),role:"status","aria-label":b.value},[y.value==="ok"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):y.value==="error"?(k(),de(p(Ce),{key:1,name:"close",size:"sm"})):y.value==="cancelled"?(k(),de(p(Ce),{key:2,name:"close",size:"sm"})):(k(),de(p(Hl),{key:3,status:"running"}))],10,lVe)])],8,tVe),_.value?(k(),de(p(ln),{key:0,class:Re(["detach",{touch:e.mobile}]),size:"sm",label:p(n)("tasks.toBackground"),tooltip:p(n)("tasks.toBackground"),onClick:M[0]||(M[0]=Tt(R=>o("detach",e.tool.id),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"pip",size:"sm"})]),_:1},8,["class","label","tooltip"])):ee("",!0),A("span",{class:"go-slot","aria-hidden":"true",onClick:x},[m.value?(k(),de(p(Ce),{key:0,class:"go",name:"arrow-right",size:"sm"})):T.value?(k(),de(p(Ce),{key:1,class:Re(["go car",{open:I.value}]),name:"chevron-right",size:"sm"},null,8,["class"])):ee("",!0)])]),m.value&&T.value?(k(),L("button",{key:0,class:"saved-result",type:"button","aria-expanded":I.value,onClick:M[1]||(M[1]=R=>I.value=!I.value)},[U(p(Ce),{class:Re(["saved-result__chevron",{open:I.value}]),name:"chevron-right",size:"sm","aria-hidden":"true"},null,8,["class"]),A("span",null,F(p(n)("tools.output.saved")),1)],8,aVe)):ee("",!0),T.value&&I.value?(k(),L("div",{key:1,class:Re(["result",{"result--legacy":!m.value}])},[U(wl,{lines:e.tool.output},null,8,["lines"])],2)):ee("",!0)],2))}}),cVe=xt(uVe,[["__scopeId","data-v-4a2d5e3d"]]),dVe={class:"tl-ic","aria-hidden":"true"},fVe={class:"tl-main"},hVe=["aria-expanded","aria-label"],pVe={class:"tl-tail"},mVe=["aria-label"],gVe=["inert"],vVe={class:"tl-body-inner"},yVe=lt({__name:"ToolDisclosure",props:{status:{},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1}},emits:["toggle"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=Jt(df,()=>{}),r=V(null);function l(){if(!n.expandable)return;n.open,i("toggle");const u=r.value;u&&ht(()=>s(u))}const a=D(()=>n.open?o("tools.disclosure.collapse"):o("tools.disclosure.expand"));return(u,c)=>(k(),L("div",{class:Re(["tool-line",{open:e.open,expandable:e.expandable,err:e.status==="error"}])},[A("div",{ref_key:"headEl",ref:r,class:Re(["tl-head",{clickable:e.expandable}]),onClick:l},[A("span",dVe,[Un(u.$slots,"leading")]),A("span",fVe,[Un(u.$slots,"default"),U(p(Nn),{text:a.value},{default:ce(()=>[e.expandable?(k(),L("button",{key:0,class:"tl-car",type:"button","aria-expanded":e.open,"aria-label":a.value,onClick:Tt(l,["stop"])},[U(p(Ce),{class:"tl-car-ic",name:"chevron-right",size:"sm","aria-hidden":"true"})],8,hVe)):ee("",!0)]),_:1},8,["text"])]),A("span",pVe,[Un(u.$slots,"trailing"),A("span",{class:Re(["tl-status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):e.status==="error"?(k(),de(p(Ce),{key:1,name:"close",size:"sm"})):e.status==="suspended"?(k(),de(p(Hl),{key:2,status:"suspended"})):(k(),de(p(Hl),{key:3,status:"running"}))],10,mVe)])],2),e.expandable?(k(),L("div",{key:0,class:Re(["tl-body",{open:e.open}]),inert:!e.open},[A("div",vVe,[Un(u.$slots,"body")])],10,gVe)):ee("",!0)],2))}}),ba=xt(yVe,[["__scopeId","data-v-e445a9a3"]]),kVe={key:0,class:"rc-flat"},bVe={class:"rc-head"},wVe={class:"rc-st"},CVe={class:"rc-qtext"},AVe={class:"rc-lb"},xVe={key:0,class:"rc-opt"},SVe={class:"rc-lb"},_Ve={class:"rc-ds"},MVe={key:1,class:"rc-opt"},IVe={class:"rc-lb"},TVe={key:2,class:"rc-qskip"},EVe={class:"tl-name"},LVe={key:0,class:"tl-dim"},NVe={key:0,class:"tl-chip"},DVe=80,FVe=lt({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=qt();function i(I,S=DVe){const _=I.trim();return _.length>S?_.slice(0,S-1)+"…":_}const o=D(()=>Tst(t.tool.arg)),s=D(()=>Est(t.tool.output)),r=D(()=>s.value.recognized),l=D(()=>r.value&&Object.keys(s.value.answers).length===0&&s.value.note.length>0),a=D(()=>o.value.map((I,S)=>Dst(Lst(s.value.answers,I.question,S),I.options))),u=D(()=>Object.keys(s.value.answers).length);function c(I,S){return a.value[I]?.selected.has(S)??!1}function d(I){return a.value[I]?.otherText??""}function f(I){return a.value[I]?.indeterminate??!1}const h=D(()=>t.tool.status),m=D(()=>o.value.map((I,S)=>({q:I,selected:I.options.map((_,x)=>({o:_,oi:x})).filter(({oi:_})=>c(S,_))}))),g=D(()=>o.value.length===1?n("tools.ask.question",{count:1}):n("tools.ask.questions",{count:o.value.length})),v=D(()=>{const I=o.value[0]?.question??"",S=n("tools.ask.unanswered");return I?`${I} —— ${S}`:S}),y=D(()=>{if(!r.value)return i(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const I=o.value[0]?.question??"",S=i(I);return o.value.length<=1?S:`${S} ${n("tools.ask.more",{count:o.value.length-1})}`}),b=D(()=>r.value?l.value?n("tools.ask.dismissed"):u.value===0?"":u.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:u.value}):""),w=D(()=>!!t.tool.output&&t.tool.output.length>0),C=D(()=>r.value&&(o.value.length>0||l.value)||w.value),T=V(t.tool.defaultExpanded===!0&&C.value),N=D(()=>Kh(t.tool.name));return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&C.value&&(T.value=!0)}),(I,S)=>r.value&&h.value==="ok"?(k(),L("div",{key:0,class:Re(["ask-receipt",{flat:l.value||u.value===0}])},[l.value||u.value===0?(k(),L("span",kVe,F(v.value),1)):(k(),L(De,{key:1},[A("div",bVe,[A("span",null,F(p(n)("tools.ask.collected"))+" · "+F(g.value),1),A("span",wVe,[U(p(Ce),{name:"check",size:"sm"})])]),(k(!0),L(De,null,Ct(m.value,(_,x)=>(k(),L("div",{key:x,class:"rc-q"},[A("div",CVe,[A("span",null,F(_.q.question),1)]),(k(!0),L(De,null,Ct(_.selected,E=>(k(),L("div",{key:E.oi,class:"rc-opt"},[A("span",{class:Re(["rc-g on",_.q.multiSelect?"chk":"rad"])},null,2),A("span",AVe,F(E.o.label),1)]))),128)),d(x)?(k(),L("div",xVe,[A("span",{class:Re(["rc-g on",_.q.multiSelect?"chk":"rad"])},null,2),A("span",SVe,F(d(x)),1),A("span",_Ve,F(p(n)("tools.ask.freeInput")),1)])):ee("",!0),f(x)?(k(),L("div",MVe,[S[1]||(S[1]=A("span",{class:"rc-g rad on"},null,-1)),A("span",IVe,F(p(n)("tools.ask.answered")),1)])):ee("",!0),_.selected.length===0&&!d(x)&&!f(x)?(k(),L("div",TVe,F(p(n)("tools.ask.unanswered")),1)):ee("",!0)]))),128))],64))],2)):(k(),de(ba,{key:1,status:h.value,open:T.value,expandable:C.value,onToggle:S[0]||(S[0]=_=>T.value=!T.value)},{leading:ce(()=>[U(p(Ce),{name:"help-circle",size:"sm"})]),trailing:ce(()=>[b.value?(k(),L("span",NVe,F(b.value),1)):ee("",!0)]),body:ce(()=>[U(wl,{lines:e.tool.output},null,8,["lines"])]),default:ce(()=>[A("span",EVe,F(N.value),1),y.value?(k(),L("span",LVe,F(y.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),BVe=xt(FVe,[["__scopeId","data-v-928d131f"]]),RVe={class:"tl-name"},$Ve={class:"tl-mono"},OVe=["aria-label"],PVe={key:1,class:"tl-chip"},zVe={class:"cmd-echo"},jVe=lt({__name:"BashTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["detach"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=D(()=>n.tool.status),r=D(()=>{const h=Lc(n.tool.arg);return(Ci(h?.command)??Ci(h?.cmd)??Ci(h?.script)??n.tool.arg.replace(/^·\s*/,"")).trim()}),l=D(()=>n.tool.status==="running"),a=D(()=>!!n.tool.output&&n.tool.output.length>0),u=D(()=>a.value||l.value||r.value.length>0),c=V(n.tool.defaultExpanded===!0&&u.value),d=Jt(qx,void 0),f=D(()=>l.value&&d!==void 0&&d(n.tool.id)!==!1);return We(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status],()=>{n.tool.defaultExpanded===!0&&u.value&&(c.value=!0)}),(h,m)=>(k(),de(ba,{status:s.value,open:c.value,expandable:u.value,onToggle:m[1]||(m[1]=g=>c.value=!c.value)},{leading:ce(()=>[U(p(Ce),{name:"terminal",size:"sm"})]),trailing:ce(()=>[f.value?(k(),de(p(Nn),{key:0,text:p(o)("tasks.toBackground")},{default:ce(()=>[A("button",{class:Re(["tl-detach",{touch:e.mobile}]),type:"button","aria-label":p(o)("tasks.toBackground"),onClick:m[0]||(m[0]=Tt(g=>i("detach",e.tool.id),["stop"]))},[U(p(Ce),{name:"pip",size:"sm","aria-hidden":"true"})],10,OVe)]),_:1},8,["text"])):ee("",!0),e.tool.timing?(k(),L("span",PVe,F(e.tool.timing),1)):ee("",!0)]),body:ce(()=>[A("div",zVe,F(r.value),1),U(wl,{lines:e.tool.output,"empty-text":l.value?p(o)("tools.output.waiting"):p(o)("tools.output.empty")},null,8,["lines","empty-text"])]),default:ce(()=>[A("span",RVe,F(p(o)("tools.label.bash")),1),A("span",$Ve,F(r.value),1)]),_:1},8,["status","open","expandable"]))}}),HVe=xt(jVe,[["__scopeId","data-v-e0f3f8fe"]]),WVe={class:"tl-name"},qVe={key:1,class:"tl-dim"},UVe={key:2,class:"tl-faint"},VVe={key:0,class:"tl-add"},KVe={key:1,class:"tl-del"},ZVe={class:"diffbar","aria-hidden":"true"},GVe={key:1,class:"tl-chip"},QVe=lt({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,n=Jt(qo),{t:i}=qt(),o=D(()=>t.tool.status),s=D(()=>Mr(t.tool.name)==="write"),r=D(()=>DZ(Lc(t.tool.arg))??""),l=D(()=>r.value?Mc(r.value):""),a=D(()=>r.value?FZ(r.value):""),u=D(()=>YW(t.tool)),c=D(()=>gAe(t.tool)),d=D(()=>{const C=u.value;return!C||t.tool.status==="error"?{added:0,removed:0}:WW(C)}),f=D(()=>d.value.added>0||d.value.removed>0),h=D(()=>!!t.tool.output&&t.tool.output.length>0),m=D(()=>u.value!==null&&t.tool.status!=="error"),g=D(()=>c.value!==null&&t.tool.status!=="error"),v=D(()=>m.value||g.value||h.value),y=V(!1),b=V(y.value);We(y,C=>{C&&(b.value=!0)});function w(){r.value&&n?.openFile({path:r.value})}return(C,T)=>(k(),de(ba,{status:o.value,open:y.value,expandable:v.value,onToggle:T[0]||(T[0]=N=>y.value=!y.value)},{leading:ce(()=>[U(p(Ce),{name:s.value?"file-plus":"pencil",size:"sm"},null,8,["name"])]),trailing:ce(()=>[f.value?(k(),L(De,{key:0},[d.value.added>0?(k(),L("span",VVe,"+"+F(d.value.added),1)):ee("",!0),d.value.removed>0?(k(),L("span",KVe,"−"+F(d.value.removed),1)):ee("",!0),A("span",ZVe,[A("span",{class:"seg-add",style:on({flexGrow:d.value.added})},null,4),A("span",{class:"seg-del",style:on({flexGrow:d.value.removed})},null,4)])],64)):s.value&&o.value==="ok"?(k(),L("span",GVe,F(p(i)("tools.chip.created")),1)):ee("",!0)]),body:ce(()=>[m.value&&b.value?(k(),de(Pa,{key:0,lines:u.value??[],path:r.value},null,8,["lines","path"])):g.value&&b.value?(k(),de(Pa,{key:1,code:c.value?.content??"",path:c.value?.path},null,8,["code","path"])):(k(),de(wl,{key:2,lines:e.tool.output,"empty-text":p(i)("tools.output.waiting")},null,8,["lines","empty-text"]))]),default:ce(()=>[A("span",WVe,F(s.value?p(i)("tools.label.write"):p(i)("tools.label.edit")),1),l.value?(k(),L("button",{key:0,class:"tl-file",type:"button",onClick:Tt(w,["stop"])},F(l.value),1)):(k(),L("span",qVe,F(r.value||e.tool.arg),1)),a.value?(k(),L("span",UVe,F(a.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),YVe=xt(QVe,[["__scopeId","data-v-b25ea4cc"]]),JVe=["innerHTML"],XVe={class:"tl-name"},eKe={key:0,class:"tl-dim"},tKe={key:0,class:"tl-chip"},nKe={key:1,class:"tl-chip"},iKe={key:0,class:"arg-full"},oKe=lt({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=qt(),i=D(()=>t.tool.status),o=D(()=>Kh(t.tool.name)),s=D(()=>MZ(t.tool.name)),r=D(()=>ZB(t.tool.name,t.tool.arg)),l=D(()=>ZB(t.tool.name,t.tool.arg,!0)),a=D(()=>hst({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status})),u=D(()=>!!t.tool.output&&t.tool.output.length>0),c=D(()=>u.value||!!l.value&&l.value!==r.value),d=V(t.tool.defaultExpanded===!0&&c.value);return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&c.value&&(d.value=!0)}),(f,h)=>(k(),de(ba,{status:i.value,open:d.value,expandable:c.value,onToggle:h[0]||(h[0]=m=>d.value=!d.value)},{leading:ce(()=>[A("span",{class:"gl",innerHTML:s.value},null,8,JVe)]),trailing:ce(()=>[a.value?(k(),L("span",tKe,F(a.value),1)):e.tool.timing?(k(),L("span",nKe,F(e.tool.timing),1)):ee("",!0)]),body:ce(()=>[l.value&&l.value!==r.value?(k(),L("div",iKe,F(l.value),1)):ee("",!0),U(wl,{lines:e.tool.output,"empty-text":i.value==="running"?p(n)("tools.output.waiting"):p(n)("tools.output.empty")},null,8,["lines","empty-text"])]),default:ce(()=>[A("span",XVe,F(o.value),1),r.value?(k(),L("span",eKe,F(r.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),sKe=xt(oKe,[["__scopeId","data-v-c64dda93"]]),rKe={class:"tl-name"},lKe={key:0,class:"tl-mono"},aKe={key:1,class:"tl-mono"},uKe={key:2,class:"tl-dim"},cKe={key:3,class:"tl-faint"},dKe={key:0,class:"tl-chip"},fKe={key:0,class:"file-list"},hKe=["onClick"],pKe=lt({__name:"GlobTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,n=Jt(qo),{t:i}=qt(),o=D(()=>t.tool.status),s=D(()=>Mr(t.tool.name)==="glob"),r=D(()=>Lc(t.tool.arg)),l=D(()=>{const m=r.value;return Ci(m?.pattern)??Ci(m?.glob)??Ci(m?.query)??""}),a=D(()=>{const m=r.value;return Ci(m?.path)??Ci(m?.dir)??Ci(m?.directory)??Ci(m?.cwd)??""}),u=D(()=>(t.tool.output??[]).filter(m=>m.trim().length>0)),c=D(()=>u.value.length>0),d=D(()=>c.value),f=V(t.tool.defaultExpanded===!0&&d.value);We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&d.value&&(f.value=!0)});function h(m){const g=m.trim();g&&n?.openFile({path:g})}return(m,g)=>(k(),de(ba,{status:o.value,open:f.value,expandable:d.value,onToggle:g[0]||(g[0]=v=>f.value=!f.value)},{leading:ce(()=>[U(p(Ce),{name:s.value?"tree-view":"list",size:"sm"},null,8,["name"])]),trailing:ce(()=>[s.value&&u.value.length>0?(k(),L("span",dKe,F(p(i)("tools.chip.files",{count:u.value.length})),1)):ee("",!0)]),body:ce(()=>[s.value?(k(),L("div",fKe,[(k(!0),L(De,null,Ct(u.value,(v,y)=>(k(),L("button",{key:y,class:"file-row",type:"button",onClick:b=>h(v)},F(v),9,hKe))),128))])):(k(),de(wl,{key:1,lines:e.tool.output},null,8,["lines"]))]),default:ce(()=>[A("span",rKe,F(p(i)(s.value?"tools.label.glob":"tools.label.ls")),1),s.value&&l.value?(k(),L("span",lKe,F(l.value),1)):!s.value&&a.value?(k(),L("span",aKe,F(a.value),1)):(k(),L("span",uKe,F(e.tool.arg),1)),s.value&&a.value?(k(),L("span",cKe,F(a.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),mKe=xt(pKe,[["__scopeId","data-v-ef9af25f"]]),gKe={class:"tl-name"},vKe={key:0,class:"tl-dim"},yKe={key:1,class:"tl-pill pill-active"},kKe={key:0,class:"goal-block"},bKe={class:"goal-text"},wKe={key:0,class:"goal-criterion"},CKe=lt({__name:"GoalTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=qt(),i=D(()=>t.tool.status),o=D(()=>Mr(t.tool.name)),s=D(()=>Lc(t.tool.arg)),r=D(()=>Ci(s.value?.objective)??""),l=D(()=>Ci(s.value?.completionCriterion)??Ci(s.value?.completion_criterion)??""),a={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"},u=D(()=>Ci(s.value?.status)??""),c=D(()=>{const b=a[u.value];return b?n(b):u.value}),d=D(()=>{switch(u.value){case"complete":return"pill-done";case"blocked":return"pill-blocked";default:return"pill-active"}}),f=D(()=>{const b=Xc(s.value?.value),w=Ci(s.value?.unit);return b===void 0||!w?"":["turns","tokens","milliseconds","seconds","minutes","hours"].includes(w)?n(`tools.goal.${w}`,{value:b}):n("tools.goal.budget",{value:b,unit:w})}),h=D(()=>{switch(o.value){case"creategoal":return r.value;case"updategoal":return c.value;case"setgoalbudget":return f.value;default:return""}}),m=D(()=>!!t.tool.output&&t.tool.output.length>0),g=D(()=>!!l.value||o.value==="creategoal"&&m.value),v=D(()=>g.value||m.value),y=V(t.tool.defaultExpanded===!0&&v.value);return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&v.value&&(y.value=!0)}),(b,w)=>(k(),de(ba,{status:i.value,open:y.value,expandable:v.value,onToggle:w[0]||(w[0]=C=>y.value=!y.value)},{leading:ce(()=>[U(p(Ce),{name:"target",size:"sm"})]),trailing:ce(()=>[o.value==="updategoal"&&c.value?(k(),L("span",{key:0,class:Re(["tl-pill",d.value])},F(c.value),3)):o.value==="creategoal"?(k(),L("span",yKe,F(p(n)("status.goalStatusActive")),1)):ee("",!0)]),body:ce(()=>[r.value?(k(),L("div",kKe,[A("div",bKe,F(r.value),1),l.value?(k(),L("div",wKe,F(l.value),1)):ee("",!0)])):ee("",!0),m.value?(k(),de(wl,{key:1,lines:e.tool.output},null,8,["lines"])):ee("",!0)]),default:ce(()=>[A("span",gKe,F(p(Kh)(e.tool.name)),1),h.value?(k(),L("span",vKe,F(h.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),AKe=xt(CKe,[["__scopeId","data-v-50602502"]]),xKe={class:"tl-name"},SKe={key:0,class:"tl-mono"},_Ke={key:1,class:"tl-dim"},MKe={key:2,class:"tl-faint"},IKe={key:0,class:"tl-chip"},TKe={key:0,class:"match-list"},EKe=["onClick"],LKe={key:0,class:"mref"},NKe={class:"mtext"},DKe=lt({__name:"GrepTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,n=Jt(qo),{t:i}=qt(),o=D(()=>t.tool.status),s=D(()=>Mr(t.tool.name)==="grep"),r=D(()=>Lc(t.tool.arg)),l=D(()=>{const g=r.value;return Ci(g?.pattern)??Ci(g?.query)??Ci(g?.regex)??""}),a=D(()=>{const g=r.value;return Ci(g?.path)??Ci(g?.glob)??Ci(g?.include)??""}),u=D(()=>(t.tool.output??[]).filter(g=>g.trim().length>0).map(g=>{const v=/^(.+?):(\d+)[:-](.*)$/.exec(g);return v?{path:v[1],line:Number(v[2]),text:(v[3]??"").trim()}:{text:g}})),c=D(()=>u.value.length),d=D(()=>c.value>0),f=D(()=>d.value),h=V(t.tool.defaultExpanded===!0&&f.value);We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&f.value&&(h.value=!0)});function m(g){g.path&&n?.openFile({path:g.path,line:g.line})}return(g,v)=>(k(),de(ba,{status:o.value,open:h.value,expandable:f.value,onToggle:v[0]||(v[0]=y=>h.value=!h.value)},{leading:ce(()=>[U(p(Ce),{name:"search",size:"sm"})]),trailing:ce(()=>[c.value>0?(k(),L("span",IKe,F(p(i)("tools.chip.results",{count:c.value})),1)):ee("",!0)]),body:ce(()=>[s.value?(k(),L("div",TKe,[(k(!0),L(De,null,Ct(u.value,(y,b)=>(k(),L("button",{key:b,class:Re(["match-row",{link:y.path}]),type:"button",onClick:w=>m(y)},[y.path?(k(),L("span",LKe,F(y.path)+":"+F(y.line),1)):ee("",!0),A("span",NKe,F(y.text),1)],10,EKe))),128))])):(k(),de(wl,{key:1,lines:e.tool.output},null,8,["lines"]))]),default:ce(()=>[A("span",xKe,F(p(i)(s.value?"tools.label.grep":"tools.label.search")),1),l.value?(k(),L("span",SKe,F(l.value),1)):(k(),L("span",_Ke,F(e.tool.arg),1)),a.value?(k(),L("span",MKe,F(a.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),FKe=xt(DKe,[["__scopeId","data-v-e5f2e791"]]),BKe=["src","controls","muted"],RKe=["src","alt"],$Ke=lt({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},sessionId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=V(t.fileId?"":t.url),i=V(null),o=V(!t.fileId);let s=null,r=0,l=!1,a=null;function u(){s!==null&&(URL.revokeObjectURL(s),s=null)}async function c(){const d=++r;if(u(),!t.fileId){n.value=t.url;return}if(o.value)try{const f=t.sessionId?await Kt().getSessionMediaBlob(t.sessionId,t.fileId):await Kt().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}s=h,n.value=s}catch{if(l||d!==r)return;n.value=t.url}}return We(()=>[t.fileId,t.sessionId,t.url,o.value],c,{immediate:!0}),yn(()=>{typeof IntersectionObserver=="function"&&i.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(i.value)):o.value=!0}),ti(()=>{l=!0,a?.disconnect(),a=null,u()}),(d,f)=>e.kind==="video"?(k(),L("video",{key:0,ref_key:"mediaEl",ref:i,class:Re(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,BKe)):(k(),L("img",{key:1,ref_key:"mediaEl",ref:i,class:Re([e.mediaClass,{"is-resolving":!n.value}]),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,RKe))}}),dS=xt($Ke,[["__scopeId","data-v-7bd83e15"]]),OKe={class:"media-title"},PKe=["src","alt"],zKe=["aria-label"],jKe={key:0,class:"media-video-tile","aria-hidden":"true"},HKe={class:"media-play-badge","aria-hidden":"true"},WKe=["src"],qKe=lt({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,i=t,o=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function s(d){return d.split(/[\\/]+/).pop()||d}function r(d){return d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/1024/1024).toFixed(1)} MB`}const l=D(()=>{const d=o.value;if(!d)return"";const f=[d.path?s(d.path):n.tool.name];return d.mimeType&&f.push(d.mimeType),d.bytes!==void 0&&f.push(r(d.bytes)),d.dimensions&&f.push(d.dimensions),f.join(" · ")}),a=D(()=>o.value?.url.startsWith("blob:")??!1),u=D(()=>{const d=o.value;return d?.kind==="video"&&d.fileId!==void 0&&!a.value});function c(d){const f=o.value;if(f?.kind!=="image"&&f?.kind!=="video")return;const h=f.kind==="image"?d.currentTarget.querySelector("img"):null;i("openMedia",{media:f,originImg:h})}return(d,f)=>o.value?(k(),L("div",{key:0,class:Re(["media-tool",{mob:e.mobile}])},[U(p(Nn),{text:o.value.path||l.value},{default:ce(()=>[A("div",OKe,F(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(k(),de(p(Nn),{key:0,text:o.value.path||l.value},{default:ce(()=>[A("button",{type:"button",class:"media-image-button",onClick:c},[A("img",{class:"media-image",src:o.value.url,alt:o.value.path?s(o.value.path):l.value,loading:"lazy"},null,8,PKe)])]),_:1},8,["text"])):o.value.kind==="video"?(k(),de(p(Nn),{key:1,text:o.value.path||l.value},{default:ce(()=>[A("button",{type:"button",class:"media-image-button media-video-button","aria-label":o.value.path?s(o.value.path):l.value,onClick:c},[u.value?(k(),L("span",jKe)):(k(),de(dS,{key:1,url:o.value.url,kind:"video","file-id":a.value?void 0:o.value.fileId,"media-class":"media-video",controls:!1,muted:""},null,8,["url","file-id"])),A("span",HKe,[U(p(Ce),{name:"play",size:"sm"})])],8,zKe)]),_:1},8,["text"])):(k(),L("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,WKe))],2)):ee("",!0)}}),UKe=xt(qKe,[["__scopeId","data-v-8ea09226"]]),VKe=["innerHTML"],KKe={class:"tl-name"},ZKe={key:0,class:"tl-faint"},GKe={key:0,class:"tl-chip"},QKe=["title"],YKe={key:1,class:"plan-content"},JKe={key:2,class:"plan-review"},XKe={key:0},eZe={class:"review-label"},tZe={key:1},nZe={class:"review-label"},iZe={class:"review-feedback"},oZe=lt({__name:"PlanTool",props:{tool:{},mobile:{type:Boolean}},setup(e){const t=e,{t:n}=qt(),i=Jt(qo),o=V(t.tool.defaultExpanded===!0),s=D(()=>t.tool.plan),r=D(()=>s.value?.path??t.tool.planPath),l=D(()=>s.value!==void 0||r.value!==void 0||(t.tool.output?.length??0)>0),a=D(()=>{const c=s.value?.review?.state;return c?n(`tools.plan.review.${c}`):void 0});function u(){r.value&&i?.openFile({path:r.value,content:s.value?.plan})}return(c,d)=>(k(),de(ba,{status:e.tool.status,open:o.value,expandable:l.value,onToggle:d[0]||(d[0]=f=>o.value=!o.value)},{leading:ce(()=>[A("span",{class:"plan-glyph",innerHTML:p(MZ)(e.tool.name)},null,8,VKe)]),trailing:ce(()=>[e.tool.timing?(k(),L("span",GKe,F(e.tool.timing),1)):ee("",!0)]),body:ce(()=>[r.value?(k(),L("button",{key:0,type:"button",class:"plan-path",title:r.value,onClick:u},F(r.value),9,QKe)):ee("",!0),s.value?(k(),L("div",YKe,[U(p(Sc),{text:s.value.plan,"open-file":p(i)?.openFile},null,8,["text","open-file"])])):ee("",!0),s.value?.review?.selectedOption||s.value?.review?.feedback?(k(),L("div",JKe,[s.value.review.selectedOption?(k(),L("div",XKe,[A("span",eZe,F(p(n)("tools.plan.selectedOption")),1),A("span",null,F(s.value.review.selectedOption),1)])):ee("",!0),s.value.review.feedback?(k(),L("div",tZe,[A("span",nZe,F(p(n)("tools.plan.feedback")),1),A("span",iZe,F(s.value.review.feedback),1)])):ee("",!0)])):ee("",!0),s.value?ee("",!0):(k(),de(wl,{key:3,lines:e.tool.output,"empty-text":p(n)("tools.output.empty")},null,8,["lines","empty-text"]))]),default:ce(()=>[A("span",KKe,F(p(Kh)(e.tool.name)),1),a.value?(k(),L("span",ZKe,F(a.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),sZe=xt(oZe,[["__scopeId","data-v-ae3acb2d"]]),rZe={class:"tl-name"},lZe={key:1,class:"tl-faint"},aZe={key:2,class:"tl-faint"},uZe={key:3,class:"tl-dim"},cZe={key:0,class:"tl-chip"},dZe=lt({__name:"ReadTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,n=Jt(qo),{t:i}=qt(),o=D(()=>t.tool.status),s=D(()=>Lc(t.tool.arg)),r=D(()=>DZ(s.value)??""),l=D(()=>r.value?Mc(r.value):""),a=D(()=>r.value?FZ(r.value):""),u=D(()=>{const T=s.value;if(T)return Xc(T.offset)??Xc(T.line_start)??Xc(T.start_line)}),c=D(()=>{const T=s.value;if(!T)return;const N=Xc(T.limit)??Xc(T.length);return Xc(T.line_end)??Xc(T.end_line)??(u.value!==void 0&&N!==void 0?u.value+N:void 0)}),d=D(()=>u.value!==void 0&&c.value!==void 0?`:${u.value}-${c.value}`:u.value!==void 0?`:${u.value}`:""),f=D(()=>t.tool.status==="ok"?Dse(t.tool.output??[]):null),h=D(()=>f.value?.contents??[]),m=D(()=>f.value?.lineNumbers),g=D(()=>f.value?.contents.length??t.tool.output?.length??0),v=D(()=>!!t.tool.output&&t.tool.output.length>0),y=D(()=>f.value!==null||v.value),b=V(t.tool.defaultExpanded===!0&&y.value),w=V(b.value);We(b,T=>{T&&(w.value=!0)}),We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&y.value&&(b.value=!0)});function C(){r.value&&n?.openFile({path:r.value,line:u.value})}return(T,N)=>(k(),de(ba,{status:o.value,open:b.value,expandable:y.value,onToggle:N[0]||(N[0]=I=>b.value=!b.value)},{leading:ce(()=>[U(p(Ce),{name:"file-text",size:"sm"})]),trailing:ce(()=>[g.value>0?(k(),L("span",cZe,F(p(i)("tools.chip.lines",{count:g.value})),1)):ee("",!0)]),body:ce(()=>[r.value?(k(),L("button",{key:0,class:"path-link",type:"button",onClick:C},F(r.value),1)):ee("",!0),f.value&&w.value?(k(),de(Pa,{key:1,code:h.value,path:r.value,"line-numbers":m.value},null,8,["code","path","line-numbers"])):(k(),de(wl,{key:2,lines:e.tool.output,"empty-text":p(i)("tools.output.waiting")},null,8,["lines","empty-text"]))]),default:ce(()=>[A("span",rZe,F(p(i)("tools.label.read")),1),l.value?(k(),L("button",{key:0,class:"tl-file",type:"button",onClick:Tt(C,["stop"])},F(l.value),1)):ee("",!0),a.value?(k(),L("span",lZe,F(a.value),1)):ee("",!0),d.value?(k(),L("span",aZe,F(d.value),1)):ee("",!0),l.value?ee("",!0):(k(),L("span",uZe,F(r.value||e.tool.arg),1))]),_:1},8,["status","open","expandable"]))}}),fZe=xt(dZe,[["__scopeId","data-v-a487370d"]]),hZe=["aria-expanded"],pZe={class:"title"},mZe={key:0,class:"meta"},gZe={key:1,class:"sum-txt"},vZe={class:"rt"},yZe={class:"status"},kZe={key:0,class:"chip"},bZe={key:1,class:"tm"},wZe={class:"body"},CZe={class:"overview"},AZe={class:"overview-line"},xZe={class:"big"},SZe={key:0,class:"lbl"},_Ze={key:1,class:"lbl"},MZe={key:2,class:"lbl"},IZe={key:3,class:"lbl"},TZe={key:0,class:"seg","aria-hidden":"true"},EZe={key:1,class:"legend"},LZe=["disabled","aria-label","aria-expanded","onClick"],NZe={class:"mname"},DZe={class:"mact"},FZe={class:"mphase"},BZe=["aria-expanded","onClick"],RZe={key:1,class:"fallback-output"},$Ze={key:2,class:"waiting"},OZe=lt({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const{t}=qt(),n=e,i=Jt(qo);function o(B){if(!B)return{};try{const P=JSON.parse(B),H=Array.isArray(P.items)?P.items:void 0;return{description:typeof P.description=="string"?P.description:void 0,itemCount:H?.length}}catch{return{}}}const s=Jt(nK),r=D(()=>o(n.tool.arg)),l=D(()=>Kh(n.tool.name)),a=D(()=>r.value.description??""),u=D(()=>s?.(n.tool.id)??[]),c=D(()=>Hoe(n.tool.output)),d=Jt(im),f=Jt(om),h=D(()=>{let B;for(const P of u.value){const H=d?.(P.model),j=f?.(P.thinkingEffort),Z=[H,j].filter(W=>W!==void 0);if(Z.length===0)continue;const ie=Z.join(" · ");if(B===void 0)B=ie;else if(B!==ie)return}return B}),m=D(()=>n.tool.status),g=D(()=>m.value==="running"?"running":m.value==="error"||(c.value?.failed??0)>0?"error":"ok"),v=D(()=>uAe(u.value,c.value)),y=D(()=>{const B={completed:0,working:0,suspended:0,queued:0,failed:0,cancelled:0};for(const P of v.value)B[P.phase]++;return B}),b=D(()=>v.value.length||r.value.itemCount||0),w=D(()=>y.value.completed+y.value.failed+y.value.cancelled),C=D(()=>{const B=c.value;if(!B)return"";const P=B.aborted??0;return P>0?t("tools.swarm.doneSubWithCancelled",{completed:B.completed,failed:B.failed,cancelled:P}):t("tools.swarm.doneSub",{completed:B.completed,failed:B.failed})}),T=D(()=>y.value.working+y.value.suspended+y.value.queued),N=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"cancelled",cls:"s-queue"},{phase:"queued",cls:"s-queue"}],I=D(()=>N.map(({phase:B,cls:P})=>({phase:B,count:y.value[B],cls:P})).filter(B=>B.count>0)),S=V(m.value==="running"||T.value>0);function _(){S.value=!S.value}const x=D(()=>v.value.length>0||c.value||m.value==="running"?"":(n.tool.output??[]).join(` -`).trim()),E=V(new Set);function M(B){return E.value.has(B)}function R(B){const P=new Set(E.value);P.has(B)?P.delete(B):P.add(B),E.value=P}function q(B){if(B.agentId){i?.openAgent(B.agentId);return}B.body&&R(B.id)}function z(B){return B.agentId!==void 0&&B.body.length>0&&(B.phase==="completed"||B.phase==="failed"||B.phase==="cancelled")}function O(B){return t(`tools.swarm.phase${B[0].toUpperCase()}${B.slice(1)}`)}return(B,P)=>(k(),L("div",{class:Re(["swarm-card",{open:S.value,err:g.value==="error"}])},[A("button",{class:"head",type:"button","aria-expanded":S.value,onClick:_},[U(p(Ce),{class:"ic",name:"sparkles",size:"sm"}),A("span",pZe,F(l.value),1),a.value?(k(),L("span",mZe,"·")):ee("",!0),a.value?(k(),L("span",gZe,F(a.value),1)):ee("",!0),A("span",vZe,[A("span",yZe,[g.value==="ok"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):g.value==="error"?(k(),de(p(Ce),{key:1,name:"close",size:"sm"})):(k(),de(p(Hl),{key:2,status:"running"}))]),w.value>0||b.value>0?(k(),L("span",kZe,F(w.value)+" / "+F(b.value),1)):ee("",!0),e.tool.timing?(k(),L("span",bZe,F(e.tool.timing),1)):ee("",!0)]),U(p(Ce),{class:"car",name:"chevron-right",size:"sm"})],8,hZe),ai(A("div",wZe,[A("div",CZe,[A("div",AZe,[A("span",xZe,F(p(t)("tools.swarm.progress",{done:w.value,total:b.value})),1),h.value?(k(),L("span",SZe,F(h.value),1)):ee("",!0),g.value==="running"&&b.value>0?(k(),L("span",_Ze,F(p(t)("tools.swarm.runningSub",{count:T.value})),1)):c.value?(k(),L("span",MZe,F(C.value),1)):(k(),L("span",IZe,F(p(t)("tools.swarm.waiting")),1))]),b.value>0&&I.value.length>0?(k(),L("div",TZe,[(k(!0),L(De,null,Ct(I.value,H=>(k(),L("span",{key:H.phase,class:Re(H.cls),style:on({flex:H.count})},null,6))),128))])):ee("",!0),I.value.length>1?(k(),L("div",EZe,[(k(!0),L(De,null,Ct(I.value,H=>(k(),L("span",{key:H.phase},[A("i",{class:Re(["lg-dot",H.cls])},null,2),$e(F(O(H.phase))+" "+F(H.count),1)]))),128))])):ee("",!0)]),v.value.length>0?(k(!0),L(De,{key:0},Ct(v.value,H=>(k(),L("div",{key:H.id,class:Re(["member",[`phase-${H.phase}`,{open:!H.agentId&&M(H.id)}]])},[A("button",{class:"member-head",type:"button",disabled:!H.agentId&&!H.body,"aria-label":H.agentId?p(t)("tasks.openDetail"):void 0,"aria-expanded":!H.agentId&&H.body?M(H.id):void 0,onClick:j=>q(H)},[U(p(Hl),{class:"row-dot",status:H.phase},null,8,["status"]),U(p(Nn),{text:H.name},{default:ce(()=>[A("span",NZe,F(H.name),1)]),_:2},1032,["text"]),H.activity?(k(),de(p(Nn),{key:0,text:H.activity},{default:ce(()=>[A("span",DZe,F(H.activity),1)]),_:2},1032,["text"])):ee("",!0),A("span",FZe,F(O(H.phase)),1),H.agentId?(k(),de(p(Ce),{key:1,class:"mcar",name:"arrow-right",size:"sm"})):H.body?(k(),de(p(Ce),{key:2,class:"mcar",name:"chevron-right",size:"sm"})):ee("",!0)],8,LZe),z(H)?(k(),L("button",{key:0,class:"member-saved",type:"button","aria-expanded":M(H.id),onClick:j=>R(H.id)},[U(p(Ce),{class:Re(["member-saved-car",{open:M(H.id)}]),name:"chevron-right",size:"sm","aria-hidden":"true"},null,8,["class"]),A("span",null,F(p(t)("tools.output.saved")),1)],8,BZe)):ee("",!0),H.body&&(!H.agentId||z(H))?ai((k(),L("div",{key:1,class:"member-body"},F(H.body),513)),[[Go,M(H.id)]]):ee("",!0)],2))),128)):x.value?(k(),L("div",RZe,F(x.value),1)):(k(),L("div",$Ze,F(p(t)("tools.swarm.waiting")),1))],512),[[Go,S.value]])],2))}}),PZe=xt(OZe,[["__scopeId","data-v-a03fd23e"]]),zZe=lt({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e;return(n,i)=>(k(),L("span",{class:Re(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},[t.status==="run"?(k(),de(p(Hl),{key:0,status:"running"})):t.status==="pending"?(k(),de(p(Hl),{key:1,status:"idle"})):t.status==="done"?(k(),de(p(Ce),{key:2,name:"check",size:"sm"})):(k(),de(p(Ce),{key:3,name:"close",size:"sm"}))],2))}}),jZe=xt(zZe,[["__scopeId","data-v-77ce35f9"]]),HZe={class:"tl-name"},WZe={key:0,class:"tl-dim"},qZe={key:0,class:"tl-chip"},UZe={key:1,class:"todo-bar","aria-hidden":"true"},VZe={key:0,class:"todo-list"},KZe={class:"todo-title"},ZZe=lt({__name:"TodoTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=qt();function i(m){const g=Lc(m),v=g&&Array.isArray(g.todos)?g.todos:g&&Array.isArray(g.items)?g.items:void 0;if(!v)return[];const y=[];for(const b of v){if(!b||typeof b!="object")continue;const w=b,C=Ci(w.title)??Ci(w.content)??Ci(w.activeForm)??Ci(w.text);if(!C)continue;const T=Ci(w.status)??"pending";y.push({title:C,status:T==="in_progress"?"in_progress":T==="done"||T==="completed"?"done":"pending"})}return y}const o=D(()=>t.tool.status),s=D(()=>i(t.tool.arg)),r=D(()=>s.value.filter(m=>m.status==="done").length),l=D(()=>s.value.length),a=D(()=>s.value.find(m=>m.status==="in_progress")),u=D(()=>l.value>0?r.value/l.value:0),c=D(()=>!!t.tool.output&&t.tool.output.length>0),d=D(()=>l.value>0||c.value),f=V(t.tool.defaultExpanded===!0&&d.value);We(()=>[t.tool.defaultExpanded,t.tool.status],()=>{t.tool.defaultExpanded===!0&&d.value&&(f.value=!0)});function h(m){return m.status==="in_progress"?"run":m.status}return(m,g)=>(k(),de(ba,{status:o.value,open:f.value,expandable:d.value,onToggle:g[0]||(g[0]=v=>f.value=!f.value)},{leading:ce(()=>[U(p(Ce),{name:"check-list",size:"sm"})]),trailing:ce(()=>[l.value>0?(k(),L("span",qZe,F(r.value)+"/"+F(l.value),1)):ee("",!0),l.value>0?(k(),L("span",UZe,[A("span",{class:"todo-fill",style:on({width:`${u.value*100}%`})},null,4)])):ee("",!0)]),body:ce(()=>[l.value>0?(k(),L("div",VZe,[(k(!0),L(De,null,Ct(s.value,(v,y)=>(k(),L("div",{key:y,class:Re(["todo-row",`s-${v.status}`])},[U(jZe,{status:h(v)},null,8,["status"]),A("span",KZe,F(v.title),1)],2))),128))])):c.value?(k(),de(wl,{key:1,lines:e.tool.output},null,8,["lines"])):ee("",!0)]),default:ce(()=>[A("span",HZe,F(p(n)("tools.label.todo")),1),a.value?(k(),L("span",WZe,F(a.value.title),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),GZe=xt(ZZe,[["__scopeId","data-v-9c43594f"]]),QZe={class:"tl-name"},YZe={key:0,class:"tl-dim"},JZe={key:2,class:"tl-chip"},XZe={key:0,class:"wf-glance"},eGe={class:"wf-main"},tGe=lt({__name:"WaitForTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=qt(),i=D(()=>t.tool.status),o=D(()=>Lc(t.tool.arg)),s=D(()=>Ci(o.value?.task_id)??Ci(o.value?.taskId)),r=D(()=>i.value==="error"?null:Goe(t.tool.output)),l={completed:"conversation.notification.status.completed",failed:"conversation.notification.status.failed",timed_out:"conversation.notification.status.timed_out",killed:"conversation.notification.status.killed",lost:"conversation.notification.status.lost"},a=D(()=>{const w=r.value?.finishedStatus;if(!w)return"";const C=l[w];return C?n(C):w}),u=D(()=>{switch(r.value?.finishedStatus){case"completed":return"success";case"failed":case"lost":return"danger";case"timed_out":case"killed":return"warning";default:return"neutral"}}),c=D(()=>t.tool.output?.find(w=>w.trim().length>0)??""),d=D(()=>{if(i.value==="running")return s.value?n("tools.waitfor.waitingTask",{id:s.value}):n("tools.waitfor.waitingAny");if(i.value==="error")return c.value;const w=r.value;if(!w)return s.value??c.value;switch(w.status){case"completed":return w.finishedDescription??w.taskId??"";case"timed_out":return w.runningCount>0?n("tools.waitfor.stillRunning",{count:w.runningCount}):n("tools.waitfor.timedOut");case"no_tasks":return n("tools.waitfor.noTasks")}}),f=D(()=>{const w=r.value;return!w||w.status==="no_tasks"?"":Fu(w.waitedMs)}),h=D(()=>f.value||t.tool.timing||"");function m(w){if(w.runningSamples.length===0)return null;const C=[...w.runningSamples],T=w.runningCount-w.runningSamples.length;return T>0&&C.push(n("tools.waitfor.moreRunning",{count:T})),C.join(", ")}const g=D(()=>{const w=r.value;if(!w)return null;if(w.status==="completed"){const C=[w.taskId,a.value].filter(S=>S).join(" · "),T=[];w.finishedDescription&&T.push(w.finishedDescription);const N=[];w.extraCount>0&&N.push(n("tools.waitfor.moreFinished",{count:w.extraCount})),w.runningCount>0&&N.push(n("tools.waitfor.stillRunning",{count:w.runningCount})),N.length>0&&T.push(N.join(" · "));const I=m(w);return I!==null&&T.push(I),{main:C,subs:T}}if(w.status==="timed_out"){if(w.runningCount===0&&w.extraCount===0)return null;const C=w.runningCount>0?n("tools.waitfor.stillRunning",{count:w.runningCount}):n("tools.waitfor.moreFinished",{count:w.extraCount}),T=[];w.runningCount>0&&w.extraCount>0&&T.push(n("tools.waitfor.moreFinished",{count:w.extraCount}));const N=m(w);return N!==null&&T.push(N),{main:C,subs:T}}return null}),v=D(()=>!!t.tool.output&&t.tool.output.length>0),y=D(()=>g.value!==null||v.value),b=V(t.tool.defaultExpanded===!0&&y.value);return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&y.value&&(b.value=!0)}),(w,C)=>(k(),de(ba,{status:i.value,open:b.value,expandable:y.value,onToggle:C[0]||(C[0]=T=>b.value=!b.value)},{leading:ce(()=>[U(p(Ce),{name:"clock",size:"sm"})]),trailing:ce(()=>[r.value?.status==="timed_out"?(k(),de(p(ul),{key:0,variant:"warning",size:"sm"},{default:ce(()=>[$e(F(p(n)("tools.waitfor.timedOut")),1)]),_:1})):r.value?.status==="completed"&&a.value?(k(),de(p(ul),{key:1,variant:u.value,size:"sm"},{default:ce(()=>[$e(F(a.value),1)]),_:1},8,["variant"])):ee("",!0),h.value?(k(),L("span",JZe,F(h.value),1)):ee("",!0)]),body:ce(()=>[g.value?(k(),L("div",XZe,[A("div",eGe,F(g.value.main),1),(k(!0),L(De,null,Ct(g.value.subs,(T,N)=>(k(),L("div",{key:N,class:"wf-sub"},F(T),1))),128))])):ee("",!0),v.value?(k(),de(wl,{key:1,lines:e.tool.output,"empty-text":i.value==="running"?p(n)("tools.output.waiting"):p(n)("tools.output.empty")},null,8,["lines","empty-text"])):ee("",!0)]),default:ce(()=>[A("span",QZe,F(p(Kh)(e.tool.name)),1),d.value?(k(),L("span",YZe,F(d.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),nGe=xt(tGe,[["__scopeId","data-v-3a167d7c"]]),iGe={class:"tl-name"},oGe={key:0},sGe={key:1,class:"tl-dim"},rGe={key:0,class:"fetch-url"},lGe=lt({__name:"WebFetchTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=qt(),i=D(()=>t.tool.status),o=D(()=>{const u=Lc(t.tool.arg);return Ci(u?.url)??Ci(u?.uri)??""}),s=D(()=>o.value?Ist(o.value):""),r=D(()=>!!t.tool.output&&t.tool.output.length>0),l=D(()=>r.value),a=V(t.tool.defaultExpanded===!0&&l.value);return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&l.value&&(a.value=!0)}),(u,c)=>(k(),de(ba,{status:i.value,open:a.value,expandable:l.value,onToggle:c[0]||(c[0]=d=>a.value=!a.value)},{leading:ce(()=>[U(p(Ce),{name:"globe",size:"sm"})]),body:ce(()=>[o.value?(k(),L("div",rGe,F(o.value),1)):ee("",!0),U(wl,{lines:e.tool.output,"empty-text":p(n)("tools.output.waiting")},null,8,["lines","empty-text"])]),default:ce(()=>[A("span",iGe,F(p(n)("tools.label.web_fetch")),1),s.value?(k(),L("span",oGe,F(s.value),1)):(k(),L("span",sGe,F(e.tool.arg),1))]),_:1},8,["status","open","expandable"]))}}),aGe=xt(lGe,[["__scopeId","data-v-214a8617"]]);function uGe(e){if(e.media&&e.status==="ok")return UKe;switch(Mr(e.name)){case"bash":return HVe;case"read":return fZe;case"edit":case"write":case"multi_edit":return YVe;case"grep":case"search":return FKe;case"glob":case"ls":return mKe;case"web_fetch":return aGe;case"todo":return GZe;case"task":return cVe;case"agentswarm":return PZe;case"askuserquestion":return BVe;case"exitplanmode":return sZe;case"creategoal":case"getgoal":case"setgoalbudget":case"updategoal":return AKe;case"waitfor":return nGe;default:return sKe}}const fS=lt({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia","detach"],setup(e,{emit:t}){const n=e,i=t,o=D(()=>uGe(n.tool));return(s,r)=>(k(),de(Po(o.value),{tool:e.tool,mobile:e.mobile,onOpenMedia:r[0]||(r[0]=l=>i("openMedia",l)),onDetach:r[1]||(r[1]=l=>i("detach",l))},null,40,["tool","mobile"]))}}),cGe=["aria-label"],dGe=["title"],fGe={key:0,class:"ar-sep"},hGe=["inert"],pGe={class:"ar-body-inner"},mGe=lt({__name:"ActivityRun",props:{items:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},forceOpen:{type:Boolean,default:!1}},emits:["openMedia","detach"],setup(e,{emit:t}){const n=e,i=t,o=D(()=>n.items.at(-1)),s=D(()=>{const x=o.value;if(n.streaming&&x?.kind==="thinking")return x;for(let E=n.items.length-1;E>=0;E--){const M=n.items[E];if(M?.kind==="tool"&&M.tool.status==="running")return M}return null}),r=D(()=>{if(n.streaming)return"running";for(const x of n.items)if(x.kind==="tool"&&x.tool.status==="running")return"running";for(const x of n.items)if(x.kind==="tool"&&x.tool.status==="error")return"error";return"done"}),l=V(r.value==="running"),{activityRunFolding:a}=Kx(),u=D(()=>n.forceOpen||!a.value||l.value),c=Jt(df,()=>{}),d=V(null),f=V(null),h=V(void 0),m=V(Date.now()),g=D(()=>{let x=null;for(const E of n.items)if(E.kind==="thinking"&&E.startedAt!==void 0){const M=Date.parse(E.startedAt);Number.isFinite(M)&&(x===null||M{if(x==="running"){E!==void 0&&E!=="running"&&(l.value=!0),f.value===null&&(f.value=g.value??Date.now()),h.value=void 0,m.value=Date.now();const R=setInterval(()=>{m.value=Date.now()},1e3);M(()=>clearInterval(R));return}E==="running"&&(l.value=!1,f.value!==null&&(h.value=Date.now()-f.value),f.value=null)},{immediate:!0}),We(a,()=>{l.value=r.value==="running"});function v(){if(n.forceOpen||(l.value=!l.value,n.streaming))return;const x=d.value;x&&ht(()=>c(x))}const y=D(()=>{if(r.value==="done")return"check";if(r.value==="error")return"close";const x=s.value??o.value;return x?x.kind==="thinking"?"thinking":_Z(x.tool.name):"tool"}),b=D(()=>$st(n.items,s.value)),w=D(()=>Rst(n.items,{durationMs:h.value})),C=D(()=>r.value!=="running"||f.value===null?"":Fu(m.value-f.value)),T=D(()=>{if(r.value!=="running")return w.value.clauses;const x=[];return b.value.current&&x.push(b.value.current),x.push(...b.value.done),C.value&&x.push({fragments:[{text:C.value,tone:"faint"}]}),x}),N=D(()=>r.value!=="running"?w.value.plain:[b.value.plain,C.value].filter(Boolean).join(" · "));function I(x){if(x==="danger")return"ar-danger";if(x==="faint")return"ar-faint"}function S(x){return x.kind==="tool"?EZ(x):`thinking-${x.sourceIndex}`}function _(x){return n.streaming&&x.kind==="thinking"&&x.durationMs===void 0&&x.sourceIndex===o.value?.sourceIndex}return(x,E)=>(k(),L("div",{class:Re(["activity-run",{open:u.value}])},[e.forceOpen||p(a)?(k(),de(Po(e.forceOpen?"div":"button"),ui({key:0,ref_key:"headEl",ref:d,class:["ar-head",{"is-static":e.forceOpen}]},e.forceOpen?{}:{type:"button","aria-expanded":u.value},{onClick:v}),{default:ce(()=>[A("span",{class:Re(["ar-glyph",{run:r.value==="running",err:r.value==="error",ok:r.value==="done"}]),role:"status","aria-label":r.value},[U(p(Ce),{name:y.value,size:"sm","aria-hidden":"true"},null,8,["name"])],10,cGe),A("span",{class:"ar-sum",title:N.value},[(k(!0),L(De,null,Ct(T.value,(M,R)=>(k(),L(De,{key:R},[R>0?(k(),L("span",fGe," · ")):ee("",!0),(k(!0),L(De,null,Ct(M.fragments,(q,z)=>(k(),L("span",{key:z,class:Re(I(q.tone))},F(q.text),3))),128))],64))),128))],8,dGe),e.forceOpen?ee("",!0):(k(),de(p(Ce),{key:0,class:"ar-car",name:"chevron-right",size:"sm","aria-hidden":"true"}))]),_:1},16,["class"])):ee("",!0),A("div",{class:Re(["ar-body",{open:u.value}]),inert:!u.value},[A("div",pGe,[(k(!0),L(De,null,Ct(e.items,M=>(k(),L(De,{key:S(M)},[M.kind==="thinking"?(k(),de(cS,{key:0,text:M.thinking,mobile:e.mobile,streaming:_(M),"started-at":M.startedAt,"duration-ms":M.durationMs,"instant-reveal":e.forceOpen},null,8,["text","mobile","streaming","started-at","duration-ms","instant-reveal"])):(k(),de(fS,{key:1,tool:M.tool,mobile:e.mobile,onOpenMedia:E[0]||(E[0]=R=>i("openMedia",R)),onDetach:E[1]||(E[1]=R=>i("detach",R))},null,8,["tool","mobile"]))],64))),128))])],10,hGe)],2))}}),cZ=xt(mGe,[["__scopeId","data-v-0970b9ea"]]),gGe={class:"msg-time"},vGe=lt({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=qt(),i=D(()=>qO(t.time,n("conversation.yesterday")));return(o,s)=>(k(),L("span",gGe,F(i.value),1))}}),hS=xt(vGe,[["__scopeId","data-v-182ed7d4"]]),yGe={class:"ntf-list"},kGe={class:"ntn-head"},bGe={class:"ntn-head-text"},wGe={class:"ntn-bubble"},CGe={key:0,class:"ntn-line"},AGe={key:1,class:"ntn-line ntn-body"},xGe={key:2,class:"ntn-line ntn-out"},SGe=["title"],_Ge={key:0,class:"ntn-out-size"},MGe=["onClick"],IGe={key:3,class:"ntn-line ntn-preview"},TGe={key:0,class:"ntn-preview-cap"},EGe={key:1,class:"ntn-preview-text"},LGe={class:"ntn-line ntn-raw"},NGe={class:"ntn-raw-in"},DGe={class:"ntn-raw-fields"},FGe={class:"k"},BGe={class:"v"},RGe={class:"k"},$Ge={class:"v"},OGe={class:"k"},PGe={class:"v"},zGe={class:"ntn-raw-pre"},jGe={class:"ntn-meta"},HGe=lt({__name:"NotificationCard",props:{items:{}},setup(e){const{t}=qt(),n={completed:"check",failed:"alert-triangle",timed_out:"clock",killed:"stop",lost:"alert-triangle",info:"info"};function i(v,y){return v.id!==""?`${v.id}#${y}`:`ntf-${y}`}function o(v){const y=UC(v);return y==="info"&&v.sourceKind==="subagent"?"robot":n[y]}function s(v){return v.sourceKind==="subagent"?t("conversation.notification.kindSubagent"):t("conversation.notification.kindTask")}function r(v){return t(`conversation.notification.title.${UC(v)}`,{kind:s(v)})}function l(v){return Qwe(v)}function a(v){return v.sourceKind==="subagent"&&v.agentId!==void 0&&v.agentId!==""?v.agentId:v.sourceId}function u(v){const y=a(v);return y===""?r(v):`${r(v)} · ${y}`}function c(v){return v<1024?`${v} B`:v<1024*1024?`${(v/1024).toFixed(1)} KB`:`${(v/1024/1024).toFixed(1)} MB`}function d(v){const y=v.outputPreview;if(!y)return"";const b=[];return y.truncated===!0&&b.push(t("conversation.notification.outputTruncated")),y.bytes!==void 0&&b.push(y.totalBytes!==void 0&&y.totalBytes!==y.bytes?`${c(y.bytes)} / ${c(y.totalBytes)}`:c(y.bytes)),b.join(" · ")}function f(v){return v.outputPreview!==void 0&&(v.outputPreview.text!==""||d(v)!=="")}const h=V(null);let m=null;async function g(v,y){await Es(v)&&(h.value=y,m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,h.value=null},1200))}return(v,y)=>(k(),L("div",yGe,[(k(!0),L(De,null,Ct(e.items,(b,w)=>(k(),L("div",{key:i(b,w),class:Re(["ntn",l(b)]),role:"status"},[A("div",kGe,[U(p(Ce),{name:o(b),size:"sm",class:"ntn-ico","aria-hidden":"true"},null,8,["name"]),A("span",bGe,F(u(b)),1)]),A("div",wGe,[b.title?(k(),L("div",CGe,F(b.title),1)):ee("",!0),b.body?(k(),L("div",AGe,F(b.body),1)):ee("",!0),b.outputFile?(k(),L("div",xGe,[U(p(Ce),{class:"ntn-out-ic",name:"file-text",size:"sm","aria-hidden":"true"}),A("span",{class:"ntn-out-path",title:b.outputFile.path},F(b.outputFile.path),9,SGe),b.outputFile.bytes!==void 0?(k(),L("span",_Ge,F(c(b.outputFile.bytes)),1)):ee("",!0),A("button",{class:"ntn-out-copy",type:"button",onClick:C=>g(b.outputFile.path,i(b,w))},F(h.value===i(b,w)?p(t)("conversation.notification.copied"):p(t)("conversation.notification.copyPath")),9,MGe)])):ee("",!0),f(b)?(k(),L("div",IGe,[d(b)!==""?(k(),L("div",TGe,F(d(b)),1)):ee("",!0),b.outputPreview?.text?(k(),L("pre",EGe,F(b.outputPreview.text),1)):ee("",!0)])):ee("",!0),A("details",LGe,[A("summary",null,[U(p(Ce),{class:"ntn-raw-car",name:"chevron-right",size:"sm","aria-hidden":"true"}),A("span",null,F(p(t)("conversation.notification.rawPayload")),1)]),A("div",NGe,[A("div",DGe,[A("span",FGe,F(p(t)("conversation.notification.fields.type")),1),A("span",BGe,F(b.type),1),A("span",RGe,F(p(t)("conversation.notification.fields.source")),1),A("span",$Ge,F(b.sourceKind)+" · "+F(b.sourceId),1),A("span",OGe,F(p(t)("conversation.notification.fields.severity")),1),A("span",PGe,F(b.severity||"—"),1)]),A("pre",zGe,F(b.raw),1)])])]),A("div",jGe,[b.createdAt?(k(),de(hS,{key:0,time:b.createdAt},null,8,["time"])):ee("",!0)])],2))),128))]))}}),dZ=xt(HGe,[["__scopeId","data-v-2962a217"]]),WGe=["aria-expanded"],qGe=["title"],UGe=["inert"],VGe={class:"tf-body-inner"},KGe={key:1,class:"msg"},ZGe=lt({__name:"TurnFold",props:{items:{},mobile:{type:Boolean,default:!1},streamingTailIndex:{default:null},live:{type:Boolean,default:!1},parked:{type:Boolean,default:!1},seedMs:{default:void 0},createdMs:{default:void 0},endedMs:{default:void 0},durationMs:{default:void 0}},emits:["openMedia","detach"],setup(e,{emit:t}){const n=e,i=t,o=Jt(qo),{t:s}=qt(),r=D(()=>n.streamingTailIndex!==null),l=D(()=>n.live?n.parked?"parked":"live":"settled"),a=V(!1),u=D(()=>r.value||a.value),c=V(u.value),d=V(u.value);let f=null;We(u,S=>{if(S){if(f!==null&&(clearTimeout(f),f=null),c.value){d.value=!0;return}c.value=!0,requestAnimationFrame(()=>{requestAnimationFrame(()=>{d.value=!0})});return}d.value=!1,f=setTimeout(()=>{f=null,c.value=!1},200)});const h=Jt(df,()=>{}),m=V(null),g=V(Date.now());let v=null;function y(){v!==null&&(clearInterval(v),v=null)}Ln(()=>{y(),f!==null&&clearTimeout(f)}),We(l,(S,_)=>{S!=="settled"?(g.value=Date.now(),v===null&&(v=setInterval(()=>{g.value=Date.now()},1e3))):y(),_==="live"&&S!=="live"&&(a.value=!1)},{immediate:!0});const b=D(()=>n.seedMs===void 0?n.createdMs:n.createdMs===void 0?n.seedMs:Math.min(n.seedMs,n.createdMs)),w=D(()=>kst({startMs:b.value,endedMs:n.endedMs,durationMs:n.durationMs,state:l.value==="settled"?{phase:"settled"}:{phase:"live",nowMs:g.value}}));function C(){a.value=!a.value,ht(()=>{const S=m.value;S&&h(S)})}const T=D(()=>{const S=w.value===void 0?"":Fu(w.value);return S?s("conversation.fold.worked",{duration:S}):s("conversation.fold.workedUnknown")});function N(S){return n.streamingTailIndex===null||S.kind==="thinking"&&S.durationMs!==void 0?!1:S.sourceIndex===n.streamingTailIndex}function I(S){if(n.streamingTailIndex===null)return!1;const _=S.items.at(-1);return _?.kind==="thinking"&&_.durationMs!==void 0?!1:_!==void 0&&_.sourceIndex===n.streamingTailIndex}return(S,_)=>e.items.length>0?(k(),L("div",{key:0,class:Re(["turn-fold",{open:u.value,streaming:r.value}])},[r.value?ee("",!0):(k(),L("button",{key:0,ref_key:"headEl",ref:m,class:"tf-head",type:"button","aria-expanded":a.value,onClick:C},[A("span",{class:"tf-sum",title:T.value},F(T.value),9,qGe),U(p(Ce),{class:"tf-car",name:"chevron-right",size:"sm","aria-hidden":"true"})],8,WGe)),c.value?(k(),L("div",{key:1,class:Re(["tf-body",{open:d.value}]),inert:!u.value},[A("div",VGe,[(k(!0),L(De,null,Ct(e.items,(x,E)=>(k(),L(De,{key:p(LZ)(x,E)},[x.kind==="thinking"?(k(),de(cS,{key:0,text:x.thinking,mobile:e.mobile,streaming:N(x),"started-at":x.startedAt,"duration-ms":x.durationMs},null,8,["text","mobile","streaming","started-at","duration-ms"])):x.kind==="text"&&x.text?(k(),L("div",KGe,[U(p(Sc),{text:x.text,streaming:N(x),"open-file":p(o)?.openFile},null,8,["text","streaming","open-file"])])):x.kind==="activity-run"?(k(),de(cZ,{key:2,items:x.items,mobile:e.mobile,streaming:I(x),onOpenMedia:_[0]||(_[0]=M=>i("openMedia",M)),onDetach:_[1]||(_[1]=M=>i("detach",M))},null,8,["items","mobile","streaming"])):x.kind==="tool"?(k(),de(fS,{key:3,tool:x.tool,mobile:e.mobile,onOpenMedia:_[2]||(_[2]=M=>i("openMedia",M)),onDetach:_[3]||(_[3]=M=>i("detach",M))},null,8,["tool","mobile"])):x.kind==="notification"?(k(),de(dZ,{key:4,items:x.items},null,8,["items"])):ee("",!0)],64))),128))])],10,UGe)):ee("",!0)],2)):ee("",!0)}}),GGe=xt(ZGe,[["__scopeId","data-v-d69de1b5"]]),QGe={class:"turn-files"},YGe={class:"tf-ic","aria-hidden":"true"},JGe={class:"tf-title"},XGe={key:0,class:"tf-stats"},eQe={key:0,class:"tf-add"},tQe={key:1,class:"tf-del"},nQe={class:"diffbar","aria-hidden":"true"},iQe={class:"tf-list"},oQe={key:0,class:"tf-dir"},sQe={class:"tf-base"},rQe={key:0,class:"tf-stats"},lQe={key:0,class:"tf-add"},aQe={key:1,class:"tf-del"},T5=3,uQe=lt({__name:"TurnFilesSummary",props:{changes:{},turnId:{},cwd:{},interactive:{type:Boolean,default:!0}},setup(e){const t=e,n=Jt(qo),{t:i}=qt(),o=D(()=>t.interactive!==!1),s=D(()=>{const w=t.changes.length;return i(w===1?"conversation.turnFiles.titleOne":"conversation.turnFiles.titleOther",{number:w})}),r=D(()=>t.changes.some(w=>w.statsIncomplete)),l=D(()=>{let w=0,C=0;for(const T of t.changes)w+=T.added,C+=T.removed;return{added:w,removed:C}}),a=D(()=>!r.value&&(l.value.added>0||l.value.removed>0)),u=V(!1),c=D(()=>u.value?t.changes:t.changes.slice(0,T5)),d=D(()=>Math.max(0,t.changes.length-T5)),f=D(()=>t.changes.length>T5),h=D(()=>u.value?i("conversation.turnFiles.showLess"):d.value===1?i("conversation.turnFiles.moreOne"):i("conversation.turnFiles.more",{number:d.value}));function m(w){const C=t.cwd?Ak(w,t.cwd):null;return C!==null?C||Mc(w):w}function g(w){const C=m(w),T=Math.max(C.lastIndexOf("/"),C.lastIndexOf("\\"));return T>0?C.slice(0,T+1):""}function v(w){const C=m(w),T=Math.max(C.lastIndexOf("/"),C.lastIndexOf("\\"));return T>=0?C.slice(T+1):C}function y(w){return w.statsIncomplete||w.added===0&&w.removed===0?null:{added:w.added,removed:w.removed}}function b(w){w.hasWrite?n?.openFile({path:w.path}):n?.openTurnDiff({turnId:t.turnId,change:w})}return(w,C)=>(k(),L("div",QGe,[U(p(Pne),null,l$({head:ce(()=>[A("span",YGe,[U(p(Ce),{name:"pencil",size:"sm"})]),A("span",JGe,F(s.value),1),a.value?(k(),L("span",XGe,[l.value.added>0?(k(),L("span",eQe,"+"+F(l.value.added),1)):ee("",!0),l.value.removed>0?(k(),L("span",tQe,"−"+F(l.value.removed),1)):ee("",!0),A("span",nQe,[A("span",{class:"seg-add",style:on({flexGrow:l.value.added})},null,4),A("span",{class:"seg-del",style:on({flexGrow:l.value.removed})},null,4)])])):ee("",!0)]),default:ce(()=>[A("ul",iQe,[(k(!0),L(De,null,Ct(c.value,T=>(k(),L("li",{key:T.path,class:"tf-row"},[(k(),de(Po(o.value?"button":"span"),{class:"tf-file",type:o.value?"button":void 0,onClick:N=>o.value&&b(T)},{default:ce(()=>[g(T.path)?(k(),L("span",oQe,F(g(T.path)),1)):ee("",!0),A("span",sQe,F(v(T.path)),1)]),_:2},1032,["type","onClick"])),y(T)?(k(),L("span",rQe,[y(T).added>0?(k(),L("span",lQe,"+"+F(y(T).added),1)):ee("",!0),y(T).removed>0?(k(),L("span",aQe,"−"+F(y(T).removed),1)):ee("",!0)])):ee("",!0)]))),128))])]),_:2},[f.value?{name:"foot",fn:ce(()=>[U(p(sn),{variant:"ghost",size:"sm",class:"tf-more","aria-expanded":u.value,onClick:C[0]||(C[0]=T=>u.value=!u.value)},{default:ce(()=>[$e(F(h.value)+" ",1),U(p(Ce),{class:Re(["tf-more-car",{open:u.value}]),name:"chevron-down",size:"sm","aria-hidden":"true"},null,8,["class"])]),_:1},8,["aria-expanded"])]),key:"0"}:void 0]),1024)]))}}),cQe=xt(uQe,[["__scopeId","data-v-c82a66d2"]]),dQe=["data-turn-id"],fQe=["title"],hQe={class:"cn-head-text"},pQe={key:0,class:"cn-bubble"},mQe={class:"cn-prompt"},gQe={key:1,class:"cn-meta"},vQe=lt({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=qt(),i=D(()=>t.cron),o=D(()=>i.value?.missedCount!==void 0),s=D(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=D(()=>{const f=i.value;return!f?.cron||f.recurring===!1?"":f.cron}),l=D(()=>o.value?"error":"ok"),a=D(()=>{const f=i.value;if(!f)return"";const h=[];return f.recurring===!1&&h.push(n("conversation.cron.oneShot")),typeof f.coalescedCount=="number"&&f.coalescedCount>1&&h.push(n("conversation.cron.coalesced",{n:f.coalescedCount})),f.missedCount!==void 0&&h.push(n("conversation.cron.missedCount",{n:f.missedCount})),f.stale===!0&&h.push(n("conversation.cron.finalDelivery")),h.join(" · ")}),u=D(()=>{const f=[s.value];return r.value&&f.push(r.value),a.value&&f.push(a.value),f.join(" · ")}),c=D(()=>{const f=i.value?.jobId;return f?n("conversation.cron.job",{id:f}):void 0}),d=D(()=>t.text??"");return(f,h)=>(k(),L("div",{class:Re(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[A("div",{class:Re(["cn-head",l.value]),title:c.value},[U(p(Ce),{name:"clock",size:"sm",class:"cn-head-ico","aria-hidden":"true"}),A("span",hQe,F(u.value),1)],10,fQe),d.value?(k(),L("div",pQe,[A("span",mQe,F(d.value),1)])):ee("",!0),e.createdAt?(k(),L("div",gQe,[U(hS,{time:e.createdAt},null,8,["time"])])):ee("",!0)],10,dQe))}}),yQe=xt(vQe,[["__scopeId","data-v-bbd9b071"]]);function kQe(e){return e!==""&&cA(e).trim()===""?"":yd(e)}function bQe(e){const{text:t,rewritten:n,blocked:i,assembly:o,skillMentions:s,skills:r,skillsLoaded:l,working:a,running:u,queueLength:c,goalMode:d}=e;if(!t&&o.promptAttachments.length===0)return{kind:"noop"};const f=cA(t).trim(),h=t!==""&&f===""?"":yd(n);if(f==="/plan")return{kind:"mode",mode:"plan",historyText:f};if(f==="/goal")return{kind:"mode",mode:"goal",historyText:f};if(f==="/swarm")return{kind:"mode",mode:"swarm",historyText:f};if(t){const m=HI(cA(t))?.cmd,g=m?Ple(MP(r),m):void 0,v=s.length===1&&l&&!r.some(y=>y.name===s[0].name);if(s.length===1&&!v&&!a&&!u&&c===0&&!g&&!d){if(i)return{kind:"noop"};const y=s[0];return{kind:"skill-activation",cmd:`/${gc}${y.name} ${Fp(n).trim()}`,skillName:y.name,restoreText:t,attachments:o.promptAttachments,historyText:h}}if(m&&g){if(g.isSkill===!0){if(i)return{kind:"noop"};const w=Fp(n.slice(m.length)).trim();return{kind:"skill-command",cmd:w?`${m} ${w}`:m,skillName:B6(g.name),restoreText:t,attachments:o.promptAttachments,historyText:h}}if(g.noArgs===!0)return(HI(f)??{arg:""}).arg.trim()!==""?{kind:"invalid-command",cmd:m}:{kind:"builtin-command",cmd:m,leave:m==="/new"||m==="/clear",historyText:m,restoreText:t};const y=Fp(t.slice(m.length)).trim();return{kind:"builtin-command",cmd:yd(y?`${m} ${y}`:m),leave:m==="/new"||m==="/clear",historyText:yd(t),restoreText:t,editText:yd(t.slice(m.length)).trim()}}if(m?.startsWith(`/${gc}`)){if(i)return{kind:"noop"};const y=Fp(n.slice(m.length)).trim();return{kind:"unresolved-skill-command",cmd:y?`${m} ${y}`:m,restoreText:t,attachments:o.promptAttachments,historyText:h}}}return i?{kind:"noop"}:{kind:"submit",text:Fp(n).trim(),restoreText:t,editText:n,attachments:o.promptAttachments,historyText:h}}let mb=!1,gb=0,RB=!1;const wQe=100;function CQe(){mb=!0,gb=0}function AQe(){mb=!1,gb=Date.now()}function $B(){mb=!1,gb=0}function pS(){RB||typeof document>"u"||(RB=!0,document.addEventListener("compositionstart",CQe,!0),document.addEventListener("compositionend",AQe,!0),document.addEventListener("focusin",$B,!0),document.addEventListener("focusout",$B,!0))}function mS(e){return mb||e.isComposing||e.keyCode===229||Date.now()-gbnull);if(r===null)return s?.close(),"failed";const l=URL.createObjectURL(new Blob([r],{type:o}));if(s!==null)s.location.href=l;else{const a=document.createElement("a");a.href=l,a.download=n??t,a.click()}return setTimeout(()=>{URL.revokeObjectURL(l)},6e4),"previewed"}/*! +`),Sn=()=>{if(He.length===0)return;const mn=e.queuedBySession[Y]??[];e.queuedBySession={...e.queuedBySession,[Y]:[...He,...mn]}},Un=await no(Y,wn,Xe);Un==="rejected"&&Sn(),Un!=="ok"&&Ko(Y)}async function Mi(Y){const ge=e.activeSessionId;if(!ge)return;const Be=(e.queuedBySession[ge]??[])[Y];if(Be===void 0)return;const He=Be.id??Be.text,Xe=(bg.get(ge)??Promise.resolve()).catch(()=>{}).then(()=>Ni(ge,He));return bg.set(ge,Xe),Xe}async function Ni(Y,ge){const Be=e.queuedBySession[Y]??[],He=Be.findIndex(Kt=>(Kt.id??Kt.text)===ge),Qe=He>=0?Be[He]:void 0;if(Qe===void 0)return;const Xe=Qe.attachments??[];if(Qe.text.trim().length===0&&Xe.length===0)return;const yt=[...Be];yt.splice(He,1),e.queuedBySession={...e.queuedBySession,[Y]:yt};const Rt=await no(Y,Qe.text,Xe);if(Rt==="rejected"&&e.sessions.some(Kt=>Kt.id===Y)){const wn=[...e.queuedBySession[Y]??[]];wn.splice(Math.min(He,wn.length),0,Qe),e.queuedBySession={...e.queuedBySession,[Y]:wn}}Rt!=="ok"&&Ko(Y)}async function _n(Y,ge,Be){try{const Qe=await Zt().uploadFile({file:Y,name:ge,onProgress:Be});return{fileId:Qe.id,name:Qe.name,mediaType:Qe.mediaType}}catch(He){return r("uploadImage",He),null}}function gs(Y,ge,Be){const He=e.activeSessionId;if(!He)return;const Qe=e.queuedBySession[He]??[],Xe={text:Y,attachments:ge,editText:Be,id:kje()};e.queuedBySession={...e.queuedBySession,[He]:[...Qe,Xe]}}function qs(Y){if((Xu.get(Y)??0)>0)return;const[ge,...Be]=e.queuedBySession[Y]??[];ge!==void 0&&(e.queuedBySession={...e.queuedBySession,[Y]:Be},fi(Y,ge.text,ge.attachments).then(He=>{if(He==="ok"){Hf.delete(Y);return}if(He==="uncertain"){Hf.delete(Y);return}if(!e.sessions.some(Kt=>Kt.id===Y)){Hf.delete(Y);return}const Qe=ge.id??ge.text,Xe=Hf.get(Y),yt=Xe!==void 0&&Xe.key===Qe?Xe.count+1:1;if(yt>=gje){Hf.delete(Y),(e.queuedBySession[Y]?.length??0)>0&&qs(Y);return}Hf.set(Y,{key:Qe,count:yt});const Rt=e.queuedBySession[Y]??[];e.queuedBySession={...e.queuedBySession,[Y]:[ge,...Rt]}}))}function Xo(Y,ge){const Be=e.inFlightBySession[Y]===!0;e.inFlightBySession={...e.inFlightBySession,[Y]:!1};const He=e.optimisticMessagesBySession[Y];if(He!==void 0&&He.length>0){const Xe={...e.optimisticMessagesBySession};if(ge?.retireOptimistic==="all"){const yt=He.filter(Rt=>Rt.metadata?.["kimiWeb.uncertain"]===!0);yt.length>0?Xe[Y]=yt:delete Xe[Y],e.optimisticMessagesBySession=Xe}else{const yt=He.findIndex(Rt=>Rt.metadata?.["kimiWeb.uncertain"]!==!0);if(yt!==-1){const Rt=[...He.slice(0,yt),...He.slice(yt+1)];Rt.length>0?Xe[Y]=Rt:delete Xe[Y],e.optimisticMessagesBySession=Xe}}}if(e.promptIdBySession[Y]!==void 0){const Xe={...e.promptIdBySession};delete Xe[Y],e.promptIdBySession=Xe}if(e.abortPromptIdBySession?.[Y]!==void 0){const Xe={...e.abortPromptIdBySession};delete Xe[Y],e.abortPromptIdBySession=Xe}return(Be||ge?.turnWasActive===!0||(e.turnActiveBySession[Y]??!1))&&ge?.skipDrain!==!0&&qs(Y),Be}async function Us(){const Y=e.activeSessionId;if(!Y)return!1;const ge=e.sessions.find(Rt=>Rt.id===Y);let Be=e.abortPromptIdBySession?.[Y];if(Be===void 0){const Rt=ge?.currentPromptId;Rt!==void 0&&Rt.length>0&&!Rt.startsWith("pr_")&&(Be=Rt)}const He=Zt();let Qe=!1;const Xe=()=>{e.inFlightBySession={...e.inFlightBySession,[Y]:!1},e.turnActiveBySession={...e.turnActiveBySession,[Y]:!1}};if(Be!==void 0)try{if((await He.abortPrompt(Y,Be)).aborted)return!0;Qe=!0;const Kt={...e.promptIdBySession};delete Kt[Y],e.promptIdBySession=Kt;const wn={...e.abortPromptIdBySession};delete wn[Y],e.abortPromptIdBySession=wn,Xe()}catch(Rt){if(qi(Rt)&&Rt.code===rje){Qe=!0;const Kt={...e.promptIdBySession};delete Kt[Y],e.promptIdBySession=Kt;const wn={...e.abortPromptIdBySession};delete wn[Y],e.abortPromptIdBySession=wn,Xe()}else return r("abortCurrentPrompt",Rt,{sessionId:Y}),!1}if(Qe||!((e.inFlightBySession[Y]??!1)||(e.turnActiveBySession[Y]??!1)||(ge?.mainTurnActive??!1)))return!1;try{return(await He.abortSession(Y)).aborted===!0}catch(Rt){return r("abortCurrentPrompt",Rt,{sessionId:Y}),!1}}async function vo(Y,ge){const Be=e.activeSessionId;if(!Be||hy[Y])return;hy[Y]=!0;const He=e.approvalsBySession[Be]?.find(Qe=>Qe.approvalId===Y&&Qe.toolName==="ExitPlanMode")?.toolCallId;try{const Qe=Zt(),Xe={decision:ge.decision,scope:ge.scope,feedback:ge.feedback,selectedLabel:ge.selectedLabel};await Qe.respondApproval(Be,Y,Xe),ir().removePendingApproval(Be,Y),He!==void 0&&($(Be,He,{state:ge.decision,selectedOption:ge.selectedLabel,feedback:ge.feedback}),z(Be,He))}catch(Qe){k5(Qe)?(ir().removePendingApproval(Be,Y),He!==void 0&&z(Be,He)):r("respondApproval",Qe,{sessionId:Be})}finally{delete hy[Y]}}async function Ji(Y,ge){const Be=e.activeSessionId;if(Be&&!Ff[Y]){Ff[Y]="answer";try{await Zt().respondQuestion(Be,Y,ge),ir().removePendingQuestion(Be,Y)}catch(He){k5(He)?ir().removePendingQuestion(Be,Y):r("respondQuestion",He,{sessionId:Be})}finally{delete Ff[Y]}}}async function Oi(Y){const ge=e.activeSessionId;if(ge&&!Ff[Y]){Ff[Y]="dismiss";try{await Zt().dismissQuestion(ge,Y),ir().removePendingQuestion(ge,Y)}catch(Be){k5(Be)?ir().removePendingQuestion(ge,Y):r("dismissQuestion",Be,{sessionId:ge})}finally{delete Ff[Y]}}}async function $i(Y){const ge=e.activeSessionId;if(ge&&!b5[Y]){b5[Y]=!0;try{const Be=Zt(),He=(e.tasksBySession[ge]??[]).find(Xe=>Xe.id===Y)?.backgroundTaskId??E?.(ge,Y);await Be.cancelTask(ge,He??Y);const Qe=e.tasksBySession[ge]??[];e.tasksBySession={...e.tasksBySession,[ge]:Qe.map(Xe=>(He!==void 0?Xe.backgroundTaskId===He||Xe.id===He:Xe.id===Y||Xe.backgroundTaskId===Y)?{...Xe,status:"cancelled",completedAt:Xe.completedAt??new Date().toISOString(),completedAtEstimated:Xe.completedAt===void 0?!0:Xe.completedAtEstimated}:Xe)}}catch(Be){_B(Be)||r("cancelTask",Be,{sessionId:ge})}finally{delete b5[Y]}}}function je(Y,ge){return Y.parentToolCallId===ge&&Y.status==="running"&&Y.runInBackground!==!0}function Se(Y,ge){return(e.tasksBySession[Y]??[]).find(Be=>je(Be,ge))}async function Pe(Y){const ge=e.activeSessionId;if(ge&&!w5[Y]){w5[Y]=!0;try{const Be=Zt();let He=Se(ge,Y),Qe;if(He===void 0){let Kt;try{Kt=await Be.listTasks(ge)}catch(wn){r("detachTask",wn,{sessionId:ge});return}He=Kt.find(wn=>je(wn,Y)),Qe=He?.id}if(He===void 0)return;const Xe=He;Qe??=Xe.backgroundTaskId??E?.(ge,Xe.id)??Xe.id;const yt=await Be.detachTask(ge,Qe),Rt=e.tasksBySession[ge]??[];e.tasksBySession={...e.tasksBySession,[ge]:Rt.map(Kt=>Kt.id!==Xe.id||(Kt.backgroundTaskId??E?.(ge,Kt.id)??Kt.id)!==Qe?Kt:yt.status==="running"?{...Kt,runInBackground:!0}:{...Kt,status:yt.status,completedAt:Kt.completedAt??new Date().toISOString(),completedAtEstimated:Kt.completedAt===void 0?!0:Kt.completedAtEstimated})}}catch(Be){!hje(Be)&&!_B(Be)&&r("detachTask",Be,{sessionId:ge})}finally{delete w5[Y]}}}function on(Y){const ge=e.activeSessionId;ge?(e.planArmedBySession={...e.planArmedBySession,[ge]:Y},W(),!Y&&(e.planModeBySession[ge]??!1)&&(e.planModeBySession={...e.planModeBySession,[ge]:!1},gse(e,ge),B({planMode:!1},ge))):X.planMode=Y}function Zn(){const Y=e.activeSessionId,ge=Y?(e.planArmedBySession[Y]??!1)||(e.planModeBySession[Y]??!1):X.planMode;on(!ge)}function Gn(Y){const ge=e.activeSessionId;ge?(e.swarmModeBySession={...e.swarmModeBySession,[ge]:Y},Q(),aae(e,ge),B({swarmMode:Y})):X.swarmMode=Y}async function Xi(){const Y=e.activeSessionId,Be=!(Y?e.swarmModeBySession[Y]??!1:X.swarmMode);Be&&e.permission==="manual"&&!await n({title:li("workspace.swarmEnableTitle"),message:li("workspace.swarmEnableConfirm"),variant:"primary"})||Gn(Be)}function ti(Y){const ge=e.activeSessionId;ge?(e.goalModeBySession={...e.goalModeBySession,[ge]:Y},te()):X.goalMode=Y}function vs(){const Y=e.activeSessionId,ge=Y?e.goalModeBySession[Y]??!1:X.goalMode;ti(!ge)}async function ys(Y){const ge=Y.trim();if(!ge||e.permission==="manual"&&!await n({title:li("workspace.goalStartTitle"),message:li("workspace.goalStartConfirm",{objective:ge}),variant:"primary"}))return null;let Be=e.activeSessionId,He=null;if(!Be){const Qe=e.activeWorkspaceId,Xe=Qe&&H.value.some(yt=>yt.id===Qe)?Qe:H.value[0]?.id??null;if(!Xe)return null;try{Be=await In(Xe)??void 0,He=Be??null}catch(yt){return r("createGoal",yt),null}if(!Be)return null}try{await Zt().updateSession(Be,{goalObjective:ge,planMode:!1}),e.planModeBySession={...e.planModeBySession,[Be]:!1}}catch(Qe){return r("createGoal",Qe,{sessionId:Be,message:pe(Qe)}),He}return e.goalModeBySession[Be]&&(e.goalModeBySession={...e.goalModeBySession,[Be]:!1},te()),e.activeSessionId===Be?await Zi(ge):await fi(Be,ge),He}function Je(Y){const ge=e.activeSessionId;ge&&Promise.resolve(Zt().updateSession(ge,{goalControl:Y})).catch(Be=>{r("controlGoal",Be,{sessionId:ge,message:pe(Be)})})}function Ye(Y){e.permission=Y,ne(Y),B({permissionMode:Y})}function wt(Y){const ge=[...e.warnings];ge.splice(Y,1),e.warnings=ge}async function Bt(Y,ge){try{await Zt().updateSession(Y,{title:ge}),d(Y,He=>({...He,title:ge})),e.doneSessions.some(He=>He.id===Y)&&(e.doneSessions=e.doneSessions.map(He=>He.id===Y?{...He,title:ge}:He))}catch(Be){r("renameSession",Be,{sessionId:Y})}}async function Bn(Y){const ge=await Zt().generateSessionTitle(Y,{force:!0,source:"digest"});return ge===null?l({severity:"info",title:li("sidebar.genTitleUnavailable")}):e.doneSessions.some(Be=>Be.id===Y)&&(e.doneSessions=e.doneSessions.map(Be=>Be.id===Y?{...Be,title:ge}:Be)),ge}async function ci(Y,ge){const Be=e.workspaces.find(Qe=>Qe.id===Y)?.root,He=()=>{e.workspaces=e.workspaces.map(Qe=>Qe.id===Y?{...Qe,name:ge}:Qe)};try{if(await Zt().updateWorkspace(Y,{name:ge}),Be!==void 0){const Qe=A2();Be in Qe&&(delete Qe[Be],YI(Qe))}He()}catch(Qe){if(Be!==void 0&&qi(Qe)&&Qe.code===lje){YI({...A2(),[Be]:ge}),He();return}r("renameWorkspace",Qe)}}async function Ro(Y){const ge=e.workspaces.find(Xe=>Xe.id===Y)?.root??P.value.find(Xe=>Xe.id===Y)?.root??Y,Be=e.activeSessionId?e.sessions.find(Xe=>Xe.id===e.activeSessionId):void 0,He=e.activeWorkspaceId===Y||e.activeWorkspaceId===ge,Qe=!!(Be&&(Be.cwd===ge||Be.workspaceId===Y||G(Be)===Y));ge&&!e.hiddenWorkspaceRoots.includes(ge)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,ge],se(e.hiddenWorkspaceRoots));try{await Zt().deleteWorkspace(Y)}catch(Xe){Ua("[kimi-code] deleteWorkspace registry cleanup failed for",Y,Xe)}if(e.workspaces=e.workspaces.filter(Xe=>Xe.id!==Y&&Xe.root!==ge),He||Qe){const Xe=H.value[0]?.id??null;if(e.activeWorkspaceId=Xe,Xe)ce(Xe);else try{xr(xn.activeWorkspace)}catch{}}(He||Qe)&&(v(void 0),e.sessionLoading=!1,er().clearFileDiff(),Ei(void 0,"replace"))}const yo=500,ni=new Set;function Oo(Y){if(!ni.has(Y)){if(ni.size>=yo){const ge=ni.values().next().value;ge!==void 0&&ni.delete(ge)}ni.add(Y)}}const gi=new Set;function cr(Y){if(!gi.has(Y)){if(gi.size>=yo){const ge=gi.values().next().value;ge!==void 0&&gi.delete(ge)}gi.add(Y)}}const $o=new Map;function ko(Y){if($o.has(Y)&&$o.delete(Y),$o.size>=yo){const ge=$o.keys().next().value;ge!==void 0&&$o.delete(ge)}$o.set(Y,Date.now())}const Bs=new Set,Vs=new Set;async function ks(Y,ge){const Be=new Set(Y);if(ge){for(const yt of Y)Oo(yt);const Qe=new Date().toISOString(),Xe=e.sessions.filter(yt=>Be.has(yt.id));Xe.length>0&&(e.doneSessions=[...Xe.map(yt=>({...yt,archived:!0,archivedAt:Qe})),...e.doneSessions.filter(yt=>!Be.has(yt.id))]);for(const yt of Y)m(yt),t9.delete(yt);if(e.activeSessionId!==void 0&&Be.has(e.activeSessionId)){const yt=e.sessions[0];yt?await to(yt.id,{urlMode:"replace",skipTrack:!0}):(v(void 0),Ei(void 0,"replace"))}return}for(const Qe of Y)ni.delete(Qe),cr(Qe),ko(Qe);const He=e.doneSessions.filter(Qe=>Be.has(Qe.id));e.doneSessions=e.doneSessions.filter(Qe=>!Be.has(Qe.id));for(const Qe of He)e.sessions.some(Xe=>Xe.id===Qe.id)||(ze.add(Qe.id),f({...Qe,archived:!1}))}async function Al(Y){try{const ge=Zt();Vs.delete(Y),Bs.add(Y);const Be=e.sessions.find(Xe=>Xe.id===Y),He=Be!==void 0?G(Be):void 0,Qe=He!==void 0?Fe(He).length:0;await ge.archiveSession(Y),await ks([Y],!0),Be!==void 0&&He!==void 0&&dt(He,Y,Be.updatedAt,Qe),Bs.delete(Y),Vs.delete(Y)}catch(ge){Bs.delete(Y),Vs.delete(Y)||r("archiveSession",ge,{sessionId:Y})}}async function Yr(Y,ge){if($o.has(Y)){let Xe;try{Xe=(await Zt().getSession(Y)).archived}catch{return!1}if(!Xe)return!1}Bs.delete(Y)&&Vs.add(Y),gi.delete(Y),$o.delete(Y),Oo(Y);const Be=e.sessions.find(Xe=>Xe.id===Y);if(Be===void 0&&e.activeSessionId!==Y)return!0;const He=ge??(Be!==void 0?G(Be):void 0),Qe=He!==void 0?Fe(He).length:0;return await ks([Y],!0),Be!==void 0&&He!==void 0&&dt(He,Y,Be.updatedAt,Qe),!0}async function Zl(Y){if(re)return!1;const ge=Y??e.activeSessionId;if(!ge){const He=li("commands.export.noSession");return ha("export:failed",{status:"no-session"}),r("exportSession",new Error(He),{message:He}),!1}re=!0;const Be=Date.now();ha("export:start",{sessionId:ge});try{const He=Wze(),{blob:Qe,fileName:Xe}=await Zt().exportSession(ge,He,{desktop:qh});if(typeof document>"u")throw new Error("Document is unavailable");const yt=URL.createObjectURL(Qe);let Rt;try{Rt=document.createElement("a"),Rt.href=yt,Rt.download=Xe,document.body.append(Rt),Rt.click()}finally{Rt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(yt)}catch{}},0)}return ha("export:accepted",{sessionId:ge,status:"accepted",zipBytes:Qe.size,durationMs:Date.now()-Be}),!0}catch(He){const Qe=typeof He=="object"&&He!==null?He:void 0;return ha("export:failed",{sessionId:ge,status:"failed",durationMs:Date.now()-Be,errorName:typeof Qe?.name=="string"?Qe.name:typeof He,errorCode:typeof Qe?.code=="number"?Qe.code:void 0,requestId:typeof Qe?.requestId=="string"?Qe.requestId:void 0,phase:typeof Qe?.phase=="string"?Qe.phase:void 0,httpStatus:typeof Qe?.status=="number"?Qe.status:void 0}),r("exportSession",He,{sessionId:ge,...qi(He)&&He.code===o4e?{message:li("commands.export.tooLarge",{sessionId:ge})}:{}}),!1}finally{re=!1}}async function _a(Y){try{const ge=await Zt().restoreSession(Y);return f(ge),await ks([Y],!1),!0}catch(ge){return r("restoreSession",ge,{sessionId:Y}),!1}}function Gl(Y){return Zt().listSessions({archivedOnly:!0,beforeId:Y?.beforeId,pageSize:Y?.pageSize??50})}async function Zo(){try{await Zt().logout(),await Ae(),await Qt()}catch(Y){r("logout",Y)}}function Tr(Y){const ge=e.activeSessionId;ge&&Zt().compactSession(ge,Y).catch(Be=>{r("compact",Be,{sessionId:ge})})}async function dr(Y){const ge=Y??e.activeSessionId;if(ge)try{const Be=await Zt().forkSession(ge);f(Be),await to(Be.id,{skipTrack:!0})}catch(Be){r("fork",Be,{sessionId:ge})}}async function tu(Y=1){const ge=e.activeSessionId;if(!ge)return null;const Be=b(ge);try{await Zt().undoSession(ge,Y),delete e.turnErrorBySession[ge],delete e.turnRetryBySession[ge];const He=e.sessionLastTurnReasonSeqBySession[ge];return Zt().getSession(ge).then(Qe=>{e.sessionLastTurnReasonSeqBySession[ge]===He&&d(ge,Xe=>({...Xe,lastTurnReason:Qe.lastTurnReason}))}).catch(()=>{}),await _(ge).catch(()=>{}),{text:Be}}catch(He){return r("undo",He,{sessionId:ge}),null}}function xl(Y){const ge=e.activeSessionId;if(!ge)return;const Be=e.queuedBySession[ge]??[];if(Y<0||Y>=Be.length)return;const He=[...Be];He.splice(Y,1),e.queuedBySession={...e.queuedBySession,[ge]:He}}function bo(Y,ge){const Be=e.activeSessionId;if(!Be)return;const He=e.queuedBySession[Be]??[];if(Y===ge||Y<0||Y>=He.length||ge<0||ge>=He.length)return;const Qe=[...He],[Xe]=Qe.splice(Y,1);Xe!==void 0&&(Qe.splice(ge,0,Xe),e.queuedBySession={...e.queuedBySession,[Be]:Qe})}async function Sl(Y){const ge=e.activeSessionId;if(!ge)return[];try{return(await Zt().listDirectory(ge,{path:Y,includeGitStatus:!0})).items}catch{return[]}}async function Rs(Y,ge){const Be=e.activeSessionId;if(!Be){let He=Y;if(!fr(Y)){const Qe=e.activeWorkspaceId,Xe=Qe&&H.value.some(Rt=>Rt.id===Qe)?Qe:H.value[0]?.id??null,yt=Xe?P.value.find(Rt=>Rt.id===Xe)?.root:void 0;if(!yt)return!0;He=`${yt.replace(/[\\/]+$/,"")}/${Y}`}try{return await bs(He),!0}catch(Qe){return!(qi(Qe)&&Qe.code===SB)}}try{if(fr(Y))return await bs(Y),!0;const He=Zt();return ge==="folder"?await He.listDirectory(Be,{path:Y}):await He.readFile(Be,{path:Y,length:1}),!0}catch(He){return!(qi(He)&&He.code===SB)}}async function bs(Y){return Zt().readHostFileContent(Y)}const ho=10485760;function _l(Y){const ge=e.activeSessionId;return ge?Zt().getFileDownloadUrl(ge,Y):null}async function Ml(Y,ge){const Be=e.activeSessionId;if(!Be)return!1;try{return await Zt().openFile(Be,{path:Y,line:ge}),!0}catch(He){return r("openFile",He,{sessionId:Be}),!1}}async function Ql(Y){const ge=e.activeSessionId;if(!ge)return;const Be=j.value.cwd||".";try{await Zt().openInApp(ge,Y,Be)}catch(He){r("openInApp",He,{sessionId:ge})}}async function Il(Y){const ge=e.activeSessionId;if(!ge)return!1;try{return await Zt().revealFile(ge,{path:Y}),!0}catch(Be){return r("revealFile",Be,{sessionId:ge}),!1}}function fr(Y){return Y.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(Y)||Y.startsWith("\\\\")}async function nu(Y){if(/^(https?:|data:|blob:)/i.test(Y))return Y;const ge=e.activeSessionId;if(!ge)return Y;let Be=Y;if(fr(Be)){const He=e.sessions.find(Xe=>Xe.id===ge)?.cwd,Qe=He?Ck(Be,He):null;if(Qe)Be=Qe;else try{const Xe=await bs(Be);return!Xe.isBinary||Xe.encoding!=="base64"?Y:`data:${Xe.mime};base64,${Xe.content}`}catch{return Y}}try{const Qe=await Zt().readFile(ge,{path:Be,length:ho});return!Qe.isBinary||Qe.encoding!=="base64"||Qe.truncated?Y:`data:${Qe.mime};base64,${Qe.content}`}catch{return Y}}let Yl=!1;async function ju(Y){const ge=e.sessions.find(He=>He.id===e.activeSessionId),Be=ge===void 0?e.activeWorkspaceId:G(ge);if(!Be)return[];try{const He=Zt();if(!Yl)try{return(await He.suggestFiles(Be,{query:Y,limit:20})).items.map(yt=>({path:yt.path,name:yt.name,kind:yt.kind,matchPositions:yt.matchPositions}))}catch(Xe){if(!qi(Xe)||Xe.code!==404)throw Xe;Yl=!0}return(await He.searchFiles(Be,{query:Y,limit:20})).items.map(Xe=>({path:Xe.path,name:Xe.name,kind:Xe.kind,matchPositions:Xe.matchPositions}))}catch{return[]}}return{checkAuth:Ae,probeManagedMembership:ye,loadConfig:fe,updateConfig:ie,listAllSessionsGlobal:qe,load:Qt,refreshServerMeta:un,loadWorkspaces:ei,loadMoreSessions:Te,loadAllSessions:At,ensureFlatSessions:Lt,loadMoreFlatSessions:Vt,ensureDoneSessions:nn,loadMoreDoneSessions:it,selectWorkspace:Hi,openWorkspace:wi,upsertWorkspacePreserveOrder:Vo,applyWorkspaceEvent:ot,clearActiveSession:Ue,openWorkspaceDraft:st,startSessionAndSendPrompt:kt,startSessionAndActivateSkill:ui,startSessionAndOpenSideChat:_o,getDraftPromotion:Xze,addWorkspaceByPath:co,browseFs:Ns,getFsHome:Ds,writeSessionUrl:Ei,openSessionAdmin:ur,closeSessionAdmin:Mo,fetchSessionIntoList:go,onSessionRoutePopState:Ir,bindSessionRoute:qn,selectSession:to,submitPromptInternal:fi,finishPromptLocal:Xo,maybeGenerateSessionTitle:yje,localTurnStartState:vK,isLocalTurnSnapshotCurrent:wje,afterLocalTurnStartsSettle:Cje,sendPrompt:Zi,steerPrompt:ri,steerQueued:Mi,resumeQueueIfIdle:Ko,uploadImage:_n,enqueue:gs,unqueue:xl,reorderQueue:bo,abortCurrentPrompt:Us,respondApproval:vo,respondQuestion:Ji,dismissQuestion:Oi,pendingQuestionActions:Ff,pendingApprovalActions:hy,cancelTask:$i,detachTask:Pe,refreshSessionWarnings:be,markSessionWarningShown:ke,setPlanMode:on,togglePlanMode:Zn,setSwarmMode:Gn,toggleSwarmMode:Xi,setGoalMode:ti,toggleGoalMode:vs,createGoal:ys,controlGoal:Je,setPermission:Ye,dismissWarning:wt,renameSession:Bt,regenerateSessionTitle:Bn,renameWorkspace:ci,deleteWorkspace:Ro,archiveSession:Al,applySessionsArchivedLocally:ks,applyRemoteSessionArchived:Yr,exportSession:Zl,restoreSession:_a,loadArchivedSessions:Gl,logout:Zo,compact:Tr,forkSession:dr,undo:tu,listDir:Sl,readHostFileContent:bs,probeWorkspacePath:Rs,getFileDownloadUrl:_l,openWorkspaceFile:Ml,openInApp:Ql,revealWorkspaceFile:Il,resolveImageUrl:nu,searchFiles:ju,refreshSessionSidecars:we,isStartingFirstPrompt:()=>uu.size>0}}const xje=20,Sje=300,_je=1e4,IB=5e3;function yK(e){const[t,n,i]=e.split("-").map(Number);return new Date(t??0,(n??1)-1,i??1,0,0,0,0).getTime()}function kK(e){const[t,n,i]=e.split("-").map(Number);return new Date(t??0,(n??1)-1,i??1,23,59,59,999).getTime()}function Mje(e,t,n){return{workspaceIds:e.workspaceIds.length>0?[...e.workspaceIds]:void 0,archived:e.status==="all"?"all":e.status==="done",updatedAfter:e.updatedFrom!==""?yK(e.updatedFrom):void 0,updatedBefore:e.updatedTo!==""?kK(e.updatedTo):void 0,sort:"meta.updated_at_desc",page:t,pageSize:n}}function Ije(e){return{workspaceIds:e.workspaceIds.length>0?[...e.workspaceIds]:void 0,archived:e.status==="all"?"all":e.status==="done",updatedAfter:e.updatedFrom!==""?yK(e.updatedFrom):void 0,updatedBefore:e.updatedTo!==""?kK(e.updatedTo):void 0,sort:"meta.updated_at_desc"}}function py(e){return JSON.stringify([[...e.workspaceIds].toSorted(),e.status,e.updatedFrom,e.updatedTo])}function Tje(e){const t=ao({filters:{workspaceIds:[],status:"all",updatedFrom:"",updatedTo:""},page:1,pageSize:xje,items:[],total:0,loading:!1,seeded:!1,selectedIds:new Set,selectedArchivedById:new Map,allMatching:!1,materializingAll:!1});let n=0,i=null;async function o(){i!==null&&(clearTimeout(i),i=null);const I=++n;t.loading=!0;try{const S=await Zt().listSessionsV2(Mje(t.filters,t.page,t.pageSize));if(I!==n)return;t.items=S.items,t.total=S.total;for(const x of S.items)t.selectedArchivedById.has(x.id)&&t.selectedArchivedById.set(x.id,x.meta.archived);const _=Math.max(1,Math.ceil(S.total/t.pageSize));t.page>_&&(t.page=_,o())}catch(S){if(I!==n)return;e.pushOperationFailure("sessionAdmin",S)}finally{I===n&&(t.loading=!1)}}function s(){i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,o()},Sje)}function r(){t.seeded||(t.seeded=!0,o())}async function l(){await o()}function a(I){t.allMatching&&py(I)!==py(t.filters)&&y(),t.filters.workspaceIds=[...I.workspaceIds],t.filters.status=I.status,t.filters.updatedFrom=I.updatedFrom,t.filters.updatedTo=I.updatedTo,t.page=1,t.seeded=!0,o()}function u(I){t.allMatching&&y(),t.filters.workspaceIds=[...I],t.page=1,s()}function c(I){t.allMatching&&y(),t.filters.status=I,t.page=1,s()}function d(I,S){t.allMatching&&y(),t.filters.updatedFrom=I,t.filters.updatedTo=S,t.page=1,s()}function f(I){I!==t.page&&(t.page=I,s())}function h(I){I!==t.pageSize&&(t.pageSize=I,t.page=1,s())}function m(I,S){if(t.selectedIds.has(I)){t.selectedIds.delete(I),t.selectedArchivedById.delete(I),t.selectedIds.size===0&&(t.allMatching=!1);return}t.selectedIds.add(I),t.selectedArchivedById.set(I,S)}function g(I){const S=I.length>0&&I.every(_=>t.selectedIds.has(_.id));for(const _ of I)S?(t.selectedIds.delete(_.id),t.selectedArchivedById.delete(_.id)):(t.selectedIds.add(_.id),t.selectedArchivedById.set(_.id,_.archived));t.selectedIds.size===0&&(t.allMatching=!1)}function v(I){t.selectedIds=new Set(I.map(S=>S.id)),t.selectedArchivedById=new Map(I.map(S=>[S.id,S.archived])),t.allMatching=!1}function y(){t.selectedIds=new Set,t.selectedArchivedById=new Map,t.allMatching=!1}async function b(){if(t.allMatching||t.materializingAll)return;t.materializingAll=!0;const I=Ije(t.filters),S=py(t.filters);try{const _=[];let x;for(;;){const E=await Zt().listSessionIdsV2({...I,pageSize:_je,pageToken:x});if(_.push(...E.items),!E.hasMore||E.nextPageToken===null)break;x=E.nextPageToken}if(py(t.filters)!==S)return;for(const E of _)t.selectedIds.add(E.id),t.selectedArchivedById.set(E.id,E.archived);t.allMatching=!0}catch(_){e.pushOperationFailure("sessionAdmin",_)}finally{t.materializingAll=!1}}function w(I){const S=[];for(const[_,x]of t.selectedArchivedById)x===I&&S.push(_);return S}async function C(I,S,_){const x=[];let E=0,M=0;for(let R=0;RB.ok).map(B=>B.id);x.push(...$),E+=z.succeeded,M+=z.failed}catch(z){M+=I.length-R,e.pushOperationFailure(S?"archiveSessions":"restoreSessions",z);break}}if(x.length>0){await e.applySessionsArchivedLocally(x,S);for(const R of x)t.selectedIds.delete(R),t.selectedArchivedById.delete(R);t.selectedIds.size===0&&(t.allMatching=!1),await l()}return{okIds:x,succeeded:E,failed:M}}async function T(I){return C(I,!0,S=>Zt().archiveSessions(S))}async function N(I){return C(I,!1,S=>Zt().restoreSessions(S))}return{state:t,ensureSeeded:r,refresh:l,applyFilters:a,setWorkspaceIds:u,setStatus:c,setTimeRange:d,setPage:f,setPageSize:h,toggleSelection:m,togglePageSelection:g,setSelection:v,clearSelection:y,selectAllMatching:b,selectedIdsByArchived:w,archiveSessions:T,restoreSessions:N}}function Eje(e){if(e.startsWith("kimi-complete-"))return"turn_complete";if(e.startsWith("kimi-question-"))return"question";if(e.startsWith("kimi-approval-"))return"approval"}function TB(e,t){const n=ps(e);return n===null?t:n==="1"}const Lje="/favicon.ico",Nje=Dv("kimi.notifications",()=>{const e=V(TB(xn.notifyEnabled,!0)),t=V(TB(xn.notifySound,!0)),n=V(typeof Notification<"u"?Notification.permission:"denied");async function i(c){if(!c){e.value=!1,ds(xn.notifyEnabled,"0");return}if(typeof Notification>"u")return;let d=Notification.permission;if(d==="default")try{d=await Notification.requestPermission()}catch{}n.value=d,d==="granted"&&(e.value=!0,ds(xn.notifyEnabled,"1"))}function o(c){t.value=c,ds(xn.notifySound,c?"1":"0")}function s(c,d,f){if(!e.value||typeof Notification>"u")return;const h=Notification.permission;if(h!=="denied"){if(h==="default"){Notification.requestPermission().then(m=>{n.value=m,m==="granted"&&r(c,d,f)});return}r(c,d,f)}}function r(c,d,f){if(!c.isUserWatching)try{const h=new Notification(d.title,{body:d.body,tag:f,icon:Lje,silent:!t.value}),m=Eje(f);m!==void 0&&void 0,h.onclick=()=>{try{window.kimiDesktop?.showWindow?.(),window.focus()}catch{}m!==void 0&&void 0,c.onClick(),h.close()}}catch{}}function l(c,d){s(d,IPe(li,d.sessionTitle),`kimi-complete-${c}-${d.promptId??Date.now()}`)}function a(c){s(c,TPe(li,c.sessionTitle,c.questionPreview),`kimi-question-${c.questionId}`)}function u(c){s(c,EPe(li,c.sessionTitle,c.toolName),`kimi-approval-${c.approvalId}`)}return{notifyEnabled:e,notifySound:t,notifyPermission:n,setNotifyEnabled:i,setNotifySound:o,maybeNotifyCompletion:l,maybeNotifyQuestion:a,maybeNotifyApproval:u}});function pd(){return Nje(sm)}const my=X1(),bK=xn.permission,wK=xn.activeWorkspace,CK=xn.planArmed,AK=xn.swarmMode,xK=xn.goalMode,O4=xn.onboarded;xr(xn.codeFont);xr(xn.accent);xr(xn.theme);xr(xn.thinking);xr(xn.notifyOnComplete);xr(xn.notifyOnQuestion);xr(xn.notifyOnApproval);xr(xn.soundOnComplete);function Dje(){try{const e=ps(bK);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Fje(e){try{ds(bK,e)}catch{}}function gy(e){const t=ps(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const i={};for(const[o,s]of Object.entries(n))s===!0&&(i[o]=!0);return i}catch{return{}}}function Zx(e,t){try{const n={};for(const[i,o]of Object.entries(t))o&&(n[i]=!0);ds(e,JSON.stringify(n))}catch{}}function Gx(){Zx(CK,xe.planArmedBySession)}function SK(){Zx(AK,xe.swarmModeBySession)}function _K(){Zx(xK,xe.goalModeBySession)}function Bje(){try{return ps(wK)}catch{return null}}const MK=xn.hiddenWorkspaces;function Rje(){try{const e=ps(MK);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Oje(e){try{ds(MK,JSON.stringify(e))}catch{}}function $je(e){try{ds(wK,e)}catch{}}function Pje(e,t){if(t&&e.startsWith(t)){const i=e.slice(t.length);return i?`~${i}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const xe=ao({...Fwe(),get sessions(){return wr().sessions},set sessions(e){wr().setSessions(e)},get activeSessionId(){return wr().activeSessionId},set activeSessionId(e){wr().setActiveSessionId(e)},get approvalsBySession(){return ir().approvalsBySession},get questionsBySession(){return ir().questionsBySession},get gitStatusBySession(){return er().gitStatusBySession},connected:!1,serverVersion:"",webTitle:"",dangerousBypassAuth:!1,backend:"v1",experimentalFlags:{},workspaceName:"kimi-code",connection:"disconnected",permission:Dje(),thinking:void 0,draftThinkingExplicit:!1,thinkingBySession:{},pendingThinkingBySession:{},planModeBySession:gy(xn.planMode),planArmedBySession:gy(CK),pendingPlanBySession:{},swarmModeBySession:gy(AK),pendingSwarmBySession:{},goalModeBySession:gy(xK),loading:!1,sessionLoading:!1,queuedBySession:{},promptIdBySession:{},abortPromptIdBySession:{},inFlightBySession:{},optimisticMessagesBySession:{},sessionLastTurnReasonSeqBySession:{},unreadBySession:B6(),authReady:!1,defaultModel:null,managedProviderStatus:null,managedUserInfo:null,managedMembership:null,workspaces:[],activeWorkspaceId:Bje(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Rje(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatUserMessageIdsBySession:{},sideChatSendingByAgent:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1,flatSessionsNextPageToken:null,flatSessionsHasMore:!0,flatSessionsLoading:!1,flatSessionsLoadingMore:!1,flatSessionsSeeded:!1,flatSessionsFrontier:null,doneSessions:[],doneSessionsNextPageToken:null,doneSessionsHasMore:!0,doneSessionsLoading:!1,doneSessionsLoadingMore:!1,doneSessionsSeeded:!1,draftEntry:"newChat",mainView:"chat"}),kc=ao({}),Qx=ao({}),r0=new Map,wg=new Map;function zje(e,t){return`${e}\0${t??"*"}`}function $4(e,t,n){Qx[t]=n;const i=kc[e]?.[t];i&&(kc[e]={...kc[e],[t]:{...i,review:n}})}async function P1(e,t){if(t!==void 0){P1(e);return}const n=zje(e,t),i=(r0.get(n)??0)+1;r0.set(n,i),t!==void 0&&wg.set(e,(wg.get(e)??0)+1);const o=wg.get(e)??0;try{const s=await Zt().getSessionPlans(e,{agentId:"main",toolCallId:t});if(r0.get(n)!==i||t===void 0&&(wg.get(e)??0)!==o||!xe.sessions.some(l=>l.id===e))return;const r=Object.fromEntries(s.map(l=>[l.toolCallId,l]));for(const[l,a]of Object.entries(r)){const u=Qx[l];u&&(!a.review||a.review.state==="pending")&&(r[l]={...a,review:u})}kc[e]=t===void 0?r:{...kc[e],...r}}catch(s){Ua("[refreshSessionPlans] plan history unavailable for",e,s)}}function jje(e){const t=`${e}\0`;for(const n of r0.keys())n.startsWith(t)&&r0.delete(n);wg.delete(e),delete kc[e]}function Hje(e){delete kc[e]}const Bv=ao({planMode:!1,swarmMode:!1,goalMode:!1});function Yx(e){xe.sessions=e}function Rv(e,t){xe.sessions=xe.sessions.map(n=>n.id===e?t(n):n)}function Wje(e){xe.sessions=dP(xe.sessions,e)}function qje(e){xe.sessions=[...xe.sessions,e]}function Uje(e){xe.sessions=xe.sessions.filter(t=>t.id!==e)}function IK(){const e=xe.activeSessionId;e&&xe.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(xe.unreadBySession[e]=!1,R6({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===xn.unread&&(xe.unreadBySession=B6(),IK())});function OA(){zr!==null&&zr.health().stale&&(ha("ws:stale-reconnect",{sessionId:xe.activeSessionId,status:"stale"}),Hze("ws: stale socket on focus, reconnecting",{activeSessionId:xe.activeSessionId}),zr.reconnect()),Ho.recoverIfStale()}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(IK(),OA())});typeof window<"u"&&(window.addEventListener("focus",OA),window.addEventListener("online",OA));function TK(e){Jze(e),xe.activeSessionId=e}const m1=new Map,P4=new Map,n9=new Map;function Jx(e){zr?.unsubscribe(e),vu.forgetSession(e),Ho.forgetSession(e),xi.clearSideChatForSession(e),jA.delete(e),qK(e),l0.discard(({meta:t})=>t.sessionId===e),Uje(e),jje(e),ir().clearSessionApprovals(e),ir().clearSessionQuestions(e),delete xe.tasksBySession[e],delete xe.goalBySession[e],er().clearSessionGitStatus(e),delete xe.lastSeqBySession[e],delete xe.compactionBySession[e],delete xe.optimisticMessagesBySession[e],Cg.delete(e),nv.delete(e),i9.delete(e),m1.delete(e),P4.delete(e),n9.delete(e),Y0.delete(e);{const t=rd.get(e);t?.timer!=null&&clearTimeout(t.timer),rd.delete(e)}J0.delete(e),X0.delete(e);for(const t of[...z4.keys()])t.startsWith(`${e}:`)&&z4.delete(t);delete xe.sessionLastTurnReasonSeqBySession[e],Xx.delete(e),bje(e),delete xe.queuedBySession[e],delete xe.promptIdBySession[e],delete xe.abortPromptIdBySession[e],delete xe.inFlightBySession[e],delete xe.turnActiveBySession[e],delete xe.turnErrorBySession[e],delete xe.turnRetryBySession[e],delete xe.planModeBySession[e],delete xe.planArmedBySession[e],delete xe.pendingPlanBySession[e],delete xe.swarmModeBySession[e],delete xe.pendingSwarmBySession[e],delete xe.goalModeBySession[e],delete xe.thinkingBySession[e],delete xe.pendingThinkingBySession[e],Gx(),SK(),_K(),wr().unpinSession(e)}function EK(e){const t=xe.activeSessionId===e;Jx(e),Q0(e),t&&(zt.clearActiveSession(),xe.sessionLoading=!1)}const LK=V(!1),NK=V(null);async function hc(e,t){const n=Y0.get(e)??0;let i;try{i=await Zt().getSessionStatus(e)}catch{return!1}if((Y0.get(e)??0)!==n)return!1;if(Rv(e,o=>({...o,model:i.model||o.model,usage:{...o.usage,contextTokens:i.contextTokens,contextLimit:i.maxContextTokens}})),t?.throughShield!==void 0){const o=t.throughShield.swarm===!0&&(t.throughTokens?.swarm===void 0||xe.pendingSwarmBySession[e]===t.throughTokens.swarm),s=t.throughShield.plan===!0&&(t.throughTokens?.plan===void 0||xe.pendingPlanBySession[e]===t.throughTokens.plan);o?xe.swarmModeBySession={...xe.swarmModeBySession,[e]:i.swarmMode}:t.throughShield.swarm!==!0&&Zw(xe,e,i.swarmMode),s?xe.planModeBySession={...xe.planModeBySession,[e]:i.planMode}:t.throughShield.plan!==!0&&Mw(xe,e,i.planMode)}else Zw(xe,e,i.swarmMode),Mw(xe,e,i.planMode);return xr(xn.planMode),i.thinkingEffort.length>0&&I6(xe,e,i.thinkingEffort),!0}const bc=new Set,Sh=new Set,g1=new Map;function DK(e,t){Sh.add(e),g1.set(e,t),t==="active"&&bc.add(e),lb(e).finally(()=>{Sh.delete(e),bc.delete(e);const n=g1.get(e);g1.delete(e),n!==void 0&&n!==t&&xe.goalBySession[e]===void 0&&DK(e,n)})}function Vje(e){Sh.has(e)||(Sh.add(e),bc.add(e),lb(e).finally(()=>{Sh.delete(e),bc.delete(e)}))}async function lb(e){const t=xe.goalVersionBySession[e]??0;let n;try{n=await Zt().getSessionGoal(e)}catch{return}(xe.goalVersionBySession[e]??0)===t&&(n===null||n.status==="complete"?delete xe.goalBySession[e]:xe.goalBySession[e]=n)}const rd=new Map;function FK(e,t,n){const i=rd.get(e),o={thinking:t.thinking??i?.tokens.thinking,swarm:t.swarm??i?.tokens.swarm,plan:t.plan??i?.tokens.plan},s={swarm:t.swarm!==void 0||i?.fields.swarm===!0,plan:t.plan!==void 0||i?.fields.plan===!0};i?.timer!=null&&clearTimeout(i.timer);const r={attempt:n,timer:null,tokens:o,fields:s};rd.set(e,r),r.timer=setTimeout(()=>{r.timer=null,hc(e,{throughShield:r.fields,throughTokens:r.tokens}).then(l=>{if(l){rd.get(e)===r&&rd.delete(e),Eu(xe,e,r.tokens.thinking),Kw(xe,e,r.tokens.swarm),_w(xe,e,r.tokens.plan);return}if(rd.get(e)===r){if(!xe.sessions.some(a=>a.id===e)){rd.delete(e);return}FK(e,t,n+1)}})},Math.min(n*2e3,15e3))}function BK(e,t){const n=t??xe.activeSessionId;if(!n)return Promise.resolve(!1);const i=e.thinking!==void 0?xe.pendingThinkingBySession[n]:void 0,o=e.swarmMode!==void 0?xe.pendingSwarmBySession[n]:void 0,s=e.planMode!==void 0?xe.pendingPlanBySession[n]:void 0;return Promise.resolve(Zt().updateSession(n,e)).then(()=>hc(n,{throughShield:{swarm:e.swarmMode!==void 0,plan:e.planMode!==void 0},throughTokens:{swarm:o,plan:s}})).then(r=>r?(Eu(xe,n,i),Kw(xe,n,o),_w(xe,n,s),!0):(FK(n,{thinking:i,swarm:o,plan:s},1),!0)).catch(r=>(Eu(xe,n,i)&&hc(n),Kw(xe,n,o)&&hc(n),_w(xe,n,s)&&hc(n),rm("persistSessionProfile",r,{sessionId:n}),!1))}function RK(e){try{return ps(e)??""}catch{return""}}function Kje(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("kimi_onboarded")==="1"}const OK=Kje();if(OK&&RK(O4)!=="1")try{ds(O4,"1")}catch{}const $K=V(OK||RK(O4)==="1");function Zje(e){$K.value=e;try{ds(O4,e?"1":"0")}catch{}e&&window.kimiDesktop?.setOnboarded?.()}let zr=null;const vu=UPe({api:Zt(),connectEventsIfNeeded:ab,getEventConnection:()=>zr}),Ho=ZPe({api:Zt(),getSharedConnection:()=>zr,ensureSharedConnection:ab,onSessionGone:e=>EK(e),getLocalTurnState:e=>zt.localTurnStartState(e),hasPendingLocalWork:e=>xe.inFlightBySession[e]===!0||(xe.queuedBySession[e]??[]).length>0||(xe.optimisticMessagesBySession[e]??[]).length>0,onBaselineError:(e,t)=>rm("loadSessionTranscript",t,{sessionId:e})});function xa(){const e=xe.activeSessionId;if(!e)return null;const t=Ho.pool.getEntry(e);return t?.version.value,t!==void 0&&t.baselineLoaded?t:null}function PK(e){const t=Ho.pool.getEntry(e)?.channel.snapshot.items.findLast(n=>n.kind==="turn");return t?.kind==="turn"?t.turnId:void 0}function zK(e){const t=Ho.pool.getEntry(e)?.channel.snapshot.prompts;if(t===void 0||t.length===0)return;let n;for(const i of t)(n===void 0||i.createdAt>n)&&(n=i.createdAt);return n}let EB=0;function jK(){return EB+=1,`msg_opt_${Date.now().toString(36)}_${EB}`}function LB(e,t,n){const i={sessions:xe.sessions,activeSessionId:xe.activeSessionId,approvalsBySession:xe.approvalsBySession,planReviewByToolCallId:xe.planReviewByToolCallId,questionsBySession:xe.questionsBySession,tasksBySession:xe.tasksBySession,goalBySession:xe.goalBySession,goalVersionBySession:xe.goalVersionBySession,lastSeqBySession:xe.lastSeqBySession,turnActiveBySession:xe.turnActiveBySession,turnErrorBySession:xe.turnErrorBySession,turnRetryBySession:xe.turnRetryBySession,compactionBySession:xe.compactionBySession,config:xe.config,warnings:xe.warnings},o=$we(i,e,{sessionId:t,seq:n},{t:(s,r)=>r===void 0?li(s):li(s,r)});o.sessions!==i.sessions&&Yx(o.sessions),o.activeSessionId!==i.activeSessionId&&TK(o.activeSessionId),ir().applyApprovalsDiff(o.approvalsBySession),Ll(xe.planReviewByToolCallId,o.planReviewByToolCallId),ir().applyQuestionsDiff(o.questionsBySession),Ll(xe.tasksBySession,o.tasksBySession),Ll(xe.goalBySession,o.goalBySession),Ll(xe.goalVersionBySession,o.goalVersionBySession),Ll(xe.lastSeqBySession,o.lastSeqBySession),Ll(xe.turnActiveBySession,o.turnActiveBySession),Ll(xe.turnErrorBySession,o.turnErrorBySession),Ll(xe.turnRetryBySession,o.turnRetryBySession),Ll(xe.compactionBySession,o.compactionBySession),o.config!==i.config&&(xe.config=o.config??null),Pwe(o.warnings,i.warnings)||(xe.warnings=o.warnings),e.type==="goalUpdated"&&bc.delete(t),e.type==="configChanged"&&(xe.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(hi.loadModels(),hi.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&Zw(xe,e.sessionId,e.swarmMode),e.planMode!==void 0&&Mw(xe,e.sessionId,e.planMode),e.thinking!==void 0&&I6(xe,e.sessionId,e.thinking)),e.type==="sessionUpdated"&&"archived"in e.session&&m1.set(e.session.id,n),e.type==="sessionArchived"&&m1.set(e.sessionId,n),e.type==="sessionMetaUpdated"&&"title"in e&&P4.set(e.sessionId,n),(e.type==="sessionWorkChanged"||e.type==="turnActiveChanged")&&"lastTurnReason"in e&&(xe.sessionLastTurnReasonSeqBySession[e.sessionId]=n),e.type==="sessionDeleted"&&(Jx(e.sessionId),Q0(e.sessionId)),e.type==="sessionUpdated"&&e.session.archived===!0&&Q0(e.session.id)}function Gje(e,t){const n=xe.lastSeqBySession[t.sessionId]??0,i=xe.turnActiveBySession[t.sessionId]??!1,o=e.type==="approvalResolved"||e.type==="approvalExpired"?xe.approvalsBySession[t.sessionId]?.find(a=>a.approvalId===e.approvalId&&a.toolName==="ExitPlanMode")?.toolCallId:void 0,s=xi.sideChatTargetBySession.value[t.sessionId]??[],r=e.type==="messageCreated"&&e.message.role==="user"&&e.agentId!==void 0&&Object.prototype.hasOwnProperty.call(xe.sideChatMessagesByAgent,e.agentId),l=e.type==="messageCreated"&&e.message.role==="user"&&e.agentId!==void 0&&xi.isClosedSideChatAgent(t.sessionId,e.agentId);if(r||l){LB({type:"unknown",raw:{_noop:!0}},t.sessionId,t.seq),r&&e.type==="messageCreated"&&xi.reconcileSideChatUserMessage(e.agentId,e.message);return}LB(e,t.sessionId,t.seq);for(const{agentId:a}of s){const u=t.sessionId;e.type==="agentDelta"&&e.agentId===a?e.delta.text&&xi.appendSideChatAssistantText(a,u,e.delta.text):e.type==="taskProgress"&&e.taskId===a&&xi.appendSideChatAssistantText(a,u,e.outputChunk)}if(e.type==="agentTurnEnded"&&xi.wasSideChatAgent(e.agentId)?xi.finishSideChatAgent(e.agentId,t.sessionId):e.type==="taskCompleted"&&xi.wasSideChatAgent(e.taskId)&&xi.finishSideChatAgent(e.taskId,t.sessionId,e.outputPreview,!0),e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&i||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&zWe(e.sessionId),t.seq>n&&(e.type==="turnActiveChanged"||e.type==="approvalRequested"||e.type==="questionRequested"||e.type==="promptCompleted"&&e.reason==="blocked"||e.type==="promptAborted"||e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1||!e.busy)&&i)&&Wf(t.sessionId),o!==void 0){const a=e.type==="approvalResolved"?{state:e.decision,selectedOption:e.selectedLabel,feedback:e.feedback}:{state:"cancelled"};$4(t.sessionId,o,a),P1(t.sessionId,o)}}const l0=qCe(({appEvent:e,meta:t})=>Gje(e,t),({appEvent:e})=>zCe(e),{coalesce:VCe}),Qje=3e4;let NB=0,vr=null;const Y0=new Map;function Yje(e){Y0.set(e,(Y0.get(e)??0)+1)}const Kp=new Map,J0=new Map,X0=new Map,z4=new Map;let j4=0,v1=null;function Jje(){v1!==null&&(clearTimeout(v1),v1=null)}function DB(e){if(!xe.connected||v1!==null)return;const t=Math.min(Qje,1e3*2**j4);j4+=1,Ua("[kimi-code] session work reconciliation incomplete; retrying",e),v1=setTimeout(()=>{v1=null,xe.connected&&$A()},t)}function Xje(e,t){const n=new Map(e.map(u=>[u.id,u]));let i=!1,o=!1;const s={...xe.turnActiveBySession},r=[],l=new Map,a=xe.sessions.map(u=>{const c=n.get(u.id);if(c===void 0)return u;const d=t.workEventSeqBySession.get(u.id)??0,f=t.turnEventSeqBySession.get(u.id)??0,h=t.pendingEventBySession.get(u.id),m=d>c.lastSeq,g=f>c.lastSeq,v=h!==void 0&&h.seq>c.lastSeq,y=m||g&&u.mainTurnActive===!0?u.busy||u.mainTurnActive===!0:c.busy,b=m||g?u.mainTurnActive:c.mainTurnActive??(y?u.mainTurnActive:!1),w=v?h.source==="work"?u.pendingInteraction:(xe.approvalsBySession[u.id]?.length??0)>0?"approval":(xe.questionsBySession[u.id]?.length??0)>0?"question":"none":c.pendingInteraction??(y?u.pendingInteraction:"none");(v&&h.source==="work"||!v&&(c.pendingInteraction!==void 0||c.busy===!1))&&w!==void 0&&l.set(u.id,w);const C=m?u.lastTurnReason:c.lastTurnReason;eS(u.id,c.lastSeq);const T=t.turnStartBySession.get(u.id);return(b===!1||b===void 0&&!y)&&t.witnessedTurnBySession.has(u.id)&&T!==void 0&&zt.isLocalTurnSnapshotCurrent(u.id,T)&&r.push(u.id),b===!0&&!s[u.id]?(s[u.id]=!0,o=!0):(b===!1||!y)&&s[u.id]&&(delete s[u.id],o=!0),u.busy===y&&u.mainTurnActive===b&&u.pendingInteraction===w&&u.lastTurnReason===C?u:(i=!0,{...u,busy:y,mainTurnActive:b,pendingInteraction:w,lastTurnReason:C})});i&&Yx(a),o&&Ll(xe.turnActiveBySession,s);for(const[u,c]of l)c==="none"?(ir().clearSessionApprovals(u),ir().clearSessionQuestions(u)):c==="question"&&ir().clearSessionApprovals(u);for(const u of r){const c=Ho.pool.getEntry(u);if(c!==void 0)Ho.pool.refreshSession(u).catch(()=>{setTimeout(()=>{Ho.pool.getEntry(u)===c&&Ho.pool.refreshSession(u).catch(()=>{})},2e3)});else{const d=xe.sessions.find(f=>f.id===u)?.lastTurnReason;qA(u,d==="cancelled"||d==="failed"?"aborted":"idle",!0)}}}async function $A(){const e={workEventSeqBySession:new Map,turnEventSeqBySession:new Map,pendingEventBySession:new Map,turnStartBySession:new Map(xe.sessions.map(t=>[t.id,zt.localTurnStartState(t.id)])),witnessedTurnBySession:new Set(xe.sessions.filter(t=>xe.inFlightBySession[t.id]||xe.turnActiveBySession[t.id]).map(t=>t.id))};vr=e;try{const t=await zt.listAllSessionsGlobal({shouldContinue:()=>vr===e&&xe.connected});if(vr!==e||!xe.connected)return;l0.flush(),Xje(t.sessions,e),vr=null,t.error!==void 0?DB(t.error):j4=0}catch(t){if(vr!==e||!xe.connected)return;vr=null,DB(t)}}function ab(){if(zr!==null||typeof WebSocket>"u")return;ha("ws:connection",{status:"connecting"}),xe.connection="connecting",zr=Zt().connectEvents({onEvent(t,n){const i=ev.get(n.sessionId);if(i!==void 0&&n.seq>=i.throughSeq&&ev.delete(n.sessionId),t.type==="sessionArchived"){zt.applyRemoteSessionArchived(t.sessionId,t.workspaceId).then(l=>{l&&Q0(t.sessionId)});return}if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){if(t.type==="workspaceDeleted"){const l=xe.sessions.filter(a=>a.workspaceId===t.workspaceId||a.cwd===t.root).map(a=>a.id);qze(t.workspaceId,t.root,l)}zt.applyWorkspaceEvent(t);return}if((t.type==="pluginsChanged"||t.type==="capabilityChanged")&&Vze(t))return;const o=t.type==="sessionWorkChanged",s=t.type==="turnActiveChanged",r=t.type==="approvalRequested"||t.type==="approvalResolved"||t.type==="approvalExpired"||t.type==="questionRequested"||t.type==="questionAnswered"||t.type==="questionDismissed";if((o||s||r)&&n.seq>0){const l=Kp.get(n.sessionId)??0;if(n.seq<=l)return;Kp.set(n.sessionId,n.seq)}if(vr!==null&&(o||s||r))if(o){const l=vr.workEventSeqBySession.get(n.sessionId)??0;if(n.seq>l&&vr.workEventSeqBySession.set(n.sessionId,n.seq),t.pendingInteraction!==void 0||!t.busy){const a=vr.pendingEventBySession.get(n.sessionId);(a===void 0||n.seq>a.seq)&&vr.pendingEventBySession.set(n.sessionId,{seq:n.seq,source:"work"})}}else if(s){const l=vr.turnEventSeqBySession.get(n.sessionId)??0;n.seq>l&&vr.turnEventSeqBySession.set(n.sessionId,n.seq)}else{const l=vr.pendingEventBySession.get(n.sessionId);(l===void 0||n.seq>l.seq)&&vr.pendingEventBySession.set(n.sessionId,{seq:n.seq,source:"interaction"})}for(const l of UCe({appEvent:t,meta:n}))l0(l)},onResync(t,n,i){const o=(n9.get(t)??0)+1;n9.set(t,o),ha("ws:resync",{sessionId:t,status:"required",seq:n}),l0.flush(),xe.lastSeqBySession[t]=n,Kp.delete(t),xi.resyncSideChat(t),(async()=>{const s=xe.sessions.find(u=>u.id===t),r=m1.get(t),l=P4.get(t),a=xe.sessionLastTurnReasonSeqBySession[t];try{const u=await Zt().getSession(t);if(n9.get(t)!==o)return;const c=xe.sessions.find(d=>d.id===t);if(u.archived===!0&&c?.archived!==!0&&s?.archived!==!0&&m1.get(t)===r){await zt.applyRemoteSessionArchived(t,u.workspaceId),Q0(t);return}Rv(t,d=>({...d,title:P4.get(t)===l?u.title:d.title,archived:m1.get(t)===r?d.archived||u.archived:d.archived,busy:d.busy!==s?.busy?d.busy:u.busy,mainTurnActive:d.mainTurnActive!==s?.mainTurnActive?d.mainTurnActive:u.mainTurnActive??d.mainTurnActive,pendingInteraction:d.pendingInteraction!==s?.pendingInteraction?d.pendingInteraction:u.pendingInteraction??d.pendingInteraction,lastTurnReason:xe.sessionLastTurnReasonSeqBySession[t]===a?u.lastTurnReason:d.lastTurnReason}))}catch(u){if(qi(u)&&u.code===40401){EK(t);return}}zt.loadWorkspaces(),$A()})(),i!==void 0&&(tv=i)},onError(t,n,i){ha("ws:error",{status:"failed",errorCode:t,fatal:i}),_h({severity:"error",title:li("warnings.wsTitle"),message:n,details:[Io("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){ha("ws:connection",{status:t?"connected":"disconnected"}),xe.connected=t,xe.connection=t?"connected":"disconnected",t||(vr=null,Kp.clear(),Jje(),j4=0),t&&(NB+=1,rHe(),zt.refreshServerMeta())},onReplayComplete(){l0.flush(),NB>1&&$A();const t=xe.activeSessionId;t!==void 0&&!Da.includes(t)&&VK(t)},onTranscriptReset(t,n,i,o){vu.receiveReset(t,n,i,o),n==="main"&&Ho.pool.receiveReset(t,i,o)},onTranscriptOps(t,n,i,o){const s=vu.applyOps(t,n,i,o);return n==="main"?Ho.pool.applyOps(t,i,o):s}})}const Xx=new Set;function Io(e,t){if(!(t==null||t===""))return{label:li(`warnings.details.${e}`),value:HK(t)}}function HK(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function eHe(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function tHe(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function nHe(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function iHe(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function FB(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function oHe(e,t,n){const i=Hk(t),o=qi(t),s=i||o?t.timestamp:void 0,r=i||o?t.durationMs:void 0,l=[Io("operation",e),Io("sessionId",n??xe.activeSessionId),Io("connection",xe.connection),Io("timestamp",iHe(s??Date.now()))];return i?l.push(Io("duration",FB(r)),Io("request",`${t.method} ${t.path}`),Io("endpoint",t.url),Io("requestId",t.requestId),Io("phase",t.phase),Io("timeout",`${t.timeoutMs}ms`),Io("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Io("contentType",t.contentType),Io("responsePreview",t.bodyPreview),Io("cause",t.cause)):o?l.push(Io("duration",FB(r)),Io("code",t.code),Io("requestId",t.requestId),Io("message",t.message),Io("details",t.details)):l.push(Io("errorName",eHe(t)),Io("message",tHe(t)??HK(t)),Io("stack",nHe(t))),l.filter(a=>a!==void 0)}function sHe(e,t,n={}){const i=Hk(t),o=qi(t),s=n4e(t),r=n.title??li(i?s?"warnings.daemonTimeoutTitle":"warnings.daemonNetworkTitle":o?"warnings.daemonApiTitle":"warnings.operationFailedTitle"),l=n.message??(i?li(s?"warnings.daemonTimeoutMessage":"warnings.daemonNetworkMessage"):o?t.message:li("warnings.operationFailedMessage"));return{severity:"error",title:r,message:l,details:oHe(e,t,n.sessionId)}}function _h(e){xe.warnings=[...xe.warnings,e]}function rHe(){const e=li("warnings.wsTitle"),t=xe.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==xe.warnings.length&&(xe.warnings=t)}function rm(e,t,n){yu(`[kimi-code] operation failed: ${e}`,t);const i=qi(t),o=Hk(t);ha("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:i?t.code:void 0,requestId:i||o?t.requestId:void 0,phase:o?t.phase:void 0,httpStatus:o?t.status:void 0}),_h(sHe(e,t,n))}const lHe={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function aHe(e){if(!qi(e)||e.code===void 0)return;const t=lHe[e.code];return t?li(t):void 0}function WK(e){return Ho.pool.getEntry(e)?.baselineLoaded===!0}function uHe(e){return WK(e)?Promise.resolve():new Promise(t=>{const n=We(()=>{const i=Ho.pool.getEntry(e);return i===void 0?!0:(i.version.value,i.baselineLoaded===!0)},i=>{i&&(n(),t())})})}const cHe=4,Da=[],H4=new Map,ev=new Map;let tv;function C5(e){const t=Da.indexOf(e);for(t!==-1&&Da.splice(t,1),Da.unshift(e);Da.length>cHe;){let n=-1;for(let s=Da.length-1;s>=0;s--)if(Da[s]!==xe.activeSessionId){n=s;break}if(n===-1)break;const[i]=Da.splice(n,1);if(i===void 0)break;const o=ev.get(i)?.seq??xe.lastSeqBySession[i];o!==void 0&&H4.set(i,{seq:o,...tv!==void 0?{epoch:tv}:{}}),zr?.unsubscribe(i)}}function qK(e){const t=Da.indexOf(e);t!==-1&&Da.splice(t,1),H4.delete(e),ev.delete(e)}const Cg=new Map;function UK(e,t){Rv(e,n=>({...n,title:t.title??n.title,archived:t.archived??n.archived,archivedAt:t.archivedAt??n.archivedAt,updatedAt:t.updatedAt!==void 0&&t.updatedAt>n.updatedAt?t.updatedAt:n.updatedAt,lastPrompt:t.lastPrompt??n.lastPrompt,messageCount:t.messageCount??n.messageCount}))}const A5=new Map;function Wf(e){if(A5.has(e))return;const t=(async()=>{try{const n=await Zt().getSession(e);n!=null&&UK(e,n)}catch{}finally{A5.delete(e)}})();A5.set(e,t)}function eS(e,t){t>(xe.lastSeqBySession[e]??0)&&(xe.lastSeqBySession[e]=t),t>(Kp.get(e)??0)&&Kp.set(e,t)}const x5=new Map;function VK(e){if(ab(),!zr)return;const t=H4.get(e);t!==void 0&&(H4.delete(e),ev.set(e,{seq:t.seq,throughSeq:Math.max(xe.lastSeqBySession[e]??0,t.seq)}));const n=xe.sessions.find(s=>s.id===e)?.lastSeq??0,i=t?.seq??xe.lastSeqBySession[e]??(n>0?n:void 0);if(i!==void 0){const s=t?.epoch??tv;zr.subscribe(e,s===void 0?{seq:i}:{seq:i,epoch:s}),C5(e);return}if(Xx.has(e)){zr.subscribe(e,{seq:0}),C5(e);return}if(x5.has(e))return;C5(e);const o=(async()=>{try{const s=await Zt().getSession(e);UK(e,s);const r=typeof s.lastSeq=="number"&&Number.isFinite(s.lastSeq)?s.lastSeq:0;if(eS(e,r),!Da.includes(e))return;const l=Math.max(xe.lastSeqBySession[e]??0,r),a=tv;zr?.subscribe(e,a===void 0?{seq:l}:{seq:l,epoch:a})}catch(s){qK(e),(!qi(s)||s.code!==40401)&&Ua("session-event subscribe skipped: watermark fetch failed",s)}finally{x5.delete(e)}})();x5.set(e,o)}function zh(e,t){return(xe.inFlightBySession[e]??!1)||(xe.turnActiveBySession[e]??!1)||(t??xe.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function Kh(e){try{const t=new Date(e),i=Date.now()-t.getTime(),o=i/36e5;if(i<6e4)return li("sessions.justNow");if(o<1)return`${Math.round(i/6e4)}m`;if(o<24)return`${Math.round(o)}h`;const s=i/864e5;return s<7?`${Math.round(s)}d`:s<30?`${Math.round(s/7)}w`:s<365?`${Math.round(s/30)}mo`:`${Math.round(s/365)}y`}catch{return e}}const dHe=3e4,Zd=V(0);let S5=null;function fHe(){S5===null&&(S5=setInterval(()=>{Zd.value=(Zd.value+1)%Number.MAX_SAFE_INTEGER},dHe),S5.unref?.())}function hHe(e){return{questionId:e.questionId,sessionId:e.sessionId,toolCallId:e.toolCallId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel,otherDescription:t.otherDescription}))}}const pHe=D(()=>{const e=xa(),t=new Map;if(e===null)return t;const n=new Map,i=[];for(const o of e.channel.snapshot.items)if(o.kind==="turn")for(const s of o.steps)for(const r of s.frames){if(r.kind!=="tool")continue;if(r.name==="Bash"||r.name==="bash"){const a=r.input;typeof a?.command=="string"&&n.set(r.toolCallId,a.command)}const l=ex(r.output);l!==void 0&&l.length>0&&i.push({toolCallId:r.toolCallId,output:l.join(` +`)})}if(n.size===0)return t;for(const{toolCallId:o,output:s}of i){const r=/task_id:\s*(\S+)/.exec(s);if(!r?.[1])continue;const l=n.get(o);l&&t.set(r[1],l)}return t});function KK(e){return pHe.value.get(e.id)}const mHe=D(()=>{const e=xa(),t=new Map;if(e===null)return t;for(const n of e.channel.snapshot.items)if(n.kind==="turn")for(const i of n.steps)for(const o of i.frames){if(o.kind!=="tool")continue;const s=o.input,r=typeof s?.prompt=="string"?s.prompt:void 0;r&&!t.has(o.toolCallId)&&t.set(o.toolCallId,r);const l=s?.items;if(!r&&Array.isArray(l)&&!t.has(o.toolCallId)){const a=l.filter(u=>typeof u=="string");a.length>0&&t.set(o.toolCallId,a)}}return t});function ZK(e){if(!e.parentToolCallId)return;const t=mHe.value.get(e.parentToolCallId);return Array.isArray(t)?e.swarmIndex!==void 0?t[e.swarmIndex]:void 0:t}function gHe(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":e.status==="cancelled"?t="cancelled":t="fail";let n="",i;if(e.status==="running"&&e.startedAt){i=Date.now()-new Date(e.startedAt).getTime();const l=Math.round(i/1e3),a=Math.floor(l/60),u=l%60;n=li("tasks.timingRunning",{time:`${a}:${String(u).padStart(2,"0")}`})}else e.completedAt&&e.startedAt&&!e.completedAtEstimated?(i=new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime(),n=li("tasks.timingDone",{time:Bu(i,{h:li("status.timeUnitHour"),m:li("status.timeUnitMinute"),s:li("status.timeUnitSecond")})})):n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??KK(e),r=e.kind==="bash"&&s?`$ ${s}`:e.kind==="subagent"?ZK(e)??e.subagentType:void 0;return{id:e.id,agentId:e.agentId,backgroundTaskId:e.backgroundTaskId,name:e.description,kind:e.kind,state:t,timing:n,durationMs:i,meta:r,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId,swarmIndex:e.swarmIndex,completedAt:e.completedAt,createdAt:e.createdAt,model:e.model,thinkingEffort:e.thinkingEffort}}const vHe=D(()=>{const e=xe.sessions.find(n=>n.id===xe.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:xe.workspaceName,branch:t}}),yHe=D(()=>(Zd.value,xe.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Kh(e.updatedAt),busy:zh(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason,workspaceId:Qr(e),cwd:e.cwd})))),kHe=D(()=>xe.activeSessionId??""),bHe=D(()=>{const e=xe.activeSessionId;if(e)return hi.skillsBySession.value[e]??[];const t=Ov.value;return t?hi.skillsByWorkspace.value[t]??[]:[]}),wHe=D(()=>{const e=xe.activeSessionId;if(e)return hi.skillsFetchedBySession.value[e]===!0;const t=Ov.value;return t?hi.skillsFetchedByWorkspace.value[t]===!0:!1}),tS=D(()=>{const e=xe.activeSessionId;return e?xe.inFlightBySession[e]??!1:!1}),CHe=D(()=>zt.isStartingFirstPrompt()),xi=Nze(xe,{api:Zt(),pushOperationFailure:rm,nextOptimisticMsgId:jK,connectEventsIfNeeded:ab,getEventConn:()=>zr,resolveThinkingForPrompt:(e,t)=>hi.resolveThinkingForPrompt(e,t),refreshSessionStatus:hc}),nv=new Map,i9=new Map;function GK(e){let t=nv.get(e);return t===void 0&&(t={parents:new Map,swarmIndexes:new Map},nv.set(e,t)),t}const lm=D(()=>{const e=xe.activeSessionId;if(!e)return[];const t=new Set((xi.sideChatTargetBySession.value[e]??[]).map(o=>o.agentId)),n=o=>o!==void 0&&(t.has(o)||xi.isClosedSideChatAgent(e,o)),i=xa();if(i!==null){const o=bAe(i.channel.snapshot,e,GK(e)),s=new Map((xe.tasksBySession[e]??[]).map(r=>[r.id,r]));return o.filter(r=>!n(r.agentId??r.id)).map(r=>{const l=s.get(r.id)??(r.backgroundTaskId!==void 0?s.get(r.backgroundTaskId):void 0);if(l===void 0)return r;const a=r.status==="running"&&l.status!=="running"&&r.startedAt!==void 0&&(l.completedAtEstimated===!0?l.startedAt!==void 0&&l.startedAt>=r.startedAt:l.completedAt!==void 0&&l.completedAt>=r.startedAt),u=a||r.id===l.id;return{...r,status:a?l.status:r.status,subagentPhase:a?l.status==="completed"?"completed":l.status==="cancelled"?"cancelled":"failed":r.subagentPhase,completedAt:u?l.completedAt??r.completedAt:r.completedAt,completedAtEstimated:l.completedAt!==void 0&&u?void 0:r.completedAtEstimated,outputPreview:u?l.outputPreview??r.outputPreview:r.outputPreview,outputBytes:u?l.outputBytes??r.outputBytes:r.outputBytes,model:r.model??l.model,thinkingEffort:r.thinkingEffort??l.thinkingEffort,command:r.command??l.command}})}return(xe.tasksBySession[e]??[]).filter(o=>!n(o.agentId??o.id))}),AHe=D(()=>{const e=xe.activeSessionId;return e?xe.tasksBySession[e]??[]:[]}),QK=Lze(xe,lm,{api:Zt()}),ub=D(()=>{const e=xe.activeSessionId;if(!e)return!1;const t=xa();return t!==null?t.channel.snapshot.meta.activity==="turn":(xe.turnActiveBySession[e]??!1)||(xe.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}),xHe=D(()=>{const e=xe.activeSessionId;if(!e)return;const t=xa();if(t!==null){const n=t.channel.snapshot;if(n.meta.activity==="turn")return;const i=n.items.findLast(a=>a.kind==="turn");if(i?.kind!=="turn"||i.state!=="failed"||i.error===void 0)return;const o=n.items.findLast(a=>a.kind==="marker"&&a.marker==="notice"&&a.payload?.level==="error"),s=o?.kind==="marker"?o.payload:void 0,r=s?.event??s,l=r?.details??{};return{code:typeof r?.code=="string"?r.code:void 0,message:i.error,name:typeof r?.name=="string"?r.name:void 0,retryable:typeof r?.retryable=="boolean"?r.retryable:void 0,statusCode:typeof l.statusCode=="number"?l.statusCode:void 0,requestId:typeof l.requestId=="string"?l.requestId:void 0}}return xe.turnErrorBySession[e]}),SHe=D(()=>{const e=xe.activeSessionId;if(!e||!ub.value)return;const t=xa();if(t!==null){const i=t.channel.snapshot.items.findLast(s=>s.kind==="turn"),o=i?.state==="running"?i.steps.at(-1)?.retry:void 0;return o===void 0?void 0:{failedAttempt:o.failedAttempt,nextAttempt:o.nextAttempt,maxAttempts:o.maxAttempts,delayMs:o.delayMs,errorName:o.errorName,statusCode:o.statusCode}}return xe.turnRetryBySession[e]}),PA=e=>Zt().getFileUrl(e),zA=(e,t)=>Zt().getSessionMediaUrl(e,t),_He=tAe();function YK(e){return Array.isArray(e)?e.filter(t=>typeof t=="object"&&t!==null&&t.type==="text").map(t=>t.text).join(""):""}function MHe(e){for(let t=e.items.length-1;t>=0;t--){const n=e.items[t];if(n.kind==="marker"){const i=n.at;if(typeof i=="string")return i;continue}if(n.kind==="turn"){let i;const o=s=>{typeof s=="string"&&(i===void 0||s>i)&&(i=s)};o(n.endedAt),o(n.startedAt);for(const s of n.steps)o(s.endedAt),o(s.startedAt);if(i!==void 0)return i}}}function IHe(e,t){if(t===void 0)return;const n=e.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n.startedAt:void 0}function cb(e,t){const n=IHe(e,t?.["kimiWeb.anchorTurnId"]),i=t?.["kimiWeb.anchorPromptCreatedAt"];return typeof i=="string"&&(n===void 0||i>=n)?{at:i,exclusive:!0}:n!==void 0?{at:n,exclusive:!1}:void 0}function nS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){const r=t.find(l=>!o.has(l.promptId)&&l.status!=="queued"&&(s.floor===void 0||(s.floor.exclusive?l.createdAt>s.floor.at:l.createdAt>=s.floor.at))&&YK(l.content)===s.text);r!==void 0&&(o.add(r.promptId),i.set(s.id,r.promptId))}return i}function THe(e,t,n,i,o){const s=t===void 0?-1:e.findIndex(r=>r.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="marker"||r.marker!=="skill")return!1;if(o!==void 0){const a=r.at;if(typeof a!="string"||a<=o)return!1}const l=r.payload?.origin;return l?.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function JK(e,t,n,i,o){const s=t===void 0?-1:e.findIndex(r=>r.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="turn"||o?.terminalOnly===!0&&r.state==="running")return!1;const l=r.origin.payload??r.origin;return l.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function iS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){const r=s.anchorTurnId===void 0?-1:t.findIndex(a=>a.kind==="turn"&&a.turnId===s.anchorTurnId);if(s.anchorTurnId!==void 0&&r===-1)continue;const l=t.slice(r+1).find(a=>{if(a.kind==="turn"){if(o.has(a.turnId))return!1;const u=a.origin.payload??a.origin;return u.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}if(a.kind==="marker"&&a.marker==="skill"){if(o.has(a.markerId))return!1;if(s.promptFloor!==void 0){const c=a.at;if(typeof c!="string"||c<=s.promptFloor)return!1}const u=a.payload?.origin;return u?.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}return!1});if(l!==void 0){const a=l.kind==="turn"?l.turnId:l.markerId;o.add(a),i.set(s.id,a)}}return i}const XK=D(()=>{const e=xe.activeSessionId;if(!e)return[];const t=xa();if(t===null)return[];const n=_He(t.channel.snapshot,{sessionId:e,getFileUrl:PA,getSessionMediaUrl:zA,plansByToolCallId:kc[e],planReviewByToolCallId:xe.planReviewByToolCallId,agentCreatedAt:xe.sessions.find(u=>u.id===e)?.createdAt,pendingInteractionAtByStepId:Ag.get(e),thinkingTiming:t.thinkingTiming}),i=xe.optimisticMessagesBySession[e]??[];if(i.length===0)return n;const o=t.channel.snapshot.items.filter(u=>u.kind==="turn"),s=nS(i.filter(u=>u.metadata?.["kimiWeb.uncertain"]===!0&&u.metadata?.["kimiWeb.promptId"]===void 0&&u.metadata?.origin?.kind!=="skill_activation").map(u=>({id:u.id,text:u.content.filter(c=>c.type==="text").map(c=>"text"in c?c.text:"").join(""),floor:cb(t.channel.snapshot.items,u.metadata)})),t.channel.snapshot.prompts,J0.get(e)),r=iS(i.filter(u=>u.metadata?.["kimiWeb.uncertain"]===!0&&u.metadata?.origin?.kind==="skill_activation").map(u=>{const c=u.metadata?.origin;return{id:u.id,anchorTurnId:u.metadata?.["kimiWeb.anchorTurnId"],promptFloor:u.metadata?.["kimiWeb.anchorPromptCreatedAt"],skillName:c?.skillName,skillArgs:c?.skillArgs}}),t.channel.snapshot.items,X0.get(e)),l=i.filter(u=>{const c=u.metadata?.["kimiWeb.promptId"];if(c!==void 0){if(u.metadata?.["kimiWeb.steered"]===!0&&t.channel.snapshot.items.some(b=>b.kind==="turn"&&b.steps.some(w=>w.frames.some(C=>C.kind==="text"&&C.role==="user"&&(C.promptIds?.includes(c)??!1)))))return!1;const v=t.channel.snapshot.prompts.find(y=>y.promptId===c);if(v!==void 0)return v.status==="queued"||u.metadata?.["kimiWeb.steered"]===!0}const d=u.metadata?.origin;if(d?.kind==="skill_activation"){if(u.metadata?.["kimiWeb.uncertain"]===!0)return!r.has(u.id);const v=u.metadata?.["kimiWeb.anchorTurnId"];return!JK(t.channel.snapshot.items,v,d.skillName,d.skillArgs)}if(u.metadata?.["kimiWeb.uncertain"]===!0)return!s.has(u.id);const f=u.metadata?.["kimiWeb.anchorTurnId"],h=f===void 0?-1:o.findIndex(v=>v.kind==="turn"&&v.turnId===f);if(f!==void 0&&h===-1)return!0;const m=o.slice(h+1),g=u.content.filter(v=>v.type==="text").map(v=>"text"in v?v.text:"").join("");return!m.some(v=>v.kind==="turn"&&((v.prompt??"")===g||g===""&&(v.attachmentIds?.length??0)>0))});if(l.length===0)return n;const a=n.filter(u=>u.role!=="compaction").length+1;return[...n,...l.flatMap((u,c)=>Gk([u],[],PA,!1,{},{},{startNo:a+c,getSessionMediaUrl:zA}))]}),EHe=D(()=>tS.value||ub.value),Ag=Mh(new Map);{const e=Ho;We(()=>xe.activeSessionId,(i,o)=>{o!==void 0&&o!==i&&e.deactivate(o),i&&e.activate(i)},{immediate:!0}),We(()=>[xe.activeSessionId,...[...e.pool.subscribedSessions].flatMap(i=>[e.pool.getEntry(i)?.version.value??-1,...(xi.sideChatTargetBySession.value[i]??[]).map(o=>vu.getEntry(i,o.agentId)?.version.value??-1),vu.desiredAgentBySession.get(i),vu.getEntry(i,vu.desiredAgentBySession.get(i)??"")?.version.value??-1])],()=>{for(const i of e.pool.subscribedSessions){const o=e.pool.getEntry(i);if(o===void 0||!o.baselineLoaded)continue;const s=o.channel.snapshot.meta;let r=!1;const l=s.modes?.plan!==void 0;xe.pendingPlanBySession[i]===void 0&&(xe.planModeBySession[i]??!1)!==l&&(xe.planModeBySession={...xe.planModeBySession,[i]:l},r=!0);const a=s.modes?.swarm!==void 0;xe.pendingSwarmBySession[i]===void 0&&(xe.swarmModeBySession[i]??!1)!==a&&(xe.swarmModeBySession={...xe.swarmModeBySession,[i]:a},r=!0);const u=s.agent?.model;if(u!==void 0){const N=xe.sessions.find(I=>I.id===i);N!==void 0&&N.model!==u&&(xe.sessions=xe.sessions.map(I=>I.id===i?{...I,model:u}:I),r=!0)}const c=s.agent?.thinkingEffort;c!==void 0&&(xe.pendingThinkingBySession[i]===void 0&&xe.thinkingBySession[i]!==c&&(r=!0),I6(xe,i,c)),r&&Yje(i);const d=o.channel.snapshot;if(d.hasMoreOlder===!0&&!o.channel.loadingOlder){const N=kAe(d),I=GK(i);if(d.tasks.some(_=>_.kind==="subagent"&&_.agentId!==void 0&&_.state==="running"&&!I.parents.has(_.agentId)&&!N.has(_.agentId))){const _=i9.get(i)??0;Date.now()-_>3e4&&o.channel.loadOlder().catch(()=>{i9.set(i,Date.now()),setTimeout(()=>{const x=e.pool.getEntry(i);x!==void 0&&(x.version.value+=1)},3e4)})}}const f=s.goal,h=xe.goalBySession[i];if(f===void 0||f.status==="complete"){const N=h!==void 0;N&&delete xe.goalBySession[i];const I=Sh.has(i);(N||I)&&(xe.goalVersionBySession[i]=(xe.goalVersionBySession[i]??0)+1,bc.delete(i),g1.delete(i))}else h!==void 0&&h.status!==f.status?(xe.goalBySession[i]={...h,status:f.status},xe.goalVersionBySession[i]=(xe.goalVersionBySession[i]??0)+1):h===void 0&&(Sh.has(i)?g1.get(i)!==f.status&&(g1.set(i,f.status),xe.goalVersionBySession[i]=(xe.goalVersionBySession[i]??0)+1,f.status==="active"?bc.add(i):bc.delete(i)):DK(i,f.status));const m=[],g=[],v={};for(const N of o.channel.snapshot.interactions){const I=Lp(N,i);I!==void 0&&m.push(I);const S=qm(N,i);S!==void 0&&g.push(S);const _=N.request,x=_?.display,E=typeof N.toolCallId=="string"?N.toolCallId:typeof _?.toolCallId=="string"?_.toolCallId:void 0;E!==void 0&&x?.kind==="plan_review"&&typeof x.plan=="string"&&x.plan.length>0&&(v[E]={plan:x.plan,path:typeof x.path=="string"?x.path:void 0})}const y=new Set;for(const N of xi.sideChatTargetBySession.value[i]??[])y.add(N.agentId);const b=vu.desiredAgentBySession.get(i);b!==void 0&&y.add(b);const w=[...y].map(N=>vu.getEntry(i,N)).filter(N=>N?.baselineLoaded===!0);for(const N of w){const I=`${i}:${N.channel.agentId}`;let S=z4.get(I);if(S===void 0)S=new Set(N.channel.snapshot.interactions.map(E=>E.interactionId)),z4.set(I,S);else{for(const E of N.channel.snapshot.interactions){if(E.state!=="pending"||S.has(E.interactionId))continue;S.add(E.interactionId);const M=Lp(E,i);M!==void 0&&M5(i,M);const R=qm(E,i);R!==void 0&&_5(i,R)}for(const E of[...S])N.channel.snapshot.interactions.some(M=>M.interactionId===E)||S.delete(E)}const _=new Set(m.map(E=>E.approvalId)),x=new Set(g.map(E=>E.questionId));for(const E of N.channel.snapshot.interactions){const M=Lp(E,i);if(M!==void 0&&!_.has(M.approvalId)){const q=(xe.approvalsBySession[i]??[]).find(z=>z.approvalId===M.approvalId);m.push(q??M)}const R=qm(E,i);if(R!==void 0&&!x.has(R.questionId)){const q=(xe.questionsBySession[i]??[]).find(z=>z.questionId===R.questionId);g.push(q??R)}}}const C=new Set(o.channel.snapshot.interactions.map(N=>N.interactionId)),T=new Set(w.flatMap(N=>N.channel.snapshot.interactions.filter(I=>I.state!=="pending").map(I=>I.interactionId)));for(const N of xe.approvalsBySession[i]??[])C.has(N.approvalId)||T.has(N.approvalId)||m.some(I=>I.approvalId===N.approvalId)||m.push(N);for(const N of xe.questionsBySession[i]??[])C.has(N.questionId)||T.has(N.questionId)||g.some(I=>I.questionId===N.questionId)||g.push(N);ir().setSessionApprovals(i,m),ir().setSessionQuestions(i,g),i===xe.activeSessionId&&Ll(xe.planReviewByToolCallId,v)}},{immediate:!0});const t=new Map,n=(i,o,s)=>{let r=!1;for(const l of o.interactions){if(l.state==="pending"||s.has(l.interactionId)||l.request?.toolName!=="ExitPlanMode")continue;s.add(l.interactionId),r=!0;const a=l.request,u=typeof l.toolCallId=="string"?l.toolCallId:typeof a?.toolCallId=="string"?a.toolCallId:void 0,c=l.state;if(u!==void 0&&(c==="approved"||c==="rejected"||c==="cancelled")){const d=l.response;$4(i,u,{state:c,selectedOption:typeof d?.selectedOption=="string"?d.selectedOption:void 0,feedback:typeof d?.feedback=="string"?d.feedback:void 0})}}return r};We(()=>[...e.pool.subscribedSessions].map(i=>e.pool.getEntry(i)?.version.value??-1),()=>{for(const i of[...t.keys()])e.pool.subscribedSessions.has(i)||(t.delete(i),Ag.delete(i),nv.delete(i),i9.delete(i));for(const i of e.pool.subscribedSessions){const o=e.pool.getEntry(i);if(o===void 0||!o.baselineLoaded)continue;const s=o.channel.snapshot,r=s.items.filter(S=>S.kind==="turn"),l=s.interactions.filter(S=>S.state==="pending"),a=new Map(s.prompts.map(S=>[S.promptId,S.status])),u=t.get(i),c=r.at(-1),d=c?.kind==="turn"?c.turnId:void 0,f=c?.kind==="turn"?c.state:void 0;t.set(i,{activity:s.meta.activity,lastTurnId:d,lastTurnState:f,maxTurnOrdinal:r.reduce((S,_)=>_.kind==="turn"?Math.max(S,_.ordinal):S,-1),firstItemId:s.items[0]===void 0?void 0:_N(s.items[0]),seenPendingInteractionIds:new Set(l.map(S=>S.interactionId)),settledPlanInteractionIds:u?.settledPlanInteractionIds??new Set,seenNoticeIds:new Set(s.items.filter(S=>S.kind==="marker"&&S.marker==="notice").map(S=>S.kind==="marker"?S.markerId:"")),promptStatusById:a});const h=l.some(S=>!u?.seenPendingInteractionIds.has(S.interactionId));if(l.length>0&&h){const S=s.items.findLast(x=>x.kind==="turn"&&x.state==="running"),_=S?.kind==="turn"?S.steps.findLast(x=>x.state==="running"):void 0;if(_!==void 0){const x=new Map(Ag.get(i));x.set(_.stepId,MHe(s)??new Date().toISOString()),Ag.set(i,x)}}if(u===void 0){if(o.recoveredViaEmptyReset){o.recoveredViaEmptyReset=!1;for(const _ of l){Wf(i);const x=Lp(_,i);x!==void 0&&M5(i,x);const E=qm(_,i);E!==void 0&&_5(i,E)}if(i!==xe.activeSessionId)for(const _ of s.items){if(_.kind!=="marker"||_.marker!=="notice")continue;const x=_.payload;x?.level==="error"&&(_h(WC(x.event??x,li)),zt.markSessionWarningShown(i,`${typeof x.event?.code=="string"?x.event.code:""} ${typeof x.message=="string"?x.message:""}`))}}const S=o9(i,s);s.meta.activity!=="turn"&&!s.prompts.some(_=>_.status==="running"||_.status==="queued")&&S.settle&&zt.finishPromptLocal(i,{skipDrain:!S.drain}),n(i,s,t.get(i).settledPlanInteractionIds)&&P1(i);continue}let m=!1;const g=r.reduce((S,_)=>_.kind==="turn"?Math.max(S,_.ordinal):S,-1),y=u.lastTurnId!==void 0&&u.lastTurnId!==d&&!r.some(S=>S.kind==="turn"&&S.turnId===u.lastTurnId)&&g_.kind==="turn"&&_.turnId===u.lastTurnId);S?.kind==="turn"&&u.lastTurnState==="running"&&S.state!=="running"&&b.push(S);for(const _ of r)_.kind==="turn"&&_.ordinal>u.maxTurnOrdinal&&_.state!=="running"&&b.push(_)}!y&&r.some(S=>S.kind==="turn"&&S.state==="running"&&S.ordinal>u.maxTurnOrdinal)&&Wf(i);const w=u.activity==="turn"&&s.meta.activity!=="turn";if(b.length>0||w){const S=b.filter(_=>Cg.get(i)!==_.turnId);for(const[_,x]of S.entries()){Cg.set(i,x.turnId);const E=x.state==="cancelled"||x.state==="failed",M=_===S.length-1,R=M?o9(i,s):{settle:!1,drain:!1};qA(i,E?"aborted":"idle",!0,{drain:M&&R.drain,settleLocal:R.settle}),Wf(i)}if(b.length>0&&l.length===0&&Ag.delete(i),b.length===0&&c?.kind==="turn"&&Cg.get(i)!==c.turnId){Cg.set(i,c.turnId);const _=c.state==="cancelled"||c.state==="failed",x=o9(i,s);qA(i,_?"aborted":"idle",!0,{drain:x.drain,settleLocal:x.settle}),Wf(i)}}for(const S of l){if(u.seenPendingInteractionIds.has(S.interactionId))continue;Wf(i);const _=Lp(S,i);_!==void 0&&M5(i,_);const x=qm(S,i);x!==void 0&&_5(i,x)}{const S=u.firstItemId===void 0?0:s.items.findIndex(x=>_N(x)===u.firstItemId),_=S>0?s.items.slice(S):s.items;for(const x of _){if(x.kind!=="marker"||x.marker!=="notice"||u.seenNoticeIds.has(x.markerId))continue;const E=x.payload,M=`${typeof E?.event?.code=="string"?E.event.code:""} ${typeof E?.message=="string"?E.message:""}`;if(E?.level==="error"){if(zt.markSessionWarningShown(i,M),i===xe.activeSessionId)continue;_h(WC(E?.event??E??{},li));continue}E?.level!=="warning"&&E?.level!=="info"||(_h({severity:E.level,title:li("warnings.noteLabel"),message:typeof E.message=="string"?E.message:void 0}),zt.markSessionWarningShown(i,M))}}for(const S of u.seenPendingInteractionIds){if(l.some(x=>x.interactionId===S))continue;const _=s.interactions.find(x=>x.interactionId===S);if(_!==void 0&&_.request?.toolName==="ExitPlanMode"){u.settledPlanInteractionIds.add(S),m=!0;const x=_.request,E=typeof _.toolCallId=="string"?_.toolCallId:typeof x?.toolCallId=="string"?x.toolCallId:void 0,M=_.state;if(E!==void 0&&(M==="approved"||M==="rejected"||M==="cancelled")){const R=_.response;$4(i,E,{state:M,selectedOption:typeof R?.selectedOption=="string"?R.selectedOption:void 0,feedback:typeof R?.feedback=="string"?R.feedback:void 0})}}}n(i,s,u.settledPlanInteractionIds)&&(m=!0),m&&P1(i);for(const S of s.prompts){if(S.status==="running"||S.status==="queued")continue;const _=u.promptStatusById.get(S.promptId);(S.status==="blocked"||S.status==="aborted")&&_!==S.status&&d===u.lastTurnId&&(Wf(i),xe.promptIdBySession[i]===S.promptId&&zt.finishPromptLocal(i))}const C=xe.optimisticMessagesBySession[i];if(C!==void 0&&C.some(S=>S.metadata?.["kimiWeb.steered"]===!0)){const S=C.filter(_=>{if(_.metadata?.["kimiWeb.steered"]!==!0)return!0;const x=_.metadata?.["kimiWeb.promptId"];return x===void 0?!0:!s.items.some(E=>E.kind==="turn"&&E.steps.some(M=>M.frames.some(R=>R.kind==="text"&&R.role==="user"&&(R.promptIds?.includes(x)??!1))))});if(S.length!==C.length){const _={...xe.optimisticMessagesBySession};S.length>0?_[i]=S:delete _[i],xe.optimisticMessagesBySession=_,s.meta.activity!=="turn"&&((_[i]??[]).some(M=>M.metadata?.["kimiWeb.uncertain"]===!0)||(xe.queuedBySession[i]??[]).length>0&&queueMicrotask(()=>zt.resumeQueueIfIdle(i)))}}const T=xe.optimisticMessagesBySession[i];if(T!==void 0&&T.some(S=>S.metadata?.["kimiWeb.uncertain"]===!0)){const S=J0.get(i)??new Set;for(const q of[...S])s.prompts.some(z=>z.promptId===q)||S.delete(q);J0.set(i,S);const _=nS(T.filter(q=>q.metadata?.["kimiWeb.uncertain"]===!0&&!(q.metadata?.["kimiWeb.steered"]===!0&&q.metadata?.["kimiWeb.promptId"]!==void 0)&&q.metadata?.origin?.kind!=="skill_activation").map(q=>({id:q.id,text:q.content.filter(z=>z.type==="text").map(z=>"text"in z?z.text:"").join(""),floor:cb(s.items,q.metadata)})),s.prompts,S),x=new Set([..._.entries()].filter(([q])=>{const z=T.find($=>$.id===q);return z!==void 0&&z.metadata?.["kimiWeb.steered"]!==!0}).map(([,q])=>q));for(const q of x)S.add(q);const E=X0.get(i)??new Set;for(const q of[...E])s.items.some($=>$.kind==="turn"&&$.turnId===q||$.kind==="marker"&&$.markerId===q)||E.delete(q);X0.set(i,E);const M=iS(T.filter(q=>q.metadata?.["kimiWeb.uncertain"]===!0&&q.metadata?.origin?.kind==="skill_activation").map(q=>{const z=q.metadata?.origin;return{id:q.id,anchorTurnId:q.metadata?.["kimiWeb.anchorTurnId"],promptFloor:q.metadata?.["kimiWeb.anchorPromptCreatedAt"],skillName:z?.skillName,skillArgs:z?.skillArgs}}),s.items,E);for(const q of M.values())E.add(q);const R=T.filter(q=>{if(q.metadata?.["kimiWeb.uncertain"]!==!0)return!0;if(q.metadata?.["kimiWeb.steered"]===!0&&q.metadata?.["kimiWeb.promptId"]!==void 0){const $=q.metadata?.["kimiWeb.promptId"],B=s.prompts.find(ne=>ne.promptId===$);if(B===void 0||B.status==="queued")return!0;if(B.status==="blocked"||B.status==="aborted")return!1;const P=q.content.filter(ne=>ne.type==="text").map(ne=>"text"in ne?ne.text:"").join(""),H=q.metadata?.["kimiWeb.anchorTurnId"],j=H===void 0?-1:s.items.findIndex(ne=>ne.kind==="turn"&&ne.turnId===H);return!(j===-1?s.items:s.items.slice(j+1)).some(ne=>ne.kind==="turn"&&(ne.steps.some(W=>W.frames.some(Q=>Q.kind==="text"&&Q.role==="user"&&(Q.promptIds?.includes($)??!1)))||(ne.prompt??"")===P||P===""&&(ne.attachmentIds?.length??0)>0))}return q.metadata?.origin?.kind==="skill_activation"?!M.has(q.id):!_.has(q.id)});if(R.length!==T.length){const q={...xe.optimisticMessagesBySession};R.length>0?q[i]=R:delete q[i],xe.optimisticMessagesBySession=q,s.meta.activity!=="turn"&&((q[i]??[]).some(B=>B.metadata?.["kimiWeb.uncertain"]===!0)||(xe.queuedBySession[i]??[]).length>0&&queueMicrotask(()=>zt.resumeQueueIfIdle(i)))}}const I=s.prompts.find(S=>S.status==="running")??s.prompts.find(S=>S.status==="queued");I!==void 0&&xe.abortPromptIdBySession[i]!==I.promptId?xe.abortPromptIdBySession[i]=I.promptId:I===void 0&&xe.abortPromptIdBySession[i]!==void 0&&delete xe.abortPromptIdBySession[i]}Ho.trimResident()},{immediate:!0})}const jA=new Map,LHe=D(()=>{QK.taskClock.value;const e=lm.value.map(gHe),t=xe.activeSessionId;if(t){let n=jA.get(t);n||(n=new Map,jA.set(t,n));const i=e.filter(r=>r.kind==="subagent"&&r.runInBackground);for(const r of i){const l=r.agentId??r.id;if(r.agentId!==void 0&&r.backgroundTaskId!==void 0&&!n.has(l)){const a=n.get(r.backgroundTaskId);a!==void 0&&(n.delete(r.backgroundTaskId),n.set(l,a))}}const o=i.filter(r=>!n.has(r.agentId??r.id)).sort((r,l)=>(r.createdAt??"").localeCompare(l.createdAt??""));let s=n.size===0?0:Math.max(...n.values())+1;for(const r of o)n.set(r.agentId??r.id,s++);for(const r of i)r.swarmIndex=n.get(r.agentId??r.id)}return e}),eZ=D(()=>dAe(lm.value)),NHe=D(()=>hAe(lm.value)),Rp=D(()=>{const e=xe.activeSessionId;return e?xe.goalBySession[e]??null:null}),DHe=D(()=>{if(!xe.activeSessionId)return[];const t=xa();return t===null?[]:(t.channel.snapshot.todos.at(-1)?.items??[]).map(i=>({title:i.title,status:i.status}))}),FHe=D(()=>{const e=xe.activeSessionId;if(!e)return null;const t=xa();if(t!==null){const n=t.channel.snapshot.items.findLast(o=>o.kind==="marker"&&o.marker==="compaction"),i=n?.payload;return n===void 0||i?.phase!=="started"?null:{status:"running",trigger:i.trigger==="manual"?"manual":"auto"}}return xe.compactionBySession[e]??null}),BHe=D(()=>xe.connection),RHe=D(()=>xe.loading),OHe=D(()=>xe.sessionLoading),$He=D(()=>xa()?.channel.loadingOlder??!1),PHe=D(()=>xe.activeSessionId?xa()?.channel.snapshot.hasMoreOlder===!0:!1),zHe=D(()=>xa()?.channel.loadOlderError??!1),jHe=D(()=>xe.serverVersion),tZ=D(()=>xe.webTitle),HHe=D(()=>xe.experimentalFlags),WHe=D(()=>xe.backend),qHe=D(()=>xe.dangerousBypassAuth);function UHe(){xe.dangerousBypassAuth=!1}const VHe=D(()=>xe.permission),KHe=D(()=>xe.thinking),nZ=D(()=>{const e=xe.activeSessionId;return e?xe.planModeBySession[e]??!1:Bv.planMode}),ZHe=D(()=>{const e=xe.activeSessionId;return e?xe.planArmedBySession[e]??!1:Bv.planMode}),GHe=D(()=>{const e=xe.activeSessionId;return e?xe.swarmModeBySession[e]??!1:Bv.swarmMode}),QHe=D(()=>{const e=xe.activeSessionId;return e?xe.goalModeBySession[e]??!1:Bv.goalMode}),YHe=D(()=>{const e=xe.activeSessionId,t=(e?kc[e]:void 0)??{},n={},i=new Set;for(const s of XK.value)for(const r of s.tools??[]){if(r.name!=="ExitPlanMode")continue;i.add(r.id);const l=t[r.id];if(l){n[r.id]=l;continue}const a=xe.planReviewByToolCallId[r.id],u=JHe(r.arg),c=a?.plan??u?.plan,d=r.planPath??a?.path;!c&&!d||(n[r.id]={agentId:"main",toolCallId:r.id,turnId:s.id,source:"interaction",plan:c??"",path:d,options:u?.options,review:Qx[r.id]})}return{...Object.fromEntries(Object.entries(t).filter(([s])=>!i.has(s))),...n}});function JHe(e){try{const t=JSON.parse(e);return{plan:typeof t.plan=="string"?t.plan:void 0,options:Array.isArray(t.options)?t.options:void 0}}catch{return}}const XHe=D(()=>{const e=fAe(eZ.value);return{plan:nZ.value,goal:Rp.value&&Rp.value.status!=="complete"?{status:Rp.value.status,turnsUsed:Rp.value.turnsUsed,elapsedMs:Rp.value.wallClockMs}:null,swarm:e.total>0?e:null}}),eWe=D(()=>{const e=xe.activeSessionId;if(!e)return[];const t=Zt();return(xe.queuedBySession[e]??[]).map(n=>({id:n.id??n.text,text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(i=>qx(t,i)),editText:n.editText}))}),tWe=D(()=>xe.warnings),nWe=D(()=>{const e=xe.activeSessionId;return e?(xe.questionsBySession[e]??[]).map(hHe):[]}),iWe=D(()=>{const e=xe.activeSessionId;return e?(xe.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:VW(t),agentName:t.agentName,toolCallId:t.toolCallId})):[]}),oS=D(()=>{const e=xe.activeSessionId;return e?(xe.approvalsBySession[e]??[]).length>0?"awaiting-approval":(xe.questionsBySession[e]??[]).length>0?"awaiting-question":tS.value||ub.value?"running":"idle":"idle"}),hi=Qze(xe,{api:Zt(),pushOperationFailure:rm,refreshSessionStatus:hc,persistSessionProfile:BK,savePlanModeToStorage:Gx,activity:oS,updateSession:Rv,loadConfig:()=>zt.loadConfig(),checkAuth:()=>zt.checkAuth(),beginLocalTurn:BA,settleLocalTurn:RA,mainTranscriptTailTurnId:PK,mainTranscriptTailPromptCreatedAt:zK,settleIfFateProven:aZ}),HA=D(()=>{const e=xe.activeSessionId;if(!e)return null;const t=xe.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),oWe=D(()=>{const e=xe.activeSessionId;return e?xe.gitStatusBySession[e]?.pullRequest??null:null}),sWe=D(()=>{const e=xe.activeSessionId;if(!e)return[];const t=xe.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,i])=>({path:n,status:i})).sort((n,i)=>n.path.localeCompare(i.path)):[]}),rWe=D(()=>{const e=xe.activeSessionId;if(!e)return null;const t=xe.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),iZ=D(()=>{const e=xe.sessions.find(r=>r.id===xe.activeSessionId),t=HA.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?hi.draftModel.value:null,i=(e?.model&&e.model.length>0?e.model:n??xe.defaultModel)??"—",o=hi.models.value.find(r=>r.id===i)??hi.models.value.find(r=>r.model===i);return{model:o?.displayName||o?.model||(i.includes("/")?i.split("/").pop():i),modelId:o?.id??i,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:xe.permission,branch:t,cwd:e?.cwd??"",isGitRepo:HA.value!==null}}),lWe=D(()=>er().fileDiffLines),aWe=D(()=>xe.sessions.find(t=>t.id===xe.activeSessionId)?.usage.totalCostUsd??0),uWe=D(()=>xe.authReady),cWe=D(()=>xe.defaultModel),dWe=D(()=>xe.managedProviderStatus),fWe=D(()=>xe.managedUserInfo),hWe=D(()=>xe.managedMembership),pWe=D(()=>xe.config),mWe=D(()=>{const e=xe.activeSessionId;if(!e)return{};const t=xe.gitStatusBySession[e];return t?{...t.entries}:{}}),gWe=D(()=>{const e=new Map;for(const t of xe.workspaces){const n=Nl(t.root);e.has(n)||e.set(n,t.id)}return e});function Qr(e){return gWe.value.get(Nl(e.cwd))??e.workspaceId??e.cwd}const db=D(()=>Aoe({workspaces:xe.workspaces,sessions:xe.sessions,hiddenWorkspaceRoots:xe.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:xe.sessionsHasMoreByWorkspace})),W4=V(nae()),q4=V(iae());function vWe(e){q4.value!==e&&(q4.value=e,oae(e))}const iv=V(sae());We(()=>xe.sessions,e=>{const t=Nae(e,Qr),{next:n,changed:i}=Lae(iv.value,t);i&&(iv.value=n,LP(n))});const oZ=D(()=>Dae(db.value,iv.value));We(()=>[db.value.map(e=>e.id).join("\0"),xe.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],i=Mae(n,W4.value,oZ.value);i!==null&&(W4.value=i,EP(i));const{next:o,changed:s}=Fae(iv.value,new Set(n));s&&(iv.value=o,LP(o))});const fb=D(()=>wr().pinnedSessionIds);function yWe(e){wr().pinSession(e)}function kWe(e){wr().unpinSession(e)}function bWe(e){wr().unpinSessions(e)}function wWe(e){wr().togglePinSession(e)}const kl=D(()=>{const e=db.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Pje(t.root,xe.fsHome),sessionCount:t.sessionCount}));return q4.value==="recent"?Eae(e,oZ.value):Iae(e,W4.value)}),Ov=D(()=>{const e=xe.activeWorkspaceId,t=kl.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});We(Ov,e=>{e&&(Object.prototype.hasOwnProperty.call(hi.skillsByWorkspace.value,e)||hi.loadSkillsForWorkspace(e))},{immediate:!0});const sZ=D(()=>{const e=Ov.value;return e?kl.value.find(t=>t.id===e)??null:null}),CWe=SPe({webTitle:tZ,activeWorkspaceRoot:()=>sZ.value?.root??null}),AWe=D(()=>{Zd.value;const e=new Set(kl.value.map(n=>n.id)),t=new Map(kl.value.map(n=>[n.id,n.name]));return xe.sessions.filter(n=>!n.parentSessionId&&e.has(Qr(n))).map(n=>{const i=Qr(n);return{id:n.id,title:n.title,time:Kh(n.updatedAt),busy:zh(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:i,workspaceName:t.get(i)}})}),WA=V(kd),hb=D(()=>{Zd.value;const e=new Set(kl.value.map(r=>r.id)),t=new Map(kl.value.map(r=>[r.id,r.name])),n=new Set(fb.value),i=(r,l)=>new Date(l.updatedAt).getTime()-new Date(r.updatedAt).getTime(),o=xe.flatSessionsFrontier,s=[];for(const r of xe.sessions)r.parentSessionId||r.archived||n.has(r.id)||!e.has(Qr(r))||!(hv({busy:zh(r.id,r.mainTurnActive),unread:lS.value[r.id]??!1,questionCount:ov.value[r.id]?.questions??0,approvalCount:ov.value[r.id]?.approvals??0,pendingInteraction:r.pendingInteraction,lastTurnReason:r.lastTurnReason})!=="idle")&&o!==null&&new Date(r.updatedAt).getTime(){const l=Qr(r);return{id:r.id,title:r.title,time:Kh(r.updatedAt),busy:zh(r.id,r.mainTurnActive),pendingInteraction:r.pendingInteraction,lastTurnReason:r.lastTurnReason,lastPrompt:r.lastPrompt,updatedAt:r.updatedAt,workspaceId:l,workspaceName:t.get(l),cwdLabel:r.cwd?Ic(r.cwd):"-",pullRequest:r.pullRequest}})});function xWe(e){return hv({busy:e.busy,unread:lS.value[e.id]??!1,questionCount:ov.value[e.id]?.questions??0,approvalCount:ov.value[e.id]?.approvals??0,pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})!=="idle"}const sS=D(()=>{const e=hb.value;let t=WA.value;for(let n=e.length-1;n>=t;n--)if(xWe(e[n])){t=n+1;break}return t}),SWe=D(()=>hb.value.slice(0,sS.value)),_We=D(()=>xe.flatSessionsHasMore||sS.valuehb.value.length&&xe.flatSessionsHasMore&&zt.loadMoreFlatSessions()}const U4=V(kd),rS=D(()=>{Zd.value;const e=new Set(kl.value.map(n=>n.id)),t=new Map(kl.value.map(n=>[n.id,n.name]));return xe.doneSessions.filter(n=>e.has(Qr(n))).map(n=>{const i=Qr(n),o=xe.sessions.find(r=>r.id===n.id),s=o!==void 0&&new Date(o.updatedAt).getTime()>new Date(n.updatedAt).getTime()?o.updatedAt:n.updatedAt;return{id:n.id,title:n.title,time:Kh(s),busy:o?.busy??n.busy,pendingInteraction:o?.pendingInteraction??n.pendingInteraction,lastTurnReason:o?.lastTurnReason??n.lastTurnReason,lastPrompt:n.lastPrompt,updatedAt:s,workspaceId:i,workspaceName:t.get(i),archived:!0,cwdLabel:n.cwd?Ic(n.cwd):"-",pullRequest:n.pullRequest}}).sort((n,i)=>new Date(i.updatedAt).getTime()-new Date(n.updatedAt).getTime())}),IWe=D(()=>rS.value.slice(0,U4.value)),TWe=D(()=>xe.doneSessionsHasMore||U4.valuerS.value.length&&xe.doneSessionsHasMore&&zt.loadMoreDoneSessions()}const LWe=D(()=>{const e=xe.activeSessionId;return e?xe.sessions.find(t=>t.id===e)?.archived===!0:!1});function NWe(e,t=6){if(!e)return[];const n=new Map(kl.value.map(r=>[r.id,r.name])),i=(r,l)=>({id:r.id,title:r.title,time:Kh(l??r.updatedAt),busy:l===void 0&&zh(r.id,r.mainTurnActive),pendingInteraction:l===void 0?r.pendingInteraction:void 0,lastTurnReason:l===void 0?r.lastTurnReason:void 0,lastPrompt:r.lastPrompt,updatedAt:l??r.updatedAt,workspaceId:e,workspaceName:n.get(e),archived:l!==void 0,cwdLabel:r.cwd?Ic(r.cwd):"-",pullRequest:r.pullRequest}),o=xe.sessions.filter(r=>!r.parentSessionId&&!r.archived&&Qr(r)===e).sort((r,l)=>new Date(l.updatedAt).getTime()-new Date(r.updatedAt).getTime()),s=xe.doneSessions.filter(r=>Qr(r)===e);return[...o.map(r=>i(r)),...s.map(r=>i(r,r.updatedAt))].slice(0,t)}function rZ(e){Zd.value;const t=new Set(fb.value),n=new Map,i=new Map;for(const o of xe.sessions.toSorted((s,r)=>new Date(r.updatedAt).getTime()-new Date(s.updatedAt).getTime())){if(o.parentSessionId||o.archived)continue;const s=Qr(o);if(e&&t.has(o.id)){i.set(s,(i.get(s)??0)+1);continue}const r={id:o.id,title:o.title,time:Kh(o.updatedAt),busy:zh(o.id,o.mainTurnActive),pendingInteraction:o.pendingInteraction,lastTurnReason:o.lastTurnReason,updatedAt:o.updatedAt},l=n.get(s)??[];l.push(r),n.set(s,l)}return kl.value.map(o=>({workspace:o,sessions:n.get(o.id)??[],pinnedCount:i.get(o.id)??0,hasMore:xe.sessionsHasMoreByWorkspace[o.id]??!1,loadingMore:xe.sessionsLoadingMoreByWorkspace[o.id]??!1,initialCount:xe.sessionsInitialCountByWorkspace[o.id]??yg}))}const DWe=D(()=>rZ(!0)),FWe=D(()=>rZ(!1)),BWe=D(()=>{Zd.value;const e=new Set(kl.value.map(o=>o.id)),t=new Map(kl.value.map(o=>[o.id,o.name])),n=xe.sessions.filter(o=>!o.parentSessionId&&!o.archived&&e.has(Qr(o)));return cse(n,fb.value).pinned.toSorted((o,s)=>new Date(s.updatedAt).getTime()-new Date(o.updatedAt).getTime()).map(o=>{const s=Qr(o);return{id:o.id,title:o.title,time:Kh(o.updatedAt),busy:zh(o.id,o.mainTurnActive),pendingInteraction:o.pendingInteraction,lastTurnReason:o.lastTurnReason,updatedAt:o.updatedAt,workspaceId:s,workspaceName:t.get(s),pinned:!0,cwdLabel:o.cwd?Ic(o.cwd):"-",pullRequest:o.pullRequest}})});function RWe(e){W4.value=e,EP(e)}const lZ=D(()=>{const e={};for(const[t,n]of Object.entries(xe.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(xe.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),ov=D(()=>{const e={};for(const[t,n]of Object.entries(xe.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(xe.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),lS=D(()=>{const e={};for(const[t,n]of Object.entries(xe.unreadBySession))n&&(e[t]=!0);return e}),OWe=D(()=>{const e={},t=lZ.value;for(const n of xe.sessions){const i=t[n.id]??0;if(i<=0)continue;const o=Qr(n);e[o]=(e[o]??0)+i}return e}),$We=D(()=>xe.recentRoots),PWe=D(()=>xe.availableOpenInApps),zt=Aje(xe,{taskPoller:QK,sideChat:xi,modelProvider:hi,pushOperationFailure:rm,notify:_h,activity:oS,sessionsKnownEmpty:Xx,setSessions:Yx,updateSession:Rv,upsertSessionSorted:Wje,appendSession:qje,forgetSession:Jx,unpinSessions:bWe,setActiveSessionId:TK,nextOptimisticMsgId:jK,lastMainUserPromptText:e=>{const t=Ho.pool.getEntry(e);if(t===void 0)return null;const n=t.channel.snapshot.items.findLast(i=>i.kind==="turn"&&i.origin.kind==="user");return n?.kind==="turn"?n.prompt??null:null},mainTranscriptTailTurnId:PK,mainTranscriptTailPromptCreatedAt:zK,settleIfFateProven:aZ,getEventConn:()=>zr,subscribeSessionEvents:VK,noteSessionWatermark:eS,refreshMainTranscript:async e=>{const t=Ho.pool.getEntry(e);t!==void 0&&(await t.channel.settleOlder().catch(()=>{}),await Ho.pool.refreshSession(e).catch(()=>{}),await Ho.pool.refreshSession(e))},hasLoadedMessages:WK,resolveTaskRestId:(e,t)=>lm.value.find(n=>n.id===t)?.backgroundTaskId,whenMainTranscriptBaseline:uHe,refreshSessionStatus:hc,refreshSessionGoal:lb,refillSessionGoalOnReload:Vje,refreshSessionPlans:P1,settlePlanReviewLocally:$4,persistSessionProfile:BK,mergedWorkspaces:db,workspacesView:kl,status:iZ,workspaceIdForSession:Qr,savePermissionToStorage:Fje,savePlanModeToStorage:Gx,saveSwarmModeToStorage:SK,saveGoalModeToStorage:_K,draftModes:Bv,saveUnread:R6,saveActiveWorkspaceToStorage:$je,saveHiddenWorkspacesToStorage:Oje,goalErrorMessage:aHe,initialized:LK,connectIssue:NK}),Gi=Tje({pushOperationFailure:rm,applySessionsArchivedLocally:zt.applySessionsArchivedLocally});We(()=>xe.mainView,e=>{e==="sessionAdmin"&&Gi.ensureSeeded()});function aS(e){return e===xe.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function zWe(e){xe.turnActiveBySession[e]&&delete xe.turnActiveBySession[e],xe.inFlightBySession[e]&&(xe.inFlightBySession[e]=!1)}function jWe(e,t){const n=e.metadata?.origin;if(n?.kind==="skill_activation"){const a=e.metadata?.["kimiWeb.anchorTurnId"];return JK(t.items,a,n.skillName,n.skillArgs,{terminalOnly:!0})||THe(t.items,a,n.skillName,n.skillArgs,e.metadata?.["kimiWeb.anchorPromptCreatedAt"])}const i=e.content.filter(a=>a.type==="text").map(a=>"text"in a?a.text:"").join(""),o=e.metadata?.["kimiWeb.anchorTurnId"],s=o===void 0?-1:t.items.findIndex(a=>a.kind==="turn"&&a.turnId===o);if(o!==void 0&&s===-1)return!1;if(t.items.slice(s+1).some(a=>a.kind==="turn"&&a.state!=="running"&&((a.prompt??"")===i||i===""&&(a.attachmentIds?.length??0)>0)))return!0;const l=cb(t.items,e.metadata);return t.prompts.some(a=>a.status!=="queued"&&a.status!=="running"&&(l===void 0||(l.exclusive?a.createdAt>l.at:a.createdAt>=l.at))&&YK(a.content)===i)}function o9(e,t){const n=xe.optimisticMessagesBySession[e]??[],i=n.findLast(c=>c.metadata?.["kimiWeb.uncertain"]!==!0);let o;const s=xe.promptIdBySession[e];if(vK(e).pending)o=!1;else if(s!==void 0){const c=t.prompts.find(d=>d.promptId===s);o=c!==void 0&&c.status!=="queued"&&c.status!=="running"}else xe.inFlightBySession[e]===!0?o=i===void 0||jWe(i,t):o=!0;const r=n.filter(c=>c.metadata?.["kimiWeb.uncertain"]===!0&&c.metadata?.origin?.kind!=="skill_activation"),l=n.filter(c=>c.metadata?.["kimiWeb.uncertain"]===!0&&c.metadata?.origin?.kind==="skill_activation"),a=nS(r.map(c=>({id:c.id,text:c.content.filter(d=>d.type==="text").map(d=>"text"in d?d.text:"").join(""),floor:cb(t.items,c.metadata)})),t.prompts,J0.get(e)).size===r.length&&iS(l.map(c=>{const d=c.metadata?.origin;return{id:c.id,anchorTurnId:c.metadata?.["kimiWeb.anchorTurnId"],promptFloor:c.metadata?.["kimiWeb.anchorPromptCreatedAt"],skillName:d?.skillName,skillArgs:d?.skillArgs}}),t.items,X0.get(e)).size===l.length;return{settle:o,drain:o&&a}}function aZ(e){const t=Ho.pool.getEntry(e);if(t===void 0||!t.baselineLoaded)return;const n=o9(e,t.channel.snapshot);n.settle&&zt.finishPromptLocal(e,{skipDrain:!n.drain})}function qA(e,t,n,i){const o=xe.promptIdBySession[e],s=xe.goalBySession[e]?.status==="active"||bc.has(e);if(i?.settleLocal!==!1){const a=xe.optimisticMessagesBySession[e];let u=[];if(a!==void 0&&a.length>0){const c=Ho.pool.getEntry(e)?.channel.snapshot;if(u=a.filter(d=>{const f=d.metadata?.["kimiWeb.promptId"];if(f===void 0||c===void 0)return!1;const h=c.prompts.find(m=>m.promptId===f);if(h===void 0){const m=d.content.filter(b=>b.type==="text").map(b=>"text"in b?b.text:"").join(""),g=d.metadata?.["kimiWeb.anchorTurnId"],v=g===void 0?-1:c.items.findIndex(b=>b.kind==="turn"&&b.turnId===g);return g!==void 0&&v===-1?!0:!(v===-1?c.items:c.items.slice(v+1)).some(b=>b.kind==="turn"&&((b.prompt??"")===m||m===""&&(b.attachmentIds?.length??0)>0))}return h.status==="queued"?!0:d.metadata?.["kimiWeb.steered"]!==!0?!1:!c.items.some(m=>m.kind==="turn"&&m.steps.some(g=>g.frames.some(v=>v.kind==="text"&&v.role==="user"&&(v.promptIds?.includes(f)??!1))))}),u.length>0){const d={...xe.optimisticMessagesBySession},f=a.filter(h=>!u.includes(h));f.length>0?d[e]=f:delete d[e],xe.optimisticMessagesBySession=d}}if(zt.finishPromptLocal(e,{turnWasActive:n,retireOptimistic:"all",skipDrain:i?.drain===!1}),u.length>0){const c=xe.optimisticMessagesBySession[e]??[],d=new Set(u.map(g=>g.id)),f=new Set((a??[]).map(g=>g.id)),h=c.filter(g=>!f.has(g.id)),m=[];for(const g of a??[])(d.has(g.id)||c.some(v=>v.id===g.id))&&m.push(g);xe.optimisticMessagesBySession={...xe.optimisticMessagesBySession,[e]:[...m,...h]}}}(xe.experimentalFlags?.auto_session_title??xe.config?.experimental?.auto_session_title)===!0&&zt.maybeGenerateSessionTitle(e),er().loadGitStatus(e),lb(e),zt.refreshSessionWarnings(e),e===xe.activeSessionId?hc(e):t==="idle"&&!s&&(xe.unreadBySession[e]=!0,R6({[e]:!0}));const r=(xe.approvalsBySession[e]??[]).length>0,l=(xe.questionsBySession[e]??[]).length>0;!s&&MPe(t,r,l)&&pd().maybeNotifyCompletion(e,{isUserWatching:aS(e),sessionTitle:xe.sessions.find(a=>a.id===e)?.title??"",promptId:o,onClick:()=>{zt.selectSession(e,{source:"notification"})}})}function _5(e,t){const n=t.questions[0],i=n?.header?.trim()??"",o=n?.question?.trim()??"",s=i&&o?`${i}: ${o}`:o||i;pd().maybeNotifyQuestion({isUserWatching:aS(e),sessionTitle:xe.sessions.find(r=>r.id===e)?.title??"",questionPreview:s,questionId:t.questionId,onClick:()=>{zt.selectSession(e,{source:"notification"})}})}function M5(e,t){pd().maybeNotifyApproval({isUserWatching:aS(e),sessionTitle:xe.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{zt.selectSession(e,{source:"notification"})}})}function Xa(){return fHe(),{workspace:vHe,sessions:yHe,activeSessionId:kHe,workspacesView:kl,workspaceSortMode:q4,visibleWorkspace:sZ,activeWorkspaceId:Ov,sessionsForView:AWe,workspaceGroups:DWe,mobileWorkspaceGroups:FWe,pinnedSessions:BWe,pinnedSessionIds:fb,flatSessions:SWe,flatSessionsHasMore:_We,flatSessionsLoadingMore:D(()=>xe.flatSessionsLoadingMore),doneSessions:IWe,doneSessionsHasMore:TWe,doneSessionsLoadingMore:D(()=>xe.doneSessionsLoadingMore),activeSessionArchived:LWe,recentSessionsForWorkspace:NWe,draftEntry:D(()=>xe.draftEntry),mainView:D(()=>xe.mainView),attentionBySession:lZ,pendingBySession:ov,attentionByWorkspace:OWe,unreadBySession:lS,recentRoots:$We,turns:XK,tasks:LHe,activeAppTasks:lm,activeRestTasks:AHe,findBashCommandForTask:KK,findSubagentPromptForTask:ZK,auxiliaryTranscripts:vu,getFileUrl:PA,getSessionMediaUrl:zA,todos:DHe,goal:Rp,sessionPlans:YHe,refreshSessionPlans:P1,invalidateSessionPlans:Hje,swarms:eZ,swarmMembersByToolCallId:NHe,activationBadges:XHe,compaction:FHe,status:iZ,sessionCost:aWe,fileDiff:lWe,selectedDiffPath:D(()=>er().selectedDiffPath),fileDiffLoading:D(()=>er().fileDiffLoading),fileDiffTexts:D(()=>er().fileDiffTexts),fileDiffEmptyFile:D(()=>er().fileDiffEmptyFile),changes:sWe,gitInfo:HA,gitDiffStats:rWe,activePullRequest:oWe,changesByPath:mWe,pendingApprovals:iWe,availableOpenInApps:PWe,connection:BHe,loading:RHe,sessionLoading:OHe,loadingMoreMessages:$He,hasMoreMessages:PHe,loadMoreMessagesError:zHe,serverVersion:jHe,webTitle:tZ,documentBaseTitle:CWe,backend:WHe,dangerousBypassAuth:qHe,experimentalFlags:HHe,clearDangerousBypassAuth:UHe,initialized:LK,connectIssue:NK,permission:VHe,thinking:KHe,planMode:nZ,planArmed:ZHe,swarmMode:GHe,goalMode:QHe,queued:eWe,warnings:tWe,questions:nWe,activity:oS,turnActive:ub,activeTurnError:xHe,activeTurnRetry:SHe,inFlight:tS,working:EHe,isStartingFirstPrompt:CHe,models:hi.models,starredModelIds:hi.starredModelIds,providers:hi.providers,fontScale:my.fontScale,setFontScale:my.setFontScale,colorScheme:my.colorScheme,setColorScheme:my.setColorScheme,notifyEnabled:D(()=>pd().notifyEnabled),notifySound:D(()=>pd().notifySound),notifyPermission:D(()=>pd().notifyPermission),setNotifyEnabled:e=>pd().setNotifyEnabled(e),setNotifySound:e=>pd().setNotifySound(e),onboarded:$K,setOnboarded:Zje,load:zt.load,selectSession:zt.selectSession,clearActiveSession:zt.clearActiveSession,openSessionAdmin:e=>{e!==void 0&&Gi.applyFilters({workspaceIds:[e],status:"all",updatedFrom:"",updatedTo:""}),zt.openSessionAdmin()},closeSessionAdmin:zt.closeSessionAdmin,sessionAdminItems:D(()=>Gi.state.items),sessionAdminTotal:D(()=>Gi.state.total),sessionAdminLoading:D(()=>Gi.state.loading),sessionAdminFilters:D(()=>Gi.state.filters),sessionAdminPage:D(()=>Gi.state.page),sessionAdminPageSize:D(()=>Gi.state.pageSize),refreshSessionAdminSessions:Gi.refresh,applySessionAdminFilters:Gi.applyFilters,setSessionAdminWorkspaceFilter:Gi.setWorkspaceIds,setSessionAdminStatusFilter:Gi.setStatus,setSessionAdminTimeRange:Gi.setTimeRange,setSessionAdminPage:Gi.setPage,setSessionAdminPageSize:Gi.setPageSize,sessionAdminSelectedIds:D(()=>Gi.state.selectedIds),sessionAdminSelectedCount:D(()=>Gi.state.selectedIds.size),sessionAdminOpenSelectedIds:D(()=>Gi.selectedIdsByArchived(!1)),sessionAdminDoneSelectedIds:D(()=>Gi.selectedIdsByArchived(!0)),toggleSessionAdminSelection:Gi.toggleSelection,toggleSessionAdminPageSelection:Gi.togglePageSelection,setSessionAdminSelection:Gi.setSelection,clearSessionAdminSelection:Gi.clearSelection,selectSessionAdminAllMatching:Gi.selectAllMatching,sessionAdminAllMatching:D(()=>Gi.state.allMatching),sessionAdminMaterializingAll:D(()=>Gi.state.materializingAll),archiveSessions:Gi.archiveSessions,restoreSessions:Gi.restoreSessions,loadOlderMessages:async e=>{const t=Ho.pool.getEntry(e)?.channel;t?.snapshot.hasMoreOlder===!0&&await t.loadOlder().catch(()=>{})},loadWorkspaces:zt.loadWorkspaces,loadMoreSessions:zt.loadMoreSessions,loadAllSessions:zt.loadAllSessions,ensureFlatSessions:zt.ensureFlatSessions,loadMoreFlatSessions:MWe,ensureDoneSessions:zt.ensureDoneSessions,loadMoreDoneSessions:EWe,selectWorkspace:zt.selectWorkspace,openWorkspace:zt.openWorkspace,openWorkspaceDraft:zt.openWorkspaceDraft,startSessionAndSendPrompt:zt.startSessionAndSendPrompt,startSessionAndActivateSkill:zt.startSessionAndActivateSkill,startSessionAndOpenSideChat:zt.startSessionAndOpenSideChat,getDraftPromotion:zt.getDraftPromotion,addWorkspaceByPath:zt.addWorkspaceByPath,browseFs:zt.browseFs,getFsHome:zt.getFsHome,sendPrompt:zt.sendPrompt,steerPrompt:zt.steerPrompt,steerQueued:zt.steerQueued,sideChatVisible:xi.sideChatVisible,sideChatSessionId:xi.sideChatSessionId,sideChatTurns:xi.sideChatTurns,sideChatRunning:xi.sideChatRunning,sideChatSending:xi.sideChatSending,openSideChat:xi.openSideChat,closeSideChat:xi.closeSideChat,sendSideChatPrompt:xi.sendSideChatPrompt,sideChatTargetsOfSession:xi.sideChatTargetsOfSession,sideChatTurnsOf:xi.sideChatTurnsOf,sideChatRunningOf:xi.sideChatRunningOf,sideChatSendingOf:xi.sideChatSendingOf,openSideChatOn:xi.openSideChatOn,sendSideChatPromptOn:xi.sendSideChatPromptOn,saveSideChatDraft:xi.saveSideChatDraft,sideChatDraft:xi.sideChatDraft,clearSideChatDraftIfUnchanged:xi.clearSideChatDraftIfUnchanged,uploadImage:zt.uploadImage,abortCurrentPrompt:zt.abortCurrentPrompt,respondApproval:zt.respondApproval,respondQuestion:zt.respondQuestion,dismissQuestion:zt.dismissQuestion,pendingQuestionActions:zt.pendingQuestionActions,pendingApprovalActions:zt.pendingApprovalActions,cancelTask:zt.cancelTask,detachTask:zt.detachTask,setPermission:zt.setPermission,setThinking:hi.setThinking,setPlanMode:zt.setPlanMode,togglePlanMode:zt.togglePlanMode,setSwarmMode:zt.setSwarmMode,toggleSwarmMode:zt.toggleSwarmMode,setGoalMode:zt.setGoalMode,toggleGoalMode:zt.toggleGoalMode,createGoal:zt.createGoal,controlGoal:zt.controlGoal,enqueue:zt.enqueue,dismissWarning:zt.dismissWarning,renameSession:zt.renameSession,regenerateSessionTitle:zt.regenerateSessionTitle,renameWorkspace:zt.renameWorkspace,deleteWorkspace:zt.deleteWorkspace,reorderWorkspaces:RWe,setWorkspaceSortMode:vWe,pinSession:yWe,unpinSession:kWe,togglePinSession:wWe,archiveSession:zt.archiveSession,exportSession:zt.exportSession,restoreSession:zt.restoreSession,loadArchivedSessions:zt.loadArchivedSessions,compact:zt.compact,forkSession:zt.forkSession,undo:zt.undo,unqueue:zt.unqueue,reorderQueue:zt.reorderQueue,searchFiles:zt.searchFiles,loadGitStatus:er().loadGitStatus,loadFileDiff:er().loadFileDiff,clearFileDiff:er().clearFileDiff,listDir:zt.listDir,readFileContent:er().readFileContent,readHostFileContent:zt.readHostFileContent,probeWorkspacePath:zt.probeWorkspacePath,getFileDownloadUrl:zt.getFileDownloadUrl,openWorkspaceFile:zt.openWorkspaceFile,openInApp:zt.openInApp,revealWorkspaceFile:zt.revealWorkspaceFile,resolveImageUrl:zt.resolveImageUrl,loadModels:hi.loadModels,loadProviders:hi.loadProviders,skills:bHe,skillsLoaded:wHe,activateSkill:hi.activateSkill,setModel:hi.setModel,toggleStarModel:hi.toggleStarModel,addProvider:hi.addProvider,updateProvider:hi.updateProvider,getProvider:hi.getProvider,deleteProvider:hi.deleteProvider,refreshProvider:hi.refreshProvider,refreshAllProviders:hi.refreshAllProviders,loadCatalogProviders:hi.loadCatalogProviders,importCatalogProvider:hi.importCatalogProvider,importCustomRegistry:hi.importCustomRegistry,authReady:uWe,defaultModel:cWe,managedProviderStatus:dWe,managedUserInfo:fWe,managedMembership:hWe,notify:_h,config:pWe,loadConfig:zt.loadConfig,updateConfig:zt.updateConfig,checkAuth:zt.checkAuth,probeManagedMembership:zt.probeManagedMembership,startOAuthLogin:hi.startOAuthLogin,pollOAuthLogin:hi.pollOAuthLogin,cancelOAuthLogin:hi.cancelOAuthLogin,getOAuthRegion:hi.getOAuthRegion,getUsage:hi.getUsage,logout:zt.logout}}const HWe={class:"row"},WWe={key:0,class:"lead"},qWe={class:"left"},UWe=["readonly","onKeydown"],VWe={key:0,class:"gen-dots","aria-hidden":"true"},KWe=["aria-label"],ZWe={key:1,class:"act"},GWe={key:0,class:"ts"},QWe={key:1,class:"st"},YWe={key:1,class:"unread-dot"},JWe={key:2,class:"ha"},XWe={key:0,class:"sub"},eqe={class:"sub-text"},tqe=["aria-label"],nqe={class:"menu-time"},iqe=rt({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1},stateTag:{default:void 0}},emits:["select","rename","generateTitle","renameStateChange","archive","restore","fork","export","pin"],setup(e,{expose:t,emit:n}){const{t:i}=Ut(),{sidebarTabs:o}=em(),s=e,r=n;function l(Te){const Fe=new Date(Te);if(Number.isNaN(Fe.getTime()))return Te;const Ve=lt=>String(lt).padStart(2,"0");return`${Fe.getFullYear()}-${Ve(Fe.getMonth()+1)}-${Ve(Fe.getDate())} ${Ve(Fe.getHours())}:${Ve(Fe.getMinutes())}`}const a=D(()=>s.session.updatedAt?l(s.session.updatedAt):s.session.time),u=D(()=>s.session.cwdLabel!==void 0),c=D(()=>te.value?"idle":hv({busy:s.session.busy,unread:s.unread,questionCount:s.questionCount,approvalCount:s.approvalCount,pendingInteraction:s.session.pendingInteraction,lastTurnReason:s.session.lastTurnReason})),d=D(()=>c.value==="awaiting-question"),f=D(()=>c.value==="awaiting-approval"),h=D(()=>c.value==="aborted"),m=D(()=>c.value==="running"),g=D(()=>c.value==="unread"),v=D(()=>c.value!=="idle"),y=V(!1),b=V(null),w=V({});function C(Te){const Fe=Te.target;b.value?.el?.contains(Fe)||N()}async function T(){$(),y.value=!0,setTimeout(()=>document.addEventListener("mousedown",C),0),window.addEventListener("resize",N),await ft()}function N(){y.value=!1,document.removeEventListener("mousedown",C),window.removeEventListener("resize",N)}Ln(()=>{document.removeEventListener("mousedown",C),document.removeEventListener("mousedown",B),window.removeEventListener("keydown",P,!0),window.removeEventListener("resize",N),window.removeEventListener("resize",$)});const I=D(()=>cP(s.session.title)),S=D(()=>{const Te=I.value.emoji;return Te?s.session.title.slice(Te.length):s.session.title}),_=V(!1),x=V("menu"),E=V(null),M=V({});let R=null;function q(Te,Fe,Ve){const lt=E.value?.el,Ft=4,Lt=8,Vt=lt?.offsetHeight??0,qt=lt?.offsetWidth??0;let nn=Te.bottom+Ft,it=!1;nn+Vt>window.innerHeight-Lt&&(nn=Math.max(Lt,Te.top-Vt-Ft),it=!0);const dt=Ve??(Fe==="left"?Te.left:Te.right-qt),At=Math.max(Lt,Math.min(dt,window.innerWidth-qt-Lt)),un=Ve===void 0?Fe:`${Math.round(Math.min(Math.max(Ve-At,0),qt))}px`;M.value={top:`${Math.round(nn)}px`,left:`${Math.round(At)}px`,transformOrigin:`${un} ${it?"bottom":"top"}`,"--menu-pop-shift":it?"2px":"-2px"}}async function z(Te,Fe,Ve="left",lt){const Ft=Fe??Te?.getBoundingClientRect();if(Ft){if(_.value){$();return}N(),R=Te??null,_.value=!0,setTimeout(()=>document.addEventListener("mousedown",B),0),window.addEventListener("keydown",P,!0),window.addEventListener("resize",$),await ft(),q(Ft,Ve,lt)}}function $(){_.value=!1,R=null,document.removeEventListener("mousedown",B),window.removeEventListener("keydown",P,!0),window.removeEventListener("resize",$)}function B(Te){const Fe=Te.target;E.value?.el?.contains(Fe)||R?.contains(Fe)||$()}function P(Te){Te.key==="Escape"&&(E.value?.isComposingKeyEvent(Te)||(Te.preventDefault(),Te.stopPropagation(),$()))}function H(Te){return Te.clientX||Te.clientY?new DOMRect(Te.clientX,Te.clientY,0,0):void 0}function j(Te){Te.stopPropagation(),x.value="icon";const Fe=Te;z(Fe.currentTarget,H(Fe),"left",Fe.clientX||void 0)}function G(Te){x.value="menu";const Fe=b.value?.el,Ve=Te,lt=H(Ve)??Fe?.getBoundingClientRect();N(),z(Fe,lt,"left",Ve.clientX||void 0)}function ne(Te,Fe){if($(),Te===I.value.emoji)return;const Ve=Yse(s.session.title,Te);Ve&&Ve!==s.session.title&&(x.value,r("rename",s.session.id,Ve))}const W=Xa(),Q=D(()=>(W.experimentalFlags.value.auto_session_title??W.config.value?.experimental?.auto_session_title)===!0),te=V(!1),X=V(""),ve=V(null),ce=V(null),se=V(!1);let pe="",Z=null;const{handleCompositionStart:ae,handleCompositionEnd:K,isComposingKeyEvent:re}=bl();async function we(){N(),$(),te.value=!0,X.value=s.session.title,await ft();try{ve.value?.focus(),ve.value?.select()}catch{}}function be(){if(!te.value)return;const Te=X.value.trim();Te&&Te!==Z&&Te!==s.session.title&&r("rename",s.session.id,Te),te.value=!1}function ke(){se.value||be()}function oe(Te){re(Te)||se.value||be()}function le(Te){re(Te)||ye()}function ye(){se.value=!1,te.value=!1}function Ae(Te){const Fe=ce.value;if(!(Fe===null||!(Te.target instanceof Node)||Fe.contains(Te.target))){if(se.value){se.value=!1,te.value=!1;return}be()}}We(te,Te=>{Te?document.addEventListener("pointerdown",Ae,!0):document.removeEventListener("pointerdown",Ae,!0)}),Ln(()=>document.removeEventListener("pointerdown",Ae,!0));function Me(){se.value||(se.value=!0,pe=X.value,Z=null,X.value="",r("generateTitle",s.session.id,Te=>{se.value=!1,te.value&&(X.value=Te??pe,Z=Te,ft(()=>{try{ve.value?.focus(),ve.value?.select()}catch{}}))}))}We(te,Te=>r("renameStateChange",Te));async function fe(Te){te.value||(Te.preventDefault(),Te.stopPropagation(),y.value&&N(),await T(),ie(Te))}function ie(Te){const Fe=b.value?.el,Ve=8,lt=Fe?.offsetHeight??0,Ft=Fe?.offsetWidth??0;let Lt=Te.clientY,Vt=!1;Lt+lt>window.innerHeight-Ve&&(Lt=Math.max(Ve,Te.clientY-lt),Vt=!0);let qt=Te.clientX,nn=!1;qt+Ft>window.innerWidth-Ve&&(qt=Math.max(Ve,Te.clientX-Ft),nn=!0),w.value={top:`${Math.round(Lt)}px`,left:`${Math.round(qt)}px`,transformOrigin:`${Vt?"bottom":"top"} ${nn?"right":"left"}`,"--menu-pop-shift":Vt?"2px":"-2px"}}const Ee=V(!1),qe=V(!1);async function ze(){const Te=await Ls(s.session.id);Ee.value=Te,qe.value=!Te,setTimeout(()=>{Ee.value=!1,qe.value=!1,N()},1500)}function ht(){N(),r("fork",s.session.id)}function gt(){N(),r("export",s.session.id)}function _t(){N(),r("pin",s.session.id)}function $t(){N(),r("archive",s.session.id)}function jt(){N(),r("restore",s.session.id)}t({closeMenu:N});function Ht(){const Te=s.session.pullRequest?.url;Te&&window.open(Te,"_blank","noopener")}return(Te,Fe)=>(k(),L("div",{class:Re(["se",{on:e.active,flat:u.value}]),onClick:Fe[8]||(Fe[8]=Ve=>r("select",e.session.id)),onContextmenu:fe},[A("div",HWe,[u.value?ee("",!0):(k(),L("span",WWe)),A("div",qWe,[te.value?(k(),L("div",{key:0,ref_key:"renameWrapRef",ref:ce,class:Re(["rename-wrap",{generating:se.value}]),onClick:Fe[4]||(Fe[4]=Tt(()=>{},["stop"]))},[ai(A("input",{ref_key:"renameInputRef",ref:ve,"onUpdate:modelValue":Fe[0]||(Fe[0]=Ve=>X.value=Ve),class:"rename-input",readonly:se.value,onKeydown:[Yo(Tt(oe,["stop"]),["enter"]),Yo(Tt(le,["stop"]),["esc"])],onCompositionstart:Fe[1]||(Fe[1]=(...Ve)=>p(ae)&&p(ae)(...Ve)),onCompositionend:Fe[2]||(Fe[2]=(...Ve)=>p(K)&&p(K)(...Ve)),onBlur:ke},null,40,UWe),[[ar,X.value]]),se.value?(k(),L("span",VWe,[...Fe[9]||(Fe[9]=[A("i",null,null,-1),A("i",null,null,-1),A("i",null,null,-1)])])):ee("",!0),Q.value?(k(),de(p(Nn),{key:1,text:p(i)("sidebar.genTitle")},{default:ue(()=>[U(p(an),{class:"gen-title-btn",size:"sm",label:p(i)("sidebar.genTitle"),disabled:se.value,onMousedown:Fe[3]||(Fe[3]=Tt(()=>{},["prevent","stop"])),onClick:Tt(Me,["stop"])},{default:ue(()=>[U(p(Ce),{name:"gen-title"})]),_:1},8,["label","disabled"])]),_:1},8,["text"])):ee("",!0)],2)):(k(),L("span",{key:1,class:"t",onDblclick:Tt(we,["stop"])},[I.value.emoji?(k(),L("button",{key:0,type:"button",class:"emoji","aria-label":p(i)("sidebar.setEmoji"),onClick:Tt(j,["stop"]),onDblclick:Fe[5]||(Fe[5]=Tt(()=>{},["stop"]))},F(I.value.emoji),41,KWe)):ee("",!0),Oe(F(S.value),1)],32))]),te.value?ee("",!0):(k(),L("span",ZWe,[U(p(Nn),{text:p(i)("workspace.awaitingAnswerTitle")},{default:ue(()=>[d.value?(k(),de(p(cl),{key:0,variant:"info",size:"sm"},{default:ue(()=>[Oe(F(p(i)("workspace.awaitingAnswer")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),U(p(Nn),{text:p(i)("workspace.awaitingPermissionTitle")},{default:ue(()=>[f.value?(k(),de(p(cl),{key:0,variant:"warning",size:"sm"},{default:ue(()=>[Oe(F(p(i)("workspace.awaitingPermission")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),U(p(Nn),{text:p(i)("workspace.abortedTitle")},{default:ue(()=>[h.value?(k(),de(p(cl),{key:0,variant:"danger",size:"sm"},{default:ue(()=>[Oe(F(p(i)("workspace.aborted")),1)]),_:1})):ee("",!0)]),_:1},8,["text"]),v.value?m.value||g.value?(k(),L("span",QWe,[m.value?(k(),de(p(uo),{key:0,size:"sm"})):(k(),L("span",YWe))])):ee("",!0):(k(),L("span",GWe,F(e.session.time),1)),te.value?ee("",!0):(k(),L("span",JWe,[e.stateTag==="done"?(k(),de(p(Nn),{key:0,text:p(i)("sidebar.reopen")},{default:ue(()=>[U(p(an),{class:"reopen-btn",size:"sm",label:p(i)("sidebar.reopen"),onClick:Tt(jt,["stop"])},{default:ue(()=>[U(p(Ce),{name:"undo"})]),_:1},8,["label"])]),_:1},8,["text"])):(k(),L(De,{key:1},[U(p(Nn),{text:e.session.pinned?p(i)("sidebar.unpin"):p(i)("sidebar.pin")},{default:ue(()=>[U(p(an),{class:"pin-btn",size:"sm",label:e.session.pinned?p(i)("sidebar.unpin"):p(i)("sidebar.pin"),onClick:Tt(_t,["stop"])},{default:ue(()=>[U(p(Ce),{name:e.session.pinned?"unpin":"pin"},null,8,["name"])]),_:1},8,["label"])]),_:1},8,["text"]),U(p(Nn),{text:p(o)?p(i)("sidebar.complete"):p(i)("sidebar.archive")},{default:ue(()=>[U(p(an),{class:Re(p(o)?"complete-btn":"archive-btn"),size:"sm",label:p(o)?p(i)("sidebar.complete"):p(i)("sidebar.archive"),onClick:Tt($t,["stop"])},{default:ue(()=>[U(p(Ce),{name:p(o)?"state-done":"archive"},null,8,["name"])]),_:1},8,["class","label"])]),_:1},8,["text"])],64))]))]))]),e.session.cwdLabel!==void 0?(k(),L("div",XWe,[U(p(Ce),{class:"sub-icon",name:"folder-closed",size:"sm"}),A("span",eqe,F(e.session.cwdLabel),1),e.session.pullRequest?(k(),L("button",{key:0,type:"button",class:Re(["pr",`pr--${e.session.pullRequest.state}`]),"aria-label":`PR #${e.session.pullRequest.number}`,onClick:Tt(Ht,["stop"])},[U(p(Ce),{name:"git-pull-request",size:"sm"}),A("span",null,"#"+F(e.session.pullRequest.number),1)],10,tqe)):ee("",!0)])):ee("",!0),(k(),de(us,{to:"body"},[U(mo,{name:"menu-pop"},{default:ue(()=>[y.value?(k(),de(p(Hs),{key:0,ref_key:"menuRef",ref:b,class:"menu",style:sn(w.value),onClick:Fe[6]||(Fe[6]=Tt(()=>{},["stop"]))},{default:ue(()=>[U(p(tn),{danger:qe.value,onClick:ze},{default:ue(()=>[U(p(Ce),{name:"copy",size:"sm"}),Oe(" "+F(qe.value?p(i)("sidebar.copyFailed"):Ee.value?p(i)("sidebar.copied"):p(i)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),U(p(tn),{separator:""}),U(p(tn),{onClick:we},{default:ue(()=>[U(p(Ce),{name:"pencil",size:"sm"}),Oe(" "+F(p(i)("sidebar.rename")),1)]),_:1}),U(p(tn),{onClick:G},{default:ue(()=>[U(p(Ce),{name:"emoji",size:"sm"}),Oe(" "+F(p(i)("sidebar.setEmoji")),1)]),_:1}),U(p(tn),{onClick:ht},{default:ue(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),Oe(" "+F(p(i)("sidebar.fork")),1)]),_:1}),U(p(tn),{onClick:gt},{default:ue(()=>[U(p(Ce),{name:"download",size:"sm"}),Oe(" "+F(p(i)("sidebar.export")),1)]),_:1}),e.stateTag!=="done"?(k(),de(p(tn),{key:0,onClick:_t},{default:ue(()=>[U(p(Ce),{name:e.session.pinned?"unpin":"pin",size:"sm"},null,8,["name"]),Oe(" "+F(e.session.pinned?p(i)("sidebar.unpin"):p(i)("sidebar.pin")),1)]),_:1})):ee("",!0),e.stateTag==="done"?(k(),de(p(tn),{key:1,onClick:jt},{default:ue(()=>[U(p(Ce),{name:"undo",size:"sm"}),Oe(" "+F(p(i)("sidebar.reopen")),1)]),_:1})):(k(),de(p(tn),{key:2,onClick:$t},{default:ue(()=>[U(p(Ce),{name:p(o)?"state-done":"archive",size:"sm"},null,8,["name"]),Oe(" "+F(p(o)?p(i)("sidebar.markDone"):p(i)("sidebar.archive")),1)]),_:1})),U(p(tn),{separator:""}),A("div",nqe,F(p(i)("sidebar.lastActive",{time:a.value})),1)]),_:1},8,["style"])):ee("",!0)]),_:1})])),(k(),de(us,{to:"body"},[U(mo,{name:"menu-pop"},{default:ue(()=>[_.value?(k(),de(Ize,{key:0,ref_key:"pickerRef",ref:E,class:"picker",style:sn(M.value),current:I.value.emoji,removable:I.value.rest.length>0,onClick:Fe[7]||(Fe[7]=Tt(()=>{},["stop"])),onPick:ne},null,8,["style","current","removable"])):ee("",!0)]),_:1})]))],34))}}),a0=St(iqe,[["__scopeId","data-v-5086001d"]]),oqe={class:"pinned-label"},sqe={class:"pinned-title"},rqe=["draggable","onDragstart"],lqe=["aria-label","aria-valuenow","aria-valuemin","aria-valuemax"],aqe=rt({__name:"PinnedSessionList",props:{sessions:{},activeId:{},pendingBySession:{},unreadBySession:{},stateTag:{},flashSessionId:{}},emits:["selectSession","renameSession","generateSessionTitle","archiveSession","forkSession","exportSession","pinSession","dropPin","sessionDragStart","sessionDragEnd"],setup(e,{expose:t,emit:n}){const{t:i}=Ut(),o=e,s=n,r=V(Yle());function l(){r.value=!r.value,Vw(r.value)}function a(){r.value&&(r.value=!1,Vw(!1))}t({expand:a});const u=D(()=>!r.value&&ise(o.sessions.length)),c=V(window.innerHeight);function d(){c.value=window.innerHeight}kn(()=>window.addEventListener("resize",d)),Xn(()=>window.removeEventListener("resize",d));const f=V(null),h=V(null);function m(){return f.value?.parentElement?.nextElementSibling??null}const g=V(void 0);function v(){const Te=h.value,Fe=m();if(!Te||!Fe){g.value=void 0;return}g.value=Te.getBoundingClientRect().height+Fe.getBoundingClientRect().height}const y=V(null),b=V(null),w=V(null);function C(){const Te=m();if(!Te)return;const Fe=Te.querySelectorAll(".se"),Ve=[];let lt=0;for(let Vt=0;Vt{ft(()=>{v(),C();const Te=m();typeof ResizeObserver=="function"&&Te&&(T=new ResizeObserver(v),T.observe(Te)),typeof MutationObserver=="function"&&Te&&(N=new MutationObserver(C),N.observe(Te,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]})),Te?.addEventListener("transitionend",I)})}),Xn(()=>{T?.disconnect(),N?.disconnect(),m()?.removeEventListener("transitionend",I)});const S=V(null);function _(Te){S.value=Te,Q!==null&&Te!==Q&&(R.value=!0),h.value?.style.setProperty("max-height",`${Te}px`)}const x=V(null),E=V([]);let M=!1;const R=V(ps(xn.sidebarPinnedHeight)!==null),q=D(()=>ese(E.value)),z=D(()=>nse(b.value,w.value,y.value)),$=D(()=>sse(c.value,g.value,q.value,z.value)),{width:B,dragging:P,cursor:H,clamp:j,setWidth:G,onPointerDown:ne}=QV({storageKey:xn.sidebarPinnedHeight,defaultWidth:uI(window.innerHeight),min:()=>q.value,max:()=>M?M3($.value,x.value,q.value):$.value,axis:"y",applyLive:_,persist:()=>R.value});We([c,$],()=>{R.value||(B.value=j(uI(c.value)))});let W=null,Q=null,te=!1;function X(Te){const Fe=h.value;Fe&&(C(),M=!0,W=B.value,te=R.value,Q=j(Fe.getBoundingClientRect().height),B.value=Q),ne(Te)}We(P,Te=>{if(Te)return;M=!1;const Fe=S.value;W!==null&&lse(Q,Fe)&&(B.value=j(W),R.value=te),W=null,Q=null,S.value=null});const ve=D(()=>u.value||P.value);We([h,ve,B],([Te,Fe,Ve])=>{Te&&(Fe?Te.style.setProperty("max-height",`${Ve}px`):Te.style.removeProperty("max-height"))},{immediate:!0});function ce(Te){if(Te.key!=="ArrowUp"&&Te.key!=="ArrowDown")return;Te.preventDefault(),C();const Fe=h.value,Ve=M3($.value,Fe?.scrollHeight??null,q.value),lt=Fe?j(Fe.getBoundingClientRect().height):B.value,Ft=(Te.key==="ArrowDown"?1:-1)*(Te.shiftKey?48:16),Lt=rse(lt,Ft,Ve,q.value);Lt!==lt&&(R.value=!0,G(Lt))}const se=D(()=>{if(S.value!==null)return S.value;const Te=x.value;return Te===null?B.value:Math.min(B.value,Te)}),pe=V(!1),Z=V(!1),{thumb:ae,thumbVisible:K,update:re,markScrolling:we,onThumbPointerDown:be,onListMouseEnter:ke,onListMouseLeave:oe,onThumbMouseEnter:le,onThumbMouseLeave:ye}=YV(h);function Ae(Te=h.value){if(!Te)return;x.value=Te.scrollHeight;const Fe=[Te.children.item(0),Te.children.item(1)].map(Ve=>Ve?Ve.getBoundingClientRect().height:null);(Fe.length!==E.value.length||Fe.some((Ve,lt)=>Ve!==E.value[lt]))&&(E.value=Fe),pe.value=Te.scrollTop>0,Z.value=Te.scrollTop+Te.clientHeight{Fe&&fe?.disconnect(),fe=null,Te&&typeof ResizeObserver=="function"&&(fe=new ResizeObserver(()=>Ae()),fe.observe(Te)),Te?Ae(Te):(x.value=null,E.value=[],pe.value=!1,Z.value=!1,re())}),W1(()=>Ae()),Xn(()=>fe?.disconnect());const{fontScale:ie}=X1();We(ie,()=>{ft(()=>{Ae(),C()})});const Ee=V(null),qe=V(null);function ze(Te,Fe){if(!Fe.dataTransfer)return;Fe.dataTransfer.effectAllowed="move",Fe.dataTransfer.setData("text/plain",Te),Ee.value=Te;const Ve=o.sessions.find(lt=>lt.id===Te)?.workspaceId;Ve!==void 0&&s("sessionDragStart",Te,Ve)}function ht(){Ee.value=null,s("sessionDragEnd")}We(()=>o.sessions,Te=>{Ee.value!==null&&!Te.some(Fe=>Fe.id===Ee.value)&&(Ee.value=null)});const gt=V(!1);function _t(Te){return Te.dataTransfer?.types.includes(N9)??!1}function $t(Te){_t(Te)&&(Te.preventDefault(),Te.dataTransfer&&(Te.dataTransfer.dropEffect="move"),gt.value=!0)}function jt(Te){gt.value=!1;const Fe=Te.dataTransfer?.getData(N9);Fe&&s("dropPin",Fe)}function Ht(Te){Te.currentTarget.contains(Te.relatedTarget)||(gt.value=!1)}return(Te,Fe)=>(k(),L("div",{ref_key:"pinnedRootEl",ref:f,class:Re(["pinned",{"drop-active":gt.value}]),onDragover:$t,onDrop:jt,onDragleave:Ht},[A("div",oqe,[A("span",sqe,F(p(i)("sidebar.pinned")),1),U(p(an),{class:Re(["pinned-toggle",{"pinned-toggle--on":r.value}]),size:"sm",label:r.value?p(i)("sidebar.expandPinned"):p(i)("sidebar.collapsePinned"),tooltip:r.value?p(i)("sidebar.expandPinned"):p(i)("sidebar.collapsePinned"),onClick:Tt(l,["stop"])},{default:ue(()=>[r.value?(k(),de(p(Ce),{key:0,name:"chevron-right"})):(k(),de(p(Ce),{key:1,name:"chevron-down"}))]),_:1},8,["class","label","tooltip"])]),r.value?ee("",!0):(k(),L("div",{key:0,class:Re(["pinned-rows-wrap",{scrolled:pe.value,"more-below":Z.value}]),onMouseenter:Fe[10]||(Fe[10]=(...Ve)=>p(ke)&&p(ke)(...Ve)),onMouseleave:Fe[11]||(Fe[11]=(...Ve)=>p(oe)&&p(oe)(...Ve))},[A("div",{ref_key:"pinnedRowsEl",ref:h,class:"pinned-rows",onScroll:Me},[(k(!0),L(De,null,Ct(e.sessions,Ve=>(k(),L("div",{key:Ve.id,class:Re(["pin-row",{dragging:Ee.value===Ve.id}]),draggable:qe.value!==Ve.id,onDragstart:lt=>ze(Ve.id,lt),onDragend:ht},[U(a0,{session:Ve,active:Ve.id===e.activeId,"approval-count":e.pendingBySession[Ve.id]?.approvals??0,"question-count":e.pendingBySession[Ve.id]?.questions??0,unread:e.unreadBySession[Ve.id]??!1,"state-tag":o.stateTag,"data-session-id":Ve.id,class:Re({"se-locate-flash":e.flashSessionId===Ve.id}),onRenameStateChange:lt=>qe.value=lt?Ve.id:null,onSelect:Fe[0]||(Fe[0]=lt=>s("selectSession",lt)),onRename:Fe[1]||(Fe[1]=(lt,Ft)=>s("renameSession",lt,Ft)),onGenerateTitle:Fe[2]||(Fe[2]=(lt,Ft)=>s("generateSessionTitle",lt,Ft)),onArchive:Fe[3]||(Fe[3]=lt=>s("archiveSession",lt)),onFork:Fe[4]||(Fe[4]=lt=>s("forkSession",lt)),onExport:Fe[5]||(Fe[5]=lt=>s("exportSession",lt)),onPin:Fe[6]||(Fe[6]=lt=>s("pinSession",lt))},null,8,["session","active","approval-count","question-count","unread","state-tag","data-session-id","class","onRenameStateChange"])],42,rqe))),128))],544),Fe[12]||(Fe[12]=A("span",{class:"pinned-seam pinned-seam--top","aria-hidden":"true"},null,-1)),Fe[13]||(Fe[13]=A("span",{class:"pinned-seam pinned-seam--bottom","aria-hidden":"true"},null,-1)),p(ae)?(k(),L("span",{key:0,class:Re(["pinned-thumb",{visible:p(K)}]),style:sn({top:`${p(ae).top}px`,height:`${p(ae).height}px`}),"aria-hidden":"true",onPointerdown:Fe[7]||(Fe[7]=(...Ve)=>p(be)&&p(be)(...Ve)),onMouseenter:Fe[8]||(Fe[8]=(...Ve)=>p(le)&&p(le)(...Ve)),onMouseleave:Fe[9]||(Fe[9]=(...Ve)=>p(ye)&&p(ye)(...Ve))},null,38)):ee("",!0)],34)),ve.value?(k(),L("div",{key:1,class:Re(["pinned-resize",{dragging:p(P)}]),style:sn({cursor:p(H)}),role:"separator","aria-orientation":"horizontal","aria-label":p(i)("sidebar.resizePinnedAria"),"aria-valuenow":Math.round(se.value),"aria-valuemin":q.value,"aria-valuemax":p(M3)($.value,x.value,q.value),tabindex:"0",onPointerdown:X,onKeydown:ce},[...Fe[14]||(Fe[14]=[A("span",{class:"pinned-resize-bar","aria-hidden":"true"},null,-1)])],46,lqe)):ee("",!0)],34))}}),uqe=St(aqe,[["__scopeId","data-v-7139df48"]]);function BB(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue(e);return Number.parseFloat(n)||t}function cqe(e){return e?BB("--resize-handle-step-lg",48):BB("--resize-handle-step",16)}const dqe=["aria-label","aria-valuenow","aria-valuemin","aria-valuemax"],fqe=rt({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{},applyLive:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),{width:s,dragging:r,cursor:l,setWidth:a,onPointerDown:u}=QV({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse,applyLive:n.applyLive});i("update:width",s.value),We(s,d=>i("update:width",d)),We(r,d=>i("update:dragging",d));function c(d){if(d.key!=="ArrowLeft"&&d.key!=="ArrowRight")return;d.preventDefault();const f=d.key==="ArrowRight"?1:-1,h=n.reverse?-f:f;a(s.value+h*cqe(d.shiftKey))}return(d,f)=>(k(),L("div",{class:Re(["rh",{dragging:p(r)}]),style:sn({cursor:p(l)}),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??p(o)("layout.resizeHandleAria"),"aria-valuenow":Math.round(p(s)),"aria-valuemin":e.min,"aria-valuemax":e.max,tabindex:"0",onPointerdown:f[0]||(f[0]=(...h)=>p(u)&&p(u)(...h)),onKeydown:c},[...f[1]||(f[1]=[A("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],46,dqe))}}),uZ=St(fqe,[["__scopeId","data-v-c42027cd"]]),hqe={key:0,class:"actions"},pqe=["onClick"],mqe=["onClick"],gqe={key:1,class:"details"},vqe=rt({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut();function s(x){return typeof x=="object"&&x!==null}function r(x){return s(x)?x.title:x}function l(x){return s(x)?x.message??"":""}function a(x){return s(x)?x.details:void 0}function u(x){return s(x)?x.severity==="error":x.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function c(x){return s(x)?x.severity==="error"?"danger":x.severity==="success"?"success":x.severity==="info"?"info":"warning":u(x)?"danger":"warning"}function d(x){return s(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function f(x){if(!s(x))return x;const E=[x.title];x.message&&E.push(x.message);const M=x.details??[];if(M.length>0){E.push("",`${o("warnings.diagnostics")}:`);for(const R of M)E.push(`${R.label}: ${R.value}`)}return E.join(` +`)}let h=1;const m=V([]),g=new Map,v=new Map;function y(x){const E=u(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function b(x,E){const M=g.get(x)??{handle:null,deadline:0,remaining:0};M.handle=setTimeout(()=>_(x),E),M.deadline=Date.now()+E,g.set(x,M)}function w(x){const E=g.get(x);E&&E.handle!==null&&clearTimeout(E.handle),g.delete(x)}function C(x){const E=g.get(x);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function T(x){if(m.value.find(R=>R.id===x)?.detailsOpen)return;const M=g.get(x);!M||M.handle!==null||b(x,M.remaining)}const N=D(()=>sr.value+Ip.value>0);We(N,x=>{for(const E of m.value)x?C(E.id):T(E.id)});function I(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?C(x.id):T(x.id)}async function S(x){if(!await Ls(f(x.warning)))return;x.copied=!0;const M=v.get(x.id);M&&clearTimeout(M),v.set(x.id,setTimeout(()=>{x.copied=!1,v.delete(x.id)},1400))}function _(x){w(x);const E=v.get(x);E&&clearTimeout(E),v.delete(x);const M=m.value.findIndex(R=>R.id===x);M!==-1&&(m.value=m.value.filter(R=>R.id!==x),i("dismiss",M))}return We(()=>n.warnings,x=>{const E=[...m.value];m.value=x.map(M=>{const R=d(M),q=E.findIndex(B=>B.key===R),z=q===-1?void 0:E.splice(q,1)[0];if(z)return z.warning=M,z;const $={id:h++,key:R,warning:M,detailsOpen:!1,copied:!1};return b($.id,y(M)),N.value&&C($.id),$});for(const M of E){w(M.id);const R=v.get(M.id);R&&clearTimeout(R),v.delete(M.id)}},{immediate:!0,flush:"post"}),Ln(()=>{g.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),g.clear(),v.forEach(x=>clearTimeout(x)),v.clear()}),(x,E)=>(k(),de(VO,{name:"toast",tag:"div",class:Re(["toasts",{"below-overlay":N.value}]),role:"status","aria-live":"polite"},{default:ue(()=>[(k(!0),L(De,null,Ct(m.value,M=>(k(),de(p(Zie),{key:M.id,variant:c(M.warning),title:r(M.warning),message:l(M.warning),"dismiss-label":p(o)("warnings.dismiss"),onDismiss:R=>_(M.id),onPointerenter:R=>C(M.id),onPointerleave:R=>T(M.id)},{default:ue(()=>[a(M.warning)?.length?(k(),L("div",hqe,[A("button",{class:"link",type:"button",onClick:R=>I(M)},F(M.detailsOpen?p(o)("warnings.hideDetails"):p(o)("warnings.showDetails")),9,pqe),A("button",{class:"link",type:"button",onClick:R=>S(M)},F(M.copied?p(o)("warnings.copied"):p(o)("warnings.copyDetails")),9,mqe)])):ee("",!0),M.detailsOpen&&a(M.warning)?.length?(k(),L("dl",gqe,[(k(!0),L(De,null,Ct(a(M.warning),R=>(k(),L("div",{key:`${R.label}:${R.value}`,class:"detail-row"},[A("dt",null,F(R.label),1),A("dd",null,F(R.value),1)]))),128))])):ee("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1},8,["class"]))}}),yqe=St(vqe,[["__scopeId","data-v-f46ca0b3"]]),kqe=["draggable"],bqe={class:"gh-top"},wqe={class:"gh-name"},Cqe=["inert"],Aqe={key:0,class:"show-more-row"},xqe=["disabled"],Sqe={class:"show-more-label"},_qe={key:1,class:"show-more-sep","aria-hidden":"true"},Mqe={class:"show-more-label"},Iqe={key:1,class:"group-empty"},Tqe=rt({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},sortable:{type:Boolean},isCollapsed:{type:Function},visibleLimit:{type:Function},flashSessionId:{},pinnedDragSession:{},stateTag:{}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","generateSessionTitle","archiveSession","forkSession","exportSession","pinSession","dropPinnedSession","expand","collapse","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t,s=D({get:()=>i.renameValue,set:x=>o("updateRenameValue",x)}),r=V(!1),l=D(()=>i.pinnedDragSession!=null),a=D(()=>i.pinnedDragSession?.workspaceId===i.group.workspace.id);function u(x){if(i.pinnedDragSession!=null){if(!a.value){x.dataTransfer&&(x.dataTransfer.dropEffect="none");return}x.preventDefault(),x.dataTransfer&&(x.dataTransfer.dropEffect="move"),r.value=!0}}function c(x){i.pinnedDragSession==null||!a.value||(x.preventDefault(),r.value=!1,o("dropPinnedSession",i.pinnedDragSession.id))}function d(x){x.currentTarget.contains(x.relatedTarget)||(r.value=!1)}const f=D(()=>i.visibleLimit(i.group.workspace.id)??i.group.initialCount),h=D(()=>{const x=i.group.sessions.slice(0,f.value);if(i.activeId&&!x.some(E=>E.id===i.activeId)){const E=i.group.sessions.find(M=>M.id===i.activeId);if(E)return[...x,E]}return x}),m=D(()=>i.group.sessions.length>f.value||i.group.hasMore||i.group.loadingMore),g=D(()=>f.value>i.group.initialCount);function v(x){i.renameInputRef.value=x instanceof HTMLInputElement?x:null}const{handleCompositionStart:y,handleCompositionEnd:b,isComposingKeyEvent:w}=bl();function C(x){w(x)||o("confirmRename")}function T(x){w(x)||o("cancelRename")}const N=V(null);function I(x){i.renamingId!==i.group.workspace.id&&o("groupContextmenu",i.group.workspace,x)}function S(x){i.sortable!==!1&&x.dataTransfer&&(x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",i.group.workspace.id),o("wsDragstart",i.group.workspace.id))}function _(x,E){E.dataTransfer&&(E.dataTransfer.effectAllowed="move",E.dataTransfer.setData(N9,x),E.dataTransfer.setData("text/plain",x))}return(x,E)=>(k(),L("div",{class:Re(["group",{dragging:e.dragging,"pinned-drag-active":l.value&&a.value,"pinned-drop-hover":r.value,"pinned-drop-blocked":l.value&&!a.value}]),onDragover:u,onDrop:c,onDragleave:d},[A("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId&&e.activeId==="",collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:e.sortable!==!1&&e.renamingId!==e.group.workspace.id,onClick:E[7]||(E[7]=Tt(M=>o("groupClick",e.group.workspace.id,M),["stop"])),onContextmenu:I,onDragstart:S,onDragend:E[8]||(E[8]=M=>o("wsDragend"))},[A("div",bqe,[e.isCollapsed(e.group.workspace.id)?(k(),de(p(Ce),{key:0,class:"gh-folder",name:"folder-closed"})):(k(),de(p(Ce),{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(k(),de(p(Nn),{key:2,text:e.group.workspace.root},{default:ue(()=>[A("span",wqe,F(e.group.workspace.name),1)]),_:1},8,["text"])):ai((k(),L("input",{key:3,ref:v,"onUpdate:modelValue":E[0]||(E[0]=M=>s.value=M),class:"gh-rename",type:"text",onKeydown:[Yo(C,["enter"]),Yo(T,["esc"])],onCompositionstart:E[1]||(E[1]=(...M)=>p(y)&&p(y)(...M)),onCompositionend:E[2]||(E[2]=(...M)=>p(b)&&p(b)(...M)),onBlur:E[3]||(E[3]=M=>o("cancelRename")),onClick:E[4]||(E[4]=Tt(()=>{},["stop"]))},null,544)),[[ar,s.value]]),e.renamingId!==e.group.workspace.id?(k(),L("div",{key:4,class:Re(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[U(p(an),{class:Re(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:p(n)("sidebar.options"),tooltip:p(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:E[5]||(E[5]=Tt(M=>o("toggleWsMenu",e.group.workspace,M),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"dots-horizontal"})]),_:1},8,["class","label","tooltip","aria-expanded"]),U(p(an),{class:"gh-add",size:"sm",label:p(n)("workspace.newInGroup"),tooltip:p(n)("workspace.newInGroup"),onClick:E[6]||(E[6]=Tt(M=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"chat-new"})]),_:1},8,["label","tooltip"])],2)):ee("",!0)])],42,kqe),A("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(k(!0),L(De,null,Ct(h.value,M=>(k(),de(a0,{key:M.id,session:M,active:M.id===e.activeId,"approval-count":e.pendingBySession[M.id]?.approvals??0,"question-count":e.pendingBySession[M.id]?.questions??0,unread:e.unreadBySession[M.id]??!1,"state-tag":i.stateTag,draggable:N.value!==M.id,"data-session-id":M.id,class:Re({"se-locate-flash":e.flashSessionId===M.id}),onDragstart:R=>_(M.id,R),onRenameStateChange:R=>N.value=R?M.id:null,onSelect:E[9]||(E[9]=R=>o("selectSession",R)),onRename:E[10]||(E[10]=(R,q)=>o("renameSession",R,q)),onGenerateTitle:E[11]||(E[11]=(R,q)=>o("generateSessionTitle",R,q)),onArchive:E[12]||(E[12]=R=>o("archiveSession",R)),onFork:E[13]||(E[13]=R=>o("forkSession",R)),onExport:E[14]||(E[14]=R=>o("exportSession",R)),onPin:E[15]||(E[15]=R=>o("pinSession",R))},null,8,["session","active","approval-count","question-count","unread","state-tag","draggable","data-session-id","class","onDragstart","onRenameStateChange"]))),128)),m.value||g.value?(k(),L("div",Aqe,[m.value?(k(),L("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:E[16]||(E[16]=Tt(M=>o("expand",e.group.workspace.id),["stop"]))},[U(p(Ce),{name:"chevron-down",size:"sm"}),A("span",Sqe,F(e.group.loadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,xqe)):ee("",!0),m.value&&g.value?(k(),L("span",_qe,"·")):ee("",!0),g.value?(k(),L("button",{key:2,class:"show-more",onClick:E[17]||(E[17]=Tt(M=>o("collapse",e.group.workspace.id),["stop"]))},[U(p(Ce),{name:"chevron-up",size:"sm"}),A("span",Mqe,F(p(n)("sidebar.showLess")),1)])):ee("",!0)])):ee("",!0),e.group.sessions.length===0?(k(),L("div",Iqe,F(e.group.pinnedCount>0?p(n)("sidebar.allPinned",{count:e.group.pinnedCount}):p(n)("sidebar.noSessions")),1)):ee("",!0)],10,Cqe)],34))}}),Eqe=St(Tqe,[["__scopeId","data-v-643ef903"]]),Lqe=["aria-label"],Nqe={class:"sa-select-label"},Dqe={class:"sa-check"},Fqe=rt({__name:"FilterSelect",props:{modelValue:{},options:{},ariaLabel:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=e,o=n,s=V(null),{open:r,menuStyle:l,toggle:a,close:u}=yS(s);t({open:r});const c=D(()=>i.options.find(f=>f.value===i.modelValue)?.label??"");function d(f){f!==i.modelValue&&o("update:modelValue",f),u()}return(f,h)=>(k(),L(De,null,[A("button",{class:Re(["sa-select",{"is-open":p(r)}]),type:"button","aria-label":e.ariaLabel,onClick:h[0]||(h[0]=(...m)=>p(a)&&p(a)(...m))},[A("span",Nqe,F(c.value),1),U(p(Ce),{class:"sa-select-chev",name:"chevron-down",size:"sm"})],10,Lqe),U(mo,{name:"menu-pop"},{default:ue(()=>[p(r)?(k(),de(p(Hs),{key:0,ref_key:"menuRef",ref:s,class:"sa-menu",style:sn(p(l)),onClick:h[1]||(h[1]=Tt(()=>{},["stop"]))},{default:ue(()=>[(k(!0),L(De,null,Ct(e.options,m=>(k(),de(p(tn),{key:m.value,onClick:g=>d(m.value)},{default:ue(()=>[A("span",Dqe,[m.value===e.modelValue?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),m.dot?(k(),L("span",{key:0,class:Re(["sa-dot",`sa-dot--${m.dot}`])},null,2)):ee("",!0),Oe(" "+F(m.label),1)]),_:2},1032,["onClick"]))),128))]),_:1},8,["style"])):ee("",!0)]),_:1})],64))}}),UA=St(Fqe,[["__scopeId","data-v-d0588d0e"]]),Bqe=["aria-label","onKeydown"],Rqe={class:"sa-tag-name"},Oqe=["aria-label","onClick"],$qe={key:0,class:"sa-tag-more"},Pqe={key:1,class:"sa-select-label"},zqe={class:"sa-search"},jqe=["placeholder","aria-label"],Hqe={class:"sa-opts"},Wqe={class:"sa-ws-name"},qqe={key:0,class:"sa-menu-empty"},Uqe=rt({__name:"MultiSelectMenu",props:{options:{},modelValue:{},ariaLabel:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=Ut(),r=V(null),{open:l,menuStyle:a,toggle:u}=yS(r);t({open:l});const c=D(()=>new Set(i.modelValue)),d=D(()=>i.options.length>0&&c.value.size===i.options.length),f=D(()=>i.options.filter(I=>c.value.has(I.id))),h=D(()=>f.value.slice(0,2)),m=D(()=>f.value.length-h.value.length),g=V(""),v=V(null),y=D(()=>{const I=g.value.trim().toLowerCase();return I===""?i.options:i.options.filter(S=>S.name.toLowerCase().includes(I))});We(l,I=>{I?ft(()=>v.value?.focus()):g.value=""});function b(I){o("update:modelValue",i.options.filter(S=>I.has(S.id)).map(S=>S.id))}function w(I){const S=new Set(c.value);S.has(I)?S.delete(I):S.add(I),b(S)}function C(I){const S=new Set(c.value);S.delete(I),b(S)}function T(){b(d.value?new Set:new Set(i.options.map(I=>I.id)))}function N(I){u(I)}return(I,S)=>(k(),L(De,null,[A("div",{class:Re(["sa-select",{"is-open":p(l)}]),role:"button",tabindex:"0","aria-label":e.ariaLabel,onClick:S[2]||(S[2]=(..._)=>p(u)&&p(u)(..._)),onKeydown:[Yo(Tt(N,["prevent"]),["enter"]),Yo(Tt(N,["prevent"]),["space"])]},[f.value.length>0?(k(),L(De,{key:0},[(k(!0),L(De,null,Ct(h.value,_=>(k(),L("span",{key:_.id,class:"sa-tag"},[A("span",Rqe,F(_.name),1),A("button",{class:"sa-tag-x",type:"button","aria-label":p(s)("admin.removeTag",{name:_.name}),onClick:Tt(x=>C(_.id),["stop"]),onKeydown:[S[0]||(S[0]=Yo(Tt(()=>{},["stop"]),["enter"])),S[1]||(S[1]=Yo(Tt(()=>{},["stop"]),["space"]))]},[U(p(Ce),{name:"close",size:"sm"})],40,Oqe)]))),128)),m.value>0?(k(),L("span",$qe,"+"+F(m.value),1)):ee("",!0)],64)):(k(),L("span",Pqe,F(p(s)("admin.allWorkspaces")),1)),U(p(Ce),{class:"sa-select-chev",name:"chevron-down",size:"sm"})],42,Bqe),U(mo,{name:"menu-pop"},{default:ue(()=>[p(l)?(k(),de(p(Hs),{key:0,ref_key:"menuRef",ref:r,class:"sa-menu",style:sn(p(a)),role:"dialog",onClick:S[4]||(S[4]=Tt(()=>{},["stop"]))},{default:ue(()=>[A("div",zqe,[U(p(Ce),{name:"search",size:"sm"}),ai(A("input",{ref_key:"searchRef",ref:v,"onUpdate:modelValue":S[3]||(S[3]=_=>g.value=_),class:"sa-search-input",type:"text",placeholder:p(s)("admin.searchWorkspace"),"aria-label":p(s)("admin.searchWorkspace")},null,8,jqe),[[ar,g.value]])]),U(p(tn),{role:"button",active:d.value,onClick:T},{default:ue(()=>[Oe(F(p(s)("admin.selectAll")),1)]),_:1},8,["active"]),U(p(tn),{separator:""}),A("div",Hqe,[(k(!0),L(De,null,Ct(y.value,_=>(k(),de(p(tn),{key:_.id,role:"button",active:c.value.has(_.id),onClick:x=>w(_.id)},{default:ue(()=>[A("span",Wqe,F(_.name),1)]),_:2},1032,["active","onClick"]))),128)),y.value.length===0?(k(),L("div",qqe,F(p(s)("admin.noWorkspaceMatch")),1)):ee("",!0)])]),_:1},8,["style"])):ee("",!0)]),_:1})],64))}}),Vqe=St(Uqe,[["__scopeId","data-v-967a19b0"]]),Kqe={class:"sa-menu-head"},Zqe=rt({__name:"SessionAdminMenu",props:{mode:{},targetArchived:{type:Boolean},counts:{}},emits:["action"],setup(e,{expose:t,emit:n}){const i=n,{t:o}=Ut(),s=V(null),{open:r,menuStyle:l,toggleAnchored:a,openAt:u,close:c}=yS(s);function d(f){c(),i("action",f)}return t({openAt:u,toggleAnchored:a,close:c}),(f,h)=>(k(),de(mo,{name:"menu-pop"},{default:ue(()=>[p(r)?(k(),de(p(Hs),{key:0,ref_key:"menuRef",ref:s,class:"sa-menu",style:sn(p(l)),onClick:h[11]||(h[11]=Tt(()=>{},["stop"]))},{default:ue(()=>[e.mode==="single"?(k(),L(De,{key:0},[U(p(tn),{onClick:h[0]||(h[0]=m=>d("open"))},{default:ue(()=>[U(p(Ce),{name:"external-link",size:"sm"}),Oe(" "+F(p(o)("admin.open")),1)]),_:1}),U(p(tn),{onClick:h[1]||(h[1]=m=>d("rename"))},{default:ue(()=>[U(p(Ce),{name:"pencil",size:"sm"}),Oe(" "+F(p(o)("admin.rename")),1)]),_:1}),U(p(tn),{onClick:h[2]||(h[2]=m=>d("fork"))},{default:ue(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),Oe(" "+F(p(o)("admin.fork")),1)]),_:1}),U(p(tn),{onClick:h[3]||(h[3]=m=>d("export"))},{default:ue(()=>[U(p(Ce),{name:"download",size:"sm"}),Oe(" "+F(p(o)("admin.export")),1)]),_:1}),U(p(tn),{separator:""}),e.targetArchived?(k(),de(p(tn),{key:0,onClick:h[4]||(h[4]=m=>d("restore"))},{default:ue(()=>[U(p(Ce),{name:"undo",size:"sm"}),Oe(" "+F(p(o)("admin.reopen")),1)]),_:1})):(k(),de(p(tn),{key:1,onClick:h[5]||(h[5]=m=>d("archive"))},{default:ue(()=>[U(p(Ce),{name:"state-done",size:"sm"}),Oe(" "+F(p(o)("admin.markDone")),1)]),_:1}))],64)):e.mode==="rowActions"?(k(),L(De,{key:1},[U(p(tn),{onClick:h[6]||(h[6]=m=>d("rename"))},{default:ue(()=>[U(p(Ce),{name:"pencil",size:"sm"}),Oe(" "+F(p(o)("admin.rename")),1)]),_:1}),U(p(tn),{onClick:h[7]||(h[7]=m=>d("fork"))},{default:ue(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),Oe(" "+F(p(o)("admin.fork")),1)]),_:1}),U(p(tn),{onClick:h[8]||(h[8]=m=>d("export"))},{default:ue(()=>[U(p(Ce),{name:"download",size:"sm"}),Oe(" "+F(p(o)("admin.export")),1)]),_:1})],64)):(k(),L(De,{key:2},[A("div",Kqe,F(p(o)("admin.batchSelected",{n:e.counts?.total??0})),1),U(p(tn),{disabled:(e.counts?.open??0)===0,onClick:h[9]||(h[9]=m=>d("archive"))},{default:ue(()=>[U(p(Ce),{name:"state-done",size:"sm"}),Oe(" "+F(p(o)("admin.markDoneCount",{n:e.counts?.open??0})),1)]),_:1},8,["disabled"]),U(p(tn),{disabled:(e.counts?.done??0)===0,onClick:h[10]||(h[10]=m=>d("restore"))},{default:ue(()=>[U(p(Ce),{name:"undo",size:"sm"}),Oe(" "+F(p(o)("admin.reopenCount",{n:e.counts?.done??0})),1)]),_:1},8,["disabled"])],64))]),_:1},8,["style"])):ee("",!0)]),_:1}))}}),Gqe=St(Zqe,[["__scopeId","data-v-b35c02be"]]),Qqe={class:"sa-pager"},Yqe={class:"sa-total"},Jqe={class:"sa-pager-right"},Xqe={key:0,class:"sa-pages"},eUe=["disabled","title","aria-label"],tUe={key:0,class:"sa-ellipsis"},nUe=["onClick"],iUe=["disabled","title","aria-label"],oUe=rt({__name:"SessionAdminPagination",props:{page:{},pageSize:{},total:{}},emits:["update:page","update:pageSize"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=[10,20,50,100],r=D(()=>Math.max(1,Math.ceil(n.total/n.pageSize))),l=D(()=>Lst(n.page,r.value)),a=D(()=>s.map(c=>({value:String(c),label:o("admin.pageSize",{n:c})}))),u=D({get:()=>String(n.pageSize),set:c=>i("update:pageSize",Number(c))});return(c,d)=>(k(),L("div",Qqe,[A("span",Yqe,F(p(o)("admin.total",{n:e.total})),1),A("div",Jqe,[U(UA,{modelValue:u.value,"onUpdate:modelValue":d[0]||(d[0]=f=>u.value=f),options:a.value,"aria-label":p(o)("admin.pageSize",{n:e.pageSize})},null,8,["modelValue","options","aria-label"]),e.total>0?(k(),L("div",Xqe,[A("button",{class:"sa-pg",type:"button",disabled:e.page===1,title:p(o)("admin.prevPage"),"aria-label":p(o)("admin.prevPage"),onClick:d[1]||(d[1]=f=>i("update:page",e.page-1))},[U(p(Ce),{name:"chevron-left",size:"sm"})],8,eUe),(k(!0),L(De,null,Ct(l.value,(f,h)=>(k(),L(De,{key:h},[f==="…"?(k(),L("span",tUe,"…")):(k(),L("button",{key:1,class:Re(["sa-pg",{cur:f===e.page}]),type:"button",onClick:m=>i("update:page",f)},F(f),11,nUe))],64))),128)),A("button",{class:"sa-pg",type:"button",disabled:e.page===r.value,title:p(o)("admin.nextPage"),"aria-label":p(o)("admin.nextPage"),onClick:d[2]||(d[2]=f=>i("update:page",e.page+1))},[U(p(Ce),{name:"chevron-right",size:"sm"})],8,iUe)])):ee("",!0)])]))}}),sUe=St(oUe,[["__scopeId","data-v-d8059995"]]),rUe={key:0},lUe={class:"sa-col-cb"},aUe=["aria-label"],uUe={key:0,colspan:"7",class:"sa-batch"},cUe={class:"sa-batch-inner"},dUe={class:"sa-batch-count"},fUe=["disabled"],hUe=["disabled"],pUe=["disabled"],mUe={class:"sa-c-time"},gUe={class:"sa-c-time"},vUe=["onContextmenu"],yUe={class:"sa-col-cb"},kUe=["aria-label","onClick"],bUe=["onKeydown","onBlur"],wUe=["title"],CUe={class:"sa-ws"},AUe=["title"],xUe={class:"sa-c-time"},SUe={class:"sa-time sa-time--full"},_Ue={class:"sa-time sa-time--compact"},MUe={class:"sa-c-time"},IUe={class:"sa-time sa-time--full"},TUe={class:"sa-time sa-time--compact"},EUe={key:1,class:"sa-time sa-none"},LUe={class:"sa-act"},NUe={key:1,class:"sa-state"},DUe={key:2,class:"sa-state"},FUe={class:"sa-empty"},BUe=rt({__name:"SessionAdminTable",props:{items:{},total:{},loading:{type:Boolean},workspaces:{},batchRunning:{}},emits:["archiveSessions","restoreSessions"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=Xa(),r=D(()=>new Map(n.workspaces.map(H=>[H.id,H.name])));function l(H){return H.meta.title??H.meta.last_prompt??H.id.slice(0,12)}function a(H){const j=r.value.get(H.workspace.id);return j!==void 0?j:H.workspace.cwd!==null?Ic(H.workspace.cwd):"—"}function u(H){return H.meta.archived?JB(H.meta.archived_at??H.meta.updated_at):null}function c(H){return H.meta.archived?XB(H.meta.archived_at??H.meta.updated_at):null}const d=D(()=>s.sessionAdminSelectedIds.value),f=D(()=>s.sessionAdminSelectedCount.value),h=D(()=>s.sessionAdminOpenSelectedIds.value),m=D(()=>s.sessionAdminDoneSelectedIds.value),g=D(()=>s.sessionAdminAllMatching.value),v=D(()=>s.sessionAdminMaterializingAll.value),y=D(()=>({total:f.value,open:h.value.length,done:m.value.length})),b=D(()=>n.items.map(H=>({id:H.id,archived:H.meta.archived}))),w=D(()=>b.value.length>0&&b.value.every(H=>d.value.has(H.id))),C=D(()=>!w.value&&b.value.some(H=>d.value.has(H.id)));function T(){s.toggleSessionAdminPageSelection(b.value)}const N=V(null),I=V(""),S=V(null);function _(H){N.value=H.id,I.value=l(H),ft(()=>{S.value?.focus(),S.value?.select()})}async function x(H){if(N.value!==H.id)return;const j=I.value.trim();N.value=null,!(j===""||j===l(H))&&(await s.renameSession(H.id,j),await s.refreshSessionAdminSessions())}function E(H,j){H.stopPropagation(),H.key==="Enter"?x(j):H.key==="Escape"&&(N.value=null)}const M=V("single"),R=V(null),q=V(null);function z(H,j){j.preventDefault(),d.value.has(H.id)&&d.value.size>1?(M.value="multi",R.value=null):(s.setSessionAdminSelection([{id:H.id,archived:H.meta.archived}]),M.value="single",R.value=H),q.value?.openAt(j.clientX,j.clientY)}function $(H,j){M.value="rowActions",R.value=H,q.value?.toggleAnchored(j,"right")}function B(H){H.meta.archived?i("restoreSessions",[H.id]):i("archiveSessions",[H.id])}function P(H){if(M.value==="multi"){H==="archive"?i("archiveSessions",[...h.value]):H==="restore"&&i("restoreSessions",[...m.value]);return}const j=R.value;if(j!==null)switch(H){case"open":s.selectSession(j.id);break;case"rename":_(j);break;case"fork":s.forkSession(j.id);break;case"export":s.exportSession(j.id);break;case"archive":i("archiveSessions",[j.id]);break;case"restore":i("restoreSessions",[j.id]);break}}return(H,j)=>(k(),L(De,null,[A("div",{class:Re(["sa-table-card",{"is-loading":e.loading&&e.items.length>0}])},[e.items.length>0?(k(),L("table",rUe,[j[5]||(j[5]=A("colgroup",null,[A("col",{class:"sa-col-cb"}),A("col",{class:"sa-col-title"}),A("col",{class:"sa-col-ws"}),A("col",{class:"sa-col-status"}),A("col"),A("col",{class:"sa-col-time"}),A("col",{class:"sa-col-time"}),A("col",{class:"sa-col-act"})],-1)),A("thead",null,[A("tr",null,[A("th",lUe,[A("button",{class:Re(["sa-cb",{on:w.value,ind:C.value}]),type:"button","aria-label":p(o)("admin.selectPageAll"),onClick:T},[w.value?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):C.value?(k(),de(p(Ce),{key:1,name:"minus",size:"sm"})):ee("",!0)],10,aUe)]),f.value>0?(k(),L("th",uUe,[A("div",cUe,[A("span",dUe,F(g.value?p(o)("admin.allMatchingSelected",{n:f.value}):p(o)("admin.batchSelected",{n:f.value})),1),g.value?(k(),L("button",{key:0,class:"sa-batch-link",type:"button",onClick:j[0]||(j[0]=G=>p(s).clearSessionAdminSelection())},F(p(o)("admin.clearSelection")),1)):w.value&&e.total>f.value?(k(),L("button",{key:1,class:"sa-batch-link",type:"button",disabled:v.value,onClick:j[1]||(j[1]=G=>p(s).selectSessionAdminAllMatching())},F(v.value?p(o)("admin.materializingAll"):p(o)("admin.selectAllMatching",{total:e.total})),9,fUe)):ee("",!0),A("button",{class:"sa-btn-q sa-btn-q--primary",type:"button",disabled:y.value.open===0||e.batchRunning!==null,onClick:j[2]||(j[2]=G=>i("archiveSessions",[...h.value]))},[e.batchRunning==="archive"?(k(),de(p(uo),{key:0,size:"sm"})):(k(),de(p(Ce),{key:1,name:"state-done",size:"sm"})),Oe(" "+F(p(o)("admin.markDone")),1)],8,hUe),A("button",{class:"sa-btn-q",type:"button",disabled:y.value.done===0||e.batchRunning!==null,onClick:j[3]||(j[3]=G=>i("restoreSessions",[...m.value]))},[e.batchRunning==="restore"?(k(),de(p(uo),{key:0,size:"sm"})):(k(),de(p(Ce),{key:1,name:"undo",size:"sm"})),Oe(" "+F(p(o)("admin.reopen")),1)],8,pUe)])])):(k(),L(De,{key:1},[A("th",null,F(p(o)("admin.colTitle")),1),A("th",null,F(p(o)("admin.colWorkspace")),1),A("th",null,F(p(o)("admin.colStatus")),1),A("th",null,F(p(o)("admin.colPrompt")),1),A("th",mUe,F(p(o)("admin.colUpdated")),1),A("th",gUe,F(p(o)("admin.colCompleted")),1),A("th",null,F(p(o)("admin.colActions")),1)],64))])]),A("tbody",null,[(k(!0),L(De,null,Ct(e.items,G=>(k(),L("tr",{key:G.id,onContextmenu:ne=>z(G,ne)},[A("td",yUe,[A("button",{class:Re(["sa-cb",{on:d.value.has(G.id)}]),type:"button","aria-label":G.id,onClick:ne=>p(s).toggleSessionAdminSelection(G.id,G.meta.archived)},[d.value.has(G.id)?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)],10,kUe)]),A("td",null,[N.value===G.id?ai((k(),L("input",{key:0,ref_for:!0,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":j[4]||(j[4]=ne=>I.value=ne),class:"sa-rename",type:"text",onKeydown:ne=>E(ne,G),onBlur:ne=>void x(G)},null,40,bUe)),[[ar,I.value]]):(k(),L("span",{key:1,class:"sa-title",title:l(G)},F(l(G)),9,wUe))]),A("td",null,[A("span",CUe,[A("span",null,F(a(G)),1)])]),A("td",null,[A("span",{class:Re(["sa-st",G.meta.archived?"sa-st--done":"sa-st--open"])},[U(p(Ce),{name:G.meta.archived?"state-done":"state-open",size:"sm"},null,8,["name"]),Oe(" "+F(G.meta.archived?p(o)("admin.statusDone"):p(o)("admin.statusOpen")),1)],2)]),A("td",{class:"sa-prompt",title:G.meta.last_prompt??void 0},[A("span",{class:Re({"sa-none":G.meta.last_prompt===null})},F(G.meta.last_prompt??"—"),3)],8,AUe),A("td",xUe,[A("span",SUe,F(p(JB)(G.meta.updated_at)),1),A("span",_Ue,F(p(XB)(G.meta.updated_at)),1)]),A("td",MUe,[u(G)!==null?(k(),L(De,{key:0},[A("span",IUe,F(u(G)),1),A("span",TUe,F(c(G)),1)],64)):(k(),L("span",EUe,"—"))]),A("td",null,[A("div",LUe,[U(p(an),{size:"sm",label:G.meta.archived?p(o)("admin.reopen"):p(o)("admin.markDone"),tooltip:G.meta.archived?p(o)("admin.reopen"):p(o)("admin.markDone"),onClick:ne=>B(G)},{default:ue(()=>[U(p(Ce),{name:G.meta.archived?"undo":"state-done"},null,8,["name"])]),_:2},1032,["label","tooltip","onClick"]),U(p(an),{size:"sm",label:p(o)("admin.moreActions"),tooltip:p(o)("admin.moreActions"),onClick:ne=>$(G,ne)},{default:ue(()=>[U(p(Ce),{name:"dots-horizontal"})]),_:1},8,["label","tooltip","onClick"])])])],40,vUe))),128))])])):e.loading?(k(),L("div",NUe,[U(p(uo),{size:"lg",label:p(o)("admin.loading")},null,8,["label"])])):(k(),L("div",DUe,[A("p",FUe,F(p(o)("admin.empty")),1)]))],2),U(Gqe,{ref_key:"adminMenuRef",ref:q,mode:M.value,"target-archived":R.value?.meta.archived,counts:y.value,onAction:P},null,8,["mode","target-archived","counts"])],64))}}),RUe=St(BUe,[["__scopeId","data-v-dd5dbf42"]]),OUe={class:"activity-notice",role:"status"},$Ue={"aria-hidden":"true"},PUe={class:"an-label"},zUe=rt({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(k(),L("div",OUe,[A("span",$Ue,[U(p(uo),{size:"sm"})]),A("span",PUe,F(e.label),1)]))}}),jUe=St(zUe,[["__scopeId","data-v-fd031610"]]),HUe=["aria-expanded"],WUe={class:"think-title"},qUe={key:0,class:"think-time"},UUe=["inert"],VUe={class:"think-text"},KUe=rt({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},startedAt:{default:void 0},durationMs:{default:void 0},instantReveal:{type:Boolean,default:!1}},setup(e){const t=e,n=V(!1),{t:i}=Ut();We(()=>t.streaming,(d,f)=>{f&&!d&&(n.value=!1)});const o=V(Date.now());We(()=>[t.streaming,t.startedAt],([d,f],h,m)=>{if(!d||!f)return;o.value=Date.now();const g=setInterval(()=>{o.value=Date.now()},1e3);m(()=>clearInterval(g))},{immediate:!0});const s=D(()=>{if(t.streaming&&t.startedAt){const d=Date.parse(t.startedAt);return Number.isFinite(d)?Bu(o.value-d):""}if(t.durationMs!==void 0){const d=Bu(t.durationMs);return d?`· ${d}`:""}return""}),r=Yt(df,()=>{}),l=V(null),a=V(null),u=V(!1);function c(){if(!n.value){const f=(a.value?.scrollHeight??0)>(typeof window<"u"?window.innerHeight:0);u.value=t.instantReveal||t.streaming&&f}if(n.value=!n.value,n.value,t.streaming)return;const d=l.value;d&&ft(()=>r(d))}return(d,f)=>(k(),L("div",{class:Re(["think",{mob:e.mobile,open:n.value,streaming:e.streaming}])},[A("button",{ref_key:"headEl",ref:l,class:"think-head",type:"button","aria-expanded":n.value,onClick:c},[U(p(Ce),{class:"think-bulb",name:"thinking",size:"sm"}),A("span",WUe,F(e.streaming?p(i)("thinking.streaming"):p(i)("thinking.panelTitle")),1),s.value?(k(),L("span",qUe,F(s.value),1)):ee("",!0),U(p(Ce),{class:"think-car",name:"chevron-right",size:"sm"})],8,HUe),A("div",{class:Re(["think-body",{open:n.value,instant:u.value}]),inert:!n.value},[A("div",{ref_key:"bodyInnerEl",ref:a,class:"think-body-inner"},[A("pre",VUe,F(e.text),1)],512)],10,UUe)],2))}}),uS=St(KUe,[["__scopeId","data-v-39bd75ea"]]),Uo=Symbol("panelApi"),RB="__draft__:",ZUe={class:"op"},GUe={key:0,class:"op-empty"},QUe=rt({__name:"OutputPanel",props:{lines:{default:void 0},emptyText:{default:""}},setup(e){const t=e,n=D(()=>t.lines??[]);return(i,o)=>(k(),L("div",ZUe,[n.value.length===0&&e.emptyText?(k(),L("div",GUe,F(e.emptyText),1)):ee("",!0),(k(!0),L(De,null,Ct(n.value,(s,r)=>(k(),L("div",{key:r},F(s),1))),128))]))}}),Cl=St(QUe,[["__scopeId","data-v-ad2b6614"]]),YUe={class:"head-row"},JUe=["disabled","aria-label","aria-expanded"],XUe={class:"lead","aria-hidden":"true"},eVe={class:"main"},tVe={class:"task"},nVe={key:0,class:"type"},iVe={class:"tail"},oVe=["aria-label"],sVe=["aria-expanded"],rVe=rt({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["detach"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t,s=Yt(Uo);function r(E){if(!E)return{};try{const M=JSON.parse(E);return{description:typeof M.description=="string"?M.description:void 0,subagentType:typeof M.subagent_type=="string"?M.subagent_type:void 0,runInBackground:M.run_in_background===!0}}catch{return{}}}const l=D(()=>r(i.tool.arg)),a=D(()=>i.tool.status),u=D(()=>l.value.description||l.value.subagentType||Zh(i.tool.name)),c=D(()=>l.value.description?l.value.subagentType:""),d=Yt(XV),f=Yt(eK),h=D(()=>i.tool.agentId??d?.(i.tool.id)),m=D(()=>h.value!==void 0),g=Yt(tK),v=D(()=>l.value.runInBackground?g?.(i.tool.id,h.value):void 0),y=D(()=>{const E=v.value;return E==="run"?"running":E==="done"?"ok":E==="fail"?"error":E==="cancelled"?"cancelled":a.value}),b=D(()=>n(`tools.agent.status.${y.value}`)),w=D(()=>f?.(i.tool.id,h.value)),C=D(()=>[l.value.runInBackground?n("tools.agent.background"):n("tools.agent.foreground"),c.value,w.value?.display,w.value?.effort].filter(E=>E).join(" · ")),T=D(()=>!!i.tool.output&&i.tool.output.length>0),N=D(()=>m.value||T.value),I=V(!1),S=Yt(Wx,void 0),_=D(()=>l.value.runInBackground!==!0&&a.value==="running"&&S!==void 0&&S(i.tool.id)!==!1);function x(){if(h.value!==void 0){s?.openAgent(h.value);return}T.value&&(I.value=!I.value)}return(E,M)=>(k(),L("div",{class:Re(["agent-card",{err:y.value==="error"}])},[A("div",YUe,[A("button",{class:"head",type:"button",disabled:!N.value,"aria-label":m.value?p(n)("tasks.openDetail"):void 0,"aria-expanded":m.value?void 0:I.value,onClick:x},[A("span",XUe,[U(p(Ce),{name:"robot",size:"sm"})]),A("span",eVe,[A("span",tVe,F(u.value),1),C.value?(k(),L("span",nVe,F(C.value),1)):ee("",!0)]),A("span",iVe,[A("span",{class:Re(["st",y.value]),role:"status","aria-label":b.value},[y.value==="ok"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):y.value==="error"?(k(),de(p(Ce),{key:1,name:"close",size:"sm"})):y.value==="cancelled"?(k(),de(p(Ce),{key:2,name:"close",size:"sm"})):(k(),de(p(Ul),{key:3,status:"running"}))],10,oVe)])],8,JUe),_.value?(k(),de(p(an),{key:0,class:Re(["detach",{touch:e.mobile}]),size:"sm",label:p(n)("tasks.toBackground"),tooltip:p(n)("tasks.toBackground"),onClick:M[0]||(M[0]=Tt(R=>o("detach",e.tool.id),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"pip",size:"sm"})]),_:1},8,["class","label","tooltip"])):ee("",!0),A("span",{class:"go-slot","aria-hidden":"true",onClick:x},[m.value?(k(),de(p(Ce),{key:0,class:"go",name:"arrow-right",size:"sm"})):T.value?(k(),de(p(Ce),{key:1,class:Re(["go car",{open:I.value}]),name:"chevron-right",size:"sm"},null,8,["class"])):ee("",!0)])]),m.value&&T.value?(k(),L("button",{key:0,class:"saved-result",type:"button","aria-expanded":I.value,onClick:M[1]||(M[1]=R=>I.value=!I.value)},[U(p(Ce),{class:Re(["saved-result__chevron",{open:I.value}]),name:"chevron-right",size:"sm","aria-hidden":"true"},null,8,["class"]),A("span",null,F(p(n)("tools.output.saved")),1)],8,sVe)):ee("",!0),T.value&&I.value?(k(),L("div",{key:1,class:Re(["result",{"result--legacy":!m.value}])},[U(Cl,{lines:e.tool.output},null,8,["lines"])],2)):ee("",!0)],2))}}),lVe=St(rVe,[["__scopeId","data-v-4a2d5e3d"]]),aVe={class:"tl-ic","aria-hidden":"true"},uVe={class:"tl-main"},cVe=["aria-expanded","aria-label"],dVe={class:"tl-tail"},fVe=["aria-label"],hVe=["inert"],pVe={class:"tl-body-inner"},mVe=rt({__name:"ToolDisclosure",props:{status:{},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1}},emits:["toggle"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=Yt(df,()=>{}),r=V(null);function l(){if(!n.expandable)return;n.open,i("toggle");const u=r.value;u&&ft(()=>s(u))}const a=D(()=>n.open?o("tools.disclosure.collapse"):o("tools.disclosure.expand"));return(u,c)=>(k(),L("div",{class:Re(["tool-line",{open:e.open,expandable:e.expandable,err:e.status==="error"}])},[A("div",{ref_key:"headEl",ref:r,class:Re(["tl-head",{clickable:e.expandable}]),onClick:l},[A("span",aVe,[Wn(u.$slots,"leading")]),A("span",uVe,[Wn(u.$slots,"default"),U(p(Nn),{text:a.value},{default:ue(()=>[e.expandable?(k(),L("button",{key:0,class:"tl-car",type:"button","aria-expanded":e.open,"aria-label":a.value,onClick:Tt(l,["stop"])},[U(p(Ce),{class:"tl-car-ic",name:"chevron-right",size:"sm","aria-hidden":"true"})],8,cVe)):ee("",!0)]),_:1},8,["text"])]),A("span",dVe,[Wn(u.$slots,"trailing"),A("span",{class:Re(["tl-status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):e.status==="error"?(k(),de(p(Ce),{key:1,name:"close",size:"sm"})):e.status==="suspended"?(k(),de(p(Ul),{key:2,status:"suspended"})):(k(),de(p(Ul),{key:3,status:"running"}))],10,fVe)])],2),e.expandable?(k(),L("div",{key:0,class:Re(["tl-body",{open:e.open}]),inert:!e.open},[A("div",pVe,[Wn(u.$slots,"body")])],10,hVe)):ee("",!0)],2))}}),Sa=St(mVe,[["__scopeId","data-v-e445a9a3"]]),gVe={key:0,class:"rc-flat"},vVe={class:"rc-head"},yVe={class:"rc-st"},kVe={class:"rc-qtext"},bVe={class:"rc-lb"},wVe={key:0,class:"rc-opt"},CVe={class:"rc-lb"},AVe={class:"rc-ds"},xVe={key:1,class:"rc-opt"},SVe={class:"rc-lb"},_Ve={key:2,class:"rc-qskip"},MVe={class:"tl-name"},IVe={key:0,class:"tl-dim"},TVe={key:0,class:"tl-chip"},EVe=80,LVe=rt({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Ut();function i(I,S=EVe){const _=I.trim();return _.length>S?_.slice(0,S-1)+"…":_}const o=D(()=>_st(t.tool.arg)),s=D(()=>Mst(t.tool.output)),r=D(()=>s.value.recognized),l=D(()=>r.value&&Object.keys(s.value.answers).length===0&&s.value.note.length>0),a=D(()=>o.value.map((I,S)=>Est(Ist(s.value.answers,I.question,S),I.options))),u=D(()=>Object.keys(s.value.answers).length);function c(I,S){return a.value[I]?.selected.has(S)??!1}function d(I){return a.value[I]?.otherText??""}function f(I){return a.value[I]?.indeterminate??!1}const h=D(()=>t.tool.status),m=D(()=>o.value.map((I,S)=>({q:I,selected:I.options.map((_,x)=>({o:_,oi:x})).filter(({oi:_})=>c(S,_))}))),g=D(()=>o.value.length===1?n("tools.ask.question",{count:1}):n("tools.ask.questions",{count:o.value.length})),v=D(()=>{const I=o.value[0]?.question??"",S=n("tools.ask.unanswered");return I?`${I} —— ${S}`:S}),y=D(()=>{if(!r.value)return i(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const I=o.value[0]?.question??"",S=i(I);return o.value.length<=1?S:`${S} ${n("tools.ask.more",{count:o.value.length-1})}`}),b=D(()=>r.value?l.value?n("tools.ask.dismissed"):u.value===0?"":u.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:u.value}):""),w=D(()=>!!t.tool.output&&t.tool.output.length>0),C=D(()=>r.value&&(o.value.length>0||l.value)||w.value),T=V(t.tool.defaultExpanded===!0&&C.value),N=D(()=>Zh(t.tool.name));return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&C.value&&(T.value=!0)}),(I,S)=>r.value&&h.value==="ok"?(k(),L("div",{key:0,class:Re(["ask-receipt",{flat:l.value||u.value===0}])},[l.value||u.value===0?(k(),L("span",gVe,F(v.value),1)):(k(),L(De,{key:1},[A("div",vVe,[A("span",null,F(p(n)("tools.ask.collected"))+" · "+F(g.value),1),A("span",yVe,[U(p(Ce),{name:"check",size:"sm"})])]),(k(!0),L(De,null,Ct(m.value,(_,x)=>(k(),L("div",{key:x,class:"rc-q"},[A("div",kVe,[A("span",null,F(_.q.question),1)]),(k(!0),L(De,null,Ct(_.selected,E=>(k(),L("div",{key:E.oi,class:"rc-opt"},[A("span",{class:Re(["rc-g on",_.q.multiSelect?"chk":"rad"])},null,2),A("span",bVe,F(E.o.label),1)]))),128)),d(x)?(k(),L("div",wVe,[A("span",{class:Re(["rc-g on",_.q.multiSelect?"chk":"rad"])},null,2),A("span",CVe,F(d(x)),1),A("span",AVe,F(p(n)("tools.ask.freeInput")),1)])):ee("",!0),f(x)?(k(),L("div",xVe,[S[1]||(S[1]=A("span",{class:"rc-g rad on"},null,-1)),A("span",SVe,F(p(n)("tools.ask.answered")),1)])):ee("",!0),_.selected.length===0&&!d(x)&&!f(x)?(k(),L("div",_Ve,F(p(n)("tools.ask.unanswered")),1)):ee("",!0)]))),128))],64))],2)):(k(),de(Sa,{key:1,status:h.value,open:T.value,expandable:C.value,onToggle:S[0]||(S[0]=_=>T.value=!T.value)},{leading:ue(()=>[U(p(Ce),{name:"help-circle",size:"sm"})]),trailing:ue(()=>[b.value?(k(),L("span",TVe,F(b.value),1)):ee("",!0)]),body:ue(()=>[U(Cl,{lines:e.tool.output},null,8,["lines"])]),default:ue(()=>[A("span",MVe,F(N.value),1),y.value?(k(),L("span",IVe,F(y.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),NVe=St(LVe,[["__scopeId","data-v-928d131f"]]),DVe={class:"tl-name"},FVe={class:"tl-mono"},BVe=["aria-label"],RVe={key:1,class:"tl-chip"},OVe={class:"cmd-echo"},$Ve=rt({__name:"BashTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["detach"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=D(()=>n.tool.status),r=D(()=>{const h=Nc(n.tool.arg);return(ki(h?.command)??ki(h?.cmd)??ki(h?.script)??n.tool.arg.replace(/^·\s*/,"")).trim()}),l=D(()=>n.tool.status==="running"),a=D(()=>!!n.tool.output&&n.tool.output.length>0),u=D(()=>a.value||l.value||r.value.length>0),c=V(n.tool.defaultExpanded===!0&&u.value),d=Yt(Wx,void 0),f=D(()=>l.value&&d!==void 0&&d(n.tool.id)!==!1);return We(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status],()=>{n.tool.defaultExpanded===!0&&u.value&&(c.value=!0)}),(h,m)=>(k(),de(Sa,{status:s.value,open:c.value,expandable:u.value,onToggle:m[1]||(m[1]=g=>c.value=!c.value)},{leading:ue(()=>[U(p(Ce),{name:"terminal",size:"sm"})]),trailing:ue(()=>[f.value?(k(),de(p(Nn),{key:0,text:p(o)("tasks.toBackground")},{default:ue(()=>[A("button",{class:Re(["tl-detach",{touch:e.mobile}]),type:"button","aria-label":p(o)("tasks.toBackground"),onClick:m[0]||(m[0]=Tt(g=>i("detach",e.tool.id),["stop"]))},[U(p(Ce),{name:"pip",size:"sm","aria-hidden":"true"})],10,BVe)]),_:1},8,["text"])):ee("",!0),e.tool.timing?(k(),L("span",RVe,F(e.tool.timing),1)):ee("",!0)]),body:ue(()=>[A("div",OVe,F(r.value),1),U(Cl,{lines:e.tool.output,"empty-text":l.value?p(o)("tools.output.waiting"):p(o)("tools.output.empty")},null,8,["lines","empty-text"])]),default:ue(()=>[A("span",DVe,F(p(o)("tools.label.bash")),1),A("span",FVe,F(r.value),1)]),_:1},8,["status","open","expandable"]))}}),PVe=St($Ve,[["__scopeId","data-v-e0f3f8fe"]]),zVe={class:"tl-name"},jVe={key:1,class:"tl-dim"},HVe={key:2,class:"tl-faint"},WVe={key:0,class:"tl-add"},qVe={key:1,class:"tl-del"},UVe={class:"diffbar","aria-hidden":"true"},VVe={key:1,class:"tl-chip"},KVe=rt({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,n=Yt(Uo),{t:i}=Ut(),o=D(()=>t.tool.status),s=D(()=>_r(t.tool.name)==="write"),r=D(()=>DZ(Nc(t.tool.arg))??""),l=D(()=>r.value?Ic(r.value):""),a=D(()=>r.value?FZ(r.value):""),u=D(()=>YW(t.tool)),c=D(()=>mAe(t.tool)),d=D(()=>{const C=u.value;return!C||t.tool.status==="error"?{added:0,removed:0}:WW(C)}),f=D(()=>d.value.added>0||d.value.removed>0),h=D(()=>!!t.tool.output&&t.tool.output.length>0),m=D(()=>u.value!==null&&t.tool.status!=="error"),g=D(()=>c.value!==null&&t.tool.status!=="error"),v=D(()=>m.value||g.value||h.value),y=V(!1),b=V(y.value);We(y,C=>{C&&(b.value=!0)});function w(){r.value&&n?.openFile({path:r.value})}return(C,T)=>(k(),de(Sa,{status:o.value,open:y.value,expandable:v.value,onToggle:T[0]||(T[0]=N=>y.value=!y.value)},{leading:ue(()=>[U(p(Ce),{name:s.value?"file-plus":"pencil",size:"sm"},null,8,["name"])]),trailing:ue(()=>[f.value?(k(),L(De,{key:0},[d.value.added>0?(k(),L("span",WVe,"+"+F(d.value.added),1)):ee("",!0),d.value.removed>0?(k(),L("span",qVe,"−"+F(d.value.removed),1)):ee("",!0),A("span",UVe,[A("span",{class:"seg-add",style:sn({flexGrow:d.value.added})},null,4),A("span",{class:"seg-del",style:sn({flexGrow:d.value.removed})},null,4)])],64)):s.value&&o.value==="ok"?(k(),L("span",VVe,F(p(i)("tools.chip.created")),1)):ee("",!0)]),body:ue(()=>[m.value&&b.value?(k(),de(Wa,{key:0,lines:u.value??[],path:r.value},null,8,["lines","path"])):g.value&&b.value?(k(),de(Wa,{key:1,code:c.value?.content??"",path:c.value?.path},null,8,["code","path"])):(k(),de(Cl,{key:2,lines:e.tool.output,"empty-text":p(i)("tools.output.waiting")},null,8,["lines","empty-text"]))]),default:ue(()=>[A("span",zVe,F(s.value?p(i)("tools.label.write"):p(i)("tools.label.edit")),1),l.value?(k(),L("button",{key:0,class:"tl-file",type:"button",onClick:Tt(w,["stop"])},F(l.value),1)):(k(),L("span",jVe,F(r.value||e.tool.arg),1)),a.value?(k(),L("span",HVe,F(a.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),ZVe=St(KVe,[["__scopeId","data-v-b25ea4cc"]]),GVe=["innerHTML"],QVe={class:"tl-name"},YVe={key:0,class:"tl-dim"},JVe={key:0,class:"tl-chip"},XVe={key:1,class:"tl-chip"},eKe={key:0,class:"arg-full"},tKe=rt({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Ut(),i=D(()=>t.tool.status),o=D(()=>Zh(t.tool.name)),s=D(()=>MZ(t.tool.name)),r=D(()=>GB(t.tool.name,t.tool.arg)),l=D(()=>GB(t.tool.name,t.tool.arg,!0)),a=D(()=>cst({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status})),u=D(()=>!!t.tool.output&&t.tool.output.length>0),c=D(()=>u.value||!!l.value&&l.value!==r.value),d=V(t.tool.defaultExpanded===!0&&c.value);return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&c.value&&(d.value=!0)}),(f,h)=>(k(),de(Sa,{status:i.value,open:d.value,expandable:c.value,onToggle:h[0]||(h[0]=m=>d.value=!d.value)},{leading:ue(()=>[A("span",{class:"gl",innerHTML:s.value},null,8,GVe)]),trailing:ue(()=>[a.value?(k(),L("span",JVe,F(a.value),1)):e.tool.timing?(k(),L("span",XVe,F(e.tool.timing),1)):ee("",!0)]),body:ue(()=>[l.value&&l.value!==r.value?(k(),L("div",eKe,F(l.value),1)):ee("",!0),U(Cl,{lines:e.tool.output,"empty-text":i.value==="running"?p(n)("tools.output.waiting"):p(n)("tools.output.empty")},null,8,["lines","empty-text"])]),default:ue(()=>[A("span",QVe,F(o.value),1),r.value?(k(),L("span",YVe,F(r.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),nKe=St(tKe,[["__scopeId","data-v-c64dda93"]]),iKe={class:"tl-name"},oKe={key:0,class:"tl-mono"},sKe={key:1,class:"tl-mono"},rKe={key:2,class:"tl-dim"},lKe={key:3,class:"tl-faint"},aKe={key:0,class:"tl-chip"},uKe={key:0,class:"file-list"},cKe=["onClick"],dKe=rt({__name:"GlobTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,n=Yt(Uo),{t:i}=Ut(),o=D(()=>t.tool.status),s=D(()=>_r(t.tool.name)==="glob"),r=D(()=>Nc(t.tool.arg)),l=D(()=>{const m=r.value;return ki(m?.pattern)??ki(m?.glob)??ki(m?.query)??""}),a=D(()=>{const m=r.value;return ki(m?.path)??ki(m?.dir)??ki(m?.directory)??ki(m?.cwd)??""}),u=D(()=>(t.tool.output??[]).filter(m=>m.trim().length>0)),c=D(()=>u.value.length>0),d=D(()=>c.value),f=V(t.tool.defaultExpanded===!0&&d.value);We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&d.value&&(f.value=!0)});function h(m){const g=m.trim();g&&n?.openFile({path:g})}return(m,g)=>(k(),de(Sa,{status:o.value,open:f.value,expandable:d.value,onToggle:g[0]||(g[0]=v=>f.value=!f.value)},{leading:ue(()=>[U(p(Ce),{name:s.value?"tree-view":"list",size:"sm"},null,8,["name"])]),trailing:ue(()=>[s.value&&u.value.length>0?(k(),L("span",aKe,F(p(i)("tools.chip.files",{count:u.value.length})),1)):ee("",!0)]),body:ue(()=>[s.value?(k(),L("div",uKe,[(k(!0),L(De,null,Ct(u.value,(v,y)=>(k(),L("button",{key:y,class:"file-row",type:"button",onClick:b=>h(v)},F(v),9,cKe))),128))])):(k(),de(Cl,{key:1,lines:e.tool.output},null,8,["lines"]))]),default:ue(()=>[A("span",iKe,F(p(i)(s.value?"tools.label.glob":"tools.label.ls")),1),s.value&&l.value?(k(),L("span",oKe,F(l.value),1)):!s.value&&a.value?(k(),L("span",sKe,F(a.value),1)):(k(),L("span",rKe,F(e.tool.arg),1)),s.value&&a.value?(k(),L("span",lKe,F(a.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),fKe=St(dKe,[["__scopeId","data-v-ef9af25f"]]),hKe={class:"tl-name"},pKe={key:0,class:"tl-dim"},mKe={key:1,class:"tl-pill pill-active"},gKe={key:0,class:"goal-block"},vKe={class:"goal-text"},yKe={key:0,class:"goal-criterion"},kKe=rt({__name:"GoalTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Ut(),i=D(()=>t.tool.status),o=D(()=>_r(t.tool.name)),s=D(()=>Nc(t.tool.arg)),r=D(()=>ki(s.value?.objective)??""),l=D(()=>ki(s.value?.completionCriterion)??ki(s.value?.completion_criterion)??""),a={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"},u=D(()=>ki(s.value?.status)??""),c=D(()=>{const b=a[u.value];return b?n(b):u.value}),d=D(()=>{switch(u.value){case"complete":return"pill-done";case"blocked":return"pill-blocked";default:return"pill-active"}}),f=D(()=>{const b=Xc(s.value?.value),w=ki(s.value?.unit);return b===void 0||!w?"":["turns","tokens","milliseconds","seconds","minutes","hours"].includes(w)?n(`tools.goal.${w}`,{value:b}):n("tools.goal.budget",{value:b,unit:w})}),h=D(()=>{switch(o.value){case"creategoal":return r.value;case"updategoal":return c.value;case"setgoalbudget":return f.value;default:return""}}),m=D(()=>!!t.tool.output&&t.tool.output.length>0),g=D(()=>!!l.value||o.value==="creategoal"&&m.value),v=D(()=>g.value||m.value),y=V(t.tool.defaultExpanded===!0&&v.value);return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&v.value&&(y.value=!0)}),(b,w)=>(k(),de(Sa,{status:i.value,open:y.value,expandable:v.value,onToggle:w[0]||(w[0]=C=>y.value=!y.value)},{leading:ue(()=>[U(p(Ce),{name:"target",size:"sm"})]),trailing:ue(()=>[o.value==="updategoal"&&c.value?(k(),L("span",{key:0,class:Re(["tl-pill",d.value])},F(c.value),3)):o.value==="creategoal"?(k(),L("span",mKe,F(p(n)("status.goalStatusActive")),1)):ee("",!0)]),body:ue(()=>[r.value?(k(),L("div",gKe,[A("div",vKe,F(r.value),1),l.value?(k(),L("div",yKe,F(l.value),1)):ee("",!0)])):ee("",!0),m.value?(k(),de(Cl,{key:1,lines:e.tool.output},null,8,["lines"])):ee("",!0)]),default:ue(()=>[A("span",hKe,F(p(Zh)(e.tool.name)),1),h.value?(k(),L("span",pKe,F(h.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),bKe=St(kKe,[["__scopeId","data-v-50602502"]]),wKe={class:"tl-name"},CKe={key:0,class:"tl-mono"},AKe={key:1,class:"tl-dim"},xKe={key:2,class:"tl-faint"},SKe={key:0,class:"tl-chip"},_Ke={key:0,class:"match-list"},MKe=["onClick"],IKe={key:0,class:"mref"},TKe={class:"mtext"},EKe=rt({__name:"GrepTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,n=Yt(Uo),{t:i}=Ut(),o=D(()=>t.tool.status),s=D(()=>_r(t.tool.name)==="grep"),r=D(()=>Nc(t.tool.arg)),l=D(()=>{const g=r.value;return ki(g?.pattern)??ki(g?.query)??ki(g?.regex)??""}),a=D(()=>{const g=r.value;return ki(g?.path)??ki(g?.glob)??ki(g?.include)??""}),u=D(()=>(t.tool.output??[]).filter(g=>g.trim().length>0).map(g=>{const v=/^(.+?):(\d+)[:-](.*)$/.exec(g);return v?{path:v[1],line:Number(v[2]),text:(v[3]??"").trim()}:{text:g}})),c=D(()=>u.value.length),d=D(()=>c.value>0),f=D(()=>d.value),h=V(t.tool.defaultExpanded===!0&&f.value);We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&f.value&&(h.value=!0)});function m(g){g.path&&n?.openFile({path:g.path,line:g.line})}return(g,v)=>(k(),de(Sa,{status:o.value,open:h.value,expandable:f.value,onToggle:v[0]||(v[0]=y=>h.value=!h.value)},{leading:ue(()=>[U(p(Ce),{name:"search",size:"sm"})]),trailing:ue(()=>[c.value>0?(k(),L("span",SKe,F(p(i)("tools.chip.results",{count:c.value})),1)):ee("",!0)]),body:ue(()=>[s.value?(k(),L("div",_Ke,[(k(!0),L(De,null,Ct(u.value,(y,b)=>(k(),L("button",{key:b,class:Re(["match-row",{link:y.path}]),type:"button",onClick:w=>m(y)},[y.path?(k(),L("span",IKe,F(y.path)+":"+F(y.line),1)):ee("",!0),A("span",TKe,F(y.text),1)],10,MKe))),128))])):(k(),de(Cl,{key:1,lines:e.tool.output},null,8,["lines"]))]),default:ue(()=>[A("span",wKe,F(p(i)(s.value?"tools.label.grep":"tools.label.search")),1),l.value?(k(),L("span",CKe,F(l.value),1)):(k(),L("span",AKe,F(e.tool.arg),1)),a.value?(k(),L("span",xKe,F(a.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),LKe=St(EKe,[["__scopeId","data-v-e5f2e791"]]),NKe=["src","controls","muted"],DKe=["src","alt"],FKe=rt({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},sessionId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=V(t.fileId?"":t.url),i=V(null),o=V(!t.fileId);let s=null,r=0,l=!1,a=null;function u(){s!==null&&(URL.revokeObjectURL(s),s=null)}async function c(){const d=++r;if(u(),!t.fileId){n.value=t.url;return}if(o.value)try{const f=t.sessionId?await Zt().getSessionMediaBlob(t.sessionId,t.fileId):await Zt().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}s=h,n.value=s}catch{if(l||d!==r)return;n.value=t.url}}return We(()=>[t.fileId,t.sessionId,t.url,o.value],c,{immediate:!0}),kn(()=>{typeof IntersectionObserver=="function"&&i.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(i.value)):o.value=!0}),Xn(()=>{l=!0,a?.disconnect(),a=null,u()}),(d,f)=>e.kind==="video"?(k(),L("video",{key:0,ref_key:"mediaEl",ref:i,class:Re(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,NKe)):(k(),L("img",{key:1,ref_key:"mediaEl",ref:i,class:Re([e.mediaClass,{"is-resolving":!n.value}]),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,DKe))}}),cS=St(FKe,[["__scopeId","data-v-7bd83e15"]]),BKe={class:"media-title"},RKe=["src","alt"],OKe=["aria-label"],$Ke={key:0,class:"media-video-tile","aria-hidden":"true"},PKe={class:"media-play-badge","aria-hidden":"true"},zKe=["src"],jKe=rt({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,i=t,o=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function s(d){return d.split(/[\\/]+/).pop()||d}function r(d){return d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/1024/1024).toFixed(1)} MB`}const l=D(()=>{const d=o.value;if(!d)return"";const f=[d.path?s(d.path):n.tool.name];return d.mimeType&&f.push(d.mimeType),d.bytes!==void 0&&f.push(r(d.bytes)),d.dimensions&&f.push(d.dimensions),f.join(" · ")}),a=D(()=>o.value?.url.startsWith("blob:")??!1),u=D(()=>{const d=o.value;return d?.kind==="video"&&d.fileId!==void 0&&!a.value});function c(d){const f=o.value;if(f?.kind!=="image"&&f?.kind!=="video")return;const h=f.kind==="image"?d.currentTarget.querySelector("img"):null;i("openMedia",{media:f,originImg:h})}return(d,f)=>o.value?(k(),L("div",{key:0,class:Re(["media-tool",{mob:e.mobile}])},[U(p(Nn),{text:o.value.path||l.value},{default:ue(()=>[A("div",BKe,F(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(k(),de(p(Nn),{key:0,text:o.value.path||l.value},{default:ue(()=>[A("button",{type:"button",class:"media-image-button",onClick:c},[A("img",{class:"media-image",src:o.value.url,alt:o.value.path?s(o.value.path):l.value,loading:"lazy"},null,8,RKe)])]),_:1},8,["text"])):o.value.kind==="video"?(k(),de(p(Nn),{key:1,text:o.value.path||l.value},{default:ue(()=>[A("button",{type:"button",class:"media-image-button media-video-button","aria-label":o.value.path?s(o.value.path):l.value,onClick:c},[u.value?(k(),L("span",$Ke)):(k(),de(cS,{key:1,url:o.value.url,kind:"video","file-id":a.value?void 0:o.value.fileId,"media-class":"media-video",controls:!1,muted:""},null,8,["url","file-id"])),A("span",PKe,[U(p(Ce),{name:"play",size:"sm"})])],8,OKe)]),_:1},8,["text"])):(k(),L("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,zKe))],2)):ee("",!0)}}),HKe=St(jKe,[["__scopeId","data-v-8ea09226"]]),WKe=["innerHTML"],qKe={class:"tl-name"},UKe={key:0,class:"tl-faint"},VKe={key:0,class:"tl-chip"},KKe=["title"],ZKe={key:1,class:"plan-content"},GKe={key:2,class:"plan-review"},QKe={key:0},YKe={class:"review-label"},JKe={key:1},XKe={class:"review-label"},eZe={class:"review-feedback"},tZe=rt({__name:"PlanTool",props:{tool:{},mobile:{type:Boolean}},setup(e){const t=e,{t:n}=Ut(),i=Yt(Uo),o=V(t.tool.defaultExpanded===!0),s=D(()=>t.tool.plan),r=D(()=>s.value?.path??t.tool.planPath),l=D(()=>s.value!==void 0||r.value!==void 0||(t.tool.output?.length??0)>0),a=D(()=>{const c=s.value?.review?.state;return c?n(`tools.plan.review.${c}`):void 0});function u(){r.value&&i?.openFile({path:r.value,content:s.value?.plan})}return(c,d)=>(k(),de(Sa,{status:e.tool.status,open:o.value,expandable:l.value,onToggle:d[0]||(d[0]=f=>o.value=!o.value)},{leading:ue(()=>[A("span",{class:"plan-glyph",innerHTML:p(MZ)(e.tool.name)},null,8,WKe)]),trailing:ue(()=>[e.tool.timing?(k(),L("span",VKe,F(e.tool.timing),1)):ee("",!0)]),body:ue(()=>[r.value?(k(),L("button",{key:0,type:"button",class:"plan-path",title:r.value,onClick:u},F(r.value),9,KKe)):ee("",!0),s.value?(k(),L("div",ZKe,[U(p(_c),{text:s.value.plan,"open-file":p(i)?.openFile},null,8,["text","open-file"])])):ee("",!0),s.value?.review?.selectedOption||s.value?.review?.feedback?(k(),L("div",GKe,[s.value.review.selectedOption?(k(),L("div",QKe,[A("span",YKe,F(p(n)("tools.plan.selectedOption")),1),A("span",null,F(s.value.review.selectedOption),1)])):ee("",!0),s.value.review.feedback?(k(),L("div",JKe,[A("span",XKe,F(p(n)("tools.plan.feedback")),1),A("span",eZe,F(s.value.review.feedback),1)])):ee("",!0)])):ee("",!0),s.value?ee("",!0):(k(),de(Cl,{key:3,lines:e.tool.output,"empty-text":p(n)("tools.output.empty")},null,8,["lines","empty-text"]))]),default:ue(()=>[A("span",qKe,F(p(Zh)(e.tool.name)),1),a.value?(k(),L("span",UKe,F(a.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),nZe=St(tZe,[["__scopeId","data-v-ae3acb2d"]]),iZe={class:"tl-name"},oZe={key:1,class:"tl-faint"},sZe={key:2,class:"tl-faint"},rZe={key:3,class:"tl-dim"},lZe={key:0,class:"tl-chip"},aZe=rt({__name:"ReadTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,n=Yt(Uo),{t:i}=Ut(),o=D(()=>t.tool.status),s=D(()=>Nc(t.tool.arg)),r=D(()=>DZ(s.value)??""),l=D(()=>r.value?Ic(r.value):""),a=D(()=>r.value?FZ(r.value):""),u=D(()=>{const T=s.value;if(T)return Xc(T.offset)??Xc(T.line_start)??Xc(T.start_line)}),c=D(()=>{const T=s.value;if(!T)return;const N=Xc(T.limit)??Xc(T.length);return Xc(T.line_end)??Xc(T.end_line)??(u.value!==void 0&&N!==void 0?u.value+N:void 0)}),d=D(()=>u.value!==void 0&&c.value!==void 0?`:${u.value}-${c.value}`:u.value!==void 0?`:${u.value}`:""),f=D(()=>t.tool.status==="ok"?Nse(t.tool.output??[]):null),h=D(()=>f.value?.contents??[]),m=D(()=>f.value?.lineNumbers),g=D(()=>f.value?.contents.length??t.tool.output?.length??0),v=D(()=>!!t.tool.output&&t.tool.output.length>0),y=D(()=>f.value!==null||v.value),b=V(t.tool.defaultExpanded===!0&&y.value),w=V(b.value);We(b,T=>{T&&(w.value=!0)}),We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&y.value&&(b.value=!0)});function C(){r.value&&n?.openFile({path:r.value,line:u.value})}return(T,N)=>(k(),de(Sa,{status:o.value,open:b.value,expandable:y.value,onToggle:N[0]||(N[0]=I=>b.value=!b.value)},{leading:ue(()=>[U(p(Ce),{name:"file-text",size:"sm"})]),trailing:ue(()=>[g.value>0?(k(),L("span",lZe,F(p(i)("tools.chip.lines",{count:g.value})),1)):ee("",!0)]),body:ue(()=>[r.value?(k(),L("button",{key:0,class:"path-link",type:"button",onClick:C},F(r.value),1)):ee("",!0),f.value&&w.value?(k(),de(Wa,{key:1,code:h.value,path:r.value,"line-numbers":m.value},null,8,["code","path","line-numbers"])):(k(),de(Cl,{key:2,lines:e.tool.output,"empty-text":p(i)("tools.output.waiting")},null,8,["lines","empty-text"]))]),default:ue(()=>[A("span",iZe,F(p(i)("tools.label.read")),1),l.value?(k(),L("button",{key:0,class:"tl-file",type:"button",onClick:Tt(C,["stop"])},F(l.value),1)):ee("",!0),a.value?(k(),L("span",oZe,F(a.value),1)):ee("",!0),d.value?(k(),L("span",sZe,F(d.value),1)):ee("",!0),l.value?ee("",!0):(k(),L("span",rZe,F(r.value||e.tool.arg),1))]),_:1},8,["status","open","expandable"]))}}),uZe=St(aZe,[["__scopeId","data-v-a487370d"]]),cZe=["aria-expanded"],dZe={class:"title"},fZe={key:0,class:"meta"},hZe={key:1,class:"sum-txt"},pZe={class:"rt"},mZe={class:"status"},gZe={key:0,class:"chip"},vZe={key:1,class:"tm"},yZe={class:"body"},kZe={class:"overview"},bZe={class:"overview-line"},wZe={class:"big"},CZe={key:0,class:"lbl"},AZe={key:1,class:"lbl"},xZe={key:2,class:"lbl"},SZe={key:3,class:"lbl"},_Ze={key:0,class:"seg","aria-hidden":"true"},MZe={key:1,class:"legend"},IZe=["disabled","aria-label","aria-expanded","onClick"],TZe={class:"mname"},EZe={class:"mact"},LZe={class:"mphase"},NZe=["aria-expanded","onClick"],DZe={key:1,class:"fallback-output"},FZe={key:2,class:"waiting"},BZe=rt({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const{t}=Ut(),n=e,i=Yt(Uo);function o(B){if(!B)return{};try{const P=JSON.parse(B),H=Array.isArray(P.items)?P.items:void 0;return{description:typeof P.description=="string"?P.description:void 0,itemCount:H?.length}}catch{return{}}}const s=Yt(nK),r=D(()=>o(n.tool.arg)),l=D(()=>Zh(n.tool.name)),a=D(()=>r.value.description??""),u=D(()=>s?.(n.tool.id)??[]),c=D(()=>Hoe(n.tool.output)),d=Yt(im),f=Yt(om),h=D(()=>{let B;for(const P of u.value){const H=d?.(P.model),j=f?.(P.thinkingEffort),G=[H,j].filter(W=>W!==void 0);if(G.length===0)continue;const ne=G.join(" · ");if(B===void 0)B=ne;else if(B!==ne)return}return B}),m=D(()=>n.tool.status),g=D(()=>m.value==="running"?"running":m.value==="error"||(c.value?.failed??0)>0?"error":"ok"),v=D(()=>aAe(u.value,c.value)),y=D(()=>{const B={completed:0,working:0,suspended:0,queued:0,failed:0,cancelled:0};for(const P of v.value)B[P.phase]++;return B}),b=D(()=>v.value.length||r.value.itemCount||0),w=D(()=>y.value.completed+y.value.failed+y.value.cancelled),C=D(()=>{const B=c.value;if(!B)return"";const P=B.aborted??0;return P>0?t("tools.swarm.doneSubWithCancelled",{completed:B.completed,failed:B.failed,cancelled:P}):t("tools.swarm.doneSub",{completed:B.completed,failed:B.failed})}),T=D(()=>y.value.working+y.value.suspended+y.value.queued),N=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"cancelled",cls:"s-queue"},{phase:"queued",cls:"s-queue"}],I=D(()=>N.map(({phase:B,cls:P})=>({phase:B,count:y.value[B],cls:P})).filter(B=>B.count>0)),S=V(m.value==="running"||T.value>0);function _(){S.value=!S.value}const x=D(()=>v.value.length>0||c.value||m.value==="running"?"":(n.tool.output??[]).join(` +`).trim()),E=V(new Set);function M(B){return E.value.has(B)}function R(B){const P=new Set(E.value);P.has(B)?P.delete(B):P.add(B),E.value=P}function q(B){if(B.agentId){i?.openAgent(B.agentId);return}B.body&&R(B.id)}function z(B){return B.agentId!==void 0&&B.body.length>0&&(B.phase==="completed"||B.phase==="failed"||B.phase==="cancelled")}function $(B){return t(`tools.swarm.phase${B[0].toUpperCase()}${B.slice(1)}`)}return(B,P)=>(k(),L("div",{class:Re(["swarm-card",{open:S.value,err:g.value==="error"}])},[A("button",{class:"head",type:"button","aria-expanded":S.value,onClick:_},[U(p(Ce),{class:"ic",name:"sparkles",size:"sm"}),A("span",dZe,F(l.value),1),a.value?(k(),L("span",fZe,"·")):ee("",!0),a.value?(k(),L("span",hZe,F(a.value),1)):ee("",!0),A("span",pZe,[A("span",mZe,[g.value==="ok"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):g.value==="error"?(k(),de(p(Ce),{key:1,name:"close",size:"sm"})):(k(),de(p(Ul),{key:2,status:"running"}))]),w.value>0||b.value>0?(k(),L("span",gZe,F(w.value)+" / "+F(b.value),1)):ee("",!0),e.tool.timing?(k(),L("span",vZe,F(e.tool.timing),1)):ee("",!0)]),U(p(Ce),{class:"car",name:"chevron-right",size:"sm"})],8,cZe),ai(A("div",yZe,[A("div",kZe,[A("div",bZe,[A("span",wZe,F(p(t)("tools.swarm.progress",{done:w.value,total:b.value})),1),h.value?(k(),L("span",CZe,F(h.value),1)):ee("",!0),g.value==="running"&&b.value>0?(k(),L("span",AZe,F(p(t)("tools.swarm.runningSub",{count:T.value})),1)):c.value?(k(),L("span",xZe,F(C.value),1)):(k(),L("span",SZe,F(p(t)("tools.swarm.waiting")),1))]),b.value>0&&I.value.length>0?(k(),L("div",_Ze,[(k(!0),L(De,null,Ct(I.value,H=>(k(),L("span",{key:H.phase,class:Re(H.cls),style:sn({flex:H.count})},null,6))),128))])):ee("",!0),I.value.length>1?(k(),L("div",MZe,[(k(!0),L(De,null,Ct(I.value,H=>(k(),L("span",{key:H.phase},[A("i",{class:Re(["lg-dot",H.cls])},null,2),Oe(F($(H.phase))+" "+F(H.count),1)]))),128))])):ee("",!0)]),v.value.length>0?(k(!0),L(De,{key:0},Ct(v.value,H=>(k(),L("div",{key:H.id,class:Re(["member",[`phase-${H.phase}`,{open:!H.agentId&&M(H.id)}]])},[A("button",{class:"member-head",type:"button",disabled:!H.agentId&&!H.body,"aria-label":H.agentId?p(t)("tasks.openDetail"):void 0,"aria-expanded":!H.agentId&&H.body?M(H.id):void 0,onClick:j=>q(H)},[U(p(Ul),{class:"row-dot",status:H.phase},null,8,["status"]),U(p(Nn),{text:H.name},{default:ue(()=>[A("span",TZe,F(H.name),1)]),_:2},1032,["text"]),H.activity?(k(),de(p(Nn),{key:0,text:H.activity},{default:ue(()=>[A("span",EZe,F(H.activity),1)]),_:2},1032,["text"])):ee("",!0),A("span",LZe,F($(H.phase)),1),H.agentId?(k(),de(p(Ce),{key:1,class:"mcar",name:"arrow-right",size:"sm"})):H.body?(k(),de(p(Ce),{key:2,class:"mcar",name:"chevron-right",size:"sm"})):ee("",!0)],8,IZe),z(H)?(k(),L("button",{key:0,class:"member-saved",type:"button","aria-expanded":M(H.id),onClick:j=>R(H.id)},[U(p(Ce),{class:Re(["member-saved-car",{open:M(H.id)}]),name:"chevron-right",size:"sm","aria-hidden":"true"},null,8,["class"]),A("span",null,F(p(t)("tools.output.saved")),1)],8,NZe)):ee("",!0),H.body&&(!H.agentId||z(H))?ai((k(),L("div",{key:1,class:"member-body"},F(H.body),513)),[[Qo,M(H.id)]]):ee("",!0)],2))),128)):x.value?(k(),L("div",DZe,F(x.value),1)):(k(),L("div",FZe,F(p(t)("tools.swarm.waiting")),1))],512),[[Qo,S.value]])],2))}}),RZe=St(BZe,[["__scopeId","data-v-a03fd23e"]]),OZe=rt({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e;return(n,i)=>(k(),L("span",{class:Re(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},[t.status==="run"?(k(),de(p(Ul),{key:0,status:"running"})):t.status==="pending"?(k(),de(p(Ul),{key:1,status:"idle"})):t.status==="done"?(k(),de(p(Ce),{key:2,name:"check",size:"sm"})):(k(),de(p(Ce),{key:3,name:"close",size:"sm"}))],2))}}),$Ze=St(OZe,[["__scopeId","data-v-77ce35f9"]]),PZe={class:"tl-name"},zZe={key:0,class:"tl-dim"},jZe={key:0,class:"tl-chip"},HZe={key:1,class:"todo-bar","aria-hidden":"true"},WZe={key:0,class:"todo-list"},qZe={class:"todo-title"},UZe=rt({__name:"TodoTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Ut();function i(m){const g=Nc(m),v=g&&Array.isArray(g.todos)?g.todos:g&&Array.isArray(g.items)?g.items:void 0;if(!v)return[];const y=[];for(const b of v){if(!b||typeof b!="object")continue;const w=b,C=ki(w.title)??ki(w.content)??ki(w.activeForm)??ki(w.text);if(!C)continue;const T=ki(w.status)??"pending";y.push({title:C,status:T==="in_progress"?"in_progress":T==="done"||T==="completed"?"done":"pending"})}return y}const o=D(()=>t.tool.status),s=D(()=>i(t.tool.arg)),r=D(()=>s.value.filter(m=>m.status==="done").length),l=D(()=>s.value.length),a=D(()=>s.value.find(m=>m.status==="in_progress")),u=D(()=>l.value>0?r.value/l.value:0),c=D(()=>!!t.tool.output&&t.tool.output.length>0),d=D(()=>l.value>0||c.value),f=V(t.tool.defaultExpanded===!0&&d.value);We(()=>[t.tool.defaultExpanded,t.tool.status],()=>{t.tool.defaultExpanded===!0&&d.value&&(f.value=!0)});function h(m){return m.status==="in_progress"?"run":m.status}return(m,g)=>(k(),de(Sa,{status:o.value,open:f.value,expandable:d.value,onToggle:g[0]||(g[0]=v=>f.value=!f.value)},{leading:ue(()=>[U(p(Ce),{name:"check-list",size:"sm"})]),trailing:ue(()=>[l.value>0?(k(),L("span",jZe,F(r.value)+"/"+F(l.value),1)):ee("",!0),l.value>0?(k(),L("span",HZe,[A("span",{class:"todo-fill",style:sn({width:`${u.value*100}%`})},null,4)])):ee("",!0)]),body:ue(()=>[l.value>0?(k(),L("div",WZe,[(k(!0),L(De,null,Ct(s.value,(v,y)=>(k(),L("div",{key:y,class:Re(["todo-row",`s-${v.status}`])},[U($Ze,{status:h(v)},null,8,["status"]),A("span",qZe,F(v.title),1)],2))),128))])):c.value?(k(),de(Cl,{key:1,lines:e.tool.output},null,8,["lines"])):ee("",!0)]),default:ue(()=>[A("span",PZe,F(p(n)("tools.label.todo")),1),a.value?(k(),L("span",zZe,F(a.value.title),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),VZe=St(UZe,[["__scopeId","data-v-9c43594f"]]),KZe={class:"tl-name"},ZZe={key:0,class:"tl-dim"},GZe={key:2,class:"tl-chip"},QZe={key:0,class:"wf-glance"},YZe={class:"wf-main"},JZe=rt({__name:"WaitForTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Ut(),i=D(()=>t.tool.status),o=D(()=>Nc(t.tool.arg)),s=D(()=>ki(o.value?.task_id)??ki(o.value?.taskId)),r=D(()=>i.value==="error"?null:Goe(t.tool.output)),l={completed:"conversation.notification.status.completed",failed:"conversation.notification.status.failed",timed_out:"conversation.notification.status.timed_out",killed:"conversation.notification.status.killed",lost:"conversation.notification.status.lost"},a=D(()=>{const w=r.value?.finishedStatus;if(!w)return"";const C=l[w];return C?n(C):w}),u=D(()=>{switch(r.value?.finishedStatus){case"completed":return"success";case"failed":case"lost":return"danger";case"timed_out":case"killed":return"warning";default:return"neutral"}}),c=D(()=>t.tool.output?.find(w=>w.trim().length>0)??""),d=D(()=>{if(i.value==="running")return s.value?n("tools.waitfor.waitingTask",{id:s.value}):n("tools.waitfor.waitingAny");if(i.value==="error")return c.value;const w=r.value;if(!w)return s.value??c.value;switch(w.status){case"completed":return w.finishedDescription??w.taskId??"";case"timed_out":return w.runningCount>0?n("tools.waitfor.stillRunning",{count:w.runningCount}):n("tools.waitfor.timedOut");case"no_tasks":return n("tools.waitfor.noTasks")}}),f=D(()=>{const w=r.value;return!w||w.status==="no_tasks"?"":Bu(w.waitedMs)}),h=D(()=>f.value||t.tool.timing||"");function m(w){if(w.runningSamples.length===0)return null;const C=[...w.runningSamples],T=w.runningCount-w.runningSamples.length;return T>0&&C.push(n("tools.waitfor.moreRunning",{count:T})),C.join(", ")}const g=D(()=>{const w=r.value;if(!w)return null;if(w.status==="completed"){const C=[w.taskId,a.value].filter(S=>S).join(" · "),T=[];w.finishedDescription&&T.push(w.finishedDescription);const N=[];w.extraCount>0&&N.push(n("tools.waitfor.moreFinished",{count:w.extraCount})),w.runningCount>0&&N.push(n("tools.waitfor.stillRunning",{count:w.runningCount})),N.length>0&&T.push(N.join(" · "));const I=m(w);return I!==null&&T.push(I),{main:C,subs:T}}if(w.status==="timed_out"){if(w.runningCount===0&&w.extraCount===0)return null;const C=w.runningCount>0?n("tools.waitfor.stillRunning",{count:w.runningCount}):n("tools.waitfor.moreFinished",{count:w.extraCount}),T=[];w.runningCount>0&&w.extraCount>0&&T.push(n("tools.waitfor.moreFinished",{count:w.extraCount}));const N=m(w);return N!==null&&T.push(N),{main:C,subs:T}}return null}),v=D(()=>!!t.tool.output&&t.tool.output.length>0),y=D(()=>g.value!==null||v.value),b=V(t.tool.defaultExpanded===!0&&y.value);return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&y.value&&(b.value=!0)}),(w,C)=>(k(),de(Sa,{status:i.value,open:b.value,expandable:y.value,onToggle:C[0]||(C[0]=T=>b.value=!b.value)},{leading:ue(()=>[U(p(Ce),{name:"clock",size:"sm"})]),trailing:ue(()=>[r.value?.status==="timed_out"?(k(),de(p(cl),{key:0,variant:"warning",size:"sm"},{default:ue(()=>[Oe(F(p(n)("tools.waitfor.timedOut")),1)]),_:1})):r.value?.status==="completed"&&a.value?(k(),de(p(cl),{key:1,variant:u.value,size:"sm"},{default:ue(()=>[Oe(F(a.value),1)]),_:1},8,["variant"])):ee("",!0),h.value?(k(),L("span",GZe,F(h.value),1)):ee("",!0)]),body:ue(()=>[g.value?(k(),L("div",QZe,[A("div",YZe,F(g.value.main),1),(k(!0),L(De,null,Ct(g.value.subs,(T,N)=>(k(),L("div",{key:N,class:"wf-sub"},F(T),1))),128))])):ee("",!0),v.value?(k(),de(Cl,{key:1,lines:e.tool.output,"empty-text":i.value==="running"?p(n)("tools.output.waiting"):p(n)("tools.output.empty")},null,8,["lines","empty-text"])):ee("",!0)]),default:ue(()=>[A("span",KZe,F(p(Zh)(e.tool.name)),1),d.value?(k(),L("span",ZZe,F(d.value),1)):ee("",!0)]),_:1},8,["status","open","expandable"]))}}),XZe=St(JZe,[["__scopeId","data-v-3a167d7c"]]),eGe={class:"tl-name"},tGe={key:0},nGe={key:1,class:"tl-dim"},iGe={key:0,class:"fetch-url"},oGe=rt({__name:"WebFetchTool",props:{tool:{},mobile:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Ut(),i=D(()=>t.tool.status),o=D(()=>{const u=Nc(t.tool.arg);return ki(u?.url)??ki(u?.uri)??""}),s=D(()=>o.value?Sst(o.value):""),r=D(()=>!!t.tool.output&&t.tool.output.length>0),l=D(()=>r.value),a=V(t.tool.defaultExpanded===!0&&l.value);return We(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&l.value&&(a.value=!0)}),(u,c)=>(k(),de(Sa,{status:i.value,open:a.value,expandable:l.value,onToggle:c[0]||(c[0]=d=>a.value=!a.value)},{leading:ue(()=>[U(p(Ce),{name:"globe",size:"sm"})]),body:ue(()=>[o.value?(k(),L("div",iGe,F(o.value),1)):ee("",!0),U(Cl,{lines:e.tool.output,"empty-text":p(n)("tools.output.waiting")},null,8,["lines","empty-text"])]),default:ue(()=>[A("span",eGe,F(p(n)("tools.label.web_fetch")),1),s.value?(k(),L("span",tGe,F(s.value),1)):(k(),L("span",nGe,F(e.tool.arg),1))]),_:1},8,["status","open","expandable"]))}}),sGe=St(oGe,[["__scopeId","data-v-214a8617"]]);function rGe(e){if(e.media&&e.status==="ok")return HKe;switch(_r(e.name)){case"bash":return PVe;case"read":return uZe;case"edit":case"write":case"multi_edit":return ZVe;case"grep":case"search":return LKe;case"glob":case"ls":return fKe;case"web_fetch":return sGe;case"todo":return VZe;case"task":return lVe;case"agentswarm":return RZe;case"askuserquestion":return NVe;case"exitplanmode":return nZe;case"creategoal":case"getgoal":case"setgoalbudget":case"updategoal":return bKe;case"waitfor":return XZe;default:return nKe}}const dS=rt({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia","detach"],setup(e,{emit:t}){const n=e,i=t,o=D(()=>rGe(n.tool));return(s,r)=>(k(),de(zo(o.value),{tool:e.tool,mobile:e.mobile,onOpenMedia:r[0]||(r[0]=l=>i("openMedia",l)),onDetach:r[1]||(r[1]=l=>i("detach",l))},null,40,["tool","mobile"]))}}),lGe=["aria-label"],aGe=["title"],uGe={key:0,class:"ar-sep"},cGe=["inert"],dGe={class:"ar-body-inner"},fGe=rt({__name:"ActivityRun",props:{items:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},forceOpen:{type:Boolean,default:!1}},emits:["openMedia","detach"],setup(e,{emit:t}){const n=e,i=t,o=D(()=>n.items.at(-1)),s=D(()=>{const x=o.value;if(n.streaming&&x?.kind==="thinking")return x;for(let E=n.items.length-1;E>=0;E--){const M=n.items[E];if(M?.kind==="tool"&&M.tool.status==="running")return M}return null}),r=D(()=>{if(n.streaming)return"running";for(const x of n.items)if(x.kind==="tool"&&x.tool.status==="running")return"running";for(const x of n.items)if(x.kind==="tool"&&x.tool.status==="error")return"error";return"done"}),l=V(r.value==="running"),{activityRunFolding:a}=Vx(),u=D(()=>n.forceOpen||!a.value||l.value),c=Yt(df,()=>{}),d=V(null),f=V(null),h=V(void 0),m=V(Date.now()),g=D(()=>{let x=null;for(const E of n.items)if(E.kind==="thinking"&&E.startedAt!==void 0){const M=Date.parse(E.startedAt);Number.isFinite(M)&&(x===null||M{if(x==="running"){E!==void 0&&E!=="running"&&(l.value=!0),f.value===null&&(f.value=g.value??Date.now()),h.value=void 0,m.value=Date.now();const R=setInterval(()=>{m.value=Date.now()},1e3);M(()=>clearInterval(R));return}E==="running"&&(l.value=!1,f.value!==null&&(h.value=Date.now()-f.value),f.value=null)},{immediate:!0}),We(a,()=>{l.value=r.value==="running"});function v(){if(n.forceOpen||(l.value=!l.value,n.streaming))return;const x=d.value;x&&ft(()=>c(x))}const y=D(()=>{if(r.value==="done")return"check";if(r.value==="error")return"close";const x=s.value??o.value;return x?x.kind==="thinking"?"thinking":_Z(x.tool.name):"tool"}),b=D(()=>Fst(n.items,s.value)),w=D(()=>Dst(n.items,{durationMs:h.value})),C=D(()=>r.value!=="running"||f.value===null?"":Bu(m.value-f.value)),T=D(()=>{if(r.value!=="running")return w.value.clauses;const x=[];return b.value.current&&x.push(b.value.current),x.push(...b.value.done),C.value&&x.push({fragments:[{text:C.value,tone:"faint"}]}),x}),N=D(()=>r.value!=="running"?w.value.plain:[b.value.plain,C.value].filter(Boolean).join(" · "));function I(x){if(x==="danger")return"ar-danger";if(x==="faint")return"ar-faint"}function S(x){return x.kind==="tool"?EZ(x):`thinking-${x.sourceIndex}`}function _(x){return n.streaming&&x.kind==="thinking"&&x.durationMs===void 0&&x.sourceIndex===o.value?.sourceIndex}return(x,E)=>(k(),L("div",{class:Re(["activity-run",{open:u.value}])},[e.forceOpen||p(a)?(k(),de(zo(e.forceOpen?"div":"button"),di({key:0,ref_key:"headEl",ref:d,class:["ar-head",{"is-static":e.forceOpen}]},e.forceOpen?{}:{type:"button","aria-expanded":u.value},{onClick:v}),{default:ue(()=>[A("span",{class:Re(["ar-glyph",{run:r.value==="running",err:r.value==="error",ok:r.value==="done"}]),role:"status","aria-label":r.value},[U(p(Ce),{name:y.value,size:"sm","aria-hidden":"true"},null,8,["name"])],10,lGe),A("span",{class:"ar-sum",title:N.value},[(k(!0),L(De,null,Ct(T.value,(M,R)=>(k(),L(De,{key:R},[R>0?(k(),L("span",uGe," · ")):ee("",!0),(k(!0),L(De,null,Ct(M.fragments,(q,z)=>(k(),L("span",{key:z,class:Re(I(q.tone))},F(q.text),3))),128))],64))),128))],8,aGe),e.forceOpen?ee("",!0):(k(),de(p(Ce),{key:0,class:"ar-car",name:"chevron-right",size:"sm","aria-hidden":"true"}))]),_:1},16,["class"])):ee("",!0),A("div",{class:Re(["ar-body",{open:u.value}]),inert:!u.value},[A("div",dGe,[(k(!0),L(De,null,Ct(e.items,M=>(k(),L(De,{key:S(M)},[M.kind==="thinking"?(k(),de(uS,{key:0,text:M.thinking,mobile:e.mobile,streaming:_(M),"started-at":M.startedAt,"duration-ms":M.durationMs,"instant-reveal":e.forceOpen},null,8,["text","mobile","streaming","started-at","duration-ms","instant-reveal"])):(k(),de(dS,{key:1,tool:M.tool,mobile:e.mobile,onOpenMedia:E[0]||(E[0]=R=>i("openMedia",R)),onDetach:E[1]||(E[1]=R=>i("detach",R))},null,8,["tool","mobile"]))],64))),128))])],10,cGe)],2))}}),cZ=St(fGe,[["__scopeId","data-v-0970b9ea"]]),hGe={class:"msg-time"},pGe=rt({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Ut(),i=D(()=>U$(t.time,n("conversation.yesterday")));return(o,s)=>(k(),L("span",hGe,F(i.value),1))}}),fS=St(pGe,[["__scopeId","data-v-182ed7d4"]]),mGe={class:"ntf-list"},gGe={class:"ntn-head"},vGe={class:"ntn-head-text"},yGe={class:"ntn-bubble"},kGe={key:0,class:"ntn-line"},bGe={key:1,class:"ntn-line ntn-body"},wGe={key:2,class:"ntn-line ntn-out"},CGe=["title"],AGe={key:0,class:"ntn-out-size"},xGe=["onClick"],SGe={key:3,class:"ntn-line ntn-preview"},_Ge={key:0,class:"ntn-preview-cap"},MGe={key:1,class:"ntn-preview-text"},IGe={class:"ntn-line ntn-raw"},TGe={class:"ntn-raw-in"},EGe={class:"ntn-raw-fields"},LGe={class:"k"},NGe={class:"v"},DGe={class:"k"},FGe={class:"v"},BGe={class:"k"},RGe={class:"v"},OGe={class:"ntn-raw-pre"},$Ge={class:"ntn-meta"},PGe=rt({__name:"NotificationCard",props:{items:{}},setup(e){const{t}=Ut(),n={completed:"check",failed:"alert-triangle",timed_out:"clock",killed:"stop",lost:"alert-triangle",info:"info"};function i(v,y){return v.id!==""?`${v.id}#${y}`:`ntf-${y}`}function o(v){const y=qC(v);return y==="info"&&v.sourceKind==="subagent"?"robot":n[y]}function s(v){return v.sourceKind==="subagent"?t("conversation.notification.kindSubagent"):t("conversation.notification.kindTask")}function r(v){return t(`conversation.notification.title.${qC(v)}`,{kind:s(v)})}function l(v){return Gwe(v)}function a(v){return v.sourceKind==="subagent"&&v.agentId!==void 0&&v.agentId!==""?v.agentId:v.sourceId}function u(v){const y=a(v);return y===""?r(v):`${r(v)} · ${y}`}function c(v){return v<1024?`${v} B`:v<1024*1024?`${(v/1024).toFixed(1)} KB`:`${(v/1024/1024).toFixed(1)} MB`}function d(v){const y=v.outputPreview;if(!y)return"";const b=[];return y.truncated===!0&&b.push(t("conversation.notification.outputTruncated")),y.bytes!==void 0&&b.push(y.totalBytes!==void 0&&y.totalBytes!==y.bytes?`${c(y.bytes)} / ${c(y.totalBytes)}`:c(y.bytes)),b.join(" · ")}function f(v){return v.outputPreview!==void 0&&(v.outputPreview.text!==""||d(v)!=="")}const h=V(null);let m=null;async function g(v,y){await Ls(v)&&(h.value=y,m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,h.value=null},1200))}return(v,y)=>(k(),L("div",mGe,[(k(!0),L(De,null,Ct(e.items,(b,w)=>(k(),L("div",{key:i(b,w),class:Re(["ntn",l(b)]),role:"status"},[A("div",gGe,[U(p(Ce),{name:o(b),size:"sm",class:"ntn-ico","aria-hidden":"true"},null,8,["name"]),A("span",vGe,F(u(b)),1)]),A("div",yGe,[b.title?(k(),L("div",kGe,F(b.title),1)):ee("",!0),b.body?(k(),L("div",bGe,F(b.body),1)):ee("",!0),b.outputFile?(k(),L("div",wGe,[U(p(Ce),{class:"ntn-out-ic",name:"file-text",size:"sm","aria-hidden":"true"}),A("span",{class:"ntn-out-path",title:b.outputFile.path},F(b.outputFile.path),9,CGe),b.outputFile.bytes!==void 0?(k(),L("span",AGe,F(c(b.outputFile.bytes)),1)):ee("",!0),A("button",{class:"ntn-out-copy",type:"button",onClick:C=>g(b.outputFile.path,i(b,w))},F(h.value===i(b,w)?p(t)("conversation.notification.copied"):p(t)("conversation.notification.copyPath")),9,xGe)])):ee("",!0),f(b)?(k(),L("div",SGe,[d(b)!==""?(k(),L("div",_Ge,F(d(b)),1)):ee("",!0),b.outputPreview?.text?(k(),L("pre",MGe,F(b.outputPreview.text),1)):ee("",!0)])):ee("",!0),A("details",IGe,[A("summary",null,[U(p(Ce),{class:"ntn-raw-car",name:"chevron-right",size:"sm","aria-hidden":"true"}),A("span",null,F(p(t)("conversation.notification.rawPayload")),1)]),A("div",TGe,[A("div",EGe,[A("span",LGe,F(p(t)("conversation.notification.fields.type")),1),A("span",NGe,F(b.type),1),A("span",DGe,F(p(t)("conversation.notification.fields.source")),1),A("span",FGe,F(b.sourceKind)+" · "+F(b.sourceId),1),A("span",BGe,F(p(t)("conversation.notification.fields.severity")),1),A("span",RGe,F(b.severity||"—"),1)]),A("pre",OGe,F(b.raw),1)])])]),A("div",$Ge,[b.createdAt?(k(),de(fS,{key:0,time:b.createdAt},null,8,["time"])):ee("",!0)])],2))),128))]))}}),dZ=St(PGe,[["__scopeId","data-v-2962a217"]]),zGe=["aria-expanded"],jGe=["title"],HGe=["inert"],WGe={class:"tf-body-inner"},qGe={key:1,class:"msg"},UGe=rt({__name:"TurnFold",props:{items:{},mobile:{type:Boolean,default:!1},streamingTailIndex:{default:null},live:{type:Boolean,default:!1},parked:{type:Boolean,default:!1},seedMs:{default:void 0},createdMs:{default:void 0},endedMs:{default:void 0},durationMs:{default:void 0}},emits:["openMedia","detach"],setup(e,{emit:t}){const n=e,i=t,o=Yt(Uo),{t:s}=Ut(),r=D(()=>n.streamingTailIndex!==null),l=D(()=>n.live?n.parked?"parked":"live":"settled"),a=V(!1),u=D(()=>r.value||a.value),c=V(u.value),d=V(u.value);let f=null;We(u,S=>{if(S){if(f!==null&&(clearTimeout(f),f=null),c.value){d.value=!0;return}c.value=!0,requestAnimationFrame(()=>{requestAnimationFrame(()=>{d.value=!0})});return}d.value=!1,f=setTimeout(()=>{f=null,c.value=!1},200)});const h=Yt(df,()=>{}),m=V(null),g=V(Date.now());let v=null;function y(){v!==null&&(clearInterval(v),v=null)}Ln(()=>{y(),f!==null&&clearTimeout(f)}),We(l,(S,_)=>{S!=="settled"?(g.value=Date.now(),v===null&&(v=setInterval(()=>{g.value=Date.now()},1e3))):y(),_==="live"&&S!=="live"&&(a.value=!1)},{immediate:!0});const b=D(()=>n.seedMs===void 0?n.createdMs:n.createdMs===void 0?n.seedMs:Math.min(n.seedMs,n.createdMs)),w=D(()=>gst({startMs:b.value,endedMs:n.endedMs,durationMs:n.durationMs,state:l.value==="settled"?{phase:"settled"}:{phase:"live",nowMs:g.value}}));function C(){a.value=!a.value,ft(()=>{const S=m.value;S&&h(S)})}const T=D(()=>{const S=w.value===void 0?"":Bu(w.value);return S?s("conversation.fold.worked",{duration:S}):s("conversation.fold.workedUnknown")});function N(S){return n.streamingTailIndex===null||S.kind==="thinking"&&S.durationMs!==void 0?!1:S.sourceIndex===n.streamingTailIndex}function I(S){if(n.streamingTailIndex===null)return!1;const _=S.items.at(-1);return _?.kind==="thinking"&&_.durationMs!==void 0?!1:_!==void 0&&_.sourceIndex===n.streamingTailIndex}return(S,_)=>e.items.length>0?(k(),L("div",{key:0,class:Re(["turn-fold",{open:u.value,streaming:r.value}])},[r.value?ee("",!0):(k(),L("button",{key:0,ref_key:"headEl",ref:m,class:"tf-head",type:"button","aria-expanded":a.value,onClick:C},[A("span",{class:"tf-sum",title:T.value},F(T.value),9,jGe),U(p(Ce),{class:"tf-car",name:"chevron-right",size:"sm","aria-hidden":"true"})],8,zGe)),c.value?(k(),L("div",{key:1,class:Re(["tf-body",{open:d.value}]),inert:!u.value},[A("div",WGe,[(k(!0),L(De,null,Ct(e.items,(x,E)=>(k(),L(De,{key:p(LZ)(x,E)},[x.kind==="thinking"?(k(),de(uS,{key:0,text:x.thinking,mobile:e.mobile,streaming:N(x),"started-at":x.startedAt,"duration-ms":x.durationMs},null,8,["text","mobile","streaming","started-at","duration-ms"])):x.kind==="text"&&x.text?(k(),L("div",qGe,[U(p(_c),{text:x.text,streaming:N(x),"open-file":p(o)?.openFile},null,8,["text","streaming","open-file"])])):x.kind==="activity-run"?(k(),de(cZ,{key:2,items:x.items,mobile:e.mobile,streaming:I(x),onOpenMedia:_[0]||(_[0]=M=>i("openMedia",M)),onDetach:_[1]||(_[1]=M=>i("detach",M))},null,8,["items","mobile","streaming"])):x.kind==="tool"?(k(),de(dS,{key:3,tool:x.tool,mobile:e.mobile,onOpenMedia:_[2]||(_[2]=M=>i("openMedia",M)),onDetach:_[3]||(_[3]=M=>i("detach",M))},null,8,["tool","mobile"])):x.kind==="notification"?(k(),de(dZ,{key:4,items:x.items},null,8,["items"])):ee("",!0)],64))),128))])],10,HGe)):ee("",!0)],2)):ee("",!0)}}),VGe=St(UGe,[["__scopeId","data-v-d69de1b5"]]),KGe={class:"turn-files"},ZGe={class:"tf-ic","aria-hidden":"true"},GGe={class:"tf-title"},QGe={key:0,class:"tf-stats"},YGe={key:0,class:"tf-add"},JGe={key:1,class:"tf-del"},XGe={class:"diffbar","aria-hidden":"true"},eQe={class:"tf-list"},tQe={key:0,class:"tf-dir"},nQe={class:"tf-base"},iQe={key:0,class:"tf-stats"},oQe={key:0,class:"tf-add"},sQe={key:1,class:"tf-del"},I5=3,rQe=rt({__name:"TurnFilesSummary",props:{changes:{},turnId:{},cwd:{},interactive:{type:Boolean,default:!0}},setup(e){const t=e,n=Yt(Uo),{t:i}=Ut(),o=D(()=>t.interactive!==!1),s=D(()=>{const w=t.changes.length;return i(w===1?"conversation.turnFiles.titleOne":"conversation.turnFiles.titleOther",{number:w})}),r=D(()=>t.changes.some(w=>w.statsIncomplete)),l=D(()=>{let w=0,C=0;for(const T of t.changes)w+=T.added,C+=T.removed;return{added:w,removed:C}}),a=D(()=>!r.value&&(l.value.added>0||l.value.removed>0)),u=V(!1),c=D(()=>u.value?t.changes:t.changes.slice(0,I5)),d=D(()=>Math.max(0,t.changes.length-I5)),f=D(()=>t.changes.length>I5),h=D(()=>u.value?i("conversation.turnFiles.showLess"):d.value===1?i("conversation.turnFiles.moreOne"):i("conversation.turnFiles.more",{number:d.value}));function m(w){const C=t.cwd?Ck(w,t.cwd):null;return C!==null?C||Ic(w):w}function g(w){const C=m(w),T=Math.max(C.lastIndexOf("/"),C.lastIndexOf("\\"));return T>0?C.slice(0,T+1):""}function v(w){const C=m(w),T=Math.max(C.lastIndexOf("/"),C.lastIndexOf("\\"));return T>=0?C.slice(T+1):C}function y(w){return w.statsIncomplete||w.added===0&&w.removed===0?null:{added:w.added,removed:w.removed}}function b(w){w.hasWrite?n?.openFile({path:w.path}):n?.openTurnDiff({turnId:t.turnId,change:w})}return(w,C)=>(k(),L("div",KGe,[U(p(Pne),null,aO({head:ue(()=>[A("span",ZGe,[U(p(Ce),{name:"pencil",size:"sm"})]),A("span",GGe,F(s.value),1),a.value?(k(),L("span",QGe,[l.value.added>0?(k(),L("span",YGe,"+"+F(l.value.added),1)):ee("",!0),l.value.removed>0?(k(),L("span",JGe,"−"+F(l.value.removed),1)):ee("",!0),A("span",XGe,[A("span",{class:"seg-add",style:sn({flexGrow:l.value.added})},null,4),A("span",{class:"seg-del",style:sn({flexGrow:l.value.removed})},null,4)])])):ee("",!0)]),default:ue(()=>[A("ul",eQe,[(k(!0),L(De,null,Ct(c.value,T=>(k(),L("li",{key:T.path,class:"tf-row"},[(k(),de(zo(o.value?"button":"span"),{class:"tf-file",type:o.value?"button":void 0,onClick:N=>o.value&&b(T)},{default:ue(()=>[g(T.path)?(k(),L("span",tQe,F(g(T.path)),1)):ee("",!0),A("span",nQe,F(v(T.path)),1)]),_:2},1032,["type","onClick"])),y(T)?(k(),L("span",iQe,[y(T).added>0?(k(),L("span",oQe,"+"+F(y(T).added),1)):ee("",!0),y(T).removed>0?(k(),L("span",sQe,"−"+F(y(T).removed),1)):ee("",!0)])):ee("",!0)]))),128))])]),_:2},[f.value?{name:"foot",fn:ue(()=>[U(p(rn),{variant:"ghost",size:"sm",class:"tf-more","aria-expanded":u.value,onClick:C[0]||(C[0]=T=>u.value=!u.value)},{default:ue(()=>[Oe(F(h.value)+" ",1),U(p(Ce),{class:Re(["tf-more-car",{open:u.value}]),name:"chevron-down",size:"sm","aria-hidden":"true"},null,8,["class"])]),_:1},8,["aria-expanded"])]),key:"0"}:void 0]),1024)]))}}),lQe=St(rQe,[["__scopeId","data-v-c82a66d2"]]),aQe=["data-turn-id"],uQe=["title"],cQe={class:"cn-head-text"},dQe={key:0,class:"cn-bubble"},fQe={class:"cn-prompt"},hQe={key:1,class:"cn-meta"},pQe=rt({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Ut(),i=D(()=>t.cron),o=D(()=>i.value?.missedCount!==void 0),s=D(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=D(()=>{const f=i.value;return!f?.cron||f.recurring===!1?"":f.cron}),l=D(()=>o.value?"error":"ok"),a=D(()=>{const f=i.value;if(!f)return"";const h=[];return f.recurring===!1&&h.push(n("conversation.cron.oneShot")),typeof f.coalescedCount=="number"&&f.coalescedCount>1&&h.push(n("conversation.cron.coalesced",{n:f.coalescedCount})),f.missedCount!==void 0&&h.push(n("conversation.cron.missedCount",{n:f.missedCount})),f.stale===!0&&h.push(n("conversation.cron.finalDelivery")),h.join(" · ")}),u=D(()=>{const f=[s.value];return r.value&&f.push(r.value),a.value&&f.push(a.value),f.join(" · ")}),c=D(()=>{const f=i.value?.jobId;return f?n("conversation.cron.job",{id:f}):void 0}),d=D(()=>t.text??"");return(f,h)=>(k(),L("div",{class:Re(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[A("div",{class:Re(["cn-head",l.value]),title:c.value},[U(p(Ce),{name:"clock",size:"sm",class:"cn-head-ico","aria-hidden":"true"}),A("span",cQe,F(u.value),1)],10,uQe),d.value?(k(),L("div",dQe,[A("span",fQe,F(d.value),1)])):ee("",!0),e.createdAt?(k(),L("div",hQe,[U(fS,{time:e.createdAt},null,8,["time"])])):ee("",!0)],10,aQe))}}),mQe=St(pQe,[["__scopeId","data-v-bbd9b071"]]);function gQe(e){return e!==""&&uA(e).trim()===""?"":yd(e)}function vQe(e){const{text:t,rewritten:n,blocked:i,assembly:o,skillMentions:s,skills:r,skillsLoaded:l,working:a,running:u,queueLength:c,goalMode:d}=e;if(!t&&o.promptAttachments.length===0)return{kind:"noop"};const f=uA(t).trim(),h=t!==""&&f===""?"":yd(n);if(f==="/plan")return{kind:"mode",mode:"plan",historyText:f};if(f==="/goal")return{kind:"mode",mode:"goal",historyText:f};if(f==="/swarm")return{kind:"mode",mode:"swarm",historyText:f};if(t){const m=WI(uA(t))?.cmd,g=m?$le(MP(r),m):void 0,v=s.length===1&&l&&!r.some(y=>y.name===s[0].name);if(s.length===1&&!v&&!a&&!u&&c===0&&!g&&!d){if(i)return{kind:"noop"};const y=s[0];return{kind:"skill-activation",cmd:`/${vc}${y.name} ${Bp(n).trim()}`,skillName:y.name,restoreText:t,attachments:o.promptAttachments,historyText:h}}if(m&&g){if(g.isSkill===!0){if(i)return{kind:"noop"};const w=Bp(n.slice(m.length)).trim();return{kind:"skill-command",cmd:w?`${m} ${w}`:m,skillName:F6(g.name),restoreText:t,attachments:o.promptAttachments,historyText:h}}if(g.noArgs===!0)return(WI(f)??{arg:""}).arg.trim()!==""?{kind:"invalid-command",cmd:m}:{kind:"builtin-command",cmd:m,leave:m==="/new"||m==="/clear",historyText:m,restoreText:t};const y=Bp(t.slice(m.length)).trim();return{kind:"builtin-command",cmd:yd(y?`${m} ${y}`:m),leave:m==="/new"||m==="/clear",historyText:yd(t),restoreText:t,editText:yd(t.slice(m.length)).trim()}}if(m?.startsWith(`/${vc}`)){if(i)return{kind:"noop"};const y=Bp(n.slice(m.length)).trim();return{kind:"unresolved-skill-command",cmd:y?`${m} ${y}`:m,restoreText:t,attachments:o.promptAttachments,historyText:h}}}return i?{kind:"noop"}:{kind:"submit",text:Bp(n).trim(),restoreText:t,editText:n,attachments:o.promptAttachments,historyText:h}}let pb=!1,mb=0,OB=!1;const yQe=100;function kQe(){pb=!0,mb=0}function bQe(){pb=!1,mb=Date.now()}function $B(){pb=!1,mb=0}function hS(){OB||typeof document>"u"||(OB=!0,document.addEventListener("compositionstart",kQe,!0),document.addEventListener("compositionend",bQe,!0),document.addEventListener("focusin",$B,!0),document.addEventListener("focusout",$B,!0))}function pS(e){return pb||e.isComposing||e.keyCode===229||Date.now()-mbnull);if(r===null)return s?.close(),"failed";const l=URL.createObjectURL(new Blob([r],{type:o}));if(s!==null)s.location.href=l;else{const a=document.createElement("a");a.href=l,a.download=n??t,a.click()}return setTimeout(()=>{URL.revokeObjectURL(l)},6e4),"previewed"}/*! * PhotoSwipe 5.4.4 - https://photoswipe.com * (c) 2024 Dmytro Semenov - */function Dl(e,t,n){const i=document.createElement(t);return e&&(i.className=e),n&&n.appendChild(i),i}function ss(e,t){return e.x=t.x,e.y=t.y,t.id!==void 0&&(e.id=t.id),e}function fZ(e){e.x=Math.round(e.x),e.y=Math.round(e.y)}function KA(e,t){const n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return Math.sqrt(n*n+i*i)}function d0(e,t){return e.x===t.x&&e.y===t.y}function Pv(e,t,n){return Math.min(Math.max(e,t),n)}function rv(e,t,n){let i=`translate3d(${e}px,${t||0}px,0)`;return n!==void 0&&(i+=` scale3d(${n},${n},1)`),i}function rh(e,t,n,i){e.style.transform=rv(t,n,i)}const TQe="cubic-bezier(.4,0,.22,1)";function hZ(e,t,n,i){e.style.transition=t?`${t} ${n}ms ${i||TQe}`:"none"}function ZA(e,t,n){e.style.width=typeof t=="number"?`${t}px`:t,e.style.height=typeof n=="number"?`${n}px`:n}function EQe(e){hZ(e)}function LQe(e){return"decode"in e?e.decode().catch(()=>{}):e.complete?Promise.resolve(e):new Promise((t,n)=>{e.onload=()=>t(e),e.onerror=n})}const ea={IDLE:"idle",LOADING:"loading",LOADED:"loaded",ERROR:"error"};function NQe(e){return"button"in e&&e.button===1||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey}function DQe(e,t,n=document){let i=[];if(e instanceof Element)i=[e];else if(e instanceof NodeList||Array.isArray(e))i=Array.from(e);else{const o=typeof e=="string"?e:t;o&&(i=Array.from(n.querySelectorAll(o)))}return i}function PB(){return!!(navigator.vendor&&navigator.vendor.match(/apple/i))}let pZ=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{pZ=!0}}))}catch{}class FQe{constructor(){this._pool=[]}add(t,n,i,o){this._toggleListener(t,n,i,o)}remove(t,n,i,o){this._toggleListener(t,n,i,o,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,n,i,o,s,r){if(!t)return;const l=s?"removeEventListener":"addEventListener";n.split(" ").forEach(u=>{if(u){r||(s?this._pool=this._pool.filter(d=>d.type!==u||d.listener!==i||d.target!==t):this._pool.push({target:t,type:u,listener:i,passive:o}));const c=pZ?{passive:o||!1}:!1;t[l](u,i,c)}})}}function mZ(e,t){if(e.getViewportSizeFn){const n=e.getViewportSizeFn(e,t);if(n)return n}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function Sg(e,t,n,i,o){let s=0;if(t.paddingFn)s=t.paddingFn(n,i,o)[e];else if(t.padding)s=t.padding[e];else{const r="padding"+e[0].toUpperCase()+e.slice(1);t[r]&&(s=t[r])}return Number(s)||0}function gZ(e,t,n,i){return{x:t.x-Sg("left",e,t,n,i)-Sg("right",e,t,n,i),y:t.y-Sg("top",e,t,n,i)-Sg("bottom",e,t,n,i)}}class BQe{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:n}=this.slide,i=this.slide[t==="x"?"width":"height"]*this.currZoomLevel,s=Sg(t==="x"?"left":"top",n.options,n.viewportSize,this.slide.data,this.slide.index),r=this.slide.panAreaSize[t];this.center[t]=Math.round((r-i)/2)+s,this.max[t]=i>r?Math.round(r-i)+s:this.center[t],this.min[t]=i>r?s:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,n){return Pv(n,this.max[t],this.min[t])}}const zB=4e3;class vZ{constructor(t,n,i,o){this.pswp=o,this.options=t,this.itemData=n,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,n,i){const o={x:t,y:n};this.elementSize=o,this.panAreaSize=i;const s=i.x/o.x,r=i.y/o.y;this.fit=Math.min(1,sr?s:r),this.vFill=Math.min(1,r),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const n=t+"ZoomLevel",i=this.options[n];if(i)return typeof i=="function"?i(this):i==="fill"?this.fill:i==="fit"?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,this.fit*3),this.elementSize&&t*this.elementSize.x>zB&&(t=zB/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,this.fit*4)}}class RQe{constructor(t,n,i){this.data=t,this.index=n,this.pswp=i,this.isActive=n===i.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!i.opener.isOpen,this.zoomLevels=new vZ(i.options,t,n,i),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:n}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=Dl("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new BQe(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||!this.isActive&&!1||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel===this.zoomLevels.initial||!this.isActive?(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize()):(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y))}updateContentSize(t){const n=this.currentResolution||this.zoomLevels.initial;if(!n)return;const i=Math.round(this.width*n)||this.pswp.viewportSize.x,o=Math.round(this.height*n)||this.pswp.viewportSize.y;!this.sizeChanged(i,o)&&!t||this.content.setDisplayedSize(i,o)}sizeChanged(t,n){return t!==this.prevDisplayedWidth||n!==this.prevDisplayedHeight?(this.prevDisplayedWidth=t,this.prevDisplayedHeight=n,!0):!1}getPlaceholderElement(){var t;return(t=this.content.placeholder)===null||t===void 0?void 0:t.element}zoomTo(t,n,i,o){const{pswp:s}=this;if(!this.isZoomable()||s.mainScroll.isShifted())return;s.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:n,transitionDuration:i}),s.animations.stopAllPan();const r=this.currZoomLevel;o||(t=Pv(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",n,r),this.pan.y=this.calculateZoomToPanOffset("y",n,r),fZ(this.pan);const l=()=>{this._setResolution(t),this.applyCurrentZoomPan()};i?s.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:l,duration:i,easing:s.options.easing}):l()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,n,i){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];n||(n=this.pswp.getViewportCenterPoint()),i||(i=this.zoomLevels.initial);const s=this.currZoomLevel/i;return this.bounds.correctPan(t,(this.pan[t]-n[t])*s+n[t])}panTo(t,n){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",n),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),ss(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,n,i){i/=this.currentResolution||this.zoomLevels.initial,rh(this.container,t,n,i)}calculateSize(){const{pswp:t}=this;ss(this.panAreaSize,gZ(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return rv(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}const $Qe=.35,OQe=.6,jB=.4,HB=.5;function PQe(e,t){return e*t/(1-t)}class zQe{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&ss(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:n,dragAxis:i}=this.gestures,{currSlide:o}=this.pswp;if(i==="y"&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const s=o.pan.y+(t.y-n.y);if(!this.pswp.dispatch("verticalDrag",{panY:s}).defaultPrevented){this._setPanWithFriction("y",s,OQe);const r=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(r),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(fZ(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:n,currSlide:i}=this.pswp;let o=0;if(this.pswp.animations.stopAll(),n.isShifted()){const r=(n.x-n.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-HB&&r<0||t.x<.1&&r<-.5?(o=1,t.x=Math.min(t.x,0)):(t.x>HB&&r>0||t.x>-.1&&r>.5)&&(o=-1,t.x=Math.max(t.x,0)),n.moveIndexBy(o,!0,t.x)}i&&i.currZoomLevel>i.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:n}=this.gestures,{currSlide:i}=this.pswp;if(!i)return;const{pan:o,bounds:s}=i,r=o[t],l=this.pswp.bgOpacity<1&&t==="y",u=r+PQe(n[t],.995);if(l){const m=this._getVerticalDragRatio(r),g=this._getVerticalDragRatio(u);if(m<0&&g<-jB||m>0&&g>jB){this.pswp.close();return}}const c=s.correctPan(t,u);if(r===c)return;const d=c===u?1:.82,f=this.pswp.bgOpacity,h=c-r;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:r,end:c,velocity:n[t],dampingRatio:d,onUpdate:m=>{if(l&&this.pswp.bgOpacity<1){const g=1-(c-m)/h;this.pswp.applyBgOpacity(Pv(f+(1-f)*g,0,1))}o[t]=Math.floor(m),i.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:n,dragAxis:i,prevP1:o,isMultitouch:s}=this.gestures,{currSlide:r,mainScroll:l}=this.pswp,a=n[t]-o[t],u=l.x+a;if(!a||!r)return!1;if(t==="x"&&!r.isPannable()&&!s)return l.moveTo(u,!0),!0;const{bounds:c}=r,d=r.pan[t]+a;if(this.pswp.options.allowPanToNext&&i==="x"&&t==="x"&&!s){const f=l.getCurrSlideX(),h=l.x-f,m=a>0,g=!m;if(d>c.min[t]&&m){if(c.min[t]<=this.startPan[t])return l.moveTo(u,!0),!0;this._setPanWithFriction(t,d)}else if(d0)return l.moveTo(Math.max(u,f),!0),!0;if(h<0)return l.moveTo(Math.min(u,f),!0),!0}else this._setPanWithFriction(t,d)}else t==="y"?!l.isShifted()&&c.min.y!==c.max.y&&this._setPanWithFriction(t,d):this._setPanWithFriction(t,d);return!1}_getVerticalDragRatio(t){var n,i;return(t-((n=(i=this.pswp.currSlide)===null||i===void 0?void 0:i.bounds.center.y)!==null&&n!==void 0?n:0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,n,i){const{currSlide:o}=this.pswp;if(!o)return;const{pan:s,bounds:r}=o;if(r.correctPan(t,n)!==n||i){const a=Math.round(n-s[t]);s[t]+=a*(i||$Qe)}else s[t]=n}}const jQe=.05,HQe=.15;function WB(e,t,n){return e.x=(t.x+n.x)/2,e.y=(t.y+n.y)/2,e}class WQe{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,ss(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:n,p2:i,startP2:o,pswp:s}=this.gestures,{currSlide:r}=s;if(!r)return;const l=r.zoomLevels.min,a=r.zoomLevels.max;if(!r.isZoomable()||s.mainScroll.isShifted())return;WB(this._startZoomPoint,n,o),WB(this._zoomPoint,t,i);let u=1/KA(n,o)*KA(t,i)*this._startZoomLevel;if(u>r.zoomLevels.initial+r.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),ua&&(u=a+(u-a)*jQe);r.pan.x=this._calculatePanForZoomLevel("x",u),r.pan.y=this._calculatePanForZoomLevel("y",u),r.setZoomLevel(u),r.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:n}=t;(!n||n.currZoomLeveli.zoomLevels.max?s=i.zoomLevels.max:(r=!1,s=o);const l=n.bgOpacity,a=n.bgOpacity<1,u=ss({x:0,y:0},i.pan);let c=ss({x:0,y:0},u);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=o,ss(this._startPan,u)),r&&(c={x:this._calculatePanForZoomLevel("x",s),y:this._calculatePanForZoomLevel("y",s)}),i.setZoomLevel(s),c={x:i.bounds.correctPan("x",c.x),y:i.bounds.correctPan("y",c.y)},i.setZoomLevel(o);const d=!d0(c,u);if(!d&&!r&&!a){i._setResolution(s),i.applyCurrentZoomPan();return}n.animations.stopAllPan(),n.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:f=>{if(f/=1e3,d||r){if(d&&(i.pan.x=u.x+(c.x-u.x)*f,i.pan.y=u.y+(c.y-u.y)*f),r){const h=o+(s-o)*f;i.setZoomLevel(h)}i.applyCurrentZoomPan()}a&&n.bgOpacity<1&&n.applyBgOpacity(Pv(l+(1-l)*f,0,1))},onComplete:()=>{i._setResolution(s),i.applyCurrentZoomPan()}})}}function qB(e){return!!e.target.closest(".pswp__container")}class qQe{constructor(t){this.gestures=t}click(t,n){const i=n.target.classList,o=i.contains("pswp__img"),s=i.contains("pswp__item")||i.contains("pswp__zoom-wrap");o?this._doClickOrTapAction("imageClick",t,n):s&&this._doClickOrTapAction("bgClick",t,n)}tap(t,n){qB(n)&&this._doClickOrTapAction("tap",t,n)}doubleTap(t,n){qB(n)&&this._doClickOrTapAction("doubleTap",t,n)}_doClickOrTapAction(t,n,i){var o;const{pswp:s}=this.gestures,{currSlide:r}=s,l=t+"Action",a=s.options[l];if(!s.dispatch(l,{point:n,originalEvent:i}).defaultPrevented){if(typeof a=="function"){a.call(s,n,i);return}switch(a){case"close":case"next":s[a]();break;case"zoom":r?.toggleZoom(n);break;case"zoom-or-close":r!=null&&r.isZoomable()&&r.zoomLevels.secondary!==r.zoomLevels.initial?r.toggleZoom(n):s.options.clickToCloseNonZoomable&&s.close();break;case"toggle-controls":(o=this.gestures.pswp.element)===null||o===void 0||o.classList.toggle("pswp--ui-visible");break}}}}const UQe=10,VQe=300,KQe=25;class ZQe{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new zQe(this),this.zoomLevels=new WQe(this),this.tapHandler=new qQe(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,n,i,o){const{pswp:s}=this,{events:r}=s,l=o?t+o:"";r.add(s.scrollWrap,t+n,this.onPointerDown.bind(this)),r.add(window,t+"move",this.onPointerMove.bind(this)),r.add(window,t+i,this.onPointerUp.bind(this)),l&&r.add(s.scrollWrap,l,this.onPointerUp.bind(this))}onPointerDown(t){const n=t.type==="mousedown"||t.pointerType==="mouse";if(n&&t.button>0)return;const{pswp:i}=this;if(!i.opener.isOpen){t.preventDefault();return}i.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(n&&(i.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),i.animations.stopAll(),this._updatePoints(t,"down"),this._numActivePoints===1&&(this.dragAxis=null,ss(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1)}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===1&&!this.isDragging?(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,ss(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop())):this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop())))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===0&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),this._numActivePoints===1&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?d0(this.p1,this.prevP1)||this.drag.change():(!d0(this.p1,this.prevP1)||!d0(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const n=Date.now(),i=n-this._intervalTime;i<50&&!t||(this.velocity.x=this._getVelocity("x",i),this.velocity.y=this._getVelocity("y",i),this._intervalTime=n,ss(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:n}=this.pswp;if(n.isShifted()){n.moveIndexBy(0,!0);return}if(t.type.indexOf("cancel")>0)return;if(t.type==="mouseup"||t.pointerType==="mouse"){this.tapHandler.click(this.startP1,t);return}const i=this.pswp.options.doubleTapAction?VQe:0;this._tapTimer?(this._clearTapTimer(),KA(this._lastStartP1,this.startP1){this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},i))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,n){const i=this.p1[t]-this._intervalP1[t];return Math.abs(i)>1&&n>5?i/n:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,n){this.pswp.applyFilters("preventPointerEvent",!0,t,n)&&t.preventDefault()}_updatePoints(t,n){if(this._pointerEventEnabled){const i=t,o=this._ongoingPointers.findIndex(s=>s.id===i.pointerId);n==="up"&&o>-1?this._ongoingPointers.splice(o,1):n==="down"&&o===-1?this._ongoingPointers.push(this._convertEventPosToPoint(i,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(i,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&ss(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&ss(this.p2,this._ongoingPointers[1])}else{const i=t;this._numActivePoints=0,i.type.indexOf("touch")>-1?i.touches&&i.touches.length>0&&(this._convertEventPosToPoint(i.touches[0],this.p1),this._numActivePoints++,i.touches.length>1&&(this._convertEventPosToPoint(i.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),n==="up"?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){ss(this.prevP1,this.p1),ss(this.prevP2,this.p2)}_updateStartPoints(){ss(this.startP1,this.p1),ss(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(t!==0){const n=t>0?"x":"y";Math.abs(this.p1[n]-this.startP1[n])>=UQe&&(this.dragAxis=n)}}}_convertEventPosToPoint(t,n){return n.x=t.pageX-this.pswp.offset.x,n.y=t.pageY-this.pswp.offset.y,"pointerId"in t?n.id=t.pointerId:t.identifier!==void 0&&(n.id=t.identifier),n}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const GQe=.35;class QQe{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:n}=this,i=Math.round(n.viewportSize.x+n.viewportSize.x*n.options.spacing),o=i!==this.slideWidth;o&&(this.slideWidth=i,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((s,r)=>{o&&rh(s.el,(r+this._containerShiftIndex)*this.slideWidth),t&&s.slide&&s.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const n=Dl("pswp__item","div",this.pswp.container);n.setAttribute("role","group"),n.setAttribute("aria-roledescription","slide"),n.setAttribute("aria-hidden","true"),n.style.display=t===1?"block":"none",this.itemHolders.push({el:n})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,n,i){const{pswp:o}=this;let s=o.potentialIndex+t;const r=o.getNumItems();if(o.canLoop()){s=o.getLoopedIndex(s);const a=(t+r)%r;a<=r/2?t=a:t=a-r}else s<0?s=0:s>=r&&(s=r-1),t=s-o.potentialIndex;o.potentialIndex=s,this._currPositionIndex-=t,o.animations.stopMainScroll();const l=this.getCurrSlideX();if(!n)this.moveTo(l),this.updateCurrItem();else{o.animations.startSpring({isMainScroll:!0,start:this.x,end:l,velocity:i||0,naturalFrequency:30,dampingRatio:1,onUpdate:u=>{this.moveTo(u)},onComplete:()=>{this.updateCurrItem(),o.appendHeavy()}});let a=o.potentialIndex-o.currIndex;if(o.canLoop()){const u=(a+r)%r;u<=r/2?a=u:a=u-r}Math.abs(a)>1&&this.updateCurrItem()}return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){var t;const{pswp:n}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,n.currIndex=n.potentialIndex;let o=Math.abs(i),s;o>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),o=3,this.itemHolders.forEach(r=>{var l;(l=r.slide)===null||l===void 0||l.destroy(),r.slide=void 0}));for(let r=0;r0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,rh(s.el,(this._containerShiftIndex+2)*this.slideWidth),n.setContent(s,n.currIndex-o+r+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,rh(s.el,this._containerShiftIndex*this.slideWidth),n.setContent(s,n.currIndex+o-r-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),n.animations.stopAllPan(),this.itemHolders.forEach((r,l)=>{r.slide&&r.slide.setIsActive(l===1)}),n.currSlide=(t=this.itemHolders[1])===null||t===void 0?void 0:t.slide,n.contentLoader.updateLazy(i),n.currSlide&&n.currSlide.applyCurrentZoomPan(),n.dispatch("change")}moveTo(t,n){if(!this.pswp.canLoop()&&n){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const o=Math.round(t-this.x);(i<0&&o>0||i>=this.pswp.getNumItems()-1&&o<0)&&(t=this.x+o*GQe)}this.x=t,this.pswp.container&&rh(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:n??!1})}}const YQe={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},Ff=(e,t)=>t?e:YQe[e];class JQe{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const n=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&n&&this._wasFocused&&n.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:n}=this;if(n.dispatch("keydown",{originalEvent:t}).defaultPrevented||NQe(t))return;let i,o,s=!1;const r="key"in t;switch(r?t.key:t.keyCode){case Ff("Escape",r):n.options.escKey&&(i="close");break;case Ff("z",r):i="toggleZoom";break;case Ff("ArrowLeft",r):o="x";break;case Ff("ArrowUp",r):o="y";break;case Ff("ArrowRight",r):o="x",s=!0;break;case Ff("ArrowDown",r):s=!0,o="y";break;case Ff("Tab",r):this._focusRoot();break}if(o){t.preventDefault();const{currSlide:l}=n;n.options.arrowKeys&&o==="x"&&n.getNumItems()>1?i=s?"next":"prev":l&&l.currZoomLevel>l.zoomLevels.fit&&(l.pan[o]+=s?-80:80,l.panTo(l.pan.x,l.pan.y))}i&&(t.preventDefault(),n[i]())}_onFocusIn(t){const{template:n}=this.pswp;n&&document!==t.target&&n!==t.target&&!n.contains(t.target)&&n.focus()}}const XQe="cubic-bezier(.4,0,.22,1)";class eYe{constructor(t){var n;this.props=t;const{target:i,onComplete:o,transform:s,onFinish:r=()=>{},duration:l=333,easing:a=XQe}=t;this.onFinish=r;const u=s?"transform":"opacity",c=(n=t[u])!==null&&n!==void 0?n:"";this._target=i,this._onComplete=o,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{hZ(i,u,l,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},l+500),i.style[u]=c},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&clearTimeout(this._helperTimeout),EQe(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}const tYe=12,nYe=.75;class iYe{constructor(t,n,i){this.velocity=t*1e3,this._dampingRatio=n||nYe,this._naturalFrequency=i||tYe,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,n){let i=0,o;n/=1e3;const s=Math.E**(-this._dampingRatio*this._naturalFrequency*n);if(this._dampingRatio===1)o=this.velocity+this._naturalFrequency*t,i=(t+o*n)*s,this.velocity=i*-this._naturalFrequency+o*s;else if(this._dampingRatio<1){o=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const r=Math.cos(this._dampedFrequency*n),l=Math.sin(this._dampedFrequency*n);i=s*(t*r+o*l),this.velocity=i*-this._naturalFrequency*this._dampingRatio+s*(-this._dampedFrequency*t*l+this._dampedFrequency*o*r)}return i}}class oYe{constructor(t){this.props=t,this._raf=0;const{start:n,end:i,velocity:o,onUpdate:s,onComplete:r,onFinish:l=()=>{},dampingRatio:a,naturalFrequency:u}=t;this.onFinish=l;const c=new iYe(o,a,u);let d=Date.now(),f=n-i;const h=()=>{this._raf&&(f=c.easeFrame(f,Date.now()-d),Math.abs(f)<1&&Math.abs(c.velocity)<50?(s(i),r&&r(),this.onFinish()):(d=Date.now(),s(f+i),this._raf=requestAnimationFrame(h)))};this._raf=requestAnimationFrame(h)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class sYe{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,n){const i=n?new oYe(t):new eYe(t);return this.activeAnimations.push(i),i.onFinish=()=>this.stop(i),i}stop(t){t.destroy();const n=this.activeAnimations.indexOf(t);n>-1&&this.activeAnimations.splice(n,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isPan?(t.destroy(),!1):!0)}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isMainScroll?(t.destroy(),!1):!0)}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}class rYe{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:n}=this.pswp;let{deltaX:i,deltaY:o}=t;if(n&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(n.isZoomable()){let s=-o;t.deltaMode===1?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const r=n.currZoomLevel*s;n.zoomTo(r,{x:t.clientX,y:t.clientY})}}else n.isPannable()&&(t.deltaMode===1&&(i*=18,o*=18),n.panTo(n.pan.x-i,n.pan.y-o))}}function lYe(e){if(typeof e=="string")return e;if(!e||!e.isCustomSVG)return"";const t=e;let n='",n}class aYe{constructor(t,n){var i;const o=n.name||n.className;let s=n.html;if(t.options[o]===!1)return;typeof t.options[o+"SVG"]=="string"&&(s=t.options[o+"SVG"]),t.dispatch("uiElementCreate",{data:n});let r="";n.isButton?(r+="pswp__button ",r+=n.className||`pswp__button--${n.name}`):r+=n.className||`pswp__${n.name}`;let l=n.isButton?n.tagName||"button":n.tagName||"div";l=l.toLowerCase();const a=Dl(r,l);if(n.isButton){l==="button"&&(a.type="button");let{title:d}=n;const{ariaLabel:f}=n;typeof t.options[o+"Title"]=="string"&&(d=t.options[o+"Title"]),d&&(a.title=d);const h=f||d;h&&a.setAttribute("aria-label",h)}a.innerHTML=lYe(s),n.onInit&&n.onInit(a,t),n.onClick&&(a.onclick=d=>{typeof n.onClick=="string"?t[n.onClick]():typeof n.onClick=="function"&&n.onClick(d,a,t)});const u=n.appendTo||"bar";let c=t.element;u==="bar"?(t.topBar||(t.topBar=Dl("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),c=t.topBar):(a.classList.add("pswp__hide-on-close"),u==="wrapper"&&(c=t.scrollWrap)),(i=c)===null||i===void 0||i.appendChild(t.applyFilters("uiElement",a,n))}}function yZ(e,t,n){e.classList.add("pswp__button--arrow"),e.setAttribute("aria-controls","pswp__items"),t.on("change",()=>{t.options.loop||(n?e.disabled=!(t.currIndex0))})}const uYe={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:yZ},cYe={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(e,t)=>{yZ(e,t,!0)}},dYe={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'',outlineID:"pswp__icn-close"},onClick:"close"},fYe={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},hYe={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'',outlineID:"pswp__icn-loading"},onInit:(e,t)=>{let n,i=null;const o=(l,a)=>{e.classList.toggle("pswp__preloader--"+l,a)},s=l=>{n!==l&&(n=l,o("active",l))},r=()=>{var l;if(!((l=t.currSlide)!==null&&l!==void 0&&l.content.isLoading())){s(!1),i&&(clearTimeout(i),i=null);return}i||(i=setTimeout(()=>{var a;s(!!(!((a=t.currSlide)===null||a===void 0)&&a.content.isLoading())),i=null},t.options.preloaderDelay))};t.on("change",r),t.on("loadComplete",l=>{t.currSlide===l.slide&&r()}),t.ui&&(t.ui.updatePreloaderVisibility=r)}},pYe={name:"counter",order:5,onInit:(e,t)=>{t.on("change",()=>{e.innerText=t.currIndex+1+t.options.indexIndicatorSep+t.getNumItems()})}};function UB(e,t){e.classList.toggle("pswp--zoomed-in",t)}class mYe{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[dYe,uYe,cYe,fYe,hYe,pYe],t.dispatch("uiRegister"),this.uiElementsData.sort((n,i)=>(n.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(n=>{this.registerElement(n)}),t.on("change",()=>{var n;(n=t.element)===null||n===void 0||n.classList.toggle("pswp--one-slide",t.getNumItems()===1)}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new aYe(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:n,options:i}=this.pswp;if(this.pswp.opener.isClosing||!t||!n)return;let{currZoomLevel:o}=n;if(this.pswp.opener.isOpen||(o=n.zoomLevels.initial),o===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=o;const s=n.zoomLevels.initial-n.zoomLevels.secondary;if(Math.abs(s)<.01||!n.isZoomable()){UB(t,!1),t.classList.remove("pswp--zoom-allowed");return}t.classList.add("pswp--zoom-allowed");const r=o===n.zoomLevels.initial?n.zoomLevels.secondary:n.zoomLevels.initial;UB(t,r<=o),(i.imageClickAction==="zoom"||i.imageClickAction==="zoom-or-close")&&t.classList.add("pswp--click-to-zoom")}}function gYe(e){const t=e.getBoundingClientRect();return{x:t.left,y:t.top,w:t.width}}function vYe(e,t,n){const i=e.getBoundingClientRect(),o=i.width/t,s=i.height/n,r=o>s?o:s,l=(i.width-t*r)/2,a=(i.height-n*r)/2,u={x:i.left+l,y:i.top+a,w:t*r};return u.innerRect={w:i.width,h:i.height,x:l,y:a},u}function yYe(e,t,n){const i=n.dispatch("thumbBounds",{index:e,itemData:t,instance:n});if(i.thumbBounds)return i.thumbBounds;const{element:o}=t;let s,r;if(o&&n.options.thumbSelector!==!1){const l=n.options.thumbSelector||"img";r=o.matches(l)?o:o.querySelector(l)}return r=n.applyFilters("thumbEl",r,t,e),r&&(t.thumbCropped?s=vYe(r,t.width||t.w||0,t.height||t.h||0):s=gYe(r)),n.applyFilters("thumbBounds",s,t,e)}class kYe{constructor(t,n){this.type=t,this.defaultPrevented=!1,n&&Object.assign(this,n)}preventDefault(){this.defaultPrevented=!0}}class bYe{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,n,i=100){var o,s,r;this._filters[t]||(this._filters[t]=[]),(o=this._filters[t])===null||o===void 0||o.push({fn:n,priority:i}),(s=this._filters[t])===null||s===void 0||s.sort((l,a)=>l.priority-a.priority),(r=this.pswp)===null||r===void 0||r.addFilter(t,n,i)}removeFilter(t,n){this._filters[t]&&(this._filters[t]=this._filters[t].filter(i=>i.fn!==n)),this.pswp&&this.pswp.removeFilter(t,n)}applyFilters(t,...n){var i;return(i=this._filters[t])===null||i===void 0||i.forEach(o=>{n[0]=o.fn.apply(this,n)}),n[0]}on(t,n){var i,o;this._listeners[t]||(this._listeners[t]=[]),(i=this._listeners[t])===null||i===void 0||i.push(n),(o=this.pswp)===null||o===void 0||o.on(t,n)}off(t,n){var i;this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(o=>n!==o)),(i=this.pswp)===null||i===void 0||i.off(t,n)}dispatch(t,n){var i;if(this.pswp)return this.pswp.dispatch(t,n);const o=new kYe(t,n);return(i=this._listeners[t])===null||i===void 0||i.forEach(s=>{s.call(this,o)}),o}}class wYe{constructor(t,n){if(this.element=Dl("pswp__img pswp__img--placeholder",t?"img":"div",n),t){const i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,n){this.element&&(this.element.tagName==="IMG"?(ZA(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=rv(0,0,t/250)):ZA(this.element,t,n))}destroy(){var t;(t=this.element)!==null&&t!==void 0&&t.parentNode&&this.element.remove(),this.element=null}}class CYe{constructor(t,n,i){this.instance=n,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=ea.IDLE,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,n){if(this.slide&&this.usePlaceholder())if(this.placeholder){const i=this.placeholder.element;i&&!i.parentElement&&this.slide.container.prepend(i)}else{const i=this.instance.applyFilters("placeholderSrc",this.data.msrc&&this.slide.isFirstSlide?this.data.msrc:!1,this);this.placeholder=new wYe(i,this.slide.container)}this.element&&!n||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=Dl("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=Dl("pswp__content","div"),this.element.innerHTML=this.data.html||""),n&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var n,i;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const o=this.element;this.updateSrcsetSizes(),this.data.srcset&&(o.srcset=this.data.srcset),o.src=(n=this.data.src)!==null&&n!==void 0?n:"",o.alt=(i=this.data.alt)!==null&&i!==void 0?i:"",this.state=ea.LOADING,o.complete?this.onLoaded():(o.onload=()=>{this.onLoaded()},o.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=ea.LOADED,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),(this.state===ea.LOADED||this.state===ea.ERROR)&&this.removePlaceholder())}onError(){this.state=ea.ERROR,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===ea.LOADING,this)}isError(){return this.state===ea.ERROR}isImageContent(){return this.type==="image"}setDisplayedSize(t,n){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,n),!this.instance.dispatch("contentResize",{content:this,width:t,height:n}).defaultPrevented&&(ZA(this.element,t,n),this.isImageContent()&&!this.isError()))){const i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=n,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:n,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==ea.ERROR,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,n=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||n>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=n+"px",t.dataset.largestUsedSize=String(n))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,!this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented&&(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var t,n;let i=Dl("pswp__error-msg","div");i.innerText=(t=(n=this.instance.options)===null||n===void 0?void 0:n.errorMsg)!==null&&t!==void 0?t:"",i=this.instance.applyFilters("contentErrorElement",i,this),this.element=Dl("pswp__content pswp__error-msg-container","div"),this.element.appendChild(i),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===ea.ERROR){this.displayError();return}if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||PB())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){this.instance.dispatch("contentActivate",{content:this}).defaultPrevented||!this.slide||(this.isImageContent()&&this.isDecoding&&!PB()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,!this.instance.dispatch("contentRemove",{content:this}).defaultPrevented&&(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),(this.state===ea.LOADED||this.state===ea.ERROR)&&this.removePlaceholder()))}}const AYe=5;function kZ(e,t,n){const i=t.createContentFromData(e,n);let o;const{options:s}=t;if(s){o=new vZ(s,e,-1);let r;t.pswp?r=t.pswp.viewportSize:r=mZ(s,t);const l=gZ(s,r,e,n);o.update(i.width,i.height,l)}return i.lazyLoad(),o&&i.setDisplayedSize(Math.ceil(i.width*o.initial),Math.ceil(i.height*o.initial)),i}function xYe(e,t){const n=t.getItemData(e);if(!t.dispatch("lazyLoadSlide",{index:e,itemData:n}).defaultPrevented)return kZ(n,t,e)}class SYe{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,AYe),this._cachedItems=[]}updateLazy(t){const{pswp:n}=this;if(n.dispatch("lazyLoad").defaultPrevented)return;const{preload:i}=n.options,o=t===void 0?!0:t>=0;let s;for(s=0;s<=i[1];s++)this.loadSlideByIndex(n.currIndex+(o?s:-s));for(s=1;s<=i[0];s++)this.loadSlideByIndex(n.currIndex+(o?-s:s))}loadSlideByIndex(t){const n=this.pswp.getLoopedIndex(t);let i=this.getContentByIndex(n);i||(i=xYe(n,this.pswp),i&&this.addToCache(i))}getContentBySlide(t){let n=this.getContentByIndex(t.index);return n||(n=this.pswp.createContentFromData(t.data,t.index),this.addToCache(n)),n.setSlide(t),n}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const n=this._cachedItems.findIndex(i=>!i.isAttached&&!i.hasSlide);n!==-1&&this._cachedItems.splice(n,1)[0].destroy()}}removeByIndex(t){const n=this._cachedItems.findIndex(i=>i.index===t);n!==-1&&this._cachedItems.splice(n,1)}getContentByIndex(t){return this._cachedItems.find(n=>n.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}}class _Ye extends bYe{getNumItems(){var t;let n=0;const i=(t=this.options)===null||t===void 0?void 0:t.dataSource;i&&"length"in i?n=i.length:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),i.items&&(n=i.items.length));const o=this.dispatch("numItems",{dataSource:i,numItems:n});return this.applyFilters("numItems",o.numItems,i)}createContentFromData(t,n){return new CYe(t,this,n)}getItemData(t){var n;const i=(n=this.options)===null||n===void 0?void 0:n.dataSource;let o={};Array.isArray(i)?o=i[t]:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),o=i.items[t]);let s=o;s instanceof Element&&(s=this._domElementToItemData(s));const r=this.dispatch("itemData",{itemData:s||{},index:t});return this.applyFilters("itemData",r.itemData,t)}_getGalleryDOMElements(t){var n,i;return(n=this.options)!==null&&n!==void 0&&n.children||(i=this.options)!==null&&i!==void 0&&i.childSelector?DQe(this.options.children,this.options.childSelector,t)||[]:[t]}_domElementToItemData(t){const n={element:t},i=t.tagName==="A"?t:t.querySelector("a");if(i){n.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(n.srcset=i.dataset.pswpSrcset),n.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,n.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,n.w=n.width,n.h=n.height,i.dataset.pswpType&&(n.type=i.dataset.pswpType);const s=t.querySelector("img");if(s){var o;n.msrc=s.currentSrc||s.src,n.alt=(o=s.getAttribute("alt"))!==null&&o!==void 0?o:""}(i.dataset.pswpCropped||i.dataset.cropped)&&(n.thumbCropped=!0)}return this.applyFilters("domItemData",n,t,i)}lazyLoadData(t,n){return kZ(t,this,n)}}const Gm=.003;class MYe{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,n=this.pswp.currSlide,{options:i}=t;if(i.showHideAnimationType==="fade"?(i.showHideOpacity=!0,this._thumbBounds=void 0):i.showHideAnimationType==="none"?(i.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=n?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&n?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),!this._animateZoom)this._animateRootOpacity=!0,this.isOpening&&n&&(n.zoomAndPanToInitial(),n.applyCurrentZoomPan());else{var o;this._animateRootOpacity=(o=i.showHideOpacity)!==null&&o!==void 0?o:!1}if(this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>Gm,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation){this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,this.isOpening&&(t.element&&(t.element.style.opacity=String(Gm)),t.applyBgOpacity(1));return}if(this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect){var s;this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=(s=this.pswp.currSlide)===null||s===void 0?void 0:s.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")}else this._croppedZoom=!1;this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(Gm)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(Gm)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(Gm)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&t.mainScroll.x!==0&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&this._placeholder.tagName==="IMG"?new Promise(t=>{let n=!1,i=!0;LQe(this._placeholder).finally(()=>{n=!0,i||t(!0)}),setTimeout(()=>{i=!1,n&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){var t,n;(t=this.pswp.element)===null||t===void 0||t.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),(n=this.pswp.element)===null||n===void 0||n.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;if(this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed)t.destroy();else if(this.isOpen){var n;this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),(n=t.currSlide)===null||n===void 0||n.applyCurrentZoomPan()}}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:n}=this,{innerRect:i}=this._thumbBounds,{currSlide:o,viewportSize:s}=n;if(this._croppedZoom&&i&&this._cropContainer1&&this._cropContainer2){const r=-s.x+(this._thumbBounds.x-i.x)+i.w,l=-s.y+(this._thumbBounds.y-i.y)+i.h,a=s.x-i.w,u=s.y-i.h;t?(this._animateTo(this._cropContainer1,"transform",rv(r,l)),this._animateTo(this._cropContainer2,"transform",rv(a,u))):(rh(this._cropContainer1,r,l),rh(this._cropContainer2,a,u))}o&&(ss(o.pan,i||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,t?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,n,i){if(!this._duration){t.style[n]=i;return}const{animations:o}=this.pswp,s={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{o.activeAnimations.length||this._onAnimationComplete()},target:t};s[n]=i,o.startTransition(s)}}const IYe={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class TYe extends _Ye{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new FQe,this.animations=new sYe,this.mainScroll=new QQe(this),this.gestures=new ZQe(this),this.opener=new MYe(this),this.keyboard=new JQe(this),this.contentLoader=new SYe(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new rYe(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:n}=this.mainScroll;n[0]&&(n[0].el.style.display="block",this.setContent(n[0],this.currIndex-1)),n[2]&&(n[2].el.style.display="block",this.setContent(n[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const n=this.getNumItems();return this.options.loop&&(t>n-1&&(t-=n),t<0&&(t+=n)),Pv(t,0,n-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{var n;(n=t.slide)===null||n===void 0||n.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){var n;(n=this.currSlide)===null||n===void 0||n.zoomTo(...t)}toggleZoom(){var t;(t=this.currSlide)===null||t===void 0||t.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){var t;if(!this.isDestroying){this.options.showHideAnimationType="none",this.close();return}this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),(t=this.element)===null||t===void 0||t.remove(),this.mainScroll.itemHolders.forEach(n=>{var i;(i=n.slide)===null||i===void 0||i.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((n,i)=>{var o,s;let r=((o=(s=this.currSlide)===null||s===void 0?void 0:s.index)!==null&&o!==void 0?o:0)-1+i;if(this.canLoop()&&(r=this.getLoopedIndex(r)),r===t&&(this.setContent(n,t,!0),i===1)){var l;this.currSlide=n.slide,(l=n.slide)===null||l===void 0||l.setIsActive(!0)}}),this.dispatch("change")}setContent(t,n,i){if(this.canLoop()&&(n=this.getLoopedIndex(n)),t.slide){if(t.slide.index===n&&!i)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(n<0||n>=this.getNumItems()))return;const o=this.getItemData(n);t.slide=new RQe(o,n,this),n===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const n=mZ(this.options,this);!t&&d0(n,this._prevViewportSize)||(ss(this._prevViewportSize,n),this.dispatch("beforeResize"),ss(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){if(!this.hasMouse){var t;this.hasMouse=!0,(t=this.element)===null||t===void 0||t.classList.add("pswp--has_mouse")}}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,n){this.offset.x=t,this.offset.y=n,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=Dl("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=Dl("pswp__bg","div",this.element),this.scrollWrap=Dl("pswp__scroll-wrap","section",this.element),this.container=Dl("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new mYe(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return yYe(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...IYe,...t}}}function EYe(e){return new Promise(t=>{const n=new Image;n.onload=()=>t(n.naturalWidth>0?{w:n.naturalWidth,h:n.naturalHeight}:null),n.onerror=()=>t(null),n.src=e})}async function LYe(e,t,n){if(n?.currentSrc&&n.naturalWidth>0)return{src:n.currentSrc,w:n.naturalWidth,h:n.naturalHeight,objectUrl:null};let i=t.url,o=null;if(t.fileId)try{const r=t.sessionId?await e.getSessionMediaBlob(t.sessionId,t.fileId):await e.getFileBlob(t.fileId);o=URL.createObjectURL(r),i=o}catch{}const s=await EYe(i);return s?{src:i,...s,objectUrl:o}:(o&&URL.revokeObjectURL(o),null)}function NYe(e){const t=(o,s)=>{const r=parseFloat(e(o));return Number.isFinite(r)&&r>0?r:s},n=t("--space-6",24),i=t("--space-8",32)+n;return{top:i,bottom:i,left:n,right:n}}function DYe(e){let t=!1,n=!1,i=null;return(async()=>{const o=await LYe(e.api,e.media,e.thumbImg);if(t){o?.objectUrl&&URL.revokeObjectURL(o.objectUrl);return}if(!o){e.onClose();return}const s=e.thumbImg?.currentSrc===o.src?e.thumbImg:null;i=new TYe({dataSource:[{src:o.src,w:o.w,h:o.h,thumbCropped:!0,...s?{msrc:s.currentSrc,element:s}:{}}],index:0,showHideAnimationType:s?"zoom":"fade",arrowPrev:!1,arrowNext:!1,counter:!1,close:!1,zoom:!1,wheelToZoom:!0,escKey:!0,trapFocus:!1,bgOpacity:1,padding:NYe(l=>getComputedStyle(document.documentElement).getPropertyValue(l))}),i.addFilter("thumbEl",l=>l?.isConnected?l:null);const r=e.media.path;i.on("uiRegister",()=>{const l=i?.ui;!l||!r||l.registerElement({name:"caption",className:"media-preview-caption",isButton:!1,appendTo:"root",onInit:a=>{a.textContent=r}})}),i.on("openingAnimationStart",()=>{rr.value+=1,e.onOpen?.()}),i.on("destroy",()=>{n=!0,rr.value=Math.max(0,rr.value-1),o.objectUrl&&URL.revokeObjectURL(o.objectUrl),e.onClose()}),i.init()})(),()=>{t=!0,i&&!n&&i.close()}}function gS(e){try{const t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}function FYe(){const e=window.open("","_blank");if(!e)return null;try{e.opener=null}catch{}return{get closed(){return e.closed},navigate(t){e.location.href=t},focus(){e.focus()},close(){e.close()}}}function bZ(e=FYe){let t=null,n=null;function i(){if(t)try{t.close()}catch{}t=null,n=null}return{onGesture(){i(),t=e()},openUrl(o,s){if(!gS(o))return i(),!1;if(!t||t.closed)return t=null,n=null,!1;if(n===o){try{t.focus()}catch{}return!0}try{t.navigate(o)}catch{return i(),!1}return n=o,!0},settle(o,s){if(n!==null&&(o||s?.keepNavigated===!0)){t=null,n=null;return}i()}}}function wZ(){return{subscribe(e){const t=()=>{document.visibilityState==="visible"&&e()};return window.addEventListener("focus",e),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",t)}}}}const BYe=["aria-label"],RYe=["aria-label"],$Ye={class:"media-lightbox-card"},OYe={class:"media-lightbox-frame"},PYe={key:0,class:"media-lightbox-name"},zYe=["aria-label"],jYe='button:not([disabled]), video[controls], [tabindex]:not([tabindex="-1"])',HYe=lt({__name:"MediaLightbox",props:{media:{},originImg:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=D(()=>n.media.kind==="image"),r=D(()=>n.media.path??null),l=D(()=>r.value??(n.media.kind==="video"?o("composer.attachmentVideo"):o("composer.attachmentImage"))),a=V(null),u=V(null),c=V(!1);let d=null,f=null;function h(m){if(m.key==="Escape"){m.preventDefault(),i("close");return}if(m.key!=="Tab"||!a.value)return;const g=a.value.querySelectorAll(jYe),v=g[0],y=g[g.length-1];!v||!y||(a.value.contains(document.activeElement)?m.shiftKey&&document.activeElement===v?(m.preventDefault(),y.focus()):!m.shiftKey&&document.activeElement===y&&(m.preventDefault(),v.focus()):(m.preventDefault(),(m.shiftKey?y:v).focus()))}return yn(()=>{if(s.value){f=DYe({api:Kt(),media:n.media,thumbImg:n.originImg??null,onOpen:()=>{c.value=!0},onClose:()=>i("close")});return}rr.value+=1,d=document.activeElement instanceof HTMLElement?document.activeElement:null,window.addEventListener("keydown",h),u.value?.focus()}),ti(()=>{if(f){f(),f=null;return}rr.value=Math.max(0,rr.value-1),window.removeEventListener("keydown",h),d?.focus()}),(m,g)=>(k(),de(cs,{to:"body"},[s.value?c.value?(k(),de(p(Nn),{key:1,text:p(o)("model.close")},{default:ce(()=>[A("button",{type:"button",class:"media-lightbox-close","aria-label":p(o)("model.close"),onClick:g[2]||(g[2]=v=>i("close"))},[U(p(Ce),{name:"close",size:"sm"})],8,zYe)]),_:1},8,["text"])):ee("",!0):(k(),L("div",{key:0,ref_key:"overlayRef",ref:a,class:"media-lightbox",role:"dialog","aria-modal":"true","aria-label":l.value,onMousedown:g[1]||(g[1]=Tt(v=>i("close"),["self"]))},[U(p(Nn),{text:p(o)("model.close")},{default:ce(()=>[A("button",{ref_key:"closeRef",ref:u,type:"button",class:"media-lightbox-close","aria-label":p(o)("model.close"),onClick:g[0]||(g[0]=v=>i("close"))},[U(p(Ce),{name:"close",size:"sm"})],8,RYe)]),_:1},8,["text"]),A("div",$Ye,[A("div",OYe,[U(dS,{url:e.media.url,kind:e.media.kind==="video"?"video":"image","file-id":e.media.fileId,"session-id":e.media.sessionId,"media-class":"media-lightbox-media",controls:e.media.kind==="video"},null,8,["url","kind","file-id","session-id","controls"])]),r.value?(k(),L("div",PYe,F(r.value),1)):ee("",!0)])],40,BYe))]))}}),CZ=xt(HYe,[["__scopeId","data-v-14fb6a4a"]]),WYe={class:"working-indicator",role:"status"},qYe={class:"wi-mascot","aria-hidden":"true"},UYe={class:"wi-label"},VYe=lt({__name:"WorkingIndicator",props:{label:{}},setup(e){return(t,n)=>(k(),L("div",WYe,[A("span",qYe,[U(p(ZOe))]),A("span",UYe,F(e.label),1)]))}}),vS=xt(VYe,[["__scopeId","data-v-cd612157"]]),KYe=lt({__name:"SelectionActionBubble",props:{visible:{type:Boolean},x:{},y:{},bottom:{},px:{},py:{},quote:{},focusOnOpen:{type:Boolean},focusReturnEl:{}},emits:["action","close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),r=Ec().value||typeof window<"u"&&window.matchMedia("(hover: none)").matches===!0,{handleCompositionStart:l,handleCompositionEnd:a,isComposingKeyEvent:u}=kl(),c=V("menu"),d=V(""),f=V(null),h=V(null),m=V(null),g=V({});let v=null;function y(){const B=v;if(v=null,B&&B.isConnected){B.focus();return}const P=n.focusReturnEl;P&&P.isConnected&&P.focus()}function b(){y(),i("close")}function w(B){const P=B.target;f.value?.el?.contains(P)||b()}function C(B){if(!bV(f.value?.el??null,B?.target??null)){if(B?.type==="resize"&&c.value==="comment"){x();return}b()}}function T(){if(c.value==="comment"){x();return}b()}function N(B){B.key!=="Escape"||B.repeat||mS(B)||(B.stopPropagation(),b())}function I(){pS(),document.addEventListener("mousedown",w),window.addEventListener("keydown",N,!0),document.addEventListener("scroll",C,!0),window.addEventListener("resize",C),window.visualViewport?.addEventListener("resize",T),window.visualViewport?.addEventListener("scroll",T)}function S(){document.removeEventListener("mousedown",w),window.removeEventListener("keydown",N,!0),document.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C),window.visualViewport?.removeEventListener("resize",T),window.visualViewport?.removeEventListener("scroll",T)}function _(B,P){const H=getComputedStyle(document.documentElement).getPropertyValue(B).trim(),j=Number.parseFloat(H);return Number.isFinite(j)?j:P}async function x(B=!1){B&&(g.value={visibility:"hidden"}),await ht();const P=f.value?.el;if(!P)return;const H=_("--space-1-5",6),j=_("--p-mention-tip-vmargin",12),Z=window.visualViewport?.width??window.innerWidth,ie=window.visualViewport?.height??window.innerHeight,W=window.visualViewport?.offsetLeft??0,Q=window.visualViewport?.offsetTop??0,te=`${Math.round(Z-2*j)}px`,X=`${Math.round(ie-2*j)}px`;g.value={...g.value,maxWidth:te,maxHeight:X},await ht();const ge=P.offsetWidth,ue=P.offsetHeight;let se,fe;if(n.px!==void 0&&n.py!==void 0){se=y5(n.px,ge,Z,j,W);const G=n.py>=(n.y+n.bottom)/2,ae=n.py+H,K=n.py-ue-H;G?fe=ae+ue<=Q+ie-j||K=Q+j||ae+ue>Q+ie-j?K:ae}else{se=y5(n.x-ge/2,ge,Z,j,W),fe=n.bottom+H;const G=fe+ue<=Q+ie-j,ae=n.y-ue-H>=Q+j;!G&&ae&&(fe=n.y-ue-H)}fe=y5(fe,ue,ie,j,Q),g.value={top:`${Math.round(fe)}px`,left:`${Math.round(se)}px`,maxWidth:te,maxHeight:X}}We(()=>[n.visible,n.x,n.y,n.bottom,n.px,n.py],([B],P)=>{B?(P?.[0]!==!0&&(c.value="menu",d.value="",v=document.activeElement,I()),x(P?.[0]!==!0).then(()=>{P?.[0]!==!0&&n.focusOnOpen&&E()[0]?.focus()})):S()},{immediate:!0}),Ln(S);function E(){return Array.from(f.value?.el?.querySelectorAll('[role="menuitem"]')??[])}function M(B){if(c.value==="comment"){if(B.key!=="Tab")return;B.preventDefault();const Z=h.value?.el,ie=m.value?.querySelector(".ui-button");if(!Z||!ie)return;(document.activeElement===Z?ie:Z).focus();return}if(B.key!=="ArrowDown"&&B.key!=="ArrowUp")return;const P=E();if(P.length===0)return;B.preventDefault();const H=P.findIndex(Z=>Z===document.activeElement),j=ize(H,B.key==="ArrowDown"?1:-1,P.length);P[j]?.focus()}function R(B,P){i("action",{action:B,quote:n.quote,comment:P})}async function q(){c.value="comment",await x(),h.value?.focus()}function z(){const B=d.value.trim();if(B.length===0){h.value?.focus();return}R("comment",B)}function O(B){B.key==="Enter"&&!u(B)&&(B.preventDefault(),z())}return(B,P)=>(k(),de(cs,{to:"body"},[e.visible?(k(),de(p(zs),{key:0,ref_key:"menuRef",ref:f,class:"sab",style:on(g.value),role:c.value==="menu"?"menu":"dialog","aria-label":c.value==="comment"?p(o)("selection.comment"):void 0,onKeydown:M},{default:ce(()=>[c.value==="menu"?(k(),L(De,{key:0},[U(p(nn),{size:p(r)?"lg":"md",onClick:q},{default:ce(()=>[U(p(Ce),{name:"message",size:"sm"}),$e(" "+F(p(o)("selection.comment")),1)]),_:1},8,["size"]),U(p(nn),{size:p(r)?"lg":"md",onClick:P[0]||(P[0]=H=>R("quote"))},{default:ce(()=>[U(p(Ce),{name:"plus",size:"sm"}),$e(" "+F(p(o)("selection.addToChat")),1)]),_:1},8,["size"])],64)):(k(),L("div",{key:1,ref_key:"commentRowRef",ref:m,class:"sab-comment"},[U(p(_s),{ref_key:"inputRef",ref:h,modelValue:d.value,"onUpdate:modelValue":P[1]||(P[1]=H=>d.value=H),size:"sm",placeholder:p(o)("selection.commentPlaceholder"),onKeydown:O,onCompositionstart:p(l),onCompositionend:p(a)},null,8,["modelValue","placeholder","onCompositionstart","onCompositionend"]),U(p(sn),{size:"sm",disabled:d.value.trim().length===0,onClick:z},{default:ce(()=>[$e(F(p(o)("selection.confirm")),1)]),_:1},8,["disabled"])],512))]),_:1},8,["style","role","aria-label"])):ee("",!0)]))}}),AZ=xt(KYe,[["__scopeId","data-v-73604c69"]]),ZYe={key:0,class:"chat-loading"},GYe={class:"chat-loading-text"},QYe={key:1,class:"chat-empty"},YYe={key:1,class:"top-sentinel-text"},JYe={key:0,class:"u-turn"},XYe=["data-turn-id"],eJe={key:0,class:"u-atts"},tJe=["data-attachment-id","data-attachment-kind","data-attachment-name","data-attachment-url","data-attachment-file-id","data-attachment-media-type","data-attachment-size","data-attachment-session-id","aria-label"],nJe=["innerHTML"],iJe={class:"attachment-pill-name"},oJe=["data-attachment-id","data-attachment-kind","data-attachment-name","data-attachment-file-id","data-attachment-media-type","data-attachment-size","data-attachment-session-id","aria-label"],sJe=["innerHTML"],rJe={class:"attachment-pill-name"},lJe={key:1,class:"u-atts"},aJe=["data-attachment-id","data-attachment-name","data-attachment-url","data-attachment-file-id","data-attachment-media-type","data-attachment-size","aria-label"],uJe=["innerHTML"],cJe={class:"attachment-pill-name"},dJe=["data-attachment-id","data-attachment-name","data-attachment-file-id","data-attachment-media-type","data-attachment-size","aria-label"],fJe=["innerHTML"],hJe={class:"attachment-pill-name"},pJe={key:2,class:"skill-act"},mJe={class:"skill-act-head"},gJe=["aria-expanded","onClick"],vJe={key:0,class:"u-meta"},yJe=["aria-label","onClick"],kJe={class:"u-edit-hint"},bJe=["aria-label","onClick"],wJe=["aria-label","onClick"],CJe=["data-turn-id"],AJe=["onClick"],xJe={class:"cd-view"},SJe={key:1,class:"cd-label"},_Je=["data-turn-id"],MJe={key:0,class:"goal-prov"},IJe={key:1,class:"msg"},TJe={key:3,class:"a-msg-ft"},EJe={key:0,class:"a-time"},LJe=["aria-label","onClick"],NJe={key:4,class:"compact-divider",role:"separator"},DJe={class:"cd-label",role:"status"},FJe={key:3,class:"turn-failed",role:"alert"},BJe={class:"tf-chip","aria-hidden":"true"},RJe={class:"tf-main"},$Je={class:"tf-title"},OJe=["title"],PJe=["title"],zJe={key:5,class:"sending-placeholder"},jJe={key:6,class:"q-stack"},HJe={class:"q-head"},WJe={class:"q-title"},qJe=["onDragover","onDrop"],UJe=["aria-label","onClick"],VJe={class:"u-bub q-bub"},KJe=["title","onDragstart"],ZJe=["title","onClick"],GJe={key:0,class:"u-text q-text"},QJe={key:1,class:"q-text q-text-placeholder"},YJe=["aria-expanded","onClick"],JJe={key:0,class:"q-imgs"},XJe={key:0,class:"q-file"},eXe=["aria-label","onClick"],tXe=["aria-label","onClick"],nXe=250,iXe=2500,oXe=10,sXe=3,rXe=lt({__name:"ChatPane",props:{turns:{},cwd:{},turnFilesInteractive:{type:Boolean,default:!0},approvals:{default:()=>[]},questions:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},selectionActions:{type:Boolean,default:!0},inspector:{type:Boolean,default:!1},queued:{default:()=>[]},undoHintTurnId:{default:null},interruptedTurnId:{default:null},turnFailed:{type:Boolean,default:!1},turnError:{default:null},turnRetry:{default:null}},emits:["openMedia","detach","copyConversationCopied","editMessage","armedUndo","loadOlderMessages","unqueue","editQueued","reorderQueue","steerQueued","resumeTurn","quoteAction"],setup(e,{expose:t,emit:n}){const{t:i}=qt(),{confirm:o}=cf(),{turnFolding:s}=Vx();Ln(()=>{Ee!==null&&(clearTimeout(Ee),Ee=null),we!==null&&(clearTimeout(we),we=null),K!==null&&(clearTimeout(K),K=null)});const r=e,l=V(null);let a=null;function u(){!l.value||typeof IntersectionObserver>"u"||(a?.disconnect(),a=new IntersectionObserver(ot=>{ot[0]?.isIntersecting&&r.hasMoreMessages&&!r.loadingMore&&!r.loadingMoreError&&!r.sessionLoading&&!r.isFollowing&&b("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),a.observe(l.value))}yn(u),Ln(()=>{a?.disconnect(),a=null});const c=V(null);let d=null;yn(()=>{d=_V(()=>c.value)}),Ln(()=>{d?.(),d=null}),We(()=>[r.hasMoreMessages,r.loadingMore,r.loadingMoreError],()=>{ht().then(u)});const f=D(()=>{if(!r.turnActive||r.turns.length===0)return null;const ot=r.turns.at(-1);return ot.role==="assistant"?ot.id:null}),h=D(()=>{const ot=new Map;if(r.inspector)return ot;for(const Ue of r.turns){if(Ue.role!=="assistant"||Ue.id===f.value)continue;const st=NZ(Ue);st.length>0&&ot.set(Ue.id,st)}return ot}),m=D(()=>r.working),g=D(()=>{const ot=r.turnRetry;if(ot!=null)return i("conversation.workingRetry",{n:ot.nextAttempt,max:ot.maxAttempts});const Ue=r.turns.at(-1),st=Ue?.role==="assistant"&&(Ue.text.trim().length>0||(Ue.thinking?.trim().length??0)>0||(Ue.tools?.length??0)>0);return i(st?"conversation.working":"conversation.requesting")}),v=D(()=>r.turnError?.code==="loop.max_steps_exceeded"?i("conversation.turnFailedMaxSteps"):i("conversation.turnFailed")),y=D(()=>{const ot=r.turnError;if(!ot)return"";const Ue=[];return ot.code!==void 0&&ot.code.length>0&&Ue.push(ot.code),ot.statusCode!==void 0&&Ue.push(`HTTP ${ot.statusCode}`),ot.requestId!==void 0&&ot.requestId.length>0&&Ue.push(ot.requestId),Ue.join(" · ")}),b=n,w=Jt(qo),C=ot=>b("openMedia",ot),T=ot=>b("detach",ot),N=V(null),I=V(!1),S=D(()=>r.selectionActions&&JPe);function _(ot){}function x(ot){I.value=!1,(ot.clientX||ot.clientY)&&(ot.clientX,ot.clientY)}function E(){I.value=!1}function M(ot){ot.key!=="Escape"&&(I.value=!0)}let R=null;function q(){R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null;const ot=document.activeElement;if(ot instanceof Element&&ot.closest(".sab"))return;const Ue=window.getSelection();if(Ue&&!Ue.isCollapsed&&!lK(Ue,c.value)){N.value=null;return}},nXe)}yn(()=>{S.value&&document.addEventListener("selectionchange",q)}),Ln(()=>{document.removeEventListener("selectionchange",q),R!==null&&(clearTimeout(R),R=null)});function z(){N.value=null,R!==null&&(clearTimeout(R),R=null)}function O(ot){N.value=null,window.getSelection()?.removeAllRanges(),b("quoteAction",ot)}const B=V(null),P=V(null);function H(ot){return j(ot).length>0}function j(ot){const Ue=ot.attachments??[],st=ll(ot.text);if(st.length===0)return Ue;const _n=new Set,bt=new Set;for(const go of st)D1(go.attrs.attId,Ue)!==void 0&&(/^[1-9]\d*$/.test(go.attrs.attId)?_n.add(Number(go.attrs.attId)):/^m[1-9]\d*$/.test(go.attrs.attId)&&bt.add(Number(go.attrs.attId.slice(1))));if(_n.size===0&&bt.size===0)return Ue;let Zn=0,vs=0;return Ue.filter(go=>go.kind==="file"?(Zn+=1,!_n.has(Zn)):go.kind==="image"||go.kind==="video"?(vs+=1,!bt.has(vs)):!0)}function Z(ot){b("editQueued",ot)}function ie(ot){typeof window<"u"&&window.matchMedia("(hover: none)").matches||Z(ot)}function W(ot,Ue){if(B.value=ot,!Ue.dataTransfer)return;Ue.dataTransfer.effectAllowed="move",Ue.dataTransfer.setData("text/plain",String(ot));const st=Ue.currentTarget?.closest(".q-turn");st&&Ue.dataTransfer.setDragImage(st,24,24)}function Q(ot,Ue){if(B.value===null)return;Ue.preventDefault(),Ue.dataTransfer&&(Ue.dataTransfer.dropEffect="move");const st=Ue.currentTarget.getBoundingClientRect(),_n=Ue.clientYAAe(r.turns));function ue(ot){return!r.readOnly&&ot.role==="user"&&ge.value.has(ot.id)&&!r.working&&!ot.pluginCommand&&!(ot.skillActivation&&!vU(ot.skillActivation,{revivePill:!0}))}function se(ot){const Ue=ot.compaction,st=Ue?.trigger==="auto"?i("conversation.compactedAuto"):i("conversation.compactedPlain");return typeof Ue?.tokensBefore=="number"&&typeof Ue?.tokensAfter=="number"?st+i("conversation.compactedTokens",{before:Ac(Ue.tokensBefore),after:Ac(Ue.tokensAfter)}):st}const fe=V(null);function G(ot){const Ue=ot.createdAt===void 0?NaN:Date.parse(ot.createdAt),st=ot.endedAt??(Number.isFinite(Ue)&&ot.durationMs!==void 0?new Date(Ue+ot.durationMs).toISOString():ot.createdAt);return st===void 0?"":qO(st,i("conversation.yesterday"))}const ae=V(null);let K=null;async function re(ot){await o({title:i("conversation.undo"),message:i("conversation.undoConfirm"),variant:"primary"})&&be(ot)}function be(ot){if(ae.value!==null)return;const Ue=ge.value.get(ot.id);if(Ue===void 0)return;ae.value=ot.id;const st=ot.skillActivation?wx(ot.skillActivation,{revivePill:!0})??ot.text:ot.text;b("editMessage",{text:st,attachments:oK(ot),undoCount:Ue}),K=setTimeout(()=>{K=null,ae.value=null},iXe)}We(()=>r.turns,ot=>{ae.value!==null&&(ot.some(Ue=>Ue.id===ae.value)||(ae.value=null,K!==null&&(clearTimeout(K),K=null)))},{flush:"post"});const ke=V(!1);let we=null;function oe(){if(r.turns.length===0)return;const ot=[];for(const st of r.turns){if(st.role==="compaction"||st.role==="cron")continue;const _n=st.role==="user"?"User":"Assistant",bt=Cst(st);bt.trim()&&ot.push(`**${_n}** + */function Rl(e,t,n){const i=document.createElement(t);return e&&(i.className=e),n&&n.appendChild(i),i}function is(e,t){return e.x=t.x,e.y=t.y,t.id!==void 0&&(e.id=t.id),e}function fZ(e){e.x=Math.round(e.x),e.y=Math.round(e.y)}function VA(e,t){const n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return Math.sqrt(n*n+i*i)}function u0(e,t){return e.x===t.x&&e.y===t.y}function $v(e,t,n){return Math.min(Math.max(e,t),n)}function sv(e,t,n){let i=`translate3d(${e}px,${t||0}px,0)`;return n!==void 0&&(i+=` scale3d(${n},${n},1)`),i}function lh(e,t,n,i){e.style.transform=sv(t,n,i)}const _Qe="cubic-bezier(.4,0,.22,1)";function hZ(e,t,n,i){e.style.transition=t?`${t} ${n}ms ${i||_Qe}`:"none"}function KA(e,t,n){e.style.width=typeof t=="number"?`${t}px`:t,e.style.height=typeof n=="number"?`${n}px`:n}function MQe(e){hZ(e)}function IQe(e){return"decode"in e?e.decode().catch(()=>{}):e.complete?Promise.resolve(e):new Promise((t,n)=>{e.onload=()=>t(e),e.onerror=n})}const sa={IDLE:"idle",LOADING:"loading",LOADED:"loaded",ERROR:"error"};function TQe(e){return"button"in e&&e.button===1||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey}function EQe(e,t,n=document){let i=[];if(e instanceof Element)i=[e];else if(e instanceof NodeList||Array.isArray(e))i=Array.from(e);else{const o=typeof e=="string"?e:t;o&&(i=Array.from(n.querySelectorAll(o)))}return i}function zB(){return!!(navigator.vendor&&navigator.vendor.match(/apple/i))}let pZ=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{pZ=!0}}))}catch{}class LQe{constructor(){this._pool=[]}add(t,n,i,o){this._toggleListener(t,n,i,o)}remove(t,n,i,o){this._toggleListener(t,n,i,o,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,n,i,o,s,r){if(!t)return;const l=s?"removeEventListener":"addEventListener";n.split(" ").forEach(u=>{if(u){r||(s?this._pool=this._pool.filter(d=>d.type!==u||d.listener!==i||d.target!==t):this._pool.push({target:t,type:u,listener:i,passive:o}));const c=pZ?{passive:o||!1}:!1;t[l](u,i,c)}})}}function mZ(e,t){if(e.getViewportSizeFn){const n=e.getViewportSizeFn(e,t);if(n)return n}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function xg(e,t,n,i,o){let s=0;if(t.paddingFn)s=t.paddingFn(n,i,o)[e];else if(t.padding)s=t.padding[e];else{const r="padding"+e[0].toUpperCase()+e.slice(1);t[r]&&(s=t[r])}return Number(s)||0}function gZ(e,t,n,i){return{x:t.x-xg("left",e,t,n,i)-xg("right",e,t,n,i),y:t.y-xg("top",e,t,n,i)-xg("bottom",e,t,n,i)}}class NQe{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:n}=this.slide,i=this.slide[t==="x"?"width":"height"]*this.currZoomLevel,s=xg(t==="x"?"left":"top",n.options,n.viewportSize,this.slide.data,this.slide.index),r=this.slide.panAreaSize[t];this.center[t]=Math.round((r-i)/2)+s,this.max[t]=i>r?Math.round(r-i)+s:this.center[t],this.min[t]=i>r?s:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,n){return $v(n,this.max[t],this.min[t])}}const jB=4e3;class vZ{constructor(t,n,i,o){this.pswp=o,this.options=t,this.itemData=n,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,n,i){const o={x:t,y:n};this.elementSize=o,this.panAreaSize=i;const s=i.x/o.x,r=i.y/o.y;this.fit=Math.min(1,sr?s:r),this.vFill=Math.min(1,r),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const n=t+"ZoomLevel",i=this.options[n];if(i)return typeof i=="function"?i(this):i==="fill"?this.fill:i==="fit"?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,this.fit*3),this.elementSize&&t*this.elementSize.x>jB&&(t=jB/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,this.fit*4)}}class DQe{constructor(t,n,i){this.data=t,this.index=n,this.pswp=i,this.isActive=n===i.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!i.opener.isOpen,this.zoomLevels=new vZ(i.options,t,n,i),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:n}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=Rl("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new NQe(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||!this.isActive&&!1||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel===this.zoomLevels.initial||!this.isActive?(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize()):(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y))}updateContentSize(t){const n=this.currentResolution||this.zoomLevels.initial;if(!n)return;const i=Math.round(this.width*n)||this.pswp.viewportSize.x,o=Math.round(this.height*n)||this.pswp.viewportSize.y;!this.sizeChanged(i,o)&&!t||this.content.setDisplayedSize(i,o)}sizeChanged(t,n){return t!==this.prevDisplayedWidth||n!==this.prevDisplayedHeight?(this.prevDisplayedWidth=t,this.prevDisplayedHeight=n,!0):!1}getPlaceholderElement(){var t;return(t=this.content.placeholder)===null||t===void 0?void 0:t.element}zoomTo(t,n,i,o){const{pswp:s}=this;if(!this.isZoomable()||s.mainScroll.isShifted())return;s.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:n,transitionDuration:i}),s.animations.stopAllPan();const r=this.currZoomLevel;o||(t=$v(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",n,r),this.pan.y=this.calculateZoomToPanOffset("y",n,r),fZ(this.pan);const l=()=>{this._setResolution(t),this.applyCurrentZoomPan()};i?s.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:l,duration:i,easing:s.options.easing}):l()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,n,i){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];n||(n=this.pswp.getViewportCenterPoint()),i||(i=this.zoomLevels.initial);const s=this.currZoomLevel/i;return this.bounds.correctPan(t,(this.pan[t]-n[t])*s+n[t])}panTo(t,n){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",n),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),is(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,n,i){i/=this.currentResolution||this.zoomLevels.initial,lh(this.container,t,n,i)}calculateSize(){const{pswp:t}=this;is(this.panAreaSize,gZ(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return sv(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}const FQe=.35,BQe=.6,HB=.4,WB=.5;function RQe(e,t){return e*t/(1-t)}class OQe{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&is(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:n,dragAxis:i}=this.gestures,{currSlide:o}=this.pswp;if(i==="y"&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const s=o.pan.y+(t.y-n.y);if(!this.pswp.dispatch("verticalDrag",{panY:s}).defaultPrevented){this._setPanWithFriction("y",s,BQe);const r=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(r),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(fZ(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:n,currSlide:i}=this.pswp;let o=0;if(this.pswp.animations.stopAll(),n.isShifted()){const r=(n.x-n.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-WB&&r<0||t.x<.1&&r<-.5?(o=1,t.x=Math.min(t.x,0)):(t.x>WB&&r>0||t.x>-.1&&r>.5)&&(o=-1,t.x=Math.max(t.x,0)),n.moveIndexBy(o,!0,t.x)}i&&i.currZoomLevel>i.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:n}=this.gestures,{currSlide:i}=this.pswp;if(!i)return;const{pan:o,bounds:s}=i,r=o[t],l=this.pswp.bgOpacity<1&&t==="y",u=r+RQe(n[t],.995);if(l){const m=this._getVerticalDragRatio(r),g=this._getVerticalDragRatio(u);if(m<0&&g<-HB||m>0&&g>HB){this.pswp.close();return}}const c=s.correctPan(t,u);if(r===c)return;const d=c===u?1:.82,f=this.pswp.bgOpacity,h=c-r;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:r,end:c,velocity:n[t],dampingRatio:d,onUpdate:m=>{if(l&&this.pswp.bgOpacity<1){const g=1-(c-m)/h;this.pswp.applyBgOpacity($v(f+(1-f)*g,0,1))}o[t]=Math.floor(m),i.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:n,dragAxis:i,prevP1:o,isMultitouch:s}=this.gestures,{currSlide:r,mainScroll:l}=this.pswp,a=n[t]-o[t],u=l.x+a;if(!a||!r)return!1;if(t==="x"&&!r.isPannable()&&!s)return l.moveTo(u,!0),!0;const{bounds:c}=r,d=r.pan[t]+a;if(this.pswp.options.allowPanToNext&&i==="x"&&t==="x"&&!s){const f=l.getCurrSlideX(),h=l.x-f,m=a>0,g=!m;if(d>c.min[t]&&m){if(c.min[t]<=this.startPan[t])return l.moveTo(u,!0),!0;this._setPanWithFriction(t,d)}else if(d0)return l.moveTo(Math.max(u,f),!0),!0;if(h<0)return l.moveTo(Math.min(u,f),!0),!0}else this._setPanWithFriction(t,d)}else t==="y"?!l.isShifted()&&c.min.y!==c.max.y&&this._setPanWithFriction(t,d):this._setPanWithFriction(t,d);return!1}_getVerticalDragRatio(t){var n,i;return(t-((n=(i=this.pswp.currSlide)===null||i===void 0?void 0:i.bounds.center.y)!==null&&n!==void 0?n:0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,n,i){const{currSlide:o}=this.pswp;if(!o)return;const{pan:s,bounds:r}=o;if(r.correctPan(t,n)!==n||i){const a=Math.round(n-s[t]);s[t]+=a*(i||FQe)}else s[t]=n}}const $Qe=.05,PQe=.15;function qB(e,t,n){return e.x=(t.x+n.x)/2,e.y=(t.y+n.y)/2,e}class zQe{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,is(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:n,p2:i,startP2:o,pswp:s}=this.gestures,{currSlide:r}=s;if(!r)return;const l=r.zoomLevels.min,a=r.zoomLevels.max;if(!r.isZoomable()||s.mainScroll.isShifted())return;qB(this._startZoomPoint,n,o),qB(this._zoomPoint,t,i);let u=1/VA(n,o)*VA(t,i)*this._startZoomLevel;if(u>r.zoomLevels.initial+r.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),ua&&(u=a+(u-a)*$Qe);r.pan.x=this._calculatePanForZoomLevel("x",u),r.pan.y=this._calculatePanForZoomLevel("y",u),r.setZoomLevel(u),r.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:n}=t;(!n||n.currZoomLeveli.zoomLevels.max?s=i.zoomLevels.max:(r=!1,s=o);const l=n.bgOpacity,a=n.bgOpacity<1,u=is({x:0,y:0},i.pan);let c=is({x:0,y:0},u);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=o,is(this._startPan,u)),r&&(c={x:this._calculatePanForZoomLevel("x",s),y:this._calculatePanForZoomLevel("y",s)}),i.setZoomLevel(s),c={x:i.bounds.correctPan("x",c.x),y:i.bounds.correctPan("y",c.y)},i.setZoomLevel(o);const d=!u0(c,u);if(!d&&!r&&!a){i._setResolution(s),i.applyCurrentZoomPan();return}n.animations.stopAllPan(),n.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:f=>{if(f/=1e3,d||r){if(d&&(i.pan.x=u.x+(c.x-u.x)*f,i.pan.y=u.y+(c.y-u.y)*f),r){const h=o+(s-o)*f;i.setZoomLevel(h)}i.applyCurrentZoomPan()}a&&n.bgOpacity<1&&n.applyBgOpacity($v(l+(1-l)*f,0,1))},onComplete:()=>{i._setResolution(s),i.applyCurrentZoomPan()}})}}function UB(e){return!!e.target.closest(".pswp__container")}class jQe{constructor(t){this.gestures=t}click(t,n){const i=n.target.classList,o=i.contains("pswp__img"),s=i.contains("pswp__item")||i.contains("pswp__zoom-wrap");o?this._doClickOrTapAction("imageClick",t,n):s&&this._doClickOrTapAction("bgClick",t,n)}tap(t,n){UB(n)&&this._doClickOrTapAction("tap",t,n)}doubleTap(t,n){UB(n)&&this._doClickOrTapAction("doubleTap",t,n)}_doClickOrTapAction(t,n,i){var o;const{pswp:s}=this.gestures,{currSlide:r}=s,l=t+"Action",a=s.options[l];if(!s.dispatch(l,{point:n,originalEvent:i}).defaultPrevented){if(typeof a=="function"){a.call(s,n,i);return}switch(a){case"close":case"next":s[a]();break;case"zoom":r?.toggleZoom(n);break;case"zoom-or-close":r!=null&&r.isZoomable()&&r.zoomLevels.secondary!==r.zoomLevels.initial?r.toggleZoom(n):s.options.clickToCloseNonZoomable&&s.close();break;case"toggle-controls":(o=this.gestures.pswp.element)===null||o===void 0||o.classList.toggle("pswp--ui-visible");break}}}}const HQe=10,WQe=300,qQe=25;class UQe{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new OQe(this),this.zoomLevels=new zQe(this),this.tapHandler=new jQe(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,n,i,o){const{pswp:s}=this,{events:r}=s,l=o?t+o:"";r.add(s.scrollWrap,t+n,this.onPointerDown.bind(this)),r.add(window,t+"move",this.onPointerMove.bind(this)),r.add(window,t+i,this.onPointerUp.bind(this)),l&&r.add(s.scrollWrap,l,this.onPointerUp.bind(this))}onPointerDown(t){const n=t.type==="mousedown"||t.pointerType==="mouse";if(n&&t.button>0)return;const{pswp:i}=this;if(!i.opener.isOpen){t.preventDefault();return}i.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(n&&(i.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),i.animations.stopAll(),this._updatePoints(t,"down"),this._numActivePoints===1&&(this.dragAxis=null,is(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1)}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===1&&!this.isDragging?(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,is(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop())):this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop())))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===0&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),this._numActivePoints===1&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?u0(this.p1,this.prevP1)||this.drag.change():(!u0(this.p1,this.prevP1)||!u0(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const n=Date.now(),i=n-this._intervalTime;i<50&&!t||(this.velocity.x=this._getVelocity("x",i),this.velocity.y=this._getVelocity("y",i),this._intervalTime=n,is(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:n}=this.pswp;if(n.isShifted()){n.moveIndexBy(0,!0);return}if(t.type.indexOf("cancel")>0)return;if(t.type==="mouseup"||t.pointerType==="mouse"){this.tapHandler.click(this.startP1,t);return}const i=this.pswp.options.doubleTapAction?WQe:0;this._tapTimer?(this._clearTapTimer(),VA(this._lastStartP1,this.startP1){this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},i))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,n){const i=this.p1[t]-this._intervalP1[t];return Math.abs(i)>1&&n>5?i/n:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,n){this.pswp.applyFilters("preventPointerEvent",!0,t,n)&&t.preventDefault()}_updatePoints(t,n){if(this._pointerEventEnabled){const i=t,o=this._ongoingPointers.findIndex(s=>s.id===i.pointerId);n==="up"&&o>-1?this._ongoingPointers.splice(o,1):n==="down"&&o===-1?this._ongoingPointers.push(this._convertEventPosToPoint(i,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(i,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&is(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&is(this.p2,this._ongoingPointers[1])}else{const i=t;this._numActivePoints=0,i.type.indexOf("touch")>-1?i.touches&&i.touches.length>0&&(this._convertEventPosToPoint(i.touches[0],this.p1),this._numActivePoints++,i.touches.length>1&&(this._convertEventPosToPoint(i.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),n==="up"?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){is(this.prevP1,this.p1),is(this.prevP2,this.p2)}_updateStartPoints(){is(this.startP1,this.p1),is(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(t!==0){const n=t>0?"x":"y";Math.abs(this.p1[n]-this.startP1[n])>=HQe&&(this.dragAxis=n)}}}_convertEventPosToPoint(t,n){return n.x=t.pageX-this.pswp.offset.x,n.y=t.pageY-this.pswp.offset.y,"pointerId"in t?n.id=t.pointerId:t.identifier!==void 0&&(n.id=t.identifier),n}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const VQe=.35;class KQe{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:n}=this,i=Math.round(n.viewportSize.x+n.viewportSize.x*n.options.spacing),o=i!==this.slideWidth;o&&(this.slideWidth=i,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((s,r)=>{o&&lh(s.el,(r+this._containerShiftIndex)*this.slideWidth),t&&s.slide&&s.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const n=Rl("pswp__item","div",this.pswp.container);n.setAttribute("role","group"),n.setAttribute("aria-roledescription","slide"),n.setAttribute("aria-hidden","true"),n.style.display=t===1?"block":"none",this.itemHolders.push({el:n})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,n,i){const{pswp:o}=this;let s=o.potentialIndex+t;const r=o.getNumItems();if(o.canLoop()){s=o.getLoopedIndex(s);const a=(t+r)%r;a<=r/2?t=a:t=a-r}else s<0?s=0:s>=r&&(s=r-1),t=s-o.potentialIndex;o.potentialIndex=s,this._currPositionIndex-=t,o.animations.stopMainScroll();const l=this.getCurrSlideX();if(!n)this.moveTo(l),this.updateCurrItem();else{o.animations.startSpring({isMainScroll:!0,start:this.x,end:l,velocity:i||0,naturalFrequency:30,dampingRatio:1,onUpdate:u=>{this.moveTo(u)},onComplete:()=>{this.updateCurrItem(),o.appendHeavy()}});let a=o.potentialIndex-o.currIndex;if(o.canLoop()){const u=(a+r)%r;u<=r/2?a=u:a=u-r}Math.abs(a)>1&&this.updateCurrItem()}return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){var t;const{pswp:n}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,n.currIndex=n.potentialIndex;let o=Math.abs(i),s;o>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),o=3,this.itemHolders.forEach(r=>{var l;(l=r.slide)===null||l===void 0||l.destroy(),r.slide=void 0}));for(let r=0;r0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,lh(s.el,(this._containerShiftIndex+2)*this.slideWidth),n.setContent(s,n.currIndex-o+r+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,lh(s.el,this._containerShiftIndex*this.slideWidth),n.setContent(s,n.currIndex+o-r-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),n.animations.stopAllPan(),this.itemHolders.forEach((r,l)=>{r.slide&&r.slide.setIsActive(l===1)}),n.currSlide=(t=this.itemHolders[1])===null||t===void 0?void 0:t.slide,n.contentLoader.updateLazy(i),n.currSlide&&n.currSlide.applyCurrentZoomPan(),n.dispatch("change")}moveTo(t,n){if(!this.pswp.canLoop()&&n){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const o=Math.round(t-this.x);(i<0&&o>0||i>=this.pswp.getNumItems()-1&&o<0)&&(t=this.x+o*VQe)}this.x=t,this.pswp.container&&lh(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:n??!1})}}const ZQe={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},Bf=(e,t)=>t?e:ZQe[e];class GQe{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const n=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&n&&this._wasFocused&&n.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:n}=this;if(n.dispatch("keydown",{originalEvent:t}).defaultPrevented||TQe(t))return;let i,o,s=!1;const r="key"in t;switch(r?t.key:t.keyCode){case Bf("Escape",r):n.options.escKey&&(i="close");break;case Bf("z",r):i="toggleZoom";break;case Bf("ArrowLeft",r):o="x";break;case Bf("ArrowUp",r):o="y";break;case Bf("ArrowRight",r):o="x",s=!0;break;case Bf("ArrowDown",r):s=!0,o="y";break;case Bf("Tab",r):this._focusRoot();break}if(o){t.preventDefault();const{currSlide:l}=n;n.options.arrowKeys&&o==="x"&&n.getNumItems()>1?i=s?"next":"prev":l&&l.currZoomLevel>l.zoomLevels.fit&&(l.pan[o]+=s?-80:80,l.panTo(l.pan.x,l.pan.y))}i&&(t.preventDefault(),n[i]())}_onFocusIn(t){const{template:n}=this.pswp;n&&document!==t.target&&n!==t.target&&!n.contains(t.target)&&n.focus()}}const QQe="cubic-bezier(.4,0,.22,1)";class YQe{constructor(t){var n;this.props=t;const{target:i,onComplete:o,transform:s,onFinish:r=()=>{},duration:l=333,easing:a=QQe}=t;this.onFinish=r;const u=s?"transform":"opacity",c=(n=t[u])!==null&&n!==void 0?n:"";this._target=i,this._onComplete=o,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{hZ(i,u,l,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},l+500),i.style[u]=c},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&clearTimeout(this._helperTimeout),MQe(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}const JQe=12,XQe=.75;class eYe{constructor(t,n,i){this.velocity=t*1e3,this._dampingRatio=n||XQe,this._naturalFrequency=i||JQe,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,n){let i=0,o;n/=1e3;const s=Math.E**(-this._dampingRatio*this._naturalFrequency*n);if(this._dampingRatio===1)o=this.velocity+this._naturalFrequency*t,i=(t+o*n)*s,this.velocity=i*-this._naturalFrequency+o*s;else if(this._dampingRatio<1){o=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const r=Math.cos(this._dampedFrequency*n),l=Math.sin(this._dampedFrequency*n);i=s*(t*r+o*l),this.velocity=i*-this._naturalFrequency*this._dampingRatio+s*(-this._dampedFrequency*t*l+this._dampedFrequency*o*r)}return i}}class tYe{constructor(t){this.props=t,this._raf=0;const{start:n,end:i,velocity:o,onUpdate:s,onComplete:r,onFinish:l=()=>{},dampingRatio:a,naturalFrequency:u}=t;this.onFinish=l;const c=new eYe(o,a,u);let d=Date.now(),f=n-i;const h=()=>{this._raf&&(f=c.easeFrame(f,Date.now()-d),Math.abs(f)<1&&Math.abs(c.velocity)<50?(s(i),r&&r(),this.onFinish()):(d=Date.now(),s(f+i),this._raf=requestAnimationFrame(h)))};this._raf=requestAnimationFrame(h)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class nYe{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,n){const i=n?new tYe(t):new YQe(t);return this.activeAnimations.push(i),i.onFinish=()=>this.stop(i),i}stop(t){t.destroy();const n=this.activeAnimations.indexOf(t);n>-1&&this.activeAnimations.splice(n,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isPan?(t.destroy(),!1):!0)}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isMainScroll?(t.destroy(),!1):!0)}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}class iYe{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:n}=this.pswp;let{deltaX:i,deltaY:o}=t;if(n&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(n.isZoomable()){let s=-o;t.deltaMode===1?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const r=n.currZoomLevel*s;n.zoomTo(r,{x:t.clientX,y:t.clientY})}}else n.isPannable()&&(t.deltaMode===1&&(i*=18,o*=18),n.panTo(n.pan.x-i,n.pan.y-o))}}function oYe(e){if(typeof e=="string")return e;if(!e||!e.isCustomSVG)return"";const t=e;let n='",n}class sYe{constructor(t,n){var i;const o=n.name||n.className;let s=n.html;if(t.options[o]===!1)return;typeof t.options[o+"SVG"]=="string"&&(s=t.options[o+"SVG"]),t.dispatch("uiElementCreate",{data:n});let r="";n.isButton?(r+="pswp__button ",r+=n.className||`pswp__button--${n.name}`):r+=n.className||`pswp__${n.name}`;let l=n.isButton?n.tagName||"button":n.tagName||"div";l=l.toLowerCase();const a=Rl(r,l);if(n.isButton){l==="button"&&(a.type="button");let{title:d}=n;const{ariaLabel:f}=n;typeof t.options[o+"Title"]=="string"&&(d=t.options[o+"Title"]),d&&(a.title=d);const h=f||d;h&&a.setAttribute("aria-label",h)}a.innerHTML=oYe(s),n.onInit&&n.onInit(a,t),n.onClick&&(a.onclick=d=>{typeof n.onClick=="string"?t[n.onClick]():typeof n.onClick=="function"&&n.onClick(d,a,t)});const u=n.appendTo||"bar";let c=t.element;u==="bar"?(t.topBar||(t.topBar=Rl("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),c=t.topBar):(a.classList.add("pswp__hide-on-close"),u==="wrapper"&&(c=t.scrollWrap)),(i=c)===null||i===void 0||i.appendChild(t.applyFilters("uiElement",a,n))}}function yZ(e,t,n){e.classList.add("pswp__button--arrow"),e.setAttribute("aria-controls","pswp__items"),t.on("change",()=>{t.options.loop||(n?e.disabled=!(t.currIndex0))})}const rYe={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:yZ},lYe={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(e,t)=>{yZ(e,t,!0)}},aYe={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'',outlineID:"pswp__icn-close"},onClick:"close"},uYe={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},cYe={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'',outlineID:"pswp__icn-loading"},onInit:(e,t)=>{let n,i=null;const o=(l,a)=>{e.classList.toggle("pswp__preloader--"+l,a)},s=l=>{n!==l&&(n=l,o("active",l))},r=()=>{var l;if(!((l=t.currSlide)!==null&&l!==void 0&&l.content.isLoading())){s(!1),i&&(clearTimeout(i),i=null);return}i||(i=setTimeout(()=>{var a;s(!!(!((a=t.currSlide)===null||a===void 0)&&a.content.isLoading())),i=null},t.options.preloaderDelay))};t.on("change",r),t.on("loadComplete",l=>{t.currSlide===l.slide&&r()}),t.ui&&(t.ui.updatePreloaderVisibility=r)}},dYe={name:"counter",order:5,onInit:(e,t)=>{t.on("change",()=>{e.innerText=t.currIndex+1+t.options.indexIndicatorSep+t.getNumItems()})}};function VB(e,t){e.classList.toggle("pswp--zoomed-in",t)}class fYe{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[aYe,rYe,lYe,uYe,cYe,dYe],t.dispatch("uiRegister"),this.uiElementsData.sort((n,i)=>(n.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(n=>{this.registerElement(n)}),t.on("change",()=>{var n;(n=t.element)===null||n===void 0||n.classList.toggle("pswp--one-slide",t.getNumItems()===1)}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new sYe(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:n,options:i}=this.pswp;if(this.pswp.opener.isClosing||!t||!n)return;let{currZoomLevel:o}=n;if(this.pswp.opener.isOpen||(o=n.zoomLevels.initial),o===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=o;const s=n.zoomLevels.initial-n.zoomLevels.secondary;if(Math.abs(s)<.01||!n.isZoomable()){VB(t,!1),t.classList.remove("pswp--zoom-allowed");return}t.classList.add("pswp--zoom-allowed");const r=o===n.zoomLevels.initial?n.zoomLevels.secondary:n.zoomLevels.initial;VB(t,r<=o),(i.imageClickAction==="zoom"||i.imageClickAction==="zoom-or-close")&&t.classList.add("pswp--click-to-zoom")}}function hYe(e){const t=e.getBoundingClientRect();return{x:t.left,y:t.top,w:t.width}}function pYe(e,t,n){const i=e.getBoundingClientRect(),o=i.width/t,s=i.height/n,r=o>s?o:s,l=(i.width-t*r)/2,a=(i.height-n*r)/2,u={x:i.left+l,y:i.top+a,w:t*r};return u.innerRect={w:i.width,h:i.height,x:l,y:a},u}function mYe(e,t,n){const i=n.dispatch("thumbBounds",{index:e,itemData:t,instance:n});if(i.thumbBounds)return i.thumbBounds;const{element:o}=t;let s,r;if(o&&n.options.thumbSelector!==!1){const l=n.options.thumbSelector||"img";r=o.matches(l)?o:o.querySelector(l)}return r=n.applyFilters("thumbEl",r,t,e),r&&(t.thumbCropped?s=pYe(r,t.width||t.w||0,t.height||t.h||0):s=hYe(r)),n.applyFilters("thumbBounds",s,t,e)}class gYe{constructor(t,n){this.type=t,this.defaultPrevented=!1,n&&Object.assign(this,n)}preventDefault(){this.defaultPrevented=!0}}class vYe{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,n,i=100){var o,s,r;this._filters[t]||(this._filters[t]=[]),(o=this._filters[t])===null||o===void 0||o.push({fn:n,priority:i}),(s=this._filters[t])===null||s===void 0||s.sort((l,a)=>l.priority-a.priority),(r=this.pswp)===null||r===void 0||r.addFilter(t,n,i)}removeFilter(t,n){this._filters[t]&&(this._filters[t]=this._filters[t].filter(i=>i.fn!==n)),this.pswp&&this.pswp.removeFilter(t,n)}applyFilters(t,...n){var i;return(i=this._filters[t])===null||i===void 0||i.forEach(o=>{n[0]=o.fn.apply(this,n)}),n[0]}on(t,n){var i,o;this._listeners[t]||(this._listeners[t]=[]),(i=this._listeners[t])===null||i===void 0||i.push(n),(o=this.pswp)===null||o===void 0||o.on(t,n)}off(t,n){var i;this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(o=>n!==o)),(i=this.pswp)===null||i===void 0||i.off(t,n)}dispatch(t,n){var i;if(this.pswp)return this.pswp.dispatch(t,n);const o=new gYe(t,n);return(i=this._listeners[t])===null||i===void 0||i.forEach(s=>{s.call(this,o)}),o}}class yYe{constructor(t,n){if(this.element=Rl("pswp__img pswp__img--placeholder",t?"img":"div",n),t){const i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,n){this.element&&(this.element.tagName==="IMG"?(KA(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=sv(0,0,t/250)):KA(this.element,t,n))}destroy(){var t;(t=this.element)!==null&&t!==void 0&&t.parentNode&&this.element.remove(),this.element=null}}class kYe{constructor(t,n,i){this.instance=n,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=sa.IDLE,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,n){if(this.slide&&this.usePlaceholder())if(this.placeholder){const i=this.placeholder.element;i&&!i.parentElement&&this.slide.container.prepend(i)}else{const i=this.instance.applyFilters("placeholderSrc",this.data.msrc&&this.slide.isFirstSlide?this.data.msrc:!1,this);this.placeholder=new yYe(i,this.slide.container)}this.element&&!n||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=Rl("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=Rl("pswp__content","div"),this.element.innerHTML=this.data.html||""),n&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var n,i;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const o=this.element;this.updateSrcsetSizes(),this.data.srcset&&(o.srcset=this.data.srcset),o.src=(n=this.data.src)!==null&&n!==void 0?n:"",o.alt=(i=this.data.alt)!==null&&i!==void 0?i:"",this.state=sa.LOADING,o.complete?this.onLoaded():(o.onload=()=>{this.onLoaded()},o.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=sa.LOADED,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),(this.state===sa.LOADED||this.state===sa.ERROR)&&this.removePlaceholder())}onError(){this.state=sa.ERROR,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===sa.LOADING,this)}isError(){return this.state===sa.ERROR}isImageContent(){return this.type==="image"}setDisplayedSize(t,n){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,n),!this.instance.dispatch("contentResize",{content:this,width:t,height:n}).defaultPrevented&&(KA(this.element,t,n),this.isImageContent()&&!this.isError()))){const i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=n,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:n,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==sa.ERROR,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,n=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||n>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=n+"px",t.dataset.largestUsedSize=String(n))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,!this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented&&(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var t,n;let i=Rl("pswp__error-msg","div");i.innerText=(t=(n=this.instance.options)===null||n===void 0?void 0:n.errorMsg)!==null&&t!==void 0?t:"",i=this.instance.applyFilters("contentErrorElement",i,this),this.element=Rl("pswp__content pswp__error-msg-container","div"),this.element.appendChild(i),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===sa.ERROR){this.displayError();return}if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||zB())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){this.instance.dispatch("contentActivate",{content:this}).defaultPrevented||!this.slide||(this.isImageContent()&&this.isDecoding&&!zB()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,!this.instance.dispatch("contentRemove",{content:this}).defaultPrevented&&(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),(this.state===sa.LOADED||this.state===sa.ERROR)&&this.removePlaceholder()))}}const bYe=5;function kZ(e,t,n){const i=t.createContentFromData(e,n);let o;const{options:s}=t;if(s){o=new vZ(s,e,-1);let r;t.pswp?r=t.pswp.viewportSize:r=mZ(s,t);const l=gZ(s,r,e,n);o.update(i.width,i.height,l)}return i.lazyLoad(),o&&i.setDisplayedSize(Math.ceil(i.width*o.initial),Math.ceil(i.height*o.initial)),i}function wYe(e,t){const n=t.getItemData(e);if(!t.dispatch("lazyLoadSlide",{index:e,itemData:n}).defaultPrevented)return kZ(n,t,e)}class CYe{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,bYe),this._cachedItems=[]}updateLazy(t){const{pswp:n}=this;if(n.dispatch("lazyLoad").defaultPrevented)return;const{preload:i}=n.options,o=t===void 0?!0:t>=0;let s;for(s=0;s<=i[1];s++)this.loadSlideByIndex(n.currIndex+(o?s:-s));for(s=1;s<=i[0];s++)this.loadSlideByIndex(n.currIndex+(o?-s:s))}loadSlideByIndex(t){const n=this.pswp.getLoopedIndex(t);let i=this.getContentByIndex(n);i||(i=wYe(n,this.pswp),i&&this.addToCache(i))}getContentBySlide(t){let n=this.getContentByIndex(t.index);return n||(n=this.pswp.createContentFromData(t.data,t.index),this.addToCache(n)),n.setSlide(t),n}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const n=this._cachedItems.findIndex(i=>!i.isAttached&&!i.hasSlide);n!==-1&&this._cachedItems.splice(n,1)[0].destroy()}}removeByIndex(t){const n=this._cachedItems.findIndex(i=>i.index===t);n!==-1&&this._cachedItems.splice(n,1)}getContentByIndex(t){return this._cachedItems.find(n=>n.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}}class AYe extends vYe{getNumItems(){var t;let n=0;const i=(t=this.options)===null||t===void 0?void 0:t.dataSource;i&&"length"in i?n=i.length:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),i.items&&(n=i.items.length));const o=this.dispatch("numItems",{dataSource:i,numItems:n});return this.applyFilters("numItems",o.numItems,i)}createContentFromData(t,n){return new kYe(t,this,n)}getItemData(t){var n;const i=(n=this.options)===null||n===void 0?void 0:n.dataSource;let o={};Array.isArray(i)?o=i[t]:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),o=i.items[t]);let s=o;s instanceof Element&&(s=this._domElementToItemData(s));const r=this.dispatch("itemData",{itemData:s||{},index:t});return this.applyFilters("itemData",r.itemData,t)}_getGalleryDOMElements(t){var n,i;return(n=this.options)!==null&&n!==void 0&&n.children||(i=this.options)!==null&&i!==void 0&&i.childSelector?EQe(this.options.children,this.options.childSelector,t)||[]:[t]}_domElementToItemData(t){const n={element:t},i=t.tagName==="A"?t:t.querySelector("a");if(i){n.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(n.srcset=i.dataset.pswpSrcset),n.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,n.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,n.w=n.width,n.h=n.height,i.dataset.pswpType&&(n.type=i.dataset.pswpType);const s=t.querySelector("img");if(s){var o;n.msrc=s.currentSrc||s.src,n.alt=(o=s.getAttribute("alt"))!==null&&o!==void 0?o:""}(i.dataset.pswpCropped||i.dataset.cropped)&&(n.thumbCropped=!0)}return this.applyFilters("domItemData",n,t,i)}lazyLoadData(t,n){return kZ(t,this,n)}}const Zm=.003;class xYe{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,n=this.pswp.currSlide,{options:i}=t;if(i.showHideAnimationType==="fade"?(i.showHideOpacity=!0,this._thumbBounds=void 0):i.showHideAnimationType==="none"?(i.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=n?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&n?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),!this._animateZoom)this._animateRootOpacity=!0,this.isOpening&&n&&(n.zoomAndPanToInitial(),n.applyCurrentZoomPan());else{var o;this._animateRootOpacity=(o=i.showHideOpacity)!==null&&o!==void 0?o:!1}if(this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>Zm,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation){this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,this.isOpening&&(t.element&&(t.element.style.opacity=String(Zm)),t.applyBgOpacity(1));return}if(this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect){var s;this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=(s=this.pswp.currSlide)===null||s===void 0?void 0:s.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")}else this._croppedZoom=!1;this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(Zm)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(Zm)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(Zm)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&t.mainScroll.x!==0&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&this._placeholder.tagName==="IMG"?new Promise(t=>{let n=!1,i=!0;IQe(this._placeholder).finally(()=>{n=!0,i||t(!0)}),setTimeout(()=>{i=!1,n&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){var t,n;(t=this.pswp.element)===null||t===void 0||t.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),(n=this.pswp.element)===null||n===void 0||n.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;if(this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed)t.destroy();else if(this.isOpen){var n;this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),(n=t.currSlide)===null||n===void 0||n.applyCurrentZoomPan()}}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:n}=this,{innerRect:i}=this._thumbBounds,{currSlide:o,viewportSize:s}=n;if(this._croppedZoom&&i&&this._cropContainer1&&this._cropContainer2){const r=-s.x+(this._thumbBounds.x-i.x)+i.w,l=-s.y+(this._thumbBounds.y-i.y)+i.h,a=s.x-i.w,u=s.y-i.h;t?(this._animateTo(this._cropContainer1,"transform",sv(r,l)),this._animateTo(this._cropContainer2,"transform",sv(a,u))):(lh(this._cropContainer1,r,l),lh(this._cropContainer2,a,u))}o&&(is(o.pan,i||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,t?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,n,i){if(!this._duration){t.style[n]=i;return}const{animations:o}=this.pswp,s={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{o.activeAnimations.length||this._onAnimationComplete()},target:t};s[n]=i,o.startTransition(s)}}const SYe={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class _Ye extends AYe{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new LQe,this.animations=new nYe,this.mainScroll=new KQe(this),this.gestures=new UQe(this),this.opener=new xYe(this),this.keyboard=new GQe(this),this.contentLoader=new CYe(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new iYe(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:n}=this.mainScroll;n[0]&&(n[0].el.style.display="block",this.setContent(n[0],this.currIndex-1)),n[2]&&(n[2].el.style.display="block",this.setContent(n[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const n=this.getNumItems();return this.options.loop&&(t>n-1&&(t-=n),t<0&&(t+=n)),$v(t,0,n-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{var n;(n=t.slide)===null||n===void 0||n.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){var n;(n=this.currSlide)===null||n===void 0||n.zoomTo(...t)}toggleZoom(){var t;(t=this.currSlide)===null||t===void 0||t.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){var t;if(!this.isDestroying){this.options.showHideAnimationType="none",this.close();return}this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),(t=this.element)===null||t===void 0||t.remove(),this.mainScroll.itemHolders.forEach(n=>{var i;(i=n.slide)===null||i===void 0||i.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((n,i)=>{var o,s;let r=((o=(s=this.currSlide)===null||s===void 0?void 0:s.index)!==null&&o!==void 0?o:0)-1+i;if(this.canLoop()&&(r=this.getLoopedIndex(r)),r===t&&(this.setContent(n,t,!0),i===1)){var l;this.currSlide=n.slide,(l=n.slide)===null||l===void 0||l.setIsActive(!0)}}),this.dispatch("change")}setContent(t,n,i){if(this.canLoop()&&(n=this.getLoopedIndex(n)),t.slide){if(t.slide.index===n&&!i)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(n<0||n>=this.getNumItems()))return;const o=this.getItemData(n);t.slide=new DQe(o,n,this),n===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const n=mZ(this.options,this);!t&&u0(n,this._prevViewportSize)||(is(this._prevViewportSize,n),this.dispatch("beforeResize"),is(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){if(!this.hasMouse){var t;this.hasMouse=!0,(t=this.element)===null||t===void 0||t.classList.add("pswp--has_mouse")}}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,n){this.offset.x=t,this.offset.y=n,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=Rl("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=Rl("pswp__bg","div",this.element),this.scrollWrap=Rl("pswp__scroll-wrap","section",this.element),this.container=Rl("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new fYe(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return mYe(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...SYe,...t}}}function MYe(e){return new Promise(t=>{const n=new Image;n.onload=()=>t(n.naturalWidth>0?{w:n.naturalWidth,h:n.naturalHeight}:null),n.onerror=()=>t(null),n.src=e})}async function IYe(e,t,n){if(n?.currentSrc&&n.naturalWidth>0)return{src:n.currentSrc,w:n.naturalWidth,h:n.naturalHeight,objectUrl:null};let i=t.url,o=null;if(t.fileId)try{const r=t.sessionId?await e.getSessionMediaBlob(t.sessionId,t.fileId):await e.getFileBlob(t.fileId);o=URL.createObjectURL(r),i=o}catch{}const s=await MYe(i);return s?{src:i,...s,objectUrl:o}:(o&&URL.revokeObjectURL(o),null)}function TYe(e){const t=(o,s)=>{const r=parseFloat(e(o));return Number.isFinite(r)&&r>0?r:s},n=t("--space-6",24),i=t("--space-8",32)+n;return{top:i,bottom:i,left:n,right:n}}function EYe(e){let t=!1,n=!1,i=null;return(async()=>{const o=await IYe(e.api,e.media,e.thumbImg);if(t){o?.objectUrl&&URL.revokeObjectURL(o.objectUrl);return}if(!o){e.onClose();return}const s=e.thumbImg?.currentSrc===o.src?e.thumbImg:null;i=new _Ye({dataSource:[{src:o.src,w:o.w,h:o.h,thumbCropped:!0,...s?{msrc:s.currentSrc,element:s}:{}}],index:0,showHideAnimationType:s?"zoom":"fade",arrowPrev:!1,arrowNext:!1,counter:!1,close:!1,zoom:!1,wheelToZoom:!0,escKey:!0,trapFocus:!1,bgOpacity:1,padding:TYe(l=>getComputedStyle(document.documentElement).getPropertyValue(l))}),i.addFilter("thumbEl",l=>l?.isConnected?l:null);const r=e.media.path;i.on("uiRegister",()=>{const l=i?.ui;!l||!r||l.registerElement({name:"caption",className:"media-preview-caption",isButton:!1,appendTo:"root",onInit:a=>{a.textContent=r}})}),i.on("openingAnimationStart",()=>{sr.value+=1,e.onOpen?.()}),i.on("destroy",()=>{n=!0,sr.value=Math.max(0,sr.value-1),o.objectUrl&&URL.revokeObjectURL(o.objectUrl),e.onClose()}),i.init()})(),()=>{t=!0,i&&!n&&i.close()}}function mS(e){try{const t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}function LYe(){const e=window.open("","_blank");if(!e)return null;try{e.opener=null}catch{}return{get closed(){return e.closed},navigate(t){e.location.href=t},focus(){e.focus()},close(){e.close()}}}function bZ(e=LYe){let t=null,n=null;function i(){if(t)try{t.close()}catch{}t=null,n=null}return{onGesture(){i(),t=e()},openUrl(o,s){if(!mS(o))return i(),!1;if(!t||t.closed)return t=null,n=null,!1;if(n===o){try{t.focus()}catch{}return!0}try{t.navigate(o)}catch{return i(),!1}return n=o,!0},settle(o,s){if(n!==null&&(o||s?.keepNavigated===!0)){t=null,n=null;return}i()}}}function wZ(){return{subscribe(e){const t=()=>{document.visibilityState==="visible"&&e()};return window.addEventListener("focus",e),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",t)}}}}const NYe=["aria-label"],DYe=["aria-label"],FYe={class:"media-lightbox-card"},BYe={class:"media-lightbox-frame"},RYe={key:0,class:"media-lightbox-name"},OYe=["aria-label"],$Ye='button:not([disabled]), video[controls], [tabindex]:not([tabindex="-1"])',PYe=rt({__name:"MediaLightbox",props:{media:{},originImg:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=D(()=>n.media.kind==="image"),r=D(()=>n.media.path??null),l=D(()=>r.value??(n.media.kind==="video"?o("composer.attachmentVideo"):o("composer.attachmentImage"))),a=V(null),u=V(null),c=V(!1);let d=null,f=null;function h(m){if(m.key==="Escape"){m.preventDefault(),i("close");return}if(m.key!=="Tab"||!a.value)return;const g=a.value.querySelectorAll($Ye),v=g[0],y=g[g.length-1];!v||!y||(a.value.contains(document.activeElement)?m.shiftKey&&document.activeElement===v?(m.preventDefault(),y.focus()):!m.shiftKey&&document.activeElement===y&&(m.preventDefault(),v.focus()):(m.preventDefault(),(m.shiftKey?y:v).focus()))}return kn(()=>{if(s.value){f=EYe({api:Zt(),media:n.media,thumbImg:n.originImg??null,onOpen:()=>{c.value=!0},onClose:()=>i("close")});return}sr.value+=1,d=document.activeElement instanceof HTMLElement?document.activeElement:null,window.addEventListener("keydown",h),u.value?.focus()}),Xn(()=>{if(f){f(),f=null;return}sr.value=Math.max(0,sr.value-1),window.removeEventListener("keydown",h),d?.focus()}),(m,g)=>(k(),de(us,{to:"body"},[s.value?c.value?(k(),de(p(Nn),{key:1,text:p(o)("model.close")},{default:ue(()=>[A("button",{type:"button",class:"media-lightbox-close","aria-label":p(o)("model.close"),onClick:g[2]||(g[2]=v=>i("close"))},[U(p(Ce),{name:"close",size:"sm"})],8,OYe)]),_:1},8,["text"])):ee("",!0):(k(),L("div",{key:0,ref_key:"overlayRef",ref:a,class:"media-lightbox",role:"dialog","aria-modal":"true","aria-label":l.value,onMousedown:g[1]||(g[1]=Tt(v=>i("close"),["self"]))},[U(p(Nn),{text:p(o)("model.close")},{default:ue(()=>[A("button",{ref_key:"closeRef",ref:u,type:"button",class:"media-lightbox-close","aria-label":p(o)("model.close"),onClick:g[0]||(g[0]=v=>i("close"))},[U(p(Ce),{name:"close",size:"sm"})],8,DYe)]),_:1},8,["text"]),A("div",FYe,[A("div",BYe,[U(cS,{url:e.media.url,kind:e.media.kind==="video"?"video":"image","file-id":e.media.fileId,"session-id":e.media.sessionId,"media-class":"media-lightbox-media",controls:e.media.kind==="video"},null,8,["url","kind","file-id","session-id","controls"])]),r.value?(k(),L("div",RYe,F(r.value),1)):ee("",!0)])],40,NYe))]))}}),CZ=St(PYe,[["__scopeId","data-v-14fb6a4a"]]),zYe={class:"working-indicator",role:"status"},jYe={class:"wi-mascot","aria-hidden":"true"},HYe={class:"wi-label"},WYe=rt({__name:"WorkingIndicator",props:{label:{}},setup(e){return(t,n)=>(k(),L("div",zYe,[A("span",jYe,[U(p(U$e))]),A("span",HYe,F(e.label),1)]))}}),gS=St(WYe,[["__scopeId","data-v-cd612157"]]),qYe=rt({__name:"SelectionActionBubble",props:{visible:{type:Boolean},x:{},y:{},bottom:{},px:{},py:{},quote:{},focusOnOpen:{type:Boolean},focusReturnEl:{}},emits:["action","close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),r=Lc().value||typeof window<"u"&&window.matchMedia("(hover: none)").matches===!0,{handleCompositionStart:l,handleCompositionEnd:a,isComposingKeyEvent:u}=bl(),c=V("menu"),d=V(""),f=V(null),h=V(null),m=V(null),g=V({});let v=null;function y(){const B=v;if(v=null,B&&B.isConnected){B.focus();return}const P=n.focusReturnEl;P&&P.isConnected&&P.focus()}function b(){y(),i("close")}function w(B){const P=B.target;f.value?.el?.contains(P)||b()}function C(B){if(!bV(f.value?.el??null,B?.target??null)){if(B?.type==="resize"&&c.value==="comment"){x();return}b()}}function T(){if(c.value==="comment"){x();return}b()}function N(B){B.key!=="Escape"||B.repeat||pS(B)||(B.stopPropagation(),b())}function I(){hS(),document.addEventListener("mousedown",w),window.addEventListener("keydown",N,!0),document.addEventListener("scroll",C,!0),window.addEventListener("resize",C),window.visualViewport?.addEventListener("resize",T),window.visualViewport?.addEventListener("scroll",T)}function S(){document.removeEventListener("mousedown",w),window.removeEventListener("keydown",N,!0),document.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C),window.visualViewport?.removeEventListener("resize",T),window.visualViewport?.removeEventListener("scroll",T)}function _(B,P){const H=getComputedStyle(document.documentElement).getPropertyValue(B).trim(),j=Number.parseFloat(H);return Number.isFinite(j)?j:P}async function x(B=!1){B&&(g.value={visibility:"hidden"}),await ft();const P=f.value?.el;if(!P)return;const H=_("--space-1-5",6),j=_("--p-mention-tip-vmargin",12),G=window.visualViewport?.width??window.innerWidth,ne=window.visualViewport?.height??window.innerHeight,W=window.visualViewport?.offsetLeft??0,Q=window.visualViewport?.offsetTop??0,te=`${Math.round(G-2*j)}px`,X=`${Math.round(ne-2*j)}px`;g.value={...g.value,maxWidth:te,maxHeight:X},await ft();const ve=P.offsetWidth,ce=P.offsetHeight;let se,pe;if(n.px!==void 0&&n.py!==void 0){se=v5(n.px,ve,G,j,W);const Z=n.py>=(n.y+n.bottom)/2,ae=n.py+H,K=n.py-ce-H;Z?pe=ae+ce<=Q+ne-j||K=Q+j||ae+ce>Q+ne-j?K:ae}else{se=v5(n.x-ve/2,ve,G,j,W),pe=n.bottom+H;const Z=pe+ce<=Q+ne-j,ae=n.y-ce-H>=Q+j;!Z&&ae&&(pe=n.y-ce-H)}pe=v5(pe,ce,ne,j,Q),g.value={top:`${Math.round(pe)}px`,left:`${Math.round(se)}px`,maxWidth:te,maxHeight:X}}We(()=>[n.visible,n.x,n.y,n.bottom,n.px,n.py],([B],P)=>{B?(P?.[0]!==!0&&(c.value="menu",d.value="",v=document.activeElement,I()),x(P?.[0]!==!0).then(()=>{P?.[0]!==!0&&n.focusOnOpen&&E()[0]?.focus()})):S()},{immediate:!0}),Ln(S);function E(){return Array.from(f.value?.el?.querySelectorAll('[role="menuitem"]')??[])}function M(B){if(c.value==="comment"){if(B.key!=="Tab")return;B.preventDefault();const G=h.value?.el,ne=m.value?.querySelector(".ui-button");if(!G||!ne)return;(document.activeElement===G?ne:G).focus();return}if(B.key!=="ArrowDown"&&B.key!=="ArrowUp")return;const P=E();if(P.length===0)return;B.preventDefault();const H=P.findIndex(G=>G===document.activeElement),j=eze(H,B.key==="ArrowDown"?1:-1,P.length);P[j]?.focus()}function R(B,P){i("action",{action:B,quote:n.quote,comment:P})}async function q(){c.value="comment",await x(),h.value?.focus()}function z(){const B=d.value.trim();if(B.length===0){h.value?.focus();return}R("comment",B)}function $(B){B.key==="Enter"&&!u(B)&&(B.preventDefault(),z())}return(B,P)=>(k(),de(us,{to:"body"},[e.visible?(k(),de(p(Hs),{key:0,ref_key:"menuRef",ref:f,class:"sab",style:sn(g.value),role:c.value==="menu"?"menu":"dialog","aria-label":c.value==="comment"?p(o)("selection.comment"):void 0,onKeydown:M},{default:ue(()=>[c.value==="menu"?(k(),L(De,{key:0},[U(p(tn),{size:p(r)?"lg":"md",onClick:q},{default:ue(()=>[U(p(Ce),{name:"message",size:"sm"}),Oe(" "+F(p(o)("selection.comment")),1)]),_:1},8,["size"]),U(p(tn),{size:p(r)?"lg":"md",onClick:P[0]||(P[0]=H=>R("quote"))},{default:ue(()=>[U(p(Ce),{name:"plus",size:"sm"}),Oe(" "+F(p(o)("selection.addToChat")),1)]),_:1},8,["size"])],64)):(k(),L("div",{key:1,ref_key:"commentRowRef",ref:m,class:"sab-comment"},[U(p(Ms),{ref_key:"inputRef",ref:h,modelValue:d.value,"onUpdate:modelValue":P[1]||(P[1]=H=>d.value=H),size:"sm",placeholder:p(o)("selection.commentPlaceholder"),onKeydown:$,onCompositionstart:p(l),onCompositionend:p(a)},null,8,["modelValue","placeholder","onCompositionstart","onCompositionend"]),U(p(rn),{size:"sm",disabled:d.value.trim().length===0,onClick:z},{default:ue(()=>[Oe(F(p(o)("selection.confirm")),1)]),_:1},8,["disabled"])],512))]),_:1},8,["style","role","aria-label"])):ee("",!0)]))}}),AZ=St(qYe,[["__scopeId","data-v-73604c69"]]),UYe={key:0,class:"chat-loading"},VYe={class:"chat-loading-text"},KYe={key:1,class:"chat-empty"},ZYe={key:1,class:"top-sentinel-text"},GYe={key:0,class:"u-turn"},QYe=["data-turn-id"],YYe={key:0,class:"u-atts"},JYe=["data-attachment-id","data-attachment-kind","data-attachment-name","data-attachment-url","data-attachment-file-id","data-attachment-media-type","data-attachment-size","data-attachment-session-id","aria-label"],XYe=["innerHTML"],eJe={class:"attachment-pill-name"},tJe=["data-attachment-id","data-attachment-kind","data-attachment-name","data-attachment-file-id","data-attachment-media-type","data-attachment-size","data-attachment-session-id","aria-label"],nJe=["innerHTML"],iJe={class:"attachment-pill-name"},oJe={key:1,class:"u-atts"},sJe=["data-attachment-id","data-attachment-name","data-attachment-url","data-attachment-file-id","data-attachment-media-type","data-attachment-size","aria-label"],rJe=["innerHTML"],lJe={class:"attachment-pill-name"},aJe=["data-attachment-id","data-attachment-name","data-attachment-file-id","data-attachment-media-type","data-attachment-size","aria-label"],uJe=["innerHTML"],cJe={class:"attachment-pill-name"},dJe={key:2,class:"skill-act"},fJe={class:"skill-act-head"},hJe=["aria-expanded","onClick"],pJe={key:0,class:"u-meta"},mJe=["aria-label","onClick"],gJe={class:"u-edit-hint"},vJe=["aria-label","onClick"],yJe=["aria-label","onClick"],kJe=["data-turn-id"],bJe=["onClick"],wJe={class:"cd-view"},CJe={key:1,class:"cd-label"},AJe=["data-turn-id"],xJe={key:0,class:"goal-prov"},SJe={key:1,class:"msg"},_Je={key:3,class:"a-msg-ft"},MJe={key:0,class:"a-time"},IJe=["aria-label","onClick"],TJe={key:4,class:"compact-divider",role:"separator"},EJe={class:"cd-label",role:"status"},LJe={key:3,class:"turn-failed",role:"alert"},NJe={class:"tf-chip","aria-hidden":"true"},DJe={class:"tf-main"},FJe={class:"tf-title"},BJe=["title"],RJe=["title"],OJe={key:5,class:"sending-placeholder"},$Je={key:6,class:"q-stack"},PJe={class:"q-head"},zJe={class:"q-title"},jJe=["onDragover","onDrop"],HJe=["aria-label","onClick"],WJe={class:"u-bub q-bub"},qJe=["title","onDragstart"],UJe=["title","onClick"],VJe={key:0,class:"u-text q-text"},KJe={key:1,class:"q-text q-text-placeholder"},ZJe=["aria-expanded","onClick"],GJe={key:0,class:"q-imgs"},QJe={key:0,class:"q-file"},YJe=["aria-label","onClick"],JJe=["aria-label","onClick"],XJe=250,eXe=2500,tXe=10,nXe=3,iXe=rt({__name:"ChatPane",props:{turns:{},cwd:{},turnFilesInteractive:{type:Boolean,default:!0},approvals:{default:()=>[]},questions:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},selectionActions:{type:Boolean,default:!0},inspector:{type:Boolean,default:!1},queued:{default:()=>[]},undoHintTurnId:{default:null},interruptedTurnId:{default:null},turnFailed:{type:Boolean,default:!1},turnError:{default:null},turnRetry:{default:null}},emits:["openMedia","detach","copyConversationCopied","editMessage","armedUndo","loadOlderMessages","unqueue","editQueued","reorderQueue","steerQueued","resumeTurn","quoteAction"],setup(e,{expose:t,emit:n}){const{t:i}=Ut(),{confirm:o}=cf(),{turnFolding:s}=Ux();Ln(()=>{Ee!==null&&(clearTimeout(Ee),Ee=null),ke!==null&&(clearTimeout(ke),ke=null),K!==null&&(clearTimeout(K),K=null)});const r=e,l=V(null);let a=null;function u(){!l.value||typeof IntersectionObserver>"u"||(a?.disconnect(),a=new IntersectionObserver(ot=>{ot[0]?.isIntersecting&&r.hasMoreMessages&&!r.loadingMore&&!r.loadingMoreError&&!r.sessionLoading&&!r.isFollowing&&b("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),a.observe(l.value))}kn(u),Ln(()=>{a?.disconnect(),a=null});const c=V(null);let d=null;kn(()=>{d=_V(()=>c.value)}),Ln(()=>{d?.(),d=null}),We(()=>[r.hasMoreMessages,r.loadingMore,r.loadingMoreError],()=>{ft().then(u)});const f=D(()=>{if(!r.turnActive||r.turns.length===0)return null;const ot=r.turns.at(-1);return ot.role==="assistant"?ot.id:null}),h=D(()=>{const ot=new Map;if(r.inspector)return ot;for(const Ue of r.turns){if(Ue.role!=="assistant"||Ue.id===f.value)continue;const st=NZ(Ue);st.length>0&&ot.set(Ue.id,st)}return ot}),m=D(()=>r.working),g=D(()=>{const ot=r.turnRetry;if(ot!=null)return i("conversation.workingRetry",{n:ot.nextAttempt,max:ot.maxAttempts});const Ue=r.turns.at(-1),st=Ue?.role==="assistant"&&(Ue.text.trim().length>0||(Ue.thinking?.trim().length??0)>0||(Ue.tools?.length??0)>0);return i(st?"conversation.working":"conversation.requesting")}),v=D(()=>r.turnError?.code==="loop.max_steps_exceeded"?i("conversation.turnFailedMaxSteps"):i("conversation.turnFailed")),y=D(()=>{const ot=r.turnError;if(!ot)return"";const Ue=[];return ot.code!==void 0&&ot.code.length>0&&Ue.push(ot.code),ot.statusCode!==void 0&&Ue.push(`HTTP ${ot.statusCode}`),ot.requestId!==void 0&&ot.requestId.length>0&&Ue.push(ot.requestId),Ue.join(" · ")}),b=n,w=Yt(Uo),C=ot=>b("openMedia",ot),T=ot=>b("detach",ot),N=V(null),I=V(!1),S=D(()=>r.selectionActions&&GPe);function _(ot){}function x(ot){I.value=!1,(ot.clientX||ot.clientY)&&(ot.clientX,ot.clientY)}function E(){I.value=!1}function M(ot){ot.key!=="Escape"&&(I.value=!0)}let R=null;function q(){R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null;const ot=document.activeElement;if(ot instanceof Element&&ot.closest(".sab"))return;const Ue=window.getSelection();if(Ue&&!Ue.isCollapsed&&!lK(Ue,c.value)){N.value=null;return}},XJe)}kn(()=>{S.value&&document.addEventListener("selectionchange",q)}),Ln(()=>{document.removeEventListener("selectionchange",q),R!==null&&(clearTimeout(R),R=null)});function z(){N.value=null,R!==null&&(clearTimeout(R),R=null)}function $(ot){N.value=null,window.getSelection()?.removeAllRanges(),b("quoteAction",ot)}const B=V(null),P=V(null);function H(ot){return j(ot).length>0}function j(ot){const Ue=ot.attachments??[],st=al(ot.text);if(st.length===0)return Ue;const In=new Set,kt=new Set;for(const co of st)D1(co.attrs.attId,Ue)!==void 0&&(/^[1-9]\d*$/.test(co.attrs.attId)?In.add(Number(co.attrs.attId)):/^m[1-9]\d*$/.test(co.attrs.attId)&&kt.add(Number(co.attrs.attId.slice(1))));if(In.size===0&&kt.size===0)return Ue;let ui=0,_o=0;return Ue.filter(co=>co.kind==="file"?(ui+=1,!In.has(ui)):co.kind==="image"||co.kind==="video"?(_o+=1,!kt.has(_o)):!0)}function G(ot){b("editQueued",ot)}function ne(ot){typeof window<"u"&&window.matchMedia("(hover: none)").matches||G(ot)}function W(ot,Ue){if(B.value=ot,!Ue.dataTransfer)return;Ue.dataTransfer.effectAllowed="move",Ue.dataTransfer.setData("text/plain",String(ot));const st=Ue.currentTarget?.closest(".q-turn");st&&Ue.dataTransfer.setDragImage(st,24,24)}function Q(ot,Ue){if(B.value===null)return;Ue.preventDefault(),Ue.dataTransfer&&(Ue.dataTransfer.dropEffect="move");const st=Ue.currentTarget.getBoundingClientRect(),In=Ue.clientYCAe(r.turns));function ce(ot){return!r.readOnly&&ot.role==="user"&&ve.value.has(ot.id)&&!r.working&&!ot.pluginCommand&&!(ot.skillActivation&&!vU(ot.skillActivation,{revivePill:!0}))}function se(ot){const Ue=ot.compaction,st=Ue?.trigger==="auto"?i("conversation.compactedAuto"):i("conversation.compactedPlain");return typeof Ue?.tokensBefore=="number"&&typeof Ue?.tokensAfter=="number"?st+i("conversation.compactedTokens",{before:xc(Ue.tokensBefore),after:xc(Ue.tokensAfter)}):st}const pe=V(null);function Z(ot){const Ue=ot.createdAt===void 0?NaN:Date.parse(ot.createdAt),st=ot.endedAt??(Number.isFinite(Ue)&&ot.durationMs!==void 0?new Date(Ue+ot.durationMs).toISOString():ot.createdAt);return st===void 0?"":U$(st,i("conversation.yesterday"))}const ae=V(null);let K=null;async function re(ot){await o({title:i("conversation.undo"),message:i("conversation.undoConfirm"),variant:"primary"})&&we(ot)}function we(ot){if(ae.value!==null)return;const Ue=ve.value.get(ot.id);if(Ue===void 0)return;ae.value=ot.id;const st=ot.skillActivation?bx(ot.skillActivation,{revivePill:!0})??ot.text:ot.text;b("editMessage",{text:st,attachments:oK(ot),undoCount:Ue}),K=setTimeout(()=>{K=null,ae.value=null},eXe)}We(()=>r.turns,ot=>{ae.value!==null&&(ot.some(Ue=>Ue.id===ae.value)||(ae.value=null,K!==null&&(clearTimeout(K),K=null)))},{flush:"post"});const be=V(!1);let ke=null;function oe(){if(r.turns.length===0)return;const ot=[];for(const st of r.turns){if(st.role==="compaction"||st.role==="cron")continue;const In=st.role==="user"?"User":"Assistant",kt=kst(st);kt.trim()&&ot.push(`**${In}** -${bt}`)}const Ue=ot.join(` +${kt}`)}const Ue=ot.join(` --- -`);Es(Ue).then(st=>{st&&(ke.value=!0,b("copyConversationCopied"),we!==null&&clearTimeout(we),we=setTimeout(()=>{we=null,ke.value=!1},2e3))}).catch(()=>{})}function le(ot){const Ue=[];for(let st=ot;st>=0;st--){const _n=r.turns[st];if(!_n||_n.role!=="assistant")break;Ue.unshift(_n)}return Ue}function ye(ot){return le(ot).map(Ue=>bst(Ue)).filter(Boolean).join(` +`);Ls(Ue).then(st=>{st&&(be.value=!0,b("copyConversationCopied"),ke!==null&&clearTimeout(ke),ke=setTimeout(()=>{ke=null,be.value=!1},2e3))}).catch(()=>{})}function le(ot){const Ue=[];for(let st=ot;st>=0;st--){const In=r.turns[st];if(!In||In.role!=="assistant")break;Ue.unshift(In)}return Ue}function ye(ot){return le(ot).map(Ue=>vst(Ue)).filter(Boolean).join(` -`)}function Ae(ot){return le(ot).some(GA)}function _e(){for(let ot=r.turns.length-1;ot>=0;ot-=1)if(r.turns[ot]?.role==="assistant")return ye(ot);return""}function pe(){const ot=_e();ot.trim()&&Es(ot).then(Ue=>{Ue&&(ke.value=!0,b("copyConversationCopied"),we!==null&&clearTimeout(we),we=setTimeout(()=>{we=null,ke.value=!1},2e3))}).catch(()=>{})}t({copyConversation:oe,copyFinalSummary:pe});function ne(ot){const Ue=r.turns[ot];if(!Ue||Ue.role!=="assistant")return!1;const st=r.turns[ot+1];return!st||st.role!=="assistant"}let Ee=null;function qe(ot){const Ue=r.turns[ot];if(!Ue)return;const st=ye(ot);st.trim()&&Es(st).then(_n=>{_n&&(fe.value=Ue.id,Ee!==null&&clearTimeout(Ee),Ee=setTimeout(()=>{Ee=null,fe.value=null},1400))}).catch(()=>{})}function ze(ot){const Ue=ot.text;Ue.trim()&&qMe(yd(Ue),MSe(Ue,ot.inlineAttachments)).then(st=>{st&&(fe.value=ot.id,Ee!==null&&clearTimeout(Ee),Ee=setTimeout(()=>{Ee=null,fe.value=null},1400))}).catch(()=>{})}const ft=po(new Set),gt=po(new Set),_t=new Map,Pt=new WeakMap,Ht=Jt(df,()=>{}),jt=new ResizeObserver(ot=>{for(const Ue of ot){const st=Ue.target,_n=Pt.get(st);_n!==void 0&&Te(_n,st)}});Ln(()=>jt.disconnect());function Te(ot,Ue){const st=parseFloat(getComputedStyle(Ue).lineHeight);if(!Number.isFinite(st)||st<=0)return;const bt=(Ue.textContent??"").match(/\n+$/)?.[0].length??0,Zn=Ue.scrollHeight-Math.max(0,bt-1)*st,vs=ot.startsWith("queue:")?sXe:oXe;Zn>st*vs+1?ft.add(ot):ft.delete(ot)}function Fe(ot,Ue){if(!(Ue instanceof HTMLElement)||_t.get(ot)===Ue)return;const st=_t.get(ot);st!==void 0&&jt.unobserve(st),_t.set(ot,Ue),Pt.set(Ue,ot),jt.observe(Ue),Te(ot,Ue)}function Ke(ot){return`queue:${ot.id}`}We([()=>r.turns,()=>r.queued],()=>{const ot=new Set(r.turns.map(Ue=>Ue.id));for(const Ue of r.queued)ot.add(Ke(Ue));for(const[Ue,st]of _t)ot.has(Ue)||(jt.unobserve(st),_t.delete(Ue),ft.delete(Ue),gt.delete(Ue))});function rt(ot){if(ot.skillActivation){const Ue=ot.skillActivation;if(gU(Ue))return Ue.args??null;const st=nm({kind:"skill",name:Ue.name,path:""});return Ue.args?`${st} ${Ue.args}`:st}return ot.pluginCommand?ot.pluginCommand.args||null:ot.text||null}function Nt(ot){return ot.pluginCommand!==void 0}function Lt(ot){return ft.has(ot)&&!gt.has(ot)}function Qt(ot,Ue){const st=gt.has(ot);st&&Ue.currentTarget instanceof HTMLElement&&Ht(Ue.currentTarget),st?gt.delete(ot):gt.add(ot)}function Ut(ot){return ot.kind==="image"||ot.kind==="video"}function en(ot){return(ot.attachments??[]).filter(Ut)}function it(ot){return ot.name??(ot.kind==="video"?i("composer.attachmentVideo"):i("composer.attachmentImage"))}function dt(ot){return(ot.attachments??[]).filter(Ue=>!Ut(Ue))}const wt=V(null),dn=V(null);function Gt(ot,Ue){return ot.id!==f.value||Ue.kind==="thinking"&&Ue.durationMs!==void 0?!1:Ue.sourceIndex===hc(ot).length-1}function ri(ot,Ue){if(ot.id!==f.value)return!1;const st=Ue.items.at(-1);return st?.kind==="thinking"&&st.durationMs!==void 0?!1:st!==void 0&&st.sourceIndex===hc(ot).length-1}const ci={folded:[],visible:[]};function ji(ot){return ot.role!=="assistant"?ci:TZ(ot)}function xi(ot){const Ue=ji(ot);return r.inspector||!s.value?vst(Ue):Ue.visible}function Uo(ot){if(ot.id!==f.value)return null;const Ue=hc(ot),st=Ue.at(-1);if(st?.kind==="thinking"&&st.durationMs!==void 0)return null;if(st?.kind==="tool"&&st.tool.status==="running"){const _n=st.tool.id;if(r.approvals?.some(bt=>bt.toolCallId===_n)||r.questions?.some(bt=>bt.toolCallId===_n))return null}return Ue.length-1}return(ot,Ue)=>(k(),L(De,null,[A("div",{class:"chat",ref_key:"chatRootRef",ref:c,tabindex:"-1",onMouseup:x,onKeyup:M,onPointerdown:E},[e.sessionLoading?(k(),L("div",ZYe,[U(p(mo),{size:"sm"}),A("span",GYe,F(p(i)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(k(),L("div",QYe)):ee("",!0),e.hasMoreMessages||e.loadingMore?(k(),L("div",{key:2,ref_key:"topSentinelRef",ref:l,class:Re(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(k(),L("span",YYe,[U(p(mo),{size:"sm"}),$e(" "+F(p(i)("conversation.loadingOlder")),1)])):(k(),L("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:Ue[0]||(Ue[0]=st=>b("loadOlderMessages"))},F(p(i)("conversation.loadOlder")),1))],2)):ee("",!0),(k(!0),L(De,null,Ct(e.turns,(st,_n)=>(k(),L(De,{key:st.id},[st.role==="user"?(k(),L("div",JYe,[A("div",{class:Re(["u-bub turn-anchor",{undoing:ae.value===st.id}]),"data-turn-id":st.id},[en(st).length>0?(k(),L("div",eJe,[(k(!0),L(De,null,Ct(en(st),(bt,Zn)=>(k(),L(De,{key:Zn},[bt.url!==""?(k(),L("button",{key:0,type:"button",class:Re(`attachment-pill attachment-${bt.kind}`),"data-attachment-id":bt.fileId??bt.name??"","data-attachment-kind":bt.kind,"data-attachment-name":it(bt),"data-attachment-url":bt.url,"data-attachment-file-id":bt.fileId,"data-attachment-media-type":bt.mediaType,"data-attachment-size":bt.size,"data-attachment-session-id":bt.sessionId,"aria-label":it(bt)},[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p($1)(bt.kind)},null,8,nJe),A("span",iJe,F(p(Su)(it(bt))),1)],10,tJe)):(k(),L("span",{key:1,class:Re(`attachment-pill attachment-${bt.kind}`),"data-attachment-id":bt.fileId??bt.name??"","data-attachment-kind":bt.kind,"data-attachment-name":it(bt),"data-attachment-file-id":bt.fileId,"data-attachment-media-type":bt.mediaType,"data-attachment-size":bt.size,"data-attachment-session-id":bt.sessionId,"aria-label":it(bt)},[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p($1)(bt.kind)},null,8,sJe),A("span",rJe,F(p(Su)(it(bt))),1)],10,oJe))],64))),128))])):ee("",!0),dt(st).length>0?(k(),L("div",lJe,[(k(!0),L(De,null,Ct(dt(st),(bt,Zn)=>(k(),L(De,{key:Zn},[bt.url!==""?(k(),L("button",{key:0,type:"button",class:"attachment-pill attachment-file","data-attachment-id":bt.fileId??bt.name??"","data-attachment-kind":"file","data-attachment-name":bt.name??"","data-attachment-url":bt.url,"data-attachment-file-id":bt.fileId,"data-attachment-media-type":bt.mediaType,"data-attachment-size":bt.size,"aria-label":bt.name},[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p(E4)()},null,8,uJe),A("span",cJe,F(p(Su)(bt.name??"")),1)],8,aJe)):(k(),L("span",{key:1,class:"attachment-pill attachment-file","data-attachment-id":bt.fileId??bt.name??"","data-attachment-kind":"file","data-attachment-name":bt.name??"","data-attachment-file-id":bt.fileId,"data-attachment-media-type":bt.mediaType,"data-attachment-size":bt.size,"aria-label":bt.name},[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p(E4)()},null,8,fJe),A("span",hJe,F(p(Su)(bt.name??"")),1)],8,dJe))],64))),128))])):ee("",!0),st.pluginCommand?(k(),L("div",pJe,[A("div",mJe,[Ue[3]||(Ue[3]=A("span",{class:"skill-act-arrow"},"▶",-1)),A("span",null,"/"+F(st.pluginCommand.pluginId)+":"+F(st.pluginCommand.commandName),1)])])):ee("",!0),rt(st)!==null||(st.inlineAttachments?.length??0)>0?(k(),L("div",{key:3,class:Re(["u-text-wrap",{"is-clamped":Lt(st.id),"u-text-wrap-args":Nt(st)}])},[A("div",{class:Re(Nt(st)?"skill-act-args":"u-text"),ref_for:!0,ref:bt=>Fe(st.id,bt)},[U(p(MA),{text:rt(st)??"","open-file":p(w)?.openFile,attachments:st.inlineAttachments},null,8,["text","open-file","attachments"])],2),ft.has(st.id)?(k(),L("button",{key:0,type:"button",class:"u-text-toggle","aria-expanded":!Lt(st.id),onClick:bt=>Qt(st.id,bt)},[A("span",null,F(Lt(st.id)?p(i)("conversation.userMessage.expand"):p(i)("conversation.userMessage.collapse")),1),U(p(Ce),{class:"u-text-toggle-car",name:"chevron-down",size:"sm","aria-hidden":"true"})],8,gJe)):ee("",!0)],2)):ee("",!0)],10,XYe),st.createdAt||ue(st)||!e.readOnly&&e.undoHintTurnId===st.id?(k(),L("div",vJe,[ue(st)||!e.readOnly&&e.undoHintTurnId===st.id?(k(),L("div",{key:0,class:Re(["u-edit-wrap",{undoing:ae.value===st.id}])},[e.undoHintTurnId===st.id?(k(),de(p(Nn),{key:0,text:p(i)("conversation.undoTooltip")},{default:ce(()=>[A("button",{type:"button",class:"u-edit u-edit-armed","aria-label":p(i)("conversation.undoTooltip"),onClick:bt=>b("armedUndo",st.id)},[U(p(Ce),{name:"undo",size:"sm"}),A("span",kJe,[$e(F(p(i)("conversation.escUndoHintPre")),1),U(p(mc),{keys:["Esc"]}),$e(F(p(i)("conversation.escUndoHintPost")),1)])],8,yJe)]),_:2},1032,["text"])):(k(),de(p(Nn),{key:1,text:p(i)("conversation.undoTooltip")},{default:ce(()=>[A("button",{type:"button",class:"u-edit","aria-label":p(i)("conversation.undoTooltip"),onClick:bt=>re(st)},[U(p(Ce),{name:"undo",size:"sm"})],8,bJe)]),_:2},1032,["text"]))],2)):ee("",!0),U(p(Nn),{text:p(i)("filePreview.copy")},{default:ce(()=>[st.text.trim().length>0?(k(),L("button",{key:0,type:"button",class:"u-copy","aria-label":p(i)("filePreview.copy"),onClick:Tt(bt=>ze(st),["stop"])},[fe.value!==st.id?(k(),de(p(Ce),{key:0,name:"copy",size:"sm"})):(k(),de(p(Ce),{key:1,name:"check",size:"sm"}))],8,wJe)):ee("",!0)]),_:2},1032,["text"]),st.createdAt?(k(),de(hS,{key:1,time:st.createdAt},null,8,["time"])):ee("",!0)])):ee("",!0)])):st.role==="compaction"?(k(),L("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":st.id,role:"separator"},[Ue[4]||(Ue[4]=A("span",{class:"cd-line","aria-hidden":"true"},null,-1)),st.text&&p(w)?.openCompaction!==void 0?(k(),L("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:bt=>p(w)?.openCompaction?.({turnId:st.id})},[A("span",null,F(se(st)),1),A("span",xJe,F(p(i)("conversation.viewSummary")),1)],8,AJe)):(k(),L("span",SJe,F(se(st)),1)),Ue[5]||(Ue[5]=A("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,CJe)):st.role==="cron"?(k(),de(yQe,{key:2,text:st.text,cron:st.cron,"turn-id":st.id,"created-at":st.createdAt},null,8,["text","cron","turn-id","created-at"])):(k(),L("div",{key:3,class:"a-msg turn-anchor","data-turn-id":st.id},[st.goalContinuation?(k(),L("div",MJe,[U(p(Ce),{name:"target",size:"sm","aria-hidden":"true"}),A("span",null,F(p(i)("conversation.goal.continuation")),1)])):ee("",!0),!e.inspector&&p(s)&&ji(st).folded.length>0?(k(),de(GGe,{key:1,items:ji(st).folded,mobile:"","streaming-tail-index":Uo(st),live:st.id===f.value,parked:st.id===f.value&&Uo(st)===null,"seed-ms":p(yst)(p(hc)(st)),"created-ms":p(QB)(st.createdAt),"ended-ms":p(QB)(st.endedAt),"duration-ms":st.durationMs,onOpenMedia:C,onDetach:T},null,8,["items","streaming-tail-index","live","parked","seed-ms","created-ms","ended-ms","duration-ms"])):ee("",!0),(k(!0),L(De,null,Ct(xi(st),(bt,Zn)=>(k(),L(De,{key:p(LZ)(bt,Zn)},[bt.kind==="thinking"?(k(),de(cS,{key:0,text:bt.thinking,mobile:"",streaming:Gt(st,bt),"started-at":bt.startedAt,"duration-ms":bt.durationMs,"instant-reveal":e.inspector},null,8,["text","streaming","started-at","duration-ms","instant-reveal"])):bt.kind==="text"&&bt.text?(k(),L("div",IJe,[U(p(Sc),{text:bt.text,streaming:Gt(st,bt),"open-file":p(w)?.openFile},null,8,["text","streaming","open-file"])])):bt.kind==="activity-run"?(k(),de(cZ,{key:2,items:bt.items,mobile:"",streaming:ri(st,bt),"force-open":e.inspector,onOpenMedia:C,onDetach:T},null,8,["items","streaming","force-open"])):bt.kind==="tool"?(k(),de(fS,{key:3,tool:bt.tool,mobile:"",onOpenMedia:C,onDetach:T},null,8,["tool"])):bt.kind==="notification"?(k(),de(dZ,{key:4,items:bt.items},null,8,["items"])):ee("",!0)],64))),128)),!e.inspector&&h.value.get(st.id)?(k(),de(cQe,{key:2,changes:h.value.get(st.id),"turn-id":st.id,cwd:r.cwd,interactive:e.turnFilesInteractive},null,8,["changes","turn-id","cwd","interactive"])):ee("",!0),!e.inspector&&st.id!==f.value&&ne(_n)&&Ae(_n)&&(ye(_n).trim().length>0||G(st))?(k(),L("div",TJe,[G(st)?(k(),L("span",EJe,F(G(st)),1)):ee("",!0),U(p(Nn),{text:p(i)("filePreview.copy")},{default:ce(()=>[ye(_n).trim().length>0?(k(),L("button",{key:0,class:"a-cpbtn","aria-label":p(i)("filePreview.copy"),onClick:bt=>qe(_n)},[fe.value!==st.id?(k(),de(p(Ce),{key:0,name:"copy",size:"sm"})):(k(),de(p(Ce),{key:1,name:"check",size:"sm"}))],8,LJe)):ee("",!0)]),_:2},1032,["text"])])):ee("",!0)],8,_Je)),st.role==="assistant"&&st.id===e.interruptedTurnId?(k(),L("div",NJe,[Ue[6]||(Ue[6]=A("span",{class:"cd-line","aria-hidden":"true"},null,-1)),A("span",DJe,F(p(i)("conversation.turnInterrupted")),1),Ue[7]||(Ue[7]=A("span",{class:"cd-line","aria-hidden":"true"},null,-1))])):ee("",!0)],64))),128)),e.turnFailed?(k(),L("div",FJe,[A("span",BJe,[U(p(Ce),{name:"alert-triangle",size:"sm"})]),A("div",RJe,[A("span",$Je,F(v.value),1),e.turnError?.message?(k(),L("span",{key:0,class:"tf-sub",title:e.turnError.message},F(e.turnError.message),9,OJe)):ee("",!0),y.value?(k(),L("span",{key:1,class:"tf-meta",title:y.value},F(y.value),9,PJe)):ee("",!0)]),e.readOnly?ee("",!0):(k(),de(p(sn),{key:0,variant:"secondary",size:"sm",onClick:Ue[1]||(Ue[1]=st=>b("resumeTurn"))},{default:ce(()=>[$e(F(p(i)("conversation.turnFailedResume")),1)]),_:1}))])):ee("",!0),e.compaction?(k(),de(qUe,{key:4,label:p(i)("conversation.compacting")},null,8,["label"])):ee("",!0),m.value?(k(),L("div",zJe,[U(vS,{label:g.value},null,8,["label"])])):ee("",!0),e.queued.length>0?(k(),L("div",jJe,[A("div",HJe,[A("span",WJe,[U(p(Ce),{name:"mail",size:"sm"}),$e(" "+F(p(i)("composer.queueLabel"))+" · ",1),A("b",null,F(p(i)("composer.queuePending",{n:e.queued.length})),1)])]),(k(!0),L(De,null,Ct(e.queued,(st,_n)=>(k(),L("div",{key:st.id,class:Re(["u-turn q-turn",{"q-dragging":B.value===_n,"drop-before":P.value?.index===_n&&P.value.position==="before","drop-after":P.value?.index===_n&&P.value.position==="after"}]),onDragover:bt=>Q(_n,bt),onDrop:bt=>te(_n,bt)},[_n===0?(k(),de(p(Nn),{key:0,text:p(i)("composer.queueSteer")},{default:ce(()=>[A("button",{type:"button",class:"q-send","aria-label":p(i)("composer.queueSteer"),onClick:Tt(bt=>b("steerQueued",_n),["stop"])},[U(p(Ce),{name:"send",size:"lg"})],8,UJe)]),_:2},1032,["text"])):ee("",!0),A("div",VJe,[A("span",{class:"q-grip",title:p(i)("composer.queueDragTitle"),draggable:"true",onDragstart:bt=>W(_n,bt),onDragend:X},[U(p(Ce),{name:"grip",size:"sm"})],40,KJe),A("div",{class:Re(["q-clamp u-text-wrap",{"is-clamped":Lt(Ke(st))}])},[A("button",{type:"button",class:"q-body",title:p(i)("composer.editQueued"),ref_for:!0,ref:bt=>Fe(Ke(st),bt),onClick:bt=>ie(_n)},[st.text?(k(),L("span",GJe,[U(p(MA),{text:st.text,interactive:!1,attachments:st.attachments},null,8,["text","attachments"])])):(k(),L("span",QJe,[U(p(Ce),{name:"file",size:"sm"}),$e(" "+F(p(i)("composer.queuedAttachments",{n:st.attachments?.length??0})),1)]))],8,ZJe),ft.has(Ke(st))?(k(),L("button",{key:0,type:"button",class:"u-text-toggle","aria-expanded":!Lt(Ke(st)),onClick:bt=>Qt(Ke(st),bt)},[A("span",null,F(Lt(Ke(st))?p(i)("conversation.userMessage.expand"):p(i)("conversation.userMessage.collapse")),1),U(p(Ce),{class:"u-text-toggle-car",name:"chevron-down",size:"sm","aria-hidden":"true"})],8,YJe)):ee("",!0)],2),H(st)?(k(),L("div",JJe,[(k(!0),L(De,null,Ct(j(st),(bt,Zn)=>(k(),L(De,{key:Zn},[bt.kind==="file"?(k(),L("span",XJe,[U(p(Ce),{name:"file",size:"sm"}),$e(" "+F(bt.name??bt.fileId),1)])):(k(),de(dS,{key:1,url:bt.url,kind:bt.kind,"file-id":bt.fileId,"session-id":bt.sessionId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id","session-id"]))],64))),128))])):ee("",!0),A("button",{type:"button",class:"q-edit","aria-label":p(i)("composer.editQueued"),onClick:Tt(bt=>Z(_n),["stop"])},[U(p(Ce),{name:"pencil",size:"sm"})],8,eXe),U(p(Nn),{text:p(i)("composer.remove")},{default:ce(()=>[A("button",{type:"button",class:"q-rm","aria-label":p(i)("composer.remove"),onClick:Tt(bt=>b("unqueue",_n),["stop"])},[U(p(Ce),{name:"close",size:"sm"})],8,tXe)]),_:2},1032,["text"])])],42,qJe))),128))])):ee("",!0)],544),wt.value?(k(),de(CZ,{key:0,media:wt.value,"origin-img":dn.value,onClose:Ue[2]||(Ue[2]=st=>{wt.value=null,dn.value=null})},null,8,["media","origin-img"])):ee("",!0),S.value?(k(),de(AZ,{key:1,visible:N.value!==null,x:N.value?.x??0,y:N.value?.y??0,bottom:N.value?.bottom??0,px:N.value?.px,py:N.value?.py,quote:N.value?.quote??"","focus-on-open":I.value,"focus-return-el":c.value,onAction:O,onClose:z},null,8,["visible","x","y","bottom","px","py","quote","focus-on-open","focus-return-el"])):ee("",!0)],64))}}),yS=xt(rXe,[["__scopeId","data-v-999e1e60"]]),lXe={class:"agent-panel"},aXe={class:"agent-transcript-inner"},uXe={key:0,class:"agent-meta"},cXe={class:"agent-meta-text"},dXe={key:1,class:"agent-prompt"},fXe={class:"agent-prompt-bubble"},hXe=["aria-expanded"],pXe={key:0,class:"agent-error"},mXe=6,gXe=lt({__name:"AgentDetailPanel",props:{member:{},turns:{},running:{type:Boolean},loading:{type:Boolean},loadError:{type:Boolean},hasMore:{type:Boolean},loadingMore:{type:Boolean},loadMoreError:{type:Boolean}},emits:["loadOlderMessages","openMedia"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=Jt(qo);ii(qo,s&&{...s,openTurnDiff:({change:j})=>s.openTurnDiff({turnId:`agent:${n.member.id}`,change:j}),openCompaction:void 0});const r=D(()=>n.member.kind==="bash"),l=D(()=>{const j=n.member.prompt;return j!==void 0&&j.trim()!==""?j:void 0}),a=V(null),u=V(!1),c=V(!1),d=D(()=>u.value&&!c.value);function f(){const j=a.value;if(!j)return;const Z=Number.parseFloat(getComputedStyle(j).lineHeight);!Number.isFinite(Z)||Z<=0||(u.value=j.scrollHeight>Z*mXe+1)}const h=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>f());We(a,(j,Z)=>{Z&&h?.unobserve(Z),j&&h?.observe(j),f()}),We(l,()=>{c.value=!1,ht(f)});function m(j){if(!c.value)T();else{const Z=j.currentTarget instanceof HTMLElement?j.currentTarget:null,ie=b.value;if(Z!==null&&ie!==null){const W=Z.getBoundingClientRect().top;requestAnimationFrame(()=>{ie.scrollTop+=Z.getBoundingClientRect().top-W})}}c.value=!c.value}const g=D(()=>{const j=l.value;if(j===void 0)return n.turns;const Z=n.turns.findIndex(Q=>Q.role==="user");if(Z===-1)return n.turns;const ie=n.turns[Z];return ie.text!==j?n.turns:(ie.attachments?.length??0)>0?n.turns.map((Q,te)=>te===Z?{...Q,text:""}:Q):n.turns.filter((Q,te)=>te!==Z)}),v=D(()=>{const j=l.value;if(j!==void 0)return n.turns.find(Z=>Z.role==="user"&&Z.text===j)?.inlineAttachments}),y=D(()=>n.member.id),{scroller:b,following:w,onScroll:C,pinScroll:T,jumpToBottom:N}=ePe(y),I=D(()=>n.member.status==="running"&&n.member.phase!=="queued"&&n.member.phase!=="suspended"&&!(n.loading&&g.value.length===0)),S=D(()=>o(R.value.length>0?"conversation.working":"conversation.requesting"));We(y,()=>{c.value=!1});const _=V(!1);let x=null,E=null;function M(){x!==null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(x),E!==null&&clearTimeout(E),x=null,E=null}We(y,()=>{_.value=!1,M();const j=()=>{M(),_.value=!0};typeof requestAnimationFrame=="function"?x=requestAnimationFrame(()=>{x=requestAnimationFrame(j)}):E=setTimeout(j,32)},{immediate:!0}),ti(()=>{M(),h?.disconnect()});const R=D(()=>{const j=new Set,Z=[],ie=n.member.prompt?.trim(),W=ie?`$ ${ie}`:null;for(const Q of[n.member.suspendedReason,n.member.text,n.member.outputLines?.join(` -`),n.member.summary]){const te=Q?.trim();!te||j.has(te)||W!==null&&te===W||(j.add(te),Z.push(te))}return Z}),q=D(()=>n.member.kind==="subagent");ii(df,()=>{b.value&&T()});const z=Jt(im),O=Jt(om),B=D(()=>{const j=n.member.subagentType?.trim();return j?j.charAt(0).toUpperCase()+j.slice(1):void 0}),P=D(()=>{const j=[z?.(n.member.model),O?.(n.member.thinkingEffort)].filter(Z=>!!Z);return j.length>0?j.join(" · "):void 0}),H=D(()=>{const j=[B.value,P.value].filter(Z=>!!Z);return j.length>0?j.join(" · "):void 0});return(j,Z)=>(k(),L("div",lXe,[A("div",{ref_key:"scroller",ref:b,class:"agent-transcript",onScrollPassive:Z[2]||(Z[2]=(...ie)=>p(C)&&p(C)(...ie))},[A("div",aXe,[H.value?(k(),L("div",uXe,[A("span",cXe,F(H.value),1)])):ee("",!0),l.value?(k(),L("section",dXe,[A("div",fXe,[A("div",{class:Re(["agent-prompt-wrap",{"is-clamped":d.value}])},[A("div",{ref_key:"promptTextEl",ref:a,class:Re(["agent-prompt-text",{"is-command":r.value}])},[r.value?(k(),L(De,{key:1},[$e(F(l.value),1)],64)):(k(),de(p(MA),{key:0,text:l.value??"","open-file":p(s)?.openFile,attachments:v.value},null,8,["text","open-file","attachments"]))],2),u.value?(k(),L("button",{key:0,type:"button",class:"agent-prompt-toggle","aria-expanded":!d.value,onClick:m},[A("span",null,F(d.value?p(o)("tasks.expand"):p(o)("tasks.collapse")),1),U(p(Ce),{class:Re(["agent-prompt-toggle-car",{open:!d.value}]),name:"chevron-down",size:"sm","aria-hidden":"true"},null,8,["class"])],8,hXe)):ee("",!0)],2)])])):ee("",!0),_.value?(k(),L(De,{key:2},[g.value.length===0&&!e.loading&&(e.loadError||R.value.length>0)?(k(),L("div",{key:0,class:Re(["agent-fallback",{prose:q.value}])},[e.loadError?(k(),L("div",pXe,F(p(o)("tasks.transcriptLoadError")),1)):ee("",!0),R.value.length>0?(k(),de(wl,{key:1,lines:R.value},null,8,["lines"])):ee("",!0),I.value?(k(),de(vS,{key:2,label:S.value},null,8,["label"])):ee("",!0)],2)):(k(),de(yS,{key:1,turns:g.value,"turn-active":e.running,"session-loading":e.loading&&g.value.length===0,"has-more-messages":e.hasMore,"loading-more":e.loadingMore,"loading-more-error":e.loadMoreError,"is-following":p(w),working:I.value,"read-only":"",inspector:"","selection-actions":!1,onLoadOlderMessages:Z[0]||(Z[0]=ie=>i("loadOlderMessages")),onOpenMedia:Z[1]||(Z[1]=ie=>i("openMedia",ie))},null,8,["turns","turn-active","session-loading","has-more-messages","loading-more","loading-more-error","is-following","working"]))],64)):ee("",!0)])],544),U(ko,{name:"agent-jump"},{default:ce(()=>[p(w)?ee("",!0):(k(),L("button",{key:0,class:"agent-jump-btn",type:"button",onClick:Z[3]||(Z[3]=ie=>p(N)())},[U(p(Ce),{class:"agent-jump-car",name:"arrow-down",size:"sm"}),A("span",null,F(p(o)("conversation.backToBottom")),1)]))]),_:1})]))}}),vXe=xt(gXe,[["__scopeId","data-v-1441b1f4"]]),yXe=["aria-label","aria-hidden"],kXe={class:"toc-scroll"},bXe=["onClick"],wXe={class:"toc-label"},CXe=240,AXe=lt({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=V(null),r=V(!0);let l=null;function a(){const c=s.value,d=c?.offsetParent;if(!c||!d)return;const f=c.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=CXe}const u=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return We(u,c=>{l?.disconnect(),l=null,c&&ht(()=>{const d=s.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ti(()=>{l?.disconnect(),l=null}),(c,d)=>u.value?(k(),L("nav",{key:0,ref_key:"navRef",ref:s,class:Re(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":p(o)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[A("div",kXe,[(k(!0),L(De,null,Ct(e.items,f=>(k(),L("button",{key:f.id,type:"button",class:Re(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>i("select",f.id)},[d[0]||(d[0]=A("span",{class:"toc-bar"},null,-1)),A("span",wXe,F(f.title),1)],10,bXe))),128))])],10,yXe)):ee("",!0)}}),xXe=xt(AXe,[["__scopeId","data-v-9c0a5438"]]),SXe={class:"changes-pane"},_Xe={class:"dv-path"},MXe={class:"diff-head"},IXe={class:"back-label"},TXe={key:"loading",class:"empty-state diff-loading"},EXe={key:"lines",class:"dv-lines-wrap"},LXe={key:"empty",class:"empty-state"},NXe={class:"dv-change-count"},DXe={class:"ch-head"},FXe={class:"br-heading"},BXe={class:"br-label"},RXe={class:"br-name"},$Xe={key:0,class:"sync-info"},OXe={key:0,class:"ahead"},PXe={key:0,class:"behind"},zXe={key:1,class:"empty-head"},jXe={class:"ch-list-content"},HXe=["onClick"],WXe={class:"fpath"},qXe=["onClick"],UXe={class:"tree-name"},VXe=["onClick"],KXe={class:"tree-name"},ZXe={key:2,class:"empty-state"},GXe={class:"empty-state-icon","aria-hidden":"true"},QXe={key:3,class:"empty-state"},YXe=lt({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},fullTexts:{},emptyFile:{type:Boolean},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=qt();function i(R){return n(R===1?"diff.fileCountOne":"diff.fileCountOther",{number:R})}const o=e,s=t;function r(R){const q=R.toLowerCase();return q==="modified"?"modified":q==="added"?"added":q==="deleted"?"deleted":q==="renamed"?"renamed":q==="untracked"?"untracked":q==="conflicted"?"conflicted":q==="ignored"?"ignored":q==="clean"?"clean":"unknown"}const l={modified:"M",added:"+",deleted:"−",renamed:"→",untracked:"+",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function a(R){return l[r(R)]??"?"}function u(R,q=60){return R.length<=q?R:"…"+R.slice(R.length-q+1)}const c=D(()=>o.gitInfo!==null),d=D(()=>o.changes.length>0),f=D(()=>(o.selectedDiffPath??null)!==null),h=D(()=>o.mode==="detail"||o.mode==="full"&&f.value),m=D(()=>o.fileDiff??[]),g=D(()=>o.fileDiffLoading===!0);function v(R){s("open",R)}function y(){s("back")}function b(){s("close")}const w=V("list");function C(R){w.value=R}function T(R){const q={children:[]},z=[...R].sort((O,B)=>O.path.localeCompare(B.path));for(const O of z){const B=O.path.endsWith("/"),P=O.path.split("/").filter(Boolean);if(P.length===0)continue;let H=q;for(let j=0;jte.name===Z&&te.kind===(ie?"file":"folder"));Q||(Q={name:Z,path:W,kind:ie?"file":"folder",status:ie?O.status:void 0,children:[]},H.children.push(Q)),H=Q}}return q.children}const N=D(()=>T(o.changes)),I=V(new Set);function S(R){return!I.value.has(R)}const _=D(()=>{const R=[];function q(z,O){for(const B of z)R.push({node:B,depth:O}),B.kind==="folder"&&S(B.path)&&q(B.children,O+1)}return q(N.value,0),R});function x(R){const q=new Set(I.value);q.has(R.path)?q.delete(R.path):q.add(R.path),I.value=q}function E(R){return`calc(var(--tree-base-indent) + ${R} * var(--tree-indent-step))`}function M(R){return{paddingLeft:E(R),"--tree-depth":String(R)}}return(R,q)=>(k(),L("div",SXe,[h.value?(k(),L(De,{key:0},[U(p(_1),{title:p(n)("diff.title"),closable:e.closable,"close-label":p(n)("diff.close"),onClose:b},{default:ce(()=>[U(p(Nn),{text:e.selectedDiffPath??""},{default:ce(()=>[A("span",_Xe,F(u(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),A("div",MXe,[e.hideBack?ee("",!0):(k(),de(p(sn),{key:0,variant:"ghost",size:"sm",onClick:y},{default:ce(()=>[U(p(Ce),{name:"arrow-left",size:"sm"}),A("span",IXe,F(p(n)("diff.back")),1)]),_:1}))]),U(ko,{name:"diff-content",mode:"out-in"},{default:ce(()=>[g.value?(k(),L("div",TXe,[U(p(mo),{size:"md"}),A("span",null,F(p(n)("diff.loading")),1)])):m.value.length>0?(k(),L("div",EXe,[U(Pa,{lines:m.value,path:e.selectedDiffPath??void 0,"line-numbers":"",framed:!1,"full-texts":e.fullTexts??null},null,8,["lines","path","full-texts"])])):(k(),L("div",LXe,F(e.emptyFile?p(n)("diff.emptyFile"):p(n)("diff.noDiff")),1))]),_:1})],64)):(k(),L(De,{key:1},[U(p(_1),{title:p(n)("diff.title"),closable:e.closable,"close-label":p(n)("diff.close"),onClose:b},{default:ce(()=>[A("span",NXe,F(i(e.changes.length)),1),U(p(Ms),{"model-value":w.value,size:"sm",options:[{value:"list",label:p(n)("diff.list"),icon:"list"},{value:"tree",label:p(n)("diff.tree"),icon:"tree-view"}],"onUpdate:modelValue":C},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),A("div",DXe,[c.value?(k(),L(De,{key:0},[A("span",FXe,[U(p(Ce),{class:"br-icon",name:"git-fork",size:"sm"}),A("span",BXe,F(p(n)("diff.branch")),1)]),A("span",RXe,F(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(k(),L("span",$Xe,[U(p(Nn),{text:p(n)("diff.aheadTitle")},{default:ce(()=>[e.gitInfo.ahead>0?(k(),L("span",OXe,"↑"+F(e.gitInfo.ahead),1)):ee("",!0)]),_:1},8,["text"]),U(p(Nn),{text:p(n)("diff.behindTitle")},{default:ce(()=>[e.gitInfo.behind>0?(k(),L("span",PXe,"↓"+F(e.gitInfo.behind),1)):ee("",!0)]),_:1},8,["text"])])):ee("",!0)],64)):(k(),L("span",zXe,F(p(n)("diff.empty")),1))]),d.value&&w.value==="list"?(k(),de(p(YM),{key:0,class:"ch-list"},{default:ce(()=>[A("div",jXe,[(k(!0),L(De,null,Ct(e.changes,z=>(k(),de(p(Nn),{key:z.path,text:z.path},{default:ce(()=>[A("button",{type:"button",class:"ch-row",onClick:O=>v(z.path)},[A("span",{class:Re(["badge",r(z.status)])},F(a(z.status)),3),A("span",WXe,F(u(z.path)),1)],8,HXe)]),_:2},1032,["text"]))),128))])]),_:1})):d.value&&w.value==="tree"?(k(),de(p(YM),{key:1,class:"ch-list ch-tree"},{default:ce(()=>[U(U$,{name:"tree-collapse",tag:"ul",class:"tree-list ch-list-content"},{default:ce(()=>[(k(!0),L(De,null,Ct(_.value,({node:z,depth:O})=>(k(),L("li",{key:z.path,class:"tree-node"},[z.kind==="folder"?(k(),L("button",{key:0,type:"button",class:"tree-row tree-folder",style:on(M(O)),onClick:B=>x(z)},[U(p(Ce),{class:"tree-icon",name:"folder-solid",size:"sm"}),A("span",UXe,F(z.name),1)],12,qXe)):(k(),de(p(Nn),{key:1,text:z.path},{default:ce(()=>[A("button",{type:"button",class:"tree-row tree-file",style:on(M(O)),onClick:B=>v(z.path)},[A("span",{class:Re(["badge",r(z.status)])},F(a(z.status)),3),A("span",KXe,F(z.name),1)],12,VXe)]),_:2},1032,["text"]))]))),128))]),_:1})]),_:1})):c.value?(k(),L("div",ZXe,[A("span",GXe,[U(p(Ce),{name:"check",size:"lg"})]),$e(" "+F(p(n)("diff.clean")),1)])):(k(),L("div",QXe,F(p(n)("diff.empty")),1))],64))]))}}),JXe=xt(YXe,[["__scopeId","data-v-2c83d74b"]]);function XXe(){const e=ms(Cn.openInDefaultTarget);return e!==null&&e!==""?e:null}XXe();const eet={key:0,class:"qh-chip"},tet={class:"qtitle"},net={class:"qbody"},iet={class:"qopts"},oet=["onClick"],set={class:"qopt-key"},ret={class:"qopt-text"},aet={class:"qopt-label"},uet={key:0,class:"qopt-desc"},cet={class:"qopt-text qopt-text-other"},det={class:"qopt-label"},fet={key:0,class:"qopt-desc"},het=["placeholder"],pet={class:"qfoot"},met={class:"qbtns"},get={class:"qhint"},vet=lt({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:i}=qt(),o=t,s=V(0),r=V(!1);function l(){r.value&&(r.value=!1)}const a=D(()=>n.question.questions[s.value]),u=D(()=>n.question.questions.length);function c(){s.value>0&&s.value--}function d(){s.value0:te.kind==="multiWithOther"?te.optionIds.length>0||te.otherText.trim().length>0:te.kind==="other"?te.text.trim().length>0:!0:!1}function h(){return f(a.value.id)}const m=V({});function g(Q){return Q.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${Q.label} ${Q.description??""}`.toLowerCase())}function v(){const Q={...m.value};let te=!1;for(const X of n.question.questions){if(Q[X.id])continue;const ge=X.options.filter(g);ge.length!==0&&(Q[X.id]=X.multiSelect?{kind:"multi",optionIds:ge.map(ue=>ue.id)}:{kind:"single",optionId:ge[0].id},te=!0)}te&&(m.value=Q)}We(()=>n.question.questionId,()=>{s.value=0,r.value=!1,m.value={},w.value={}}),We(()=>n.question,()=>{s.value>=n.question.questions.length&&(s.value=0),v()},{immediate:!0,deep:!0});function y(Q,te){const X=m.value[Q];if(X&&X.kind==="single"&&X.optionId===te){const ge={...m.value};delete ge[Q],m.value=ge}else m.value={...m.value,[Q]:{kind:"single",optionId:te}}}function b(Q,te){const X=m.value[Q],ge=X&&(X.kind==="multi"||X.kind==="multiWithOther")?X.kind==="multi"?[...X.optionIds]:[...X.optionIds]:[],ue=ge.indexOf(te);ue>=0?ge.splice(ue,1):ge.push(te);const se=m.value[Q],fe=se&&se.kind==="multiWithOther"?se.otherText:"";fe?m.value={...m.value,[Q]:{kind:"multiWithOther",optionIds:ge,otherText:fe}}:m.value={...m.value,[Q]:{kind:"multi",optionIds:ge}}}const w=V({}),C=V(null);function T(Q){const te=n.question.questions.find(ge=>ge.id===Q),X=w.value[Q]??"";if(te.multiSelect){const ge=m.value[Q],ue=ge&&(ge.kind==="multi"||ge.kind==="multiWithOther")?ge.kind==="multi"?[...ge.optionIds]:[...ge.optionIds]:[];m.value={...m.value,[Q]:{kind:"multiWithOther",optionIds:ue,otherText:X}}}else m.value={...m.value,[Q]:{kind:"other",text:X}}}function N(Q){T(Q),ht(()=>C.value?.focus())}function I(Q,te){const X=m.value[Q];return X?X.kind==="single"?X.optionId===te:X.kind==="multi"||X.kind==="multiWithOther"?X.optionIds.includes(te):!1:!1}function S(Q){const te=m.value[Q];return!!(te&&(te.kind==="other"||te.kind==="multiWithOther"))}function _(){return n.question.questions.every(Q=>f(Q.id))}const x=D(()=>n.busyKind==="answer"),E=D(()=>n.busyKind==="dismiss"),M=D(()=>!!n.busyKind);function R(){if(M.value||!_())return;const Q={answers:m.value,method:"click"};o("answer",n.question.questionId,Q)}function q(){M.value||o("dismiss",n.question.questionId)}const z=V(0);let O=!1;We([s,()=>n.question.questionId],()=>{z.value!==0&&(O=!0),z.value=0});const B=V(null);function P(Q,te){const X=Q.getBoundingClientRect(),ge=te.getBoundingClientRect(),ue=ge.top-X.top+Q.scrollTop,se=ue+ge.height;ge.height>=Q.clientHeight||ueQ.scrollTop+Q.clientHeight&&(Q.scrollTop=se-Q.clientHeight)}function H(){const Q=B.value,te=Q?.querySelector(".qbody");if(!Q||!te)return;const X=te.querySelectorAll(".qopt")[z.value];X&&(P(te,X),P(Q,X))}We(z,()=>{if(O){O=!1;return}ht(H)}),We(s,()=>{ht(()=>{const Q=B.value?.querySelector(".qbody");Q&&(Q.scrollTop=0),B.value&&(B.value.scrollTop=0)})});const{handleCompositionStart:j,handleCompositionEnd:Z,isComposingKeyEvent:ie}=kl();function W(Q){const te=(document.activeElement?.tagName??"").toLowerCase(),X=te==="input"||te==="textarea";if(Q.metaKey||Q.ctrlKey||Q.altKey||M.value||ie(Q)||rr.value>0)return;if(Q.key==="Enter"){if(Q.preventDefault(),r.value)return;s.value0||Q.defaultPrevented)return;Q.preventDefault(),q();return}if(r.value)return;if(Q.key==="ArrowDown"||Q.key==="ArrowUp"){const ue=a.value,se=ue.options.length+(ue.allowOther?1:0);if(se===0)return;Q.preventDefault();const fe=Q.key==="ArrowDown"?1:-1,G=Math.min(se-1,Math.max(0,z.value+fe));if(G===z.value){ht(H);return}z.value=G;const ae=ue.options[z.value];ae?ue.multiSelect||y(ue.id,ae.id):ue.allowOther&&!ue.multiSelect&&T(ue.id);return}if(Q.key===" "&&a.value.multiSelect){Q.preventDefault();const ue=a.value,se=ue.options[z.value];se?(b(ue.id,se.id),ht(H)):ue.allowOther&&(T(ue.id),ht(H));return}const ge=parseInt(Q.key,10);if(!isNaN(ge)&&ge>=1&&ge<=9){Q.preventDefault();const ue=a.value,se=ge-1,fe=ue.options[se];fe&&(z.value=se,ue.multiSelect?b(ue.id,fe.id):y(ue.id,fe.id),ht(H))}}return yn(()=>document.addEventListener("keydown",W)),Ln(()=>document.removeEventListener("keydown",W)),(Q,te)=>(k(),L("div",{ref_key:"cardEl",ref:B,class:Re(["qcard",{minimized:r.value}])},[A("div",{class:Re(["qh",{clickable:r.value}]),onClick:l},[u.value>1?(k(),L("span",eet,F(s.value+1),1)):ee("",!0),A("span",tet,F(a.value.question),1),U(p(ln),{class:"qmin",size:"sm",label:r.value?p(i)("question.expand"):p(i)("question.minimize"),tooltip:r.value?p(i)("question.expand"):p(i)("question.minimize"),onClick:te[0]||(te[0]=Tt(X=>r.value=!r.value,["stop"]))},{default:ce(()=>[r.value?(k(),de(p(Ce),{key:0,name:"chevron-up",size:"md"})):(k(),de(p(Ce),{key:1,name:"minus",size:"md"}))]),_:1},8,["label","tooltip"]),U(p(ln),{class:"qclose",size:"sm",label:p(i)("question.dismiss"),tooltip:p(i)("question.dismiss"),disabled:M.value,onClick:Tt(q,["stop"])},{default:ce(()=>[U(p(Ce),{name:"close",size:"md"})]),_:1},8,["label","tooltip","disabled"])],2),r.value?ee("",!0):(k(),L(De,{key:0},[A("div",net,[a.value.body?(k(),de(p(Sc),{key:0,text:a.value.body,class:"qmdbody"},null,8,["text"])):ee("",!0),A("div",iet,[(k(!0),L(De,null,Ct(a.value.options,(X,ge)=>(k(),L("label",{key:X.id,class:Re(["qopt",{selected:I(a.value.id,X.id),highlighted:a.value.multiSelect&&ge===z.value}]),onClick:Tt(ue=>{z.value=ge,a.value.multiSelect?b(a.value.id,X.id):y(a.value.id,X.id)},["prevent"])},[A("span",set,F(ge+1),1),A("span",{class:Re(["qopt-glyph",a.value.multiSelect?"chk":"rad"])},null,2),A("span",ret,[A("span",aet,F(X.label),1),X.description?(k(),L("span",uet,F(X.description),1)):ee("",!0)])],10,oet))),128)),a.value.allowOther?(k(),L("label",{key:0,class:Re(["qopt",{selected:S(a.value.id),highlighted:a.value.multiSelect&&z.value===a.value.options.length}]),onClick:te[6]||(te[6]=Tt(X=>{z.value=a.value.options.length,N(a.value.id)},["prevent"]))},[te[7]||(te[7]=A("span",{class:"qopt-key"},null,-1)),A("span",{class:Re(["qopt-glyph",a.value.multiSelect?"chk":"rad"])},null,2),A("span",cet,[A("span",det,F(a.value.otherLabel??p(i)("question.otherDefault")),1),a.value.otherDescription?(k(),L("span",fet,F(a.value.otherDescription),1)):ee("",!0)]),ai(A("input",{ref_key:"otherInputEl",ref:C,"onUpdate:modelValue":te[1]||(te[1]=X=>w.value[a.value.id]=X),class:"other-input",type:"text",placeholder:a.value.otherLabel??p(i)("question.otherDefault"),onInput:te[2]||(te[2]=X=>T(a.value.id)),onFocus:te[3]||(te[3]=X=>T(a.value.id)),onCompositionstart:te[4]||(te[4]=(...X)=>p(j)&&p(j)(...X)),onCompositionend:te[5]||(te[5]=(...X)=>p(Z)&&p(Z)(...X))},null,40,het),[[ur,w.value[a.value.id]]])],2)):ee("",!0)])]),A("div",pet,[A("div",met,[s.value[$e(F(p(i)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(k(),de(p(sn),{key:1,class:"qmain",size:"md",variant:"primary",disabled:!_(),loading:x.value,onClick:R},{default:ce(()=>[$e(F(p(i)("question.submit")),1)]),_:1},8,["disabled","loading"])),u.value>1?(k(),de(p(sn),{key:2,size:"md",variant:"ghost",disabled:s.value===0||M.value,onClick:c},{default:ce(()=>[$e(F(p(i)("question.back")),1)]),_:1},8,["disabled"])):ee("",!0),U(p(sn),{size:"md",variant:"ghost",loading:E.value,disabled:M.value,onClick:q},{default:ce(()=>[$e(F(p(i)("question.dismiss")),1)]),_:1},8,["loading","disabled"])]),A("span",get,F(p(i)("question.hint")),1)])],64))],2))}}),yet=xt(vet,[["__scopeId","data-v-645038cd"]]),ket={class:"sc"},bet={key:0,class:"sc-empty"},wet={key:2,class:"sc-loading"},Cet=["placeholder"],Aet=["disabled"],E5=po(new Set),xet=lt({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},agentId:{},title:{},subtitle:{},onSend:{type:Function}},emits:["close","openMedia"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=qt(),r=D(()=>i.turns.find(E=>E.role==="user")?.text?.trim()??""),l=D(()=>i.title?.trim()||s("sideChat.title")),a=D(()=>i.subtitle?.trim()?i.subtitle.trim():r.value||s("sideChat.subtitle")),u=D({get:()=>p1.get(i.agentId)??"",set:x=>{x===""?p1.delete(i.agentId):p1.set(i.agentId,x)}}),c=V(null),d=V(null),f=V(null),h=V(0);let m=null;We(f,x=>{m?.disconnect(),m=null,x!==null&&typeof ResizeObserver<"u"&&(m=new ResizeObserver(()=>{h.value=x.offsetHeight}),m.observe(x)),h.value=x?.offsetHeight??0}),Ln(()=>m?.disconnect());const g=D(()=>E5.has(i.agentId));async function v(){const x=u.value,E=tSe(x.trim());if(!(!E||g.value)){E5.add(i.agentId);try{if(!await i.onSend(E)||u.value!==x)return;u.value="",ht(()=>{c.value&&(c.value.style.height="auto"),y()})}finally{E5.delete(i.agentId)}}}function y(){const x=d.value;x&&(x.scrollTop=x.scrollHeight)}ii(df,x=>{const E=d.value;if(!E)return;const M=x.getBoundingClientRect().top;requestAnimationFrame(()=>{E.scrollTop+=x.getBoundingClientRect().top-M})}),ii(qo,void 0);const b=D(()=>{const x=i.turns;if(x.length===0)return"0";const E=x.at(-1),M=E.thinking?.length??0,R=E.tools?.reduce((q,z)=>q+z.name.length+(z.arg?.length??0)+(z.output?.join("").length??0),0)??0;return`${x.length}:${E.text.length}:${M}:${R}`});We(b,async()=>{!i.running&&!i.sending||(await ht(),y())});const w=D(()=>i.sending?i.turns.at(-1)?.role==="user":!1),{handleCompositionStart:C,handleCompositionEnd:T,isComposingKeyEvent:N}=kl();function I(x){x.key==="Enter"&&!x.shiftKey&&!N(x)&&(x.preventDefault(),v())}function S(){const x=c.value;x&&(x.style.height="auto",x.style.height=`${Math.min(x.scrollHeight,160)}px`)}function _(){c.value?.focus()}return t({focusInput:_}),(x,E)=>(k(),L("div",ket,[U(p(_1),{title:l.value,subtitle:a.value,"close-label":p(s)("thinking.close"),onClose:E[0]||(E[0]=M=>o("close"))},null,8,["title","subtitle","close-label"]),A("div",{ref_key:"bodyRef",ref:d,class:"sc-body",style:on(h.value>0?{paddingBottom:`${h.value}px`}:void 0)},[e.turns.length===0?(k(),L("div",bet,F(p(s)("sideChat.empty")),1)):(k(),de(yS,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running,"turn-files-interactive":!1,"selection-actions":!1,onOpenMedia:E[1]||(E[1]=M=>o("openMedia",M))},null,8,["turns","turn-active","working"])),w.value?(k(),L("div",wet,[U(vS,{label:p(s)("conversation.requesting")},null,8,["label"])])):ee("",!0)],4),A("div",{ref_key:"composerEl",ref:f,class:"sc-composer"},[ai(A("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":E[2]||(E[2]=M=>u.value=M),class:"sc-input",rows:"1",placeholder:p(s)("sideChat.placeholder"),onInput:S,onKeydown:I,onCompositionstart:E[3]||(E[3]=(...M)=>p(C)&&p(C)(...M)),onCompositionend:E[4]||(E[4]=(...M)=>p(T)&&p(T)(...M))},null,40,Cet),[[ur,u.value]]),U(p(Nn),{text:p(s)("sideChat.send")},{default:ce(()=>[A("button",{type:"button",class:"sc-send",disabled:!u.value.trim()||g.value,onClick:v},[U(p(Ce),{name:"arrow-right",size:"sm"})],8,Aet)]),_:1},8,["text"])],512)]))}}),_et=xt(xet,[["__scopeId","data-v-9932e21c"]]),Met={class:"rows"},Iet={class:"row"},Tet={class:"row"},Eet={key:0},Let={key:1,class:"thinking-value"},Net={class:"cache-note"},Det={key:2},Fet={class:"row"},Bet={class:"row"},Ret={class:"row"},$et={class:"row"},Oet={class:"ctx-text"},Pet={key:0,class:"bar"},zet={class:"row"},jet=lt({__name:"StatusPanel",props:{status:{},thinking:{},model:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close","setThinking"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t,s=D(()=>K1(i.model)),r=D(()=>Z1(i.model)),l=D(()=>r.value.includes(i.thinking)?i.thinking:""),a=D(()=>r.value.map(w=>({value:w,label:Bd(w)})));function u(w){o("setThinking",wk(i.model,w))}const c=V(!0),d=D(()=>i.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(i.status.ctxUsed/i.status.ctxMax*100)))),f=D(()=>i.status.ctxMax>0?n("status.statusContextValue",{used:Ac(i.status.ctxUsed),max:Ac(i.status.ctxMax),pct:d.value}):n("status.statusNone"));function h(w){return n(w==="yolo"?"status.permissionYolo":w==="auto"?"status.permissionAuto":"status.permissionManual")}const m=D(()=>{const w=i.status.permission;return w==="auto"?"var(--color-danger)":w==="yolo"?"var(--color-warning)":"var(--color-text)"}),g=D(()=>i.planMode?n("status.planOn"):n("status.planOff")),v=D(()=>i.swarmMode?n("status.swarmOn"):n("status.swarmOff")),y=D(()=>typeof i.costUsd=="number"&&i.costUsd>0),b=D(()=>y.value?`$${i.costUsd.toFixed(4)}`:n("status.statusNone"));return(w,C)=>(k(),de(p(ef),{open:c.value,"onUpdate:open":C[0]||(C[0]=T=>c.value=T),title:p(n)("status.statusPanelTitle"),onClose:C[1]||(C[1]=T=>o("close"))},{default:ce(()=>[A("dl",Met,[A("div",Iet,[A("dt",null,F(p(n)("status.statusModel")),1),A("dd",null,F(e.status.model),1)]),A("div",Tet,[A("dt",null,F(p(n)("status.statusThinking")),1),s.value==="unsupported"?(k(),L("dd",Eet,F(p(n)("status.modeNotSupported")),1)):r.value.length>1?(k(),L("dd",Let,[U(p(Ms),{"model-value":l.value,options:a.value,size:"xs","aria-label":p(n)("status.statusThinking"),"onUpdate:modelValue":u},null,8,["model-value","options","aria-label"]),A("span",Net,F(p(n)("status.cacheNote")),1)])):(k(),L("dd",Det,F(p(Bd)(r.value[0]??"on")),1))]),A("div",Fet,[A("dt",null,F(p(n)("status.statusPermission")),1),A("dd",{style:on({color:m.value})},F(h(e.status.permission)),5)]),A("div",Bet,[A("dt",null,F(p(n)("status.statusPlanMode")),1),A("dd",{class:Re({"plan-on":e.planMode})},F(g.value),3)]),A("div",Ret,[A("dt",null,F(p(n)("status.statusSwarmMode")),1),A("dd",{class:Re({"swarm-on":e.swarmMode})},F(v.value),3)]),A("div",$et,[A("dt",null,F(p(n)("status.statusContext")),1),A("dd",null,[A("span",Oet,F(f.value),1),e.status.ctxMax>0?(k(),L("span",Pet,[A("i",{style:on({width:d.value+"%"})},null,4)])):ee("",!0)])]),A("div",zet,[A("dt",null,F(p(n)("status.statusCost")),1),A("dd",null,F(b.value),1)])])]),_:1},8,["open","title"]))}}),Het=xt(jet,[["__scopeId","data-v-1e95fd47"]]),Wet={class:"tp"},qet=lt({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=V(null);return We(()=>n.text,()=>{const r=s.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ht(()=>{s.value&&(s.value.scrollTop=s.value.scrollHeight)})},{immediate:!0}),(r,l)=>(k(),L("div",Wet,[U(p(_1),{title:p(o)("common.preview"),subtitle:e.subtitle??p(o)("thinking.panelTitle"),"close-label":p(o)("thinking.close"),onClose:l[0]||(l[0]=a=>i("close"))},null,8,["title","subtitle","close-label"]),A("pre",{ref_key:"bodyEl",ref:s,class:"tp-body"},F(e.text),513)]))}}),Uet=xt(qet,[["__scopeId","data-v-5ecb9355"]]),Vet={class:"td"},Ket={class:"td-path"},Zet={class:"td-body"},Get={key:1,class:"td-empty"},Qet=lt({__name:"TurnDiffPanel",props:{change:{},cwd:{},closable:{type:Boolean}},emits:["close","openFile"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=D(()=>{const a=n.cwd?Ak(n.change.path,n.cwd):null;return r(a??n.change.path)});function r(a,u=48){return!a||a.length<=u?a:"…"+a.slice(a.length-u+1)}const l=D(()=>n.change.diff!==null&&n.change.diff.length>0);return(a,u)=>(k(),L("div",Vet,[U(p(_1),{title:p(o)("conversation.turnFiles.diffTitle"),closable:e.closable,"close-label":p(o)("filePreview.close"),onClose:u[1]||(u[1]=c=>i("close"))},{default:ce(()=>[U(p(Nn),{text:e.change.path},{default:ce(()=>[A("span",Ket,F(s.value),1)]),_:1},8,["text"]),U(p(ln),{size:"sm",label:p(o)("conversation.turnFiles.openFile"),tooltip:p(o)("conversation.turnFiles.openFile"),onClick:u[0]||(u[0]=c=>i("openFile",e.change.path))},{default:ce(()=>[U(p(Ce),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])]),_:1},8,["title","closable","close-label"]),A("div",Zet,[l.value?(k(),de(Pa,{key:0,lines:e.change.diff,path:e.change.path,framed:!1},null,8,["lines","path"])):(k(),L("div",Get,[A("p",null,F(p(o)("conversation.turnFiles.diffUnavailable")),1),U(p(sn),{variant:"ghost",size:"sm",onClick:u[2]||(u[2]=c=>i("openFile",e.change.path))},{default:ce(()=>[$e(F(p(o)("conversation.turnFiles.openFile")),1)]),_:1})]))])]))}}),Yet=xt(Qet,[["__scopeId","data-v-6c964102"]]),Jet={class:"fc-label"},Xet=lt({__name:"FilterControl",props:{modelValue:{},options:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,o=D(()=>n.options.find(x=>x.value===n.modelValue)),s=typeof window<"u"&&window.matchMedia?.("(hover: none)").matches?"lg":"md",r=V(null),l=V(!1);let a=0,u=null;async function c(){const x=r.value?.closest(".dock-work-head");if(!x)return;const E=x.querySelector(".wp-head-tab"),M=getComputedStyle(x),R=(parseFloat(M.columnGap)||0)*2,q=x.clientWidth-parseFloat(M.paddingLeft)-parseFloat(M.paddingRight)-R,z=E?.scrollWidth??0;if(!l.value){const B=r.value?.querySelector(".ui-seg");B!==null&&B.offsetWidth>0&&(a=B.offsetWidth)}const O=z+a>q;if(l.value=O,!O){await ht();const B=r.value?.querySelector(".ui-seg");B!==null&&B.offsetWidth>0&&(a=B.offsetWidth),l.value=z+a>q}}yn(()=>{const x=r.value?.closest(".dock-work-head");!x||typeof ResizeObserver!="function"||(u=new ResizeObserver(c),u.observe(x),c())}),We(l,x=>{!x&&d.value&&y()}),We(rr,x=>{x>0&&d.value&&y()}),We(()=>n.options,async()=>{a=0,await ht(),c()},{flush:"post"});const d=V(!1),f=V(null);function h(){return f.value?.$el??null}const m=V(null),g=V({left:"0px",top:"0px"});async function v(){if(d.value){y();return}d.value=!0,await ht(),b(),w(),window.addEventListener("mousedown",N,!0),window.addEventListener("keydown",I,!0),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0)}function y(x){d.value=!1,window.removeEventListener("mousedown",N,!0),window.removeEventListener("keydown",I,!0),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0),x?.refocus&&h()?.focus()}function b(){const x=h();if(!x)return;const E=x.getBoundingClientRect(),M=m.value?.offsetHeight??0,R=getComputedStyle(document.documentElement),q=Number.parseFloat(R.getPropertyValue("--space-2"))||0,z=Number.parseFloat(R.getPropertyValue("--space-1"))||0,O=m.value?.offsetWidth??0,B=Math.min(E.left,Math.max(q,window.innerWidth-O-q));E.bottom+z+M<=window.innerHeight-q?g.value={left:`${B}px`,top:`${E.bottom+z}px`}:g.value={left:`${B}px`,bottom:`${window.innerHeight-E.top+z}px`}}function w(){const x=m.value;if(!x)return;(x.querySelector(".ui-menu-item.is-active")??x.querySelector(".ui-menu-item"))?.focus()}function C(){d.value||v()}function T(x){const E=x.relatedTarget;E&&(m.value?.contains(E)||h()?.contains(E))||y()}function N(x){const E=x.target;if(E){if(m.value?.contains(E)){x.stopImmediatePropagation();return}h()?.contains(E)||y()}}function I(x){x.key==="Escape"&&(x.preventDefault(),x.stopImmediatePropagation(),y({refocus:!0}))}function S(x){if(x.key!=="ArrowDown"&&x.key!=="ArrowUp")return;x.preventDefault();const E=Array.from(m.value?.querySelectorAll(".ui-menu-item")??[]);if(E.length===0)return;const M=E.indexOf(document.activeElement),R=x.key==="ArrowDown"?(M+1)%E.length:(M-1+E.length)%E.length;E[R]?.focus()}function _(x){i("update:modelValue",x),y({refocus:!0})}return ti(()=>{u?.disconnect(),d.value&&y()}),(x,E)=>(k(),L("span",{ref_key:"root",ref:r,class:"filter-control"},[l.value?(k(),L(De,{key:0},[U(p(FO),{ref_key:"triggerRef",ref:f,class:"fc-trigger","aria-haspopup":"menu","aria-expanded":d.value,onClick:v,onKeydown:[Qo(Tt(C,["prevent"]),["down"]),Qo(Tt(C,["prevent"]),["up"])],onFocusout:T},{default:ce(()=>[o.value?.icon?(k(),de(p(Ce),{key:0,name:o.value.icon,size:"sm"},null,8,["name"])):ee("",!0),A("span",null,F(o.value?.label),1),U(p(Ce),{class:"fc-chevron",name:"chevron-down",size:"sm"})]),_:1},8,["aria-expanded","onKeydown"]),(k(),de(cs,{to:"body"},[d.value?(k(),L("div",{key:0,ref_key:"menuBoxRef",ref:m,class:"fc-menu",style:on(g.value),onKeydown:S,onFocusout:T},[U(p(zs),null,{default:ce(()=>[(k(!0),L(De,null,Ct(e.options,M=>(k(),de(p(nn),{key:M.value,role:"menuitemradio",active:M.value===e.modelValue,"aria-checked":M.value===e.modelValue,size:p(s),onClick:R=>_(M.value)},{default:ce(()=>[M.icon?(k(),de(p(Ce),{key:0,name:M.icon,size:"sm","data-icon":M.icon},null,8,["name","data-icon"])):ee("",!0),A("span",Jet,F(M.label),1),M.value===e.modelValue?(k(),de(p(Ce),{key:1,class:"fc-check",name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["active","aria-checked","size","onClick"]))),128))]),_:1})],36)):ee("",!0)]))],64)):(k(),de(p(Ms),{key:1,"model-value":e.modelValue,options:e.options,size:"md","onUpdate:modelValue":E[0]||(E[0]=M=>i("update:modelValue",M))},null,8,["model-value","options"]))],512))}}),VB=xt(Xet,[["__scopeId","data-v-9d5b56c7"]]),ett={class:"goal-panel"},ttt={key:0,class:"goal-criterion"},ntt={class:"goal-criterion-label"},itt=lt({__name:"GoalPanel",props:{goal:{}},setup(e){const{t}=qt(),n=Jt(qo);return(i,o)=>(k(),L("div",ett,[U(p(Sc),{text:e.goal.objective,"open-file":p(n)?.openFile},null,8,["text","open-file"]),e.goal.completionCriterion?(k(),L("div",ttt,[A("span",ntt,[U(p(Ce),{name:"check-list",size:"sm"}),$e(" "+F(p(t)("status.goalDoneWhen")),1)]),U(p(Sc),{text:e.goal.completionCriterion,"open-file":p(n)?.openFile},null,8,["text","open-file"])])):ee("",!0)]))}}),ott=xt(itt,[["__scopeId","data-v-6dea2f18"]]),stt={class:"plan-panel"},rtt={key:0,class:"plan-review-row"},ltt={class:"plan-review-label"},att={key:1,class:"plan-review-row"},utt={class:"plan-review-label"},ctt={class:"plan-review-feedback"},dtt={key:3,class:"plan-path-only"},ftt={class:"plan-path-hint"},htt={key:1,class:"plan-empty"},ptt=lt({__name:"PlanPanel",props:{plan:{},planModeOn:{type:Boolean}},setup(e){const t=e,{t:n}=qt(),i=Jt(qo),o=D(()=>t.plan&&!t.plan.plan&&t.plan.path?t.plan.path:void 0);function s(){o.value&&i?.openFile({path:o.value})}return(r,l)=>(k(),L("div",stt,[e.plan?(k(),L(De,{key:0},[e.plan.review?.selectedOption?(k(),L("div",rtt,[A("span",ltt,F(p(n)("tools.plan.selectedOption")),1),A("span",null,F(e.plan.review.selectedOption),1)])):ee("",!0),e.plan.review?.feedback?(k(),L("div",att,[A("span",utt,F(p(n)("tools.plan.feedback")),1),A("span",ctt,F(e.plan.review.feedback),1)])):ee("",!0),e.plan.plan?(k(),de(p(Sc),{key:2,text:e.plan.plan,"open-file":p(i)?.openFile},null,8,["text","open-file"])):ee("",!0),o.value?(k(),L("div",dtt,[A("span",ftt,F(p(n)("tools.plan.pathOnlyHint")),1),U(p(sn),{variant:"ghost",size:"sm",class:"plan-path",onClick:s},{default:ce(()=>[$e(F(o.value),1)]),_:1})])):ee("",!0)],64)):(k(),L("div",htt,[U(p(Ce),{name:"file-edit",size:"lg",class:"plan-empty-ico"}),A("span",null,F(e.planModeOn?p(n)("status.planEmptyArmed"):p(n)("status.planEmptyIdle")),1)]))]))}}),mtt=xt(ptt,[["__scopeId","data-v-69db97fc"]]),gtt={key:0,class:"sg-empty"},vtt={key:1,class:"sg-grid"},ytt=["aria-label","onClick"],ktt={class:"sg-top"},btt={class:"sg-num"},wtt={class:"sg-name"},Ctt={key:1,class:"sg-desc"},Att={class:"sg-foot"},xtt={key:0,class:"sg-model"},Stt={class:"sg-status"},_tt={class:"sg-state"},Mtt={key:0,class:"sg-time"},Itt=lt({__name:"SubagentGrid",props:{tasks:{},filter:{}},emits:["cancel"],setup(e,{emit:t}){const n=e,i={active:"tasks.emptyRecent",running:"tasks.emptyRunning",done:"tasks.emptyDone",all:"tasks.emptyTasks"},o=D(()=>i[n.filter??"all"]),s=t,{t:r}=qt(),l=Jt(qo),a=Jt(im),u=Jt(om);function c(g){const v=[a?.(g.model),u?.(g.thinkingEffort)].filter(y=>y!==void 0);return v.length>0?v.join(" · "):void 0}function d(g){return r(g==="done"?"tasks.stateDone":g==="fail"?"tasks.stateFail":g==="cancelled"?"tasks.stateCancelled":"tasks.running")}function f(g){return typeof g.durationMs!="number"?"":Fu(g.durationMs,{h:r("status.timeUnitHour"),m:r("status.timeUnitMinute"),s:r("status.timeUnitSecond")})}function h(g,v){return String((g.swarmIndex??v)+1).padStart(2,"0")}function m(g){return!!g.agentId||!!(g.output&&g.output.length>0)}return(g,v)=>e.tasks.length===0?(k(),L("div",gtt,F(p(r)(o.value)),1)):(k(),L("div",vtt,[(k(!0),L(De,null,Ct(e.tasks,(y,b)=>(k(),L("div",{key:y.id,class:Re(["sg-card",[`s-${y.state}`,{openable:m(y)}]])},[m(y)?(k(),L("button",{key:0,type:"button",class:"sg-open","aria-label":y.name,onClick:w=>p(l)?.openAgent(y.agentId??y.id)},null,8,ytt)):ee("",!0),A("div",ktt,[A("span",btt,F(h(y,b)),1),A("span",wtt,F(y.name),1)]),y.meta?(k(),L("div",Ctt,F(y.meta),1)):ee("",!0),A("div",Att,[c(y)?(k(),L("div",xtt,[U(p(Ce),{name:"robot",size:"sm"}),A("span",null,F(c(y)),1)])):ee("",!0),A("div",Stt,[A("span",_tt,[y.state==="run"?(k(),de(p(Hl),{key:0,status:"running"})):y.state==="done"?(k(),de(p(Ce),{key:1,class:"sg-ic-done",name:"circle-check",size:"sm"})):(k(),de(p(Ce),{key:2,name:"close",size:"sm"})),$e(" "+F(d(y.state)),1)]),f(y)?(k(),L("span",Mtt,[U(p(Ce),{name:"clock",size:"sm"}),$e(F(f(y)),1)])):ee("",!0)])]),y.state==="run"?(k(),de(p(ln),{key:2,class:"sg-cancel",size:"sm",label:p(r)("tasks.stop"),tooltip:p(r)("tasks.stop"),onClick:Tt(w=>s("cancel",y.id),["stop"])},{default:ce(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip","onClick"])):ee("",!0)],2))),128))]))}}),Ttt=xt(Itt,[["__scopeId","data-v-13735c1e"]]),Ett={class:"taskspane"},Ltt={class:"tp-list"},Ntt={key:0,class:"tp-empty"},Dtt={class:"tp-main"},Ftt=["aria-label","onClick"],Btt=["aria-label"],Rtt={class:"tp-name"},$tt={key:1,class:"tp-meta"},Ott={key:2,class:"tp-model"},Ptt={key:3,class:"tp-model"},ztt={key:4,class:"tp-time"},jtt=lt({__name:"TasksPane",props:{tasks:{},filter:{}},emits:["cancel"],setup(e,{emit:t}){const n=e,i={active:"tasks.emptyRecent",running:"tasks.emptyRunning",done:"tasks.emptyDone",all:"tasks.emptyTasks"},o=D(()=>i[n.filter??"all"]),s=t,{t:r}=qt(),l=Jt(qo);function a(y){return!!(y.output&&y.output.length>0||y.meta)}function u(y){c(y)&&l?.openAgent(y.agentId??y.id)}function c(y){return y.kind==="subagent"||a(y)}function d(y){return typeof y.durationMs!="number"?"":Fu(y.durationMs,{h:r("status.timeUnitHour"),m:r("status.timeUnitMinute"),s:r("status.timeUnitSecond")})}function f(y){return y.state==="done"?r("tasks.stateDone"):y.state==="fail"?r("tasks.stateFail"):y.state==="cancelled"?r("tasks.stateCancelled"):r("tasks.running")}const h=Jt(im),m=Jt(om);function g(y){if(y.kind==="subagent")return h?.(y.model)}function v(y){if(y.kind==="subagent")return m?.(y.thinkingEffort)}return(y,b)=>(k(),L("div",Ett,[A("div",Ltt,[e.tasks.length===0?(k(),L("div",Ntt,F(p(r)(o.value)),1)):(k(!0),L(De,{key:1},Ct(e.tasks,w=>(k(),L("div",{key:w.id,class:Re(["tp-row",{fail:w.state==="fail",expandable:c(w)}])},[A("div",Dtt,[c(w)?(k(),L("button",{key:0,type:"button",class:"tp-open","aria-label":w.name,onClick:C=>u(w)},null,8,Ftt)):ee("",!0),A("span",{class:"tp-glyph",role:"img","aria-label":f(w)},[w.state==="run"?(k(),de(p(Hl),{key:0,status:"running"})):w.state==="done"?(k(),de(p(Ce),{key:1,class:"tp-done",name:"circle-check",size:"sm"})):w.state==="cancelled"?(k(),de(p(Ce),{key:2,class:"tp-cancelled",name:"close",size:"sm"})):(k(),de(p(Ce),{key:3,class:"tp-fail",name:"close",size:"sm"}))],8,Btt),A("span",Rtt,F(w.name),1),w.meta?(k(),L("span",$tt,F(w.meta),1)):ee("",!0),g(w)?(k(),L("span",Ott,F(g(w)),1)):ee("",!0),v(w)?(k(),L("span",Ptt,F(v(w)),1)):ee("",!0),d(w)?(k(),L("span",ztt,F(d(w)),1)):ee("",!0),w.state==="run"?(k(),de(p(ln),{key:5,class:"tp-stop",size:"sm",label:p(r)("tasks.stop"),tooltip:p(r)("tasks.stop"),onClick:Tt(C=>s("cancel",w.id),["stop"])},{default:ce(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip","onClick"])):ee("",!0),c(w)?(k(),de(p(Ce),{key:6,class:"tp-chevron",name:"chevron-right",size:"sm"})):ee("",!0)])],2))),128))])]))}}),Htt=xt(jtt,[["__scopeId","data-v-25d6e0cb"]]),Wtt={class:"todo-card"},qtt={key:0,class:"tc-empty"},Utt={class:"tc-name"},Vtt=lt({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=qt();return(i,o)=>(k(),L("div",Wtt,[t.todos.length===0?(k(),L("div",qtt,[U(p(Ce),{name:"check-list",size:"lg",class:"tc-empty-ico"}),A("span",null,F(p(n)("tasks.emptyTodo")),1)])):ee("",!0),(k(!0),L(De,null,Ct(t.todos,(s,r)=>(k(),L("div",{key:r,class:Re(["tc-row",`s-${s.status}`])},[A("span",{class:Re(["tc-glyph",`g-${s.status}`]),"aria-hidden":"true"},[s.status==="in_progress"?(k(),de(p(mo),{key:0,size:"xs",class:"tc-spin"})):s.status==="done"?(k(),de(p(Ce),{key:1,name:"circle-check",size:"md"})):ee("",!0)],2),A("span",Utt,F(s.title),1)],2))),128))]))}}),Ktt=xt(Vtt,[["__scopeId","data-v-1b02ea7b"]]),Ztt={class:"wp-head-tab"},Gtt={key:0,class:"wp-head-meta"},Qtt={key:0,class:"wp-head-actions"},Ytt=lt({__name:"WorkPanelHead",props:{icon:{},title:{},meta:{}},setup(e){return(t,n)=>(k(),L(De,null,[A("span",Ztt,[U(p(Ce),{name:e.icon,size:"md"},null,8,["name"]),A("span",null,F(e.title),1),e.meta?(k(),L("span",Gtt,F(e.meta),1)):ee("",!0)]),t.$slots.actions?(k(),L("span",Qtt,[Un(t.$slots,"actions",{},void 0,!0)])):ee("",!0)],64))}}),Qm=xt(Ytt,[["__scopeId","data-v-c935b92a"]]),Ym=lt({__name:"WorkPill",props:{icon:{},active:{type:Boolean},label:{}},emits:["click"],setup(e,{emit:t}){const n=t;return(i,o)=>(k(),de(p(FO),{active:e.active,"aria-pressed":e.active,"aria-label":e.label,onClick:o[0]||(o[0]=s=>n("click",s))},{default:ce(()=>[U(p(Ce),{name:e.icon,size:"md"},null,8,["name"]),A("span",null,[Un(i.$slots,"default")]),Un(i.$slots,"meta")]),_:3},8,["active","aria-pressed","aria-label"]))}}),Jtt={class:"aw"},Xtt={class:"crumbbar"},ent={class:"crumbs"},tnt={key:0,class:"crumb-sep"},nnt=["onClick"],int={key:0,class:"filterbar"},ont=["placeholder"],snt={class:"folder-list"},rnt={key:0,class:"fl-loading"},lnt=["onClick"],ant={class:"folder-name search-rel"},unt={key:0,class:"fl-empty"},cnt={key:1,class:"fl-loading"},dnt=["onClick"],fnt={class:"folder-name"},hnt={key:0,class:"fl-empty"},pnt={class:"paste-row"},mnt={class:"paste-input-wrap"},gnt={key:1,class:"add-error",role:"alert"},vnt={class:"actions"},ynt={class:"footer-hint"},knt=600,bnt=6,KB=150,wnt=lt({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t,s=V(!0),r=V(!1),l=V(!1),a=V(""),u=V(null),c=V([]),d=V(""),f=V(!1),h=V([]),m=D(()=>d.value.trim().length>0);let g=0,v=null;function y(P,H){const j=P.toLowerCase(),Z=H.toLowerCase();let ie=0;for(let W=0;W0&&Q=KB))break;te.depth+1{if(v&&clearTimeout(v),P.trim()===""){g++,h.value=[],f.value=!1;return}v=setTimeout(()=>void b(P),220)});const w=V(!1),C=V(""),T=D(()=>C.value.trim()),N=D(()=>{const P=a.value;if(!P)return[];const H=P.split("/").filter(Boolean),j=[{label:"/",path:"/"}];let Z="";for(const ie of H)Z+=`/${ie}`,j.push({label:ie,path:Z});return j}),I=D(()=>a.value.length>0);async function S(P){r.value=!0;try{const H=await i.browseFs(P);if(!H.path){l.value=!0;return}a.value=H.path,u.value=H.parent,c.value=H.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function _(P){P.isDir&&S(P.path)}function x(){u.value&&S(u.value)}function E(){I.value&&o("add",a.value)}function M(){T.value.length!==0&&o("add",T.value)}const{handleCompositionStart:R,handleCompositionEnd:q,isComposingKeyEvent:z}=kl();function O(P){z(P)||M()}function B(P){P.key==="Escape"&&z(P)&&P.stopPropagation()}return yn(async()=>{r.value=!0;try{if(i.defaultPath&&(await S(i.defaultPath),!l.value))return;const P=await i.getFsHome();P.home?await S(P.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),Ln(()=>{v&&clearTimeout(v)}),(P,H)=>(k(),de(p(ef),{open:s.value,"onUpdate:open":H[5]||(H[5]=j=>s.value=j),title:p(n)("workspace.addTitle"),size:"lg",height:"fixed",padded:!1,onClose:H[6]||(H[6]=j=>o("close"))},{default:ce(()=>[A("div",Jtt,[l.value?ee("",!0):(k(),L(De,{key:0},[A("div",Xtt,[U(p(ln),{size:"sm",disabled:!u.value,label:p(n)("workspace.up"),tooltip:p(n)("workspace.up"),onClick:x},{default:ce(()=>[U(p(Ce),{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label","tooltip"]),A("div",ent,[(k(!0),L(De,null,Ct(N.value,(j,Z)=>(k(),L(De,{key:j.path},[Z>1?(k(),L("span",tnt,"/")):ee("",!0),A("button",{class:Re(["crumb",{last:Z===N.value.length-1}]),onClick:ie=>S(j.path)},F(j.label),11,nnt)],64))),128))])]),r.value?ee("",!0):(k(),L("div",int,[U(p(Ce),{class:"filter-icon",name:"search",size:"md"}),ai(A("input",{"onUpdate:modelValue":H[0]||(H[0]=j=>d.value=j),class:"filter-input",type:"text",placeholder:p(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:H[1]||(H[1]=Tt(()=>{},["stop"]))},null,40,ont),[[ur,d.value]]),f.value?(k(),de(p(mo),{key:0,size:"sm"})):ee("",!0)])),A("div",snt,[r.value?(k(),L("div",rnt,F(p(n)("workspace.browsing")),1)):m.value?(k(),L(De,{key:1},[(k(!0),L(De,null,Ct(h.value,j=>(k(),L("button",{key:j.path,class:"folder-row",onClick:Z=>S(j.path)},[U(p(Ce),{class:"dir-icon",name:"folder-closed",size:"sm"}),A("span",ant,F(j.rel),1)],8,lnt))),128)),!f.value&&h.value.length===0?(k(),L("div",unt,F(p(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(k(),L("div",cnt,F(p(n)("workspace.searching")),1)):ee("",!0)],64)):(k(),L(De,{key:2},[(k(!0),L(De,null,Ct(c.value,j=>(k(),L("button",{key:j.path,class:"folder-row",onClick:Z=>_(j)},[U(p(Ce),{class:"dir-icon",name:"folder-closed",size:"sm"}),A("span",fnt,F(j.name),1)],8,dnt))),128)),c.value.length===0?(k(),L("div",hnt,F(p(n)("workspace.noSubfolders")),1)):ee("",!0)],64))])],64)),A("div",{class:Re(["paste-section",{"paste-only":l.value}])},[!l.value&&!w.value?(k(),de(p(sn),{key:0,variant:"ghost",size:"sm",onClick:H[2]||(H[2]=j=>w.value=!0)},{default:ce(()=>[$e(F(p(n)("workspace.pasteToggle")),1)]),_:1})):(k(),de(p(uie),{key:1,label:p(n)("workspace.pathLabel")},{default:ce(()=>[A("div",pnt,[A("div",mnt,[U(p(_s),{modelValue:C.value,"onUpdate:modelValue":H[3]||(H[3]=j=>C.value=j),placeholder:p(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:[Qo(Tt(O,["stop"]),["enter"]),B],onCompositionstart:p(R),onCompositionend:p(q)},null,8,["modelValue","placeholder","onKeydown","onCompositionstart","onCompositionend"])]),U(p(ln),{disabled:T.value.length===0,label:p(n)("workspace.add"),tooltip:p(n)("workspace.add"),onClick:M},{default:ce(()=>[U(p(Ce),{name:"plus",size:"md"})]),_:1},8,["disabled","label","tooltip"])])]),_:1},8,["label"]))],2),e.error?(k(),L("div",gnt,F(e.error),1)):ee("",!0),A("div",vnt,[U(p(Nn),{text:a.value},{default:ce(()=>[l.value?ee("",!0):(k(),de(p(sn),{key:0,variant:"primary",disabled:!I.value,onClick:E},{default:ce(()=>[$e(F(p(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),U(p(sn),{variant:"secondary",onClick:H[4]||(H[4]=j=>o("close"))},{default:ce(()=>[$e(F(p(n)("workspace.cancel")),1)]),_:1})]),A("div",ynt,F(p(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),Cnt=xt(wnt,[["__scopeId","data-v-e24668bd"]]),Ant={key:0,class:"sheet-root"},xnt=["aria-label"],Snt=["aria-label"],_nt={key:0,class:"sheet-head"},Mnt={class:"sheet-title"},Int={class:"sheet-body"},Tnt=lt({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""},closeOnEsc:{type:Boolean,default:!0}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t;function s(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i.closeOnEsc&&s()}return We(()=>i.modelValue,l=>{l?Mp.value+=1:Mp.value=Math.max(0,Mp.value-1),!(typeof document>"u")&&(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Ln(()=>{i.modelValue&&(Mp.value=Math.max(0,Mp.value-1)),typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(k(),de(ko,{name:"sheet"},{default:ce(()=>[e.modelValue?(k(),L("div",Ant,[A("div",{class:"sheet-scrim",onClick:s}),A("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||p(n)("mobile.sheetLabel")},[A("button",{type:"button",class:"sheet-grab","aria-label":p(n)("mobile.closeSheet"),onClick:s},null,8,Snt),e.title?(k(),L("div",_nt,[A("span",Mnt,F(e.title),1)])):ee("",!0),A("div",Int,[Un(l.$slots,"default",{},void 0,!0)])],8,xnt)])):ee("",!0)]),_:3}))}}),y1=xt(Tnt,[["__scopeId","data-v-91fc927c"]]),Ent={key:0,class:"confirm-dialog__message"},Lnt=lt({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt();function s(){n.loading||(i("update:open",!1),i("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),ti(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(k(),de(p(ef),{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=u=>i("update:open",u)),onClose:s},{foot:ce(()=>[U(p(sn),{variant:"secondary",disabled:e.loading,onClick:s},{default:ce(()=>[$e(F(e.cancelLabel??p(o)("common.cancel")),1)]),_:1},8,["disabled"]),U(p(sn),{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=u=>i("confirm"))},{default:ce(()=>[$e(F(e.confirmLabel??p(o)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:ce(()=>[e.message?(k(),L("p",Ent,F(e.message),1)):ee("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),Nnt=xt(Lnt,[["__scopeId","data-v-32237722"]]),Dnt=lt({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:i,runAction:o}=cf();function s(){o()}return(r,l)=>p(t)!==null?(k(),de(Nnt,{key:0,open:!0,title:p(t).title,message:p(t).message,"confirm-label":p(t).confirmLabel,"cancel-label":p(t).cancelLabel,variant:p(t).variant,loading:p(n),onConfirm:s,onCancel:l[0]||(l[0]=a=>p(i)(!1))},null,8,["title","message","confirm-label","cancel-label","variant","loading"])):ee("",!0)}}),Fnt={class:"sd-body"},Bnt={class:"sd-search"},Rnt=["aria-label"],$nt={key:0,class:"sd-section","aria-hidden":"true"},Ont={class:"sd-section-count"},Pnt=["aria-selected","onClick","onMousemove"],znt=["innerHTML"],jnt=["innerHTML"],Hnt=["aria-selected","onClick","onMousemove"],Wnt={class:"sd-line1"},qnt=["innerHTML"],Unt={class:"sd-time"},Vnt={class:"sd-line2"},Knt=["innerHTML"],Znt=["innerHTML"],Gnt={key:1,class:"sd-empty"},Qnt={class:"sd-foot","aria-hidden":"true"},Ynt={class:"sd-hint"},Jnt={class:"sd-hint"},Xnt={class:"sd-hint"},eit=200,tit=3,nit=lt({__name:"SearchSessionsDialog",props:{sessions:{},workspaces:{},activeId:{}},emits:["select","selectWorkspace","close"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t,s=V(!0),r=V(""),l=V(null),a=V(null),u=D(()=>{const I=r.value.trim().toLowerCase(),S=[];if(I.length===0)for(const x of i.workspaces.slice(0,tit))S.push({kind:"workspace",key:`ws:${x.id}`,hit:{workspace:x,inName:!1,inPath:!1}});else for(const x of i.workspaces){const E=x.name.toLowerCase().includes(I),M=x.shortPath.toLowerCase().includes(I);!E&&!M||S.push({kind:"workspace",key:`ws:${x.id}`,hit:{workspace:x,inName:E,inPath:M}})}const _=[];for(const x of i.sessions){const E=x.title??"",M=x.lastPrompt??"",R=x.workspaceName??"",q=I.length>0&&E.toLowerCase().includes(I),z=I.length>0&&M.toLowerCase().includes(I),O=I.length>0&&R.toLowerCase().includes(I);if(!(I.length>0&&!q&&!z&&!O)&&(_.push({kind:"session",key:`s:${x.id}`,hit:{session:x,inTitle:q,inWorkspace:O,snippetText:M?hse(M,r.value):""}}),_.length>=eit))break}return S.length>0&&_.length>0&&(S[0].section={label:n("sidebar.workspaces"),count:S.length},_[0].section={label:n("sidebar.sessionsHeader"),count:_.length}),[...S,..._]}),c=V(0);We(r,()=>{c.value=0});function d(I){const S=u.value.length;return S===0?0:Math.max(0,Math.min(S-1,I))}async function f(){await ht(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(I){c.value=d(c.value+I),f()}function m(I){o("select",I),o("close")}function g(I){o("selectWorkspace",I),o("close")}function v(){r.value="",l.value?.focus()}function y(){const I=u.value[c.value];I&&(I.kind==="workspace"?g(I.hit.workspace.id):m(I.hit.session.id))}function b(){return l.value?.el??null}const{handleCompositionStart:w,handleCompositionEnd:C,isComposingKeyEvent:T}=kl();function N(I){if(T(I)){I.key==="Escape"&&I.stopPropagation();return}I.key==="ArrowDown"?(I.preventDefault(),h(1)):I.key==="ArrowUp"?(I.preventDefault(),h(-1)):I.key==="Enter"&&(I.preventDefault(),y())}return yn(()=>{l.value?.focus()}),(I,S)=>(k(),de(p(ef),{open:s.value,"onUpdate:open":S[1]||(S[1]=_=>s.value=_),title:p(n)("sidebar.searchPlaceholder"),size:"lg",height:"fixed",padded:!1,"initial-focus":b,onClose:S[2]||(S[2]=_=>o("close"))},{default:ce(()=>[A("div",Fnt,[A("div",Bnt,[U(p(_s),{ref_key:"inputRef",ref:l,modelValue:r.value,"onUpdate:modelValue":S[0]||(S[0]=_=>r.value=_),placeholder:p(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:N,onCompositionstart:p(w),onCompositionend:p(C)},null,8,["modelValue","placeholder","onCompositionstart","onCompositionend"]),U(p(Nn),{text:p(n)("sidebar.searchClear")},{default:ce(()=>[A("button",{type:"button",class:Re(["search-clear",{"is-on":r.value.length>0}]),tabindex:"-1","aria-label":p(n)("sidebar.searchClear"),onClick:v},[U(p(Ce),{name:"close",size:"sm"})],10,Rnt)]),_:1},8,["text"])]),A("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[u.value.length>0?(k(!0),L(De,{key:0},Ct(u.value,(_,x)=>(k(),L(De,{key:_.key},[_.section?(k(),L("div",$nt,[A("span",null,F(_.section.label),1),A("span",Ont,F(_.section.count),1)])):ee("",!0),_.kind==="workspace"?(k(),L("button",{key:1,class:Re(["sd-row sd-row-ws",{on:x===c.value}]),role:"option","aria-selected":x===c.value,onClick:E=>g(_.hit.workspace.id),onMousemove:E=>c.value=x},[U(p(Ce),{class:"sd-folder",name:"folder-closed",size:"sm"}),A("span",{class:"sd-ws-name",innerHTML:p(Rm)(_.hit.workspace.name,_.hit.inName?r.value:"")},null,8,znt),A("span",{class:"sd-ws-path",innerHTML:p(Rm)(_.hit.workspace.shortPath,_.hit.inPath?r.value:"")},null,8,jnt)],42,Pnt)):(k(),L("button",{key:2,class:Re(["sd-row",{on:x===c.value,active:_.hit.session.id===e.activeId}]),role:"option","aria-selected":x===c.value,onClick:E=>m(_.hit.session.id),onMousemove:E=>c.value=x},[A("span",Wnt,[A("span",{class:"sd-title",innerHTML:p(Rm)(_.hit.session.title,_.hit.inTitle?r.value:"")},null,8,qnt),A("span",Unt,F(_.hit.session.time),1)]),A("span",Vnt,[A("span",{class:"sd-meta-ws",innerHTML:p(Rm)(_.hit.session.workspaceName??_.hit.session.workspaceId??"",_.hit.inWorkspace?r.value:"")},null,8,Knt),_.hit.snippetText?(k(),L(De,{key:0},[S[3]||(S[3]=A("span",{class:"sd-meta-sep","aria-hidden":"true"},"·",-1)),A("span",{class:"sd-meta-snippet",innerHTML:p(Rm)(_.hit.snippetText,r.value)},null,8,Znt)],64)):ee("",!0)])],42,Hnt))],64))),128)):(k(),L("div",Gnt,[U(p(oie),{title:r.value.trim()?p(n)("sidebar.searchNoResults"):p(n)("sidebar.searchEmpty")},{icon:ce(()=>[U(p(Ce),{name:"search",size:"lg"})]),_:1},8,["title"])]))],512),A("div",Qnt,[A("span",Ynt,[U(p(mc),{keys:["↑","↓"]}),$e(F(p(n)("sidebar.searchHintSelect")),1)]),S[4]||(S[4]=A("span",{class:"sd-dot"},"·",-1)),A("span",Jnt,[U(p(mc),{keys:["Enter"]}),$e(F(p(n)("sidebar.searchHintOpen")),1)]),S[5]||(S[5]=A("span",{class:"sd-dot"},"·",-1)),A("span",Xnt,[U(p(mc),{keys:["Esc"]}),$e(F(p(n)("sidebar.searchHintClose")),1)])])])]),_:1},8,["open","title"]))}}),iit=xt(nit,[["__scopeId","data-v-35cdd013"]]),oit={class:"topbar"},sit=["aria-label"],rit={key:0,class:"st","aria-hidden":"true"},lit={key:4,class:"unread-dot"},ait={class:"tb-line"},uit={class:"tt"},cit=lt({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},status:{default:"idle"}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t,s=D(()=>i.workspace?.name??n("workspace.noWorkspace"));return(r,l)=>(k(),L("div",oit,[A("button",{type:"button",class:"tb-main","aria-label":p(n)("mobile.openSwitcher"),onClick:l[0]||(l[0]=a=>o("openSwitcher"))},[e.status!=="idle"?(k(),L("span",rit,[e.status==="awaiting-approval"?(k(),de(p(ul),{key:0,variant:"warning",size:"sm"},{default:ce(()=>[$e(F(p(n)("workspace.awaitingPermission")),1)]),_:1})):e.status==="awaiting-question"?(k(),de(p(ul),{key:1,variant:"info",size:"sm"},{default:ce(()=>[$e(F(p(n)("workspace.awaitingAnswer")),1)]),_:1})):e.status==="running"?(k(),de(p(mo),{key:2,size:"sm"})):e.status==="aborted"?(k(),de(p(ul),{key:3,variant:"danger",size:"sm"},{default:ce(()=>[$e(F(p(n)("workspace.aborted")),1)]),_:1})):e.status==="unread"?(k(),L("span",lit)):ee("",!0)])):ee("",!0),A("span",ait,[A("span",{class:Re(["dir",{solo:!e.sessionTitle}])},F(s.value),3),e.sessionTitle?(k(),L(De,{key:0},[l[2]||(l[2]=A("span",{class:"sl"},"/",-1)),A("span",uit,F(e.sessionTitle),1)],64)):ee("",!0),U(p(Ce),{class:"cv",name:"chevron-down",size:"sm"})])],8,sit),U(p(ln),{size:"lg",label:p(n)("mobile.openSettings"),onClick:l[1]||(l[1]=a=>o("openSettings"))},{default:ce(()=>[U(p(Ce),{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),dit=xt(cit,[["__scopeId","data-v-78cbb21c"]]),fit={class:"msg"},hit={class:"pf-field"},pit={class:"pf-field-label"},mit={class:"pf-field"},git={class:"pf-field-label"},vit={class:"pf-field"},yit={class:"pf-field-label"},kit={class:"pf-key-wrap"},bit={class:"pf-field"},wit={class:"pf-field-label"},Cit={class:"pf-field"},Ait={class:"pf-field-label"},xit={class:"pf-models"},Sit={key:0,class:"pf-models-empty"},_it={class:"pf-model-grid pf-model-head"},Mit={key:1},Iit={key:0},Tit={class:"pf-foot"},Eit={key:0,class:"pf-managed-note"},Lit={class:"pf-confirm-msg"},Nit=lt({__name:"ProviderForm",props:{mode:{},provider:{},guard:{type:Boolean}},emits:["dirtyChange","guardStay","guardDiscard","added","saved","deleting","deleted","cancel"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=Ga(),r=po({id:"",type:"openai",apiKey:"",baseUrl:"",models:[C2()]}),l=new WeakMap;let a=0;function u(O){let B=l.get(O);return B===void 0&&(B=++a,l.set(O,B)),B}const c=V(""),d=V(!1),f=V(!1),h=V(!1),m=D(()=>n.mode==="add"),g=D(()=>n.provider!==void 0&&iP(n.provider)),v=D(()=>{const O=n.provider;return O===void 0?0:Ew(O,s.config.value?.models).length}),y=D(()=>g.value&&v.value===0),b=D(()=>Cse.map(O=>({value:O,label:o(`providers.types.${O}`)}))),w=D(()=>g.value?o("providers.apiKeyManaged"):!m.value&&n.provider?.hasApiKey===!0?o("providers.apiKeySet"):"sk-…");function C(){c.value="",f.value=!1;const O=n.provider;if(m.value||O===void 0){r.id="",r.type="openai",r.apiKey="",r.baseUrl="",r.models=[C2()];return}r.id=O.id,r.type=O.type,r.apiKey="",r.baseUrl=O.baseUrl??"";const B=Ew(O,s.config.value?.models);r.models=B.length>0?B:[C2()]}yn(()=>{C(),I()});const T=V(!1),N=V(!1);async function I(){const O=n.provider;if(!(m.value||O===void 0||g.value||O.hasApiKey!==!0))try{const B=await s.getProvider(O.id);if(N.value)return;B.apiKey!==void 0&&B.apiKey!==""&&(r.apiKey=B.apiKey,T.value=!0)}catch{}}function S(){i("dirtyChange",!0)}const _=V(!1),x=V();function E(O){c.value=O,ht(()=>x.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}async function M(){if(d.value)return;const O=Ase(r,{requireApiKey:m.value,requireBaseUrl:m.value});if(O!==null){E(o(`providers.error.${O}`));return}c.value="",d.value=!0;try{if(m.value){const B=await s.addProvider(xse(r));if(B!==null){E(B);return}i("dirtyChange",!1),s.notify({severity:"success",title:o("providers.added")}),i("added",r.id.trim())}else{const B=n.provider;if(B===void 0)return;const P=s.config.value?.providers?.[B.id]?.defaultModel,H=await s.updateProvider(B.id,Sse(r,B,{includeBlankApiKey:T.value,existingDefaultModel:P}));if(H!==null){E(H);return}await s.checkAuth(),s.notify({severity:"success",title:o("providers.saved")}),i("dirtyChange",!1),i("saved",r.id.trim())}}finally{d.value=!1}}async function R(){const O=n.provider;if(!(O===void 0||h.value)){h.value=!0,i("deleting"),await new Promise(B=>setTimeout(B,300));try{if(await s.deleteProvider(O.id)===null){f.value=!1;return}i("dirtyChange",!1),i("deleted",O.id)}finally{h.value=!1}}}function q(){r.models.push(C2()),S()}function z(O){if(r.models.length<=1)return;const B=r.models.indexOf(O);B>=0&&r.models.splice(B,1),S()}return(O,B)=>(k(),L("div",{class:"pf-form",onInput:S},[e.guard?(k(),de(p(qf),{key:0,variant:"warning",class:"pf-guard"},{default:ce(()=>[A("span",fit,F(p(o)("providers.unsavedGuard")),1),U(p(sn),{variant:"secondary",size:"sm",onClick:B[0]||(B[0]=P=>i("guardStay"))},{default:ce(()=>[$e(F(p(o)("providers.guardStay")),1)]),_:1}),U(p(sn),{variant:"danger",size:"sm",onClick:B[1]||(B[1]=P=>i("guardDiscard"))},{default:ce(()=>[$e(F(p(o)("providers.guardDiscard")),1)]),_:1})]),_:1})):ee("",!0),c.value?(k(),L("div",{key:1,ref_key:"errorBox",ref:x},[U(p(qf),{variant:"danger"},{default:ce(()=>[$e(F(c.value),1)]),_:1})],512)):ee("",!0),A("div",hit,[A("label",pit,[$e(F(p(o)("providers.fieldId")),1),B[11]||(B[11]=A("span",{class:"req"}," *",-1))]),U(p(_s),{modelValue:r.id,"onUpdate:modelValue":B[2]||(B[2]=P=>r.id=P),placeholder:"my-openai",disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","disabled"])]),A("div",mit,[A("label",git,[$e(F(p(o)("providers.fieldType")),1),B[12]||(B[12]=A("span",{class:"req"}," *",-1))]),U(p(Cw),{"model-value":r.type,options:b.value,disabled:g.value,"onUpdate:modelValue":B[3]||(B[3]=P=>{r.type=P,S()})},null,8,["model-value","options","disabled"])]),A("div",vit,[A("label",yit,[$e(F(p(o)("providers.fieldApiKey")),1),B[13]||(B[13]=A("span",{class:"req"}," *",-1))]),A("div",kit,[U(p(_s),{modelValue:r.apiKey,"onUpdate:modelValue":B[4]||(B[4]=P=>r.apiKey=P),type:_.value?"text":"password",placeholder:w.value,disabled:g.value,autocomplete:"off",spellcheck:"false",onInput:B[5]||(B[5]=P=>N.value=!0)},null,8,["modelValue","type","placeholder","disabled"]),g.value?ee("",!0):(k(),de(p(ln),{key:0,class:"pf-key-eye",size:"sm",label:p(o)(_.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(o)(_.value?"providers.hideApiKey":"providers.showApiKey"),onClick:B[6]||(B[6]=P=>_.value=!_.value)},{default:ce(()=>[U(p(Ce),{name:_.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"]))])]),A("div",bit,[A("label",wit,[$e(F(p(o)("providers.fieldBaseUrl")),1),B[14]||(B[14]=A("span",{class:"req"}," *",-1))]),U(p(_s),{modelValue:r.baseUrl,"onUpdate:modelValue":B[7]||(B[7]=P=>r.baseUrl=P),placeholder:p(o)("providers.baseUrlPlaceholder"),disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder","disabled"])]),A("div",Cit,[A("label",Ait,[$e(F(p(o)("providers.fieldModels")),1),B[15]||(B[15]=A("span",{class:"req"}," *",-1))]),A("div",xit,[y.value?(k(),L("div",Sit,F(p(o)("providers.noModels")),1)):(k(),L(De,{key:1},[A("div",_it,[A("span",null,[$e(F(p(o)("providers.colModelId")),1),B[16]||(B[16]=A("span",{class:"req"}," *",-1))]),A("span",null,[$e(F(p(o)("providers.colContext")),1),B[17]||(B[17]=A("span",{class:"req"}," *",-1))]),A("span",null,F(p(o)("providers.colDisplayName")),1),B[18]||(B[18]=A("span",null,null,-1))]),(k(!0),L(De,null,Ct(r.models,P=>(k(),L("div",{key:u(P),class:"pf-model-grid"},[U(p(_s),{modelValue:P.model,"onUpdate:modelValue":H=>P.model=H,placeholder:p(o)("providers.modelIdPlaceholder"),disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),U(p(_s),{modelValue:P.maxContextSize,"onUpdate:modelValue":H=>P.maxContextSize=H,inputmode:"numeric",placeholder:p(o)("providers.modelContextPlaceholder"),disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),U(p(_s),{modelValue:P.displayName,"onUpdate:modelValue":H=>P.displayName=H,placeholder:p(o)("providers.modelNamePlaceholder"),disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),g.value?(k(),L("span",Mit)):(k(),de(p(ln),{key:0,size:"sm",label:p(o)("providers.removeModel"),tooltip:p(o)("providers.removeModel"),disabled:r.models.length<=1,onClick:H=>z(P)},{default:ce(()=>[U(p(Ce),{name:"trash",size:"sm"})]),_:1},8,["label","tooltip","disabled","onClick"]))]))),128)),g.value?ee("",!0):(k(),L("div",Iit,[U(p(sn),{variant:"ghost",size:"sm",onClick:q},{default:ce(()=>[U(p(Ce),{name:"plus",size:"sm"}),$e(" "+F(p(o)("providers.addModel")),1)]),_:1})]))],64))])]),A("div",Tit,[g.value?(k(),L("span",Eit,F(p(o)("providers.managedHint")),1)):m.value?(k(),L(De,{key:1},[U(p(sn),{variant:"secondary",size:"sm",onClick:B[8]||(B[8]=P=>i("cancel"))},{default:ce(()=>[$e(F(p(o)("common.cancel")),1)]),_:1}),U(p(sn),{variant:"primary",size:"sm",disabled:d.value,onClick:M},{default:ce(()=>[$e(F(p(o)("providers.addProvider")),1)]),_:1},8,["disabled"])],64)):f.value&&n.provider!==void 0?(k(),L(De,{key:2},[A("span",Lit,F(p(o)("providers.deleteConfirm",{id:n.provider.id,count:v.value})),1),B[19]||(B[19]=A("span",{class:"spacer"},null,-1)),U(p(sn),{variant:"secondary",size:"sm",disabled:h.value,onClick:B[9]||(B[9]=P=>f.value=!1)},{default:ce(()=>[$e(F(p(o)("common.cancel")),1)]),_:1},8,["disabled"]),U(p(sn),{variant:"danger",size:"sm",disabled:h.value,onClick:R},{default:ce(()=>[$e(F(p(o)("providers.deleteConfirmYes")),1)]),_:1},8,["disabled"])],64)):(k(),L(De,{key:3},[U(p(sn),{variant:"danger-soft",size:"sm",onClick:B[10]||(B[10]=P=>f.value=!0)},{default:ce(()=>[$e(F(p(o)("providers.deleteProvider")),1)]),_:1}),B[20]||(B[20]=A("span",{class:"spacer"},null,-1)),U(p(sn),{variant:"primary",size:"sm",disabled:d.value,onClick:M},{default:ce(()=>[$e(F(p(o)("providers.save")),1)]),_:1},8,["disabled"])],64))])],32))}}),xZ=xt(Nit,[["__scopeId","data-v-5ad95550"]]),Dit={class:"af"},Fit={class:"msg"},Bit={key:2,class:"af-catalog"},Rit={key:0,class:"af-center"},$it={key:1,class:"af-error"},Oit={class:"af-list"},Pit=["disabled","onClick"],zit={class:"af-entry-name"},jit={key:1,class:"af-entry-reason"},Hit={key:2,class:"af-entry-count"},Wit={key:0,class:"af-empty"},qit={class:"af-field"},Uit={class:"af-label"},Vit={class:"af-field"},Kit={class:"af-label"},Zit={class:"af-key-wrap"},Git={key:0,class:"af-field"},Qit={class:"af-label"},Yit={class:"af-note"},Jit={class:"af-foot"},Xit={class:"af-hint"},eot={class:"af-field"},tot={class:"af-label"},not={class:"af-field"},iot={class:"af-label"},oot={class:"af-key-wrap"},sot={class:"af-foot"},rot={class:"af-manual"},lot=lt({__name:"AddProviderFlow",props:{guard:{type:Boolean}},emits:["dirtyChange","guardStay","guardDiscard","added","cancel"],setup(e,{emit:t}){const n=t,{t:i,te:o}=qt(),s=Ga(),r=V("catalog"),l=D(()=>[{value:"catalog",label:i("providers.catalog.sourceCatalog")},{value:"registry",label:i("providers.catalog.sourceRegistry")},{value:"manual",label:i("providers.catalog.sourceManual")}]),a=V("loading"),u=V([]);async function c(){a.value="loading";const P=await s.loadCatalogProviders();P.kind==="ok"?(u.value=P.items,a.value="ready"):P.kind==="unsupported"?(a.value="unsupported",r.value==="catalog"&&(r.value="manual")):a.value="error"}yn(c);const d=V(""),f=D(()=>{const P=d.value.trim().toLowerCase();return P===""?u.value:u.value.filter(H=>H.name.toLowerCase().includes(P)||H.id.toLowerCase().includes(P))});function h(P){const H=P.rejectReason;return H!==null&&o(`providers.catalog.rejectReason.${H}`)?i(`providers.catalog.rejectReason.${H}`):i("providers.catalog.rejected")}const m=V(null),g=V({id:"",apiKey:"",baseUrl:""}),v=V(!1),y=V(!1),b=V("");function w(P){m.value=P,g.value={id:P.id,apiKey:"",baseUrl:""},b.value="",v.value=!1}function C(){m.value=null,b.value="",n("dirtyChange",!1)}function T(){n("dirtyChange",!0)}const N=D(()=>{if(m.value===null)return!1;const H=g.value.id.trim();return H!==""&&s.providers.value.some(j=>j.id===H)}),I=V();function S(P){b.value=P,ht(()=>I.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}function _(){const P=g.value,H=P.id.trim();return H===""?i("providers.error.idRequired"):tP.test(H)?P.apiKey.trim()===""?i("providers.error.apiKeyRequired"):m.value?.needsBaseUrl===!0&&P.baseUrl.trim()===""?i("providers.error.baseUrlRequired"):null:i("providers.error.idInvalid")}async function x(){const P=m.value;if(P===null||y.value)return;const H=_();if(H!==null){S(H);return}b.value="",y.value=!0;try{const j=g.value,Z=j.id.trim(),ie=j.baseUrl.trim(),W=await s.importCatalogProvider({catalogId:P.id,apiKey:j.apiKey.trim(),...ie===""?{}:{baseUrl:ie},...Z===P.id?{}:{id:Z}});if(W!==null){S(W);return}s.notify({severity:"success",title:i("providers.added")}),n("dirtyChange",!1),n("added",Z)}finally{y.value=!1}}const E=V({url:"",apiKey:""}),M=V(!1),R=V(!1),q=V(""),z=V();function O(P){q.value=P,ht(()=>z.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}async function B(){if(R.value)return;const P=E.value.url.trim();if(P===""){O(i("providers.error.registryUrlRequired"));return}q.value="",R.value=!0;try{const H=E.value.apiKey.trim(),j=await s.importCustomRegistry({url:P,...H===""?{}:{apiKey:H}});if(typeof j=="string"){O(j);return}s.notify({severity:"success",title:i("providers.catalog.registryImported",{count:j.providers.length})}),n("dirtyChange",!1);const Z=j.providers[0];Z!==void 0?n("added",Z.id):n("cancel")}finally{R.value=!1}}return(P,H)=>(k(),L("div",Dit,[e.guard?(k(),de(p(qf),{key:0,variant:"warning",class:"af-guard"},{default:ce(()=>[A("span",Fit,F(p(i)("providers.unsavedGuard")),1),U(p(sn),{variant:"secondary",size:"sm",onClick:H[0]||(H[0]=j=>n("guardStay"))},{default:ce(()=>[$e(F(p(i)("providers.guardStay")),1)]),_:1}),U(p(sn),{variant:"danger",size:"sm",onClick:H[1]||(H[1]=j=>n("guardDiscard"))},{default:ce(()=>[$e(F(p(i)("providers.guardDiscard")),1)]),_:1})]),_:1})):ee("",!0),a.value!=="unsupported"?(k(),de(p(Ms),{key:1,modelValue:r.value,"onUpdate:modelValue":H[2]||(H[2]=j=>r.value=j),size:"sm",options:l.value},null,8,["modelValue","options"])):ee("",!0),a.value!=="unsupported"?ai((k(),L("div",Bit,[a.value==="loading"?(k(),L("div",Rit,[U(p(mo),{size:"sm"}),A("span",null,F(p(i)("providers.catalog.loading")),1)])):a.value==="error"?(k(),L("div",$it,[U(p(qf),{variant:"danger"},{default:ce(()=>[$e(F(p(i)("providers.catalog.loadError")),1)]),_:1}),A("div",null,[U(p(sn),{variant:"secondary",size:"sm",onClick:c},{default:ce(()=>[$e(F(p(i)("providers.catalog.retry")),1)]),_:1})])])):m.value===null?(k(),L(De,{key:2},[U(p(_s),{modelValue:d.value,"onUpdate:modelValue":H[3]||(H[3]=j=>d.value=j),placeholder:p(i)("providers.catalog.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"]),A("div",Oit,[(k(!0),L(De,null,Ct(f.value,j=>(k(),L("button",{key:j.id,type:"button",class:"af-entry",disabled:j.rejected,onClick:Z=>w(j)},[A("span",zit,F(j.name),1),j.wireType!==null?(k(),de(p(ul),{key:0,variant:"neutral",size:"sm"},{default:ce(()=>[$e(F(j.wireType),1)]),_:2},1024)):ee("",!0),H[16]||(H[16]=A("span",{class:"grow"},null,-1)),j.rejected?(k(),L("span",jit,F(h(j)),1)):(k(),L("span",Hit,F(p(i)("providers.modelCount",{count:j.models.length})),1))],8,Pit))),128)),f.value.length===0?(k(),L("div",Wit,F(p(i)("providers.catalog.empty")),1)):ee("",!0)])],64)):(k(),L("div",{key:3,class:"af-import",onInput:T},[A("button",{type:"button",class:"af-back",onClick:C},[U(p(Ce),{name:"arrow-left",size:"sm"}),$e(" "+F(p(i)("providers.catalog.backToList")),1)]),A("div",qit,[A("label",Uit,[$e(F(p(i)("providers.fieldId")),1),H[17]||(H[17]=A("span",{class:"req"}," *",-1))]),U(p(_s),{modelValue:g.value.id,"onUpdate:modelValue":H[4]||(H[4]=j=>g.value.id=j),autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),A("div",Vit,[A("label",Kit,[$e(F(p(i)("providers.fieldApiKey")),1),H[18]||(H[18]=A("span",{class:"req"}," *",-1))]),A("div",Zit,[U(p(_s),{modelValue:g.value.apiKey,"onUpdate:modelValue":H[5]||(H[5]=j=>g.value.apiKey=j),type:v.value?"text":"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type"]),U(p(ln),{class:"af-key-eye",size:"sm",label:p(i)(v.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(i)(v.value?"providers.hideApiKey":"providers.showApiKey"),onClick:H[6]||(H[6]=j=>v.value=!v.value)},{default:ce(()=>[U(p(Ce),{name:v.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])])]),m.value.needsBaseUrl?(k(),L("div",Git,[A("label",Qit,[$e(F(p(i)("providers.fieldBaseUrl")),1),H[19]||(H[19]=A("span",{class:"req"}," *",-1))]),U(p(_s),{modelValue:g.value.baseUrl,"onUpdate:modelValue":H[7]||(H[7]=j=>g.value.baseUrl=j),placeholder:p(i)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])])):ee("",!0),N.value?(k(),de(p(qf),{key:1,variant:"warning"},{default:ce(()=>[$e(F(p(i)("providers.catalog.overwriteWarning")),1)]),_:1})):ee("",!0),A("div",Yit,F(p(i)("providers.catalog.willImport",{count:m.value.models.length})),1),b.value?(k(),L("div",{key:2,ref_key:"importErrorBox",ref:I},[U(p(qf),{variant:"danger"},{default:ce(()=>[$e(F(b.value),1)]),_:1})],512)):ee("",!0),A("div",Jit,[U(p(sn),{variant:"secondary",size:"sm",onClick:H[8]||(H[8]=j=>n("cancel"))},{default:ce(()=>[$e(F(p(i)("common.cancel")),1)]),_:1}),U(p(sn),{variant:"primary",size:"sm",disabled:y.value,onClick:x},{default:ce(()=>[$e(F(p(i)("providers.catalog.importAction")),1)]),_:1},8,["disabled"])])],32))],512)),[[Go,r.value==="catalog"]]):ee("",!0),ai(A("div",{class:"af-registry",onInput:T},[A("div",Xit,F(p(i)("providers.catalog.registryHint")),1),A("div",eot,[A("label",tot,[$e(F(p(i)("providers.catalog.registryUrlLabel")),1),H[20]||(H[20]=A("span",{class:"req"}," *",-1))]),U(p(_s),{modelValue:E.value.url,"onUpdate:modelValue":H[9]||(H[9]=j=>E.value.url=j),placeholder:"https://example.com/api.json",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),A("div",not,[A("label",iot,F(p(i)("providers.fieldApiKey")),1),A("div",oot,[U(p(_s),{modelValue:E.value.apiKey,"onUpdate:modelValue":H[10]||(H[10]=j=>E.value.apiKey=j),type:M.value?"text":"password",placeholder:p(i)("providers.modelNamePlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type","placeholder"]),U(p(ln),{class:"af-key-eye",size:"sm",label:p(i)(M.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(i)(M.value?"providers.hideApiKey":"providers.showApiKey"),onClick:H[11]||(H[11]=j=>M.value=!M.value)},{default:ce(()=>[U(p(Ce),{name:M.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])])]),q.value?(k(),L("div",{key:0,ref_key:"registryErrorBox",ref:z},[U(p(qf),{variant:"danger"},{default:ce(()=>[$e(F(q.value),1)]),_:1})],512)):ee("",!0),A("div",sot,[U(p(sn),{variant:"secondary",size:"sm",onClick:H[12]||(H[12]=j=>n("cancel"))},{default:ce(()=>[$e(F(p(i)("common.cancel")),1)]),_:1}),U(p(sn),{variant:"primary",size:"sm",disabled:R.value,onClick:B},{default:ce(()=>[$e(F(p(i)("providers.catalog.importAction")),1)]),_:1},8,["disabled"])])],544),[[Go,r.value==="registry"]]),ai(A("div",rot,[U(xZ,{mode:"add",guard:!1,onDirtyChange:H[13]||(H[13]=j=>n("dirtyChange",j)),onAdded:H[14]||(H[14]=j=>n("added",j)),onCancel:H[15]||(H[15]=j=>n("cancel"))})],512),[[Go,r.value==="manual"]])]))}}),aot=xt(lot,[["__scopeId","data-v-96ec6ac0"]]),uot={class:"search-wrap"},cot=["aria-label"],dot=["aria-label"],fot=["aria-pressed","onClick"],hot={key:1,class:"state-row"},pot={key:2,class:"state-row unavail"},mot=["aria-label"],got=["aria-selected","onClick","onMouseenter"],vot={class:"model-main"},yot={class:"model-name"},kot={class:"model-meta"},bot={class:"model-side"},wot={key:0,class:"empty"},Cot={class:"footer-hint","aria-hidden":"true"},Aot=lt({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t,s=D(()=>new Set(i.starredIds??[]));function r(z){return s.value.has(z)}const l=V(""),a=V(null),u=V(null),c=V(null),d=V("all"),f={image_in:"model.capabilityImageInput",video_in:"model.capabilityVideoInput",tool_use:"model.capabilityToolUse",thinking:"model.capabilityThinking",always_thinking:"model.capabilityAlwaysThinking"};function h(z){const O=f[z];return O?n(O):z.replaceAll("_"," ")}function m(z){const O=[z.provider,n("model.contextSuffix",{size:Ac(z.maxContextSize)})];for(const B of z.capabilities??[])O.push(h(B));return O.join(" · ")}const g=typeof window<"u"&&window.matchMedia("(hover: none)").matches;BZ(u,g?void 0:a);const v=Ec(),y=D(()=>v.value?y1:ef),b=D(()=>v.value?{modelValue:!0,title:n("model.title"),closeOnEsc:!1}:{open:!0,closeOnEsc:!1,title:n("model.title"),size:"lg",height:"fixed",padded:!1,focusOnOpen:!g}),w=D(()=>{const z=new Set,O=[{id:"all",label:n("model.allTab")}];for(const B of i.models)z.has(B.provider)||(z.add(B.provider),O.push({id:B.provider,label:B.provider}));return O}),C=D(()=>{const z=l.value.toLowerCase().trim(),O=i.models.filter(B=>{if(d.value!=="all"&&B.provider!==d.value)return!1;const P=(B.displayName??B.model).toLowerCase().includes(z),H=B.provider.toLowerCase().includes(z),j=B.id.toLowerCase().includes(z);return!z||P||H||j});return d.value!=="all"?O:O.sort((B,P)=>{const H=r(B.id)?1:0;return(r(P.id)?1:0)-H})}),T=D(()=>C.value),N=V(0);We([l,d],()=>{N.value=0}),We(w,z=>{z.some(O=>O.id===d.value)||(d.value="all")}),We(T,z=>{N.value=Math.min(N.value,Math.max(z.length-1,0))}),We(N,async()=>{await ht(),c.value?.querySelector(".model-row.is-selected")?.scrollIntoView({block:"nearest"})});const{handleCompositionStart:I,handleCompositionEnd:S,isComposingKeyEvent:_}=kl();function x(z){if(!_(z)){if(z.key==="Escape"){o("close");return}if(z.key==="ArrowDown")z.preventDefault(),N.value=Math.min(N.value+1,T.value.length-1);else if(z.key==="ArrowUp")z.preventDefault(),N.value=Math.max(N.value-1,0);else if(z.key==="Enter"){const O=T.value[N.value];O&&o("select",O.id)}}}yn(()=>{document.addEventListener("keydown",x)}),Ln(()=>{document.removeEventListener("keydown",x)});function E(z){o("select",z)}function M(){l.value="",a.value?.focus()}function R(z){return T.value.indexOf(z)}function q(z){d.value=z}return(z,O)=>(k(),de(Po(y.value),ui(b.value,{onClose:O[1]||(O[1]=B=>o("close"))}),{default:ce(()=>[A("div",{ref_key:"dialogRef",ref:u,class:Re(["mp",{"mp--sheet":p(v)}])},[A("div",uot,[U(p(_s),{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":O[0]||(O[0]=B=>l.value=B),placeholder:p(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:!p(g),onCompositionstart:p(I),onCompositionend:p(S)},null,8,["modelValue","placeholder","autofocus","onCompositionstart","onCompositionend"]),U(p(Nn),{text:p(n)("model.clearSearch")},{default:ce(()=>[A("button",{type:"button",class:Re(["search-clear",{"is-on":l.value.length>0}]),tabindex:"-1","aria-label":p(n)("model.clearSearch"),onClick:M},[U(p(Ce),{name:"close",size:"sm"})],10,cot)]),_:1},8,["text"])]),w.value.length>1?(k(),L("div",{key:0,class:"chip-strip","aria-label":p(n)("model.providerTabs")},[(k(!0),L(De,null,Ct(w.value,B=>(k(),L("button",{key:B.id,type:"button",class:Re(["chip",{"is-active":B.id===d.value}]),"aria-pressed":B.id===d.value,onClick:P=>q(B.id)},F(B.label),11,fot))),128))],8,dot)):ee("",!0),e.loading?(k(),L("div",hot,[U(p(mo),{size:"sm"}),A("span",null,F(p(n)("model.loading")),1)])):e.unavailable?(k(),L("div",pot,[U(p(Ce),{name:"alert-triangle",size:"lg"}),A("span",null,F(p(n)("model.unavailable")),1)])):(k(),L("div",{key:3,ref_key:"listRef",ref:c,class:"model-list",role:"listbox","aria-label":p(n)("model.title")},[(k(!0),L(De,null,Ct(T.value,B=>(k(),L("div",{key:B.id,class:Re(["model-row",{"is-current":B.id===e.current,"is-selected":R(B)===N.value}]),role:"option","aria-selected":B.id===e.current,onClick:P=>E(B.id),onMouseenter:P=>N.value=R(B)},[A("span",vot,[A("span",yot,F(B.displayName??B.model),1),A("span",kot,F(m(B)),1)]),A("span",bot,[B.id===e.current?(k(),de(p(Ce),{key:0,class:"model-check",name:"check",size:"sm"})):ee("",!0),U(p(ln),{class:Re(["model-star",{"is-starred":r(B.id)}]),size:"sm",label:r(B.id)?p(n)("model.unstarTitle"):p(n)("model.starTitle"),tooltip:r(B.id)?p(n)("model.unstarTitle"):p(n)("model.starTitle"),onClick:Tt(P=>o("toggle-star",B.id),["stop"])},{default:ce(()=>[r(B.id)?(k(),de(p(Ce),{key:0,name:"star",size:"md"})):(k(),de(p(Ce),{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["class","label","tooltip","onClick"])])],42,got))),128)),T.value.length===0?(k(),L("div",wot,F(i.models.length===0?p(n)("model.emptyNoModels"):p(n)("model.emptyNoMatch")),1)):ee("",!0)],8,mot)),A("div",Cot,[U(p(mc),{keys:["↑","↓"]}),A("span",null,F(p(n)("model.hintNavigate")),1),O[2]||(O[2]=A("span",{class:"hint-dot"},"·",-1)),U(p(mc),{keys:["Enter"]}),A("span",null,F(p(n)("model.hintSelect")),1),O[3]||(O[3]=A("span",{class:"hint-dot"},"·",-1)),U(p(mc),{keys:["Esc"]}),A("span",null,F(p(n)("model.hintClose")),1)])],2)]),_:1},16))}}),xot=xt(Aot,[["__scopeId","data-v-49f293b0"]]),Sot={class:"sec"},_ot={class:"sec-title"},Mot={class:"pu-group"},Iot={class:"pu-row"},Tot={class:"pu-main"},Eot={class:"pu-label"},Lot={class:"pu-hint"},Not=lt({__name:"PlanUpgradeCard",setup(e){const{t}=qt();return(n,i)=>(k(),L("section",Sot,[A("h3",_ot,F(p(t)("settings.planUsage.title")),1),A("div",Mot,[A("div",Iot,[A("span",Tot,[A("span",Eot,F(p(t)("settings.planUsage.freeTitle")),1),A("span",Lot,F(p(t)("settings.planUsage.freeHint")),1)]),U(p(sn),{variant:"primary",size:"sm",onClick:i[0]||(i[0]=o=>p(mv)())},{default:ce(()=>[$e(F(p(t)("sidebar.upgrade")),1)]),_:1})])])]))}}),SZ=xt(Not,[["__scopeId","data-v-3cd02b1c"]]),Dot={class:"pp"},Fot={class:"pp-head"},Bot={class:"pp-title"},Rot={key:0,class:"pp-loading"},$ot={key:1,class:"pp-group"},Oot={class:"pp-add-label"},Pot={class:"pp-chev"},zot={class:"pp-acc"},jot={class:"pp-acc-in"},Hot={key:1,class:"pp-empty"},Wot=["onClick"],qot={class:"grow"},Uot={class:"pp-id"},Vot={class:"pp-count"},Kot={class:"pp-chev"},Zot={class:"pp-acc"},Got={class:"pp-acc-in"},Bf="$add",Qot=lt({__name:"ProvidersPanel",setup(e){const{t}=qt(),n=Ga(),i=V(!0),o=V(null),s=V(null);let r=0;const l=V(!1),a=V(!1),u=V(null),c=V("");let d=0;const f=D(()=>[...n.providers.value].sort((N,I)=>N.id.localeCompare(I.id)));function h(N){return Ew(N,n.config.value?.models).length}We(o,(N,I)=>{I!==null&&I!==N&&(s.value=I,window.clearTimeout(r),r=window.setTimeout(()=>{s.value=null},300)),l.value=!1}),We(l,N=>{N||(a.value=!1,u.value=null)}),Ln(()=>{window.clearTimeout(r),window.clearTimeout(d)});const m=V(!1);We(o,N=>{N===Bf?(m.value=!1,ht(()=>requestAnimationFrame(()=>{m.value=!0}))):m.value=!1}),yn(async()=>{i.value=!0;try{await Promise.all([n.loadProviders(),n.loadModels(),n.loadConfig()])}finally{i.value=!1}});function g(N){const I=o.value===N?null:N;if(l.value){u.value=I,a.value=!0;return}o.value=I}function v(){a.value=!1,u.value=null}function y(){a.value=!1,o.value=u.value,u.value=null}function b(N){c.value=N,window.clearTimeout(d),d=window.setTimeout(()=>{c.value=""},1200)}function w(N){o.value=N}function C(N){o.value=N,b(N)}function T(){o.value=null}return(N,I)=>(k(),L("section",Dot,[A("div",Fot,[A("h3",Bot,F(p(t)("settings.tabs.providers")),1),U(p(sn),{variant:"secondary",size:"sm",onClick:I[0]||(I[0]=S=>g(Bf))},{default:ce(()=>[U(p(Ce),{name:"plus",size:"sm"}),$e(" "+F(p(t)("providers.addProvider")),1)]),_:1})]),i.value?(k(),L("div",Rot,[U(p(mo),{size:"sm"}),A("span",null,F(p(t)("providers.loading")),1)])):(k(),L("div",$ot,[o.value===Bf||s.value===Bf?(k(),L("div",{key:0,class:Re(["pp-item pp-add-item",{open:o.value===Bf&&m.value}])},[A("button",{type:"button",class:"pp-row pp-add-row",onClick:I[1]||(I[1]=S=>g(Bf))},[A("span",Oot,F(p(t)("providers.addProvider")),1),I[6]||(I[6]=A("span",{class:"grow"},null,-1)),A("span",Pot,[U(p(Ce),{name:"chevron-right",size:"sm"})])]),A("div",zot,[A("div",jot,[U(aot,{guard:a.value&&o.value===Bf,onDirtyChange:I[2]||(I[2]=S=>l.value=S),onGuardStay:v,onGuardDiscard:y,onAdded:C,onCancel:I[3]||(I[3]=S=>o.value=null)},null,8,["guard"])])])],2)):ee("",!0),f.value.length===0?(k(),L("div",Hot,F(p(t)("providers.empty")),1)):ee("",!0),(k(!0),L(De,null,Ct(f.value,S=>(k(),L("div",{key:S.id,class:Re(["pp-item",{open:o.value===S.id,flash:c.value===S.id}])},[A("button",{type:"button",class:"pp-row",onClick:_=>g(S.id)},[A("div",qot,[A("span",Uot,F(S.id),1),U(p(ul),{variant:"neutral",size:"sm"},{default:ce(()=>[$e(F(S.type),1)]),_:2},1024),p(iP)(S)?(k(),de(p(ul),{key:0,variant:"info",size:"sm"},{default:ce(()=>[$e(F(p(t)("providers.managedBadge")),1)]),_:1})):ee("",!0)]),A("span",Vot,F(p(t)("providers.modelCount",{count:h(S)})),1),A("span",Kot,[U(p(Ce),{name:"chevron-right",size:"sm"})])],8,Wot),A("div",Zot,[A("div",Got,[o.value===S.id||s.value===S.id?(k(),de(xZ,{key:0,mode:"edit",provider:S,guard:a.value&&o.value===S.id,onDirtyChange:I[4]||(I[4]=_=>l.value=_),onGuardStay:v,onGuardDiscard:y,onSaved:w,onDeleting:I[5]||(I[5]=_=>o.value=null),onDeleted:T},null,8,["provider","guard"])):ee("",!0)])])],2))),128))]))]))}}),Yot=xt(Qot,[["__scopeId","data-v-f7054f75"]]),Jot=["aria-expanded","aria-label"],Xot={class:"sm-picker__value-text"},est=["aria-label"],tst=["aria-label"],nst={class:"sm-picker__group"},ist=["aria-selected","onMouseenter","onClick"],ost={class:"sm-picker__option-label"},sst=["aria-label"],rst={class:"sm-picker__group"},lst=["aria-selected","onMouseenter","onClick"],ast={class:"sm-picker__option-label"},ust=188,cst=250,L5=8,dst=lt({__name:"SecondaryModelPicker",props:{modelValue:{},effort:{},groups:{},modelInfoById:{}},emits:["select"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=V(null),r=V(null),l=V(null),a=V(null),u=new Map,c=V(!1);ld(c,l);const d=V(!1),f=V({}),h=`sm-picker-${Math.random().toString(36).slice(2,9)}`,m=V(""),g=V(null),v=V("right"),y=V(0),b=V("models"),w=V(0),C=V(0);let T=null;const N=D(()=>n.groups.flatMap(G=>G.options)),I=D(()=>n.modelValue?N.value.find(G=>G.id===n.modelValue)?.label??n.modelValue:""),S=D(()=>n.modelValue?n.effort?`${I.value} · ${n.effort}`:I.value:o("settings.noSecondaryModel")),_=D(()=>{const G=g.value;if(G===null)return[];const ae=Z1(n.modelInfoById[G]),K=n.effort===""?[null,...ae]:[...ae];return n.modelValue===G&&n.effort!==""&&!ae.includes(n.effort)&&K.push(n.effort),K});function x(G){return n.modelValue!==g.value?!1:G===null?n.effort==="":n.effort===G}function E(){const G=_.value.findIndex(ae=>x(ae));return G>=0?G:0}function M(G,ae){G instanceof HTMLElement?u.set(ae,G):u.delete(ae)}function R(){T!==null&&(clearTimeout(T),T=null)}function q(){R(),T=setTimeout(()=>{g.value=null,b.value==="efforts"&&(b.value="models")},cst)}function z(G){G!==m.value&&(m.value=G,w.value=Math.max(0,N.value.findIndex(ae=>ae.id===G)))}function O(){const G=r.value,ae=l.value;if(!G||!ae)return;const K=G.getBoundingClientRect(),re=ae.offsetHeight,be=window.innerHeight-K.bottom;d.value=bere;const ke=Math.max(L5,window.innerWidth-K.right);f.value=d.value?{right:`${ke}px`,bottom:`${window.innerHeight-K.top+4}px`,top:"auto"}:{right:`${ke}px`,top:`${K.bottom+4}px`,bottom:"auto"}}function B(){const G=l.value,ae=g.value===null?void 0:u.get(g.value);if(!G||!ae)return;const K=G.getBoundingClientRect(),re=ae.getBoundingClientRect(),be=a.value?.offsetHeight??0,ke=Math.max(0,window.innerHeight-L5-be-K.top);y.value=Math.max(0,Math.min(re.top-K.top-4,G.offsetHeight-40,ke));const we=window.innerWidth-K.right,oe=K.left;v.value=we>=ust||we>=oe?"right":"left"}function P(G,{moveFocus:ae=!1}={}){z(G),R(),g.value=G,ae&&(b.value="efforts",C.value=E()),ht(B)}function H(){g.value=null,b.value="models"}function j(){c.value||(c.value=!0,m.value=n.modelValue||(N.value[0]?.id??""),w.value=Math.max(0,N.value.findIndex(G=>G.id===m.value)),g.value=null,b.value="models",ht(O))}function Z({restoreFocus:G=!1}={}){c.value&&(R(),c.value=!1,g.value=null,G&&ht(()=>r.value?.focus()))}function ie(){c.value?Z():j()}function W(G){if(g.value===null)return;const ae={model:g.value,effort:G??void 0};(ae.model!==n.modelValue||(ae.effort??"")!==n.effort)&&i("select",ae),Z({restoreFocus:!0})}function Q(){ht(()=>{l.value?.querySelector(".sm-picker__option.is-kb-active")?.scrollIntoView({block:"nearest"})})}function te(G){const ae=N.value;if(ae.length===0)return;const K=(w.value+G+ae.length)%ae.length,re=ae[K].id;z(re),g.value!==null&&P(re),Q()}function X(G){const ae=_.value;ae.length!==0&&(C.value=(C.value+G+ae.length)%ae.length,Q())}function ge(G){if(!c.value){(G.key==="Enter"||G.key===" "||G.key==="ArrowDown")&&(G.preventDefault(),j());return}if(G.key==="ArrowDown")G.preventDefault(),b.value==="models"?te(1):X(1);else if(G.key==="ArrowUp")G.preventDefault(),b.value==="models"?te(-1):X(-1);else if(G.key==="ArrowRight")G.preventDefault(),P(m.value,{moveFocus:!0});else if(G.key==="ArrowLeft")G.preventDefault(),g.value!==null&&H();else if(G.key==="Enter"||G.key===" ")G.preventDefault(),b.value==="models"?P(m.value,{moveFocus:!0}):W(_.value[C.value]??null);else if(G.key==="Home"||G.key==="End"){G.preventDefault();const ae=G.key==="Home";if(b.value==="models"){const K=N.value;if(K.length===0)return;const re=(ae?K[0]:K.at(-1)).id;z(re),g.value!==null&&P(re)}else C.value=ae?0:_.value.length-1;Q()}else G.key==="Escape"&&(G.preventDefault(),Z({restoreFocus:!0}))}function ue(G){const ae=G.target;s.value?.contains(ae)||l.value?.contains(ae)||Z()}function se(G){if(c.value){if(l.value?.contains(G.target)){B();return}O(),B()}}function fe(){Z()}return yn(()=>{document.addEventListener("pointerdown",ue),document.addEventListener("scroll",se,!0),window.addEventListener("resize",fe)}),Ln(()=>{document.removeEventListener("pointerdown",ue),document.removeEventListener("scroll",se,!0),window.removeEventListener("resize",fe),R()}),(G,ae)=>(k(),L("div",{ref_key:"rootRef",ref:s,class:Re(["sm-picker",{"is-open":c.value}])},[A("button",{ref_key:"triggerRef",ref:r,class:"sm-picker__trigger",type:"button",role:"combobox","aria-controls":h,"aria-expanded":c.value,"aria-haspopup":"dialog","aria-label":p(o)("settings.secondaryModel"),onClick:ie,onKeydown:ge},[A("span",{class:Re(["sm-picker__value",{"is-placeholder":!e.modelValue}])},[A("span",Xot,F(S.value),1)],2),U(p(Ce),{class:"sm-picker__chevron",name:"chevron-down",size:"sm"})],40,Jot),(k(),de(cs,{to:"body"},[c.value?(k(),L("div",{key:0,id:h,ref_key:"menuRef",ref:l,class:Re(["sm-picker__menu",{"sm-picker__menu--up":d.value}]),style:on(f.value),role:"dialog","aria-label":p(o)("settings.secondaryModel")},[A("div",{class:"sm-picker__models",role:"listbox","aria-label":p(o)("settings.secondaryModel")},[(k(!0),L(De,null,Ct(e.groups,K=>(k(),L(De,{key:K.provider},[A("div",nst,F(K.provider),1),(k(!0),L(De,null,Ct(K.options,re=>(k(),L("button",{key:re.id,ref_for:!0,ref:be=>M(be,re.id),class:Re(["sm-picker__option",{"is-selected":re.id===e.modelValue,"is-active":re.id===m.value,"is-kb-active":b.value==="models"&&re.id===m.value}]),type:"button",role:"option","aria-selected":re.id===e.modelValue,onMouseenter:be=>P(re.id),onMouseleave:q,onClick:be=>P(re.id,{moveFocus:!0})},[U(p(Ce),{class:"sm-picker__check",name:"check",size:"sm"}),A("span",ost,F(re.label),1),U(p(Ce),{class:"sm-picker__flyout-caret",name:"chevron-right",size:"sm"})],42,ist))),128))],64))),128))],8,tst),g.value!==null?(k(),L("div",{key:0,ref_key:"flyoutRef",ref:a,class:Re(["sm-picker__flyout",`sm-picker__flyout--${v.value}`]),style:on({top:`${y.value}px`}),role:"listbox","aria-label":p(o)("settings.secondaryModelEffort"),onMouseenter:R,onMouseleave:q},[A("div",rst,F(p(o)("settings.secondaryModelEffort")),1),(k(!0),L(De,null,Ct(_.value,(K,re)=>(k(),L("button",{key:K??"__default__",class:Re(["sm-picker__option",{"is-selected":x(K),"is-active":b.value==="efforts"&&re===C.value,"is-kb-active":b.value==="efforts"&&re===C.value,"is-muted":K===null}]),type:"button",role:"option","aria-selected":x(K),onMouseenter:be=>{b.value="efforts",C.value=re},onClick:be=>W(K)},[U(p(Ce),{class:"sm-picker__check",name:"check",size:"sm"}),A("span",ast,F(K??p(o)("settings.secondaryModelEffortAuto")),1)],42,lst))),128))],46,sst)):ee("",!0)],14,est)):ee("",!0)]))],2))}}),fst=xt(dst,[["__scopeId","data-v-ae75986f"]]);function Kh(e){return BO(li,e)}function ZB(e,t,n=!1){return _6(li,e,t,n)}function hst(e){return soe(li,e)}const pst={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"sparkles",askuserquestion:"help-circle",exitplanmode:"file-text",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",waitfor:"clock",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function _Z(e){const t=Mr(e);let n=pst[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),n}function MZ(e){return rb(_Z(e),"sm")}function hc(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function GA(e){return hc(e).some(t=>t.kind==="thinking"&&t.thinking.trim().length>0||t.kind==="text"&&t.text.trim().length>0||t.kind==="tool"||t.kind==="notification")}function IZ(e){return!(e.tool.status==="ok"&&e.tool.media)}function mst(e){const t=hc(e),n=[];let i=[],o=null;const s=()=>{const[l]=i;i.length===1&&l?n.push(l):i.length>1&&n.push({kind:"activity-run",items:i}),i=[]},r=()=>{o&&n.push({kind:"notification",items:o.items,sourceIndex:o.sourceIndex}),o=null};return t.forEach((l,a)=>{if(l.kind==="notification"){o?o.items.push(l.notification):o={items:[l.notification],sourceIndex:a};return}if(i.length===0&&r(),l.kind==="thinking"){i.push({kind:"thinking",thinking:l.thinking,startedAt:l.startedAt,durationMs:l.durationMs,sourceIndex:a});return}if(l.kind==="tool"&&IZ(l)){i.push({kind:"tool",tool:l.tool,sourceIndex:a});return}s(),r(),l.kind==="text"?n.push({kind:"text",text:l.text,sourceIndex:a}):l.kind==="tool"&&n.push({kind:"tool",tool:l.tool,sourceIndex:a})}),s(),r(),n}const GB=new WeakMap;function TZ(e){const t=GB.get(e);if(t!==void 0)return t;const n=gst(e);return GB.set(e,n),n}function gst(e){const t=mst(e);let n=-1;for(let r=t.length-1;r>=0;r--){const l=t[r];if(l?.kind==="text"&&l.text.trim().length>0){n=r;break}}if(n===-1){for(let r=0;rr.kind==="notification");return s.length>0?{folded:i.filter(r=>r.kind!=="notification"),visible:[...s,...o]}:{folded:i,visible:o}}function vst(e){const t=n=>n.kind==="activity-run"?n.items[0]?.sourceIndex??-1:n.sourceIndex;return[...e.folded,...e.visible].sort((n,i)=>t(n)-t(i))}function yst(e){let t;for(const n of e){if(n.kind!=="thinking"||n.startedAt===void 0)continue;const i=Date.parse(n.startedAt);Number.isNaN(i)||(t===void 0||it.kind==="text"&&t.text?[t.text]:[]).join(` +`)}function Ae(ot){return le(ot).some(ZA)}function Me(){for(let ot=r.turns.length-1;ot>=0;ot-=1)if(r.turns[ot]?.role==="assistant")return ye(ot);return""}function fe(){const ot=Me();ot.trim()&&Ls(ot).then(Ue=>{Ue&&(be.value=!0,b("copyConversationCopied"),ke!==null&&clearTimeout(ke),ke=setTimeout(()=>{ke=null,be.value=!1},2e3))}).catch(()=>{})}t({copyConversation:oe,copyFinalSummary:fe});function ie(ot){const Ue=r.turns[ot];if(!Ue||Ue.role!=="assistant")return!1;const st=r.turns[ot+1];return!st||st.role!=="assistant"}let Ee=null;function qe(ot){const Ue=r.turns[ot];if(!Ue)return;const st=ye(ot);st.trim()&&Ls(st).then(In=>{In&&(pe.value=Ue.id,Ee!==null&&clearTimeout(Ee),Ee=setTimeout(()=>{Ee=null,pe.value=null},1400))}).catch(()=>{})}function ze(ot){const Ue=ot.text;Ue.trim()&&WMe(yd(Ue),_Se(Ue,ot.inlineAttachments)).then(st=>{st&&(pe.value=ot.id,Ee!==null&&clearTimeout(Ee),Ee=setTimeout(()=>{Ee=null,pe.value=null},1400))}).catch(()=>{})}const ht=ao(new Set),gt=ao(new Set),_t=new Map,$t=new WeakMap,jt=Yt(df,()=>{}),Ht=new ResizeObserver(ot=>{for(const Ue of ot){const st=Ue.target,In=$t.get(st);In!==void 0&&Te(In,st)}});Ln(()=>Ht.disconnect());function Te(ot,Ue){const st=parseFloat(getComputedStyle(Ue).lineHeight);if(!Number.isFinite(st)||st<=0)return;const kt=(Ue.textContent??"").match(/\n+$/)?.[0].length??0,ui=Ue.scrollHeight-Math.max(0,kt-1)*st,_o=ot.startsWith("queue:")?nXe:tXe;ui>st*_o+1?ht.add(ot):ht.delete(ot)}function Fe(ot,Ue){if(!(Ue instanceof HTMLElement)||_t.get(ot)===Ue)return;const st=_t.get(ot);st!==void 0&&Ht.unobserve(st),_t.set(ot,Ue),$t.set(Ue,ot),Ht.observe(Ue),Te(ot,Ue)}function Ve(ot){return`queue:${ot.id}`}We([()=>r.turns,()=>r.queued],()=>{const ot=new Set(r.turns.map(Ue=>Ue.id));for(const Ue of r.queued)ot.add(Ve(Ue));for(const[Ue,st]of _t)ot.has(Ue)||(Ht.unobserve(st),_t.delete(Ue),ht.delete(Ue),gt.delete(Ue))});function lt(ot){if(ot.skillActivation){const Ue=ot.skillActivation;if(gU(Ue))return Ue.args??null;const st=nm({kind:"skill",name:Ue.name,path:""});return Ue.args?`${st} ${Ue.args}`:st}return ot.pluginCommand?ot.pluginCommand.args||null:ot.text||null}function Ft(ot){return ot.pluginCommand!==void 0}function Lt(ot){return ht.has(ot)&&!gt.has(ot)}function Vt(ot,Ue){const st=gt.has(ot);st&&Ue.currentTarget instanceof HTMLElement&&jt(Ue.currentTarget),st?gt.delete(ot):gt.add(ot)}function qt(ot){return ot.kind==="image"||ot.kind==="video"}function nn(ot){return(ot.attachments??[]).filter(qt)}function it(ot){return ot.name??(ot.kind==="video"?i("composer.attachmentVideo"):i("composer.attachmentImage"))}function dt(ot){return(ot.attachments??[]).filter(Ue=>!qt(Ue))}const At=V(null),un=V(null);function Qt(ot,Ue){return ot.id!==f.value||Ue.kind==="thinking"&&Ue.durationMs!==void 0?!1:Ue.sourceIndex===pc(ot).length-1}function ei(ot,Ue){if(ot.id!==f.value)return!1;const st=Ue.items.at(-1);return st?.kind==="thinking"&&st.durationMs!==void 0?!1:st!==void 0&&st.sourceIndex===pc(ot).length-1}const mi={folded:[],visible:[]};function Hi(ot){return ot.role!=="assistant"?mi:TZ(ot)}function wi(ot){const Ue=Hi(ot);return r.inspector||!s.value?pst(Ue):Ue.visible}function Vo(ot){if(ot.id!==f.value)return null;const Ue=pc(ot),st=Ue.at(-1);if(st?.kind==="thinking"&&st.durationMs!==void 0)return null;if(st?.kind==="tool"&&st.tool.status==="running"){const In=st.tool.id;if(r.approvals?.some(kt=>kt.toolCallId===In)||r.questions?.some(kt=>kt.toolCallId===In))return null}return Ue.length-1}return(ot,Ue)=>(k(),L(De,null,[A("div",{class:"chat",ref_key:"chatRootRef",ref:c,tabindex:"-1",onMouseup:x,onKeyup:M,onPointerdown:E},[e.sessionLoading?(k(),L("div",UYe,[U(p(uo),{size:"sm"}),A("span",VYe,F(p(i)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(k(),L("div",KYe)):ee("",!0),e.hasMoreMessages||e.loadingMore?(k(),L("div",{key:2,ref_key:"topSentinelRef",ref:l,class:Re(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(k(),L("span",ZYe,[U(p(uo),{size:"sm"}),Oe(" "+F(p(i)("conversation.loadingOlder")),1)])):(k(),L("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:Ue[0]||(Ue[0]=st=>b("loadOlderMessages"))},F(p(i)("conversation.loadOlder")),1))],2)):ee("",!0),(k(!0),L(De,null,Ct(e.turns,(st,In)=>(k(),L(De,{key:st.id},[st.role==="user"?(k(),L("div",GYe,[A("div",{class:Re(["u-bub turn-anchor",{undoing:ae.value===st.id}]),"data-turn-id":st.id},[nn(st).length>0?(k(),L("div",YYe,[(k(!0),L(De,null,Ct(nn(st),(kt,ui)=>(k(),L(De,{key:ui},[kt.url!==""?(k(),L("button",{key:0,type:"button",class:Re(`attachment-pill attachment-${kt.kind}`),"data-attachment-id":kt.fileId??kt.name??"","data-attachment-kind":kt.kind,"data-attachment-name":it(kt),"data-attachment-url":kt.url,"data-attachment-file-id":kt.fileId,"data-attachment-media-type":kt.mediaType,"data-attachment-size":kt.size,"data-attachment-session-id":kt.sessionId,"aria-label":it(kt)},[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p(O1)(kt.kind)},null,8,XYe),A("span",eJe,F(p(_u)(it(kt))),1)],10,JYe)):(k(),L("span",{key:1,class:Re(`attachment-pill attachment-${kt.kind}`),"data-attachment-id":kt.fileId??kt.name??"","data-attachment-kind":kt.kind,"data-attachment-name":it(kt),"data-attachment-file-id":kt.fileId,"data-attachment-media-type":kt.mediaType,"data-attachment-size":kt.size,"data-attachment-session-id":kt.sessionId,"aria-label":it(kt)},[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p(O1)(kt.kind)},null,8,nJe),A("span",iJe,F(p(_u)(it(kt))),1)],10,tJe))],64))),128))])):ee("",!0),dt(st).length>0?(k(),L("div",oJe,[(k(!0),L(De,null,Ct(dt(st),(kt,ui)=>(k(),L(De,{key:ui},[kt.url!==""?(k(),L("button",{key:0,type:"button",class:"attachment-pill attachment-file","data-attachment-id":kt.fileId??kt.name??"","data-attachment-kind":"file","data-attachment-name":kt.name??"","data-attachment-url":kt.url,"data-attachment-file-id":kt.fileId,"data-attachment-media-type":kt.mediaType,"data-attachment-size":kt.size,"aria-label":kt.name},[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p(T4)()},null,8,rJe),A("span",lJe,F(p(_u)(kt.name??"")),1)],8,sJe)):(k(),L("span",{key:1,class:"attachment-pill attachment-file","data-attachment-id":kt.fileId??kt.name??"","data-attachment-kind":"file","data-attachment-name":kt.name??"","data-attachment-file-id":kt.fileId,"data-attachment-media-type":kt.mediaType,"data-attachment-size":kt.size,"aria-label":kt.name},[A("span",{class:"attachment-pill-icon","aria-hidden":"true",innerHTML:p(T4)()},null,8,uJe),A("span",cJe,F(p(_u)(kt.name??"")),1)],8,aJe))],64))),128))])):ee("",!0),st.pluginCommand?(k(),L("div",dJe,[A("div",fJe,[Ue[3]||(Ue[3]=A("span",{class:"skill-act-arrow"},"▶",-1)),A("span",null,"/"+F(st.pluginCommand.pluginId)+":"+F(st.pluginCommand.commandName),1)])])):ee("",!0),lt(st)!==null||(st.inlineAttachments?.length??0)>0?(k(),L("div",{key:3,class:Re(["u-text-wrap",{"is-clamped":Lt(st.id),"u-text-wrap-args":Ft(st)}])},[A("div",{class:Re(Ft(st)?"skill-act-args":"u-text"),ref_for:!0,ref:kt=>Fe(st.id,kt)},[U(p(_A),{text:lt(st)??"","open-file":p(w)?.openFile,attachments:st.inlineAttachments},null,8,["text","open-file","attachments"])],2),ht.has(st.id)?(k(),L("button",{key:0,type:"button",class:"u-text-toggle","aria-expanded":!Lt(st.id),onClick:kt=>Vt(st.id,kt)},[A("span",null,F(Lt(st.id)?p(i)("conversation.userMessage.expand"):p(i)("conversation.userMessage.collapse")),1),U(p(Ce),{class:"u-text-toggle-car",name:"chevron-down",size:"sm","aria-hidden":"true"})],8,hJe)):ee("",!0)],2)):ee("",!0)],10,QYe),st.createdAt||ce(st)||!e.readOnly&&e.undoHintTurnId===st.id?(k(),L("div",pJe,[ce(st)||!e.readOnly&&e.undoHintTurnId===st.id?(k(),L("div",{key:0,class:Re(["u-edit-wrap",{undoing:ae.value===st.id}])},[e.undoHintTurnId===st.id?(k(),de(p(Nn),{key:0,text:p(i)("conversation.undoTooltip")},{default:ue(()=>[A("button",{type:"button",class:"u-edit u-edit-armed","aria-label":p(i)("conversation.undoTooltip"),onClick:kt=>b("armedUndo",st.id)},[U(p(Ce),{name:"undo",size:"sm"}),A("span",gJe,[Oe(F(p(i)("conversation.escUndoHintPre")),1),U(p(gc),{keys:["Esc"]}),Oe(F(p(i)("conversation.escUndoHintPost")),1)])],8,mJe)]),_:2},1032,["text"])):(k(),de(p(Nn),{key:1,text:p(i)("conversation.undoTooltip")},{default:ue(()=>[A("button",{type:"button",class:"u-edit","aria-label":p(i)("conversation.undoTooltip"),onClick:kt=>re(st)},[U(p(Ce),{name:"undo",size:"sm"})],8,vJe)]),_:2},1032,["text"]))],2)):ee("",!0),U(p(Nn),{text:p(i)("filePreview.copy")},{default:ue(()=>[st.text.trim().length>0?(k(),L("button",{key:0,type:"button",class:"u-copy","aria-label":p(i)("filePreview.copy"),onClick:Tt(kt=>ze(st),["stop"])},[pe.value!==st.id?(k(),de(p(Ce),{key:0,name:"copy",size:"sm"})):(k(),de(p(Ce),{key:1,name:"check",size:"sm"}))],8,yJe)):ee("",!0)]),_:2},1032,["text"]),st.createdAt?(k(),de(fS,{key:1,time:st.createdAt},null,8,["time"])):ee("",!0)])):ee("",!0)])):st.role==="compaction"?(k(),L("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":st.id,role:"separator"},[Ue[4]||(Ue[4]=A("span",{class:"cd-line","aria-hidden":"true"},null,-1)),st.text&&p(w)?.openCompaction!==void 0?(k(),L("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:kt=>p(w)?.openCompaction?.({turnId:st.id})},[A("span",null,F(se(st)),1),A("span",wJe,F(p(i)("conversation.viewSummary")),1)],8,bJe)):(k(),L("span",CJe,F(se(st)),1)),Ue[5]||(Ue[5]=A("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,kJe)):st.role==="cron"?(k(),de(mQe,{key:2,text:st.text,cron:st.cron,"turn-id":st.id,"created-at":st.createdAt},null,8,["text","cron","turn-id","created-at"])):(k(),L("div",{key:3,class:"a-msg turn-anchor","data-turn-id":st.id},[st.goalContinuation?(k(),L("div",xJe,[U(p(Ce),{name:"target",size:"sm","aria-hidden":"true"}),A("span",null,F(p(i)("conversation.goal.continuation")),1)])):ee("",!0),!e.inspector&&p(s)&&Hi(st).folded.length>0?(k(),de(VGe,{key:1,items:Hi(st).folded,mobile:"","streaming-tail-index":Vo(st),live:st.id===f.value,parked:st.id===f.value&&Vo(st)===null,"seed-ms":p(mst)(p(pc)(st)),"created-ms":p(YB)(st.createdAt),"ended-ms":p(YB)(st.endedAt),"duration-ms":st.durationMs,onOpenMedia:C,onDetach:T},null,8,["items","streaming-tail-index","live","parked","seed-ms","created-ms","ended-ms","duration-ms"])):ee("",!0),(k(!0),L(De,null,Ct(wi(st),(kt,ui)=>(k(),L(De,{key:p(LZ)(kt,ui)},[kt.kind==="thinking"?(k(),de(uS,{key:0,text:kt.thinking,mobile:"",streaming:Qt(st,kt),"started-at":kt.startedAt,"duration-ms":kt.durationMs,"instant-reveal":e.inspector},null,8,["text","streaming","started-at","duration-ms","instant-reveal"])):kt.kind==="text"&&kt.text?(k(),L("div",SJe,[U(p(_c),{text:kt.text,streaming:Qt(st,kt),"open-file":p(w)?.openFile},null,8,["text","streaming","open-file"])])):kt.kind==="activity-run"?(k(),de(cZ,{key:2,items:kt.items,mobile:"",streaming:ei(st,kt),"force-open":e.inspector,onOpenMedia:C,onDetach:T},null,8,["items","streaming","force-open"])):kt.kind==="tool"?(k(),de(dS,{key:3,tool:kt.tool,mobile:"",onOpenMedia:C,onDetach:T},null,8,["tool"])):kt.kind==="notification"?(k(),de(dZ,{key:4,items:kt.items},null,8,["items"])):ee("",!0)],64))),128)),!e.inspector&&h.value.get(st.id)?(k(),de(lQe,{key:2,changes:h.value.get(st.id),"turn-id":st.id,cwd:r.cwd,interactive:e.turnFilesInteractive},null,8,["changes","turn-id","cwd","interactive"])):ee("",!0),!e.inspector&&st.id!==f.value&&ie(In)&&Ae(In)&&(ye(In).trim().length>0||Z(st))?(k(),L("div",_Je,[Z(st)?(k(),L("span",MJe,F(Z(st)),1)):ee("",!0),U(p(Nn),{text:p(i)("filePreview.copy")},{default:ue(()=>[ye(In).trim().length>0?(k(),L("button",{key:0,class:"a-cpbtn","aria-label":p(i)("filePreview.copy"),onClick:kt=>qe(In)},[pe.value!==st.id?(k(),de(p(Ce),{key:0,name:"copy",size:"sm"})):(k(),de(p(Ce),{key:1,name:"check",size:"sm"}))],8,IJe)):ee("",!0)]),_:2},1032,["text"])])):ee("",!0)],8,AJe)),st.role==="assistant"&&st.id===e.interruptedTurnId?(k(),L("div",TJe,[Ue[6]||(Ue[6]=A("span",{class:"cd-line","aria-hidden":"true"},null,-1)),A("span",EJe,F(p(i)("conversation.turnInterrupted")),1),Ue[7]||(Ue[7]=A("span",{class:"cd-line","aria-hidden":"true"},null,-1))])):ee("",!0)],64))),128)),e.turnFailed?(k(),L("div",LJe,[A("span",NJe,[U(p(Ce),{name:"alert-triangle",size:"sm"})]),A("div",DJe,[A("span",FJe,F(v.value),1),e.turnError?.message?(k(),L("span",{key:0,class:"tf-sub",title:e.turnError.message},F(e.turnError.message),9,BJe)):ee("",!0),y.value?(k(),L("span",{key:1,class:"tf-meta",title:y.value},F(y.value),9,RJe)):ee("",!0)]),e.readOnly?ee("",!0):(k(),de(p(rn),{key:0,variant:"secondary",size:"sm",onClick:Ue[1]||(Ue[1]=st=>b("resumeTurn"))},{default:ue(()=>[Oe(F(p(i)("conversation.turnFailedResume")),1)]),_:1}))])):ee("",!0),e.compaction?(k(),de(jUe,{key:4,label:p(i)("conversation.compacting")},null,8,["label"])):ee("",!0),m.value?(k(),L("div",OJe,[U(gS,{label:g.value},null,8,["label"])])):ee("",!0),e.queued.length>0?(k(),L("div",$Je,[A("div",PJe,[A("span",zJe,[U(p(Ce),{name:"mail",size:"sm"}),Oe(" "+F(p(i)("composer.queueLabel"))+" · ",1),A("b",null,F(p(i)("composer.queuePending",{n:e.queued.length})),1)])]),(k(!0),L(De,null,Ct(e.queued,(st,In)=>(k(),L("div",{key:st.id,class:Re(["u-turn q-turn",{"q-dragging":B.value===In,"drop-before":P.value?.index===In&&P.value.position==="before","drop-after":P.value?.index===In&&P.value.position==="after"}]),onDragover:kt=>Q(In,kt),onDrop:kt=>te(In,kt)},[In===0?(k(),de(p(Nn),{key:0,text:p(i)("composer.queueSteer")},{default:ue(()=>[A("button",{type:"button",class:"q-send","aria-label":p(i)("composer.queueSteer"),onClick:Tt(kt=>b("steerQueued",In),["stop"])},[U(p(Ce),{name:"send",size:"lg"})],8,HJe)]),_:2},1032,["text"])):ee("",!0),A("div",WJe,[A("span",{class:"q-grip",title:p(i)("composer.queueDragTitle"),draggable:"true",onDragstart:kt=>W(In,kt),onDragend:X},[U(p(Ce),{name:"grip",size:"sm"})],40,qJe),A("div",{class:Re(["q-clamp u-text-wrap",{"is-clamped":Lt(Ve(st))}])},[A("button",{type:"button",class:"q-body",title:p(i)("composer.editQueued"),ref_for:!0,ref:kt=>Fe(Ve(st),kt),onClick:kt=>ne(In)},[st.text?(k(),L("span",VJe,[U(p(_A),{text:st.text,interactive:!1,attachments:st.attachments},null,8,["text","attachments"])])):(k(),L("span",KJe,[U(p(Ce),{name:"file",size:"sm"}),Oe(" "+F(p(i)("composer.queuedAttachments",{n:st.attachments?.length??0})),1)]))],8,UJe),ht.has(Ve(st))?(k(),L("button",{key:0,type:"button",class:"u-text-toggle","aria-expanded":!Lt(Ve(st)),onClick:kt=>Vt(Ve(st),kt)},[A("span",null,F(Lt(Ve(st))?p(i)("conversation.userMessage.expand"):p(i)("conversation.userMessage.collapse")),1),U(p(Ce),{class:"u-text-toggle-car",name:"chevron-down",size:"sm","aria-hidden":"true"})],8,ZJe)):ee("",!0)],2),H(st)?(k(),L("div",GJe,[(k(!0),L(De,null,Ct(j(st),(kt,ui)=>(k(),L(De,{key:ui},[kt.kind==="file"?(k(),L("span",QJe,[U(p(Ce),{name:"file",size:"sm"}),Oe(" "+F(kt.name??kt.fileId),1)])):(k(),de(cS,{key:1,url:kt.url,kind:kt.kind,"file-id":kt.fileId,"session-id":kt.sessionId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id","session-id"]))],64))),128))])):ee("",!0),A("button",{type:"button",class:"q-edit","aria-label":p(i)("composer.editQueued"),onClick:Tt(kt=>G(In),["stop"])},[U(p(Ce),{name:"pencil",size:"sm"})],8,YJe),U(p(Nn),{text:p(i)("composer.remove")},{default:ue(()=>[A("button",{type:"button",class:"q-rm","aria-label":p(i)("composer.remove"),onClick:Tt(kt=>b("unqueue",In),["stop"])},[U(p(Ce),{name:"close",size:"sm"})],8,JJe)]),_:2},1032,["text"])])],42,jJe))),128))])):ee("",!0)],544),At.value?(k(),de(CZ,{key:0,media:At.value,"origin-img":un.value,onClose:Ue[2]||(Ue[2]=st=>{At.value=null,un.value=null})},null,8,["media","origin-img"])):ee("",!0),S.value?(k(),de(AZ,{key:1,visible:N.value!==null,x:N.value?.x??0,y:N.value?.y??0,bottom:N.value?.bottom??0,px:N.value?.px,py:N.value?.py,quote:N.value?.quote??"","focus-on-open":I.value,"focus-return-el":c.value,onAction:$,onClose:z},null,8,["visible","x","y","bottom","px","py","quote","focus-on-open","focus-return-el"])):ee("",!0)],64))}}),vS=St(iXe,[["__scopeId","data-v-999e1e60"]]),oXe={class:"agent-panel"},sXe={class:"agent-transcript-inner"},rXe={key:0,class:"agent-meta"},lXe={class:"agent-meta-text"},aXe={key:1,class:"agent-prompt"},uXe={class:"agent-prompt-bubble"},cXe=["aria-expanded"],dXe={key:0,class:"agent-error"},fXe=6,hXe=rt({__name:"AgentDetailPanel",props:{member:{},turns:{},running:{type:Boolean},loading:{type:Boolean},loadError:{type:Boolean},hasMore:{type:Boolean},loadingMore:{type:Boolean},loadMoreError:{type:Boolean}},emits:["loadOlderMessages","openMedia"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=Yt(Uo);ii(Uo,s&&{...s,openTurnDiff:({change:j})=>s.openTurnDiff({turnId:`agent:${n.member.id}`,change:j}),openCompaction:void 0});const r=D(()=>n.member.kind==="bash"),l=D(()=>{const j=n.member.prompt;return j!==void 0&&j.trim()!==""?j:void 0}),a=V(null),u=V(!1),c=V(!1),d=D(()=>u.value&&!c.value);function f(){const j=a.value;if(!j)return;const G=Number.parseFloat(getComputedStyle(j).lineHeight);!Number.isFinite(G)||G<=0||(u.value=j.scrollHeight>G*fXe+1)}const h=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>f());We(a,(j,G)=>{G&&h?.unobserve(G),j&&h?.observe(j),f()}),We(l,()=>{c.value=!1,ft(f)});function m(j){if(!c.value)T();else{const G=j.currentTarget instanceof HTMLElement?j.currentTarget:null,ne=b.value;if(G!==null&&ne!==null){const W=G.getBoundingClientRect().top;requestAnimationFrame(()=>{ne.scrollTop+=G.getBoundingClientRect().top-W})}}c.value=!c.value}const g=D(()=>{const j=l.value;if(j===void 0)return n.turns;const G=n.turns.findIndex(Q=>Q.role==="user");if(G===-1)return n.turns;const ne=n.turns[G];return ne.text!==j?n.turns:(ne.attachments?.length??0)>0?n.turns.map((Q,te)=>te===G?{...Q,text:""}:Q):n.turns.filter((Q,te)=>te!==G)}),v=D(()=>{const j=l.value;if(j!==void 0)return n.turns.find(G=>G.role==="user"&&G.text===j)?.inlineAttachments}),y=D(()=>n.member.id),{scroller:b,following:w,onScroll:C,pinScroll:T,jumpToBottom:N}=Y$e(y),I=D(()=>n.member.status==="running"&&n.member.phase!=="queued"&&n.member.phase!=="suspended"&&!(n.loading&&g.value.length===0)),S=D(()=>o(R.value.length>0?"conversation.working":"conversation.requesting"));We(y,()=>{c.value=!1});const _=V(!1);let x=null,E=null;function M(){x!==null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(x),E!==null&&clearTimeout(E),x=null,E=null}We(y,()=>{_.value=!1,M();const j=()=>{M(),_.value=!0};typeof requestAnimationFrame=="function"?x=requestAnimationFrame(()=>{x=requestAnimationFrame(j)}):E=setTimeout(j,32)},{immediate:!0}),Xn(()=>{M(),h?.disconnect()});const R=D(()=>{const j=new Set,G=[],ne=n.member.prompt?.trim(),W=ne?`$ ${ne}`:null;for(const Q of[n.member.suspendedReason,n.member.text,n.member.outputLines?.join(` +`),n.member.summary]){const te=Q?.trim();!te||j.has(te)||W!==null&&te===W||(j.add(te),G.push(te))}return G}),q=D(()=>n.member.kind==="subagent");ii(df,()=>{b.value&&T()});const z=Yt(im),$=Yt(om),B=D(()=>{const j=n.member.subagentType?.trim();return j?j.charAt(0).toUpperCase()+j.slice(1):void 0}),P=D(()=>{const j=[z?.(n.member.model),$?.(n.member.thinkingEffort)].filter(G=>!!G);return j.length>0?j.join(" · "):void 0}),H=D(()=>{const j=[B.value,P.value].filter(G=>!!G);return j.length>0?j.join(" · "):void 0});return(j,G)=>(k(),L("div",oXe,[A("div",{ref_key:"scroller",ref:b,class:"agent-transcript",onScrollPassive:G[2]||(G[2]=(...ne)=>p(C)&&p(C)(...ne))},[A("div",sXe,[H.value?(k(),L("div",rXe,[A("span",lXe,F(H.value),1)])):ee("",!0),l.value?(k(),L("section",aXe,[A("div",uXe,[A("div",{class:Re(["agent-prompt-wrap",{"is-clamped":d.value}])},[A("div",{ref_key:"promptTextEl",ref:a,class:Re(["agent-prompt-text",{"is-command":r.value}])},[r.value?(k(),L(De,{key:1},[Oe(F(l.value),1)],64)):(k(),de(p(_A),{key:0,text:l.value??"","open-file":p(s)?.openFile,attachments:v.value},null,8,["text","open-file","attachments"]))],2),u.value?(k(),L("button",{key:0,type:"button",class:"agent-prompt-toggle","aria-expanded":!d.value,onClick:m},[A("span",null,F(d.value?p(o)("tasks.expand"):p(o)("tasks.collapse")),1),U(p(Ce),{class:Re(["agent-prompt-toggle-car",{open:!d.value}]),name:"chevron-down",size:"sm","aria-hidden":"true"},null,8,["class"])],8,cXe)):ee("",!0)],2)])])):ee("",!0),_.value?(k(),L(De,{key:2},[g.value.length===0&&!e.loading&&(e.loadError||R.value.length>0)?(k(),L("div",{key:0,class:Re(["agent-fallback",{prose:q.value}])},[e.loadError?(k(),L("div",dXe,F(p(o)("tasks.transcriptLoadError")),1)):ee("",!0),R.value.length>0?(k(),de(Cl,{key:1,lines:R.value},null,8,["lines"])):ee("",!0),I.value?(k(),de(gS,{key:2,label:S.value},null,8,["label"])):ee("",!0)],2)):(k(),de(vS,{key:1,turns:g.value,"turn-active":e.running,"session-loading":e.loading&&g.value.length===0,"has-more-messages":e.hasMore,"loading-more":e.loadingMore,"loading-more-error":e.loadMoreError,"is-following":p(w),working:I.value,"read-only":"",inspector:"","selection-actions":!1,onLoadOlderMessages:G[0]||(G[0]=ne=>i("loadOlderMessages")),onOpenMedia:G[1]||(G[1]=ne=>i("openMedia",ne))},null,8,["turns","turn-active","session-loading","has-more-messages","loading-more","loading-more-error","is-following","working"]))],64)):ee("",!0)])],544),U(mo,{name:"agent-jump"},{default:ue(()=>[p(w)?ee("",!0):(k(),L("button",{key:0,class:"agent-jump-btn",type:"button",onClick:G[3]||(G[3]=ne=>p(N)())},[U(p(Ce),{class:"agent-jump-car",name:"arrow-down",size:"sm"}),A("span",null,F(p(o)("conversation.backToBottom")),1)]))]),_:1})]))}}),pXe=St(hXe,[["__scopeId","data-v-1441b1f4"]]),mXe=["aria-label","aria-hidden"],gXe={class:"toc-scroll"},vXe=["onClick"],yXe={class:"toc-label"},kXe=240,bXe=rt({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=V(null),r=V(!0);let l=null;function a(){const c=s.value,d=c?.offsetParent;if(!c||!d)return;const f=c.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=kXe}const u=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return We(u,c=>{l?.disconnect(),l=null,c&&ft(()=>{const d=s.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),Xn(()=>{l?.disconnect(),l=null}),(c,d)=>u.value?(k(),L("nav",{key:0,ref_key:"navRef",ref:s,class:Re(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":p(o)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[A("div",gXe,[(k(!0),L(De,null,Ct(e.items,f=>(k(),L("button",{key:f.id,type:"button",class:Re(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>i("select",f.id)},[d[0]||(d[0]=A("span",{class:"toc-bar"},null,-1)),A("span",yXe,F(f.title),1)],10,vXe))),128))])],10,mXe)):ee("",!0)}}),wXe=St(bXe,[["__scopeId","data-v-9c0a5438"]]),CXe={class:"changes-pane"},AXe={class:"dv-path"},xXe={class:"diff-head"},SXe={class:"back-label"},_Xe={key:"loading",class:"empty-state diff-loading"},MXe={key:"lines",class:"dv-lines-wrap"},IXe={key:"empty",class:"empty-state"},TXe={class:"dv-change-count"},EXe={class:"ch-head"},LXe={class:"br-heading"},NXe={class:"br-label"},DXe={class:"br-name"},FXe={key:0,class:"sync-info"},BXe={key:0,class:"ahead"},RXe={key:0,class:"behind"},OXe={key:1,class:"empty-head"},$Xe={class:"ch-list-content"},PXe=["onClick"],zXe={class:"fpath"},jXe=["onClick"],HXe={class:"tree-name"},WXe=["onClick"],qXe={class:"tree-name"},UXe={key:2,class:"empty-state"},VXe={class:"empty-state-icon","aria-hidden":"true"},KXe={key:3,class:"empty-state"},ZXe=rt({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},fullTexts:{},emptyFile:{type:Boolean},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Ut();function i(R){return n(R===1?"diff.fileCountOne":"diff.fileCountOther",{number:R})}const o=e,s=t;function r(R){const q=R.toLowerCase();return q==="modified"?"modified":q==="added"?"added":q==="deleted"?"deleted":q==="renamed"?"renamed":q==="untracked"?"untracked":q==="conflicted"?"conflicted":q==="ignored"?"ignored":q==="clean"?"clean":"unknown"}const l={modified:"M",added:"+",deleted:"−",renamed:"→",untracked:"+",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function a(R){return l[r(R)]??"?"}function u(R,q=60){return R.length<=q?R:"…"+R.slice(R.length-q+1)}const c=D(()=>o.gitInfo!==null),d=D(()=>o.changes.length>0),f=D(()=>(o.selectedDiffPath??null)!==null),h=D(()=>o.mode==="detail"||o.mode==="full"&&f.value),m=D(()=>o.fileDiff??[]),g=D(()=>o.fileDiffLoading===!0);function v(R){s("open",R)}function y(){s("back")}function b(){s("close")}const w=V("list");function C(R){w.value=R}function T(R){const q={children:[]},z=[...R].sort(($,B)=>$.path.localeCompare(B.path));for(const $ of z){const B=$.path.endsWith("/"),P=$.path.split("/").filter(Boolean);if(P.length===0)continue;let H=q;for(let j=0;jte.name===G&&te.kind===(ne?"file":"folder"));Q||(Q={name:G,path:W,kind:ne?"file":"folder",status:ne?$.status:void 0,children:[]},H.children.push(Q)),H=Q}}return q.children}const N=D(()=>T(o.changes)),I=V(new Set);function S(R){return!I.value.has(R)}const _=D(()=>{const R=[];function q(z,$){for(const B of z)R.push({node:B,depth:$}),B.kind==="folder"&&S(B.path)&&q(B.children,$+1)}return q(N.value,0),R});function x(R){const q=new Set(I.value);q.has(R.path)?q.delete(R.path):q.add(R.path),I.value=q}function E(R){return`calc(var(--tree-base-indent) + ${R} * var(--tree-indent-step))`}function M(R){return{paddingLeft:E(R),"--tree-depth":String(R)}}return(R,q)=>(k(),L("div",CXe,[h.value?(k(),L(De,{key:0},[U(p(_1),{title:p(n)("diff.title"),closable:e.closable,"close-label":p(n)("diff.close"),onClose:b},{default:ue(()=>[U(p(Nn),{text:e.selectedDiffPath??""},{default:ue(()=>[A("span",AXe,F(u(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),A("div",xXe,[e.hideBack?ee("",!0):(k(),de(p(rn),{key:0,variant:"ghost",size:"sm",onClick:y},{default:ue(()=>[U(p(Ce),{name:"arrow-left",size:"sm"}),A("span",SXe,F(p(n)("diff.back")),1)]),_:1}))]),U(mo,{name:"diff-content",mode:"out-in"},{default:ue(()=>[g.value?(k(),L("div",_Xe,[U(p(uo),{size:"md"}),A("span",null,F(p(n)("diff.loading")),1)])):m.value.length>0?(k(),L("div",MXe,[U(Wa,{lines:m.value,path:e.selectedDiffPath??void 0,"line-numbers":"",framed:!1,"full-texts":e.fullTexts??null},null,8,["lines","path","full-texts"])])):(k(),L("div",IXe,F(e.emptyFile?p(n)("diff.emptyFile"):p(n)("diff.noDiff")),1))]),_:1})],64)):(k(),L(De,{key:1},[U(p(_1),{title:p(n)("diff.title"),closable:e.closable,"close-label":p(n)("diff.close"),onClose:b},{default:ue(()=>[A("span",TXe,F(i(e.changes.length)),1),U(p(Is),{"model-value":w.value,size:"sm",options:[{value:"list",label:p(n)("diff.list"),icon:"list"},{value:"tree",label:p(n)("diff.tree"),icon:"tree-view"}],"onUpdate:modelValue":C},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),A("div",EXe,[c.value?(k(),L(De,{key:0},[A("span",LXe,[U(p(Ce),{class:"br-icon",name:"git-fork",size:"sm"}),A("span",NXe,F(p(n)("diff.branch")),1)]),A("span",DXe,F(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(k(),L("span",FXe,[U(p(Nn),{text:p(n)("diff.aheadTitle")},{default:ue(()=>[e.gitInfo.ahead>0?(k(),L("span",BXe,"↑"+F(e.gitInfo.ahead),1)):ee("",!0)]),_:1},8,["text"]),U(p(Nn),{text:p(n)("diff.behindTitle")},{default:ue(()=>[e.gitInfo.behind>0?(k(),L("span",RXe,"↓"+F(e.gitInfo.behind),1)):ee("",!0)]),_:1},8,["text"])])):ee("",!0)],64)):(k(),L("span",OXe,F(p(n)("diff.empty")),1))]),d.value&&w.value==="list"?(k(),de(p(QM),{key:0,class:"ch-list"},{default:ue(()=>[A("div",$Xe,[(k(!0),L(De,null,Ct(e.changes,z=>(k(),de(p(Nn),{key:z.path,text:z.path},{default:ue(()=>[A("button",{type:"button",class:"ch-row",onClick:$=>v(z.path)},[A("span",{class:Re(["badge",r(z.status)])},F(a(z.status)),3),A("span",zXe,F(u(z.path)),1)],8,PXe)]),_:2},1032,["text"]))),128))])]),_:1})):d.value&&w.value==="tree"?(k(),de(p(QM),{key:1,class:"ch-list ch-tree"},{default:ue(()=>[U(VO,{name:"tree-collapse",tag:"ul",class:"tree-list ch-list-content"},{default:ue(()=>[(k(!0),L(De,null,Ct(_.value,({node:z,depth:$})=>(k(),L("li",{key:z.path,class:"tree-node"},[z.kind==="folder"?(k(),L("button",{key:0,type:"button",class:"tree-row tree-folder",style:sn(M($)),onClick:B=>x(z)},[U(p(Ce),{class:"tree-icon",name:"folder-solid",size:"sm"}),A("span",HXe,F(z.name),1)],12,jXe)):(k(),de(p(Nn),{key:1,text:z.path},{default:ue(()=>[A("button",{type:"button",class:"tree-row tree-file",style:sn(M($)),onClick:B=>v(z.path)},[A("span",{class:Re(["badge",r(z.status)])},F(a(z.status)),3),A("span",qXe,F(z.name),1)],12,WXe)]),_:2},1032,["text"]))]))),128))]),_:1})]),_:1})):c.value?(k(),L("div",UXe,[A("span",VXe,[U(p(Ce),{name:"check",size:"lg"})]),Oe(" "+F(p(n)("diff.clean")),1)])):(k(),L("div",KXe,F(p(n)("diff.empty")),1))],64))]))}}),GXe=St(ZXe,[["__scopeId","data-v-2c83d74b"]]);function QXe(){const e=ps(xn.openInDefaultTarget);return e!==null&&e!==""?e:null}QXe();const YXe={key:0,class:"qh-chip"},JXe={class:"qtitle"},XXe={class:"qbody"},eet={class:"qopts"},tet=["onClick"],net={class:"qopt-key"},iet={class:"qopt-text"},oet={class:"qopt-label"},set={key:0,class:"qopt-desc"},ret={class:"qopt-text qopt-text-other"},aet={class:"qopt-label"},uet={key:0,class:"qopt-desc"},cet=["placeholder"],det={class:"qfoot"},fet={class:"qbtns"},het={class:"qhint"},pet=rt({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:i}=Ut(),o=t,s=V(0),r=V(!1);function l(){r.value&&(r.value=!1)}const a=D(()=>n.question.questions[s.value]),u=D(()=>n.question.questions.length);function c(){s.value>0&&s.value--}function d(){s.value0:te.kind==="multiWithOther"?te.optionIds.length>0||te.otherText.trim().length>0:te.kind==="other"?te.text.trim().length>0:!0:!1}function h(){return f(a.value.id)}const m=V({});function g(Q){return Q.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${Q.label} ${Q.description??""}`.toLowerCase())}function v(){const Q={...m.value};let te=!1;for(const X of n.question.questions){if(Q[X.id])continue;const ve=X.options.filter(g);ve.length!==0&&(Q[X.id]=X.multiSelect?{kind:"multi",optionIds:ve.map(ce=>ce.id)}:{kind:"single",optionId:ve[0].id},te=!0)}te&&(m.value=Q)}We(()=>n.question.questionId,()=>{s.value=0,r.value=!1,m.value={},w.value={}}),We(()=>n.question,()=>{s.value>=n.question.questions.length&&(s.value=0),v()},{immediate:!0,deep:!0});function y(Q,te){const X=m.value[Q];if(X&&X.kind==="single"&&X.optionId===te){const ve={...m.value};delete ve[Q],m.value=ve}else m.value={...m.value,[Q]:{kind:"single",optionId:te}}}function b(Q,te){const X=m.value[Q],ve=X&&(X.kind==="multi"||X.kind==="multiWithOther")?X.kind==="multi"?[...X.optionIds]:[...X.optionIds]:[],ce=ve.indexOf(te);ce>=0?ve.splice(ce,1):ve.push(te);const se=m.value[Q],pe=se&&se.kind==="multiWithOther"?se.otherText:"";pe?m.value={...m.value,[Q]:{kind:"multiWithOther",optionIds:ve,otherText:pe}}:m.value={...m.value,[Q]:{kind:"multi",optionIds:ve}}}const w=V({}),C=V(null);function T(Q){const te=n.question.questions.find(ve=>ve.id===Q),X=w.value[Q]??"";if(te.multiSelect){const ve=m.value[Q],ce=ve&&(ve.kind==="multi"||ve.kind==="multiWithOther")?ve.kind==="multi"?[...ve.optionIds]:[...ve.optionIds]:[];m.value={...m.value,[Q]:{kind:"multiWithOther",optionIds:ce,otherText:X}}}else m.value={...m.value,[Q]:{kind:"other",text:X}}}function N(Q){T(Q),ft(()=>C.value?.focus())}function I(Q,te){const X=m.value[Q];return X?X.kind==="single"?X.optionId===te:X.kind==="multi"||X.kind==="multiWithOther"?X.optionIds.includes(te):!1:!1}function S(Q){const te=m.value[Q];return!!(te&&(te.kind==="other"||te.kind==="multiWithOther"))}function _(){return n.question.questions.every(Q=>f(Q.id))}const x=D(()=>n.busyKind==="answer"),E=D(()=>n.busyKind==="dismiss"),M=D(()=>!!n.busyKind);function R(){if(M.value||!_())return;const Q={answers:m.value,method:"click"};o("answer",n.question.questionId,Q)}function q(){M.value||o("dismiss",n.question.questionId)}const z=V(0);let $=!1;We([s,()=>n.question.questionId],()=>{z.value!==0&&($=!0),z.value=0});const B=V(null);function P(Q,te){const X=Q.getBoundingClientRect(),ve=te.getBoundingClientRect(),ce=ve.top-X.top+Q.scrollTop,se=ce+ve.height;ve.height>=Q.clientHeight||ceQ.scrollTop+Q.clientHeight&&(Q.scrollTop=se-Q.clientHeight)}function H(){const Q=B.value,te=Q?.querySelector(".qbody");if(!Q||!te)return;const X=te.querySelectorAll(".qopt")[z.value];X&&(P(te,X),P(Q,X))}We(z,()=>{if($){$=!1;return}ft(H)}),We(s,()=>{ft(()=>{const Q=B.value?.querySelector(".qbody");Q&&(Q.scrollTop=0),B.value&&(B.value.scrollTop=0)})});const{handleCompositionStart:j,handleCompositionEnd:G,isComposingKeyEvent:ne}=bl();function W(Q){const te=(document.activeElement?.tagName??"").toLowerCase(),X=te==="input"||te==="textarea";if(Q.metaKey||Q.ctrlKey||Q.altKey||M.value||ne(Q)||sr.value>0)return;if(Q.key==="Enter"){if(Q.preventDefault(),r.value)return;s.value0||Q.defaultPrevented)return;Q.preventDefault(),q();return}if(r.value)return;if(Q.key==="ArrowDown"||Q.key==="ArrowUp"){const ce=a.value,se=ce.options.length+(ce.allowOther?1:0);if(se===0)return;Q.preventDefault();const pe=Q.key==="ArrowDown"?1:-1,Z=Math.min(se-1,Math.max(0,z.value+pe));if(Z===z.value){ft(H);return}z.value=Z;const ae=ce.options[z.value];ae?ce.multiSelect||y(ce.id,ae.id):ce.allowOther&&!ce.multiSelect&&T(ce.id);return}if(Q.key===" "&&a.value.multiSelect){Q.preventDefault();const ce=a.value,se=ce.options[z.value];se?(b(ce.id,se.id),ft(H)):ce.allowOther&&(T(ce.id),ft(H));return}const ve=parseInt(Q.key,10);if(!isNaN(ve)&&ve>=1&&ve<=9){Q.preventDefault();const ce=a.value,se=ve-1,pe=ce.options[se];pe&&(z.value=se,ce.multiSelect?b(ce.id,pe.id):y(ce.id,pe.id),ft(H))}}return kn(()=>document.addEventListener("keydown",W)),Ln(()=>document.removeEventListener("keydown",W)),(Q,te)=>(k(),L("div",{ref_key:"cardEl",ref:B,class:Re(["qcard",{minimized:r.value}])},[A("div",{class:Re(["qh",{clickable:r.value}]),onClick:l},[u.value>1?(k(),L("span",YXe,F(s.value+1),1)):ee("",!0),A("span",JXe,F(a.value.question),1),U(p(an),{class:"qmin",size:"sm",label:r.value?p(i)("question.expand"):p(i)("question.minimize"),tooltip:r.value?p(i)("question.expand"):p(i)("question.minimize"),onClick:te[0]||(te[0]=Tt(X=>r.value=!r.value,["stop"]))},{default:ue(()=>[r.value?(k(),de(p(Ce),{key:0,name:"chevron-up",size:"md"})):(k(),de(p(Ce),{key:1,name:"minus",size:"md"}))]),_:1},8,["label","tooltip"]),U(p(an),{class:"qclose",size:"sm",label:p(i)("question.dismiss"),tooltip:p(i)("question.dismiss"),disabled:M.value,onClick:Tt(q,["stop"])},{default:ue(()=>[U(p(Ce),{name:"close",size:"md"})]),_:1},8,["label","tooltip","disabled"])],2),r.value?ee("",!0):(k(),L(De,{key:0},[A("div",XXe,[a.value.body?(k(),de(p(_c),{key:0,text:a.value.body,class:"qmdbody"},null,8,["text"])):ee("",!0),A("div",eet,[(k(!0),L(De,null,Ct(a.value.options,(X,ve)=>(k(),L("label",{key:X.id,class:Re(["qopt",{selected:I(a.value.id,X.id),highlighted:a.value.multiSelect&&ve===z.value}]),onClick:Tt(ce=>{z.value=ve,a.value.multiSelect?b(a.value.id,X.id):y(a.value.id,X.id)},["prevent"])},[A("span",net,F(ve+1),1),A("span",{class:Re(["qopt-glyph",a.value.multiSelect?"chk":"rad"])},null,2),A("span",iet,[A("span",oet,F(X.label),1),X.description?(k(),L("span",set,F(X.description),1)):ee("",!0)])],10,tet))),128)),a.value.allowOther?(k(),L("label",{key:0,class:Re(["qopt",{selected:S(a.value.id),highlighted:a.value.multiSelect&&z.value===a.value.options.length}]),onClick:te[6]||(te[6]=Tt(X=>{z.value=a.value.options.length,N(a.value.id)},["prevent"]))},[te[7]||(te[7]=A("span",{class:"qopt-key"},null,-1)),A("span",{class:Re(["qopt-glyph",a.value.multiSelect?"chk":"rad"])},null,2),A("span",ret,[A("span",aet,F(a.value.otherLabel??p(i)("question.otherDefault")),1),a.value.otherDescription?(k(),L("span",uet,F(a.value.otherDescription),1)):ee("",!0)]),ai(A("input",{ref_key:"otherInputEl",ref:C,"onUpdate:modelValue":te[1]||(te[1]=X=>w.value[a.value.id]=X),class:"other-input",type:"text",placeholder:a.value.otherLabel??p(i)("question.otherDefault"),onInput:te[2]||(te[2]=X=>T(a.value.id)),onFocus:te[3]||(te[3]=X=>T(a.value.id)),onCompositionstart:te[4]||(te[4]=(...X)=>p(j)&&p(j)(...X)),onCompositionend:te[5]||(te[5]=(...X)=>p(G)&&p(G)(...X))},null,40,cet),[[ar,w.value[a.value.id]]])],2)):ee("",!0)])]),A("div",det,[A("div",fet,[s.value[Oe(F(p(i)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(k(),de(p(rn),{key:1,class:"qmain",size:"md",variant:"primary",disabled:!_(),loading:x.value,onClick:R},{default:ue(()=>[Oe(F(p(i)("question.submit")),1)]),_:1},8,["disabled","loading"])),u.value>1?(k(),de(p(rn),{key:2,size:"md",variant:"ghost",disabled:s.value===0||M.value,onClick:c},{default:ue(()=>[Oe(F(p(i)("question.back")),1)]),_:1},8,["disabled"])):ee("",!0),U(p(rn),{size:"md",variant:"ghost",loading:E.value,disabled:M.value,onClick:q},{default:ue(()=>[Oe(F(p(i)("question.dismiss")),1)]),_:1},8,["loading","disabled"])]),A("span",het,F(p(i)("question.hint")),1)])],64))],2))}}),met=St(pet,[["__scopeId","data-v-645038cd"]]),get={class:"sc"},vet={key:0,class:"sc-empty"},yet={key:2,class:"sc-loading"},ket=["placeholder"],bet=["disabled"],T5=ao(new Set),wet=rt({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},agentId:{},title:{},subtitle:{},onSend:{type:Function}},emits:["close","openMedia"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=Ut(),r=D(()=>i.turns.find(E=>E.role==="user")?.text?.trim()??""),l=D(()=>i.title?.trim()||s("sideChat.title")),a=D(()=>i.subtitle?.trim()?i.subtitle.trim():r.value||s("sideChat.subtitle")),u=D({get:()=>p1.get(i.agentId)??"",set:x=>{x===""?p1.delete(i.agentId):p1.set(i.agentId,x)}}),c=V(null),d=V(null),f=V(null),h=V(0);let m=null;We(f,x=>{m?.disconnect(),m=null,x!==null&&typeof ResizeObserver<"u"&&(m=new ResizeObserver(()=>{h.value=x.offsetHeight}),m.observe(x)),h.value=x?.offsetHeight??0}),Ln(()=>m?.disconnect());const g=D(()=>T5.has(i.agentId));async function v(){const x=u.value,E=eSe(x.trim());if(!(!E||g.value)){T5.add(i.agentId);try{if(!await i.onSend(E)||u.value!==x)return;u.value="",ft(()=>{c.value&&(c.value.style.height="auto"),y()})}finally{T5.delete(i.agentId)}}}function y(){const x=d.value;x&&(x.scrollTop=x.scrollHeight)}ii(df,x=>{const E=d.value;if(!E)return;const M=x.getBoundingClientRect().top;requestAnimationFrame(()=>{E.scrollTop+=x.getBoundingClientRect().top-M})}),ii(Uo,void 0);const b=D(()=>{const x=i.turns;if(x.length===0)return"0";const E=x.at(-1),M=E.thinking?.length??0,R=E.tools?.reduce((q,z)=>q+z.name.length+(z.arg?.length??0)+(z.output?.join("").length??0),0)??0;return`${x.length}:${E.text.length}:${M}:${R}`});We(b,async()=>{!i.running&&!i.sending||(await ft(),y())});const w=D(()=>i.sending?i.turns.at(-1)?.role==="user":!1),{handleCompositionStart:C,handleCompositionEnd:T,isComposingKeyEvent:N}=bl();function I(x){x.key==="Enter"&&!x.shiftKey&&!N(x)&&(x.preventDefault(),v())}function S(){const x=c.value;x&&(x.style.height="auto",x.style.height=`${Math.min(x.scrollHeight,160)}px`)}function _(){c.value?.focus()}return t({focusInput:_}),(x,E)=>(k(),L("div",get,[U(p(_1),{title:l.value,subtitle:a.value,"close-label":p(s)("thinking.close"),onClose:E[0]||(E[0]=M=>o("close"))},null,8,["title","subtitle","close-label"]),A("div",{ref_key:"bodyRef",ref:d,class:"sc-body",style:sn(h.value>0?{paddingBottom:`${h.value}px`}:void 0)},[e.turns.length===0?(k(),L("div",vet,F(p(s)("sideChat.empty")),1)):(k(),de(vS,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running,"turn-files-interactive":!1,"selection-actions":!1,onOpenMedia:E[1]||(E[1]=M=>o("openMedia",M))},null,8,["turns","turn-active","working"])),w.value?(k(),L("div",yet,[U(gS,{label:p(s)("conversation.requesting")},null,8,["label"])])):ee("",!0)],4),A("div",{ref_key:"composerEl",ref:f,class:"sc-composer"},[ai(A("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":E[2]||(E[2]=M=>u.value=M),class:"sc-input",rows:"1",placeholder:p(s)("sideChat.placeholder"),onInput:S,onKeydown:I,onCompositionstart:E[3]||(E[3]=(...M)=>p(C)&&p(C)(...M)),onCompositionend:E[4]||(E[4]=(...M)=>p(T)&&p(T)(...M))},null,40,ket),[[ar,u.value]]),U(p(Nn),{text:p(s)("sideChat.send")},{default:ue(()=>[A("button",{type:"button",class:"sc-send",disabled:!u.value.trim()||g.value,onClick:v},[U(p(Ce),{name:"arrow-right",size:"sm"})],8,bet)]),_:1},8,["text"])],512)]))}}),Cet=St(wet,[["__scopeId","data-v-9932e21c"]]),Aet={class:"rows"},xet={class:"row"},_et={class:"row"},Met={key:0},Iet={key:1,class:"thinking-value"},Tet={class:"cache-note"},Eet={key:2},Let={class:"row"},Net={class:"row"},Det={class:"row"},Fet={class:"row"},Bet={class:"ctx-text"},Ret={key:0,class:"bar"},Oet={class:"row"},$et=rt({__name:"StatusPanel",props:{status:{},thinking:{},model:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close","setThinking"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t,s=D(()=>K1(i.model)),r=D(()=>Z1(i.model)),l=D(()=>r.value.includes(i.thinking)?i.thinking:""),a=D(()=>r.value.map(w=>({value:w,label:Bd(w)})));function u(w){o("setThinking",bk(i.model,w))}const c=V(!0),d=D(()=>i.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(i.status.ctxUsed/i.status.ctxMax*100)))),f=D(()=>i.status.ctxMax>0?n("status.statusContextValue",{used:xc(i.status.ctxUsed),max:xc(i.status.ctxMax),pct:d.value}):n("status.statusNone"));function h(w){return n(w==="yolo"?"status.permissionYolo":w==="auto"?"status.permissionAuto":"status.permissionManual")}const m=D(()=>{const w=i.status.permission;return w==="auto"?"var(--color-danger)":w==="yolo"?"var(--color-warning)":"var(--color-text)"}),g=D(()=>i.planMode?n("status.planOn"):n("status.planOff")),v=D(()=>i.swarmMode?n("status.swarmOn"):n("status.swarmOff")),y=D(()=>typeof i.costUsd=="number"&&i.costUsd>0),b=D(()=>y.value?`$${i.costUsd.toFixed(4)}`:n("status.statusNone"));return(w,C)=>(k(),de(p(ef),{open:c.value,"onUpdate:open":C[0]||(C[0]=T=>c.value=T),title:p(n)("status.statusPanelTitle"),onClose:C[1]||(C[1]=T=>o("close"))},{default:ue(()=>[A("dl",Aet,[A("div",xet,[A("dt",null,F(p(n)("status.statusModel")),1),A("dd",null,F(e.status.model),1)]),A("div",_et,[A("dt",null,F(p(n)("status.statusThinking")),1),s.value==="unsupported"?(k(),L("dd",Met,F(p(n)("status.modeNotSupported")),1)):r.value.length>1?(k(),L("dd",Iet,[U(p(Is),{"model-value":l.value,options:a.value,size:"xs","aria-label":p(n)("status.statusThinking"),"onUpdate:modelValue":u},null,8,["model-value","options","aria-label"]),A("span",Tet,F(p(n)("status.cacheNote")),1)])):(k(),L("dd",Eet,F(p(Bd)(r.value[0]??"on")),1))]),A("div",Let,[A("dt",null,F(p(n)("status.statusPermission")),1),A("dd",{style:sn({color:m.value})},F(h(e.status.permission)),5)]),A("div",Net,[A("dt",null,F(p(n)("status.statusPlanMode")),1),A("dd",{class:Re({"plan-on":e.planMode})},F(g.value),3)]),A("div",Det,[A("dt",null,F(p(n)("status.statusSwarmMode")),1),A("dd",{class:Re({"swarm-on":e.swarmMode})},F(v.value),3)]),A("div",Fet,[A("dt",null,F(p(n)("status.statusContext")),1),A("dd",null,[A("span",Bet,F(f.value),1),e.status.ctxMax>0?(k(),L("span",Ret,[A("i",{style:sn({width:d.value+"%"})},null,4)])):ee("",!0)])]),A("div",Oet,[A("dt",null,F(p(n)("status.statusCost")),1),A("dd",null,F(b.value),1)])])]),_:1},8,["open","title"]))}}),Pet=St($et,[["__scopeId","data-v-1e95fd47"]]),zet={class:"tp"},jet=rt({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=V(null);return We(()=>n.text,()=>{const r=s.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ft(()=>{s.value&&(s.value.scrollTop=s.value.scrollHeight)})},{immediate:!0}),(r,l)=>(k(),L("div",zet,[U(p(_1),{title:p(o)("common.preview"),subtitle:e.subtitle??p(o)("thinking.panelTitle"),"close-label":p(o)("thinking.close"),onClose:l[0]||(l[0]=a=>i("close"))},null,8,["title","subtitle","close-label"]),A("pre",{ref_key:"bodyEl",ref:s,class:"tp-body"},F(e.text),513)]))}}),Het=St(jet,[["__scopeId","data-v-5ecb9355"]]),Wet={class:"td"},qet={class:"td-path"},Uet={class:"td-body"},Vet={key:1,class:"td-empty"},Ket=rt({__name:"TurnDiffPanel",props:{change:{},cwd:{},closable:{type:Boolean}},emits:["close","openFile"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=D(()=>{const a=n.cwd?Ck(n.change.path,n.cwd):null;return r(a??n.change.path)});function r(a,u=48){return!a||a.length<=u?a:"…"+a.slice(a.length-u+1)}const l=D(()=>n.change.diff!==null&&n.change.diff.length>0);return(a,u)=>(k(),L("div",Wet,[U(p(_1),{title:p(o)("conversation.turnFiles.diffTitle"),closable:e.closable,"close-label":p(o)("filePreview.close"),onClose:u[1]||(u[1]=c=>i("close"))},{default:ue(()=>[U(p(Nn),{text:e.change.path},{default:ue(()=>[A("span",qet,F(s.value),1)]),_:1},8,["text"]),U(p(an),{size:"sm",label:p(o)("conversation.turnFiles.openFile"),tooltip:p(o)("conversation.turnFiles.openFile"),onClick:u[0]||(u[0]=c=>i("openFile",e.change.path))},{default:ue(()=>[U(p(Ce),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])]),_:1},8,["title","closable","close-label"]),A("div",Uet,[l.value?(k(),de(Wa,{key:0,lines:e.change.diff,path:e.change.path,framed:!1},null,8,["lines","path"])):(k(),L("div",Vet,[A("p",null,F(p(o)("conversation.turnFiles.diffUnavailable")),1),U(p(rn),{variant:"ghost",size:"sm",onClick:u[2]||(u[2]=c=>i("openFile",e.change.path))},{default:ue(()=>[Oe(F(p(o)("conversation.turnFiles.openFile")),1)]),_:1})]))])]))}}),Zet=St(Ket,[["__scopeId","data-v-6c964102"]]),Get={class:"fc-label"},Qet=rt({__name:"FilterControl",props:{modelValue:{},options:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,o=D(()=>n.options.find(x=>x.value===n.modelValue)),s=typeof window<"u"&&window.matchMedia?.("(hover: none)").matches?"lg":"md",r=V(null),l=V(!1);let a=0,u=null;async function c(){const x=r.value?.closest(".dock-work-head");if(!x)return;const E=x.querySelector(".wp-head-tab"),M=getComputedStyle(x),R=(parseFloat(M.columnGap)||0)*2,q=x.clientWidth-parseFloat(M.paddingLeft)-parseFloat(M.paddingRight)-R,z=E?.scrollWidth??0;if(!l.value){const B=r.value?.querySelector(".ui-seg");B!==null&&B.offsetWidth>0&&(a=B.offsetWidth)}const $=z+a>q;if(l.value=$,!$){await ft();const B=r.value?.querySelector(".ui-seg");B!==null&&B.offsetWidth>0&&(a=B.offsetWidth),l.value=z+a>q}}kn(()=>{const x=r.value?.closest(".dock-work-head");!x||typeof ResizeObserver!="function"||(u=new ResizeObserver(c),u.observe(x),c())}),We(l,x=>{!x&&d.value&&y()}),We(sr,x=>{x>0&&d.value&&y()}),We(()=>n.options,async()=>{a=0,await ft(),c()},{flush:"post"});const d=V(!1),f=V(null);function h(){return f.value?.$el??null}const m=V(null),g=V({left:"0px",top:"0px"});async function v(){if(d.value){y();return}d.value=!0,await ft(),b(),w(),window.addEventListener("mousedown",N,!0),window.addEventListener("keydown",I,!0),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0)}function y(x){d.value=!1,window.removeEventListener("mousedown",N,!0),window.removeEventListener("keydown",I,!0),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0),x?.refocus&&h()?.focus()}function b(){const x=h();if(!x)return;const E=x.getBoundingClientRect(),M=m.value?.offsetHeight??0,R=getComputedStyle(document.documentElement),q=Number.parseFloat(R.getPropertyValue("--space-2"))||0,z=Number.parseFloat(R.getPropertyValue("--space-1"))||0,$=m.value?.offsetWidth??0,B=Math.min(E.left,Math.max(q,window.innerWidth-$-q));E.bottom+z+M<=window.innerHeight-q?g.value={left:`${B}px`,top:`${E.bottom+z}px`}:g.value={left:`${B}px`,bottom:`${window.innerHeight-E.top+z}px`}}function w(){const x=m.value;if(!x)return;(x.querySelector(".ui-menu-item.is-active")??x.querySelector(".ui-menu-item"))?.focus()}function C(){d.value||v()}function T(x){const E=x.relatedTarget;E&&(m.value?.contains(E)||h()?.contains(E))||y()}function N(x){const E=x.target;if(E){if(m.value?.contains(E)){x.stopImmediatePropagation();return}h()?.contains(E)||y()}}function I(x){x.key==="Escape"&&(x.preventDefault(),x.stopImmediatePropagation(),y({refocus:!0}))}function S(x){if(x.key!=="ArrowDown"&&x.key!=="ArrowUp")return;x.preventDefault();const E=Array.from(m.value?.querySelectorAll(".ui-menu-item")??[]);if(E.length===0)return;const M=E.indexOf(document.activeElement),R=x.key==="ArrowDown"?(M+1)%E.length:(M-1+E.length)%E.length;E[R]?.focus()}function _(x){i("update:modelValue",x),y({refocus:!0})}return Xn(()=>{u?.disconnect(),d.value&&y()}),(x,E)=>(k(),L("span",{ref_key:"root",ref:r,class:"filter-control"},[l.value?(k(),L(De,{key:0},[U(p(B$),{ref_key:"triggerRef",ref:f,class:"fc-trigger","aria-haspopup":"menu","aria-expanded":d.value,onClick:v,onKeydown:[Yo(Tt(C,["prevent"]),["down"]),Yo(Tt(C,["prevent"]),["up"])],onFocusout:T},{default:ue(()=>[o.value?.icon?(k(),de(p(Ce),{key:0,name:o.value.icon,size:"sm"},null,8,["name"])):ee("",!0),A("span",null,F(o.value?.label),1),U(p(Ce),{class:"fc-chevron",name:"chevron-down",size:"sm"})]),_:1},8,["aria-expanded","onKeydown"]),(k(),de(us,{to:"body"},[d.value?(k(),L("div",{key:0,ref_key:"menuBoxRef",ref:m,class:"fc-menu",style:sn(g.value),onKeydown:S,onFocusout:T},[U(p(Hs),null,{default:ue(()=>[(k(!0),L(De,null,Ct(e.options,M=>(k(),de(p(tn),{key:M.value,role:"menuitemradio",active:M.value===e.modelValue,"aria-checked":M.value===e.modelValue,size:p(s),onClick:R=>_(M.value)},{default:ue(()=>[M.icon?(k(),de(p(Ce),{key:0,name:M.icon,size:"sm","data-icon":M.icon},null,8,["name","data-icon"])):ee("",!0),A("span",Get,F(M.label),1),M.value===e.modelValue?(k(),de(p(Ce),{key:1,class:"fc-check",name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["active","aria-checked","size","onClick"]))),128))]),_:1})],36)):ee("",!0)]))],64)):(k(),de(p(Is),{key:1,"model-value":e.modelValue,options:e.options,size:"md","onUpdate:modelValue":E[0]||(E[0]=M=>i("update:modelValue",M))},null,8,["model-value","options"]))],512))}}),KB=St(Qet,[["__scopeId","data-v-9d5b56c7"]]),Yet={class:"goal-panel"},Jet={key:0,class:"goal-criterion"},Xet={class:"goal-criterion-label"},ett=rt({__name:"GoalPanel",props:{goal:{}},setup(e){const{t}=Ut(),n=Yt(Uo);return(i,o)=>(k(),L("div",Yet,[U(p(_c),{text:e.goal.objective,"open-file":p(n)?.openFile},null,8,["text","open-file"]),e.goal.completionCriterion?(k(),L("div",Jet,[A("span",Xet,[U(p(Ce),{name:"check-list",size:"sm"}),Oe(" "+F(p(t)("status.goalDoneWhen")),1)]),U(p(_c),{text:e.goal.completionCriterion,"open-file":p(n)?.openFile},null,8,["text","open-file"])])):ee("",!0)]))}}),ttt=St(ett,[["__scopeId","data-v-6dea2f18"]]),ntt={class:"plan-panel"},itt={key:0,class:"plan-review-row"},ott={class:"plan-review-label"},stt={key:1,class:"plan-review-row"},rtt={class:"plan-review-label"},ltt={class:"plan-review-feedback"},att={key:3,class:"plan-path-only"},utt={class:"plan-path-hint"},ctt={key:1,class:"plan-empty"},dtt=rt({__name:"PlanPanel",props:{plan:{},planModeOn:{type:Boolean}},setup(e){const t=e,{t:n}=Ut(),i=Yt(Uo),o=D(()=>t.plan&&!t.plan.plan&&t.plan.path?t.plan.path:void 0);function s(){o.value&&i?.openFile({path:o.value})}return(r,l)=>(k(),L("div",ntt,[e.plan?(k(),L(De,{key:0},[e.plan.review?.selectedOption?(k(),L("div",itt,[A("span",ott,F(p(n)("tools.plan.selectedOption")),1),A("span",null,F(e.plan.review.selectedOption),1)])):ee("",!0),e.plan.review?.feedback?(k(),L("div",stt,[A("span",rtt,F(p(n)("tools.plan.feedback")),1),A("span",ltt,F(e.plan.review.feedback),1)])):ee("",!0),e.plan.plan?(k(),de(p(_c),{key:2,text:e.plan.plan,"open-file":p(i)?.openFile},null,8,["text","open-file"])):ee("",!0),o.value?(k(),L("div",att,[A("span",utt,F(p(n)("tools.plan.pathOnlyHint")),1),U(p(rn),{variant:"ghost",size:"sm",class:"plan-path",onClick:s},{default:ue(()=>[Oe(F(o.value),1)]),_:1})])):ee("",!0)],64)):(k(),L("div",ctt,[U(p(Ce),{name:"file-edit",size:"lg",class:"plan-empty-ico"}),A("span",null,F(e.planModeOn?p(n)("status.planEmptyArmed"):p(n)("status.planEmptyIdle")),1)]))]))}}),ftt=St(dtt,[["__scopeId","data-v-69db97fc"]]),htt={key:0,class:"sg-empty"},ptt={key:1,class:"sg-grid"},mtt=["aria-label","onClick"],gtt={class:"sg-top"},vtt={class:"sg-num"},ytt={class:"sg-name"},ktt={key:1,class:"sg-desc"},btt={class:"sg-foot"},wtt={key:0,class:"sg-model"},Ctt={class:"sg-status"},Att={class:"sg-state"},xtt={key:0,class:"sg-time"},Stt=rt({__name:"SubagentGrid",props:{tasks:{},filter:{}},emits:["cancel"],setup(e,{emit:t}){const n=e,i={active:"tasks.emptyRecent",running:"tasks.emptyRunning",done:"tasks.emptyDone",all:"tasks.emptyTasks"},o=D(()=>i[n.filter??"all"]),s=t,{t:r}=Ut(),l=Yt(Uo),a=Yt(im),u=Yt(om);function c(g){const v=[a?.(g.model),u?.(g.thinkingEffort)].filter(y=>y!==void 0);return v.length>0?v.join(" · "):void 0}function d(g){return r(g==="done"?"tasks.stateDone":g==="fail"?"tasks.stateFail":g==="cancelled"?"tasks.stateCancelled":"tasks.running")}function f(g){return typeof g.durationMs!="number"?"":Bu(g.durationMs,{h:r("status.timeUnitHour"),m:r("status.timeUnitMinute"),s:r("status.timeUnitSecond")})}function h(g,v){return String((g.swarmIndex??v)+1).padStart(2,"0")}function m(g){return!!g.agentId||!!(g.output&&g.output.length>0)}return(g,v)=>e.tasks.length===0?(k(),L("div",htt,F(p(r)(o.value)),1)):(k(),L("div",ptt,[(k(!0),L(De,null,Ct(e.tasks,(y,b)=>(k(),L("div",{key:y.id,class:Re(["sg-card",[`s-${y.state}`,{openable:m(y)}]])},[m(y)?(k(),L("button",{key:0,type:"button",class:"sg-open","aria-label":y.name,onClick:w=>p(l)?.openAgent(y.agentId??y.id)},null,8,mtt)):ee("",!0),A("div",gtt,[A("span",vtt,F(h(y,b)),1),A("span",ytt,F(y.name),1)]),y.meta?(k(),L("div",ktt,F(y.meta),1)):ee("",!0),A("div",btt,[c(y)?(k(),L("div",wtt,[U(p(Ce),{name:"robot",size:"sm"}),A("span",null,F(c(y)),1)])):ee("",!0),A("div",Ctt,[A("span",Att,[y.state==="run"?(k(),de(p(Ul),{key:0,status:"running"})):y.state==="done"?(k(),de(p(Ce),{key:1,class:"sg-ic-done",name:"circle-check",size:"sm"})):(k(),de(p(Ce),{key:2,name:"close",size:"sm"})),Oe(" "+F(d(y.state)),1)]),f(y)?(k(),L("span",xtt,[U(p(Ce),{name:"clock",size:"sm"}),Oe(F(f(y)),1)])):ee("",!0)])]),y.state==="run"?(k(),de(p(an),{key:2,class:"sg-cancel",size:"sm",label:p(r)("tasks.stop"),tooltip:p(r)("tasks.stop"),onClick:Tt(w=>s("cancel",y.id),["stop"])},{default:ue(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip","onClick"])):ee("",!0)],2))),128))]))}}),_tt=St(Stt,[["__scopeId","data-v-13735c1e"]]),Mtt={class:"taskspane"},Itt={class:"tp-list"},Ttt={key:0,class:"tp-empty"},Ett={class:"tp-main"},Ltt=["aria-label","onClick"],Ntt=["aria-label"],Dtt={class:"tp-name"},Ftt={key:1,class:"tp-meta"},Btt={key:2,class:"tp-model"},Rtt={key:3,class:"tp-model"},Ott={key:4,class:"tp-time"},$tt=rt({__name:"TasksPane",props:{tasks:{},filter:{}},emits:["cancel"],setup(e,{emit:t}){const n=e,i={active:"tasks.emptyRecent",running:"tasks.emptyRunning",done:"tasks.emptyDone",all:"tasks.emptyTasks"},o=D(()=>i[n.filter??"all"]),s=t,{t:r}=Ut(),l=Yt(Uo);function a(y){return!!(y.output&&y.output.length>0||y.meta)}function u(y){c(y)&&l?.openAgent(y.agentId??y.id)}function c(y){return y.kind==="subagent"||a(y)}function d(y){return typeof y.durationMs!="number"?"":Bu(y.durationMs,{h:r("status.timeUnitHour"),m:r("status.timeUnitMinute"),s:r("status.timeUnitSecond")})}function f(y){return y.state==="done"?r("tasks.stateDone"):y.state==="fail"?r("tasks.stateFail"):y.state==="cancelled"?r("tasks.stateCancelled"):r("tasks.running")}const h=Yt(im),m=Yt(om);function g(y){if(y.kind==="subagent")return h?.(y.model)}function v(y){if(y.kind==="subagent")return m?.(y.thinkingEffort)}return(y,b)=>(k(),L("div",Mtt,[A("div",Itt,[e.tasks.length===0?(k(),L("div",Ttt,F(p(r)(o.value)),1)):(k(!0),L(De,{key:1},Ct(e.tasks,w=>(k(),L("div",{key:w.id,class:Re(["tp-row",{fail:w.state==="fail",expandable:c(w)}])},[A("div",Ett,[c(w)?(k(),L("button",{key:0,type:"button",class:"tp-open","aria-label":w.name,onClick:C=>u(w)},null,8,Ltt)):ee("",!0),A("span",{class:"tp-glyph",role:"img","aria-label":f(w)},[w.state==="run"?(k(),de(p(Ul),{key:0,status:"running"})):w.state==="done"?(k(),de(p(Ce),{key:1,class:"tp-done",name:"circle-check",size:"sm"})):w.state==="cancelled"?(k(),de(p(Ce),{key:2,class:"tp-cancelled",name:"close",size:"sm"})):(k(),de(p(Ce),{key:3,class:"tp-fail",name:"close",size:"sm"}))],8,Ntt),A("span",Dtt,F(w.name),1),w.meta?(k(),L("span",Ftt,F(w.meta),1)):ee("",!0),g(w)?(k(),L("span",Btt,F(g(w)),1)):ee("",!0),v(w)?(k(),L("span",Rtt,F(v(w)),1)):ee("",!0),d(w)?(k(),L("span",Ott,F(d(w)),1)):ee("",!0),w.state==="run"?(k(),de(p(an),{key:5,class:"tp-stop",size:"sm",label:p(r)("tasks.stop"),tooltip:p(r)("tasks.stop"),onClick:Tt(C=>s("cancel",w.id),["stop"])},{default:ue(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip","onClick"])):ee("",!0),c(w)?(k(),de(p(Ce),{key:6,class:"tp-chevron",name:"chevron-right",size:"sm"})):ee("",!0)])],2))),128))])]))}}),Ptt=St($tt,[["__scopeId","data-v-25d6e0cb"]]),ztt={class:"todo-card"},jtt={key:0,class:"tc-empty"},Htt={class:"tc-name"},Wtt=rt({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Ut();return(i,o)=>(k(),L("div",ztt,[t.todos.length===0?(k(),L("div",jtt,[U(p(Ce),{name:"check-list",size:"lg",class:"tc-empty-ico"}),A("span",null,F(p(n)("tasks.emptyTodo")),1)])):ee("",!0),(k(!0),L(De,null,Ct(t.todos,(s,r)=>(k(),L("div",{key:r,class:Re(["tc-row",`s-${s.status}`])},[A("span",{class:Re(["tc-glyph",`g-${s.status}`]),"aria-hidden":"true"},[s.status==="in_progress"?(k(),de(p(uo),{key:0,size:"xs",class:"tc-spin"})):s.status==="done"?(k(),de(p(Ce),{key:1,name:"circle-check",size:"md"})):ee("",!0)],2),A("span",Htt,F(s.title),1)],2))),128))]))}}),qtt=St(Wtt,[["__scopeId","data-v-1b02ea7b"]]),Utt={class:"wp-head-tab"},Vtt={key:0,class:"wp-head-meta"},Ktt={key:0,class:"wp-head-actions"},Ztt=rt({__name:"WorkPanelHead",props:{icon:{},title:{},meta:{}},setup(e){return(t,n)=>(k(),L(De,null,[A("span",Utt,[U(p(Ce),{name:e.icon,size:"md"},null,8,["name"]),A("span",null,F(e.title),1),e.meta?(k(),L("span",Vtt,F(e.meta),1)):ee("",!0)]),t.$slots.actions?(k(),L("span",Ktt,[Wn(t.$slots,"actions",{},void 0,!0)])):ee("",!0)],64))}}),Gm=St(Ztt,[["__scopeId","data-v-c935b92a"]]),Qm=rt({__name:"WorkPill",props:{icon:{},active:{type:Boolean},label:{}},emits:["click"],setup(e,{emit:t}){const n=t;return(i,o)=>(k(),de(p(B$),{active:e.active,"aria-pressed":e.active,"aria-label":e.label,onClick:o[0]||(o[0]=s=>n("click",s))},{default:ue(()=>[U(p(Ce),{name:e.icon,size:"md"},null,8,["name"]),A("span",null,[Wn(i.$slots,"default")]),Wn(i.$slots,"meta")]),_:3},8,["active","aria-pressed","aria-label"]))}}),Gtt={class:"aw"},Qtt={class:"crumbbar"},Ytt={class:"crumbs"},Jtt={key:0,class:"crumb-sep"},Xtt=["onClick"],ent={key:0,class:"filterbar"},tnt=["placeholder"],nnt={class:"folder-list"},int={key:0,class:"fl-loading"},ont=["onClick"],snt={class:"folder-name search-rel"},rnt={key:0,class:"fl-empty"},lnt={key:1,class:"fl-loading"},ant=["onClick"],unt={class:"folder-name"},cnt={key:0,class:"fl-empty"},dnt={class:"paste-row"},fnt={class:"paste-input-wrap"},hnt={key:1,class:"add-error",role:"alert"},pnt={class:"actions"},mnt={class:"footer-hint"},gnt=600,vnt=6,ZB=150,ynt=rt({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t,s=V(!0),r=V(!1),l=V(!1),a=V(""),u=V(null),c=V([]),d=V(""),f=V(!1),h=V([]),m=D(()=>d.value.trim().length>0);let g=0,v=null;function y(P,H){const j=P.toLowerCase(),G=H.toLowerCase();let ne=0;for(let W=0;W0&&Q=ZB))break;te.depth+1{if(v&&clearTimeout(v),P.trim()===""){g++,h.value=[],f.value=!1;return}v=setTimeout(()=>void b(P),220)});const w=V(!1),C=V(""),T=D(()=>C.value.trim()),N=D(()=>{const P=a.value;if(!P)return[];const H=P.split("/").filter(Boolean),j=[{label:"/",path:"/"}];let G="";for(const ne of H)G+=`/${ne}`,j.push({label:ne,path:G});return j}),I=D(()=>a.value.length>0);async function S(P){r.value=!0;try{const H=await i.browseFs(P);if(!H.path){l.value=!0;return}a.value=H.path,u.value=H.parent,c.value=H.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function _(P){P.isDir&&S(P.path)}function x(){u.value&&S(u.value)}function E(){I.value&&o("add",a.value)}function M(){T.value.length!==0&&o("add",T.value)}const{handleCompositionStart:R,handleCompositionEnd:q,isComposingKeyEvent:z}=bl();function $(P){z(P)||M()}function B(P){P.key==="Escape"&&z(P)&&P.stopPropagation()}return kn(async()=>{r.value=!0;try{if(i.defaultPath&&(await S(i.defaultPath),!l.value))return;const P=await i.getFsHome();P.home?await S(P.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),Ln(()=>{v&&clearTimeout(v)}),(P,H)=>(k(),de(p(ef),{open:s.value,"onUpdate:open":H[5]||(H[5]=j=>s.value=j),title:p(n)("workspace.addTitle"),size:"lg",height:"fixed",padded:!1,onClose:H[6]||(H[6]=j=>o("close"))},{default:ue(()=>[A("div",Gtt,[l.value?ee("",!0):(k(),L(De,{key:0},[A("div",Qtt,[U(p(an),{size:"sm",disabled:!u.value,label:p(n)("workspace.up"),tooltip:p(n)("workspace.up"),onClick:x},{default:ue(()=>[U(p(Ce),{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label","tooltip"]),A("div",Ytt,[(k(!0),L(De,null,Ct(N.value,(j,G)=>(k(),L(De,{key:j.path},[G>1?(k(),L("span",Jtt,"/")):ee("",!0),A("button",{class:Re(["crumb",{last:G===N.value.length-1}]),onClick:ne=>S(j.path)},F(j.label),11,Xtt)],64))),128))])]),r.value?ee("",!0):(k(),L("div",ent,[U(p(Ce),{class:"filter-icon",name:"search",size:"md"}),ai(A("input",{"onUpdate:modelValue":H[0]||(H[0]=j=>d.value=j),class:"filter-input",type:"text",placeholder:p(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:H[1]||(H[1]=Tt(()=>{},["stop"]))},null,40,tnt),[[ar,d.value]]),f.value?(k(),de(p(uo),{key:0,size:"sm"})):ee("",!0)])),A("div",nnt,[r.value?(k(),L("div",int,F(p(n)("workspace.browsing")),1)):m.value?(k(),L(De,{key:1},[(k(!0),L(De,null,Ct(h.value,j=>(k(),L("button",{key:j.path,class:"folder-row",onClick:G=>S(j.path)},[U(p(Ce),{class:"dir-icon",name:"folder-closed",size:"sm"}),A("span",snt,F(j.rel),1)],8,ont))),128)),!f.value&&h.value.length===0?(k(),L("div",rnt,F(p(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(k(),L("div",lnt,F(p(n)("workspace.searching")),1)):ee("",!0)],64)):(k(),L(De,{key:2},[(k(!0),L(De,null,Ct(c.value,j=>(k(),L("button",{key:j.path,class:"folder-row",onClick:G=>_(j)},[U(p(Ce),{class:"dir-icon",name:"folder-closed",size:"sm"}),A("span",unt,F(j.name),1)],8,ant))),128)),c.value.length===0?(k(),L("div",cnt,F(p(n)("workspace.noSubfolders")),1)):ee("",!0)],64))])],64)),A("div",{class:Re(["paste-section",{"paste-only":l.value}])},[!l.value&&!w.value?(k(),de(p(rn),{key:0,variant:"ghost",size:"sm",onClick:H[2]||(H[2]=j=>w.value=!0)},{default:ue(()=>[Oe(F(p(n)("workspace.pasteToggle")),1)]),_:1})):(k(),de(p(uie),{key:1,label:p(n)("workspace.pathLabel")},{default:ue(()=>[A("div",dnt,[A("div",fnt,[U(p(Ms),{modelValue:C.value,"onUpdate:modelValue":H[3]||(H[3]=j=>C.value=j),placeholder:p(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:[Yo(Tt($,["stop"]),["enter"]),B],onCompositionstart:p(R),onCompositionend:p(q)},null,8,["modelValue","placeholder","onKeydown","onCompositionstart","onCompositionend"])]),U(p(an),{disabled:T.value.length===0,label:p(n)("workspace.add"),tooltip:p(n)("workspace.add"),onClick:M},{default:ue(()=>[U(p(Ce),{name:"plus",size:"md"})]),_:1},8,["disabled","label","tooltip"])])]),_:1},8,["label"]))],2),e.error?(k(),L("div",hnt,F(e.error),1)):ee("",!0),A("div",pnt,[U(p(Nn),{text:a.value},{default:ue(()=>[l.value?ee("",!0):(k(),de(p(rn),{key:0,variant:"primary",disabled:!I.value,onClick:E},{default:ue(()=>[Oe(F(p(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),U(p(rn),{variant:"secondary",onClick:H[4]||(H[4]=j=>o("close"))},{default:ue(()=>[Oe(F(p(n)("workspace.cancel")),1)]),_:1})]),A("div",mnt,F(p(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),knt=St(ynt,[["__scopeId","data-v-e24668bd"]]),bnt={key:0,class:"sheet-root"},wnt=["aria-label"],Cnt=["aria-label"],Ant={key:0,class:"sheet-head"},xnt={class:"sheet-title"},Snt={class:"sheet-body"},_nt=rt({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""},closeOnEsc:{type:Boolean,default:!0}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t;function s(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i.closeOnEsc&&s()}return We(()=>i.modelValue,l=>{l?Ip.value+=1:Ip.value=Math.max(0,Ip.value-1),!(typeof document>"u")&&(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Ln(()=>{i.modelValue&&(Ip.value=Math.max(0,Ip.value-1)),typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(k(),de(mo,{name:"sheet"},{default:ue(()=>[e.modelValue?(k(),L("div",bnt,[A("div",{class:"sheet-scrim",onClick:s}),A("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||p(n)("mobile.sheetLabel")},[A("button",{type:"button",class:"sheet-grab","aria-label":p(n)("mobile.closeSheet"),onClick:s},null,8,Cnt),e.title?(k(),L("div",Ant,[A("span",xnt,F(e.title),1)])):ee("",!0),A("div",Snt,[Wn(l.$slots,"default",{},void 0,!0)])],8,wnt)])):ee("",!0)]),_:3}))}}),y1=St(_nt,[["__scopeId","data-v-91fc927c"]]),Mnt={key:0,class:"confirm-dialog__message"},Int=rt({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut();function s(){n.loading||(i("update:open",!1),i("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),Xn(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(k(),de(p(ef),{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=u=>i("update:open",u)),onClose:s},{foot:ue(()=>[U(p(rn),{variant:"secondary",disabled:e.loading,onClick:s},{default:ue(()=>[Oe(F(e.cancelLabel??p(o)("common.cancel")),1)]),_:1},8,["disabled"]),U(p(rn),{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=u=>i("confirm"))},{default:ue(()=>[Oe(F(e.confirmLabel??p(o)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:ue(()=>[e.message?(k(),L("p",Mnt,F(e.message),1)):ee("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),Tnt=St(Int,[["__scopeId","data-v-32237722"]]),Ent=rt({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:i,runAction:o}=cf();function s(){o()}return(r,l)=>p(t)!==null?(k(),de(Tnt,{key:0,open:!0,title:p(t).title,message:p(t).message,"confirm-label":p(t).confirmLabel,"cancel-label":p(t).cancelLabel,variant:p(t).variant,loading:p(n),onConfirm:s,onCancel:l[0]||(l[0]=a=>p(i)(!1))},null,8,["title","message","confirm-label","cancel-label","variant","loading"])):ee("",!0)}}),Lnt={class:"sd-body"},Nnt={class:"sd-search"},Dnt=["aria-label"],Fnt={key:0,class:"sd-section","aria-hidden":"true"},Bnt={class:"sd-section-count"},Rnt=["aria-selected","onClick","onMousemove"],Ont=["innerHTML"],$nt=["innerHTML"],Pnt=["aria-selected","onClick","onMousemove"],znt={class:"sd-line1"},jnt=["innerHTML"],Hnt={class:"sd-time"},Wnt={class:"sd-line2"},qnt=["innerHTML"],Unt=["innerHTML"],Vnt={key:1,class:"sd-empty"},Knt={class:"sd-foot","aria-hidden":"true"},Znt={class:"sd-hint"},Gnt={class:"sd-hint"},Qnt={class:"sd-hint"},Ynt=200,Jnt=3,Xnt=rt({__name:"SearchSessionsDialog",props:{sessions:{},workspaces:{},activeId:{}},emits:["select","selectWorkspace","close"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t,s=V(!0),r=V(""),l=V(null),a=V(null),u=D(()=>{const I=r.value.trim().toLowerCase(),S=[];if(I.length===0)for(const x of i.workspaces.slice(0,Jnt))S.push({kind:"workspace",key:`ws:${x.id}`,hit:{workspace:x,inName:!1,inPath:!1}});else for(const x of i.workspaces){const E=x.name.toLowerCase().includes(I),M=x.shortPath.toLowerCase().includes(I);!E&&!M||S.push({kind:"workspace",key:`ws:${x.id}`,hit:{workspace:x,inName:E,inPath:M}})}const _=[];for(const x of i.sessions){const E=x.title??"",M=x.lastPrompt??"",R=x.workspaceName??"",q=I.length>0&&E.toLowerCase().includes(I),z=I.length>0&&M.toLowerCase().includes(I),$=I.length>0&&R.toLowerCase().includes(I);if(!(I.length>0&&!q&&!z&&!$)&&(_.push({kind:"session",key:`s:${x.id}`,hit:{session:x,inTitle:q,inWorkspace:$,snippetText:M?hse(M,r.value):""}}),_.length>=Ynt))break}return S.length>0&&_.length>0&&(S[0].section={label:n("sidebar.workspaces"),count:S.length},_[0].section={label:n("sidebar.sessionsHeader"),count:_.length}),[...S,..._]}),c=V(0);We(r,()=>{c.value=0});function d(I){const S=u.value.length;return S===0?0:Math.max(0,Math.min(S-1,I))}async function f(){await ft(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(I){c.value=d(c.value+I),f()}function m(I){o("select",I),o("close")}function g(I){o("selectWorkspace",I),o("close")}function v(){r.value="",l.value?.focus()}function y(){const I=u.value[c.value];I&&(I.kind==="workspace"?g(I.hit.workspace.id):m(I.hit.session.id))}function b(){return l.value?.el??null}const{handleCompositionStart:w,handleCompositionEnd:C,isComposingKeyEvent:T}=bl();function N(I){if(T(I)){I.key==="Escape"&&I.stopPropagation();return}I.key==="ArrowDown"?(I.preventDefault(),h(1)):I.key==="ArrowUp"?(I.preventDefault(),h(-1)):I.key==="Enter"&&(I.preventDefault(),y())}return kn(()=>{l.value?.focus()}),(I,S)=>(k(),de(p(ef),{open:s.value,"onUpdate:open":S[1]||(S[1]=_=>s.value=_),title:p(n)("sidebar.searchPlaceholder"),size:"lg",height:"fixed",padded:!1,"initial-focus":b,onClose:S[2]||(S[2]=_=>o("close"))},{default:ue(()=>[A("div",Lnt,[A("div",Nnt,[U(p(Ms),{ref_key:"inputRef",ref:l,modelValue:r.value,"onUpdate:modelValue":S[0]||(S[0]=_=>r.value=_),placeholder:p(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:N,onCompositionstart:p(w),onCompositionend:p(C)},null,8,["modelValue","placeholder","onCompositionstart","onCompositionend"]),U(p(Nn),{text:p(n)("sidebar.searchClear")},{default:ue(()=>[A("button",{type:"button",class:Re(["search-clear",{"is-on":r.value.length>0}]),tabindex:"-1","aria-label":p(n)("sidebar.searchClear"),onClick:v},[U(p(Ce),{name:"close",size:"sm"})],10,Dnt)]),_:1},8,["text"])]),A("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[u.value.length>0?(k(!0),L(De,{key:0},Ct(u.value,(_,x)=>(k(),L(De,{key:_.key},[_.section?(k(),L("div",Fnt,[A("span",null,F(_.section.label),1),A("span",Bnt,F(_.section.count),1)])):ee("",!0),_.kind==="workspace"?(k(),L("button",{key:1,class:Re(["sd-row sd-row-ws",{on:x===c.value}]),role:"option","aria-selected":x===c.value,onClick:E=>g(_.hit.workspace.id),onMousemove:E=>c.value=x},[U(p(Ce),{class:"sd-folder",name:"folder-closed",size:"sm"}),A("span",{class:"sd-ws-name",innerHTML:p(Bm)(_.hit.workspace.name,_.hit.inName?r.value:"")},null,8,Ont),A("span",{class:"sd-ws-path",innerHTML:p(Bm)(_.hit.workspace.shortPath,_.hit.inPath?r.value:"")},null,8,$nt)],42,Rnt)):(k(),L("button",{key:2,class:Re(["sd-row",{on:x===c.value,active:_.hit.session.id===e.activeId}]),role:"option","aria-selected":x===c.value,onClick:E=>m(_.hit.session.id),onMousemove:E=>c.value=x},[A("span",znt,[A("span",{class:"sd-title",innerHTML:p(Bm)(_.hit.session.title,_.hit.inTitle?r.value:"")},null,8,jnt),A("span",Hnt,F(_.hit.session.time),1)]),A("span",Wnt,[A("span",{class:"sd-meta-ws",innerHTML:p(Bm)(_.hit.session.workspaceName??_.hit.session.workspaceId??"",_.hit.inWorkspace?r.value:"")},null,8,qnt),_.hit.snippetText?(k(),L(De,{key:0},[S[3]||(S[3]=A("span",{class:"sd-meta-sep","aria-hidden":"true"},"·",-1)),A("span",{class:"sd-meta-snippet",innerHTML:p(Bm)(_.hit.snippetText,r.value)},null,8,Unt)],64)):ee("",!0)])],42,Pnt))],64))),128)):(k(),L("div",Vnt,[U(p(oie),{title:r.value.trim()?p(n)("sidebar.searchNoResults"):p(n)("sidebar.searchEmpty")},{icon:ue(()=>[U(p(Ce),{name:"search",size:"lg"})]),_:1},8,["title"])]))],512),A("div",Knt,[A("span",Znt,[U(p(gc),{keys:["↑","↓"]}),Oe(F(p(n)("sidebar.searchHintSelect")),1)]),S[4]||(S[4]=A("span",{class:"sd-dot"},"·",-1)),A("span",Gnt,[U(p(gc),{keys:["Enter"]}),Oe(F(p(n)("sidebar.searchHintOpen")),1)]),S[5]||(S[5]=A("span",{class:"sd-dot"},"·",-1)),A("span",Qnt,[U(p(gc),{keys:["Esc"]}),Oe(F(p(n)("sidebar.searchHintClose")),1)])])])]),_:1},8,["open","title"]))}}),eit=St(Xnt,[["__scopeId","data-v-35cdd013"]]),tit={class:"topbar"},nit=["aria-label"],iit={key:0,class:"st","aria-hidden":"true"},oit={key:4,class:"unread-dot"},sit={class:"tb-line"},rit={class:"tt"},lit=rt({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},status:{default:"idle"}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t,s=D(()=>i.workspace?.name??n("workspace.noWorkspace"));return(r,l)=>(k(),L("div",tit,[A("button",{type:"button",class:"tb-main","aria-label":p(n)("mobile.openSwitcher"),onClick:l[0]||(l[0]=a=>o("openSwitcher"))},[e.status!=="idle"?(k(),L("span",iit,[e.status==="awaiting-approval"?(k(),de(p(cl),{key:0,variant:"warning",size:"sm"},{default:ue(()=>[Oe(F(p(n)("workspace.awaitingPermission")),1)]),_:1})):e.status==="awaiting-question"?(k(),de(p(cl),{key:1,variant:"info",size:"sm"},{default:ue(()=>[Oe(F(p(n)("workspace.awaitingAnswer")),1)]),_:1})):e.status==="running"?(k(),de(p(uo),{key:2,size:"sm"})):e.status==="aborted"?(k(),de(p(cl),{key:3,variant:"danger",size:"sm"},{default:ue(()=>[Oe(F(p(n)("workspace.aborted")),1)]),_:1})):e.status==="unread"?(k(),L("span",oit)):ee("",!0)])):ee("",!0),A("span",sit,[A("span",{class:Re(["dir",{solo:!e.sessionTitle}])},F(s.value),3),e.sessionTitle?(k(),L(De,{key:0},[l[2]||(l[2]=A("span",{class:"sl"},"/",-1)),A("span",rit,F(e.sessionTitle),1)],64)):ee("",!0),U(p(Ce),{class:"cv",name:"chevron-down",size:"sm"})])],8,nit),U(p(an),{size:"lg",label:p(n)("mobile.openSettings"),onClick:l[1]||(l[1]=a=>o("openSettings"))},{default:ue(()=>[U(p(Ce),{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),ait=St(lit,[["__scopeId","data-v-78cbb21c"]]),uit={class:"msg"},cit={class:"pf-field"},dit={class:"pf-field-label"},fit={class:"pf-field"},hit={class:"pf-field-label"},pit={class:"pf-field"},mit={class:"pf-field-label"},git={class:"pf-key-wrap"},vit={class:"pf-field"},yit={class:"pf-field-label"},kit={class:"pf-field"},bit={class:"pf-field-label"},wit={class:"pf-models"},Cit={key:0,class:"pf-models-empty"},Ait={class:"pf-model-grid pf-model-head"},xit={key:1},Sit={key:0},_it={class:"pf-foot"},Mit={key:0,class:"pf-managed-note"},Iit={class:"pf-confirm-msg"},Tit=rt({__name:"ProviderForm",props:{mode:{},provider:{},guard:{type:Boolean}},emits:["dirtyChange","guardStay","guardDiscard","added","saved","deleting","deleted","cancel"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=Xa(),r=ao({id:"",type:"openai",apiKey:"",baseUrl:"",models:[w2()]}),l=new WeakMap;let a=0;function u($){let B=l.get($);return B===void 0&&(B=++a,l.set($,B)),B}const c=V(""),d=V(!1),f=V(!1),h=V(!1),m=D(()=>n.mode==="add"),g=D(()=>n.provider!==void 0&&iP(n.provider)),v=D(()=>{const $=n.provider;return $===void 0?0:Tw($,s.config.value?.models).length}),y=D(()=>g.value&&v.value===0),b=D(()=>wse.map($=>({value:$,label:o(`providers.types.${$}`)}))),w=D(()=>g.value?o("providers.apiKeyManaged"):!m.value&&n.provider?.hasApiKey===!0?o("providers.apiKeySet"):"sk-…");function C(){c.value="",f.value=!1;const $=n.provider;if(m.value||$===void 0){r.id="",r.type="openai",r.apiKey="",r.baseUrl="",r.models=[w2()];return}r.id=$.id,r.type=$.type,r.apiKey="",r.baseUrl=$.baseUrl??"";const B=Tw($,s.config.value?.models);r.models=B.length>0?B:[w2()]}kn(()=>{C(),I()});const T=V(!1),N=V(!1);async function I(){const $=n.provider;if(!(m.value||$===void 0||g.value||$.hasApiKey!==!0))try{const B=await s.getProvider($.id);if(N.value)return;B.apiKey!==void 0&&B.apiKey!==""&&(r.apiKey=B.apiKey,T.value=!0)}catch{}}function S(){i("dirtyChange",!0)}const _=V(!1),x=V();function E($){c.value=$,ft(()=>x.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}async function M(){if(d.value)return;const $=Cse(r,{requireApiKey:m.value,requireBaseUrl:m.value});if($!==null){E(o(`providers.error.${$}`));return}c.value="",d.value=!0;try{if(m.value){const B=await s.addProvider(Ase(r));if(B!==null){E(B);return}i("dirtyChange",!1),s.notify({severity:"success",title:o("providers.added")}),i("added",r.id.trim())}else{const B=n.provider;if(B===void 0)return;const P=s.config.value?.providers?.[B.id]?.defaultModel,H=await s.updateProvider(B.id,xse(r,B,{includeBlankApiKey:T.value,existingDefaultModel:P}));if(H!==null){E(H);return}await s.checkAuth(),s.notify({severity:"success",title:o("providers.saved")}),i("dirtyChange",!1),i("saved",r.id.trim())}}finally{d.value=!1}}async function R(){const $=n.provider;if(!($===void 0||h.value)){h.value=!0,i("deleting"),await new Promise(B=>setTimeout(B,300));try{if(await s.deleteProvider($.id)===null){f.value=!1;return}i("dirtyChange",!1),i("deleted",$.id)}finally{h.value=!1}}}function q(){r.models.push(w2()),S()}function z($){if(r.models.length<=1)return;const B=r.models.indexOf($);B>=0&&r.models.splice(B,1),S()}return($,B)=>(k(),L("div",{class:"pf-form",onInput:S},[e.guard?(k(),de(p(Uf),{key:0,variant:"warning",class:"pf-guard"},{default:ue(()=>[A("span",uit,F(p(o)("providers.unsavedGuard")),1),U(p(rn),{variant:"secondary",size:"sm",onClick:B[0]||(B[0]=P=>i("guardStay"))},{default:ue(()=>[Oe(F(p(o)("providers.guardStay")),1)]),_:1}),U(p(rn),{variant:"danger",size:"sm",onClick:B[1]||(B[1]=P=>i("guardDiscard"))},{default:ue(()=>[Oe(F(p(o)("providers.guardDiscard")),1)]),_:1})]),_:1})):ee("",!0),c.value?(k(),L("div",{key:1,ref_key:"errorBox",ref:x},[U(p(Uf),{variant:"danger"},{default:ue(()=>[Oe(F(c.value),1)]),_:1})],512)):ee("",!0),A("div",cit,[A("label",dit,[Oe(F(p(o)("providers.fieldId")),1),B[11]||(B[11]=A("span",{class:"req"}," *",-1))]),U(p(Ms),{modelValue:r.id,"onUpdate:modelValue":B[2]||(B[2]=P=>r.id=P),placeholder:"my-openai",disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","disabled"])]),A("div",fit,[A("label",hit,[Oe(F(p(o)("providers.fieldType")),1),B[12]||(B[12]=A("span",{class:"req"}," *",-1))]),U(p(ww),{"model-value":r.type,options:b.value,disabled:g.value,"onUpdate:modelValue":B[3]||(B[3]=P=>{r.type=P,S()})},null,8,["model-value","options","disabled"])]),A("div",pit,[A("label",mit,[Oe(F(p(o)("providers.fieldApiKey")),1),B[13]||(B[13]=A("span",{class:"req"}," *",-1))]),A("div",git,[U(p(Ms),{modelValue:r.apiKey,"onUpdate:modelValue":B[4]||(B[4]=P=>r.apiKey=P),type:_.value?"text":"password",placeholder:w.value,disabled:g.value,autocomplete:"off",spellcheck:"false",onInput:B[5]||(B[5]=P=>N.value=!0)},null,8,["modelValue","type","placeholder","disabled"]),g.value?ee("",!0):(k(),de(p(an),{key:0,class:"pf-key-eye",size:"sm",label:p(o)(_.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(o)(_.value?"providers.hideApiKey":"providers.showApiKey"),onClick:B[6]||(B[6]=P=>_.value=!_.value)},{default:ue(()=>[U(p(Ce),{name:_.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"]))])]),A("div",vit,[A("label",yit,[Oe(F(p(o)("providers.fieldBaseUrl")),1),B[14]||(B[14]=A("span",{class:"req"}," *",-1))]),U(p(Ms),{modelValue:r.baseUrl,"onUpdate:modelValue":B[7]||(B[7]=P=>r.baseUrl=P),placeholder:p(o)("providers.baseUrlPlaceholder"),disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder","disabled"])]),A("div",kit,[A("label",bit,[Oe(F(p(o)("providers.fieldModels")),1),B[15]||(B[15]=A("span",{class:"req"}," *",-1))]),A("div",wit,[y.value?(k(),L("div",Cit,F(p(o)("providers.noModels")),1)):(k(),L(De,{key:1},[A("div",Ait,[A("span",null,[Oe(F(p(o)("providers.colModelId")),1),B[16]||(B[16]=A("span",{class:"req"}," *",-1))]),A("span",null,[Oe(F(p(o)("providers.colContext")),1),B[17]||(B[17]=A("span",{class:"req"}," *",-1))]),A("span",null,F(p(o)("providers.colDisplayName")),1),B[18]||(B[18]=A("span",null,null,-1))]),(k(!0),L(De,null,Ct(r.models,P=>(k(),L("div",{key:u(P),class:"pf-model-grid"},[U(p(Ms),{modelValue:P.model,"onUpdate:modelValue":H=>P.model=H,placeholder:p(o)("providers.modelIdPlaceholder"),disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),U(p(Ms),{modelValue:P.maxContextSize,"onUpdate:modelValue":H=>P.maxContextSize=H,inputmode:"numeric",placeholder:p(o)("providers.modelContextPlaceholder"),disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),U(p(Ms),{modelValue:P.displayName,"onUpdate:modelValue":H=>P.displayName=H,placeholder:p(o)("providers.modelNamePlaceholder"),disabled:g.value,autocomplete:"off",spellcheck:"false"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]),g.value?(k(),L("span",xit)):(k(),de(p(an),{key:0,size:"sm",label:p(o)("providers.removeModel"),tooltip:p(o)("providers.removeModel"),disabled:r.models.length<=1,onClick:H=>z(P)},{default:ue(()=>[U(p(Ce),{name:"trash",size:"sm"})]),_:1},8,["label","tooltip","disabled","onClick"]))]))),128)),g.value?ee("",!0):(k(),L("div",Sit,[U(p(rn),{variant:"ghost",size:"sm",onClick:q},{default:ue(()=>[U(p(Ce),{name:"plus",size:"sm"}),Oe(" "+F(p(o)("providers.addModel")),1)]),_:1})]))],64))])]),A("div",_it,[g.value?(k(),L("span",Mit,F(p(o)("providers.managedHint")),1)):m.value?(k(),L(De,{key:1},[U(p(rn),{variant:"secondary",size:"sm",onClick:B[8]||(B[8]=P=>i("cancel"))},{default:ue(()=>[Oe(F(p(o)("common.cancel")),1)]),_:1}),U(p(rn),{variant:"primary",size:"sm",disabled:d.value,onClick:M},{default:ue(()=>[Oe(F(p(o)("providers.addProvider")),1)]),_:1},8,["disabled"])],64)):f.value&&n.provider!==void 0?(k(),L(De,{key:2},[A("span",Iit,F(p(o)("providers.deleteConfirm",{id:n.provider.id,count:v.value})),1),B[19]||(B[19]=A("span",{class:"spacer"},null,-1)),U(p(rn),{variant:"secondary",size:"sm",disabled:h.value,onClick:B[9]||(B[9]=P=>f.value=!1)},{default:ue(()=>[Oe(F(p(o)("common.cancel")),1)]),_:1},8,["disabled"]),U(p(rn),{variant:"danger",size:"sm",disabled:h.value,onClick:R},{default:ue(()=>[Oe(F(p(o)("providers.deleteConfirmYes")),1)]),_:1},8,["disabled"])],64)):(k(),L(De,{key:3},[U(p(rn),{variant:"danger-soft",size:"sm",onClick:B[10]||(B[10]=P=>f.value=!0)},{default:ue(()=>[Oe(F(p(o)("providers.deleteProvider")),1)]),_:1}),B[20]||(B[20]=A("span",{class:"spacer"},null,-1)),U(p(rn),{variant:"primary",size:"sm",disabled:d.value,onClick:M},{default:ue(()=>[Oe(F(p(o)("providers.save")),1)]),_:1},8,["disabled"])],64))])],32))}}),xZ=St(Tit,[["__scopeId","data-v-5ad95550"]]),Eit={class:"af"},Lit={class:"msg"},Nit={key:2,class:"af-catalog"},Dit={key:0,class:"af-center"},Fit={key:1,class:"af-error"},Bit={class:"af-list"},Rit=["disabled","onClick"],Oit={class:"af-entry-name"},$it={key:1,class:"af-entry-reason"},Pit={key:2,class:"af-entry-count"},zit={key:0,class:"af-empty"},jit={class:"af-field"},Hit={class:"af-label"},Wit={class:"af-field"},qit={class:"af-label"},Uit={class:"af-key-wrap"},Vit={key:0,class:"af-field"},Kit={class:"af-label"},Zit={class:"af-note"},Git={class:"af-foot"},Qit={class:"af-hint"},Yit={class:"af-field"},Jit={class:"af-label"},Xit={class:"af-field"},eot={class:"af-label"},tot={class:"af-key-wrap"},not={class:"af-foot"},iot={class:"af-manual"},oot=rt({__name:"AddProviderFlow",props:{guard:{type:Boolean}},emits:["dirtyChange","guardStay","guardDiscard","added","cancel"],setup(e,{emit:t}){const n=t,{t:i,te:o}=Ut(),s=Xa(),r=V("catalog"),l=D(()=>[{value:"catalog",label:i("providers.catalog.sourceCatalog")},{value:"registry",label:i("providers.catalog.sourceRegistry")},{value:"manual",label:i("providers.catalog.sourceManual")}]),a=V("loading"),u=V([]);async function c(){a.value="loading";const P=await s.loadCatalogProviders();P.kind==="ok"?(u.value=P.items,a.value="ready"):P.kind==="unsupported"?(a.value="unsupported",r.value==="catalog"&&(r.value="manual")):a.value="error"}kn(c);const d=V(""),f=D(()=>{const P=d.value.trim().toLowerCase();return P===""?u.value:u.value.filter(H=>H.name.toLowerCase().includes(P)||H.id.toLowerCase().includes(P))});function h(P){const H=P.rejectReason;return H!==null&&o(`providers.catalog.rejectReason.${H}`)?i(`providers.catalog.rejectReason.${H}`):i("providers.catalog.rejected")}const m=V(null),g=V({id:"",apiKey:"",baseUrl:""}),v=V(!1),y=V(!1),b=V("");function w(P){m.value=P,g.value={id:P.id,apiKey:"",baseUrl:""},b.value="",v.value=!1}function C(){m.value=null,b.value="",n("dirtyChange",!1)}function T(){n("dirtyChange",!0)}const N=D(()=>{if(m.value===null)return!1;const H=g.value.id.trim();return H!==""&&s.providers.value.some(j=>j.id===H)}),I=V();function S(P){b.value=P,ft(()=>I.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}function _(){const P=g.value,H=P.id.trim();return H===""?i("providers.error.idRequired"):tP.test(H)?P.apiKey.trim()===""?i("providers.error.apiKeyRequired"):m.value?.needsBaseUrl===!0&&P.baseUrl.trim()===""?i("providers.error.baseUrlRequired"):null:i("providers.error.idInvalid")}async function x(){const P=m.value;if(P===null||y.value)return;const H=_();if(H!==null){S(H);return}b.value="",y.value=!0;try{const j=g.value,G=j.id.trim(),ne=j.baseUrl.trim(),W=await s.importCatalogProvider({catalogId:P.id,apiKey:j.apiKey.trim(),...ne===""?{}:{baseUrl:ne},...G===P.id?{}:{id:G}});if(W!==null){S(W);return}s.notify({severity:"success",title:i("providers.added")}),n("dirtyChange",!1),n("added",G)}finally{y.value=!1}}const E=V({url:"",apiKey:""}),M=V(!1),R=V(!1),q=V(""),z=V();function $(P){q.value=P,ft(()=>z.value?.scrollIntoView({block:"nearest",behavior:"smooth"}))}async function B(){if(R.value)return;const P=E.value.url.trim();if(P===""){$(i("providers.error.registryUrlRequired"));return}q.value="",R.value=!0;try{const H=E.value.apiKey.trim(),j=await s.importCustomRegistry({url:P,...H===""?{}:{apiKey:H}});if(typeof j=="string"){$(j);return}s.notify({severity:"success",title:i("providers.catalog.registryImported",{count:j.providers.length})}),n("dirtyChange",!1);const G=j.providers[0];G!==void 0?n("added",G.id):n("cancel")}finally{R.value=!1}}return(P,H)=>(k(),L("div",Eit,[e.guard?(k(),de(p(Uf),{key:0,variant:"warning",class:"af-guard"},{default:ue(()=>[A("span",Lit,F(p(i)("providers.unsavedGuard")),1),U(p(rn),{variant:"secondary",size:"sm",onClick:H[0]||(H[0]=j=>n("guardStay"))},{default:ue(()=>[Oe(F(p(i)("providers.guardStay")),1)]),_:1}),U(p(rn),{variant:"danger",size:"sm",onClick:H[1]||(H[1]=j=>n("guardDiscard"))},{default:ue(()=>[Oe(F(p(i)("providers.guardDiscard")),1)]),_:1})]),_:1})):ee("",!0),a.value!=="unsupported"?(k(),de(p(Is),{key:1,modelValue:r.value,"onUpdate:modelValue":H[2]||(H[2]=j=>r.value=j),size:"sm",options:l.value},null,8,["modelValue","options"])):ee("",!0),a.value!=="unsupported"?ai((k(),L("div",Nit,[a.value==="loading"?(k(),L("div",Dit,[U(p(uo),{size:"sm"}),A("span",null,F(p(i)("providers.catalog.loading")),1)])):a.value==="error"?(k(),L("div",Fit,[U(p(Uf),{variant:"danger"},{default:ue(()=>[Oe(F(p(i)("providers.catalog.loadError")),1)]),_:1}),A("div",null,[U(p(rn),{variant:"secondary",size:"sm",onClick:c},{default:ue(()=>[Oe(F(p(i)("providers.catalog.retry")),1)]),_:1})])])):m.value===null?(k(),L(De,{key:2},[U(p(Ms),{modelValue:d.value,"onUpdate:modelValue":H[3]||(H[3]=j=>d.value=j),placeholder:p(i)("providers.catalog.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"]),A("div",Bit,[(k(!0),L(De,null,Ct(f.value,j=>(k(),L("button",{key:j.id,type:"button",class:"af-entry",disabled:j.rejected,onClick:G=>w(j)},[A("span",Oit,F(j.name),1),j.wireType!==null?(k(),de(p(cl),{key:0,variant:"neutral",size:"sm"},{default:ue(()=>[Oe(F(j.wireType),1)]),_:2},1024)):ee("",!0),H[16]||(H[16]=A("span",{class:"grow"},null,-1)),j.rejected?(k(),L("span",$it,F(h(j)),1)):(k(),L("span",Pit,F(p(i)("providers.modelCount",{count:j.models.length})),1))],8,Rit))),128)),f.value.length===0?(k(),L("div",zit,F(p(i)("providers.catalog.empty")),1)):ee("",!0)])],64)):(k(),L("div",{key:3,class:"af-import",onInput:T},[A("button",{type:"button",class:"af-back",onClick:C},[U(p(Ce),{name:"arrow-left",size:"sm"}),Oe(" "+F(p(i)("providers.catalog.backToList")),1)]),A("div",jit,[A("label",Hit,[Oe(F(p(i)("providers.fieldId")),1),H[17]||(H[17]=A("span",{class:"req"}," *",-1))]),U(p(Ms),{modelValue:g.value.id,"onUpdate:modelValue":H[4]||(H[4]=j=>g.value.id=j),autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),A("div",Wit,[A("label",qit,[Oe(F(p(i)("providers.fieldApiKey")),1),H[18]||(H[18]=A("span",{class:"req"}," *",-1))]),A("div",Uit,[U(p(Ms),{modelValue:g.value.apiKey,"onUpdate:modelValue":H[5]||(H[5]=j=>g.value.apiKey=j),type:v.value?"text":"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type"]),U(p(an),{class:"af-key-eye",size:"sm",label:p(i)(v.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(i)(v.value?"providers.hideApiKey":"providers.showApiKey"),onClick:H[6]||(H[6]=j=>v.value=!v.value)},{default:ue(()=>[U(p(Ce),{name:v.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])])]),m.value.needsBaseUrl?(k(),L("div",Vit,[A("label",Kit,[Oe(F(p(i)("providers.fieldBaseUrl")),1),H[19]||(H[19]=A("span",{class:"req"}," *",-1))]),U(p(Ms),{modelValue:g.value.baseUrl,"onUpdate:modelValue":H[7]||(H[7]=j=>g.value.baseUrl=j),placeholder:p(i)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])])):ee("",!0),N.value?(k(),de(p(Uf),{key:1,variant:"warning"},{default:ue(()=>[Oe(F(p(i)("providers.catalog.overwriteWarning")),1)]),_:1})):ee("",!0),A("div",Zit,F(p(i)("providers.catalog.willImport",{count:m.value.models.length})),1),b.value?(k(),L("div",{key:2,ref_key:"importErrorBox",ref:I},[U(p(Uf),{variant:"danger"},{default:ue(()=>[Oe(F(b.value),1)]),_:1})],512)):ee("",!0),A("div",Git,[U(p(rn),{variant:"secondary",size:"sm",onClick:H[8]||(H[8]=j=>n("cancel"))},{default:ue(()=>[Oe(F(p(i)("common.cancel")),1)]),_:1}),U(p(rn),{variant:"primary",size:"sm",disabled:y.value,onClick:x},{default:ue(()=>[Oe(F(p(i)("providers.catalog.importAction")),1)]),_:1},8,["disabled"])])],32))],512)),[[Qo,r.value==="catalog"]]):ee("",!0),ai(A("div",{class:"af-registry",onInput:T},[A("div",Qit,F(p(i)("providers.catalog.registryHint")),1),A("div",Yit,[A("label",Jit,[Oe(F(p(i)("providers.catalog.registryUrlLabel")),1),H[20]||(H[20]=A("span",{class:"req"}," *",-1))]),U(p(Ms),{modelValue:E.value.url,"onUpdate:modelValue":H[9]||(H[9]=j=>E.value.url=j),placeholder:"https://example.com/api.json",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),A("div",Xit,[A("label",eot,F(p(i)("providers.fieldApiKey")),1),A("div",tot,[U(p(Ms),{modelValue:E.value.apiKey,"onUpdate:modelValue":H[10]||(H[10]=j=>E.value.apiKey=j),type:M.value?"text":"password",placeholder:p(i)("providers.modelNamePlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type","placeholder"]),U(p(an),{class:"af-key-eye",size:"sm",label:p(i)(M.value?"providers.hideApiKey":"providers.showApiKey"),tooltip:p(i)(M.value?"providers.hideApiKey":"providers.showApiKey"),onClick:H[11]||(H[11]=j=>M.value=!M.value)},{default:ue(()=>[U(p(Ce),{name:M.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])])]),q.value?(k(),L("div",{key:0,ref_key:"registryErrorBox",ref:z},[U(p(Uf),{variant:"danger"},{default:ue(()=>[Oe(F(q.value),1)]),_:1})],512)):ee("",!0),A("div",not,[U(p(rn),{variant:"secondary",size:"sm",onClick:H[12]||(H[12]=j=>n("cancel"))},{default:ue(()=>[Oe(F(p(i)("common.cancel")),1)]),_:1}),U(p(rn),{variant:"primary",size:"sm",disabled:R.value,onClick:B},{default:ue(()=>[Oe(F(p(i)("providers.catalog.importAction")),1)]),_:1},8,["disabled"])])],544),[[Qo,r.value==="registry"]]),ai(A("div",iot,[U(xZ,{mode:"add",guard:!1,onDirtyChange:H[13]||(H[13]=j=>n("dirtyChange",j)),onAdded:H[14]||(H[14]=j=>n("added",j)),onCancel:H[15]||(H[15]=j=>n("cancel"))})],512),[[Qo,r.value==="manual"]])]))}}),sot=St(oot,[["__scopeId","data-v-96ec6ac0"]]),rot={class:"search-wrap"},lot=["aria-label"],aot=["aria-label"],uot=["aria-pressed","onClick"],cot={key:1,class:"state-row"},dot={key:2,class:"state-row unavail"},fot=["aria-label"],hot=["aria-selected","onClick","onMouseenter"],pot={class:"model-main"},mot={class:"model-name"},got={class:"model-meta"},vot={class:"model-side"},yot={key:0,class:"empty"},kot={class:"footer-hint","aria-hidden":"true"},bot=rt({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t,s=D(()=>new Set(i.starredIds??[]));function r(z){return s.value.has(z)}const l=V(""),a=V(null),u=V(null),c=V(null),d=V("all"),f={image_in:"model.capabilityImageInput",video_in:"model.capabilityVideoInput",tool_use:"model.capabilityToolUse",thinking:"model.capabilityThinking",always_thinking:"model.capabilityAlwaysThinking"};function h(z){const $=f[z];return $?n($):z.replaceAll("_"," ")}function m(z){const $=[z.provider,n("model.contextSuffix",{size:xc(z.maxContextSize)})];for(const B of z.capabilities??[])$.push(h(B));return $.join(" · ")}const g=typeof window<"u"&&window.matchMedia("(hover: none)").matches;BZ(u,g?void 0:a);const v=Lc(),y=D(()=>v.value?y1:ef),b=D(()=>v.value?{modelValue:!0,title:n("model.title"),closeOnEsc:!1}:{open:!0,closeOnEsc:!1,title:n("model.title"),size:"lg",height:"fixed",padded:!1,focusOnOpen:!g}),w=D(()=>{const z=new Set,$=[{id:"all",label:n("model.allTab")}];for(const B of i.models)z.has(B.provider)||(z.add(B.provider),$.push({id:B.provider,label:B.provider}));return $}),C=D(()=>{const z=l.value.toLowerCase().trim(),$=i.models.filter(B=>{if(d.value!=="all"&&B.provider!==d.value)return!1;const P=(B.displayName??B.model).toLowerCase().includes(z),H=B.provider.toLowerCase().includes(z),j=B.id.toLowerCase().includes(z);return!z||P||H||j});return d.value!=="all"?$:$.sort((B,P)=>{const H=r(B.id)?1:0;return(r(P.id)?1:0)-H})}),T=D(()=>C.value),N=V(0);We([l,d],()=>{N.value=0}),We(w,z=>{z.some($=>$.id===d.value)||(d.value="all")}),We(T,z=>{N.value=Math.min(N.value,Math.max(z.length-1,0))}),We(N,async()=>{await ft(),c.value?.querySelector(".model-row.is-selected")?.scrollIntoView({block:"nearest"})});const{handleCompositionStart:I,handleCompositionEnd:S,isComposingKeyEvent:_}=bl();function x(z){if(!_(z)){if(z.key==="Escape"){o("close");return}if(z.key==="ArrowDown")z.preventDefault(),N.value=Math.min(N.value+1,T.value.length-1);else if(z.key==="ArrowUp")z.preventDefault(),N.value=Math.max(N.value-1,0);else if(z.key==="Enter"){const $=T.value[N.value];$&&o("select",$.id)}}}kn(()=>{document.addEventListener("keydown",x)}),Ln(()=>{document.removeEventListener("keydown",x)});function E(z){o("select",z)}function M(){l.value="",a.value?.focus()}function R(z){return T.value.indexOf(z)}function q(z){d.value=z}return(z,$)=>(k(),de(zo(y.value),di(b.value,{onClose:$[1]||($[1]=B=>o("close"))}),{default:ue(()=>[A("div",{ref_key:"dialogRef",ref:u,class:Re(["mp",{"mp--sheet":p(v)}])},[A("div",rot,[U(p(Ms),{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":$[0]||($[0]=B=>l.value=B),placeholder:p(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:!p(g),onCompositionstart:p(I),onCompositionend:p(S)},null,8,["modelValue","placeholder","autofocus","onCompositionstart","onCompositionend"]),U(p(Nn),{text:p(n)("model.clearSearch")},{default:ue(()=>[A("button",{type:"button",class:Re(["search-clear",{"is-on":l.value.length>0}]),tabindex:"-1","aria-label":p(n)("model.clearSearch"),onClick:M},[U(p(Ce),{name:"close",size:"sm"})],10,lot)]),_:1},8,["text"])]),w.value.length>1?(k(),L("div",{key:0,class:"chip-strip","aria-label":p(n)("model.providerTabs")},[(k(!0),L(De,null,Ct(w.value,B=>(k(),L("button",{key:B.id,type:"button",class:Re(["chip",{"is-active":B.id===d.value}]),"aria-pressed":B.id===d.value,onClick:P=>q(B.id)},F(B.label),11,uot))),128))],8,aot)):ee("",!0),e.loading?(k(),L("div",cot,[U(p(uo),{size:"sm"}),A("span",null,F(p(n)("model.loading")),1)])):e.unavailable?(k(),L("div",dot,[U(p(Ce),{name:"alert-triangle",size:"lg"}),A("span",null,F(p(n)("model.unavailable")),1)])):(k(),L("div",{key:3,ref_key:"listRef",ref:c,class:"model-list",role:"listbox","aria-label":p(n)("model.title")},[(k(!0),L(De,null,Ct(T.value,B=>(k(),L("div",{key:B.id,class:Re(["model-row",{"is-current":B.id===e.current,"is-selected":R(B)===N.value}]),role:"option","aria-selected":B.id===e.current,onClick:P=>E(B.id),onMouseenter:P=>N.value=R(B)},[A("span",pot,[A("span",mot,F(B.displayName??B.model),1),A("span",got,F(m(B)),1)]),A("span",vot,[B.id===e.current?(k(),de(p(Ce),{key:0,class:"model-check",name:"check",size:"sm"})):ee("",!0),U(p(an),{class:Re(["model-star",{"is-starred":r(B.id)}]),size:"sm",label:r(B.id)?p(n)("model.unstarTitle"):p(n)("model.starTitle"),tooltip:r(B.id)?p(n)("model.unstarTitle"):p(n)("model.starTitle"),onClick:Tt(P=>o("toggle-star",B.id),["stop"])},{default:ue(()=>[r(B.id)?(k(),de(p(Ce),{key:0,name:"star",size:"md"})):(k(),de(p(Ce),{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["class","label","tooltip","onClick"])])],42,hot))),128)),T.value.length===0?(k(),L("div",yot,F(i.models.length===0?p(n)("model.emptyNoModels"):p(n)("model.emptyNoMatch")),1)):ee("",!0)],8,fot)),A("div",kot,[U(p(gc),{keys:["↑","↓"]}),A("span",null,F(p(n)("model.hintNavigate")),1),$[2]||($[2]=A("span",{class:"hint-dot"},"·",-1)),U(p(gc),{keys:["Enter"]}),A("span",null,F(p(n)("model.hintSelect")),1),$[3]||($[3]=A("span",{class:"hint-dot"},"·",-1)),U(p(gc),{keys:["Esc"]}),A("span",null,F(p(n)("model.hintClose")),1)])],2)]),_:1},16))}}),wot=St(bot,[["__scopeId","data-v-49f293b0"]]),Cot={class:"sec"},Aot={class:"sec-title"},xot={class:"pu-group"},Sot={class:"pu-row"},_ot={class:"pu-main"},Mot={class:"pu-label"},Iot={class:"pu-hint"},Tot=rt({__name:"PlanUpgradeCard",setup(e){const{t}=Ut();return(n,i)=>(k(),L("section",Cot,[A("h3",Aot,F(p(t)("settings.planUsage.title")),1),A("div",xot,[A("div",Sot,[A("span",_ot,[A("span",Mot,F(p(t)("settings.planUsage.freeTitle")),1),A("span",Iot,F(p(t)("settings.planUsage.freeHint")),1)]),U(p(rn),{variant:"primary",size:"sm",onClick:i[0]||(i[0]=o=>p(pv)())},{default:ue(()=>[Oe(F(p(t)("sidebar.upgrade")),1)]),_:1})])])]))}}),SZ=St(Tot,[["__scopeId","data-v-3cd02b1c"]]),Eot={class:"pp"},Lot={class:"pp-head"},Not={class:"pp-title"},Dot={key:0,class:"pp-loading"},Fot={key:1,class:"pp-group"},Bot={class:"pp-add-label"},Rot={class:"pp-chev"},Oot={class:"pp-acc"},$ot={class:"pp-acc-in"},Pot={key:1,class:"pp-empty"},zot=["onClick"],jot={class:"grow"},Hot={class:"pp-id"},Wot={class:"pp-count"},qot={class:"pp-chev"},Uot={class:"pp-acc"},Vot={class:"pp-acc-in"},Rf="$add",Kot=rt({__name:"ProvidersPanel",setup(e){const{t}=Ut(),n=Xa(),i=V(!0),o=V(null),s=V(null);let r=0;const l=V(!1),a=V(!1),u=V(null),c=V("");let d=0;const f=D(()=>[...n.providers.value].sort((N,I)=>N.id.localeCompare(I.id)));function h(N){return Tw(N,n.config.value?.models).length}We(o,(N,I)=>{I!==null&&I!==N&&(s.value=I,window.clearTimeout(r),r=window.setTimeout(()=>{s.value=null},300)),l.value=!1}),We(l,N=>{N||(a.value=!1,u.value=null)}),Ln(()=>{window.clearTimeout(r),window.clearTimeout(d)});const m=V(!1);We(o,N=>{N===Rf?(m.value=!1,ft(()=>requestAnimationFrame(()=>{m.value=!0}))):m.value=!1}),kn(async()=>{i.value=!0;try{await Promise.all([n.loadProviders(),n.loadModels(),n.loadConfig()])}finally{i.value=!1}});function g(N){const I=o.value===N?null:N;if(l.value){u.value=I,a.value=!0;return}o.value=I}function v(){a.value=!1,u.value=null}function y(){a.value=!1,o.value=u.value,u.value=null}function b(N){c.value=N,window.clearTimeout(d),d=window.setTimeout(()=>{c.value=""},1200)}function w(N){o.value=N}function C(N){o.value=N,b(N)}function T(){o.value=null}return(N,I)=>(k(),L("section",Eot,[A("div",Lot,[A("h3",Not,F(p(t)("settings.tabs.providers")),1),U(p(rn),{variant:"secondary",size:"sm",onClick:I[0]||(I[0]=S=>g(Rf))},{default:ue(()=>[U(p(Ce),{name:"plus",size:"sm"}),Oe(" "+F(p(t)("providers.addProvider")),1)]),_:1})]),i.value?(k(),L("div",Dot,[U(p(uo),{size:"sm"}),A("span",null,F(p(t)("providers.loading")),1)])):(k(),L("div",Fot,[o.value===Rf||s.value===Rf?(k(),L("div",{key:0,class:Re(["pp-item pp-add-item",{open:o.value===Rf&&m.value}])},[A("button",{type:"button",class:"pp-row pp-add-row",onClick:I[1]||(I[1]=S=>g(Rf))},[A("span",Bot,F(p(t)("providers.addProvider")),1),I[6]||(I[6]=A("span",{class:"grow"},null,-1)),A("span",Rot,[U(p(Ce),{name:"chevron-right",size:"sm"})])]),A("div",Oot,[A("div",$ot,[U(sot,{guard:a.value&&o.value===Rf,onDirtyChange:I[2]||(I[2]=S=>l.value=S),onGuardStay:v,onGuardDiscard:y,onAdded:C,onCancel:I[3]||(I[3]=S=>o.value=null)},null,8,["guard"])])])],2)):ee("",!0),f.value.length===0?(k(),L("div",Pot,F(p(t)("providers.empty")),1)):ee("",!0),(k(!0),L(De,null,Ct(f.value,S=>(k(),L("div",{key:S.id,class:Re(["pp-item",{open:o.value===S.id,flash:c.value===S.id}])},[A("button",{type:"button",class:"pp-row",onClick:_=>g(S.id)},[A("div",jot,[A("span",Hot,F(S.id),1),U(p(cl),{variant:"neutral",size:"sm"},{default:ue(()=>[Oe(F(S.type),1)]),_:2},1024),p(iP)(S)?(k(),de(p(cl),{key:0,variant:"info",size:"sm"},{default:ue(()=>[Oe(F(p(t)("providers.managedBadge")),1)]),_:1})):ee("",!0)]),A("span",Wot,F(p(t)("providers.modelCount",{count:h(S)})),1),A("span",qot,[U(p(Ce),{name:"chevron-right",size:"sm"})])],8,zot),A("div",Uot,[A("div",Vot,[o.value===S.id||s.value===S.id?(k(),de(xZ,{key:0,mode:"edit",provider:S,guard:a.value&&o.value===S.id,onDirtyChange:I[4]||(I[4]=_=>l.value=_),onGuardStay:v,onGuardDiscard:y,onSaved:w,onDeleting:I[5]||(I[5]=_=>o.value=null),onDeleted:T},null,8,["provider","guard"])):ee("",!0)])])],2))),128))]))]))}}),Zot=St(Kot,[["__scopeId","data-v-f7054f75"]]),Got=["aria-expanded","aria-label"],Qot={class:"sm-picker__value-text"},Yot=["aria-label"],Jot=["aria-label"],Xot={class:"sm-picker__group"},est=["aria-selected","onMouseenter","onClick"],tst={class:"sm-picker__option-label"},nst=["aria-label"],ist={class:"sm-picker__group"},ost=["aria-selected","onMouseenter","onClick"],sst={class:"sm-picker__option-label"},rst=188,lst=250,E5=8,ast=rt({__name:"SecondaryModelPicker",props:{modelValue:{},effort:{},groups:{},modelInfoById:{}},emits:["select"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=V(null),r=V(null),l=V(null),a=V(null),u=new Map,c=V(!1);ld(c,l);const d=V(!1),f=V({}),h=`sm-picker-${Math.random().toString(36).slice(2,9)}`,m=V(""),g=V(null),v=V("right"),y=V(0),b=V("models"),w=V(0),C=V(0);let T=null;const N=D(()=>n.groups.flatMap(Z=>Z.options)),I=D(()=>n.modelValue?N.value.find(Z=>Z.id===n.modelValue)?.label??n.modelValue:""),S=D(()=>n.modelValue?n.effort?`${I.value} · ${n.effort}`:I.value:o("settings.noSecondaryModel")),_=D(()=>{const Z=g.value;if(Z===null)return[];const ae=Z1(n.modelInfoById[Z]),K=n.effort===""?[null,...ae]:[...ae];return n.modelValue===Z&&n.effort!==""&&!ae.includes(n.effort)&&K.push(n.effort),K});function x(Z){return n.modelValue!==g.value?!1:Z===null?n.effort==="":n.effort===Z}function E(){const Z=_.value.findIndex(ae=>x(ae));return Z>=0?Z:0}function M(Z,ae){Z instanceof HTMLElement?u.set(ae,Z):u.delete(ae)}function R(){T!==null&&(clearTimeout(T),T=null)}function q(){R(),T=setTimeout(()=>{g.value=null,b.value==="efforts"&&(b.value="models")},lst)}function z(Z){Z!==m.value&&(m.value=Z,w.value=Math.max(0,N.value.findIndex(ae=>ae.id===Z)))}function $(){const Z=r.value,ae=l.value;if(!Z||!ae)return;const K=Z.getBoundingClientRect(),re=ae.offsetHeight,we=window.innerHeight-K.bottom;d.value=were;const be=Math.max(E5,window.innerWidth-K.right);f.value=d.value?{right:`${be}px`,bottom:`${window.innerHeight-K.top+4}px`,top:"auto"}:{right:`${be}px`,top:`${K.bottom+4}px`,bottom:"auto"}}function B(){const Z=l.value,ae=g.value===null?void 0:u.get(g.value);if(!Z||!ae)return;const K=Z.getBoundingClientRect(),re=ae.getBoundingClientRect(),we=a.value?.offsetHeight??0,be=Math.max(0,window.innerHeight-E5-we-K.top);y.value=Math.max(0,Math.min(re.top-K.top-4,Z.offsetHeight-40,be));const ke=window.innerWidth-K.right,oe=K.left;v.value=ke>=rst||ke>=oe?"right":"left"}function P(Z,{moveFocus:ae=!1}={}){z(Z),R(),g.value=Z,ae&&(b.value="efforts",C.value=E()),ft(B)}function H(){g.value=null,b.value="models"}function j(){c.value||(c.value=!0,m.value=n.modelValue||(N.value[0]?.id??""),w.value=Math.max(0,N.value.findIndex(Z=>Z.id===m.value)),g.value=null,b.value="models",ft($))}function G({restoreFocus:Z=!1}={}){c.value&&(R(),c.value=!1,g.value=null,Z&&ft(()=>r.value?.focus()))}function ne(){c.value?G():j()}function W(Z){if(g.value===null)return;const ae={model:g.value,effort:Z??void 0};(ae.model!==n.modelValue||(ae.effort??"")!==n.effort)&&i("select",ae),G({restoreFocus:!0})}function Q(){ft(()=>{l.value?.querySelector(".sm-picker__option.is-kb-active")?.scrollIntoView({block:"nearest"})})}function te(Z){const ae=N.value;if(ae.length===0)return;const K=(w.value+Z+ae.length)%ae.length,re=ae[K].id;z(re),g.value!==null&&P(re),Q()}function X(Z){const ae=_.value;ae.length!==0&&(C.value=(C.value+Z+ae.length)%ae.length,Q())}function ve(Z){if(!c.value){(Z.key==="Enter"||Z.key===" "||Z.key==="ArrowDown")&&(Z.preventDefault(),j());return}if(Z.key==="ArrowDown")Z.preventDefault(),b.value==="models"?te(1):X(1);else if(Z.key==="ArrowUp")Z.preventDefault(),b.value==="models"?te(-1):X(-1);else if(Z.key==="ArrowRight")Z.preventDefault(),P(m.value,{moveFocus:!0});else if(Z.key==="ArrowLeft")Z.preventDefault(),g.value!==null&&H();else if(Z.key==="Enter"||Z.key===" ")Z.preventDefault(),b.value==="models"?P(m.value,{moveFocus:!0}):W(_.value[C.value]??null);else if(Z.key==="Home"||Z.key==="End"){Z.preventDefault();const ae=Z.key==="Home";if(b.value==="models"){const K=N.value;if(K.length===0)return;const re=(ae?K[0]:K.at(-1)).id;z(re),g.value!==null&&P(re)}else C.value=ae?0:_.value.length-1;Q()}else Z.key==="Escape"&&(Z.preventDefault(),G({restoreFocus:!0}))}function ce(Z){const ae=Z.target;s.value?.contains(ae)||l.value?.contains(ae)||G()}function se(Z){if(c.value){if(l.value?.contains(Z.target)){B();return}$(),B()}}function pe(){G()}return kn(()=>{document.addEventListener("pointerdown",ce),document.addEventListener("scroll",se,!0),window.addEventListener("resize",pe)}),Ln(()=>{document.removeEventListener("pointerdown",ce),document.removeEventListener("scroll",se,!0),window.removeEventListener("resize",pe),R()}),(Z,ae)=>(k(),L("div",{ref_key:"rootRef",ref:s,class:Re(["sm-picker",{"is-open":c.value}])},[A("button",{ref_key:"triggerRef",ref:r,class:"sm-picker__trigger",type:"button",role:"combobox","aria-controls":h,"aria-expanded":c.value,"aria-haspopup":"dialog","aria-label":p(o)("settings.secondaryModel"),onClick:ne,onKeydown:ve},[A("span",{class:Re(["sm-picker__value",{"is-placeholder":!e.modelValue}])},[A("span",Qot,F(S.value),1)],2),U(p(Ce),{class:"sm-picker__chevron",name:"chevron-down",size:"sm"})],40,Got),(k(),de(us,{to:"body"},[c.value?(k(),L("div",{key:0,id:h,ref_key:"menuRef",ref:l,class:Re(["sm-picker__menu",{"sm-picker__menu--up":d.value}]),style:sn(f.value),role:"dialog","aria-label":p(o)("settings.secondaryModel")},[A("div",{class:"sm-picker__models",role:"listbox","aria-label":p(o)("settings.secondaryModel")},[(k(!0),L(De,null,Ct(e.groups,K=>(k(),L(De,{key:K.provider},[A("div",Xot,F(K.provider),1),(k(!0),L(De,null,Ct(K.options,re=>(k(),L("button",{key:re.id,ref_for:!0,ref:we=>M(we,re.id),class:Re(["sm-picker__option",{"is-selected":re.id===e.modelValue,"is-active":re.id===m.value,"is-kb-active":b.value==="models"&&re.id===m.value}]),type:"button",role:"option","aria-selected":re.id===e.modelValue,onMouseenter:we=>P(re.id),onMouseleave:q,onClick:we=>P(re.id,{moveFocus:!0})},[U(p(Ce),{class:"sm-picker__check",name:"check",size:"sm"}),A("span",tst,F(re.label),1),U(p(Ce),{class:"sm-picker__flyout-caret",name:"chevron-right",size:"sm"})],42,est))),128))],64))),128))],8,Jot),g.value!==null?(k(),L("div",{key:0,ref_key:"flyoutRef",ref:a,class:Re(["sm-picker__flyout",`sm-picker__flyout--${v.value}`]),style:sn({top:`${y.value}px`}),role:"listbox","aria-label":p(o)("settings.secondaryModelEffort"),onMouseenter:R,onMouseleave:q},[A("div",ist,F(p(o)("settings.secondaryModelEffort")),1),(k(!0),L(De,null,Ct(_.value,(K,re)=>(k(),L("button",{key:K??"__default__",class:Re(["sm-picker__option",{"is-selected":x(K),"is-active":b.value==="efforts"&&re===C.value,"is-kb-active":b.value==="efforts"&&re===C.value,"is-muted":K===null}]),type:"button",role:"option","aria-selected":x(K),onMouseenter:we=>{b.value="efforts",C.value=re},onClick:we=>W(K)},[U(p(Ce),{class:"sm-picker__check",name:"check",size:"sm"}),A("span",sst,F(K??p(o)("settings.secondaryModelEffortAuto")),1)],42,ost))),128))],46,nst)):ee("",!0)],14,Yot)):ee("",!0)]))],2))}}),ust=St(ast,[["__scopeId","data-v-ae75986f"]]);function Zh(e){return R$(li,e)}function GB(e,t,n=!1){return S6(li,e,t,n)}function cst(e){return soe(li,e)}const dst={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"sparkles",askuserquestion:"help-circle",exitplanmode:"file-text",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",waitfor:"clock",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function _Z(e){const t=_r(e);let n=dst[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),n}function MZ(e){return sb(_Z(e),"sm")}function pc(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function ZA(e){return pc(e).some(t=>t.kind==="thinking"&&t.thinking.trim().length>0||t.kind==="text"&&t.text.trim().length>0||t.kind==="tool"||t.kind==="notification")}function IZ(e){return!(e.tool.status==="ok"&&e.tool.media)}function fst(e){const t=pc(e),n=[];let i=[],o=null;const s=()=>{const[l]=i;i.length===1&&l?n.push(l):i.length>1&&n.push({kind:"activity-run",items:i}),i=[]},r=()=>{o&&n.push({kind:"notification",items:o.items,sourceIndex:o.sourceIndex}),o=null};return t.forEach((l,a)=>{if(l.kind==="notification"){o?o.items.push(l.notification):o={items:[l.notification],sourceIndex:a};return}if(i.length===0&&r(),l.kind==="thinking"){i.push({kind:"thinking",thinking:l.thinking,startedAt:l.startedAt,durationMs:l.durationMs,sourceIndex:a});return}if(l.kind==="tool"&&IZ(l)){i.push({kind:"tool",tool:l.tool,sourceIndex:a});return}s(),r(),l.kind==="text"?n.push({kind:"text",text:l.text,sourceIndex:a}):l.kind==="tool"&&n.push({kind:"tool",tool:l.tool,sourceIndex:a})}),s(),r(),n}const QB=new WeakMap;function TZ(e){const t=QB.get(e);if(t!==void 0)return t;const n=hst(e);return QB.set(e,n),n}function hst(e){const t=fst(e);let n=-1;for(let r=t.length-1;r>=0;r--){const l=t[r];if(l?.kind==="text"&&l.text.trim().length>0){n=r;break}}if(n===-1){for(let r=0;rr.kind==="notification");return s.length>0?{folded:i.filter(r=>r.kind!=="notification"),visible:[...s,...o]}:{folded:i,visible:o}}function pst(e){const t=n=>n.kind==="activity-run"?n.items[0]?.sourceIndex??-1:n.sourceIndex;return[...e.folded,...e.visible].sort((n,i)=>t(n)-t(i))}function mst(e){let t;for(const n of e){if(n.kind!=="thinking"||n.startedAt===void 0)continue;const i=Date.parse(n.startedAt);Number.isNaN(i)||(t===void 0||it.kind==="text"&&t.text?[t.text]:[]).join(` -`)}const wst=e=>e.replace(/([\\`*_[\]])/,"\\$1").replace(/^(\d+)([.)])/,"$1\\$2");function Cst(e){const t=[];for(const n of hc(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking** +`)}const yst=e=>e.replace(/([\\`*_[\]])/,"\\$1").replace(/^(\d+)([.)])/,"$1\\$2");function kst(e){const t=[];for(const n of pc(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking** > ${n.thinking.split(` `).join(` -> `)}`);else if(n.kind==="text"&&n.text)t.push(yd(n.text,wst));else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const i=n.tool.output.join(` +> `)}`);else if(n.kind==="text"&&n.text)t.push(yd(n.text,yst));else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const i=n.tool.output.join(` `);t.push(`\`\`\` [${n.tool.name}] ${i} @@ -808,11 +808,11 @@ ${r} `);a!==""&&t.push(a)}return t.join(` -`)}function Ast(e,t){if(e.role==="compaction")return t("conversation.compactedPlain");if(e.role==="user"){if(e.skillActivation)return`/${e.skillActivation.name}`;if(e.pluginCommand)return`/${e.pluginCommand.pluginId}:${e.pluginCommand.commandName}`;const i=yd(e.text).trim().replaceAll(/\s+/g," ");return i.length>0?i:"user"}const n=(e.text||e.thinking||"").trim().replaceAll(/\s+/g," ");return n.length>0?n:(e.tools?.length??0)>0?`${e.tools.length} tools`:"kimi"}function EZ(e){return e.tool.id||`tool-${e.sourceIndex}`}function LZ(e,t){return e.kind==="activity-run"?`activity-run-${e.items[0]?.sourceIndex??t}`:e.kind==="tool"?EZ({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}function xst(e){const t=new Map;for(const n of hc(e)){if(n.kind!=="tool"||n.tool.status==="error")continue;const i=n.tool,o=Mr(i.name);if(o!=="edit"&&o!=="multi_edit"&&o!=="write")continue;let s,r=0,l=0,a=!1,u=!1,c=null;if(o==="write")s=hD(i),a=!0,u=!0;else if(c=YW(i),s=hD(i),c){const h=WW(c);r=h.added,l=h.removed}else u=!0;if(!s)continue;const d=Sst(s),f=t.get(d);if(f)if(f.added+=r,f.removed+=l,f.hasWrite||=a,f.statsIncomplete||=u,f.diff!==null&&c!==null){let h=0,m=0;for(const v of f.diff)v.oldNo!==void 0&&v.oldNo>h&&(h=v.oldNo),v.newNo!==void 0&&v.newNo>m&&(m=v.newNo);const g=c.map(v=>({...v,oldNo:v.oldNo!==void 0?v.oldNo+h:void 0,newNo:v.newNo!==void 0?v.newNo+m:void 0}));f.diff=[...f.diff,{type:"hunk",text:"···"},...g]}else f.diff=null;else t.set(d,{path:s,added:r,removed:l,hasWrite:a,statsIncomplete:u,diff:c})}return[...t.values()]}function Sst(e){const t=e.replace(/\\/g,"/");let n="",i=t,o=!1;const s=/^\/\/([^/]+\/[^/]+)(\/|$)/.exec(t);s?(n=`//${s[1].toLowerCase()}/`,i=t.slice(s[0].length-(s[0].endsWith("/")?1:0)),o=!0):/^[a-zA-Z]:\//.test(t)?(n=`${t[0].toLowerCase()}:/`,i=t.slice(3),o=!0):t.startsWith("/")&&(n="/",i=t.slice(1));const r=n!=="",l=[];for(const c of i.split("/"))if(!(!c||c===".")){if(c===".."){l.length>0&&l[l.length-1]!==".."?l.pop():r||l.push(c);continue}l.push(c)}const a=l.join("/"),u=n+a;return o?u.toLowerCase():u}const _st=2e3,Jm=new Map;function Mst(e){const t=[];for(const n of hc(e)){if(n.kind!=="tool")continue;const i=n.tool,o=Mr(i.name);o!=="edit"&&o!=="multi_edit"&&o!=="write"||t.push(`${i.id}:${i.status}:${i.arg.length}`)}return t.join("|")}function NZ(e){const t=Mst(e),n=Jm.get(e.id);if(n&&n.key===t)return n.changes;const i=xst(e);if(Jm.set(e.id,{key:t,changes:i}),Jm.size>_st){const o=Jm.keys().next().value;o!==void 0&&Jm.delete(o)}return i}function Lc(e){const t=(e??"").trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Ci(e){return typeof e=="string"&&e.length>0?e:void 0}function Xc(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function DZ(e){if(e)return Ci(e.path)??Ci(e.file_path)??Ci(e.filePath)??Ci(e.filename)}function FZ(e){return/^(.*)[\\/][^\\/]+[\\/]?$/.exec(e)?.[1]??""}function Ist(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function Tst(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const i=[];for(const o of n){if(!o||typeof o!="object")continue;const s=o,r=Array.isArray(s.options)?s.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];i.push({question:typeof s.question=="string"?s.question:"",header:typeof s.header=="string"?s.header:"",options:r,multiSelect:s.multi_select===!0})}return i}catch{return[]}}const yy={recognized:!1,answers:{},note:""};function Est(e){const t=e?.[0];if(!t)return yy;let n;try{n=JSON.parse(t)}catch{return yy}if(!n||typeof n!="object"||Array.isArray(n))return yy;const i=n.answers;if(!i||typeof i!="object"||Array.isArray(i))return yy;const o={};for(const[s,r]of Object.entries(i))typeof r=="string"?o[s]=r:r===!0&&(o[s]=!0);return{recognized:!0,answers:o,note:typeof n.note=="string"?n.note:""}}function Lst(e,t,n){return e[t]??e[`q_${n}`]}const Nst=/^opt_\d+_(\d+)$/;function Dst(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const i=n.get(e);if(i!==void 0)return{selected:new Set([i]),otherText:"",indeterminate:!1};const o=new Set,s=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){o.add(a);continue}const u=Nst.exec(l);u?o.add(Number(u[1])):l.length>0&&s.push(l)}return{selected:o,otherText:s.join(", "),indeterminate:!1}}function Fst(e,t){return t<=7?Array.from({length:t},(n,i)=>i+1):e<=4?[1,2,3,4,5,"…",t]:e>=t-3?[1,"…",t-4,t-3,t-2,t-1,t]:[1,"…",e-1,e,e+1,"…",t]}function YB(e){const t=new Date(e),n=i=>String(i).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function JB(e){const t=new Date(e),n=i=>String(i).padStart(2,"0");return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function XB(e,t){return t.succeeded===0?null:{direction:e,ids:t.okIds,succeeded:t.succeeded,failed:t.failed}}function Bst(e){return e==="archive"?"restore":"archive"}const ky=4,Xm=8;function kS(e){const t=V(!1),n=V({});let i=null;function o(){document.removeEventListener("mousedown",l),document.removeEventListener("keydown",a),window.removeEventListener("resize",r),window.removeEventListener("scroll",u,!0)}function s(){document.addEventListener("mousedown",l),document.addEventListener("keydown",a),window.addEventListener("resize",r),window.addEventListener("scroll",u,!0)}function r(){t.value&&(t.value=!1,i=null,o())}function l(m){const g=m.target;g.closest(".sa-menu")||i!==null&&i.contains(g)||r()}function a(m){m.key==="Escape"&&r()}function u(m){m.target instanceof Element&&m.target.closest(".sa-menu")||r()}async function c(m,g,v){t.value||(t.value=!0,s()),await ht();const y=e.value?.el,b=y?.offsetHeight??0,w=y?.offsetWidth??0;let C=g,T=!1;C+b>window.innerHeight-Xm&&(C=Math.max(Xm,g-b-(v?.flipAboveGap??0)),T=!0);let N=v?.alignRightTo!==void 0?v.alignRightTo-w:m;N+w>window.innerWidth-Xm&&(N=Math.max(Xm,window.innerWidth-w-Xm)),n.value={top:`${Math.round(C)}px`,left:`${Math.round(N)}px`,transformOrigin:T?"bottom left":"top left","--menu-pop-shift":T?"2px":"-2px"}}async function d(m){if(t.value){r();return}i=m.currentTarget;const g=i.getBoundingClientRect();await c(g.left,g.bottom+ky,{flipAboveGap:g.height+ky*2})}async function f(m,g){if(t.value){r();return}i=m.currentTarget;const v=i.getBoundingClientRect();await c(v.left,v.bottom+ky,{flipAboveGap:v.height+ky*2,alignRightTo:g==="right"?v.right:void 0})}async function h(m,g){i=null,await c(m,g)}return ti(o),{open:t,menuStyle:n,toggle:d,toggleAnchored:f,openAt:h,close:r}}function Rst(e,t={}){return roe(li,e,t)}function $st(e,t){return aoe(li,e,t)}function BZ(e,t){let n=null;yn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ht(()=>{const i=t?.value??e.value;try{i?.focus()}catch{}})}),ti(()=>{const i=n;if(n=null,!(!i||typeof document>"u"||!document.contains(i)))try{i.focus()}catch{}})}async function Ost(){const e=await fetch("/v1/remote/devices",{credentials:"same-origin"});if(!e.ok)throw new Error(`rc devices fetch failed: ${e.status}`);const t=await e.json();return{devices:Array.isArray(t.devices)?t.devices:[],max_devices:typeof t.max_devices=="number"?t.max_devices:void 0}}const Pst=["aria-label","aria-expanded"],zst={class:"rc-dev-name"},jst={key:0,class:"rc-dev-state"},Hst={key:1,class:"rc-dev-state rc-dev-failed"},Wst={class:"rc-dev-caption"},qst={class:"rc-dev-item-name"},Ust={class:"rc-dev-item-status"},Vst={class:"rc-dev-item-check"},Kst={class:"rc-dev-caption"},Zst=["aria-current"],Gst={class:"rc-dev-offline-row"},Qst={class:"rc-dev-item-name"},Yst={class:"rc-dev-item-status"},Jst={class:"rc-dev-item-check"},Xst=lt({__name:"RcDeviceSwitcher",setup(e){const{t}=qt(),n=Ec(),i=_se(window.location),o=Tse(window.location),s=V(null),r=V(void 0),l=V(!1),a=V(!1),u=D(()=>(s.value??[]).filter(_=>_.status==="online")),c=D(()=>(s.value??[]).filter(_=>_.status!=="online")),d=D(()=>s.value?.find(_=>_.device_id===o)?.platform??t("sidebar.rcSelectDevice"));let f=0;async function h(){const _=++f;s.value===null&&(l.value=!0);try{const x=await Ost();if(_!==f)return;s.value=x.devices,r.value=x.max_devices,a.value=!1}catch{if(_!==f)return;s.value===null&&(a.value=!0)}finally{_===f&&(l.value=!1)}m.value&&(await ht(),N())}yn(()=>{i&&h()});const m=V(!1),g=V({}),v=V(null),y=V(null);let b=null;function w(_){const x=_.target;x.closest(".rc-dev-menu")||x.closest(".rc-dev-trigger")||I()}function C(_){_.key==="Escape"&&(_.stopPropagation(),I())}async function T(){if(m.value){I();return}m.value=!0,document.addEventListener("mousedown",w),document.addEventListener("keydown",C,!0),window.addEventListener("resize",I),h(),await ht(),N();const _=y.value;_&&!n.value&&(b=new ResizeObserver(()=>N()),b.observe(_))}function N(){if(n.value)return;const _=y.value,x=v.value?.el;if(!_||!x)return;const E=_.getBoundingClientRect(),M=4,R=8,q=x.offsetHeight,z={left:`${Math.round(E.left)}px`,width:`${Math.round(E.width)}px`},O=window.innerHeight-E.bottom-M-R,B=E.top-M-R;q>O&&B>O?g.value={...z,top:"auto",bottom:`${Math.round(window.innerHeight-E.top+M)}px`,maxHeight:`${Math.round(B)}px`,transformOrigin:"bottom left","--menu-pop-shift":"2px"}:g.value={...z,top:`${Math.round(E.bottom+M)}px`,bottom:"auto",maxHeight:`${Math.round(O)}px`,transformOrigin:"top left","--menu-pop-shift":"-2px"}}function I(){m.value=!1,b?.disconnect(),b=null,document.removeEventListener("mousedown",w),document.removeEventListener("keydown",C,!0),window.removeEventListener("resize",I)}ti(I);function S(_){_.device_id!==o&&window.location.assign(rP(Ise(_.device_id),window.location.search))}return(_,x)=>p(i)?(k(),L("div",{key:0,class:Re(["rc-dev",{"rc-dev--mobile":p(n)}])},[A("button",{ref_key:"triggerRef",ref:y,class:"rc-dev-trigger",type:"button","aria-label":p(t)("sidebar.rcCurrentDevice",{name:d.value}),"aria-haspopup":"dialog","aria-expanded":m.value,onClick:Tt(T,["stop"])},[U(p(Ce),{name:"device-desktop",size:"sm"}),A("span",zst,F(d.value),1),U(p(Ce),{class:"rc-dev-chevron",name:"chevron-down",size:"sm"})],8,Pst),(k(),de(cs,{to:"body",disabled:p(n)},[U(ko,{name:"menu-pop"},{default:ce(()=>[m.value?(k(),de(p(zs),{key:0,ref_key:"menuRef",ref:v,class:Re(["rc-dev-menu",{"rc-dev-menu--mobile":p(n)}]),role:"dialog",style:on(p(n)?void 0:g.value),onClick:x[0]||(x[0]=Tt(()=>{},["stop"]))},{default:ce(()=>[l.value?(k(),L("div",jst,[U(p(mo),{size:"sm"})])):a.value?(k(),L("div",Hst,F(p(t)("sidebar.rcDevicesLoadFailed")),1)):(k(),L(De,{key:2},[u.value.length>0?(k(),L(De,{key:0},[A("div",Wst,F(p(t)("sidebar.rcConnectable")),1),(k(!0),L(De,null,Ct(u.value,E=>(k(),de(p(nn),{key:E.device_id,role:"button",size:p(n)?"lg":"md",active:E.device_id===p(o),"aria-current":E.device_id===p(o)?"true":void 0,onClick:M=>S(E)},{default:ce(()=>[U(p(Ce),{name:"device-desktop",size:"sm"}),A("span",qst,F(E.platform),1),A("span",Ust,[U(p(Hl),{status:"ok"}),$e(F(p(t)("sidebar.rcOnline")),1)]),A("span",Vst,[E.device_id===p(o)?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:2},1032,["size","active","aria-current","onClick"]))),128))],64)):ee("",!0),c.value.length>0?(k(),L(De,{key:1},[A("div",Kst,F(p(t)("sidebar.rcUnavailable")),1),(k(!0),L(De,null,Ct(c.value,E=>(k(),L("div",{key:E.device_id,class:Re(["rc-dev-offline",{"is-current":E.device_id===p(o)}]),"aria-current":E.device_id===p(o)?"true":void 0},[A("div",Gst,[U(p(Ce),{name:"device-desktop",size:"sm"}),A("span",Qst,F(E.platform),1),A("span",Yst,[U(p(Hl)),$e(F(p(t)("sidebar.rcOffline")),1)]),A("span",Jst,[E.device_id===p(o)?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])])],10,Zst))),128))],64)):ee("",!0)],64))]),_:1},8,["class","style"])):ee("",!0)]),_:1})],8,["disabled"]))],2)):ee("",!0)}}),RZ=xt(Xst,[["__scopeId","data-v-cfe04ecf"]]),K4=[{code:"en",label:"English"},{code:"zh",label:"简体中文"}],zh=cne({locale:IO()});function bS(e){zh.global.locale.value=e,fs(Cn.locale,e)}const ert=["aria-expanded"],trt={class:"user-menu-avatar","aria-hidden":"true"},nrt=["src"],irt={class:"user-menu-name"},ort={class:"user-menu-name"},srt={class:"user-menu-item-label"},rrt={class:"user-menu-item-label"},lrt={class:"user-menu-item-label"},art={class:"user-menu-row-value"},urt={class:"user-menu-item-label"},crt={class:"user-menu-row-value"},drt={class:"user-menu-item-label"},frt={class:"user-menu-item-label user-menu-login-label"},hrt={key:0,class:"user-menu-usage"},prt={key:0,class:"user-menu-usage-state"},mrt={key:1,class:"user-menu-usage-state"},grt={class:"user-menu-usage-error"},vrt={key:2,class:"user-menu-usage-state user-menu-usage-empty"},yrt={class:"user-menu-usage-label"},krt={key:0,class:"user-menu-usage-hint"},brt={class:"user-menu-item-label"},wrt={class:"user-menu-item-label"},Crt=lt({__name:"UserMenu",emits:["login","openSettings"],setup(e,{emit:t}){const n=t,{t:i,locale:o}=qt(),s=Ga(),{confirm:r}=cf(),l=D(()=>s.managedProviderStatus.value==="authenticated"),a=s.managedUserInfo,u=s.managedMembership,c=D(()=>a.value?.nickname||i("sidebar.defaultUserName")),d=D(()=>u.value==="free"||bse(a.value?.userLevel)),f=D(()=>u.value!=="free"),h=V(!1);We(()=>a.value?.avatar,()=>{h.value=!1});const m=D(()=>!!a.value?.avatar&&!h.value),g=s.colorScheme,v=D(()=>i(`theme.${g.value}`)),y=D(()=>g.value==="light"?"light-mode":g.value==="dark"?"dark-mode":"follow-system"),b=[{value:"light",labelKey:"theme.light",icon:"light-mode"},{value:"dark",labelKey:"theme.dark",icon:"dark-mode"},{value:"system",labelKey:"theme.system",icon:"follow-system"}];function w(le){s.setColorScheme(le)}const C=D(()=>K4.find(le=>le.code===o.value)?.label??o.value);function T(le){o.value!==le&&bS(le)}const N=V(!1),I=V({}),S=V(null),_=V(null);let x=null;function E(le){const ye=le.target;ye.closest(".user-menu")||ye.closest(".user-menu-trigger")||ye.closest(".user-submenu")||O()}function M(le){le.key==="Escape"&&(le.stopPropagation(),O())}async function R(){if(N.value){O();return}N.value=!0,document.addEventListener("mousedown",E),document.addEventListener("keydown",M,!0),window.addEventListener("resize",O),l.value&&G(),await ht(),q();const le=_.value;le&&(x=new ResizeObserver(z),x.observe(le))}function q(){const le=_.value,ye=S.value?.el;if(!le||!ye)return;const Ae=le.getBoundingClientRect(),_e=4,pe=8,ne=ye.offsetHeight,Ee={left:`${Math.round(Ae.left)}px`,width:`${Math.round(Ae.width)}px`};Ae.top-ne-_e{j[le]=ye instanceof HTMLElement?ye:ye?.$el??null}}function W(le){X(),B.value!==le&&(B.value=le,ht(ge))}function Q(le,ye){le.key!=="Enter"&&le.key!==" "&&le.key!=="ArrowRight"||(le.preventDefault(),W(ye))}function te(){X(),Z=setTimeout(()=>{B.value=null,Z=null},250)}function X(){Z!==null&&(clearTimeout(Z),Z=null)}function ge(){const le=B.value,ye=S.value?.el,Ae=H.value?.el,_e=le!==null?j[le]:null;if(!ye||!Ae||!_e)return;const pe=4,ne=8,Ee=ye.getBoundingClientRect(),qe=_e.getBoundingClientRect();Ae.style.maxWidth="none";const ze=Ae.offsetHeight,ft=Ae.offsetWidth,{left:gt,maxWidth:_t,flipped:Pt}=lae(ft,Ee,window.innerWidth,pe,ne),Ht=Math.max(ne,Math.min(qe.top,window.innerHeight-ze-ne));P.value={top:`${Math.round(Ht)}px`,left:`${Math.round(gt)}px`,maxWidth:`${Math.round(_t)}px`,transformOrigin:Pt?"top right":"top left","--menu-pop-shift":"-2px"}}const ue=V(!1),se=V(null);let fe=0;async function G(){const le=++fe;ue.value=!0;try{const ye=await s.getUsage();le===fe&&(se.value=ye)}finally{le===fe&&(ue.value=!1)}}We([ue,se],async()=>{B.value==="usage"&&(await ht(),ge())});const ae=D(()=>{if(se.value?.kind!=="ok")return[];const{summary:le,limits:ye}=se.value,Ae=yse(ye,5,"hour");return[le,Ae].filter(_e=>_e!=null)}),K=D(()=>se.value?.kind==="error"?se.value.message:i("settings.planUsage.loadFailed"));function re(le){return le.resetAt===void 0?"":eP(le.resetAt,i)}function be(){O(),mv()}function ke(){O(),n("login")}function we(){O(),n("openSettings")}async function oe(){O(),await r({title:i("sidebar.logoutConfirmTitle"),message:i("sidebar.logoutConfirmMessage"),variant:"danger",action:()=>s.logout()})}return(le,ye)=>(k(),L(De,null,[A("button",{ref_key:"triggerRef",ref:_,class:"user-menu-trigger",type:"button","aria-haspopup":"menu","aria-expanded":N.value,onClick:Tt(R,["stop"])},[l.value?(k(),L(De,{key:0},[A("span",trt,[m.value?(k(),L("img",{key:0,src:p(a)?.avatar,alt:"",onError:ye[0]||(ye[0]=Ae=>h.value=!0)},null,40,nrt)):(k(),de(p(Ce),{key:1,name:"user",size:"sm"}))]),A("span",irt,F(c.value),1)],64)):(k(),L(De,{key:1},[U(p(Ce),{name:"user"}),A("span",ort,F(p(i)("sidebar.notSignedIn")),1)],64))],8,ert),(k(),de(cs,{to:"body"},[U(ko,{name:"menu-pop"},{default:ce(()=>[N.value?(k(),de(p(zs),{key:0,ref_key:"menuRef",ref:S,class:"user-menu",style:on(I.value),onClick:ye[14]||(ye[14]=Tt(()=>{},["stop"]))},{default:ce(()=>[l.value?(k(),L(De,{key:0},[f.value?(k(),de(p(nn),{key:0,ref:ie("usage"),"aria-haspopup":"true","aria-expanded":B.value==="usage",onMouseenter:ye[1]||(ye[1]=Ae=>W("usage")),onMouseleave:te,onFocus:ye[2]||(ye[2]=Ae=>W("usage")),onBlur:te,onClick:ye[3]||(ye[3]=Ae=>W("usage")),onKeydown:ye[4]||(ye[4]=Ae=>Q(Ae,"usage"))},{default:ce(()=>[U(p(Ce),{name:"histogram",size:"sm"}),A("span",srt,F(p(i)("settings.planUsage.title")),1),U(p(Ce),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"])):ee("",!0),d.value?(k(),de(p(nn),{key:1,onClick:be,onMouseenter:te},{default:ce(()=>[U(p(Ce),{name:"music",size:"sm"}),A("span",rrt,F(p(i)("sidebar.upgradeMembership")),1),U(p(Ce),{name:"external-link",size:"sm"})]),_:1})):ee("",!0),U(p(nn),{separator:""})],64)):ee("",!0),U(p(nn),{ref:ie("theme"),"aria-haspopup":"true","aria-expanded":B.value==="theme",onMouseenter:ye[5]||(ye[5]=Ae=>W("theme")),onMouseleave:te,onFocus:ye[6]||(ye[6]=Ae=>W("theme")),onBlur:te,onClick:ye[7]||(ye[7]=Ae=>W("theme")),onKeydown:ye[8]||(ye[8]=Ae=>Q(Ae,"theme"))},{default:ce(()=>[U(p(Ce),{name:y.value,size:"sm"},null,8,["name"]),A("span",lrt,F(p(i)("theme.colorSchemeLabel")),1),A("span",art,F(v.value),1),U(p(Ce),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"]),U(p(nn),{ref:ie("language"),"aria-haspopup":"true","aria-expanded":B.value==="language",onMouseenter:ye[9]||(ye[9]=Ae=>W("language")),onMouseleave:te,onFocus:ye[10]||(ye[10]=Ae=>W("language")),onBlur:te,onClick:ye[11]||(ye[11]=Ae=>W("language")),onKeydown:ye[12]||(ye[12]=Ae=>Q(Ae,"language"))},{default:ce(()=>[U(p(Ce),{name:"translate",size:"sm"}),A("span",urt,F(p(i)("sidebar.language")),1),A("span",crt,F(C.value),1),U(p(Ce),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"]),U(p(nn),{onClick:we,onMouseenter:te},{default:ce(()=>[U(p(Ce),{name:"settings",size:"sm"}),A("span",drt,F(p(i)("settings.title")),1)]),_:1}),l.value?(k(),L(De,{key:1},[U(p(nn),{separator:""}),U(p(nn),{onClick:ye[13]||(ye[13]=Ae=>void oe()),onMouseenter:te},{default:ce(()=>[U(p(Ce),{name:"log-out",size:"sm"}),$e(" "+F(p(i)("sidebar.signOut")),1)]),_:1})],64)):(k(),L(De,{key:2},[U(p(nn),{separator:""}),U(p(nn),{class:"user-menu-login",onClick:ke,onMouseenter:te},{default:ce(()=>[U(p(Ce),{name:"log-in",size:"sm"}),A("span",frt,F(p(i)("sidebar.signIn")),1)]),_:1})],64))]),_:1},8,["style"])):ee("",!0)]),_:1})])),(k(),de(cs,{to:"body"},[U(ko,{name:"menu-pop"},{default:ce(()=>[B.value!==null?(k(),de(p(zs),{key:0,ref_key:"submenuRef",ref:H,class:"user-submenu",style:on(P.value),role:B.value==="usage"?"dialog":"menu",onClick:ye[16]||(ye[16]=Tt(()=>{},["stop"])),onMouseenter:X,onMouseleave:te,onFocusin:X,onFocusout:te},{default:ce(()=>[B.value==="usage"?(k(),L("div",hrt,[ue.value?(k(),L("div",prt,[U(p(mo),{size:"sm"})])):se.value?.kind!=="ok"?(k(),L("div",mrt,[A("span",grt,F(K.value),1),U(p(sn),{variant:"ghost",size:"sm",onClick:ye[15]||(ye[15]=Ae=>void G())},{default:ce(()=>[$e(F(p(i)("settings.planUsage.retry")),1)]),_:1})])):ae.value.length===0?(k(),L("span",vrt,F(p(i)("settings.planUsage.empty")),1)):(k(!0),L(De,{key:3},Ct(ae.value,(Ae,_e)=>(k(),L("div",{key:_e,class:"user-menu-usage-row"},[A("span",yrt,F(p(XO)(Ae,p(i))),1),A("span",{class:Re(["user-menu-usage-value",`sev-${p(Tw)(Ae.used,Ae.limit)}`])},F(p(i)("settings.planUsage.usedPct",{pct:p(_y)(Ae.used,Ae.limit)})),3),re(Ae)?(k(),L("span",krt,F(re(Ae)),1)):ee("",!0)]))),128))])):B.value==="theme"?(k(),L(De,{key:1},Ct(b,Ae=>U(p(nn),{key:Ae.value,onClick:_e=>w(Ae.value)},{default:ce(()=>[U(p(Ce),{name:Ae.icon,size:"sm"},null,8,["name"]),A("span",brt,F(p(i)(Ae.labelKey)),1),p(g)===Ae.value?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["onClick"])),64)):(k(!0),L(De,{key:2},Ct(p(K4),Ae=>(k(),de(p(nn),{key:Ae.code,onClick:_e=>T(Ae.code)},{default:ce(()=>[A("span",wrt,F(Ae.label),1),p(o)===Ae.code?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["onClick"]))),128))]),_:1},8,["style","role"])):ee("",!0)]),_:1})]))],64))}}),Art=xt(Crt,[["__scopeId","data-v-b8060ccc"]]),xrt={class:"ch"},Srt={class:"ch-brand"},_rt={class:"ch-tail"},Mrt={class:"search-input"},Irt={key:0,class:"status-tabs"},Trt={class:"side-section-label"},Ert={class:"side-section-title"},Lrt={class:"side-section-actions"},Nrt={key:0,class:"empty"},Drt={key:1,class:"show-more-row"},Frt=["disabled"],Brt={class:"show-more-label"},Rrt={key:0,class:"empty"},$rt={key:1,class:"empty"},Ort=["data-ws-id","onDragover","onDrop"],Prt=["onClick","onContextmenu"],zrt={class:"done-gh-name"},jrt={class:"done-gh-count"},Hrt={class:"done-gh-act"},Wrt={key:0,class:"done-sessions"},qrt={key:2,class:"empty"},Urt={key:3,class:"show-more-row"},Vrt=["disabled"],Krt={class:"show-more-label"},Zrt=["onClick","onContextmenu"],Grt={class:"ws-dir-row"},Qrt=["onKeydown"],Yrt={key:1,class:"ws-dir-name"},Jrt={class:"ws-dir-act"},Xrt={class:"ws-dir-sub"},elt={key:0,class:"empty"},tlt={class:"side-footer-account"},nlt={class:"folder-drop-card"},ilt={class:"view-menu-label"},olt={class:"view-menu-check"},slt={class:"view-menu-check"},rlt={class:"view-menu-label"},llt={class:"view-menu-check"},alt={class:"view-menu-check"},eR="var(--color-accent)",ult=!1,clt=lt({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},workspaceSortMode:{default:"manual"},pinnedSessions:{default:()=>[]},flatSessions:{default:()=>[]},flatHasMore:{type:Boolean,default:!1},flatLoadingMore:{type:Boolean,default:!1},doneSessions:{default:()=>[]},doneHasMore:{type:Boolean,default:!1},doneLoadingMore:{type:Boolean,default:!1},initialized:{type:Boolean,default:!1},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","addWorkspacePaths","rename","generateTitle","archive","restore","fork","export","pin","dropPin","unpin","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","ensureFlatSessions","loadMoreFlatSessions","ensureDoneSessions","loadMoreDoneSessions","openSessionAdmin","openSettings","login","collapse"],setup(e,{expose:t,emit:n}){const{t:i}=qt(),o=e,s=n,r=V(!1),l=d()?["⌘","K"]:["Ctrl","K"],a=d()?["⌃","⇧","O"]:["Ctrl","Shift","O"];function u(){s("loadAllSessions"),r.value=!0}function c(Je){if(ire(Je)){Je.preventDefault(),u();return}!Je.metaKey&&Je.ctrlKey&&Je.shiftKey&&Je.key.toLowerCase()==="o"&&(Je.preventDefault(),s("create"))}yn(()=>window.addEventListener("keydown",c)),ti(()=>window.removeEventListener("keydown",c));function d(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Je=navigator.userAgentData;return Je?.platform==="macOS"||Je?.platform==="iOS"}const f=V(null),h=V(!1),m=V(!1),{thumb:g,thumbVisible:v,scrolling:y,update:b,markScrolling:w,onThumbPointerDown:C,onListMouseEnter:T,onListMouseLeave:N,onThumbMouseEnter:I,onThumbMouseLeave:S}=YV(f);function _(Je=f.value){Je&&(h.value=Je.scrollTop>0,m.value=Je.scrollTop+Je.clientHeight{ht(()=>{_(),typeof ResizeObserver=="function"&&f.value&&(E=new ResizeObserver(()=>_()),E.observe(f.value))})}),W1(()=>_());const{fontScale:M}=X1();We(M,()=>void ht(()=>_())),ti(()=>{E?.disconnect(),xi&&clearTimeout(xi),dt&&clearTimeout(dt)});const R=V(new Set(Yle()));function q(Je){return R.value.has(Je)}function z(Je){const Ve=new Set(R.value);Ve.has(Je)?Ve.delete(Je):Ve.add(Je),R.value=Ve,N3(Ve)}function O(){const Je=new Set(o.groups.map(Ve=>Ve.workspace.id));R.value=Je,N3(Je)}function B(){const Je=new Set;R.value=Je,N3(Je)}const P=D(()=>o.groups.length>0&&o.groups.every(Je=>R.value.has(Je.workspace.id))),H=V(new Map);function j(Je){return H.value.get(Je)}function Z(Je){const Ve=o.groups.find(Fn=>Fn.workspace.id===Je);if(!Ve)return;const St=(H.value.get(Je)??Ve.initialCount)+Zx,Rt=new Map(H.value);Rt.set(Je,St),H.value=Rt,Ve.sessions.lengthFn.workspace.id),Ve,Je,St);s("reorderWorkspaces",Rt)}const fe=V(null);function G(Je,Ve){fe.value={id:Je,workspaceId:Ve}}function ae(){fe.value=null}function K(Je){fe.value=null,s("unpin",Je)}const re=V(Xle());function be(Je){re.value!==Je&&(re.value=Je,eae(Je))}const ke=V("open"),{sidebarTabs:we}=em();We(we,Je=>{!Je&&ke.value!=="open"&&(ke.value="open")});const oe=D(()=>pI([...o.pinnedSessions,...o.flatSessions].map(Je=>({busy:Je.busy,unread:o.unreadBySession[Je.id]??!1,questionCount:o.pendingBySession[Je.id]?.questions??0,approvalCount:o.pendingBySession[Je.id]?.approvals??0,pendingInteraction:Je.pendingInteraction,lastTurnReason:Je.lastTurnReason})))),le=D(()=>pI(o.doneSessions.map(Je=>({busy:Je.busy,unread:o.unreadBySession[Je.id]??!1,questionCount:o.pendingBySession[Je.id]?.questions??0,approvalCount:o.pendingBySession[Je.id]?.approvals??0,pendingInteraction:Je.pendingInteraction,lastTurnReason:Je.lastTurnReason})))),ye=D(()=>[{value:"open",label:i("sidebar.tabOpen"),swatch:oe.value===null?void 0:eR},{value:"done",label:i("sidebar.tabDone"),swatch:le.value===null?void 0:eR},{value:"workspaces",label:i("sidebar.tabWorkspaces")}]);function Ae(Je){we.value&&(ke.value=Je,Je==="done"&&s("ensureDoneSessions"))}const _e=D(()=>Doe(o.groups,o.activeWorkspaceId,we.value)),pe=D(()=>o.groups.map(Je=>({workspace:Je.workspace,sessions:o.doneSessions.filter(Ve=>Ve.workspaceId===Je.workspace.id).map(Ve=>({...Ve,cwdLabel:void 0}))})).filter(Je=>Je.sessions.length>0));We(()=>o.initialized,Je=>{Je&&(s("ensureFlatSessions"),s("ensureDoneSessions"))},{immediate:!0});const ne=V(!1),Ee=V({}),qe=V(null);function ze(Je){const Ve=Je.target;Ve.closest(".view-menu")||Ve.closest(".side-section-view")||gt()}async function ft(Je){if(ne.value){gt();return}const Ve=Je.currentTarget;ne.value=!0,document.addEventListener("mousedown",ze),window.addEventListener("resize",gt),await ht();const St=qe.value?.el,Rt=Ve.getBoundingClientRect(),Fn=4,fi=8,Mo=St?.offsetHeight??0,Io=St?.offsetWidth??0;let ni=Rt.bottom+Fn,Ro=!1;ni+Mo>window.innerHeight-fi&&(ni=Math.max(fi,Rt.top-Mo-Fn),Ro=!0);let mi=Rt.right-Io;mike.value==="open"&&re.value==="flat"),Ke=V(!1);function rt(Je){!Fe.value||fe.value===null||(Je.preventDefault(),Je.dataTransfer&&(Je.dataTransfer.dropEffect="move"),Ke.value=!0)}function Nt(Je){!Fe.value||fe.value===null||(Je.preventDefault(),Ke.value=!1,K(fe.value.id))}function Lt(Je){Je.currentTarget.contains(Je.relatedTarget)||(Ke.value=!1)}function Qt(Je,Ve){Ve.target.closest(".gh-more, .gh-add")||z(Je)}function Ut(Je){s("select",Je)}function en(Je){s("select",Je),ci(Je)}const it=V(null);let dt=null;const wt=D(()=>o.groups.map(Je=>Je.workspace));function dn(Je,Ve){const St=getComputedStyle(Je).getPropertyValue(Ve).trim(),Rt=/^([\d.]+)(ms|s)$/.exec(St);if(!Rt)return 0;const Fn=Number.parseFloat(Rt[1]);return Rt[2]==="s"?Fn*1e3:Fn}function Gt(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}function ri(Je,Ve){it.value=Je,dt&&clearTimeout(dt),dt=setTimeout(()=>{it.value=null,dt=null},dn(Ve,"--duration-flash"))}function ci(Je){const Ve=o.groups.find(St=>St.sessions.some(Rt=>Rt.id===Je));if(!Ve){ot.value?.expand(),ht(()=>{const Rt=[...ot.value?.$el?.querySelectorAll("[data-session-id]")??[]].find(Fn=>Fn.dataset.sessionId===Je);Rt?.scrollIntoView({block:"nearest",behavior:Gt()}),Rt&&ri(Je,Rt)});return}ke.value!=="open"&&Ae("open"),re.value!=="grouped"&&be("grouped"),q(Ve.workspace.id)&&z(Ve.workspace.id),ht(()=>{const St=[...f.value?.querySelectorAll("[data-session-id]")??[]].find(Rt=>Rt.dataset.sessionId===Je);St?.scrollIntoView({block:"start",behavior:Gt()}),St&&ri(Je,St)})}const ji=V(null);let xi=null;function Uo(Je){ke.value!=="open"&&Ae("open"),re.value!=="grouped"&&be("grouped"),q(Je)&&z(Je),s("selectWorkspace",Je),ht(()=>{const Ve=[...f.value?.querySelectorAll("[data-ws-id]")??[]].find(St=>St.dataset.wsId===Je);Ve?.scrollIntoView({block:"start",behavior:Gt()}),Ve&&(ji.value=Je,xi&&clearTimeout(xi),xi=setTimeout(()=>{ji.value=null,xi=null},dn(Ve,"--duration-flash")))})}const ot=V(null);function Ue(){ke.value!=="open"&&Ae("open"),ot.value?ot.value.expand():Kw(!1)}t({revealPinnedSection:Ue});function st(Je){Ue(),s("pin",Je)}function _n(Je){ot.value?.expand(),s("dropPin",Je)}const bt=V(0),Zn=V(!1);function vs(){bt.value=0,Zn.value=!1}function go(Je){!w2()||!_3(Je)||(Je.preventDefault(),Je.stopPropagation(),bt.value+=1,Zn.value=!0)}function Ls(Je){!w2()||!_3(Je)||(Je.preventDefault(),Je.stopPropagation(),Je.dataTransfer&&(Je.dataTransfer.dropEffect="copy"))}function Hs(Je){!w2()||!_3(Je)||(bt.value=Math.max(0,bt.value-1),bt.value===0&&(Zn.value=!1))}function ys(Je){if(vs(),!w2())return;const Ve=Loe(Je);Ve.length!==0&&(Je.preventDefault(),Je.stopPropagation(),s("addWorkspacePaths",Ve))}const Vo=V(null),Ti=V(""),Tr=V(""),vo=V(null);function no(){return vo}function _o(Je,Ve){Vo.value=Je,Tr.value=Ve,Ti.value=Ve,ht().then(()=>vo.value?.focus())}function Er(){const Je=Vo.value,Ve=Ti.value.trim();Je&&Ve&&Ve!==Tr.value&&s("renameWorkspace",Je,Ve),Vo.value=null}function Bo(){Vo.value=null}function Qn(Je){Ti.value=Je}const{handleCompositionStart:Zi,handleCompositionEnd:yi,isComposingKeyEvent:Hi}=kl();function io(Je){Hi(Je)||Er()}const ki=V(!1),di=V(null),bi=V({}),oo=V(null);function so(Je){oo.value?.el&&!oo.value.el.contains(Je.target)&&Ns()}function Mn(Je,Ve){Ve.preventDefault(),Ve.stopPropagation(),di.value=Je,bi.value={top:`${Ve.clientY}px`,left:`${Ve.clientX}px`,transformOrigin:"top left","--menu-pop-shift":"-2px"},ki.value=!0,document.addEventListener("mousedown",so,!0)}function Ns(){ki.value=!1,document.removeEventListener("mousedown",so,!0),di.value=null}function Ws(){di.value&&Es(di.value.root),Ns()}function Jo(){di.value&&_o(di.value.id,di.value.name),Ns()}function ks(){const Je=di.value;Je&&(Ns(),s("deleteWorkspace",Je.id))}const ro=V(null),eo=V(null),to=V({}),Gi=V(null);function je(Je){const Ve=Je.target;Ve.closest(".gh-more")||Ve.closest(".ws-menu")||Pe()}async function xe(Je,Ve){if(ro.value===Je.id){Pe();return}const St=Ve.currentTarget;eo.value=Je,ro.value=Je.id,document.addEventListener("mousedown",je),window.addEventListener("resize",Pe),await ht();const Rt=Gi.value?.el,Fn=St.getBoundingClientRect(),fi=4,Mo=8,Io=Rt?.offsetHeight??0,ni=Rt?.offsetWidth??0;let Ro=Fn.bottom+fi,mi=!1;Ro+Io>window.innerHeight-Mo&&(Ro=Math.max(Mo,Fn.top-Io-fi),mi=!0);let cr=Fn.right-ni;cr{document.removeEventListener("mousedown",so,!0),document.removeEventListener("mousedown",je),document.removeEventListener("mousedown",ze),window.removeEventListener("resize",Pe),window.removeEventListener("resize",gt)});const Qi=V(null);let Vn;function qs(){const Je=Qi.value;Je&&(Je.classList.remove("blink-now"),Je.getBoundingClientRect(),Je.classList.add("blink-now"),clearTimeout(Vn),Vn=setTimeout(()=>Je.classList.remove("blink-now"),300))}function bs(){qs()}return(Je,Ve)=>(k(),L("aside",{class:Re(["side",{"macos-desktop":p(Cd),collapsed:e.collapsed,"no-anim":e.dragging}]),style:on({width:e.collapsed?"0px":e.colWidth+"px"})},[A("div",{class:"col",style:on({width:e.colWidth+"px"}),onDragenter:go,onDragover:Ls,onDragleave:Hs,onDrop:ys},[A("div",xrt,[A("div",Srt,[p(Cd)?ee("",!0):(k(),L(De,{key:0},[(k(),L("svg",{ref_key:"logoRef",ref:Qi,class:"ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:bs},[...Ve[58]||(Ve[58]=[Qd('',2)])],512)),Ve[59]||(Ve[59]=A("span",{class:"ch-name"},"Kimi Code",-1))],64))]),A("div",_rt,[p(Cd)?ee("",!0):(k(),de(p(ln),{key:0,class:"ch-collapse",size:"sm",label:p(i)("sidebar.collapseSidebar"),tooltip:p(i)("sidebar.collapseSidebar"),onClick:Ve[0]||(Ve[0]=Tt(St=>s("collapse"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"panel-collapse"})]),_:1},8,["label","tooltip"]))])]),U(RZ),A("div",{class:Re(["sidebar-actions",{"sidebar-actions--has-workspace-action":ult}])},[A("button",{class:"btn-new-chat",type:"button",onClick:Ve[1]||(Ve[1]=Tt(St=>s("create"),["stop"]))},[U(p(Ce),{name:"chat-new"}),A("span",null,F(p(i)("sidebar.newChat")),1),U(p(mc),{keys:p(a)},null,8,["keys"])]),ee("",!0),A("button",{class:"search",type:"button",onClick:u},[U(p(Ce),{class:"search-icon",name:"search"}),A("span",Mrt,F(p(i)("sidebar.search")),1),U(p(mc),{keys:p(l)},null,8,["keys"])])],2),p(we)?(k(),L("div",Irt,[U(p(Ms),{class:"status-seg",size:"sm","model-value":ke.value,options:ye.value,"onUpdate:modelValue":Ae},null,8,["model-value","options"])])):ee("",!0),A("div",{class:Re(["sessions-head",{"sessions-head--scrolled":h.value}])},[e.pinnedSessions.length>0&&ke.value==="open"?(k(),de(p(fqe),{key:0,ref_key:"pinnedListRef",ref:ot,sessions:e.pinnedSessions,"active-id":e.activeId,"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"state-tag":"open","flash-session-id":it.value,onSelectSession:Ut,onRenameSession:Ve[3]||(Ve[3]=(St,Rt)=>s("rename",St,Rt)),onGenerateSessionTitle:Ve[4]||(Ve[4]=(St,Rt)=>s("generateTitle",St,Rt)),onArchiveSession:Ve[5]||(Ve[5]=St=>s("archive",St)),onForkSession:Ve[6]||(Ve[6]=St=>s("fork",St)),onExportSession:Ve[7]||(Ve[7]=St=>s("export",St)),onPinSession:st,onDropPin:_n,onSessionDragStart:G,onSessionDragEnd:ae},null,8,["sessions","active-id","pending-by-session","unread-by-session","flash-session-id"])):ee("",!0),A("div",Trt,[A("span",Ert,F(ke.value==="workspaces"?p(i)("sidebar.tabWorkspaces"):ke.value==="done"?p(i)("sidebar.tabDone"):p(i)("sidebar.sessionsHeader")),1),A("div",Lrt,[ke.value==="workspaces"?(k(),de(p(Nn),{key:0,text:p(i)("sidebar.newWorkspace")},{default:ce(()=>[U(p(ln),{class:"side-section-toggle",size:"sm",label:p(i)("sidebar.newWorkspace"),onClick:Ve[8]||(Ve[8]=Tt(St=>s("addWorkspace"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"folder-plus"})]),_:1},8,["label"])]),_:1},8,["text"])):ee("",!0),ke.value!=="workspaces"&&re.value==="grouped"?(k(),de(p(ln),{key:1,class:"side-section-toggle",size:"sm",label:P.value?p(i)("sidebar.expandAll"):p(i)("sidebar.collapseAll"),tooltip:P.value?p(i)("sidebar.expandAll"):p(i)("sidebar.collapseAll"),onClick:Ve[9]||(Ve[9]=Tt(St=>P.value?B():O(),["stop"]))},{default:ce(()=>[P.value?(k(),de(p(Ce),{key:0,name:"expand"})):(k(),de(p(Ce),{key:1,name:"collapse"}))]),_:1},8,["label","tooltip"])):ee("",!0),ke.value!=="workspaces"?(k(),de(p(Nn),{key:2,text:p(i)("sidebar.viewSwitcher")},{default:ce(()=>[U(p(ln),{class:"side-section-toggle side-section-view",size:"sm",label:p(i)("sidebar.viewSwitcher"),onClick:Tt(ft,["stop"])},{default:ce(()=>[U(p(Ce),{name:"list-settings"})]),_:1},8,["label"])]),_:1},8,["text"])):ee("",!0)])])],2),A("div",{ref_key:"sessionsEl",ref:f,class:Re(["sessions",{scrolling:p(y),"pinned-drag-active":Fe.value&&fe.value!==null,"flat-pinned-drop-hover":Ke.value}]),onScroll:x,onDragover:rt,onDrop:Nt,onDragleave:Lt,onMouseenter:Ve[39]||(Ve[39]=(...St)=>p(T)&&p(T)(...St)),onMouseleave:Ve[40]||(Ve[40]=(...St)=>p(N)&&p(N)(...St))},[ke.value==="open"?(k(),L(De,{key:0},[re.value==="flat"?(k(),L(De,{key:0},[(k(!0),L(De,null,Ct(e.flatSessions,St=>(k(),de(p(c0),{key:St.id,session:St,active:St.id===e.activeId,"approval-count":e.pendingBySession[St.id]?.approvals??0,"question-count":e.pendingBySession[St.id]?.questions??0,unread:e.unreadBySession[St.id]??!1,"state-tag":"open",draggable:jt.value!==St.id,onDragstart:Rt=>Te(St.id,Rt),onRenameStateChange:Rt=>jt.value=Rt?St.id:null,onSelect:Ut,onRename:Ve[10]||(Ve[10]=(Rt,Fn)=>s("rename",Rt,Fn)),onGenerateTitle:Ve[11]||(Ve[11]=(Rt,Fn)=>s("generateTitle",Rt,Fn)),onArchive:Ve[12]||(Ve[12]=Rt=>s("archive",Rt)),onFork:Ve[13]||(Ve[13]=Rt=>s("fork",Rt)),onExport:Ve[14]||(Ve[14]=Rt=>s("export",Rt)),onPin:st},null,8,["session","active","approval-count","question-count","unread","draggable","onDragstart","onRenameStateChange"]))),128)),e.flatSessions.length===0&&!e.flatHasMore&&e.pinnedSessions.length===0?(k(),L("div",Nrt,F(p(i)("sidebar.noSessions")),1)):ee("",!0),e.flatHasMore?(k(),L("div",Drt,[A("button",{class:"show-more",disabled:e.flatLoadingMore,onClick:Ve[15]||(Ve[15]=Tt(St=>s("loadMoreFlatSessions"),["stop"]))},[A("span",Brt,F(e.flatLoadingMore?p(i)("sidebar.loadingMore"):p(i)("sidebar.loadMore")),1),U(p(Ce),{name:"chevron-down",size:"sm"})],8,Frt)])):ee("",!0)],64)):(k(),L(De,{key:1},[e.groups.length===0?(k(),L("div",Rrt,F(p(i)("workspace.noWorkspace")),1)):_e.value.length===0&&e.pinnedSessions.length===0?(k(),L("div",$rt,F(p(i)("sidebar.noOpenSessions")),1)):(k(!0),L(De,{key:2},Ct(_e.value,St=>(k(),L("div",{key:St.workspace.id,class:Re(["ws-drop-target",{"drop-before":Q.value?.id===St.workspace.id&&Q.value.position==="before","drop-after":Q.value?.id===St.workspace.id&&Q.value.position==="after","ws-locate-flash":ji.value===St.workspace.id}]),"data-ws-id":St.workspace.id,onDragover:Rt=>ue(Rt,St.workspace.id),onDrop:Rt=>se(St.workspace.id)},[U(p(Dqe),{group:St,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":Vo.value,"rename-value":Ti.value,"rename-input-ref":no(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ro.value,dragging:W.value===St.workspace.id,sortable:e.workspaceSortMode==="manual","is-collapsed":q,"visible-limit":j,"flash-session-id":it.value,"pinned-drag-session":fe.value,"state-tag":"open",onGroupClick:Qt,onGroupContextmenu:Mn,onToggleWsMenu:xe,onCreateInWorkspace:Ve[16]||(Ve[16]=Rt=>s("createInWorkspace",Rt)),onSelectSession:Ut,onRenameSession:Ve[17]||(Ve[17]=(Rt,Fn)=>s("rename",Rt,Fn)),onGenerateSessionTitle:Ve[18]||(Ve[18]=(Rt,Fn)=>s("generateTitle",Rt,Fn)),onArchiveSession:Ve[19]||(Ve[19]=Rt=>s("archive",Rt)),onForkSession:Ve[20]||(Ve[20]=Rt=>s("fork",Rt)),onExportSession:Ve[21]||(Ve[21]=Rt=>s("export",Rt)),onPinSession:st,onDropPinnedSession:K,onExpand:Z,onCollapse:ie,onConfirmRename:Er,onCancelRename:Bo,onUpdateRenameValue:Qn,onWsDragstart:te,onWsDragend:X},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","sortable","flash-session-id","pinned-drag-session"])],42,Ort))),128))],64))],64)):ke.value==="done"?(k(),L(De,{key:1},[re.value==="flat"?(k(!0),L(De,{key:0},Ct(e.doneSessions,St=>(k(),de(p(c0),{key:St.id,session:St,active:St.id===e.activeId,"approval-count":e.pendingBySession[St.id]?.approvals??0,"question-count":e.pendingBySession[St.id]?.questions??0,unread:e.unreadBySession[St.id]??!1,"state-tag":"done",onSelect:Ut,onRename:Ve[22]||(Ve[22]=(Rt,Fn)=>s("rename",Rt,Fn)),onGenerateTitle:Ve[23]||(Ve[23]=(Rt,Fn)=>s("generateTitle",Rt,Fn)),onRestore:Ve[24]||(Ve[24]=Rt=>s("restore",Rt)),onFork:Ve[25]||(Ve[25]=Rt=>s("fork",Rt)),onExport:Ve[26]||(Ve[26]=Rt=>s("export",Rt))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(k(!0),L(De,{key:1},Ct(pe.value,St=>(k(),L("div",{key:St.workspace.id,class:"done-group"},[A("div",{class:"done-gh",onClick:Rt=>z(St.workspace.id),onContextmenu:Rt=>Mn(St.workspace,Rt)},[q(St.workspace.id)?(k(),de(p(Ce),{key:0,class:"done-gh-folder",name:"folder-closed"})):(k(),de(p(Ce),{key:1,class:"done-gh-folder",name:"folder"})),A("span",zrt,F(St.workspace.name),1),A("span",jrt,F(St.sessions.length),1),A("span",Hrt,[U(p(ln),{class:Re(["gh-more",{open:ro.value===St.workspace.id}]),size:"sm",label:p(i)("sidebar.options"),tooltip:p(i)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":ro.value===St.workspace.id,onClick:Tt(Rt=>xe(St.workspace,Rt),["stop"])},{default:ce(()=>[U(p(Ce),{name:"dots-horizontal"})]),_:1},8,["class","label","tooltip","aria-expanded","onClick"])])],40,Prt),q(St.workspace.id)?ee("",!0):(k(),L("div",Wrt,[(k(!0),L(De,null,Ct(St.sessions,Rt=>(k(),de(p(c0),{key:Rt.id,session:Rt,active:Rt.id===e.activeId,"approval-count":e.pendingBySession[Rt.id]?.approvals??0,"question-count":e.pendingBySession[Rt.id]?.questions??0,unread:e.unreadBySession[Rt.id]??!1,"state-tag":"done",onSelect:Ut,onRename:Ve[27]||(Ve[27]=(Fn,fi)=>s("rename",Fn,fi)),onGenerateTitle:Ve[28]||(Ve[28]=(Fn,fi)=>s("generateTitle",Fn,fi)),onRestore:Ve[29]||(Ve[29]=Fn=>s("restore",Fn)),onFork:Ve[30]||(Ve[30]=Fn=>s("fork",Fn)),onExport:Ve[31]||(Ve[31]=Fn=>s("export",Fn))},null,8,["session","active","approval-count","question-count","unread"]))),128))]))]))),128)),e.doneSessions.length===0&&!e.doneHasMore?(k(),L("div",qrt,F(p(i)("sidebar.noDoneSessions")),1)):ee("",!0),e.doneHasMore?(k(),L("div",Urt,[A("button",{class:"show-more",disabled:e.doneLoadingMore,onClick:Ve[32]||(Ve[32]=Tt(St=>s("loadMoreDoneSessions"),["stop"]))},[A("span",Krt,F(e.doneLoadingMore?p(i)("sidebar.loadingMore"):p(i)("sidebar.loadMore")),1),U(p(Ce),{name:"chevron-down",size:"sm"})],8,Vrt)])):ee("",!0)],64)):(k(),L(De,{key:2},[(k(!0),L(De,null,Ct(e.groups,St=>(k(),L("div",{key:St.workspace.id,class:Re(["ws-dir",{on:St.workspace.id===e.activeWorkspaceId}]),onClick:Rt=>s("createInWorkspace",St.workspace.id),onContextmenu:Rt=>Mn(St.workspace,Rt)},[A("div",Grt,[U(p(Ce),{class:"ws-dir-icon",name:"folder-closed"}),Vo.value===St.workspace.id?ai((k(),L("input",{key:0,ref_for:!0,ref:Rt=>vo.value=Rt,"onUpdate:modelValue":Ve[33]||(Ve[33]=Rt=>Ti.value=Rt),class:"ws-dir-rename",type:"text",onKeydown:[Qo(Tt(io,["stop"]),["enter"]),Ve[34]||(Ve[34]=Qo(Tt(Rt=>Bo(),["stop"]),["esc"]))],onCompositionstart:Ve[35]||(Ve[35]=(...Rt)=>p(Zi)&&p(Zi)(...Rt)),onCompositionend:Ve[36]||(Ve[36]=(...Rt)=>p(yi)&&p(yi)(...Rt)),onBlur:Ve[37]||(Ve[37]=Rt=>Bo()),onClick:Ve[38]||(Ve[38]=Tt(()=>{},["stop"]))},null,40,Qrt)),[[ur,Ti.value]]):(k(),L("span",Yrt,F(St.workspace.name),1)),A("span",Jrt,[Vo.value!==St.workspace.id?(k(),de(p(ln),{key:0,class:Re(["gh-more",{open:ro.value===St.workspace.id}]),size:"sm",label:p(i)("sidebar.options"),tooltip:p(i)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":ro.value===St.workspace.id,onClick:Tt(Rt=>xe(St.workspace,Rt),["stop"])},{default:ce(()=>[U(p(Ce),{name:"dots-horizontal"})]),_:1},8,["class","label","tooltip","aria-expanded","onClick"])):ee("",!0)])]),A("div",Xrt,F(St.workspace.root),1)],42,Zrt))),128)),e.groups.length===0?(k(),L("div",elt,F(p(i)("workspace.noWorkspace")),1)):ee("",!0)],64))],34),p(g)?(k(),L("div",{key:1,class:Re(["sessions-thumb",{visible:p(v)}]),style:on({top:`${p(g).top}px`,height:`${p(g).height}px`}),"aria-hidden":"true",onPointerdown:Ve[41]||(Ve[41]=(...St)=>p(C)&&p(C)(...St)),onMouseenter:Ve[42]||(Ve[42]=(...St)=>p(I)&&p(I)(...St)),onMouseleave:Ve[43]||(Ve[43]=(...St)=>p(S)&&p(S)(...St))},null,38)):ee("",!0),A("div",{class:Re(["side-footer",{"side-footer--shadowed":m.value}])},[A("div",tlt,[U(Art,{onLogin:Ve[44]||(Ve[44]=St=>s("login")),onOpenSettings:Ve[45]||(Ve[45]=St=>s("openSettings"))})]),U(p(ln),{class:"side-footer-settings",size:"sm",label:p(i)("settings.title"),tooltip:p(i)("settings.title"),onClick:Ve[46]||(Ve[46]=Tt(St=>s("openSettings"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"settings"})]),_:1},8,["label","tooltip"])],2),A("div",{class:Re(["folder-drop-overlay",{show:Zn.value}]),"aria-hidden":"true"},[A("div",nlt,[U(p(Ce),{name:"folder",size:"lg"}),A("span",null,F(p(i)("sidebar.dropToAddWorkspace")),1)])],2)],36),U(ko,{name:"menu-pop"},{default:ce(()=>[ki.value?(k(),de(p(zs),{key:0,ref_key:"ghMenuRef",ref:oo,class:"gh-menu",style:on(bi.value),onClick:Ve[47]||(Ve[47]=Tt(()=>{},["stop"]))},{default:ce(()=>[U(p(nn),{onClick:Ws},{default:ce(()=>[U(p(Ce),{name:"copy",size:"sm"}),$e(" "+F(p(i)("sidebar.copyPath")),1)]),_:1}),U(p(nn),{class:"workspace-rename-item",onClick:Jo},{default:ce(()=>[U(p(Ce),{name:"pencil",size:"sm"}),$e(" "+F(p(i)("sidebar.rename")),1)]),_:1}),U(p(nn),{danger:"",onClick:ks},{default:ce(()=>[U(p(Ce),{name:"close",size:"sm"}),$e(" "+F(p(i)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),U(ko,{name:"menu-pop"},{default:ce(()=>[ro.value!==null&&eo.value?(k(),de(p(zs),{key:0,ref_key:"wsMenuRef",ref:Gi,class:"ws-menu",style:on(to.value),onClick:Ve[51]||(Ve[51]=Tt(()=>{},["stop"]))},{default:ce(()=>[U(p(nn),{onClick:Ve[48]||(Ve[48]=St=>rn(eo.value))},{default:ce(()=>[U(p(Ce),{name:"copy",size:"sm"}),$e(" "+F(p(i)("sidebar.copyPath")),1)]),_:1}),U(p(nn),{class:"workspace-rename-item",onClick:Ve[49]||(Ve[49]=St=>Yn(eo.value))},{default:ce(()=>[U(p(Ce),{name:"pencil",size:"sm"}),$e(" "+F(p(i)("sidebar.rename")),1)]),_:1}),U(p(nn),{danger:"",onClick:Ve[50]||(Ve[50]=St=>ei(eo.value))},{default:ce(()=>[U(p(Ce),{name:"close",size:"sm"}),$e(" "+F(p(i)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),U(ko,{name:"menu-pop"},{default:ce(()=>[ne.value?(k(),de(p(zs),{key:0,ref_key:"viewMenuRef",ref:qe,class:"view-menu",style:on(Ee.value),onClick:Ve[56]||(Ve[56]=Tt(()=>{},["stop"]))},{default:ce(()=>[A("div",ilt,F(p(i)("sidebar.viewGroup")),1),U(p(nn),{onClick:Ve[52]||(Ve[52]=St=>_t("flat"))},{default:ce(()=>[U(p(Ce),{name:"list",size:"sm"}),$e(" "+F(p(i)("sidebar.viewFlat"))+" ",1),A("span",olt,[re.value==="flat"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1}),U(p(nn),{onClick:Ve[53]||(Ve[53]=St=>_t("grouped"))},{default:ce(()=>[U(p(Ce),{name:"tree-view",size:"sm"}),$e(" "+F(p(i)("sidebar.viewGrouped"))+" ",1),A("span",slt,[re.value==="grouped"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1}),re.value==="grouped"?(k(),L(De,{key:0},[A("div",rlt,F(p(i)("sidebar.sortGroup")),1),U(p(nn),{onClick:Ve[54]||(Ve[54]=St=>Pt("manual"))},{default:ce(()=>[U(p(Ce),{name:"grip",size:"sm"}),$e(" "+F(p(i)("sidebar.sortManual"))+" ",1),A("span",llt,[e.workspaceSortMode==="manual"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1}),U(p(nn),{onClick:Ve[55]||(Ve[55]=St=>Pt("recent"))},{default:ce(()=>[U(p(Ce),{name:"clock",size:"sm"}),$e(" "+F(p(i)("sidebar.sortRecent"))+" ",1),A("span",alt,[e.workspaceSortMode==="recent"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1})],64)):ee("",!0),p(we)?(k(),L(De,{key:1},[U(p(nn),{separator:""}),U(p(nn),{onClick:Ht},{default:ce(()=>[U(p(Ce),{name:"session-admin",size:"sm"}),$e(" "+F(p(i)("sidebar.sessionAdmin")),1)]),_:1})],64)):ee("",!0)]),_:1},8,["style"])):ee("",!0)]),_:1}),r.value?(k(),de(p(iit),{key:0,sessions:e.sessions,workspaces:wt.value,"active-id":e.activeId,onSelect:en,onSelectWorkspace:Uo,onClose:Ve[57]||(Ve[57]=St=>r.value=!1)},null,8,["sessions","workspaces","active-id"])):ee("",!0),(k(),de(cs,{to:"body"}))],6))}}),dlt=xt(clt,[["__scopeId","data-v-a5d7cf12"]]),flt={class:"ch-id"},hlt=["title"],plt={key:1,class:"ch-ws"},mlt={key:2,class:"ch-sep"},glt=["onKeydown"],vlt={class:"ch-ses"},ylt={key:0,class:"ch-pill ch-sync-pill"},klt={key:0,class:"ch-ahead"},blt={key:1,class:"ch-behind"},wlt={key:1,class:"ch-pill ch-diff-pill"},Clt={key:0,class:"ch-add"},Alt={key:1,class:"ch-del"},xlt={class:"ch-pill ch-pr pr-merged ch-done-pill"},Slt=lt({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean},archived:{type:Boolean},pinned:{type:Boolean}},emits:["copyAll","copyFinalSummary","openPr","renameSession","forkSession","togglePin","archiveSession","restoreSession","exportSession"],setup(e,{emit:t}){const{t:n}=qt(),{sidebarTabs:i}=em(),o=e,s=t,r=Jt(qo),l=D(()=>r?.isVisible()??!1);async function a(){r?.togglePanel(),await ht(),document.querySelector(".ptb-hide")?.focus()}const u=D(()=>o.ahead??0),c=D(()=>o.behind??0),d=D(()=>o.gitDiffStats?.totalAdditions??0),f=D(()=>o.gitDiffStats?.totalDeletions??0),h=D(()=>d.value>0||f.value>0),m={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function g(G){return G.trim().toLowerCase().replaceAll("_","-")}function v(G){const ae=g(G);return m[ae]?`pr-${ae}`:"pr-unknown"}function y(G){return n(m[g(G)]??"header.prStatusUnknown")}const b=V(!1),w=V(null),C=V(null),T=V({});function N(G){const ae=G.target;C.value?.el?.contains(ae)||w.value?.el?.contains(ae)||_()}function I(){_()}async function S(G){if(G.stopPropagation(),b.value){_();return}b.value=!0,document.addEventListener("mousedown",N),window.addEventListener("resize",I),await ht();const ae=w.value?.el,K=C.value?.el;if(!ae||!K)return;const re=ae.getBoundingClientRect(),be=4,ke=8,we=K.offsetWidth,oe=K.offsetHeight;let le=re.bottom+be,ye=!1;le+oe>window.innerHeight-ke&&(le=Math.max(ke,re.top-oe-be),ye=!0);let Ae=re.left,_e=!1;Ae+we>window.innerWidth-ke&&(Ae=Math.max(ke,re.right-we),_e=!0),T.value={top:`${Math.round(le)}px`,left:`${Math.round(Ae)}px`,transformOrigin:`${ye?"bottom":"top"} ${_e?"right":"left"}`,"--menu-pop-shift":ye?"2px":"-2px"}}function _(){b.value=!1,document.removeEventListener("mousedown",N),window.removeEventListener("resize",I)}Ln(()=>{document.removeEventListener("mousedown",N),window.removeEventListener("resize",I)});function x(){s("copyAll"),_()}function E(){s("copyFinalSummary"),_()}const M=V(!1);function R(){o.sessionId&&Es(o.sessionId).then(G=>{G&&(M.value=!0,setTimeout(()=>{M.value=!1},1200))})}const q=V(!1),z=V(""),O=V(null),{handleCompositionStart:B,handleCompositionEnd:P,isComposingKeyEvent:H}=kl();async function j(){if(_(),!!o.sessionId){q.value=!0,z.value=o.sessionTitle??"",await ht();try{O.value?.focus(),O.value?.select()}catch{}}}function Z(){const G=z.value.trim();G&&o.sessionId&&G!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,G),q.value=!1}function ie(G){H(G)||Z()}function W(){q.value=!1}function Q(){o.sessionId&&(o.pinned,_(),s("togglePin",o.sessionId))}function te(){o.sessionId&&(_(),s("forkSession",o.sessionId))}function X(){o.sessionId&&(_(),s("exportSession",o.sessionId))}function ge(){o.sessionId&&(_(),s("archiveSession",o.sessionId))}function ue(){o.sessionId&&(_(),s("restoreSession",o.sessionId))}function se(){r?.openDiff()}const fe=!1;return(G,ae)=>(k(),L("header",{class:Re(["chat-header",{"macos-desktop":p(Cd)}])},[A("div",flt,[p(fe)?(k(),L("span",{key:0,class:"ch-dev",title:p(n)("header.devBadge")},"DEV",8,hlt)):ee("",!0),e.workspaceName?(k(),L("span",plt,F(e.workspaceName),1)):ee("",!0),e.workspaceName&&e.sessionTitle?(k(),L("span",mlt,"/")):ee("",!0),q.value?ai((k(),L("input",{key:3,ref_key:"renameInputRef",ref:O,"onUpdate:modelValue":ae[0]||(ae[0]=K=>z.value=K),class:"ch-rename",type:"text",onKeydown:[Qo(Tt(ie,["stop"]),["enter"]),Qo(Tt(W,["stop"]),["esc"])],onCompositionstart:ae[1]||(ae[1]=(...K)=>p(B)&&p(B)(...K)),onCompositionend:ae[2]||(ae[2]=(...K)=>p(P)&&p(P)(...K)),onBlur:Z,onClick:ae[3]||(ae[3]=Tt(()=>{},["stop"]))},null,40,glt)),[[ur,z.value]]):e.sessionTitle?(k(),de(p(Nn),{key:4,text:e.sessionTitle},{default:ce(()=>[A("span",vlt,F(e.sessionTitle),1)]),_:1},8,["text"])):ee("",!0)]),U(p(ln),{ref_key:"kebabRef",ref:w,class:Re(["ch-act-more",{open:b.value}]),label:p(n)("header.options"),tooltip:p(n)("header.options"),"aria-expanded":b.value,"aria-haspopup":"menu",onClick:ae[4]||(ae[4]=Tt(K=>S(K),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","tooltip","aria-expanded"]),U(ko,{name:"menu-pop"},{default:ce(()=>[b.value?(k(),de(p(zs),{key:0,ref_key:"menuRef",ref:C,class:"ch-menu",style:on(T.value),onClick:ae[5]||(ae[5]=Tt(()=>{},["stop"]))},{default:ce(()=>[U(p(nn),{onClick:x},{default:ce(()=>[U(p(Ce),{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),$e(" "+F(e.copied?p(n)("header.copied"):p(n)("header.copyAll")),1)]),_:1}),U(p(nn),{onClick:E},{default:ce(()=>[U(p(Ce),{name:"file-text",size:"sm"}),$e(" "+F(p(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(k(),L(De,{key:0},[U(p(nn),{separator:""}),U(p(nn),{onClick:R},{default:ce(()=>[U(p(Ce),{name:M.value?"check":"copy",size:"sm"},null,8,["name"]),$e(" "+F(M.value?p(n)("header.copied"):p(n)("header.copySessionId")),1)]),_:1}),e.archived?ee("",!0):(k(),de(p(nn),{key:0,onClick:Q},{default:ce(()=>[U(p(Ce),{name:e.pinned?"unpin":"pin",size:"sm"},null,8,["name"]),$e(" "+F(e.pinned?p(n)("header.unpinSession"):p(n)("header.pinSession")),1)]),_:1})),U(p(nn),{onClick:j},{default:ce(()=>[U(p(Ce),{name:"pencil",size:"sm"}),$e(" "+F(p(n)("header.renameSession")),1)]),_:1}),U(p(nn),{onClick:te},{default:ce(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),$e(" "+F(p(n)("header.forkSession")),1)]),_:1}),U(p(nn),{onClick:X},{default:ce(()=>[U(p(Ce),{name:"download",size:"sm"}),$e(" "+F(p(n)("header.exportSession")),1)]),_:1}),e.archived&&p(i)?(k(),de(p(nn),{key:1,onClick:ue},{default:ce(()=>[U(p(Ce),{name:"undo",size:"sm"}),$e(" "+F(p(n)("header.reopenSession")),1)]),_:1})):ee("",!0),e.archived?ee("",!0):(k(),de(p(nn),{key:2,onClick:ge},{default:ce(()=>[U(p(Ce),{name:p(i)?"state-done":"archive",size:"sm"},null,8,["name"]),$e(" "+F(p(i)?p(n)("header.markSessionDone"):p(n)("header.archiveSession")),1)]),_:1}))],64)):ee("",!0)]),_:1},8,["style"])):ee("",!0)]),_:1}),ae[7]||(ae[7]=A("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(k(),L("button",{key:0,type:"button",class:"ch-git",onClick:se},[U(p(Ce),{class:"ch-branch-icon",name:"git-fork",size:"sm"}),A("span",{class:Re(["ch-branch",{"ch-detached":!e.branch}])},F(e.branch||p(n)("header.detached")),3),u.value>0||c.value>0?(k(),L("span",ylt,[u.value>0?(k(),L("span",klt,"↑"+F(u.value),1)):ee("",!0),c.value>0?(k(),L("span",blt,"↓"+F(c.value),1)):ee("",!0)])):ee("",!0),h.value?(k(),L("span",wlt,[d.value>0?(k(),L("span",Clt,"+"+F(d.value),1)):ee("",!0),f.value>0?(k(),L("span",Alt,"-"+F(f.value),1)):ee("",!0)])):ee("",!0)])):ee("",!0),e.pr?(k(),L("button",{key:1,type:"button",class:Re(["ch-pill ch-pr",v(e.pr.state)]),onClick:ae[6]||(ae[6]=K=>e.pr&&s("openPr",e.pr.url))},[U(p(Ce),{name:"git-pull-request",size:"sm"}),A("span",null,"PR #"+F(e.pr.number)+" · "+F(y(e.pr.state)),1)],2)):ee("",!0),e.sessionId&&e.archived&&p(i)?(k(),L(De,{key:2},[A("span",xlt,[U(p(Ce),{name:"state-done",size:"sm"}),A("span",null,F(p(n)("header.sessionDone")),1)]),U(p(sn),{variant:"secondary",size:"sm",onClick:ue},{default:ce(()=>[U(p(Ce),{name:"undo",size:"sm"}),$e(" "+F(p(n)("header.reopenSession")),1)]),_:1})],64)):ee("",!0),p(r)&&!l.value?(k(),de(p(ln),{key:3,class:"ch-panel",label:p(n)("panel.openPanel"),tooltip:p(n)("panel.openPanel"),onClick:a},{default:ce(()=>[U(p(Ce),{name:"panel-expand-right",size:"sm"})]),_:1},8,["label","tooltip"])):ee("",!0)],2))}}),_lt=xt(Slt,[["__scopeId","data-v-927e8637"]]),Mlt=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],tR=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function Ilt(e){if(e<=255)return Mlt[e];let t=0,n=tR.length-1;for(;t<=n;){const i=t+n>>1,o=tR[i];if(eo[1]){t=i+1;continue}return o[2]}return"L"}function Tlt(e){const t=e.length;if(t===0)return null;const n=new Array(t);let i=!1;for(let u=0;u=55296&&c<=56319&&u+1=56320&&m<=57343&&(d=(c-55296<<10)+(m-56320)+65536,f=2)}const h=Ilt(d);(h==="R"||h==="AL"||h==="AN")&&(i=!0);for(let m=0;m=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c0?n[u-1]:l,f=c0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Blt(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,` +`)}function bst(e,t){if(e.role==="compaction")return t("conversation.compactedPlain");if(e.role==="user"){if(e.skillActivation)return`/${e.skillActivation.name}`;if(e.pluginCommand)return`/${e.pluginCommand.pluginId}:${e.pluginCommand.commandName}`;const i=yd(e.text).trim().replaceAll(/\s+/g," ");return i.length>0?i:"user"}const n=(e.text||e.thinking||"").trim().replaceAll(/\s+/g," ");return n.length>0?n:(e.tools?.length??0)>0?`${e.tools.length} tools`:"kimi"}function EZ(e){return e.tool.id||`tool-${e.sourceIndex}`}function LZ(e,t){return e.kind==="activity-run"?`activity-run-${e.items[0]?.sourceIndex??t}`:e.kind==="tool"?EZ({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}function wst(e){const t=new Map;for(const n of pc(e)){if(n.kind!=="tool"||n.tool.status==="error")continue;const i=n.tool,o=_r(i.name);if(o!=="edit"&&o!=="multi_edit"&&o!=="write")continue;let s,r=0,l=0,a=!1,u=!1,c=null;if(o==="write")s=pD(i),a=!0,u=!0;else if(c=YW(i),s=pD(i),c){const h=WW(c);r=h.added,l=h.removed}else u=!0;if(!s)continue;const d=Cst(s),f=t.get(d);if(f)if(f.added+=r,f.removed+=l,f.hasWrite||=a,f.statsIncomplete||=u,f.diff!==null&&c!==null){let h=0,m=0;for(const v of f.diff)v.oldNo!==void 0&&v.oldNo>h&&(h=v.oldNo),v.newNo!==void 0&&v.newNo>m&&(m=v.newNo);const g=c.map(v=>({...v,oldNo:v.oldNo!==void 0?v.oldNo+h:void 0,newNo:v.newNo!==void 0?v.newNo+m:void 0}));f.diff=[...f.diff,{type:"hunk",text:"···"},...g]}else f.diff=null;else t.set(d,{path:s,added:r,removed:l,hasWrite:a,statsIncomplete:u,diff:c})}return[...t.values()]}function Cst(e){const t=e.replace(/\\/g,"/");let n="",i=t,o=!1;const s=/^\/\/([^/]+\/[^/]+)(\/|$)/.exec(t);s?(n=`//${s[1].toLowerCase()}/`,i=t.slice(s[0].length-(s[0].endsWith("/")?1:0)),o=!0):/^[a-zA-Z]:\//.test(t)?(n=`${t[0].toLowerCase()}:/`,i=t.slice(3),o=!0):t.startsWith("/")&&(n="/",i=t.slice(1));const r=n!=="",l=[];for(const c of i.split("/"))if(!(!c||c===".")){if(c===".."){l.length>0&&l[l.length-1]!==".."?l.pop():r||l.push(c);continue}l.push(c)}const a=l.join("/"),u=n+a;return o?u.toLowerCase():u}const Ast=2e3,Ym=new Map;function xst(e){const t=[];for(const n of pc(e)){if(n.kind!=="tool")continue;const i=n.tool,o=_r(i.name);o!=="edit"&&o!=="multi_edit"&&o!=="write"||t.push(`${i.id}:${i.status}:${i.arg.length}`)}return t.join("|")}function NZ(e){const t=xst(e),n=Ym.get(e.id);if(n&&n.key===t)return n.changes;const i=wst(e);if(Ym.set(e.id,{key:t,changes:i}),Ym.size>Ast){const o=Ym.keys().next().value;o!==void 0&&Ym.delete(o)}return i}function Nc(e){const t=(e??"").trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function ki(e){return typeof e=="string"&&e.length>0?e:void 0}function Xc(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function DZ(e){if(e)return ki(e.path)??ki(e.file_path)??ki(e.filePath)??ki(e.filename)}function FZ(e){return/^(.*)[\\/][^\\/]+[\\/]?$/.exec(e)?.[1]??""}function Sst(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function _st(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const i=[];for(const o of n){if(!o||typeof o!="object")continue;const s=o,r=Array.isArray(s.options)?s.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];i.push({question:typeof s.question=="string"?s.question:"",header:typeof s.header=="string"?s.header:"",options:r,multiSelect:s.multi_select===!0})}return i}catch{return[]}}const vy={recognized:!1,answers:{},note:""};function Mst(e){const t=e?.[0];if(!t)return vy;let n;try{n=JSON.parse(t)}catch{return vy}if(!n||typeof n!="object"||Array.isArray(n))return vy;const i=n.answers;if(!i||typeof i!="object"||Array.isArray(i))return vy;const o={};for(const[s,r]of Object.entries(i))typeof r=="string"?o[s]=r:r===!0&&(o[s]=!0);return{recognized:!0,answers:o,note:typeof n.note=="string"?n.note:""}}function Ist(e,t,n){return e[t]??e[`q_${n}`]}const Tst=/^opt_\d+_(\d+)$/;function Est(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const i=n.get(e);if(i!==void 0)return{selected:new Set([i]),otherText:"",indeterminate:!1};const o=new Set,s=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){o.add(a);continue}const u=Tst.exec(l);u?o.add(Number(u[1])):l.length>0&&s.push(l)}return{selected:o,otherText:s.join(", "),indeterminate:!1}}function Lst(e,t){return t<=7?Array.from({length:t},(n,i)=>i+1):e<=4?[1,2,3,4,5,"…",t]:e>=t-3?[1,"…",t-4,t-3,t-2,t-1,t]:[1,"…",e-1,e,e+1,"…",t]}function JB(e){const t=new Date(e),n=i=>String(i).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function XB(e){const t=new Date(e),n=i=>String(i).padStart(2,"0");return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function eR(e,t){return t.succeeded===0?null:{direction:e,ids:t.okIds,succeeded:t.succeeded,failed:t.failed}}function Nst(e){return e==="archive"?"restore":"archive"}const yy=4,Jm=8;function yS(e){const t=V(!1),n=V({});let i=null;function o(){document.removeEventListener("mousedown",l),document.removeEventListener("keydown",a),window.removeEventListener("resize",r),window.removeEventListener("scroll",u,!0)}function s(){document.addEventListener("mousedown",l),document.addEventListener("keydown",a),window.addEventListener("resize",r),window.addEventListener("scroll",u,!0)}function r(){t.value&&(t.value=!1,i=null,o())}function l(m){const g=m.target;g.closest(".sa-menu")||i!==null&&i.contains(g)||r()}function a(m){m.key==="Escape"&&r()}function u(m){m.target instanceof Element&&m.target.closest(".sa-menu")||r()}async function c(m,g,v){t.value||(t.value=!0,s()),await ft();const y=e.value?.el,b=y?.offsetHeight??0,w=y?.offsetWidth??0;let C=g,T=!1;C+b>window.innerHeight-Jm&&(C=Math.max(Jm,g-b-(v?.flipAboveGap??0)),T=!0);let N=v?.alignRightTo!==void 0?v.alignRightTo-w:m;N+w>window.innerWidth-Jm&&(N=Math.max(Jm,window.innerWidth-w-Jm)),n.value={top:`${Math.round(C)}px`,left:`${Math.round(N)}px`,transformOrigin:T?"bottom left":"top left","--menu-pop-shift":T?"2px":"-2px"}}async function d(m){if(t.value){r();return}i=m.currentTarget;const g=i.getBoundingClientRect();await c(g.left,g.bottom+yy,{flipAboveGap:g.height+yy*2})}async function f(m,g){if(t.value){r();return}i=m.currentTarget;const v=i.getBoundingClientRect();await c(v.left,v.bottom+yy,{flipAboveGap:v.height+yy*2,alignRightTo:g==="right"?v.right:void 0})}async function h(m,g){i=null,await c(m,g)}return Xn(o),{open:t,menuStyle:n,toggle:d,toggleAnchored:f,openAt:h,close:r}}function Dst(e,t={}){return roe(li,e,t)}function Fst(e,t){return aoe(li,e,t)}function BZ(e,t){let n=null;kn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ft(()=>{const i=t?.value??e.value;try{i?.focus()}catch{}})}),Xn(()=>{const i=n;if(n=null,!(!i||typeof document>"u"||!document.contains(i)))try{i.focus()}catch{}})}async function Bst(){const e=await fetch("/v1/remote/devices",{credentials:"same-origin"});if(!e.ok)throw new Error(`rc devices fetch failed: ${e.status}`);const t=await e.json();return{devices:Array.isArray(t.devices)?t.devices:[],max_devices:typeof t.max_devices=="number"?t.max_devices:void 0}}const Rst=["aria-label","aria-expanded"],Ost={class:"rc-dev-name"},$st={key:0,class:"rc-dev-state"},Pst={key:1,class:"rc-dev-state rc-dev-failed"},zst={class:"rc-dev-caption"},jst={class:"rc-dev-item-name"},Hst={class:"rc-dev-item-status"},Wst={class:"rc-dev-item-check"},qst={class:"rc-dev-caption"},Ust=["aria-current"],Vst={class:"rc-dev-offline-row"},Kst={class:"rc-dev-item-name"},Zst={class:"rc-dev-item-status"},Gst={class:"rc-dev-item-check"},Qst=rt({__name:"RcDeviceSwitcher",setup(e){const{t}=Ut(),n=Lc(),i=Sse(window.location),o=Ise(window.location),s=V(null),r=V(void 0),l=V(!1),a=V(!1),u=D(()=>(s.value??[]).filter(_=>_.status==="online")),c=D(()=>(s.value??[]).filter(_=>_.status!=="online")),d=D(()=>s.value?.find(_=>_.device_id===o)?.platform??t("sidebar.rcSelectDevice"));let f=0;async function h(){const _=++f;s.value===null&&(l.value=!0);try{const x=await Bst();if(_!==f)return;s.value=x.devices,r.value=x.max_devices,a.value=!1}catch{if(_!==f)return;s.value===null&&(a.value=!0)}finally{_===f&&(l.value=!1)}m.value&&(await ft(),N())}kn(()=>{i&&h()});const m=V(!1),g=V({}),v=V(null),y=V(null);let b=null;function w(_){const x=_.target;x.closest(".rc-dev-menu")||x.closest(".rc-dev-trigger")||I()}function C(_){_.key==="Escape"&&(_.stopPropagation(),I())}async function T(){if(m.value){I();return}m.value=!0,document.addEventListener("mousedown",w),document.addEventListener("keydown",C,!0),window.addEventListener("resize",I),h(),await ft(),N();const _=y.value;_&&!n.value&&(b=new ResizeObserver(()=>N()),b.observe(_))}function N(){if(n.value)return;const _=y.value,x=v.value?.el;if(!_||!x)return;const E=_.getBoundingClientRect(),M=4,R=8,q=x.offsetHeight,z={left:`${Math.round(E.left)}px`,width:`${Math.round(E.width)}px`},$=window.innerHeight-E.bottom-M-R,B=E.top-M-R;q>$&&B>$?g.value={...z,top:"auto",bottom:`${Math.round(window.innerHeight-E.top+M)}px`,maxHeight:`${Math.round(B)}px`,transformOrigin:"bottom left","--menu-pop-shift":"2px"}:g.value={...z,top:`${Math.round(E.bottom+M)}px`,bottom:"auto",maxHeight:`${Math.round($)}px`,transformOrigin:"top left","--menu-pop-shift":"-2px"}}function I(){m.value=!1,b?.disconnect(),b=null,document.removeEventListener("mousedown",w),document.removeEventListener("keydown",C,!0),window.removeEventListener("resize",I)}Xn(I);function S(_){_.device_id!==o&&window.location.assign(rP(Mse(_.device_id),window.location.search))}return(_,x)=>p(i)?(k(),L("div",{key:0,class:Re(["rc-dev",{"rc-dev--mobile":p(n)}])},[A("button",{ref_key:"triggerRef",ref:y,class:"rc-dev-trigger",type:"button","aria-label":p(t)("sidebar.rcCurrentDevice",{name:d.value}),"aria-haspopup":"dialog","aria-expanded":m.value,onClick:Tt(T,["stop"])},[U(p(Ce),{name:"device-desktop",size:"sm"}),A("span",Ost,F(d.value),1),U(p(Ce),{class:"rc-dev-chevron",name:"chevron-down",size:"sm"})],8,Rst),(k(),de(us,{to:"body",disabled:p(n)},[U(mo,{name:"menu-pop"},{default:ue(()=>[m.value?(k(),de(p(Hs),{key:0,ref_key:"menuRef",ref:v,class:Re(["rc-dev-menu",{"rc-dev-menu--mobile":p(n)}]),role:"dialog",style:sn(p(n)?void 0:g.value),onClick:x[0]||(x[0]=Tt(()=>{},["stop"]))},{default:ue(()=>[l.value?(k(),L("div",$st,[U(p(uo),{size:"sm"})])):a.value?(k(),L("div",Pst,F(p(t)("sidebar.rcDevicesLoadFailed")),1)):(k(),L(De,{key:2},[u.value.length>0?(k(),L(De,{key:0},[A("div",zst,F(p(t)("sidebar.rcConnectable")),1),(k(!0),L(De,null,Ct(u.value,E=>(k(),de(p(tn),{key:E.device_id,role:"button",size:p(n)?"lg":"md",active:E.device_id===p(o),"aria-current":E.device_id===p(o)?"true":void 0,onClick:M=>S(E)},{default:ue(()=>[U(p(Ce),{name:"device-desktop",size:"sm"}),A("span",jst,F(E.platform),1),A("span",Hst,[U(p(Ul),{status:"ok"}),Oe(F(p(t)("sidebar.rcOnline")),1)]),A("span",Wst,[E.device_id===p(o)?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:2},1032,["size","active","aria-current","onClick"]))),128))],64)):ee("",!0),c.value.length>0?(k(),L(De,{key:1},[A("div",qst,F(p(t)("sidebar.rcUnavailable")),1),(k(!0),L(De,null,Ct(c.value,E=>(k(),L("div",{key:E.device_id,class:Re(["rc-dev-offline",{"is-current":E.device_id===p(o)}]),"aria-current":E.device_id===p(o)?"true":void 0},[A("div",Vst,[U(p(Ce),{name:"device-desktop",size:"sm"}),A("span",Kst,F(E.platform),1),A("span",Zst,[U(p(Ul)),Oe(F(p(t)("sidebar.rcOffline")),1)]),A("span",Gst,[E.device_id===p(o)?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])])],10,Ust))),128))],64)):ee("",!0)],64))]),_:1},8,["class","style"])):ee("",!0)]),_:1})],8,["disabled"]))],2)):ee("",!0)}}),RZ=St(Qst,[["__scopeId","data-v-cfe04ecf"]]),V4=[{code:"en",label:"English"},{code:"zh",label:"简体中文"}],jh=cne({locale:T$()});function kS(e){jh.global.locale.value=e,ds(xn.locale,e)}const Yst=["aria-expanded"],Jst={class:"user-menu-avatar","aria-hidden":"true"},Xst=["src"],ert={class:"user-menu-name"},trt={class:"user-menu-name"},nrt={class:"user-menu-item-label"},irt={class:"user-menu-item-label"},ort={class:"user-menu-item-label"},srt={class:"user-menu-row-value"},rrt={class:"user-menu-item-label"},lrt={class:"user-menu-row-value"},art={class:"user-menu-item-label"},urt={class:"user-menu-item-label user-menu-login-label"},crt={key:0,class:"user-menu-usage"},drt={key:0,class:"user-menu-usage-state"},frt={key:1,class:"user-menu-usage-state"},hrt={class:"user-menu-usage-error"},prt={key:2,class:"user-menu-usage-state user-menu-usage-empty"},mrt={class:"user-menu-usage-label"},grt={key:0,class:"user-menu-usage-hint"},vrt={class:"user-menu-item-label"},yrt={class:"user-menu-item-label"},krt=rt({__name:"UserMenu",emits:["login","openSettings"],setup(e,{emit:t}){const n=t,{t:i,locale:o}=Ut(),s=Xa(),{confirm:r}=cf(),l=D(()=>s.managedProviderStatus.value==="authenticated"),a=s.managedUserInfo,u=s.managedMembership,c=D(()=>a.value?.nickname||i("sidebar.defaultUserName")),d=D(()=>u.value==="free"||kse(a.value?.userLevel)),f=D(()=>u.value!=="free"),h=V(!1);We(()=>a.value?.avatar,()=>{h.value=!1});const m=D(()=>!!a.value?.avatar&&!h.value),g=s.colorScheme,v=D(()=>i(`theme.${g.value}`)),y=D(()=>g.value==="light"?"light-mode":g.value==="dark"?"dark-mode":"follow-system"),b=[{value:"light",labelKey:"theme.light",icon:"light-mode"},{value:"dark",labelKey:"theme.dark",icon:"dark-mode"},{value:"system",labelKey:"theme.system",icon:"follow-system"}];function w(le){s.setColorScheme(le)}const C=D(()=>V4.find(le=>le.code===o.value)?.label??o.value);function T(le){o.value!==le&&kS(le)}const N=V(!1),I=V({}),S=V(null),_=V(null);let x=null;function E(le){const ye=le.target;ye.closest(".user-menu")||ye.closest(".user-menu-trigger")||ye.closest(".user-submenu")||$()}function M(le){le.key==="Escape"&&(le.stopPropagation(),$())}async function R(){if(N.value){$();return}N.value=!0,document.addEventListener("mousedown",E),document.addEventListener("keydown",M,!0),window.addEventListener("resize",$),l.value&&Z(),await ft(),q();const le=_.value;le&&(x=new ResizeObserver(z),x.observe(le))}function q(){const le=_.value,ye=S.value?.el;if(!le||!ye)return;const Ae=le.getBoundingClientRect(),Me=4,fe=8,ie=ye.offsetHeight,Ee={left:`${Math.round(Ae.left)}px`,width:`${Math.round(Ae.width)}px`};Ae.top-ie-Me{j[le]=ye instanceof HTMLElement?ye:ye?.$el??null}}function W(le){X(),B.value!==le&&(B.value=le,ft(ve))}function Q(le,ye){le.key!=="Enter"&&le.key!==" "&&le.key!=="ArrowRight"||(le.preventDefault(),W(ye))}function te(){X(),G=setTimeout(()=>{B.value=null,G=null},250)}function X(){G!==null&&(clearTimeout(G),G=null)}function ve(){const le=B.value,ye=S.value?.el,Ae=H.value?.el,Me=le!==null?j[le]:null;if(!ye||!Ae||!Me)return;const fe=4,ie=8,Ee=ye.getBoundingClientRect(),qe=Me.getBoundingClientRect();Ae.style.maxWidth="none";const ze=Ae.offsetHeight,ht=Ae.offsetWidth,{left:gt,maxWidth:_t,flipped:$t}=rae(ht,Ee,window.innerWidth,fe,ie),jt=Math.max(ie,Math.min(qe.top,window.innerHeight-ze-ie));P.value={top:`${Math.round(jt)}px`,left:`${Math.round(gt)}px`,maxWidth:`${Math.round(_t)}px`,transformOrigin:$t?"top right":"top left","--menu-pop-shift":"-2px"}}const ce=V(!1),se=V(null);let pe=0;async function Z(){const le=++pe;ce.value=!0;try{const ye=await s.getUsage();le===pe&&(se.value=ye)}finally{le===pe&&(ce.value=!1)}}We([ce,se],async()=>{B.value==="usage"&&(await ft(),ve())});const ae=D(()=>{if(se.value?.kind!=="ok")return[];const{summary:le,limits:ye}=se.value,Ae=vse(ye,5,"hour");return[le,Ae].filter(Me=>Me!=null)}),K=D(()=>se.value?.kind==="error"?se.value.message:i("settings.planUsage.loadFailed"));function re(le){return le.resetAt===void 0?"":eP(le.resetAt,i)}function we(){$(),pv()}function be(){$(),n("login")}function ke(){$(),n("openSettings")}async function oe(){$(),await r({title:i("sidebar.logoutConfirmTitle"),message:i("sidebar.logoutConfirmMessage"),variant:"danger",action:()=>s.logout()})}return(le,ye)=>(k(),L(De,null,[A("button",{ref_key:"triggerRef",ref:_,class:"user-menu-trigger",type:"button","aria-haspopup":"menu","aria-expanded":N.value,onClick:Tt(R,["stop"])},[l.value?(k(),L(De,{key:0},[A("span",Jst,[m.value?(k(),L("img",{key:0,src:p(a)?.avatar,alt:"",onError:ye[0]||(ye[0]=Ae=>h.value=!0)},null,40,Xst)):(k(),de(p(Ce),{key:1,name:"user",size:"sm"}))]),A("span",ert,F(c.value),1)],64)):(k(),L(De,{key:1},[U(p(Ce),{name:"user"}),A("span",trt,F(p(i)("sidebar.notSignedIn")),1)],64))],8,Yst),(k(),de(us,{to:"body"},[U(mo,{name:"menu-pop"},{default:ue(()=>[N.value?(k(),de(p(Hs),{key:0,ref_key:"menuRef",ref:S,class:"user-menu",style:sn(I.value),onClick:ye[14]||(ye[14]=Tt(()=>{},["stop"]))},{default:ue(()=>[l.value?(k(),L(De,{key:0},[f.value?(k(),de(p(tn),{key:0,ref:ne("usage"),"aria-haspopup":"true","aria-expanded":B.value==="usage",onMouseenter:ye[1]||(ye[1]=Ae=>W("usage")),onMouseleave:te,onFocus:ye[2]||(ye[2]=Ae=>W("usage")),onBlur:te,onClick:ye[3]||(ye[3]=Ae=>W("usage")),onKeydown:ye[4]||(ye[4]=Ae=>Q(Ae,"usage"))},{default:ue(()=>[U(p(Ce),{name:"histogram",size:"sm"}),A("span",nrt,F(p(i)("settings.planUsage.title")),1),U(p(Ce),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"])):ee("",!0),d.value?(k(),de(p(tn),{key:1,onClick:we,onMouseenter:te},{default:ue(()=>[U(p(Ce),{name:"music",size:"sm"}),A("span",irt,F(p(i)("sidebar.upgradeMembership")),1),U(p(Ce),{name:"external-link",size:"sm"})]),_:1})):ee("",!0),U(p(tn),{separator:""})],64)):ee("",!0),U(p(tn),{ref:ne("theme"),"aria-haspopup":"true","aria-expanded":B.value==="theme",onMouseenter:ye[5]||(ye[5]=Ae=>W("theme")),onMouseleave:te,onFocus:ye[6]||(ye[6]=Ae=>W("theme")),onBlur:te,onClick:ye[7]||(ye[7]=Ae=>W("theme")),onKeydown:ye[8]||(ye[8]=Ae=>Q(Ae,"theme"))},{default:ue(()=>[U(p(Ce),{name:y.value,size:"sm"},null,8,["name"]),A("span",ort,F(p(i)("theme.colorSchemeLabel")),1),A("span",srt,F(v.value),1),U(p(Ce),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"]),U(p(tn),{ref:ne("language"),"aria-haspopup":"true","aria-expanded":B.value==="language",onMouseenter:ye[9]||(ye[9]=Ae=>W("language")),onMouseleave:te,onFocus:ye[10]||(ye[10]=Ae=>W("language")),onBlur:te,onClick:ye[11]||(ye[11]=Ae=>W("language")),onKeydown:ye[12]||(ye[12]=Ae=>Q(Ae,"language"))},{default:ue(()=>[U(p(Ce),{name:"translate",size:"sm"}),A("span",rrt,F(p(i)("sidebar.language")),1),A("span",lrt,F(C.value),1),U(p(Ce),{name:"chevron-right",size:"sm"})]),_:1},8,["aria-expanded"]),U(p(tn),{onClick:ke,onMouseenter:te},{default:ue(()=>[U(p(Ce),{name:"settings",size:"sm"}),A("span",art,F(p(i)("settings.title")),1)]),_:1}),l.value?(k(),L(De,{key:1},[U(p(tn),{separator:""}),U(p(tn),{onClick:ye[13]||(ye[13]=Ae=>void oe()),onMouseenter:te},{default:ue(()=>[U(p(Ce),{name:"log-out",size:"sm"}),Oe(" "+F(p(i)("sidebar.signOut")),1)]),_:1})],64)):(k(),L(De,{key:2},[U(p(tn),{separator:""}),U(p(tn),{class:"user-menu-login",onClick:be,onMouseenter:te},{default:ue(()=>[U(p(Ce),{name:"log-in",size:"sm"}),A("span",urt,F(p(i)("sidebar.signIn")),1)]),_:1})],64))]),_:1},8,["style"])):ee("",!0)]),_:1})])),(k(),de(us,{to:"body"},[U(mo,{name:"menu-pop"},{default:ue(()=>[B.value!==null?(k(),de(p(Hs),{key:0,ref_key:"submenuRef",ref:H,class:"user-submenu",style:sn(P.value),role:B.value==="usage"?"dialog":"menu",onClick:ye[16]||(ye[16]=Tt(()=>{},["stop"])),onMouseenter:X,onMouseleave:te,onFocusin:X,onFocusout:te},{default:ue(()=>[B.value==="usage"?(k(),L("div",crt,[ce.value?(k(),L("div",drt,[U(p(uo),{size:"sm"})])):se.value?.kind!=="ok"?(k(),L("div",frt,[A("span",hrt,F(K.value),1),U(p(rn),{variant:"ghost",size:"sm",onClick:ye[15]||(ye[15]=Ae=>void Z())},{default:ue(()=>[Oe(F(p(i)("settings.planUsage.retry")),1)]),_:1})])):ae.value.length===0?(k(),L("span",prt,F(p(i)("settings.planUsage.empty")),1)):(k(!0),L(De,{key:3},Ct(ae.value,(Ae,Me)=>(k(),L("div",{key:Me,class:"user-menu-usage-row"},[A("span",mrt,F(p(X$)(Ae,p(i))),1),A("span",{class:Re(["user-menu-usage-value",`sev-${p(Iw)(Ae.used,Ae.limit)}`])},F(p(i)("settings.planUsage.usedPct",{pct:p(Sy)(Ae.used,Ae.limit)})),3),re(Ae)?(k(),L("span",grt,F(re(Ae)),1)):ee("",!0)]))),128))])):B.value==="theme"?(k(),L(De,{key:1},Ct(b,Ae=>U(p(tn),{key:Ae.value,onClick:Me=>w(Ae.value)},{default:ue(()=>[U(p(Ce),{name:Ae.icon,size:"sm"},null,8,["name"]),A("span",vrt,F(p(i)(Ae.labelKey)),1),p(g)===Ae.value?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["onClick"])),64)):(k(!0),L(De,{key:2},Ct(p(V4),Ae=>(k(),de(p(tn),{key:Ae.code,onClick:Me=>T(Ae.code)},{default:ue(()=>[A("span",yrt,F(Ae.label),1),p(o)===Ae.code?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),_:2},1032,["onClick"]))),128))]),_:1},8,["style","role"])):ee("",!0)]),_:1})]))],64))}}),brt=St(krt,[["__scopeId","data-v-b8060ccc"]]),wrt={class:"ch"},Crt={class:"ch-brand"},Art={class:"ch-tail"},xrt={class:"search-input"},Srt={key:0,class:"status-tabs"},_rt={class:"side-section-label"},Mrt={class:"side-section-title"},Irt={class:"side-section-actions"},Trt={key:0,class:"empty"},Ert={key:1,class:"show-more-row"},Lrt=["disabled"],Nrt={class:"show-more-label"},Drt={key:0,class:"empty"},Frt={key:1,class:"empty"},Brt=["data-ws-id","onDragover","onDrop"],Rrt=["onClick","onContextmenu"],Ort={class:"done-gh-name"},$rt={class:"done-gh-count"},Prt={class:"done-gh-act"},zrt={key:0,class:"done-sessions"},jrt={key:2,class:"empty"},Hrt={key:3,class:"show-more-row"},Wrt=["disabled"],qrt={class:"show-more-label"},Urt=["onClick","onContextmenu"],Vrt={class:"ws-dir-row"},Krt=["onKeydown"],Zrt={key:1,class:"ws-dir-name"},Grt={class:"ws-dir-act"},Qrt={class:"ws-dir-sub"},Yrt={key:0,class:"empty"},Jrt={class:"side-footer-account"},Xrt={class:"folder-drop-card"},elt={class:"view-menu-label"},tlt={class:"view-menu-check"},nlt={class:"view-menu-check"},ilt={class:"view-menu-label"},olt={class:"view-menu-check"},slt={class:"view-menu-check"},tR="var(--color-accent)",rlt=!1,llt=rt({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},workspaceSortMode:{default:"manual"},pinnedSessions:{default:()=>[]},flatSessions:{default:()=>[]},flatHasMore:{type:Boolean,default:!1},flatLoadingMore:{type:Boolean,default:!1},doneSessions:{default:()=>[]},doneHasMore:{type:Boolean,default:!1},doneLoadingMore:{type:Boolean,default:!1},initialized:{type:Boolean,default:!1},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","addWorkspacePaths","rename","generateTitle","archive","restore","fork","export","pin","dropPin","unpin","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","ensureFlatSessions","loadMoreFlatSessions","ensureDoneSessions","loadMoreDoneSessions","openSessionAdmin","openSettings","login","collapse"],setup(e,{expose:t,emit:n}){const{t:i}=Ut(),o=e,s=n,r=V(!1),l=d()?["⌘","K"]:["Ctrl","K"],a=d()?["⌃","⇧","O"]:["Ctrl","Shift","O"];function u(){s("loadAllSessions"),r.value=!0}function c(Je){if(nre(Je)){Je.preventDefault(),u();return}!Je.metaKey&&Je.ctrlKey&&Je.shiftKey&&Je.key.toLowerCase()==="o"&&(Je.preventDefault(),s("create"))}kn(()=>window.addEventListener("keydown",c)),Xn(()=>window.removeEventListener("keydown",c));function d(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Je=navigator.userAgentData;return Je?.platform==="macOS"||Je?.platform==="iOS"}const f=V(null),h=V(!1),m=V(!1),{thumb:g,thumbVisible:v,scrolling:y,update:b,markScrolling:w,onThumbPointerDown:C,onListMouseEnter:T,onListMouseLeave:N,onThumbMouseEnter:I,onThumbMouseLeave:S}=YV(f);function _(Je=f.value){Je&&(h.value=Je.scrollTop>0,m.value=Je.scrollTop+Je.clientHeight{ft(()=>{_(),typeof ResizeObserver=="function"&&f.value&&(E=new ResizeObserver(()=>_()),E.observe(f.value))})}),W1(()=>_());const{fontScale:M}=X1();We(M,()=>void ft(()=>_())),Xn(()=>{E?.disconnect(),wi&&clearTimeout(wi),dt&&clearTimeout(dt)});const R=V(new Set(Qle()));function q(Je){return R.value.has(Je)}function z(Je){const Ye=new Set(R.value);Ye.has(Je)?Ye.delete(Je):Ye.add(Je),R.value=Ye,L3(Ye)}function $(){const Je=new Set(o.groups.map(Ye=>Ye.workspace.id));R.value=Je,L3(Je)}function B(){const Je=new Set;R.value=Je,L3(Je)}const P=D(()=>o.groups.length>0&&o.groups.every(Je=>R.value.has(Je.workspace.id))),H=V(new Map);function j(Je){return H.value.get(Je)}function G(Je){const Ye=o.groups.find(Bn=>Bn.workspace.id===Je);if(!Ye)return;const wt=(H.value.get(Je)??Ye.initialCount)+Kx,Bt=new Map(H.value);Bt.set(Je,wt),H.value=Bt,Ye.sessions.lengthBn.workspace.id),Ye,Je,wt);s("reorderWorkspaces",Bt)}const pe=V(null);function Z(Je,Ye){pe.value={id:Je,workspaceId:Ye}}function ae(){pe.value=null}function K(Je){pe.value=null,s("unpin",Je)}const re=V(Jle());function we(Je){re.value!==Je&&(re.value=Je,Xle(Je))}const be=V("open"),{sidebarTabs:ke}=em();We(ke,Je=>{!Je&&be.value!=="open"&&(be.value="open")});const oe=D(()=>mI([...o.pinnedSessions,...o.flatSessions].map(Je=>({busy:Je.busy,unread:o.unreadBySession[Je.id]??!1,questionCount:o.pendingBySession[Je.id]?.questions??0,approvalCount:o.pendingBySession[Je.id]?.approvals??0,pendingInteraction:Je.pendingInteraction,lastTurnReason:Je.lastTurnReason})))),le=D(()=>mI(o.doneSessions.map(Je=>({busy:Je.busy,unread:o.unreadBySession[Je.id]??!1,questionCount:o.pendingBySession[Je.id]?.questions??0,approvalCount:o.pendingBySession[Je.id]?.approvals??0,pendingInteraction:Je.pendingInteraction,lastTurnReason:Je.lastTurnReason})))),ye=D(()=>[{value:"open",label:i("sidebar.tabOpen"),swatch:oe.value===null?void 0:tR},{value:"done",label:i("sidebar.tabDone"),swatch:le.value===null?void 0:tR},{value:"workspaces",label:i("sidebar.tabWorkspaces")}]);function Ae(Je){ke.value&&(be.value=Je,Je==="done"&&s("ensureDoneSessions"))}const Me=D(()=>Doe(o.groups,o.activeWorkspaceId,ke.value)),fe=D(()=>o.groups.map(Je=>({workspace:Je.workspace,sessions:o.doneSessions.filter(Ye=>Ye.workspaceId===Je.workspace.id).map(Ye=>({...Ye,cwdLabel:void 0}))})).filter(Je=>Je.sessions.length>0));We(()=>o.initialized,Je=>{Je&&(s("ensureFlatSessions"),s("ensureDoneSessions"))},{immediate:!0});const ie=V(!1),Ee=V({}),qe=V(null);function ze(Je){const Ye=Je.target;Ye.closest(".view-menu")||Ye.closest(".side-section-view")||gt()}async function ht(Je){if(ie.value){gt();return}const Ye=Je.currentTarget;ie.value=!0,document.addEventListener("mousedown",ze),window.addEventListener("resize",gt),await ft();const wt=qe.value?.el,Bt=Ye.getBoundingClientRect(),Bn=4,ci=8,Ro=wt?.offsetHeight??0,yo=wt?.offsetWidth??0;let ni=Bt.bottom+Bn,Oo=!1;ni+Ro>window.innerHeight-ci&&(ni=Math.max(ci,Bt.top-Ro-Bn),Oo=!0);let gi=Bt.right-yo;gibe.value==="open"&&re.value==="flat"),Ve=V(!1);function lt(Je){!Fe.value||pe.value===null||(Je.preventDefault(),Je.dataTransfer&&(Je.dataTransfer.dropEffect="move"),Ve.value=!0)}function Ft(Je){!Fe.value||pe.value===null||(Je.preventDefault(),Ve.value=!1,K(pe.value.id))}function Lt(Je){Je.currentTarget.contains(Je.relatedTarget)||(Ve.value=!1)}function Vt(Je,Ye){Ye.target.closest(".gh-more, .gh-add")||z(Je)}function qt(Je){s("select",Je)}function nn(Je){s("select",Je),mi(Je)}const it=V(null);let dt=null;const At=D(()=>o.groups.map(Je=>Je.workspace));function un(Je,Ye){const wt=getComputedStyle(Je).getPropertyValue(Ye).trim(),Bt=/^([\d.]+)(ms|s)$/.exec(wt);if(!Bt)return 0;const Bn=Number.parseFloat(Bt[1]);return Bt[2]==="s"?Bn*1e3:Bn}function Qt(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}function ei(Je,Ye){it.value=Je,dt&&clearTimeout(dt),dt=setTimeout(()=>{it.value=null,dt=null},un(Ye,"--duration-flash"))}function mi(Je){const Ye=o.groups.find(wt=>wt.sessions.some(Bt=>Bt.id===Je));if(!Ye){ot.value?.expand(),ft(()=>{const Bt=[...ot.value?.$el?.querySelectorAll("[data-session-id]")??[]].find(Bn=>Bn.dataset.sessionId===Je);Bt?.scrollIntoView({block:"nearest",behavior:Qt()}),Bt&&ei(Je,Bt)});return}be.value!=="open"&&Ae("open"),re.value!=="grouped"&&we("grouped"),q(Ye.workspace.id)&&z(Ye.workspace.id),ft(()=>{const wt=[...f.value?.querySelectorAll("[data-session-id]")??[]].find(Bt=>Bt.dataset.sessionId===Je);wt?.scrollIntoView({block:"start",behavior:Qt()}),wt&&ei(Je,wt)})}const Hi=V(null);let wi=null;function Vo(Je){be.value!=="open"&&Ae("open"),re.value!=="grouped"&&we("grouped"),q(Je)&&z(Je),s("selectWorkspace",Je),ft(()=>{const Ye=[...f.value?.querySelectorAll("[data-ws-id]")??[]].find(wt=>wt.dataset.wsId===Je);Ye?.scrollIntoView({block:"start",behavior:Qt()}),Ye&&(Hi.value=Je,wi&&clearTimeout(wi),wi=setTimeout(()=>{Hi.value=null,wi=null},un(Ye,"--duration-flash")))})}const ot=V(null);function Ue(){be.value!=="open"&&Ae("open"),ot.value?ot.value.expand():Vw(!1)}t({revealPinnedSection:Ue});function st(Je){Ue(),s("pin",Je)}function In(Je){ot.value?.expand(),s("dropPin",Je)}const kt=V(0),ui=V(!1);function _o(){kt.value=0,ui.value=!1}function co(Je){!b2()||!S3(Je)||(Je.preventDefault(),Je.stopPropagation(),kt.value+=1,ui.value=!0)}function Ns(Je){!b2()||!S3(Je)||(Je.preventDefault(),Je.stopPropagation(),Je.dataTransfer&&(Je.dataTransfer.dropEffect="copy"))}function Ds(Je){!b2()||!S3(Je)||(kt.value=Math.max(0,kt.value-1),kt.value===0&&(ui.value=!1))}function Fs(Je){if(_o(),!b2())return;const Ye=Loe(Je);Ye.length!==0&&(Je.preventDefault(),Je.stopPropagation(),s("addWorkspacePaths",Ye))}const Fo=V(null),Ei=V(""),ur=V(""),Mo=V(null);function go(){return Mo}function fo(Je,Ye){Fo.value=Je,ur.value=Ye,Ei.value=Ye,ft().then(()=>Mo.value?.focus())}function Ir(){const Je=Fo.value,Ye=Ei.value.trim();Je&&Ye&&Ye!==ur.value&&s("renameWorkspace",Je,Ye),Fo.value=null}function Bo(){Fo.value=null}function qn(Je){Ei.value=Je}const{handleCompositionStart:to,handleCompositionEnd:fi,isComposingKeyEvent:Zi}=bl();function no(Je){Zi(Je)||Ir()}const Ko=V(!1),ri=V(null),Li=V({}),Mi=V(null);function Ni(Je){Mi.value?.el&&!Mi.value.el.contains(Je.target)&&gs()}function _n(Je,Ye){Ye.preventDefault(),Ye.stopPropagation(),ri.value=Je,Li.value={top:`${Ye.clientY}px`,left:`${Ye.clientX}px`,transformOrigin:"top left","--menu-pop-shift":"-2px"},Ko.value=!0,document.addEventListener("mousedown",Ni,!0)}function gs(){Ko.value=!1,document.removeEventListener("mousedown",Ni,!0),ri.value=null}function qs(){ri.value&&Ls(ri.value.root),gs()}function Xo(){ri.value&&fo(ri.value.id,ri.value.name),gs()}function Us(){const Je=ri.value;Je&&(gs(),s("deleteWorkspace",Je.id))}const vo=V(null),Ji=V(null),Oi=V({}),$i=V(null);function je(Je){const Ye=Je.target;Ye.closest(".gh-more")||Ye.closest(".ws-menu")||Pe()}async function Se(Je,Ye){if(vo.value===Je.id){Pe();return}const wt=Ye.currentTarget;Ji.value=Je,vo.value=Je.id,document.addEventListener("mousedown",je),window.addEventListener("resize",Pe),await ft();const Bt=$i.value?.el,Bn=wt.getBoundingClientRect(),ci=4,Ro=8,yo=Bt?.offsetHeight??0,ni=Bt?.offsetWidth??0;let Oo=Bn.bottom+ci,gi=!1;Oo+yo>window.innerHeight-Ro&&(Oo=Math.max(Ro,Bn.top-yo-ci),gi=!0);let cr=Bn.right-ni;cr{document.removeEventListener("mousedown",Ni,!0),document.removeEventListener("mousedown",je),document.removeEventListener("mousedown",ze),window.removeEventListener("resize",Pe),window.removeEventListener("resize",gt)});const Xi=V(null);let ti;function vs(){const Je=Xi.value;Je&&(Je.classList.remove("blink-now"),Je.getBoundingClientRect(),Je.classList.add("blink-now"),clearTimeout(ti),ti=setTimeout(()=>Je.classList.remove("blink-now"),300))}function ys(){vs()}return(Je,Ye)=>(k(),L("aside",{class:Re(["side",{"macos-desktop":p(Cd),collapsed:e.collapsed,"no-anim":e.dragging}]),style:sn({width:e.collapsed?"0px":e.colWidth+"px"})},[A("div",{class:"col",style:sn({width:e.colWidth+"px"}),onDragenter:co,onDragover:Ns,onDragleave:Ds,onDrop:Fs},[A("div",wrt,[A("div",Crt,[p(Cd)?ee("",!0):(k(),L(De,{key:0},[(k(),L("svg",{ref_key:"logoRef",ref:Xi,class:"ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:ys},[...Ye[58]||(Ye[58]=[Qd('',2)])],512)),Ye[59]||(Ye[59]=A("span",{class:"ch-name"},"Kimi Code",-1))],64))]),A("div",Art,[p(Cd)?ee("",!0):(k(),de(p(an),{key:0,class:"ch-collapse",size:"sm",label:p(i)("sidebar.collapseSidebar"),tooltip:p(i)("sidebar.collapseSidebar"),onClick:Ye[0]||(Ye[0]=Tt(wt=>s("collapse"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"panel-collapse"})]),_:1},8,["label","tooltip"]))])]),U(RZ),A("div",{class:Re(["sidebar-actions",{"sidebar-actions--has-workspace-action":rlt}])},[A("button",{class:"btn-new-chat",type:"button",onClick:Ye[1]||(Ye[1]=Tt(wt=>s("create"),["stop"]))},[U(p(Ce),{name:"chat-new"}),A("span",null,F(p(i)("sidebar.newChat")),1),U(p(gc),{keys:p(a)},null,8,["keys"])]),ee("",!0),A("button",{class:"search",type:"button",onClick:u},[U(p(Ce),{class:"search-icon",name:"search"}),A("span",xrt,F(p(i)("sidebar.search")),1),U(p(gc),{keys:p(l)},null,8,["keys"])])],2),p(ke)?(k(),L("div",Srt,[U(p(Is),{class:"status-seg",size:"sm","model-value":be.value,options:ye.value,"onUpdate:modelValue":Ae},null,8,["model-value","options"])])):ee("",!0),A("div",{class:Re(["sessions-head",{"sessions-head--scrolled":h.value}])},[e.pinnedSessions.length>0&&be.value==="open"?(k(),de(p(uqe),{key:0,ref_key:"pinnedListRef",ref:ot,sessions:e.pinnedSessions,"active-id":e.activeId,"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"state-tag":"open","flash-session-id":it.value,onSelectSession:qt,onRenameSession:Ye[3]||(Ye[3]=(wt,Bt)=>s("rename",wt,Bt)),onGenerateSessionTitle:Ye[4]||(Ye[4]=(wt,Bt)=>s("generateTitle",wt,Bt)),onArchiveSession:Ye[5]||(Ye[5]=wt=>s("archive",wt)),onForkSession:Ye[6]||(Ye[6]=wt=>s("fork",wt)),onExportSession:Ye[7]||(Ye[7]=wt=>s("export",wt)),onPinSession:st,onDropPin:In,onSessionDragStart:Z,onSessionDragEnd:ae},null,8,["sessions","active-id","pending-by-session","unread-by-session","flash-session-id"])):ee("",!0),A("div",_rt,[A("span",Mrt,F(be.value==="workspaces"?p(i)("sidebar.tabWorkspaces"):be.value==="done"?p(i)("sidebar.tabDone"):p(i)("sidebar.sessionsHeader")),1),A("div",Irt,[be.value==="workspaces"?(k(),de(p(Nn),{key:0,text:p(i)("sidebar.newWorkspace")},{default:ue(()=>[U(p(an),{class:"side-section-toggle",size:"sm",label:p(i)("sidebar.newWorkspace"),onClick:Ye[8]||(Ye[8]=Tt(wt=>s("addWorkspace"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"folder-plus"})]),_:1},8,["label"])]),_:1},8,["text"])):ee("",!0),be.value!=="workspaces"&&re.value==="grouped"?(k(),de(p(an),{key:1,class:"side-section-toggle",size:"sm",label:P.value?p(i)("sidebar.expandAll"):p(i)("sidebar.collapseAll"),tooltip:P.value?p(i)("sidebar.expandAll"):p(i)("sidebar.collapseAll"),onClick:Ye[9]||(Ye[9]=Tt(wt=>P.value?B():$(),["stop"]))},{default:ue(()=>[P.value?(k(),de(p(Ce),{key:0,name:"expand"})):(k(),de(p(Ce),{key:1,name:"collapse"}))]),_:1},8,["label","tooltip"])):ee("",!0),be.value!=="workspaces"?(k(),de(p(Nn),{key:2,text:p(i)("sidebar.viewSwitcher")},{default:ue(()=>[U(p(an),{class:"side-section-toggle side-section-view",size:"sm",label:p(i)("sidebar.viewSwitcher"),onClick:Tt(ht,["stop"])},{default:ue(()=>[U(p(Ce),{name:"list-settings"})]),_:1},8,["label"])]),_:1},8,["text"])):ee("",!0)])])],2),A("div",{ref_key:"sessionsEl",ref:f,class:Re(["sessions",{scrolling:p(y),"pinned-drag-active":Fe.value&&pe.value!==null,"flat-pinned-drop-hover":Ve.value}]),onScroll:x,onDragover:lt,onDrop:Ft,onDragleave:Lt,onMouseenter:Ye[39]||(Ye[39]=(...wt)=>p(T)&&p(T)(...wt)),onMouseleave:Ye[40]||(Ye[40]=(...wt)=>p(N)&&p(N)(...wt))},[be.value==="open"?(k(),L(De,{key:0},[re.value==="flat"?(k(),L(De,{key:0},[(k(!0),L(De,null,Ct(e.flatSessions,wt=>(k(),de(p(a0),{key:wt.id,session:wt,active:wt.id===e.activeId,"approval-count":e.pendingBySession[wt.id]?.approvals??0,"question-count":e.pendingBySession[wt.id]?.questions??0,unread:e.unreadBySession[wt.id]??!1,"state-tag":"open",draggable:Ht.value!==wt.id,onDragstart:Bt=>Te(wt.id,Bt),onRenameStateChange:Bt=>Ht.value=Bt?wt.id:null,onSelect:qt,onRename:Ye[10]||(Ye[10]=(Bt,Bn)=>s("rename",Bt,Bn)),onGenerateTitle:Ye[11]||(Ye[11]=(Bt,Bn)=>s("generateTitle",Bt,Bn)),onArchive:Ye[12]||(Ye[12]=Bt=>s("archive",Bt)),onFork:Ye[13]||(Ye[13]=Bt=>s("fork",Bt)),onExport:Ye[14]||(Ye[14]=Bt=>s("export",Bt)),onPin:st},null,8,["session","active","approval-count","question-count","unread","draggable","onDragstart","onRenameStateChange"]))),128)),e.flatSessions.length===0&&!e.flatHasMore&&e.pinnedSessions.length===0?(k(),L("div",Trt,F(p(i)("sidebar.noSessions")),1)):ee("",!0),e.flatHasMore?(k(),L("div",Ert,[A("button",{class:"show-more",disabled:e.flatLoadingMore,onClick:Ye[15]||(Ye[15]=Tt(wt=>s("loadMoreFlatSessions"),["stop"]))},[A("span",Nrt,F(e.flatLoadingMore?p(i)("sidebar.loadingMore"):p(i)("sidebar.loadMore")),1),U(p(Ce),{name:"chevron-down",size:"sm"})],8,Lrt)])):ee("",!0)],64)):(k(),L(De,{key:1},[e.groups.length===0?(k(),L("div",Drt,F(p(i)("workspace.noWorkspace")),1)):Me.value.length===0&&e.pinnedSessions.length===0?(k(),L("div",Frt,F(p(i)("sidebar.noOpenSessions")),1)):(k(!0),L(De,{key:2},Ct(Me.value,wt=>(k(),L("div",{key:wt.workspace.id,class:Re(["ws-drop-target",{"drop-before":Q.value?.id===wt.workspace.id&&Q.value.position==="before","drop-after":Q.value?.id===wt.workspace.id&&Q.value.position==="after","ws-locate-flash":Hi.value===wt.workspace.id}]),"data-ws-id":wt.workspace.id,onDragover:Bt=>ce(Bt,wt.workspace.id),onDrop:Bt=>se(wt.workspace.id)},[U(p(Eqe),{group:wt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":Fo.value,"rename-value":Ei.value,"rename-input-ref":go(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":vo.value,dragging:W.value===wt.workspace.id,sortable:e.workspaceSortMode==="manual","is-collapsed":q,"visible-limit":j,"flash-session-id":it.value,"pinned-drag-session":pe.value,"state-tag":"open",onGroupClick:Vt,onGroupContextmenu:_n,onToggleWsMenu:Se,onCreateInWorkspace:Ye[16]||(Ye[16]=Bt=>s("createInWorkspace",Bt)),onSelectSession:qt,onRenameSession:Ye[17]||(Ye[17]=(Bt,Bn)=>s("rename",Bt,Bn)),onGenerateSessionTitle:Ye[18]||(Ye[18]=(Bt,Bn)=>s("generateTitle",Bt,Bn)),onArchiveSession:Ye[19]||(Ye[19]=Bt=>s("archive",Bt)),onForkSession:Ye[20]||(Ye[20]=Bt=>s("fork",Bt)),onExportSession:Ye[21]||(Ye[21]=Bt=>s("export",Bt)),onPinSession:st,onDropPinnedSession:K,onExpand:G,onCollapse:ne,onConfirmRename:Ir,onCancelRename:Bo,onUpdateRenameValue:qn,onWsDragstart:te,onWsDragend:X},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","sortable","flash-session-id","pinned-drag-session"])],42,Brt))),128))],64))],64)):be.value==="done"?(k(),L(De,{key:1},[re.value==="flat"?(k(!0),L(De,{key:0},Ct(e.doneSessions,wt=>(k(),de(p(a0),{key:wt.id,session:wt,active:wt.id===e.activeId,"approval-count":e.pendingBySession[wt.id]?.approvals??0,"question-count":e.pendingBySession[wt.id]?.questions??0,unread:e.unreadBySession[wt.id]??!1,"state-tag":"done",onSelect:qt,onRename:Ye[22]||(Ye[22]=(Bt,Bn)=>s("rename",Bt,Bn)),onGenerateTitle:Ye[23]||(Ye[23]=(Bt,Bn)=>s("generateTitle",Bt,Bn)),onRestore:Ye[24]||(Ye[24]=Bt=>s("restore",Bt)),onFork:Ye[25]||(Ye[25]=Bt=>s("fork",Bt)),onExport:Ye[26]||(Ye[26]=Bt=>s("export",Bt))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(k(!0),L(De,{key:1},Ct(fe.value,wt=>(k(),L("div",{key:wt.workspace.id,class:"done-group"},[A("div",{class:"done-gh",onClick:Bt=>z(wt.workspace.id),onContextmenu:Bt=>_n(wt.workspace,Bt)},[q(wt.workspace.id)?(k(),de(p(Ce),{key:0,class:"done-gh-folder",name:"folder-closed"})):(k(),de(p(Ce),{key:1,class:"done-gh-folder",name:"folder"})),A("span",Ort,F(wt.workspace.name),1),A("span",$rt,F(wt.sessions.length),1),A("span",Prt,[U(p(an),{class:Re(["gh-more",{open:vo.value===wt.workspace.id}]),size:"sm",label:p(i)("sidebar.options"),tooltip:p(i)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":vo.value===wt.workspace.id,onClick:Tt(Bt=>Se(wt.workspace,Bt),["stop"])},{default:ue(()=>[U(p(Ce),{name:"dots-horizontal"})]),_:1},8,["class","label","tooltip","aria-expanded","onClick"])])],40,Rrt),q(wt.workspace.id)?ee("",!0):(k(),L("div",zrt,[(k(!0),L(De,null,Ct(wt.sessions,Bt=>(k(),de(p(a0),{key:Bt.id,session:Bt,active:Bt.id===e.activeId,"approval-count":e.pendingBySession[Bt.id]?.approvals??0,"question-count":e.pendingBySession[Bt.id]?.questions??0,unread:e.unreadBySession[Bt.id]??!1,"state-tag":"done",onSelect:qt,onRename:Ye[27]||(Ye[27]=(Bn,ci)=>s("rename",Bn,ci)),onGenerateTitle:Ye[28]||(Ye[28]=(Bn,ci)=>s("generateTitle",Bn,ci)),onRestore:Ye[29]||(Ye[29]=Bn=>s("restore",Bn)),onFork:Ye[30]||(Ye[30]=Bn=>s("fork",Bn)),onExport:Ye[31]||(Ye[31]=Bn=>s("export",Bn))},null,8,["session","active","approval-count","question-count","unread"]))),128))]))]))),128)),e.doneSessions.length===0&&!e.doneHasMore?(k(),L("div",jrt,F(p(i)("sidebar.noDoneSessions")),1)):ee("",!0),e.doneHasMore?(k(),L("div",Hrt,[A("button",{class:"show-more",disabled:e.doneLoadingMore,onClick:Ye[32]||(Ye[32]=Tt(wt=>s("loadMoreDoneSessions"),["stop"]))},[A("span",qrt,F(e.doneLoadingMore?p(i)("sidebar.loadingMore"):p(i)("sidebar.loadMore")),1),U(p(Ce),{name:"chevron-down",size:"sm"})],8,Wrt)])):ee("",!0)],64)):(k(),L(De,{key:2},[(k(!0),L(De,null,Ct(e.groups,wt=>(k(),L("div",{key:wt.workspace.id,class:Re(["ws-dir",{on:wt.workspace.id===e.activeWorkspaceId}]),onClick:Bt=>s("createInWorkspace",wt.workspace.id),onContextmenu:Bt=>_n(wt.workspace,Bt)},[A("div",Vrt,[U(p(Ce),{class:"ws-dir-icon",name:"folder-closed"}),Fo.value===wt.workspace.id?ai((k(),L("input",{key:0,ref_for:!0,ref:Bt=>Mo.value=Bt,"onUpdate:modelValue":Ye[33]||(Ye[33]=Bt=>Ei.value=Bt),class:"ws-dir-rename",type:"text",onKeydown:[Yo(Tt(no,["stop"]),["enter"]),Ye[34]||(Ye[34]=Yo(Tt(Bt=>Bo(),["stop"]),["esc"]))],onCompositionstart:Ye[35]||(Ye[35]=(...Bt)=>p(to)&&p(to)(...Bt)),onCompositionend:Ye[36]||(Ye[36]=(...Bt)=>p(fi)&&p(fi)(...Bt)),onBlur:Ye[37]||(Ye[37]=Bt=>Bo()),onClick:Ye[38]||(Ye[38]=Tt(()=>{},["stop"]))},null,40,Krt)),[[ar,Ei.value]]):(k(),L("span",Zrt,F(wt.workspace.name),1)),A("span",Grt,[Fo.value!==wt.workspace.id?(k(),de(p(an),{key:0,class:Re(["gh-more",{open:vo.value===wt.workspace.id}]),size:"sm",label:p(i)("sidebar.options"),tooltip:p(i)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":vo.value===wt.workspace.id,onClick:Tt(Bt=>Se(wt.workspace,Bt),["stop"])},{default:ue(()=>[U(p(Ce),{name:"dots-horizontal"})]),_:1},8,["class","label","tooltip","aria-expanded","onClick"])):ee("",!0)])]),A("div",Qrt,F(wt.workspace.root),1)],42,Urt))),128)),e.groups.length===0?(k(),L("div",Yrt,F(p(i)("workspace.noWorkspace")),1)):ee("",!0)],64))],34),p(g)?(k(),L("div",{key:1,class:Re(["sessions-thumb",{visible:p(v)}]),style:sn({top:`${p(g).top}px`,height:`${p(g).height}px`}),"aria-hidden":"true",onPointerdown:Ye[41]||(Ye[41]=(...wt)=>p(C)&&p(C)(...wt)),onMouseenter:Ye[42]||(Ye[42]=(...wt)=>p(I)&&p(I)(...wt)),onMouseleave:Ye[43]||(Ye[43]=(...wt)=>p(S)&&p(S)(...wt))},null,38)):ee("",!0),A("div",{class:Re(["side-footer",{"side-footer--shadowed":m.value}])},[A("div",Jrt,[U(brt,{onLogin:Ye[44]||(Ye[44]=wt=>s("login")),onOpenSettings:Ye[45]||(Ye[45]=wt=>s("openSettings"))})]),U(p(an),{class:"side-footer-settings",size:"sm",label:p(i)("settings.title"),tooltip:p(i)("settings.title"),onClick:Ye[46]||(Ye[46]=Tt(wt=>s("openSettings"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"settings"})]),_:1},8,["label","tooltip"])],2),A("div",{class:Re(["folder-drop-overlay",{show:ui.value}]),"aria-hidden":"true"},[A("div",Xrt,[U(p(Ce),{name:"folder",size:"lg"}),A("span",null,F(p(i)("sidebar.dropToAddWorkspace")),1)])],2)],36),U(mo,{name:"menu-pop"},{default:ue(()=>[Ko.value?(k(),de(p(Hs),{key:0,ref_key:"ghMenuRef",ref:Mi,class:"gh-menu",style:sn(Li.value),onClick:Ye[47]||(Ye[47]=Tt(()=>{},["stop"]))},{default:ue(()=>[U(p(tn),{onClick:qs},{default:ue(()=>[U(p(Ce),{name:"copy",size:"sm"}),Oe(" "+F(p(i)("sidebar.copyPath")),1)]),_:1}),U(p(tn),{class:"workspace-rename-item",onClick:Xo},{default:ue(()=>[U(p(Ce),{name:"pencil",size:"sm"}),Oe(" "+F(p(i)("sidebar.rename")),1)]),_:1}),U(p(tn),{danger:"",onClick:Us},{default:ue(()=>[U(p(Ce),{name:"close",size:"sm"}),Oe(" "+F(p(i)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),U(mo,{name:"menu-pop"},{default:ue(()=>[vo.value!==null&&Ji.value?(k(),de(p(Hs),{key:0,ref_key:"wsMenuRef",ref:$i,class:"ws-menu",style:sn(Oi.value),onClick:Ye[51]||(Ye[51]=Tt(()=>{},["stop"]))},{default:ue(()=>[U(p(tn),{onClick:Ye[48]||(Ye[48]=wt=>on(Ji.value))},{default:ue(()=>[U(p(Ce),{name:"copy",size:"sm"}),Oe(" "+F(p(i)("sidebar.copyPath")),1)]),_:1}),U(p(tn),{class:"workspace-rename-item",onClick:Ye[49]||(Ye[49]=wt=>Zn(Ji.value))},{default:ue(()=>[U(p(Ce),{name:"pencil",size:"sm"}),Oe(" "+F(p(i)("sidebar.rename")),1)]),_:1}),U(p(tn),{danger:"",onClick:Ye[50]||(Ye[50]=wt=>Gn(Ji.value))},{default:ue(()=>[U(p(Ce),{name:"close",size:"sm"}),Oe(" "+F(p(i)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ee("",!0)]),_:1}),U(mo,{name:"menu-pop"},{default:ue(()=>[ie.value?(k(),de(p(Hs),{key:0,ref_key:"viewMenuRef",ref:qe,class:"view-menu",style:sn(Ee.value),onClick:Ye[56]||(Ye[56]=Tt(()=>{},["stop"]))},{default:ue(()=>[A("div",elt,F(p(i)("sidebar.viewGroup")),1),U(p(tn),{onClick:Ye[52]||(Ye[52]=wt=>_t("flat"))},{default:ue(()=>[U(p(Ce),{name:"list",size:"sm"}),Oe(" "+F(p(i)("sidebar.viewFlat"))+" ",1),A("span",tlt,[re.value==="flat"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1}),U(p(tn),{onClick:Ye[53]||(Ye[53]=wt=>_t("grouped"))},{default:ue(()=>[U(p(Ce),{name:"tree-view",size:"sm"}),Oe(" "+F(p(i)("sidebar.viewGrouped"))+" ",1),A("span",nlt,[re.value==="grouped"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1}),re.value==="grouped"?(k(),L(De,{key:0},[A("div",ilt,F(p(i)("sidebar.sortGroup")),1),U(p(tn),{onClick:Ye[54]||(Ye[54]=wt=>$t("manual"))},{default:ue(()=>[U(p(Ce),{name:"grip",size:"sm"}),Oe(" "+F(p(i)("sidebar.sortManual"))+" ",1),A("span",olt,[e.workspaceSortMode==="manual"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1}),U(p(tn),{onClick:Ye[55]||(Ye[55]=wt=>$t("recent"))},{default:ue(()=>[U(p(Ce),{name:"clock",size:"sm"}),Oe(" "+F(p(i)("sidebar.sortRecent"))+" ",1),A("span",slt,[e.workspaceSortMode==="recent"?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])]),_:1})],64)):ee("",!0),p(ke)?(k(),L(De,{key:1},[U(p(tn),{separator:""}),U(p(tn),{onClick:jt},{default:ue(()=>[U(p(Ce),{name:"session-admin",size:"sm"}),Oe(" "+F(p(i)("sidebar.sessionAdmin")),1)]),_:1})],64)):ee("",!0)]),_:1},8,["style"])):ee("",!0)]),_:1}),r.value?(k(),de(p(eit),{key:0,sessions:e.sessions,workspaces:At.value,"active-id":e.activeId,onSelect:nn,onSelectWorkspace:Vo,onClose:Ye[57]||(Ye[57]=wt=>r.value=!1)},null,8,["sessions","workspaces","active-id"])):ee("",!0),(k(),de(us,{to:"body"}))],6))}}),alt=St(llt,[["__scopeId","data-v-a5d7cf12"]]),ult={class:"ch-id"},clt=["title"],dlt={key:1,class:"ch-ws"},flt={key:2,class:"ch-sep"},hlt=["onKeydown"],plt={class:"ch-ses"},mlt={key:0,class:"ch-pill ch-sync-pill"},glt={key:0,class:"ch-ahead"},vlt={key:1,class:"ch-behind"},ylt={key:1,class:"ch-pill ch-diff-pill"},klt={key:0,class:"ch-add"},blt={key:1,class:"ch-del"},wlt={class:"ch-pill ch-pr pr-merged ch-done-pill"},Clt=rt({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean},archived:{type:Boolean},pinned:{type:Boolean}},emits:["copyAll","copyFinalSummary","openPr","renameSession","forkSession","togglePin","archiveSession","restoreSession","exportSession"],setup(e,{emit:t}){const{t:n}=Ut(),{sidebarTabs:i}=em(),o=e,s=t,r=Yt(Uo),l=D(()=>r?.isVisible()??!1);async function a(){r?.togglePanel(),await ft(),document.querySelector(".ptb-hide")?.focus()}const u=D(()=>o.ahead??0),c=D(()=>o.behind??0),d=D(()=>o.gitDiffStats?.totalAdditions??0),f=D(()=>o.gitDiffStats?.totalDeletions??0),h=D(()=>d.value>0||f.value>0),m={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function g(Z){return Z.trim().toLowerCase().replaceAll("_","-")}function v(Z){const ae=g(Z);return m[ae]?`pr-${ae}`:"pr-unknown"}function y(Z){return n(m[g(Z)]??"header.prStatusUnknown")}const b=V(!1),w=V(null),C=V(null),T=V({});function N(Z){const ae=Z.target;C.value?.el?.contains(ae)||w.value?.el?.contains(ae)||_()}function I(){_()}async function S(Z){if(Z.stopPropagation(),b.value){_();return}b.value=!0,document.addEventListener("mousedown",N),window.addEventListener("resize",I),await ft();const ae=w.value?.el,K=C.value?.el;if(!ae||!K)return;const re=ae.getBoundingClientRect(),we=4,be=8,ke=K.offsetWidth,oe=K.offsetHeight;let le=re.bottom+we,ye=!1;le+oe>window.innerHeight-be&&(le=Math.max(be,re.top-oe-we),ye=!0);let Ae=re.left,Me=!1;Ae+ke>window.innerWidth-be&&(Ae=Math.max(be,re.right-ke),Me=!0),T.value={top:`${Math.round(le)}px`,left:`${Math.round(Ae)}px`,transformOrigin:`${ye?"bottom":"top"} ${Me?"right":"left"}`,"--menu-pop-shift":ye?"2px":"-2px"}}function _(){b.value=!1,document.removeEventListener("mousedown",N),window.removeEventListener("resize",I)}Ln(()=>{document.removeEventListener("mousedown",N),window.removeEventListener("resize",I)});function x(){s("copyAll"),_()}function E(){s("copyFinalSummary"),_()}const M=V(!1);function R(){o.sessionId&&Ls(o.sessionId).then(Z=>{Z&&(M.value=!0,setTimeout(()=>{M.value=!1},1200))})}const q=V(!1),z=V(""),$=V(null),{handleCompositionStart:B,handleCompositionEnd:P,isComposingKeyEvent:H}=bl();async function j(){if(_(),!!o.sessionId){q.value=!0,z.value=o.sessionTitle??"",await ft();try{$.value?.focus(),$.value?.select()}catch{}}}function G(){const Z=z.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,Z),q.value=!1}function ne(Z){H(Z)||G()}function W(){q.value=!1}function Q(){o.sessionId&&(o.pinned,_(),s("togglePin",o.sessionId))}function te(){o.sessionId&&(_(),s("forkSession",o.sessionId))}function X(){o.sessionId&&(_(),s("exportSession",o.sessionId))}function ve(){o.sessionId&&(_(),s("archiveSession",o.sessionId))}function ce(){o.sessionId&&(_(),s("restoreSession",o.sessionId))}function se(){r?.openDiff()}const pe=!1;return(Z,ae)=>(k(),L("header",{class:Re(["chat-header",{"macos-desktop":p(Cd)}])},[A("div",ult,[p(pe)?(k(),L("span",{key:0,class:"ch-dev",title:p(n)("header.devBadge")},"DEV",8,clt)):ee("",!0),e.workspaceName?(k(),L("span",dlt,F(e.workspaceName),1)):ee("",!0),e.workspaceName&&e.sessionTitle?(k(),L("span",flt,"/")):ee("",!0),q.value?ai((k(),L("input",{key:3,ref_key:"renameInputRef",ref:$,"onUpdate:modelValue":ae[0]||(ae[0]=K=>z.value=K),class:"ch-rename",type:"text",onKeydown:[Yo(Tt(ne,["stop"]),["enter"]),Yo(Tt(W,["stop"]),["esc"])],onCompositionstart:ae[1]||(ae[1]=(...K)=>p(B)&&p(B)(...K)),onCompositionend:ae[2]||(ae[2]=(...K)=>p(P)&&p(P)(...K)),onBlur:G,onClick:ae[3]||(ae[3]=Tt(()=>{},["stop"]))},null,40,hlt)),[[ar,z.value]]):e.sessionTitle?(k(),de(p(Nn),{key:4,text:e.sessionTitle},{default:ue(()=>[A("span",plt,F(e.sessionTitle),1)]),_:1},8,["text"])):ee("",!0)]),U(p(an),{ref_key:"kebabRef",ref:w,class:Re(["ch-act-more",{open:b.value}]),label:p(n)("header.options"),tooltip:p(n)("header.options"),"aria-expanded":b.value,"aria-haspopup":"menu",onClick:ae[4]||(ae[4]=Tt(K=>S(K),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","tooltip","aria-expanded"]),U(mo,{name:"menu-pop"},{default:ue(()=>[b.value?(k(),de(p(Hs),{key:0,ref_key:"menuRef",ref:C,class:"ch-menu",style:sn(T.value),onClick:ae[5]||(ae[5]=Tt(()=>{},["stop"]))},{default:ue(()=>[U(p(tn),{onClick:x},{default:ue(()=>[U(p(Ce),{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Oe(" "+F(e.copied?p(n)("header.copied"):p(n)("header.copyAll")),1)]),_:1}),U(p(tn),{onClick:E},{default:ue(()=>[U(p(Ce),{name:"file-text",size:"sm"}),Oe(" "+F(p(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(k(),L(De,{key:0},[U(p(tn),{separator:""}),U(p(tn),{onClick:R},{default:ue(()=>[U(p(Ce),{name:M.value?"check":"copy",size:"sm"},null,8,["name"]),Oe(" "+F(M.value?p(n)("header.copied"):p(n)("header.copySessionId")),1)]),_:1}),e.archived?ee("",!0):(k(),de(p(tn),{key:0,onClick:Q},{default:ue(()=>[U(p(Ce),{name:e.pinned?"unpin":"pin",size:"sm"},null,8,["name"]),Oe(" "+F(e.pinned?p(n)("header.unpinSession"):p(n)("header.pinSession")),1)]),_:1})),U(p(tn),{onClick:j},{default:ue(()=>[U(p(Ce),{name:"pencil",size:"sm"}),Oe(" "+F(p(n)("header.renameSession")),1)]),_:1}),U(p(tn),{onClick:te},{default:ue(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),Oe(" "+F(p(n)("header.forkSession")),1)]),_:1}),U(p(tn),{onClick:X},{default:ue(()=>[U(p(Ce),{name:"download",size:"sm"}),Oe(" "+F(p(n)("header.exportSession")),1)]),_:1}),e.archived&&p(i)?(k(),de(p(tn),{key:1,onClick:ce},{default:ue(()=>[U(p(Ce),{name:"undo",size:"sm"}),Oe(" "+F(p(n)("header.reopenSession")),1)]),_:1})):ee("",!0),e.archived?ee("",!0):(k(),de(p(tn),{key:2,onClick:ve},{default:ue(()=>[U(p(Ce),{name:p(i)?"state-done":"archive",size:"sm"},null,8,["name"]),Oe(" "+F(p(i)?p(n)("header.markSessionDone"):p(n)("header.archiveSession")),1)]),_:1}))],64)):ee("",!0)]),_:1},8,["style"])):ee("",!0)]),_:1}),ae[7]||(ae[7]=A("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(k(),L("button",{key:0,type:"button",class:"ch-git",onClick:se},[U(p(Ce),{class:"ch-branch-icon",name:"git-fork",size:"sm"}),A("span",{class:Re(["ch-branch",{"ch-detached":!e.branch}])},F(e.branch||p(n)("header.detached")),3),u.value>0||c.value>0?(k(),L("span",mlt,[u.value>0?(k(),L("span",glt,"↑"+F(u.value),1)):ee("",!0),c.value>0?(k(),L("span",vlt,"↓"+F(c.value),1)):ee("",!0)])):ee("",!0),h.value?(k(),L("span",ylt,[d.value>0?(k(),L("span",klt,"+"+F(d.value),1)):ee("",!0),f.value>0?(k(),L("span",blt,"-"+F(f.value),1)):ee("",!0)])):ee("",!0)])):ee("",!0),e.pr?(k(),L("button",{key:1,type:"button",class:Re(["ch-pill ch-pr",v(e.pr.state)]),onClick:ae[6]||(ae[6]=K=>e.pr&&s("openPr",e.pr.url))},[U(p(Ce),{name:"git-pull-request",size:"sm"}),A("span",null,"PR #"+F(e.pr.number)+" · "+F(y(e.pr.state)),1)],2)):ee("",!0),e.sessionId&&e.archived&&p(i)?(k(),L(De,{key:2},[A("span",wlt,[U(p(Ce),{name:"state-done",size:"sm"}),A("span",null,F(p(n)("header.sessionDone")),1)]),U(p(rn),{variant:"secondary",size:"sm",onClick:ce},{default:ue(()=>[U(p(Ce),{name:"undo",size:"sm"}),Oe(" "+F(p(n)("header.reopenSession")),1)]),_:1})],64)):ee("",!0),p(r)&&!l.value?(k(),de(p(an),{key:3,class:"ch-panel",label:p(n)("panel.openPanel"),tooltip:p(n)("panel.openPanel"),onClick:a},{default:ue(()=>[U(p(Ce),{name:"panel-expand-right",size:"sm"})]),_:1},8,["label","tooltip"])):ee("",!0)],2))}}),Alt=St(Clt,[["__scopeId","data-v-927e8637"]]),xlt=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],nR=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function Slt(e){if(e<=255)return xlt[e];let t=0,n=nR.length-1;for(;t<=n;){const i=t+n>>1,o=nR[i];if(eo[1]){t=i+1;continue}return o[2]}return"L"}function _lt(e){const t=e.length;if(t===0)return null;const n=new Array(t);let i=!1;for(let u=0;u=55296&&c<=56319&&u+1=56320&&m<=57343&&(d=(c-55296<<10)+(m-56320)+65536,f=2)}const h=Slt(d);(h==="R"||h==="AL"||h==="AN")&&(i=!0);for(let m=0;m=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c0?n[u-1]:l,f=c0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Nlt(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,` `).replace(/[\r\f]/g,` -`):e}let N5=null,Rlt;function $lt(){return N5===null&&(N5=new Intl.Segmenter(Rlt,{granularity:"word"})),N5}const Olt=/\p{Script=Arabic}/u,ff=/\p{M}/u,wS=/\p{Nd}/u;function nR(e){return Olt.test(e)}function iR(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Ou(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){const o=(n-55296<<10)+(i-56320)+65536;if(iR(o))return!0;t++;continue}}if(iR(n))return!0}}return!1}function Plt(e){const t=zv(e);return t!==null&&(CS.has(t)||jh.has(t))}const zlt=new Set([" "," ","⁠","\uFEFF"]),jlt=new Set(["-","‐","–","—"]);function Hlt(e){const t=zv(e);return t!==null&&zlt.has(t)}function Wlt(e){const t=zv(e);return t!==null&&jlt.has(t)}function $Z(e,t){return Hlt(e)?!1:t?!(Plt(e)||Wlt(e)):!0}const CS=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),vb=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),AS=new Set(["'","’"]),jh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),qlt=new Set([":",".","،","؛"]),Ult=new Set(["၏"]),Vlt=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Klt(e){if(xS(e))return!0;let t=!1;for(const n of e){if(jh.has(n)||kb(n)){t=!0;continue}if(!(t&&ff.test(n)))return!1}return t}function Zlt(e){for(const t of e)if(!CS.has(t)&&!jh.has(t))return!1;return e.length>0}function Glt(e){if(xS(e))return!0;for(const t of e)if(!vb.has(t)&&!AS.has(t)&&!ff.test(t)&&!kb(t))return!1;return e.length>0}function xS(e){let t=!1;for(const n of e)if(!(n==="\\"||ff.test(n))){if(vb.has(n)||jh.has(n)||AS.has(n)){t=!0;continue}return!1}return t}function yb(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function zv(e){if(e.length===0)return null;const t=yb(e,e.length);return e.slice(t)}function Qlt(e){for(const t of e)if(!ff.test(t))return t;return null}function Ylt(e){for(let t=e.length;t>0;){const n=yb(e,t),i=e.slice(n,t);if(!ff.test(i))return i;t=n}return null}const Jlt=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Xlt(e,t){for(let n=0;n=t[n]&&e<=t[n+1])return!0;return!1}function kb(e){const t=e.codePointAt(0);return t!==void 0&&Xlt(t,Jlt)}function eat(e){const t=Ylt(e);return t!==null&&kb(t)}function tat(e){const t=Qlt(e);return t!==null&&wS.test(t)}function nat(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(ff.test(i)){n--;continue}if(vb.has(i)||AS.has(i)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function iat(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function oR(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function sR(e,t){return e&&t!==null&&qlt.has(t)}function oat(e){const t=zv(e);return t!==null&&Ult.has(t)}function sat(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function QA(e){let t=e.length;for(;t>0;){const n=yb(e,t),i=e.slice(n,t);if(Vlt.has(i))return!0;if(!jh.has(i))return!1;t=n}return!1}function rat(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const lat=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Wa(e){return e.length===1?e[0]:e.join("")}function aat(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Wa(n)}function uat(e,t,n,i){if(!lat.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=rat(c,i),f=d==="text"&&t;if(s!==null&&d===s&&f===a){r.push(c),u+=c.length;continue}s!==null&&o.push({text:Wa(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length}return s!==null&&o.push({text:Wa(r),isWordLike:a,kind:s,start:l}),o}function YA(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const cat=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function dat(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:cat.test(n)&&t+1=e.len||YA(e.kinds[l]))continue;const a=[],u=e.starts[l];let c=l;for(;c0&&(t.push(Wa(a)),n.push(!0),i.push("text"),o.push(u),s=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:o}}const mat=new Set([":","-","/","×",",",".","+","–","—"]),gat=/[\p{P}\p{S}\p{Co}]/u,vat=/\p{Emoji_Presentation}/u,yat=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function kat(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function OZ(e){const t=e.charCodeAt(0);return t<128?kat(t):!yat.has(e)&&!vat.test(e)&&gat.test(e)}function rR(e){let t=!1;for(const n of e)if(!ff.test(n)){if(!OZ(n))return!1;t=!0}return t}function bat(e){for(let t=e.length;t>0;){const n=yb(e,t),i=e.slice(n,t);if(ff.test(i)){t=n;continue}return OZ(i)||kb(i)}return!1}function wat(e,t,n,i){const o=!t&&rR(e),s=!i&&rR(n),r=eat(e),l=(t||r)&&bat(e);return!o&&!s&&!l||Ou(e)||Ou(n)?!1:(t||o||r)&&(i||s)}function PZ(e){for(const t of e)if(wS.test(t))return!0;return!1}function Z4(e){if(e.length===0)return!1;for(const t of e)if(!(wS.test(t)||mat.has(t)))return!1;return!0}function Cat(e){const t=[],n=[],i=[],o=[];for(let s=0;ss+1){t.push(Wa(u)),n.push(d),i.push("text"),o.push(e.starts[s]),s=c;continue}}t.push(r),n.push(a),i.push(l),o.push(e.starts[s]),s++}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:o}}function xat(e){const t=[],n=[],i=[],o=[];for(let s=0;s1;for(let u=0;u0&&a[z]==="text"&&x&&f[z]&&m[z]||S&&o>0&&a[z]==="text"&&Zlt(I.text)&&f[z]||S&&o>0&&a[z]==="text"&&g[z]?O():S&&o>0&&a[z]==="text"&&I.isWordLike&&E&&v[z]?(O(),l[z]=!0):_!==null&&o>0&&a[z]==="text"&&c[z]===_?d[z]=(d[z]??1)+1:S&&!I.isWordLike&&o>0&&a[z]==="text"&&!f[z]&&(Klt(I.text)||I.text==="-"&&l[z])?O():(s[o]=I.text,r[o]=[I.text],l[o]=I.isWordLike,a[o]=I.kind,u[o]=I.start,c[o]=_,d[o]=_===null?0:1,f[o]=x,h[o]=E,m[o]=R,g[o]=q,v[o]=sR(E,M),o++)}for(let N=0;Nnull);let b=-1;for(let N=o-1;N>=0;N--){const I=s[N];if(I.length!==0){if(a[N]==="text"&&!l[N]&&b>=0&&a[b]==="text"&&(Glt(I)||I==="-"&&tat(s[b]))){const S=y[b]??[];S.push(I),y[b]=S,u[b]=u[N],s[N]="";continue}b=N}}for(let N=0;N=0&&!$Z(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||Ou(h);continue}d(f),i.push(h),o.push(t.isWordLike[f]),s.push(m),r.push(t.starts[f])}return d(t.len),{len:i.length,texts:i,isWordLike:o,kinds:s,starts:r}}function Eat(e,t,n="normal",i="normal"){const o=Dlt(n),s=o.mode==="pre-wrap"?Blt(e):Flt(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=Mat(s,t,o),l=i==="keep-all"?Tat(s,r,t.breakKeepAllAfterPunctuation):r;return{normalized:s,chunks:Iat(l,o),...l}}let Cp=null;const lR=new Map;let Ap=null;const Lat=96,Nat=/\p{Emoji_Presentation}/u,Dat=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let D5=null;const aR=new Map;function SS(){if(Cp!==null)return Cp;if(typeof OffscreenCanvas<"u")return Cp=new OffscreenCanvas(1,1).getContext("2d"),Cp;if(typeof document<"u")return Cp=document.createElement("canvas").getContext("2d"),Cp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Fat(e){let t=lR.get(e);return t||(t=new Map,lR.set(e,t)),t}function bd(e,t){let n=t.get(e);return n===void 0&&(n={width:SS().measureText(e).width,containsCJK:Ou(e)},t.set(e,n)),n}function bb(){if(Ap!==null)return Ap;if(typeof navigator>"u")return Ap={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ap;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),i=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Ap={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Ap}function Bat(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function zZ(){return D5===null&&(D5=new Intl.Segmenter(void 0,{granularity:"grapheme"})),D5}function Rat(e){return Nat.test(e)||e.includes("️")}function $at(e){return Dat.test(e)}function Oat(e,t){let n=aR.get(e);if(n!==void 0)return n;const i=SS();i.font=e;const o=i.measureText("😀").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){const s=document.createElement("span");s.style.font=e,s.style.display="inline-block",s.style.visibility="hidden",s.style.position="absolute",s.textContent="😀",document.body.appendChild(s);const r=s.getBoundingClientRect().width;document.body.removeChild(s),o-r>.5&&(n=o-r)}return aR.set(e,n),n}function Pat(e){let t=0;const n=zZ();for(const i of n.segment(e))Rat(i.segment)&&t++;return t}function zat(e,t){return t.emojiCount===void 0&&(t.emojiCount=Pat(e)),t.emojiCount}function lh(e,t,n){return n===0?t.width:t.width-zat(e,t)*n}function jat(e,t,n,i,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const s=zZ(),r=[];for(const c of s.segment(e))r.push(c.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){const c=[];for(const d of r){const f=bd(d,n);c.push(lh(d,f,i))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(o==="pair-context"||r.length>Lat){const c=[];let d=null,f=0;for(const h of r){const m=bd(h,n),g=lh(h,m,i);if(d===null)c.push(g);else{const v=d+h,y=bd(v,n);c.push(lh(v,y,i)-f)}d=h,f=g}return t.breakableFitAdvances=c,t.breakableFitAdvances}const l=[];let a="",u=0;for(const c of r){a+=c;const d=bd(a,n),f=lh(a,d,i);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Hat(e,t){const n=SS();n.font=e;const i=Fat(e),o=Bat(e),s=t?Oat(e,o):0;return{cache:i,fontSize:o,emojiCorrection:s}}function Wat(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function jZ(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function HZ(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function _S(e,t){return t===0?0:e+t}function Vat(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Kat(e,t,n,i,o){const s=t==="tab"?o+Vat(e,n):e.lineEndFitAdvances[n];return _S(i,s)}function uR(e,t,n,i){const o=t==="tab"?0:e.lineEndFitAdvances[n];return _S(i,o)}function cR(e,t,n,i,o){const s=t==="tab"?o:e.lineEndPaintAdvances[n];return _S(i,s)}function Zat(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Gat(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function G4(e,t,n){let i=t;for(;i0)return e.spacingGraphemeCounts[i]>0?e.letterSpacing:0;for(let s=i-1;s>=t;s--){const r=e.kinds[s];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(s===i-1)return 0;continue}return s===t&&n>0||e.spacingGraphemeCounts[s]>0?e.letterSpacing:0}}return 0}function Yat(e,t,n,i,o,s){return t+Qat(e,n,i,o,s)}function Jat(e,t,n){const{widths:i,kinds:o,breakableFitAdvances:s,breakablePreferredBreaks:r}=e;if(i.length===0)return 0;const a=bb().lineFitEpsilon,u=t+a;let c=0,d=0,f=!1,h=0,m=0,g=0,v=0,y=-1,b=0;function w(){y=-1,b=0}function C(x=g,E=v,M=d){c++,n?.(M,h,m,x,E),d=0,f=!1,w()}function T(x,E){f=!0,h=x,m=0,g=x+1,v=0,d=E}function N(x,E,M){f=!0,h=x,m=E,g=x,v=E+1,d=M}function I(x,E){if(!f){T(x,E);return}d+=E,g=x+1,v=0}function S(x,E){const M=s[x],R=r[x]??null;let q=R===null?-1:G4(R,0,E+1),z=-1,O=0,B=E;for(;Bu){if(R!==null&&z>E){C(x,z,O),B=z,q=G4(R,q,B+1),z=-1,O=0;continue}C(),N(x,B,P)}else d+=P,g=x,v=B+1;const H=B+1;R!==null&&R[q]===H&&(z=H,O=d,q++),B++}f&&g===x&&v===M.length&&(g=x+1,v=0)}let _=0;for(;_=i.length));){const x=i[_],E=o[_],M=jZ(E);if(!f){x>u&&s[_]!==null?S(_,0):T(_,x),M&&(y=_+1,b=d-x),_++;continue}if(d+x>u){if(M){I(_,x),C(_+1,0,d-x),_++;continue}if(y>=0){if(g>y||g===y&&v>0){C();continue}C(y,0,b);continue}if(x>u&&s[_]!==null){C(),S(_,0),_++;continue}C();continue}I(_,x),M&&(y=_+1,b=d-x),_++}return f&&C(),c}function Xat(e,t,n){if(e.simpleLineWalkFastPath)return Jat(e,t,n);const{widths:i,kinds:o,breakableFitAdvances:s,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(i.length===0||a.length===0)return 0;const u=bb(),c=u.lineFitEpsilon,d=t+c;let f=0,h=0,m=!1,g=0,v=0,y=0,b=0,w=-1,C=0,T=0,N=null;function I(){w=-1,C=0,T=0,N=null}function S(){return N==="soft-hyphen"&&w===y&&b===0?T:h}function _(O=y,B=b,P){f++,n!==void 0&&n(Yat(e,P??S(),g,v,O,B),g,v,O,B),h=0,m=!1,I()}function x(O,B){m=!0,g=O,v=0,y=O+1,b=0,h=B}function E(O,B,P){m=!0,g=O,v=B,y=O,b=B+1,h=P}function M(O,B){if(!m){x(O,B);return}h+=B,y=O+1,b=0}function R(O,B,P,H,j,Z){if(!B)return;const ie=uR(e,O,P,j),W=cR(e,O,P,j,H);w=P+1,C=h-Z+ie,T=h-Z+W,N=O}function q(O,B){const P=s[O],H=r[O]??null;let j=H===null?-1:G4(H,0,B+1),Z=-1,ie=0,W=B;for(;Wd){if(H!==null&&Z>B){_(O,Z,ie),W=Z,j=G4(H,j,W+1),Z=-1,ie=0;continue}_(),E(O,W,Q)}else h=ge,y=O,b=W+1}const te=W+1;H!==null&&H[j]===te&&(Z=te,ie=h,j++),W++}m&&y===O&&b===P.length&&(y=O+1,b=0)}function z(O){f++,n?.(0,O.startSegmentIndex,0,O.consumedEndSegmentIndex,0),I()}for(let O=0;O=B.endSegmentIndex));){const H=o[P],j=jZ(H),Z=Uat(e,m,P),ie=H==="tab"?qat(h+Z,e.tabStopAdvance):i[P],W=Z+ie,Q=Kat(e,H,P,Z,ie);if(H==="soft-hyphen"){m&&(y=P+1,b=0,w=P+1,C=h+l,T=h+l,N=H),P++;continue}if(!m){Q>d&&s[P]!==null?q(P,0):x(P,ie),R(H,j,P,ie,Z,W),P++;continue}if(h+Q>d){const X=h+uR(e,H,P,Z),ge=h+cR(e,H,P,Z,ie);if(N==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&C<=d){_(w,0,T);continue}if(j&&X<=d){M(P,W),_(P+1,0,ge),P++;continue}if(w>=0&&C<=d){if(y>w||y===w&&b>0){_();continue}const ue=w;_(ue,0,T),P=ue;continue}if(Q>d&&s[P]!==null){_(),q(P,0),P++;continue}_();continue}M(P,W),R(H,j,P,ie,Z,W),P++}if(m){const H=w===B.consumedEndSegmentIndex?T:h;_(B.consumedEndSegmentIndex,0,H)}}return f}let F5=null;function MS(){return F5===null&&(F5=new Intl.Segmenter(void 0,{granularity:"grapheme"})),F5}function eut(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function tut(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=QA(d),l=vb.has(d)}function c(d,f){i.push(d),s=s||f;const h=QA(d);d.length===1&&jh.has(d)?r=r||h:r=h,l=!1}for(const d of MS().segment(e)){const f=d.segment,h=Ou(f);if(i.length===0){u(f,d.index,h);continue}if(l||CS.has(f)||jh.has(f)||t.carryCJKAfterClosingQuote&&h&&r){c(f,h);continue}if(!s&&!h){c(f,h);continue}a(),u(f,d.index,h)}return a(),n}function nut(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(a,u){const c=t[a].start,d=u=0&&!$Z(t[a-1].text,n)&&l(a),o<0&&(o=a),s=s||Ou(u.text)}return l(t.length),i}function dR(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=MS();for(const o of i.segment(e))n++;return n}function iut(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function out(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const i of MS().segment(e))n++,iut(i.segment)&&t.push(n);return t.length===0?null:t}function sut(e,t,n){return t>1?e+(t-1)*n:e}function rut(e,t,n,i,o){const s=bb(),{cache:r,emojiCorrection:l}=Hat(t,$at(e.normalized)),a=lh("-",bd("-",r),l)+(o===0?0:o*2),c=lh(" ",bd(" ",r),l)*8,d=o!==0;if(e.len===0)return eut();const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=n?[]:null,b=[],w=[],C=[],T=n?[]:null,N=Array.from({length:e.len});function I(E,M,R,q,z,O,B,P,H){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(v=!1),f.push(M),h.push(R),m.push(q),g.push(z),y?.push(O),b.push(B),w.push(P),d&&C.push(H),T!==null&&T.push(E)}function S(E,M,R,q,z){const O=bd(E,r),B=d?dR(E,M):0,P=sut(lh(E,O,l),B,o),H=M==="space"||M==="preserved-space"||M==="zero-width-break"?0:P,j=H===0?0:H+(B>0?o:0),Z=M==="space"||M==="zero-width-break"?0:P;if(z&&q&&E.length>1){let ie="sum-graphemes";o!==0?ie="segment-prefixes":Z4(E)?ie="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ie="segment-prefixes");const W=jat(E,O,r,l,ie),Q=W===null||i==="keep-all"?null:out(E);I(E,P,j,Z,M,R,W,Q,B);return}I(E,P,j,Z,M,R,null,null,B)}for(let E=0;E{n>t&&(t=n)}),t}const dut={key:0,class:"slash-empty",role:"status"},fut=["id","aria-selected","onMouseenter","onMousedown"],hut={class:"slash-name"},put={key:0,class:"slash-match"},mut={class:"slash-desc"},gut={key:0,class:"slash-desc-match"},vut=lt({__name:"SlashMenu",props:{items:{},activeIndex:{},query:{default:""},ranges:{},layout:{default:"popup"}},emits:["select","hover"],setup(e,{expose:t,emit:n}){const{t:i}=qt(),o=e,s=n;function r(I,S){if(!S||S.length===0)return[{text:I,hit:!1}];const _=[];let x=0;for(const[E,M]of[...S].sort((R,q)=>R[0]-q[0]))E>x&&_.push({text:I.slice(x,E),hit:!1}),_.push({text:I.slice(E,M),hit:!0}),x=M;return xo.items.map((I,S)=>{const _=l(I),x=o.ranges?.[S]??Vle(o.query,I.name,_);return{item:I,namePieces:r(I.name,x.name),desc:_,descPieces:r(_,x.desc)}})),u=V(null),c=V(null);t({el:c});const d=V(!1),f=V(!1);let h=null;const m=V(null);function g(){const I=u.value;if(!I)return;d.value=I.scrollTop>0,f.value=I.scrollTop+I.clientHeight{j.pointerId!==x||R<=0||(S.scrollTop=O+(j.clientY-z)/R*q)},P=j=>{j.pointerId===x&&H()},H=()=>{window.removeEventListener("pointerup",P),window.removeEventListener("pointermove",B),window.removeEventListener("pointercancel",P),y===H&&(y=null)};y=H,window.addEventListener("pointermove",B),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P)}const w=D(()=>{const I=d.value,S=f.value,_="var(--menu-scroll-fade)";if(I&&S)return`linear-gradient(to bottom, transparent 0, black ${_}, black calc(100% - ${_}), transparent 100%)`;if(I)return`linear-gradient(to bottom, transparent, black ${_})`;if(S)return`linear-gradient(to top, transparent, black ${_})`}),C=V("");function T(){const I=c.value,S=u.value,_=I?.offsetParent;if(!I||!S||!_)return;const x=getComputedStyle(I),E=parseFloat(x.getPropertyValue("--space-2"))||8,M=parseFloat(x.getPropertyValue("--space-2"))||8,R=(parseFloat(x.paddingTop)||0)+(parseFloat(x.paddingBottom)||0),q=parseFloat(getComputedStyle(S).getPropertyValue("--p-slash-menu-h"))||Number.POSITIVE_INFINITY,z=window.visualViewport?.offsetTop??0,O=_.getBoundingClientRect().top-z-E-M-R;C.value=`${Math.max(Math.floor(Math.min(q,O)),0)}px`,ht(()=>{g(),N()})}yn(()=>{if(o.layout==="sheet"){g(),typeof ResizeObserver=="function"&&u.value&&(h=new ResizeObserver(()=>g()),h.observe(u.value));return}if(T(),g(),typeof ResizeObserver=="function"&&u.value){h=new ResizeObserver(S=>{for(const _ of S)_.target===u.value?g():T()}),h.observe(u.value);const I=c.value?.offsetParent;I&&h.observe(I)}window.addEventListener("resize",T),window.visualViewport?.addEventListener("resize",T),window.visualViewport?.addEventListener("scroll",T)}),Ln(()=>{h?.disconnect(),h=null,y?.(),window.removeEventListener("resize",T),window.visualViewport?.removeEventListener("resize",T),window.visualViewport?.removeEventListener("scroll",T)});function N(){const I=u.value;if(!I)return;const S=I.querySelectorAll('[role="option"]')[o.activeIndex];if(!S)return;const _=I.getBoundingClientRect(),x=S.getBoundingClientRect(),E=x.top-_.top+I.scrollTop,M=E+x.height;EI.scrollTop+I.clientHeight&&(I.scrollTop=M-I.clientHeight)}return We(()=>o.activeIndex,()=>{ht(N)}),We(()=>o.items,()=>{ht(()=>{g(),N()})}),(I,S)=>(k(),L("div",{ref_key:"menuEl",ref:c,class:Re(["slash-menu",{"is-sheet":e.layout==="sheet"}]),"data-menu-frame":""},[e.items.length===0?(k(),L("div",dut,F(p(i)("composer.noCommands")),1)):ee("",!0),ai(A("div",{id:"composer-slash-menu",ref_key:"scrollEl",ref:u,class:"slash-scroll",role:"listbox",style:on({maskImage:w.value,maxHeight:C.value}),onScroll:v},[(k(!0),L(De,null,Ct(a.value,(_,x)=>(k(),L("div",{key:`${_.item.name}-${x}`,id:`composer-slash-option-${x}`,class:Re(["slash-item",{active:x===o.activeIndex}]),role:"option","aria-selected":x===o.activeIndex,onMouseenter:E=>s("hover",x),onMousedown:Tt(E=>s("select",_.item),["prevent"])},[A("span",hut,[(k(!0),L(De,null,Ct(_.namePieces,(E,M)=>(k(),L(De,{key:M},[E.hit?(k(),L("span",put,F(E.text),1)):(k(),L(De,{key:1},[$e(F(E.text),1)],64))],64))),128))]),A("span",mut,[(k(!0),L(De,null,Ct(_.descPieces,(E,M)=>(k(),L(De,{key:M},[E.hit?(k(),L("span",gut,F(E.text),1)):(k(),L(De,{key:1},[$e(F(E.text),1)],64))],64))),128))])],42,fut))),128))],36),[[Go,e.items.length>0]]),m.value&&e.items.length>0?(k(),L("div",{key:1,class:"scroll-thumb",onPointerdown:b,style:on({top:`${m.value.top}px`,height:`${m.value.height}px`})},null,36)):ee("",!0)],2))}}),fR=xt(vut,[["__scopeId","data-v-62eaf4c2"]]),yut={key:0,class:"mention-state dim",role:"status"},kut={key:1,class:"mention-state dim",role:"status"},but=["id","aria-selected","onMouseenter","onMousedown"],wut=["innerHTML"],Cut={class:"mention-name"},Aut={key:0,class:"mention-hit"},xut={class:"mention-meta"},Sut={class:"mention-name"},_ut={key:0,class:"mention-hit"},Mut={key:0,class:"mention-meta"},Iut={key:0,class:"mention-hit"},Tut=lt({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean},stale:{type:Boolean,default:!1},layout:{default:"popup"}},emits:["select","hover"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=qt();function r(x){return x.kind==="skill"?`skill:${x.skill.name}`:x.file.path}function l(x){return x.kind==="skill"?tb("skill","",x.skill.name):gx(x.file.path,x.file.name,x.kind==="folder")}function a(x){const E=x.endsWith("/")?x.slice(0,-1):x,M=E.lastIndexOf("/");return M===-1?"":E.slice(0,M)}function u(x){return f5(x.skill.name,x.matchPositions,0)}function c(x){const E=x.path.endsWith("/")?x.path.slice(0,-1):x.path;return f5(x.name,x.matchPositions,Math.max(0,E.length-x.name.length))}function d(x){return f5(a(x.path),x.matchPositions,0)}const f=V(null),h=V(null);t({el:h});const m=V(!1),g=V(!1);let v=null;const y=V(null);function b(){const x=f.value;if(!x)return;m.value=x.scrollTop>0,g.value=x.scrollTop+x.clientHeight{W.pointerId!==R||O<=0||(E.scrollTop=H+(W.clientY-P)/O*B)},Z=W=>{W.pointerId===R&&ie()},ie=()=>{window.removeEventListener("pointerup",Z),window.removeEventListener("pointermove",j),window.removeEventListener("pointercancel",Z),C===ie&&(C=null)};C=ie,window.addEventListener("pointermove",j),window.addEventListener("pointerup",Z),window.addEventListener("pointercancel",Z)}const N=D(()=>{const x=m.value,E=g.value,M="var(--menu-scroll-fade)";if(x&&E)return`linear-gradient(to bottom, transparent 0, black ${M}, black calc(100% - ${M}), transparent 100%)`;if(x)return`linear-gradient(to bottom, transparent, black ${M})`;if(E)return`linear-gradient(to top, transparent, black ${M})`}),I=V("");function S(){const x=h.value,E=f.value,M=x?.offsetParent;if(!x||!E||!M)return;const R=getComputedStyle(x),q=parseFloat(R.getPropertyValue("--space-2"))||8,z=parseFloat(R.getPropertyValue("--space-2"))||8,O=(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0),B=parseFloat(getComputedStyle(E).getPropertyValue("--p-mention-menu-h"))||Number.POSITIVE_INFINITY,P=window.visualViewport?.offsetTop??0,H=M.getBoundingClientRect().top-P-q-z-O;I.value=`${Math.max(Math.floor(Math.min(B,H)),0)}px`,ht(()=>{b(),_()})}yn(()=>{if(i.layout==="sheet"){b(),typeof ResizeObserver=="function"&&f.value&&(v=new ResizeObserver(()=>b()),v.observe(f.value));return}if(S(),b(),typeof ResizeObserver=="function"&&f.value){v=new ResizeObserver(E=>{for(const M of E)M.target===f.value?b():S()}),v.observe(f.value);const x=h.value?.offsetParent;x&&v.observe(x)}window.addEventListener("resize",S),window.visualViewport?.addEventListener("resize",S),window.visualViewport?.addEventListener("scroll",S)}),Ln(()=>{v?.disconnect(),v=null,C?.(),window.removeEventListener("resize",S),window.visualViewport?.removeEventListener("resize",S),window.visualViewport?.removeEventListener("scroll",S)});function _(){const x=f.value;if(!x)return;const E=x.querySelectorAll('[role="option"]')[i.activeIndex];if(!E)return;const M=x.getBoundingClientRect(),R=E.getBoundingClientRect(),q=R.top-M.top+x.scrollTop,z=q+R.height;qx.scrollTop+x.clientHeight&&(x.scrollTop=z-x.clientHeight)}return We(()=>i.activeIndex,()=>{ht(_)}),We(()=>i.items,()=>{ht(()=>{b(),_()})}),(x,E)=>(k(),L("div",{ref_key:"menuEl",ref:h,class:Re(["mention-menu",{"is-sheet":e.layout==="sheet"}]),"data-menu-frame":""},[i.loading&&i.items.length===0?(k(),L("div",yut,F(p(s)("mention.searching")),1)):i.items.length===0?(k(),L("div",kut,F(p(s)("mention.noMatch")),1)):ee("",!0),i.loading&&i.items.length>0?(k(),de(p(mo),{key:2,class:"mention-spin",size:"xs"})):ee("",!0),ai(A("div",{id:"composer-mention-menu",ref_key:"scrollEl",ref:f,class:"mention-scroll",role:"listbox",style:on({maskImage:N.value,maxHeight:I.value}),onScroll:w},[(k(!0),L(De,null,Ct(i.items,(M,R)=>(k(),L("div",{key:r(M),id:`composer-mention-option-${R}`,class:Re(["mention-item",{active:R===i.activeIndex,stale:i.stale&&M.kind!=="skill"}]),role:"option","aria-selected":R===i.activeIndex,onMouseenter:q=>o("hover",R),onMousedown:Tt(q=>o("select",M),["prevent"])},[A("span",{class:"mention-icon",innerHTML:l(M),"aria-hidden":"true"},null,8,wut),M.kind==="skill"?(k(),L(De,{key:0},[A("span",Cut,[(k(!0),L(De,null,Ct(u(M),(q,z)=>(k(),L(De,{key:z},[q.hit?(k(),L("span",Aut,F(q.text),1)):(k(),L(De,{key:1},[$e(F(q.text),1)],64))],64))),128))]),A("span",xut,F(M.skill.description),1)],64)):(k(),L(De,{key:1},[A("span",Sut,[(k(!0),L(De,null,Ct(c(M.file),(q,z)=>(k(),L(De,{key:z},[q.hit?(k(),L("span",_ut,F(q.text),1)):(k(),L(De,{key:1},[$e(F(q.text),1)],64))],64))),128))]),a(M.file.path)?(k(),L("span",Mut,[(k(!0),L(De,null,Ct(d(M.file),(q,z)=>(k(),L(De,{key:z},[q.hit?(k(),L("span",Iut,F(q.text),1)):(k(),L(De,{key:1},[$e(F(q.text),1)],64))],64))),128))])):ee("",!0)],64))],42,but))),128))],36),[[Go,i.items.length>0]]),y.value&&i.items.length>0?(k(),L("div",{key:3,class:"scroll-thumb",onPointerdown:T,style:on({top:`${y.value.top}px`,height:`${y.value.height}px`})},null,36)):ee("",!0)],2))}}),hR=xt(Tut,[["__scopeId","data-v-7c3431cd"]]),Eut=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","vue:error","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],WZ=500,Q4=256*1024,pR=200,B5=16384,R5=500,$5=50,O5=50,Lut=6,Nut=/api[_-]?key|authorization|token|secret|password|cookie|credential|email|phone|nickname|avatar/i,Dut=/^[A-Za-z0-9+/=_-]{200,}$/;let P5=null;function Qa(){if(P5!==null)return P5;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=ms(Cn.debug)==="1"),P5=e,e}const Ld=[],Kp=[];let _g=0;const Yf=[];let Mg=0,Fut=1;const Y4=new TextEncoder,But=new Set(Eut),IS=V(0),Ig=Ka(!1);function Rut(){return Ld}function $ut(){Ld.length=0,Kp.length=0,_g=0,Yf.length=0,Mg=0,IS.value++}function Nc(e){if(!Ig.value){try{const t={id:Fut++,ts:Date.now(),source:e.source,kind:String(k1(e.kind)),label:String(k1(e.label)),sessionId:e.sessionId===void 0?void 0:String(k1(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:hf(e.detail)},n=JSON.stringify(t),i=Y4.encode(n).byteLength;if(i>Q4)return;for(Ld.push(t),Kp.push(n),_g+=i+(Kp.length>1?1:0);Ld.length>WZ||_g>Q4;){const o=Kp.shift();Ld.shift(),o!==void 0&&(_g-=Y4.encode(o).byteLength,Kp.length>0&&(_g-=1))}}catch{return}IS.value++}}function Rf(e){if(typeof e=="string")return e.length<=pR?e:e.slice(0,pR)}function ta(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Out(e,t){if(But.has(e))try{const n={ts:Date.now(),event:e,sessionId:Rf(t?.sessionId),status:Rf(t?.status),operation:Rf(t?.operation),seq:ta(t?.seq),durationMs:ta(t?.durationMs),messageCount:ta(t?.messageCount),contentCount:ta(t?.contentCount),mediaCount:ta(t?.mediaCount),sessionCount:ta(t?.sessionCount),workspaceCount:ta(t?.workspaceCount),promptId:Rf(t?.promptId),zipBytes:ta(t?.zipBytes),errorName:Rf(t?.errorName),errorCode:ta(t?.errorCode),requestId:Rf(t?.requestId),phase:Rf(t?.phase),httpStatus:ta(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:ta(t?.line),col:ta(t?.col)},i=JSON.stringify(n),o=Y4.encode(i).byteLength;if(o>Q4)return;for(Yf.push(i),Mg+=o+(Yf.length>1?1:0);Yf.length>WZ||Mg>Q4;){const s=Yf.shift();s!==void 0&&(Mg-=Y4.encode(s).byteLength,Yf.length>0&&(Mg-=1))}}catch{return}}function k1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const s=e;return Dut.test(s)?`[base64-like, ${s.length} chars omitted]`:s.length>R5?`${s.slice(0,R5)}… [+${s.length-R5} chars]`:s}if(n!=="object")return String(e);if(t>=Lut)return"[max depth]";if(Array.isArray(e)){const s=e.slice(0,$5).map(r=>k1(r,t+1));return e.length>$5&&s.push(`[+${e.length-$5} more items]`),s}const i={},o=Object.entries(e);for(const[s,r]of o.slice(0,O5))i[s]=Nut.test(s)?"[redacted]":k1(r,t+1);return o.length>O5&&(i._truncatedKeys=o.length-O5),i}function hf(e){if(e===void 0)return;const t=k1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>B5)return{_truncated:`detail JSON was ${n.length} chars; first ${B5} kept`,preview:n.slice(0,B5)}}catch{return"[unserializable detail]"}return t}function Put(e){Qa()&&Nc({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:hf(e.body)}})}function zut(e){if(!Qa())return;const t=e.code!==0;Nc({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:hf(e.data)}})}function jut(e){Qa()&&Nc({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function Hut(e,t){Qa()&&Nc({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:hf(t)})}function Wut(e){if(!Qa())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",i=t.payload,o=typeof i?.session_id=="string"?i.session_id:void 0;Nc({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:hf(e)})}function qut(e){if(!Qa())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",i=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,s=typeof t.offset=="number"?t.offset:void 0,r=[i,o!==void 0?`seq=${o}`:void 0,s!==void 0?`offset=${s}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Nc({source:"ws",kind:"ws:in",eventType:n,sessionId:i,seq:o,offset:s,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:hf(t.payload)})}const Uut={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Vut(e,t,n){Qa()&&Nc({source:"client",kind:`client:${e}`,label:`${Uut[e]} ${t}`,detail:hf(n)})}function Kut(e,t){Qa()&&Nc({source:"client",kind:"client:event",label:`· ${e}`,detail:hf(t)})}function lv(e,t){Out(e,t),Nc({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let z5=!1,by=null;function Zut(e,t){const n=e instanceof Error?e.name:"Error";lv("vue:error",{status:"failed",errorName:n,info:t}),vu(`[kimi-web] vue error (${t}): ${e instanceof Error?e.message:String(e)}`,e instanceof Error?e.stack:void 0)}function Gut(){if(z5)return()=>by?.();z5=!0;const e=[];try{if(typeof window<"u"){const n=o=>{lv("window:error",{status:"failed",errorName:o.error instanceof Error?o.error.name:"Error",line:o.lineno,col:o.colno}),vu(`[kimi-web] window error: ${o.message}`,o.error instanceof Error?o.error.stack:void 0)},i=o=>{const s=o.reason;lv("window:unhandled-rejection",{status:"failed",errorName:s instanceof Error?s.name:typeof s}),vu(`[kimi-web] unhandled rejection: ${Yut(s)}`,s instanceof Error?s.stack:void 0)};window.addEventListener("error",n),window.addEventListener("unhandledrejection",i),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",i)})}}catch{}if(Qa())for(const n of["error","warn","log","info","debug"]){const i=console[n];if(typeof i!="function")continue;const o=(...s)=>{try{Vut(n,s.map(Qut).join(" "),s.length>1?s:s[0])}catch{}i.apply(console,s)};console[n]=o,e.push(()=>{console[n]===o&&(console[n]=i)})}const t=()=>{if(by===t){for(const n of e.toReversed())n();by=null,z5=!1}};return by=t,t}function Qut(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function Yut(e){if(e instanceof Error)return e.message;try{return String(e)}catch{return"[unstringifiable reason]"}}function qZ(e=Ld){if(typeof document>"u")return;const t=new Blob([Jut(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let i;try{i=document.createElement("a"),i.href=n,i.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(i),i.click()}finally{i?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Jut(e=Ld){return e===Ld?Kp.join(` +`):e}let L5=null,Dlt;function Flt(){return L5===null&&(L5=new Intl.Segmenter(Dlt,{granularity:"word"})),L5}const Blt=/\p{Script=Arabic}/u,ff=/\p{M}/u,bS=/\p{Nd}/u;function iR(e){return Blt.test(e)}function oR(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Pu(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){const o=(n-55296<<10)+(i-56320)+65536;if(oR(o))return!0;t++;continue}}if(oR(n))return!0}}return!1}function Rlt(e){const t=Pv(e);return t!==null&&(wS.has(t)||Hh.has(t))}const Olt=new Set([" "," ","⁠","\uFEFF"]),$lt=new Set(["-","‐","–","—"]);function Plt(e){const t=Pv(e);return t!==null&&Olt.has(t)}function zlt(e){const t=Pv(e);return t!==null&&$lt.has(t)}function OZ(e,t){return Plt(e)?!1:t?!(Rlt(e)||zlt(e)):!0}const wS=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),gb=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),CS=new Set(["'","’"]),Hh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),jlt=new Set([":",".","،","؛"]),Hlt=new Set(["၏"]),Wlt=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function qlt(e){if(AS(e))return!0;let t=!1;for(const n of e){if(Hh.has(n)||yb(n)){t=!0;continue}if(!(t&&ff.test(n)))return!1}return t}function Ult(e){for(const t of e)if(!wS.has(t)&&!Hh.has(t))return!1;return e.length>0}function Vlt(e){if(AS(e))return!0;for(const t of e)if(!gb.has(t)&&!CS.has(t)&&!ff.test(t)&&!yb(t))return!1;return e.length>0}function AS(e){let t=!1;for(const n of e)if(!(n==="\\"||ff.test(n))){if(gb.has(n)||Hh.has(n)||CS.has(n)){t=!0;continue}return!1}return t}function vb(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function Pv(e){if(e.length===0)return null;const t=vb(e,e.length);return e.slice(t)}function Klt(e){for(const t of e)if(!ff.test(t))return t;return null}function Zlt(e){for(let t=e.length;t>0;){const n=vb(e,t),i=e.slice(n,t);if(!ff.test(i))return i;t=n}return null}const Glt=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Qlt(e,t){for(let n=0;n=t[n]&&e<=t[n+1])return!0;return!1}function yb(e){const t=e.codePointAt(0);return t!==void 0&&Qlt(t,Glt)}function Ylt(e){const t=Zlt(e);return t!==null&&yb(t)}function Jlt(e){const t=Klt(e);return t!==null&&bS.test(t)}function Xlt(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(ff.test(i)){n--;continue}if(gb.has(i)||CS.has(i)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function eat(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function sR(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function rR(e,t){return e&&t!==null&&jlt.has(t)}function tat(e){const t=Pv(e);return t!==null&&Hlt.has(t)}function nat(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function GA(e){let t=e.length;for(;t>0;){const n=vb(e,t),i=e.slice(n,t);if(Wlt.has(i))return!0;if(!Hh.has(i))return!1;t=n}return!1}function iat(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const oat=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ka(e){return e.length===1?e[0]:e.join("")}function sat(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Ka(n)}function rat(e,t,n,i){if(!oat.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=iat(c,i),f=d==="text"&&t;if(s!==null&&d===s&&f===a){r.push(c),u+=c.length;continue}s!==null&&o.push({text:Ka(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length}return s!==null&&o.push({text:Ka(r),isWordLike:a,kind:s,start:l}),o}function QA(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const lat=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function aat(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:lat.test(n)&&t+1=e.len||QA(e.kinds[l]))continue;const a=[],u=e.starts[l];let c=l;for(;c0&&(t.push(Ka(a)),n.push(!0),i.push("text"),o.push(u),s=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:o}}const fat=new Set([":","-","/","×",",",".","+","–","—"]),hat=/[\p{P}\p{S}\p{Co}]/u,pat=/\p{Emoji_Presentation}/u,mat=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function gat(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function $Z(e){const t=e.charCodeAt(0);return t<128?gat(t):!mat.has(e)&&!pat.test(e)&&hat.test(e)}function lR(e){let t=!1;for(const n of e)if(!ff.test(n)){if(!$Z(n))return!1;t=!0}return t}function vat(e){for(let t=e.length;t>0;){const n=vb(e,t),i=e.slice(n,t);if(ff.test(i)){t=n;continue}return $Z(i)||yb(i)}return!1}function yat(e,t,n,i){const o=!t&&lR(e),s=!i&&lR(n),r=Ylt(e),l=(t||r)&&vat(e);return!o&&!s&&!l||Pu(e)||Pu(n)?!1:(t||o||r)&&(i||s)}function PZ(e){for(const t of e)if(bS.test(t))return!0;return!1}function K4(e){if(e.length===0)return!1;for(const t of e)if(!(bS.test(t)||fat.has(t)))return!1;return!0}function kat(e){const t=[],n=[],i=[],o=[];for(let s=0;ss+1){t.push(Ka(u)),n.push(d),i.push("text"),o.push(e.starts[s]),s=c;continue}}t.push(r),n.push(a),i.push(l),o.push(e.starts[s]),s++}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:o}}function wat(e){const t=[],n=[],i=[],o=[];for(let s=0;s1;for(let u=0;u0&&a[z]==="text"&&x&&f[z]&&m[z]||S&&o>0&&a[z]==="text"&&Ult(I.text)&&f[z]||S&&o>0&&a[z]==="text"&&g[z]?$():S&&o>0&&a[z]==="text"&&I.isWordLike&&E&&v[z]?($(),l[z]=!0):_!==null&&o>0&&a[z]==="text"&&c[z]===_?d[z]=(d[z]??1)+1:S&&!I.isWordLike&&o>0&&a[z]==="text"&&!f[z]&&(qlt(I.text)||I.text==="-"&&l[z])?$():(s[o]=I.text,r[o]=[I.text],l[o]=I.isWordLike,a[o]=I.kind,u[o]=I.start,c[o]=_,d[o]=_===null?0:1,f[o]=x,h[o]=E,m[o]=R,g[o]=q,v[o]=rR(E,M),o++)}for(let N=0;Nnull);let b=-1;for(let N=o-1;N>=0;N--){const I=s[N];if(I.length!==0){if(a[N]==="text"&&!l[N]&&b>=0&&a[b]==="text"&&(Vlt(I)||I==="-"&&Jlt(s[b]))){const S=y[b]??[];S.push(I),y[b]=S,u[b]=u[N],s[N]="";continue}b=N}}for(let N=0;N=0&&!OZ(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||Pu(h);continue}d(f),i.push(h),o.push(t.isWordLike[f]),s.push(m),r.push(t.starts[f])}return d(t.len),{len:i.length,texts:i,isWordLike:o,kinds:s,starts:r}}function Mat(e,t,n="normal",i="normal"){const o=Elt(n),s=o.mode==="pre-wrap"?Nlt(e):Llt(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=xat(s,t,o),l=i==="keep-all"?_at(s,r,t.breakKeepAllAfterPunctuation):r;return{normalized:s,chunks:Sat(l,o),...l}}let Ap=null;const aR=new Map;let xp=null;const Iat=96,Tat=/\p{Emoji_Presentation}/u,Eat=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let N5=null;const uR=new Map;function xS(){if(Ap!==null)return Ap;if(typeof OffscreenCanvas<"u")return Ap=new OffscreenCanvas(1,1).getContext("2d"),Ap;if(typeof document<"u")return Ap=document.createElement("canvas").getContext("2d"),Ap;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Lat(e){let t=aR.get(e);return t||(t=new Map,aR.set(e,t)),t}function bd(e,t){let n=t.get(e);return n===void 0&&(n={width:xS().measureText(e).width,containsCJK:Pu(e)},t.set(e,n)),n}function kb(){if(xp!==null)return xp;if(typeof navigator>"u")return xp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},xp;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),i=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return xp={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},xp}function Nat(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function zZ(){return N5===null&&(N5=new Intl.Segmenter(void 0,{granularity:"grapheme"})),N5}function Dat(e){return Tat.test(e)||e.includes("️")}function Fat(e){return Eat.test(e)}function Bat(e,t){let n=uR.get(e);if(n!==void 0)return n;const i=xS();i.font=e;const o=i.measureText("😀").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){const s=document.createElement("span");s.style.font=e,s.style.display="inline-block",s.style.visibility="hidden",s.style.position="absolute",s.textContent="😀",document.body.appendChild(s);const r=s.getBoundingClientRect().width;document.body.removeChild(s),o-r>.5&&(n=o-r)}return uR.set(e,n),n}function Rat(e){let t=0;const n=zZ();for(const i of n.segment(e))Dat(i.segment)&&t++;return t}function Oat(e,t){return t.emojiCount===void 0&&(t.emojiCount=Rat(e)),t.emojiCount}function ah(e,t,n){return n===0?t.width:t.width-Oat(e,t)*n}function $at(e,t,n,i,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const s=zZ(),r=[];for(const c of s.segment(e))r.push(c.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){const c=[];for(const d of r){const f=bd(d,n);c.push(ah(d,f,i))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(o==="pair-context"||r.length>Iat){const c=[];let d=null,f=0;for(const h of r){const m=bd(h,n),g=ah(h,m,i);if(d===null)c.push(g);else{const v=d+h,y=bd(v,n);c.push(ah(v,y,i)-f)}d=h,f=g}return t.breakableFitAdvances=c,t.breakableFitAdvances}const l=[];let a="",u=0;for(const c of r){a+=c;const d=bd(a,n),f=ah(a,d,i);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Pat(e,t){const n=xS();n.font=e;const i=Lat(e),o=Nat(e),s=t?Bat(e,o):0;return{cache:i,fontSize:o,emojiCorrection:s}}function zat(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function jZ(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function HZ(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function SS(e,t){return t===0?0:e+t}function Wat(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function qat(e,t,n,i,o){const s=t==="tab"?o+Wat(e,n):e.lineEndFitAdvances[n];return SS(i,s)}function cR(e,t,n,i){const o=t==="tab"?0:e.lineEndFitAdvances[n];return SS(i,o)}function dR(e,t,n,i,o){const s=t==="tab"?o:e.lineEndPaintAdvances[n];return SS(i,s)}function Uat(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Vat(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Z4(e,t,n){let i=t;for(;i0)return e.spacingGraphemeCounts[i]>0?e.letterSpacing:0;for(let s=i-1;s>=t;s--){const r=e.kinds[s];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(s===i-1)return 0;continue}return s===t&&n>0||e.spacingGraphemeCounts[s]>0?e.letterSpacing:0}}return 0}function Zat(e,t,n,i,o,s){return t+Kat(e,n,i,o,s)}function Gat(e,t,n){const{widths:i,kinds:o,breakableFitAdvances:s,breakablePreferredBreaks:r}=e;if(i.length===0)return 0;const a=kb().lineFitEpsilon,u=t+a;let c=0,d=0,f=!1,h=0,m=0,g=0,v=0,y=-1,b=0;function w(){y=-1,b=0}function C(x=g,E=v,M=d){c++,n?.(M,h,m,x,E),d=0,f=!1,w()}function T(x,E){f=!0,h=x,m=0,g=x+1,v=0,d=E}function N(x,E,M){f=!0,h=x,m=E,g=x,v=E+1,d=M}function I(x,E){if(!f){T(x,E);return}d+=E,g=x+1,v=0}function S(x,E){const M=s[x],R=r[x]??null;let q=R===null?-1:Z4(R,0,E+1),z=-1,$=0,B=E;for(;Bu){if(R!==null&&z>E){C(x,z,$),B=z,q=Z4(R,q,B+1),z=-1,$=0;continue}C(),N(x,B,P)}else d+=P,g=x,v=B+1;const H=B+1;R!==null&&R[q]===H&&(z=H,$=d,q++),B++}f&&g===x&&v===M.length&&(g=x+1,v=0)}let _=0;for(;_=i.length));){const x=i[_],E=o[_],M=jZ(E);if(!f){x>u&&s[_]!==null?S(_,0):T(_,x),M&&(y=_+1,b=d-x),_++;continue}if(d+x>u){if(M){I(_,x),C(_+1,0,d-x),_++;continue}if(y>=0){if(g>y||g===y&&v>0){C();continue}C(y,0,b);continue}if(x>u&&s[_]!==null){C(),S(_,0),_++;continue}C();continue}I(_,x),M&&(y=_+1,b=d-x),_++}return f&&C(),c}function Qat(e,t,n){if(e.simpleLineWalkFastPath)return Gat(e,t,n);const{widths:i,kinds:o,breakableFitAdvances:s,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(i.length===0||a.length===0)return 0;const u=kb(),c=u.lineFitEpsilon,d=t+c;let f=0,h=0,m=!1,g=0,v=0,y=0,b=0,w=-1,C=0,T=0,N=null;function I(){w=-1,C=0,T=0,N=null}function S(){return N==="soft-hyphen"&&w===y&&b===0?T:h}function _($=y,B=b,P){f++,n!==void 0&&n(Zat(e,P??S(),g,v,$,B),g,v,$,B),h=0,m=!1,I()}function x($,B){m=!0,g=$,v=0,y=$+1,b=0,h=B}function E($,B,P){m=!0,g=$,v=B,y=$,b=B+1,h=P}function M($,B){if(!m){x($,B);return}h+=B,y=$+1,b=0}function R($,B,P,H,j,G){if(!B)return;const ne=cR(e,$,P,j),W=dR(e,$,P,j,H);w=P+1,C=h-G+ne,T=h-G+W,N=$}function q($,B){const P=s[$],H=r[$]??null;let j=H===null?-1:Z4(H,0,B+1),G=-1,ne=0,W=B;for(;Wd){if(H!==null&&G>B){_($,G,ne),W=G,j=Z4(H,j,W+1),G=-1,ne=0;continue}_(),E($,W,Q)}else h=ve,y=$,b=W+1}const te=W+1;H!==null&&H[j]===te&&(G=te,ne=h,j++),W++}m&&y===$&&b===P.length&&(y=$+1,b=0)}function z($){f++,n?.(0,$.startSegmentIndex,0,$.consumedEndSegmentIndex,0),I()}for(let $=0;$=B.endSegmentIndex));){const H=o[P],j=jZ(H),G=Hat(e,m,P),ne=H==="tab"?jat(h+G,e.tabStopAdvance):i[P],W=G+ne,Q=qat(e,H,P,G,ne);if(H==="soft-hyphen"){m&&(y=P+1,b=0,w=P+1,C=h+l,T=h+l,N=H),P++;continue}if(!m){Q>d&&s[P]!==null?q(P,0):x(P,ne),R(H,j,P,ne,G,W),P++;continue}if(h+Q>d){const X=h+cR(e,H,P,G),ve=h+dR(e,H,P,G,ne);if(N==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&C<=d){_(w,0,T);continue}if(j&&X<=d){M(P,W),_(P+1,0,ve),P++;continue}if(w>=0&&C<=d){if(y>w||y===w&&b>0){_();continue}const ce=w;_(ce,0,T),P=ce;continue}if(Q>d&&s[P]!==null){_(),q(P,0),P++;continue}_();continue}M(P,W),R(H,j,P,ne,G,W),P++}if(m){const H=w===B.consumedEndSegmentIndex?T:h;_(B.consumedEndSegmentIndex,0,H)}}return f}let D5=null;function _S(){return D5===null&&(D5=new Intl.Segmenter(void 0,{granularity:"grapheme"})),D5}function Yat(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function Jat(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=GA(d),l=gb.has(d)}function c(d,f){i.push(d),s=s||f;const h=GA(d);d.length===1&&Hh.has(d)?r=r||h:r=h,l=!1}for(const d of _S().segment(e)){const f=d.segment,h=Pu(f);if(i.length===0){u(f,d.index,h);continue}if(l||wS.has(f)||Hh.has(f)||t.carryCJKAfterClosingQuote&&h&&r){c(f,h);continue}if(!s&&!h){c(f,h);continue}a(),u(f,d.index,h)}return a(),n}function Xat(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(a,u){const c=t[a].start,d=u=0&&!OZ(t[a-1].text,n)&&l(a),o<0&&(o=a),s=s||Pu(u.text)}return l(t.length),i}function fR(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=_S();for(const o of i.segment(e))n++;return n}function eut(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function tut(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const i of _S().segment(e))n++,eut(i.segment)&&t.push(n);return t.length===0?null:t}function nut(e,t,n){return t>1?e+(t-1)*n:e}function iut(e,t,n,i,o){const s=kb(),{cache:r,emojiCorrection:l}=Pat(t,Fat(e.normalized)),a=ah("-",bd("-",r),l)+(o===0?0:o*2),c=ah(" ",bd(" ",r),l)*8,d=o!==0;if(e.len===0)return Yat();const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=n?[]:null,b=[],w=[],C=[],T=n?[]:null,N=Array.from({length:e.len});function I(E,M,R,q,z,$,B,P,H){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(v=!1),f.push(M),h.push(R),m.push(q),g.push(z),y?.push($),b.push(B),w.push(P),d&&C.push(H),T!==null&&T.push(E)}function S(E,M,R,q,z){const $=bd(E,r),B=d?fR(E,M):0,P=nut(ah(E,$,l),B,o),H=M==="space"||M==="preserved-space"||M==="zero-width-break"?0:P,j=H===0?0:H+(B>0?o:0),G=M==="space"||M==="zero-width-break"?0:P;if(z&&q&&E.length>1){let ne="sum-graphemes";o!==0?ne="segment-prefixes":K4(E)?ne="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ne="segment-prefixes");const W=$at(E,$,r,l,ne),Q=W===null||i==="keep-all"?null:tut(E);I(E,P,j,G,M,R,W,Q,B);return}I(E,P,j,G,M,R,null,null,B)}for(let E=0;E{n>t&&(t=n)}),t}const aut={key:0,class:"slash-empty",role:"status"},uut=["id","aria-selected","onMouseenter","onMousedown"],cut={class:"slash-name"},dut={key:0,class:"slash-match"},fut={class:"slash-desc"},hut={key:0,class:"slash-desc-match"},put=rt({__name:"SlashMenu",props:{items:{},activeIndex:{},query:{default:""},ranges:{},layout:{default:"popup"}},emits:["select","hover"],setup(e,{expose:t,emit:n}){const{t:i}=Ut(),o=e,s=n;function r(I,S){if(!S||S.length===0)return[{text:I,hit:!1}];const _=[];let x=0;for(const[E,M]of[...S].sort((R,q)=>R[0]-q[0]))E>x&&_.push({text:I.slice(x,E),hit:!1}),_.push({text:I.slice(E,M),hit:!0}),x=M;return xo.items.map((I,S)=>{const _=l(I),x=o.ranges?.[S]??Ule(o.query,I.name,_);return{item:I,namePieces:r(I.name,x.name),desc:_,descPieces:r(_,x.desc)}})),u=V(null),c=V(null);t({el:c});const d=V(!1),f=V(!1);let h=null;const m=V(null);function g(){const I=u.value;if(!I)return;d.value=I.scrollTop>0,f.value=I.scrollTop+I.clientHeight{j.pointerId!==x||R<=0||(S.scrollTop=$+(j.clientY-z)/R*q)},P=j=>{j.pointerId===x&&H()},H=()=>{window.removeEventListener("pointerup",P),window.removeEventListener("pointermove",B),window.removeEventListener("pointercancel",P),y===H&&(y=null)};y=H,window.addEventListener("pointermove",B),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P)}const w=D(()=>{const I=d.value,S=f.value,_="var(--menu-scroll-fade)";if(I&&S)return`linear-gradient(to bottom, transparent 0, black ${_}, black calc(100% - ${_}), transparent 100%)`;if(I)return`linear-gradient(to bottom, transparent, black ${_})`;if(S)return`linear-gradient(to top, transparent, black ${_})`}),C=V("");function T(){const I=c.value,S=u.value,_=I?.offsetParent;if(!I||!S||!_)return;const x=getComputedStyle(I),E=parseFloat(x.getPropertyValue("--space-2"))||8,M=parseFloat(x.getPropertyValue("--space-2"))||8,R=(parseFloat(x.paddingTop)||0)+(parseFloat(x.paddingBottom)||0),q=parseFloat(getComputedStyle(S).getPropertyValue("--p-slash-menu-h"))||Number.POSITIVE_INFINITY,z=window.visualViewport?.offsetTop??0,$=_.getBoundingClientRect().top-z-E-M-R;C.value=`${Math.max(Math.floor(Math.min(q,$)),0)}px`,ft(()=>{g(),N()})}kn(()=>{if(o.layout==="sheet"){g(),typeof ResizeObserver=="function"&&u.value&&(h=new ResizeObserver(()=>g()),h.observe(u.value));return}if(T(),g(),typeof ResizeObserver=="function"&&u.value){h=new ResizeObserver(S=>{for(const _ of S)_.target===u.value?g():T()}),h.observe(u.value);const I=c.value?.offsetParent;I&&h.observe(I)}window.addEventListener("resize",T),window.visualViewport?.addEventListener("resize",T),window.visualViewport?.addEventListener("scroll",T)}),Ln(()=>{h?.disconnect(),h=null,y?.(),window.removeEventListener("resize",T),window.visualViewport?.removeEventListener("resize",T),window.visualViewport?.removeEventListener("scroll",T)});function N(){const I=u.value;if(!I)return;const S=I.querySelectorAll('[role="option"]')[o.activeIndex];if(!S)return;const _=I.getBoundingClientRect(),x=S.getBoundingClientRect(),E=x.top-_.top+I.scrollTop,M=E+x.height;EI.scrollTop+I.clientHeight&&(I.scrollTop=M-I.clientHeight)}return We(()=>o.activeIndex,()=>{ft(N)}),We(()=>o.items,()=>{ft(()=>{g(),N()})}),(I,S)=>(k(),L("div",{ref_key:"menuEl",ref:c,class:Re(["slash-menu",{"is-sheet":e.layout==="sheet"}]),"data-menu-frame":""},[e.items.length===0?(k(),L("div",aut,F(p(i)("composer.noCommands")),1)):ee("",!0),ai(A("div",{id:"composer-slash-menu",ref_key:"scrollEl",ref:u,class:"slash-scroll",role:"listbox",style:sn({maskImage:w.value,maxHeight:C.value}),onScroll:v},[(k(!0),L(De,null,Ct(a.value,(_,x)=>(k(),L("div",{key:`${_.item.name}-${x}`,id:`composer-slash-option-${x}`,class:Re(["slash-item",{active:x===o.activeIndex}]),role:"option","aria-selected":x===o.activeIndex,onMouseenter:E=>s("hover",x),onMousedown:Tt(E=>s("select",_.item),["prevent"])},[A("span",cut,[(k(!0),L(De,null,Ct(_.namePieces,(E,M)=>(k(),L(De,{key:M},[E.hit?(k(),L("span",dut,F(E.text),1)):(k(),L(De,{key:1},[Oe(F(E.text),1)],64))],64))),128))]),A("span",fut,[(k(!0),L(De,null,Ct(_.descPieces,(E,M)=>(k(),L(De,{key:M},[E.hit?(k(),L("span",hut,F(E.text),1)):(k(),L(De,{key:1},[Oe(F(E.text),1)],64))],64))),128))])],42,uut))),128))],36),[[Qo,e.items.length>0]]),m.value&&e.items.length>0?(k(),L("div",{key:1,class:"scroll-thumb",onPointerdown:b,style:sn({top:`${m.value.top}px`,height:`${m.value.height}px`})},null,36)):ee("",!0)],2))}}),hR=St(put,[["__scopeId","data-v-62eaf4c2"]]),mut={key:0,class:"mention-state dim",role:"status"},gut={key:1,class:"mention-state dim",role:"status"},vut=["id","aria-selected","onMouseenter","onMousedown"],yut=["innerHTML"],kut={class:"mention-name"},but={key:0,class:"mention-hit"},wut={class:"mention-meta"},Cut={class:"mention-name"},Aut={key:0,class:"mention-hit"},xut={key:0,class:"mention-meta"},Sut={key:0,class:"mention-hit"},_ut=rt({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean},stale:{type:Boolean,default:!1},layout:{default:"popup"}},emits:["select","hover"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=Ut();function r(x){return x.kind==="skill"?`skill:${x.skill.name}`:x.file.path}function l(x){return x.kind==="skill"?eb("skill","",x.skill.name):mx(x.file.path,x.file.name,x.kind==="folder")}function a(x){const E=x.endsWith("/")?x.slice(0,-1):x,M=E.lastIndexOf("/");return M===-1?"":E.slice(0,M)}function u(x){return d5(x.skill.name,x.matchPositions,0)}function c(x){const E=x.path.endsWith("/")?x.path.slice(0,-1):x.path;return d5(x.name,x.matchPositions,Math.max(0,E.length-x.name.length))}function d(x){return d5(a(x.path),x.matchPositions,0)}const f=V(null),h=V(null);t({el:h});const m=V(!1),g=V(!1);let v=null;const y=V(null);function b(){const x=f.value;if(!x)return;m.value=x.scrollTop>0,g.value=x.scrollTop+x.clientHeight{W.pointerId!==R||$<=0||(E.scrollTop=H+(W.clientY-P)/$*B)},G=W=>{W.pointerId===R&&ne()},ne=()=>{window.removeEventListener("pointerup",G),window.removeEventListener("pointermove",j),window.removeEventListener("pointercancel",G),C===ne&&(C=null)};C=ne,window.addEventListener("pointermove",j),window.addEventListener("pointerup",G),window.addEventListener("pointercancel",G)}const N=D(()=>{const x=m.value,E=g.value,M="var(--menu-scroll-fade)";if(x&&E)return`linear-gradient(to bottom, transparent 0, black ${M}, black calc(100% - ${M}), transparent 100%)`;if(x)return`linear-gradient(to bottom, transparent, black ${M})`;if(E)return`linear-gradient(to top, transparent, black ${M})`}),I=V("");function S(){const x=h.value,E=f.value,M=x?.offsetParent;if(!x||!E||!M)return;const R=getComputedStyle(x),q=parseFloat(R.getPropertyValue("--space-2"))||8,z=parseFloat(R.getPropertyValue("--space-2"))||8,$=(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0),B=parseFloat(getComputedStyle(E).getPropertyValue("--p-mention-menu-h"))||Number.POSITIVE_INFINITY,P=window.visualViewport?.offsetTop??0,H=M.getBoundingClientRect().top-P-q-z-$;I.value=`${Math.max(Math.floor(Math.min(B,H)),0)}px`,ft(()=>{b(),_()})}kn(()=>{if(i.layout==="sheet"){b(),typeof ResizeObserver=="function"&&f.value&&(v=new ResizeObserver(()=>b()),v.observe(f.value));return}if(S(),b(),typeof ResizeObserver=="function"&&f.value){v=new ResizeObserver(E=>{for(const M of E)M.target===f.value?b():S()}),v.observe(f.value);const x=h.value?.offsetParent;x&&v.observe(x)}window.addEventListener("resize",S),window.visualViewport?.addEventListener("resize",S),window.visualViewport?.addEventListener("scroll",S)}),Ln(()=>{v?.disconnect(),v=null,C?.(),window.removeEventListener("resize",S),window.visualViewport?.removeEventListener("resize",S),window.visualViewport?.removeEventListener("scroll",S)});function _(){const x=f.value;if(!x)return;const E=x.querySelectorAll('[role="option"]')[i.activeIndex];if(!E)return;const M=x.getBoundingClientRect(),R=E.getBoundingClientRect(),q=R.top-M.top+x.scrollTop,z=q+R.height;qx.scrollTop+x.clientHeight&&(x.scrollTop=z-x.clientHeight)}return We(()=>i.activeIndex,()=>{ft(_)}),We(()=>i.items,()=>{ft(()=>{b(),_()})}),(x,E)=>(k(),L("div",{ref_key:"menuEl",ref:h,class:Re(["mention-menu",{"is-sheet":e.layout==="sheet"}]),"data-menu-frame":""},[i.loading&&i.items.length===0?(k(),L("div",mut,F(p(s)("mention.searching")),1)):i.items.length===0?(k(),L("div",gut,F(p(s)("mention.noMatch")),1)):ee("",!0),i.loading&&i.items.length>0?(k(),de(p(uo),{key:2,class:"mention-spin",size:"xs"})):ee("",!0),ai(A("div",{id:"composer-mention-menu",ref_key:"scrollEl",ref:f,class:"mention-scroll",role:"listbox",style:sn({maskImage:N.value,maxHeight:I.value}),onScroll:w},[(k(!0),L(De,null,Ct(i.items,(M,R)=>(k(),L("div",{key:r(M),id:`composer-mention-option-${R}`,class:Re(["mention-item",{active:R===i.activeIndex,stale:i.stale&&M.kind!=="skill"}]),role:"option","aria-selected":R===i.activeIndex,onMouseenter:q=>o("hover",R),onMousedown:Tt(q=>o("select",M),["prevent"])},[A("span",{class:"mention-icon",innerHTML:l(M),"aria-hidden":"true"},null,8,yut),M.kind==="skill"?(k(),L(De,{key:0},[A("span",kut,[(k(!0),L(De,null,Ct(u(M),(q,z)=>(k(),L(De,{key:z},[q.hit?(k(),L("span",but,F(q.text),1)):(k(),L(De,{key:1},[Oe(F(q.text),1)],64))],64))),128))]),A("span",wut,F(M.skill.description),1)],64)):(k(),L(De,{key:1},[A("span",Cut,[(k(!0),L(De,null,Ct(c(M.file),(q,z)=>(k(),L(De,{key:z},[q.hit?(k(),L("span",Aut,F(q.text),1)):(k(),L(De,{key:1},[Oe(F(q.text),1)],64))],64))),128))]),a(M.file.path)?(k(),L("span",xut,[(k(!0),L(De,null,Ct(d(M.file),(q,z)=>(k(),L(De,{key:z},[q.hit?(k(),L("span",Sut,F(q.text),1)):(k(),L(De,{key:1},[Oe(F(q.text),1)],64))],64))),128))])):ee("",!0)],64))],42,vut))),128))],36),[[Qo,i.items.length>0]]),y.value&&i.items.length>0?(k(),L("div",{key:3,class:"scroll-thumb",onPointerdown:T,style:sn({top:`${y.value.top}px`,height:`${y.value.height}px`})},null,36)):ee("",!0)],2))}}),pR=St(_ut,[["__scopeId","data-v-7c3431cd"]]),Mut=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","vue:error","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],WZ=500,G4=256*1024,mR=200,F5=16384,B5=500,R5=50,O5=50,Iut=6,Tut=/api[_-]?key|authorization|token|secret|password|cookie|credential|email|phone|nickname|avatar/i,Eut=/^[A-Za-z0-9+/=_-]{200,}$/;let $5=null;function eu(){if($5!==null)return $5;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=ps(xn.debug)==="1"),$5=e,e}const Ld=[],Zp=[];let Sg=0;const Jf=[];let _g=0,Lut=1;const Q4=new TextEncoder,Nut=new Set(Mut),MS=V(0),Mg=Ya(!1);function Dut(){return Ld}function Fut(){Ld.length=0,Zp.length=0,Sg=0,Jf.length=0,_g=0,MS.value++}function Dc(e){if(!Mg.value){try{const t={id:Lut++,ts:Date.now(),source:e.source,kind:String(k1(e.kind)),label:String(k1(e.label)),sessionId:e.sessionId===void 0?void 0:String(k1(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:hf(e.detail)},n=JSON.stringify(t),i=Q4.encode(n).byteLength;if(i>G4)return;for(Ld.push(t),Zp.push(n),Sg+=i+(Zp.length>1?1:0);Ld.length>WZ||Sg>G4;){const o=Zp.shift();Ld.shift(),o!==void 0&&(Sg-=Q4.encode(o).byteLength,Zp.length>0&&(Sg-=1))}}catch{return}MS.value++}}function Of(e){if(typeof e=="string")return e.length<=mR?e:e.slice(0,mR)}function ra(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function But(e,t){if(Nut.has(e))try{const n={ts:Date.now(),event:e,sessionId:Of(t?.sessionId),status:Of(t?.status),operation:Of(t?.operation),seq:ra(t?.seq),durationMs:ra(t?.durationMs),messageCount:ra(t?.messageCount),contentCount:ra(t?.contentCount),mediaCount:ra(t?.mediaCount),sessionCount:ra(t?.sessionCount),workspaceCount:ra(t?.workspaceCount),promptId:Of(t?.promptId),zipBytes:ra(t?.zipBytes),errorName:Of(t?.errorName),errorCode:ra(t?.errorCode),requestId:Of(t?.requestId),phase:Of(t?.phase),httpStatus:ra(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:ra(t?.line),col:ra(t?.col)},i=JSON.stringify(n),o=Q4.encode(i).byteLength;if(o>G4)return;for(Jf.push(i),_g+=o+(Jf.length>1?1:0);Jf.length>WZ||_g>G4;){const s=Jf.shift();s!==void 0&&(_g-=Q4.encode(s).byteLength,Jf.length>0&&(_g-=1))}}catch{return}}function k1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const s=e;return Eut.test(s)?`[base64-like, ${s.length} chars omitted]`:s.length>B5?`${s.slice(0,B5)}… [+${s.length-B5} chars]`:s}if(n!=="object")return String(e);if(t>=Iut)return"[max depth]";if(Array.isArray(e)){const s=e.slice(0,R5).map(r=>k1(r,t+1));return e.length>R5&&s.push(`[+${e.length-R5} more items]`),s}const i={},o=Object.entries(e);for(const[s,r]of o.slice(0,O5))i[s]=Tut.test(s)?"[redacted]":k1(r,t+1);return o.length>O5&&(i._truncatedKeys=o.length-O5),i}function hf(e){if(e===void 0)return;const t=k1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>F5)return{_truncated:`detail JSON was ${n.length} chars; first ${F5} kept`,preview:n.slice(0,F5)}}catch{return"[unserializable detail]"}return t}function Rut(e){eu()&&Dc({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:hf(e.body)}})}function Out(e){if(!eu())return;const t=e.code!==0;Dc({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:hf(e.data)}})}function $ut(e){eu()&&Dc({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function Put(e,t){eu()&&Dc({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:hf(t)})}function zut(e){if(!eu())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",i=t.payload,o=typeof i?.session_id=="string"?i.session_id:void 0;Dc({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:hf(e)})}function jut(e){if(!eu())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",i=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,s=typeof t.offset=="number"?t.offset:void 0,r=[i,o!==void 0?`seq=${o}`:void 0,s!==void 0?`offset=${s}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Dc({source:"ws",kind:"ws:in",eventType:n,sessionId:i,seq:o,offset:s,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:hf(t.payload)})}const Hut={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Wut(e,t,n){eu()&&Dc({source:"client",kind:`client:${e}`,label:`${Hut[e]} ${t}`,detail:hf(n)})}function qut(e,t){eu()&&Dc({source:"client",kind:"client:event",label:`· ${e}`,detail:hf(t)})}function rv(e,t){But(e,t),Dc({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let P5=!1,ky=null;function Uut(e,t){const n=e instanceof Error?e.name:"Error";rv("vue:error",{status:"failed",errorName:n,info:t}),yu(`[kimi-web] vue error (${t}): ${e instanceof Error?e.message:String(e)}`,e instanceof Error?e.stack:void 0)}function Vut(){if(P5)return()=>ky?.();P5=!0;const e=[];try{if(typeof window<"u"){const n=o=>{rv("window:error",{status:"failed",errorName:o.error instanceof Error?o.error.name:"Error",line:o.lineno,col:o.colno}),yu(`[kimi-web] window error: ${o.message}`,o.error instanceof Error?o.error.stack:void 0)},i=o=>{const s=o.reason;rv("window:unhandled-rejection",{status:"failed",errorName:s instanceof Error?s.name:typeof s}),yu(`[kimi-web] unhandled rejection: ${Zut(s)}`,s instanceof Error?s.stack:void 0)};window.addEventListener("error",n),window.addEventListener("unhandledrejection",i),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",i)})}}catch{}if(eu())for(const n of["error","warn","log","info","debug"]){const i=console[n];if(typeof i!="function")continue;const o=(...s)=>{try{Wut(n,s.map(Kut).join(" "),s.length>1?s:s[0])}catch{}i.apply(console,s)};console[n]=o,e.push(()=>{console[n]===o&&(console[n]=i)})}const t=()=>{if(ky===t){for(const n of e.toReversed())n();ky=null,P5=!1}};return ky=t,t}function Kut(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function Zut(e){if(e instanceof Error)return e.message;try{return String(e)}catch{return"[unstringifiable reason]"}}function qZ(e=Ld){if(typeof document>"u")return;const t=new Blob([Gut(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let i;try{i=document.createElement("a"),i.href=n,i.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(i),i.click()}finally{i?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Gut(e=Ld){return e===Ld?Zp.join(` `):e.map(t=>JSON.stringify(t)).join(` -`)}function Xut(){return Yf.join(` -`)}const mR=Cn.clientId,ect="kimi-code-web",tct="web";function nct(){return{serverHttpUrl:oct(),clientId:rct(),clientName:ect,clientVersion:lct(),clientUiMode:tct}}function ict(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function oct(){const e=UZ();return JA(e||void 0)}const gR="kimi-desktop-server-origin";function UZ(){if(typeof window>"u")return;const e=new URLSearchParams(window.location.search).get("kimi_origin");try{return e?(window.sessionStorage.setItem(gR,e),e):window.sessionStorage.getItem(gR)??void 0}catch{return e??void 0}}function JA(e){const t=e&&e.trim()?e:ict(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function vR(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function sct(){if(typeof window<"u"){const t=UZ();if(t)return vR(JA(t))}const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return vR(e)}function rct(){const e=ms(mR);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return fs(mR,t),t}function lct(){return"0.38.0".trim()?"0.38.0":"0.0.0-dev"}const act={restRequest:e=>Put(e),restResponse:e=>zut(e),restFailure:e=>jut(e),wsEvent:e=>{switch(e.kind){case"lifecycle":Hut(e.event,e.detail);break;case"in":qut(e.frame);break;case"out":Wut(e.frame);break}},traceKeyEvent:(e,t)=>lv(e,t)},uct={getToken:jse,markAuthRequired:Use},cct=(e,t)=>t===void 0?zh.global.t(e):zh.global.t(e,t);function dct(){const e=nct();return Dwe({origin:e.serverHttpUrl,identity:{clientId:e.clientId,clientName:e.clientName,clientVersion:e.clientVersion,clientUiMode:e.clientUiMode},tracer:act,credentialStore:uct,t:cct})}const fct=dct();function b1(){return fct}const hct={class:"cin-wrap"},pct=["onClick"],mct={class:"am-icon"},gct={class:"am-name"},vct={key:0,class:"am-desc"},yct={class:"input-row"},kct=["data-empty","data-wm"],bct=["aria-label"],wct={class:"toolbar-left"},Cct=["aria-label","onKeydown"],Act={class:"perm-pill-label"},xct=["onClick"],Sct={class:"pd-info"},_ct={class:"pd-desc"},Mct={class:"pd-check"},Ict={key:1,class:"swarm-chip"},Tct={class:"swarm-label"},Ect=["aria-label"],Lct=["aria-expanded","aria-label"],Nct={key:0,class:"think-suffix"},Dct=["aria-label"],Fct=["aria-label"],Bct=["aria-label"],Rct=["aria-label","disabled"],$ct={class:"md-list"},Oct={key:0,class:"md-section"},Pct=["onClick"],zct={class:"md-check"},jct={class:"md-name"},Hct={class:"md-provider"},Wct={key:1,class:"md-divider"},qct={key:2,class:"md-section"},Uct=["onClick"],Vct={class:"md-check"},Kct={class:"md-name"},Zct={key:0,class:"md-divider"},Gct={class:"md-thinking"},Qct={class:"md-name"},Yct={key:0,class:"md-note"},Jct={key:2,class:"md-note"},Xct={class:"md-cache-note"},edt={class:"md-check md-more-icon"},tdt={class:"md-name"},ndt={key:0,class:"composer-footer"},idt={class:"drop-card"},odt={class:"msheet-search"},sdt={class:"msheet-search"},rdt=["onClick"],ldt={class:"am-icon"},adt={class:"am-name"},udt={key:0,class:"am-desc"},j5=new Map,cdt=lt({__name:"Composer",props:{running:{type:Boolean,default:!1},working:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},authReady:{type:Boolean},managedSignedIn:{type:Boolean},managedMembership:{},starredIds:{default:()=>[]},skills:{default:()=>[]},skillsLoaded:{type:Boolean,default:!1},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","focusGoal","compact","pickModel","selectModel","login"],setup(e,{expose:t,emit:n}){const i=e,o=Ec(),s=D(()=>i.starting?l("composer.starting"):i.running?l(o.value?"composer.placeholderRunningMobile":"composer.placeholderRunning"):i.goalMode?l("status.goalPlaceholder"):i.planArmed||i.planMode?l("status.planPlaceholder"):l("composer.placeholder")),r=n,{t:l,locale:a}=qt(),u=Ga(),{text:c,editorRef:d,loadForEdit:f,clearDraft:h,loadDraftAttachments:m,saveDraftAttachments:g,saveDraft:v}=aPe({sessionId:()=>i.sessionId,onBeforeSessionSave:Ie=>{C(Ie)}}),y=V([]);let b=null;function w(){P.resetBrowsing(),b=null}function C(Ie){for(;P.isBrowsing();)P.recallNewer();b!==null&&(v(Ie,c.value),g(Ie,b),S?.setText(c.value,{entries:b}),b=null)}function T(Ie){y.value=Ie,g(i.sessionId,Ie)}function N(){g(i.sessionId,[])}const I=V(null);let S=null,_=null,x=null;yn(()=>{const Ie=I.value;if(!Ie)return;S=SIe(Ie,{initialText:c.value,onChange:Ge=>{c.value=Ge,jt()},handleKeyDown:Ge=>Zi(Ge),onBlur:Ht,onWorkModeDismiss:Xo,onCompositionStart:Er,onCompositionEnd:Bo,attachments:{initialEntries:m(i.sessionId),onRegistryChange:T,onEntryDropped:Ge=>{Ge.previewUrl!==void 0&&URL.revokeObjectURL(Ge.previewUrl)}}}),S.setEditable(!i.starting),d.value=S,_=_V(()=>I.value),Jp(()=>{S?.setWorkMode(yo.value?{mode:yo.value,label:yo.value==="goal"?l("status.goalLabel"):l("status.planLabel"),dismissLabel:l("status.workModeDismiss")}:null)}),Jp(()=>{S?.setPlaceholder(s.value)});function at(Ge){if(S){if(S.restoreState(Ge)){const kt=S.getText();kt!==c.value&&(c.value=kt)}else S.setText(c.value,{entries:m(Ge)});y.value=S.getAttachmentEntries(),Nt(),x?.(),x=d5(Ge,S)}}i.sessionId?at(i.sessionId):x=d5(ad,S),y.value=S.getAttachmentEntries(),Nt(),ot(),We(()=>i.sessionId,(Ge,kt)=>{!S||Ge===kt||(kt&&S.stashState(kt),Ge?at(Ge):(x?.(),x=d5(ad,S),S.setText(c.value,{entries:m(void 0)}),y.value=S.getAttachmentEntries(),Nt()),ot())}),We(c,Ge=>{if(S&&Ge!==S.getText()){const kt=Lt;Lt=null,S.setText(Ge,{entries:kt!==null?Qt(S.getAttachmentEntries(),kt):S.getAttachmentEntries()})}}),We(y,()=>{const Ge=i.sessionId;for(const kt of y.value)kt.sessionId!==void 0&&kt.sessionId!==Ge&&kt.error===void 0&&S?.updateAttachmentEntry(kt.attId,{error:"upload-interrupted"})},{deep:!0}),We(()=>i.starting,Ge=>S?.setEditable(!Ge)),Jp(()=>{const Ge=S?.dom;if(!Ge)return;Ge.setAttribute("aria-label",mse(s.value)),Ge.setAttribute("aria-expanded",String(!!ue.value));const kt=ue.value;kt?Ge.setAttribute("aria-controls",kt):Ge.removeAttribute("aria-controls");const Yt=se.value;Yt?Ge.setAttribute("aria-activedescendant",Yt):Ge.removeAttribute("aria-activedescendant")})}),Ln(()=>{C(i.sessionId),S&&i.sessionId&&(c.value!==S.getText()&&S.setText(c.value,{entries:S.getAttachmentEntries()}),S.stashState(i.sessionId)),x?.(),x=null,_?.(),S?.destroy(),S=null,d.value=null});const E=V(!1);function M(){E.value=!E.value,ht(()=>{B(),S?.focus()})}function R(){E.value&&(E.value=!1,ht(B))}const q=36;function z(Ie){if(typeof getComputedStyle>"u")return q;const at=Number.parseFloat(getComputedStyle(Ie).minHeight);return Number.isFinite(at)&&at>0?at:q}const O=V(!1);function B(){const Ie=I.value;O.value=!!Ie&&Ie.scrollHeight>z(Ie)}We(c,()=>{ht(B)});const P=fPe({text:c,editorRef:d,sessionId:()=>i.sessionId});function H(){Lr.value||(i.goalMode&&r("toggleGoal"),r("togglePlan"))}function j(){if(Zs.value){r("focusGoal");return}i.goalMode||(Lr.value&&r("togglePlan"),r("toggleGoal"))}const{open:Z,items:ie,ranges:W,active:Q,update:te,select:X}=hPe({text:c,editorRef:d,skills:()=>i.skills,emitCommand:Ie=>{if(Ie==="/plan"){H();return}if(Ie==="/goal"){j();return}if(Ie==="/swarm"){lo.value||r("toggleSwarm");return}r("command",{cmd:Ie,attachments:[]})},historyPush:Ie=>P.push(Ie),clearDraft:h,resolveDesc:Ie=>Ie.isSkill?Ie.desc:l(Ie.desc)}),ge=D(()=>c.value.startsWith("/")&&!c.value.includes(" ")?c.value.slice(1):""),ue=D(()=>{if(Z.value)return"composer-slash-menu";if(fe.value)return"composer-mention-menu"}),se=D(()=>{if(Z.value&&ie.value.length>0)return`composer-slash-option-${Q.value}`;if(fe.value&&G.value.length>0)return`composer-mention-option-${ae.value}`}),{open:fe,items:G,active:ae,loading:K,fileStale:re,update:be,close:ke,select:we,navigate:oe,getToken:le}=vPe({text:c,editorRef:d,searchFiles:()=>i.searchFiles,skills:()=>i.skills,insertMention:(Ie,at)=>{S?.insertMention(Ie.kind==="skill"?{kind:"skill",name:Ie.name,path:""}:{kind:Ie.kind,name:Ie.name,path:Ie.path},at)}}),ye=D({get:()=>ge.value,set:Ie=>{c.value=`/${Ie}`,te()}}),Ae=V(null),_e=V("");We(_e,Ie=>{const at=Ae.value;if(at==null||!fe.value)return;const Ge=c.value,Yt=Ge.slice(at+1).search(/\s/),mn=Yt===-1?Ge.length:at+1+Yt;c.value=`${Ge.slice(0,at)}@${Ie}${Ge.slice(mn)}`,ht(()=>{const En=d.value,Jn=at+1+Ie.length;En?.setSelectionRange(Jn,Jn),be()})});const pe=V(null),ne=V(null);We(Z,Ie=>{Ie&&o.value&&ht(()=>pe.value?.focus())}),We(fe,Ie=>{if(Ie&&o.value){const at=le();Ae.value=at?.start??null,_e.value=at?.token??"",ht(()=>ne.value?.focus())}else Ae.value=null});function Ee(){Z.value=!1}function qe(){ke()}function ze(){Ve()}const ft=V(null),gt=V(null),_t=D(()=>ft.value?.el??null),Pt=D(()=>gt.value?.el??null);ld(Z,_t),ld(fe,Pt),We(()=>i.sessionId,()=>{E.value=!1,Z.value=!1,ke()});function Ht(){o.value||(Z.value=!1,ke())}function jt(){w(),te(),be(),(Z.value||fe.value||bi.value)&&Ve()}function Te(Ie){const at=S;if(w(),!at)return;let Ge=document.activeElement===at.dom?at.selectionStart??void 0:at.getText().length;for(const kt of Ie){const Yt=BPe(y.value,kt);at.insertAttachment({attId:Yt.attId,name:Yt.name,kind:"folder"},Ge),Ge=void 0,Yt.entry&&at.upsertAttachmentEntry(Yt.entry)}Z.value=!1,ke()}function Fe(Ie,at,Ge,kt,Yt){const mn=`${Ge??ad} ${kt}`,En=(j5.get(mn)??0)+1;j5.set(mn,En);const Jn=()=>j5.get(mn)===En;let xn=-1,gi=0;Yt(Ie,at,(ws,_l)=>{if(!Jn()||_l<=0)return;const tu=Math.floor(ws/_l*100),nu=Date.now();tu!==xn&&(ws<_l&&nu-gi<120||(xn=tu,gi=nu,wt(Ge,kt,{uploadProgress:ws/_l})))}).then(ws=>{Jn()&&wt(Ge,kt,ws?{fileId:ws.fileId,mediaType:ws.mediaType,uploading:!1,error:void 0,uploadProgress:void 0}:{uploading:!1,error:"upload-failed",uploadProgress:void 0})}).catch(()=>{Jn()&&wt(Ge,kt,{uploading:!1,error:"upload-failed",uploadProgress:void 0})})}function Ke(Ie,at,Ge){const kt=S,Yt=i.uploadImage;if(!kt||!Yt)return!1;const mn=iK(Ie.type);let En;Ge?En=kt.textOffsetAtCoords({left:Ge.clientX,top:Ge.clientY})??kt.getText().length:En=document.activeElement===kt.dom?kt.selectionStart??void 0:kt.getText().length;const Jn=FPe(y.value,{name:Ie.name,size:Ie.size,path:at,mediaType:Ie.type||void 0,lastModified:Ie.lastModified||void 0,kind:mn}),xn=mn!=="file"?URL.createObjectURL(Ie):void 0;if(Jn.entry)kt.insertAttachment({attId:Jn.attId,name:Ie.name,kind:mn},En),kt.upsertAttachmentEntry(xn!==void 0?{...Jn.entry,previewUrl:xn}:Jn.entry);else if(Jn.startUpload){const gi=y.value.find(hr=>hr.attId===Jn.attId);kt.upsertAttachmentEntry({...gi,key:gi.path!==void 0?gi.key:`blob:${Jn.attId}`,uploading:!0,error:void 0,uploadProgress:void 0,sessionId:void 0,size:Ie.size,mediaType:Ie.type||void 0,lastModified:Ie.lastModified||void 0,...xn!==void 0?{previewUrl:xn}:{}})}else kt.insertAttachment({attId:Jn.attId,name:Ie.name,kind:mn},En),xn!==void 0&&URL.revokeObjectURL(xn);return Jn.startUpload&&Fe(Ie,Ie.name,i.sessionId,Jn.attId,Yt),!0}const rt=new Set;function Nt(){const Ie=b1();for(const at of y.value){if(at.kind!=="image"||at.fileId===void 0||at.previewUrl!==void 0)continue;const{attId:Ge,fileId:kt,sessionId:Yt}=at,mn=`${Yt??""} ${Ge} ${kt}`;if(rt.has(mn))continue;rt.add(mn),(Yt!==void 0?Ie.getSessionMediaBlob(Yt,kt):Ie.getFileBlob(kt)).then(Jn=>{if(S===null)return;const xn=y.value.find(gi=>gi.attId===Ge);xn===void 0||xn.fileId!==kt||xn.sessionId!==Yt||xn.previewUrl!==void 0||S.updateAttachmentEntry(Ge,{previewUrl:URL.createObjectURL(Jn)})}).catch(()=>{}).finally(()=>{rt.delete(mn)})}}let Lt=null;function Qt(Ie,at){const Ge=new Set(at.map(kt=>kt.attId));return[...Ie.filter(kt=>!Ge.has(kt.attId)),...at]}function Ut(Ie,at){const Ge=Ie.startsWith("m"),kt=Number(Ge?Ie.slice(1):Ie);if(!Number.isInteger(kt)||kt<1)return;let Yt=0;for(let mn=0;mn0&&!/\s/.test(mn.charAt(Yt-1))&&(Ge.insertTextAt(Yt," "),Yt+=1)}Ge.insertAttachment({attId:kt,name:Ie.name??"file",kind:"file"},Yt),Ge.upsertAttachmentEntry({attId:kt,key:f1({kind:"file",attId:kt}),kind:"file",name:Ie.name??"file",size:Ie.size,mediaType:Ie.mediaType,refCount:0,uploading:!1,fileId:Ie.fileId})}function it(Ie,at){const Ge=S;if(!Ie.fileId||!Ge)return;P.resetBrowsing();let kt;if(at!==void 0)Ge.insertTextAt(at," "),kt=at;else{const En=Ge.getText();kt=En.length,kt>0&&!/\s/.test(En.charAt(kt-1))&&(Ge.insertTextAt(kt," "),kt+=1)}const Yt=Lu(),mn=Ie.kind==="video"?"video":"image";Ge.insertAttachment({attId:Yt,name:Ie.name??mn,kind:mn},kt),Ge.upsertAttachmentEntry({attId:Yt,key:f1({kind:mn,attId:Yt}),kind:mn,name:Ie.name??mn,size:Ie.size,mediaType:Ie.mediaType,refCount:0,uploading:!1,fileId:Ie.fileId,sessionId:Ie.sessionId}),Nt()}function dt(Ie,at){const Ge=S,kt=i.uploadImage;if(Ie.url===""||!Ge||!kt)return;P.resetBrowsing();const Yt=i.sessionId;let mn;if(at!==void 0)Ge.insertTextAt(at," "),mn=at;else{const xn=Ge.getText();mn=xn.length,mn>0&&!/\s/.test(xn.charAt(mn-1))&&(Ge.insertTextAt(mn," "),mn+=1)}const En=Lu(),Jn=Ie.kind==="video"?"video":"image";Ge.insertAttachment({attId:En,name:Ie.name??Jn,kind:Jn},mn),Ge.upsertAttachmentEntry({attId:En,key:f1({kind:Jn,attId:En}),kind:Jn,name:Ie.name??Jn,size:Ie.size,mediaType:Ie.mediaType,refCount:0,uploading:!0}),fetch(Ie.url).then(xn=>xn.ok?xn.blob():Promise.reject(new Error(`media fetch ${xn.status}`))).then(xn=>{if(i.sessionId!==Yt){wt(Yt,En,{uploading:!1,error:"upload-interrupted"});return}const gi=SV(Yt??ad);if(gi!==void 0){const hr=gi.getAttachmentEntries().find(ws=>ws.attId===En);if(hr===void 0||hr.uploading!==!0)return;gi.updateAttachmentEntry(En,{size:xn.size||Ie.size,mediaType:Ie.mediaType||xn.type||void 0,previewUrl:URL.createObjectURL(xn)})}Fe(xn,Ie.name??Jn,Yt,En,kt)}).catch(()=>{wt(Yt,En,{uploading:!1,error:"upload-interrupted"})})}function wt(Ie,at,Ge){bIe(Ie??ad,at,Ge,{loadEntries:()=>m(Ie),saveEntries:kt=>g(Ie,kt)}),b!==null&&(b=OPe(b,at,Ge))}const{fileInputRef:dn,isDragOver:Gt,openFilePicker:ri,handleFileInputChange:ci,handleDragOver:ji,handleDragLeave:xi,handleDrop:Uo,adoptStoredDrafts:ot}=HPe({api:b1(),uploadImage:()=>i.uploadImage,sessionId:()=>i.sessionId,insertFolderPaths:Te,insertFileAttachment:Ke,adoptFileAttachment:en,adoptMediaAttachment:it});yn(()=>{c.value&&ht(B)}),Ln(()=>{_o()});function Ue(){S?.focus({preventScroll:!0})}function st(Ie,at,Ge){S?.insertQuote({text:Ie,...Ge!==void 0&&Ge.length>0?{source:Ge}:{}},at)}function _n(Ie){const at=PPe(Ie);Lt=at,ht(()=>{const Ge=Lt;Lt=null;const kt=S;if(!kt)return;Ge!==null&&kt.setText(c.value,{entries:Qt(kt.getAttachmentEntries(),Ge)});const Yt=new Set(kt.getOrderedAttachmentIds()),mn=new Map(ll(kt.getText()).map(xn=>[xn.attrs.attId,xn.attrs.name]));for(const xn of at)Yt.has(xn.attId)&&kt.upsertAttachmentEntry(mn.has(xn.attId)?{...xn,name:mn.get(xn.attId)}:xn);Nt();const En=new Map(zPe(Ie,Yt).map(({att:xn,ordinal:gi})=>[xn,gi])),Jn=new Set(jPe(Ie,Yt).map(({att:xn})=>xn));for(const xn of Ie){const gi=En.get(xn);if(gi!==void 0){const _l=ll(kt.getText()).find(tu=>{const nu=Number(tu.attrs.attId);return Number.isInteger(nu)&&nu>gi});en(xn,_l?.start);continue}if(!Jn.has(xn))continue;const hr=Ie.indexOf(xn),ws=ll(kt.getText()).find(_l=>{const tu=Ut(_l.attrs.attId,Ie);return tu!==void 0&&tu>hr});if(xn.fileId!==void 0){it(xn,ws?.start);continue}dt(xn,ws?.start)}})}function bt(Ie){Lt=Ie,ht(()=>{const at=Lt;Lt=null;const Ge=S;if(!Ge)return;at!==null&&Ge.setText(c.value,{entries:Qt(Ge.getAttachmentEntries(),at)});const kt=new Set(Ge.getOrderedAttachmentIds());for(const Yt of Ie)kt.has(Yt.attId)&&Ge.upsertAttachmentEntry(Yt);Nt()})}const Zn=D(()=>(c.value,$Pe(y.value,S?.getOrderedAttachmentIds()??[],{sessionId:i.sessionId})));function vs(){const Ie=RPe(S?.getOrderedAttachmentIds()??[],y.value,{sessionId:i.sessionId});return{promptAttachments:Ie.promptAttachments,fileAttIds:Ie.fileAttIds,mediaAttIds:Ie.mediaAttIds}}function go(Ie,at){return dSe(Ie,at,{resolveFolder:Ge=>y.value.find(kt=>kt.attId===Ge)?.path})}function Ls(){const Ie=S;if(!Ie)return()=>{};const at=new Map(y.value.map(kt=>[kt.attId,kt])),Ge=ll(Ie.getText()).map(kt=>kt.attrs.attId);return Ge.length===0?()=>{}:()=>{ht(()=>{const kt=S;if(!kt)return;const Yt=new Set;for(const mn of Ge){const En=at.get(mn);En!==void 0&&(kt.insertAttachment({attId:En.attId,name:En.name,kind:En.kind}),Yt.has(mn)||(kt.upsertAttachmentEntry(En),Yt.add(mn)))}})}}function Hs(){const Ie=S;if(!Ie)return;const at=new Map(y.value.map(En=>[En.attId,En])),Ge=ll(Ie.getText()).map(En=>En.attrs.attId),kt=[],Yt=new Set,mn=[];for(const En of Ge){const Jn=at.get(En);Jn!==void 0&&(Yt.has(En)||(kt.push(Jn),Yt.add(En)),mn.push(Ud({attId:Jn.attId,name:Jn.name,kind:Jn.kind})))}mn.length!==0&&(g(i.sessionId,kt),c.value=mn.join(" "))}function ys(){const Ie=c.value.trim(),at=vs();return bQe({text:Ie,rewritten:go(Ie,at),blocked:Zn.value.uploading||Zn.value.errored||Zn.value.missing,assembly:at,skillMentions:S?.getSkillMentions()??[],skills:i.skills,skillsLoaded:i.skillsLoaded,working:i.working,running:i.running,queueLength:i.queued.length,goalMode:i.goalMode})}const Vo=D(()=>ys().kind!=="noop");function Ti(){const Ie=ys();if(Ie.kind!=="noop"){if(Ie.kind==="invalid-command"){u.notify({severity:"warning",title:l("composer.noArgCommand",{cmd:Ie.cmd})});return}switch(P.push(Ie.historyText),b=null,Ie.kind){case"mode":{const at=Ls();c.value="",h(),Z.value=!1,R(),Ie.mode==="plan"?H():Ie.mode==="goal"?j():lo.value||r("toggleSwarm"),at();return}case"skill-activation":case"skill-command":case"unresolved-skill-command":{c.value="",h(),N(),Z.value=!1,R(),ke(),Ie.kind==="skill-activation"?r("command",{cmd:Ie.cmd,attachments:Ie.attachments,restoreText:Ie.restoreText,skillName:Ie.skillName,restoreEntries:y.value}):Ie.kind==="skill-command"?r("command",{cmd:Ie.cmd,attachments:Ie.attachments,restoreText:Ie.restoreText,skillName:Ie.skillName,restoreEntries:y.value}):r("command",{cmd:Ie.cmd,attachments:Ie.attachments,restoreText:Ie.restoreText,restoreEntries:y.value});return}case"builtin-command":{if(c.value="",h(),Z.value=!1,R(),Ie.leave){Hs(),r("command",{cmd:Ie.cmd,attachments:[],restoreText:Ie.restoreText,restoreEntries:y.value});return}Ls()(),r("command",{cmd:Ie.cmd,attachments:[],restoreText:Ie.restoreText,restoreEntries:y.value,editText:Ie.editText});return}case"submit":{c.value="",h(),N(),Z.value=!1,ke(),R(),r("submit",{text:Ie.text,restoreText:Ie.restoreText,editText:Ie.editText,attachments:Ie.attachments,restoreEntries:y.value});return}}}}function Tr(){if(!i.running||Zn.value.uploading||Zn.value.errored||Zn.value.missing)return;const Ie=c.value.trim(),at=vs();if(!Ie&&at.promptAttachments.length===0&&i.queued.length===0)return;const Ge={text:Fp(go(Ie,at)).trim(),attachments:at.promptAttachments};P.push(kQe(Ie)),b=null,c.value="",h(),N(),Z.value=!1,ke(),R(),r("steer",Ge)}let vo=!1,no=null;function _o(){no!==null&&(clearTimeout(no),no=null)}function Er(){_o(),vo=!0}function Bo(){_o(),no=setTimeout(()=>{no=null,vo=!1},0)}function Qn(Ie){return vo||Ie.isComposing||Ie.keyCode===229}function Zi(Ie){if(Qn(Ie))return!1;if(yo.value&&Ie.key==="Backspace"&&!Ie.shiftKey&&!Ie.altKey&&!Ie.metaKey&&!Ie.ctrlKey){const Ge=d.value;if(Ge?.selectionStart===0&&Ge.selectionEnd===0)return Ie.preventDefault(),Xo(),!0}if(Ie.key==="Escape"){if(bi.value)return Ie.preventDefault(),Ve(),!0;if(ki.value)return Ie.preventDefault(),Vn(),!0;if(di.value)return Ie.preventDefault(),bs(),!0}if(Z.value){if(Ie.key==="Escape")return Ie.preventDefault(),Z.value=!1,!0;if(Ie.key==="Tab"&&ie.value.length===0)return Z.value=!1,!1}if(Z.value&&ie.value.length>0){if(Ie.key==="ArrowDown")return Ie.preventDefault(),Q.value=(Q.value+1)%ie.value.length,!0;if(Ie.key==="ArrowUp")return Ie.preventDefault(),Q.value=(Q.value-1+ie.value.length)%ie.value.length,!0;if(Ie.key==="Enter"||Ie.key==="Tab"){Ie.preventDefault();const Ge=ie.value[Q.value];return Ge&&X(Ge),!0}}if(fe.value){if(Ie.key==="Escape")return Ie.preventDefault(),ke(),!0;if(Ie.key==="Tab"&&G.value.length===0)return ke(),!1;if(G.value.length>0){if(Ie.key==="ArrowDown")return Ie.preventDefault(),oe((ae.value+1)%G.value.length),!0;if(Ie.key==="ArrowUp")return Ie.preventDefault(),oe((ae.value-1+G.value.length)%G.value.length),!0;if(Ie.key==="Enter"||Ie.key==="Tab"){Ie.preventDefault();const Ge=G.value[ae.value];return Ge&&we(Ge),!0}}}if(Ie.key==="s"&&(Ie.ctrlKey||Ie.metaKey)&&!Ie.shiftKey&&!Ie.altKey)return Ie.preventDefault(),i.running&&Tr(),!0;const at=Z.value&&ie.value.length>0;if(!E.value&&!at&&!fe.value&&!Ie.shiftKey&&!Ie.altKey&&!Ie.metaKey&&!Ie.ctrlKey){const Ge=P.isBrowsing();if(Ie.key==="ArrowUp"&&P.canRecallOlder())return Ie.preventDefault(),Ge||(b=y.value.map(kt=>{const{previewUrl:Yt,...mn}=kt;return mn})),P.recallOlder(),Z.value=!1,!0;if(Ie.key==="ArrowDown"&&Ge){if(Ie.preventDefault(),P.recallNewer(),Z.value=!1,!P.isBrowsing()){const kt=b;b=null,kt!==null&&kt.length>0&&ht(()=>{const Yt=S;if(!Yt)return;const mn=new Set(Yt.getOrderedAttachmentIds());for(const En of kt)mn.has(En.attId)&&Yt.upsertAttachmentEntry(En);Nt()})}return!0}}return Ie.key==="Enter"&&Ie.shiftKey&&!Ie.metaKey&&!Ie.ctrlKey&&!Ie.altKey?(Ie.preventDefault(),yi(),!0):Ie.key==="Enter"&&!Ie.shiftKey&&!Ie.altKey&&(Ie.metaKey||Ie.ctrlKey||!E.value)?(Ie.preventDefault(),Ti(),!0):!1}function yi(){if(!S){c.value+=` -`,jt();return}S.insertNewlineAtCaret()}const Hi=D(()=>l("composer.send")),io=D(()=>!!i.uploadImage),ki=V(!1),di=V(!1),bi=V(!1),oo=V(null),so=V(null),Mn=V(null),Ns=V(null),Ws=V(null),Jo=V(null);ld(bi,so),ld(di,Ws);const ks=V(null),ro=V(null);let eo=null;function to(){const Ie=ks.value;if(!Ie)return;const{scrollTop:at,scrollHeight:Ge,clientHeight:kt}=Ie;if(Ge<=kt+1){ro.value=null;return}const Yt=getComputedStyle(Ie),mn=parseFloat(Yt.getPropertyValue("--menu-scrollbar-track-inset"))||0,En=parseFloat(Yt.getPropertyValue("--menu-scrollbar-thumb-min"))||24,Jn=kt-mn*2,xn=Math.max(En,kt/Ge*Jn),gi=Ge-kt,hr=Ie.offsetTop+mn+at/gi*(Jn-xn);ro.value={top:hr,height:xn}}function Gi(){to()}We(bi,async Ie=>{eo?.disconnect(),eo=null,ro.value=null,Ie&&(await ht(),to(),typeof ResizeObserver=="function"&&ks.value&&(eo=new ResizeObserver(to),eo.observe(ks.value)))}),Ln(()=>{eo?.disconnect(),eo=null});const je=V(""),xe=V(""),Pe=V(!1),rn=D(()=>{const Ie={};return je.value&&(Ie.right=je.value),xe.value&&(Ie.maxHeight=xe.value),Ie}),Yn=D(()=>ki.value||di.value||bi.value||Z.value||fe.value);t({loadForEdit:f,insertQuote:st,loadAttachmentsForEdit:_n,restoreDraftEntries:bt,focus:Ue,anyPopupOpen:Yn,isEmpty:()=>c.value.trim().length===0&&y.value.length===0});function Qi(){ki.value=!ki.value,ki.value?(ju(),di.value=!1,bi.value=!1,document.addEventListener("click",Ni,!0)):document.removeEventListener("click",Ni,!0)}function Vn(){ki.value=!1,!di.value&&!bi.value&&document.removeEventListener("click",Ni,!0)}function qs(){di.value=!di.value,di.value?(Gl(),ki.value=!1,bi.value=!1,document.addEventListener("click",Ni,!0)):document.removeEventListener("click",Ni,!0)}function bs(){di.value=!1,!ki.value&&!bi.value&&document.removeEventListener("click",Ni,!0)}function Je(){bi.value=!bi.value,bi.value?(ki.value=!1,di.value=!1,Z.value=!1,ke(),document.addEventListener("click",Ni,!0),ht(()=>{(o.value?Mn.value:so.value)?.querySelector(".am-row")?.focus()})):document.removeEventListener("click",Ni,!0)}function Ve(){bi.value=!1,!ki.value&&!di.value&&document.removeEventListener("click",Ni,!0)}const St=D(()=>{const Ie=[];return io.value&&Ie.push({id:"files",icon:"attachment",nameKey:"composer.addFiles",descKey:"composer.addFilesDesc",action:fi}),o.value&&(Ie.push({id:"slash",icon:"terminal",nameKey:"composer.addSlash",descKey:"composer.addSlashDesc",action:Io}),Ie.push({id:"mention",icon:"link",nameKey:"composer.addMention",descKey:"composer.addMentionDesc",action:ni})),Ie.push({id:"goal",icon:"target",nameKey:"status.goalLabel",descKey:"composer.addGoalDesc",action:Ro}),Ie.push({id:"plan",icon:"file-edit",nameKey:"status.planLabel",descKey:"composer.addPlanDesc",action:mi}),Ie.push({id:"swarm",icon:"sparkles",nameKey:"status.swarmLabel",descKey:"composer.addSwarmDesc",action:cr}),Ie});function Rt(Ie){Ie.action(),!(o.value&&Ie.id==="files")&&Ue()}function Fn(Ie){if(Ie.key==="Escape"){Ie.preventDefault(),Ve(),Ue();return}if(Ie.key==="Tab"){Ve();return}if(Ie.key!=="ArrowDown"&&Ie.key!=="ArrowUp")return;Ie.preventDefault();const at=o.value?Mn.value:so.value,Ge=Array.from(at?.querySelectorAll(".am-row")??[]);if(Ge.length===0)return;const kt=Ge.indexOf(document.activeElement),Yt=Ie.key==="ArrowDown"?(kt+1)%Ge.length:(kt-1+Ge.length)%Ge.length;Ge[Yt]?.focus()}function fi(){Ve(),ri()}function Mo(Ie){Ve(),c.value=Ie,ht(()=>{const at=d.value,Ge=c.value.length;at?.setSelectionRange(Ge,Ge),Ie==="/"?te():be()})}function Io(){Mo("/")}function ni(){Mo("@")}function Ro(){Ve(),i.goalMode||j()}function mi(){Ve(),Lr.value||H()}function cr(){Ve(),lo.value||r("toggleSwarm")}function Ni(Ie){const at=Ie.target,Ge=oo.value?.contains(at)??!1,kt=so.value?.contains(at)??!1;!Ge&&!kt&&(Vn(),bs(),Ve())}Ln(()=>{document.removeEventListener("click",Ni,!0)});const Us=D(()=>{const Ie=i.status?.ctxMax??0;return Ie<=0?0:Math.min(100,Math.max(0,Math.ceil((i.status?.ctxUsed??0)/Ie*100)))}),Vs=D(()=>{const Ie=Ac(i.status?.ctxUsed??0),at=Ac(i.status?.ctxMax??0);return l("status.ctxTooltip",{used:Ie,max:at,pct:Us.value})}),Ds=D(()=>Us.value>=80),$o=D(()=>i.models?.find(Ie=>Ie.id===i.status?.modelId)),zu=D(()=>K1($o.value)),Ks=D(()=>Z1($o.value)),Ul=D(()=>M6($o.value,i.thinking)),pf=D(()=>Ks.value.includes(Ul.value)?Ul.value:""),Vl=D(()=>Moe(Ul.value)),Ko=D(()=>zu.value==="unsupported"||Ks.value.length<=1),Fs=D(()=>{if(!Vl.value)return"";const Ie=($o.value?.supportEfforts?.length??0)>0,at=Ul.value;return Ie&&at!=="on"?l("composer.thinkingSuffixEffort",{level:at}):l("composer.thinkingSuffix")});function Cl(Ie){Ko.value||r("setThinking",wk($o.value,Ie))}const Ya=D(()=>Ks.value.map(Ie=>({value:Ie,label:Bd(Ie)}))),Lr=D(()=>i.planArmed===!0||i.planMode===!0),lo=D(()=>i.swarmMode===!0),Ja=D(()=>i.goal?.status??i.activationBadges?.goal?.status??null),Zs=D(()=>Ja.value!==null&&Ja.value!=="complete"),yo=D(()=>i.goalMode?"goal":i.planArmed?"plan":null);function Xo(){yo.value==="goal"?r("toggleGoal"):yo.value==="plan"&&r("togglePlan")}const Yr=[{mode:"manual",icon:"hand",color:"var(--color-text)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",icon:"shield-question",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",icon:"full-access",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Kl=V(null),Zl=V(""),Nr=V("");function Al(Ie){const at={};return Ie&&(at["--composer-menu-desc-width"]=Ie),at}const Xa=D(()=>({...Al(Zl.value),...Nr.value?{left:Nr.value}:{}}));function Gl(){const Ie=Ns.value,at=oo.value;if(!Ie||!at){Nr.value="";return}Nr.value=`${Math.round(Ie.getBoundingClientRect().left-at.getBoundingClientRect().left)}px`}function ju(){const Ie=Jo.value,at=oo.value;if(!Ie||!at){je.value="";return}je.value=`${Math.round(at.getBoundingClientRect().right-Ie.getBoundingClientRect().right)}px`}let Y=null;function ve(Ie){const at=Number.parseFloat(Ie);return Number.isFinite(at)?at:0}function Be(Ie){return`${Ie.fontStyle||"normal"} ${Ie.fontWeight||"400"} ${Ie.fontSize} ${Ie.fontFamily}`}function He(Ie){return Ie.letterSpacing==="normal"?0:ve(Ie.letterSpacing)}function Ye(Ie,at){if(!Ie)return 0;const Ge=uut(Ie,Be(at),{letterSpacing:He(at)});return cut(Ge)}function Xe(){const Ie=Kl.value?.querySelector(".pd-desc");if(!Ie)return;const at=getComputedStyle(Ie),Ge=Math.max(0,...Yr.map(kt=>Ye(l(kt.descKey),at)));Zl.value=Ge>0?`${Math.ceil(Ge)}px`:""}function vt(){typeof window>"u"||(Y!==null&&window.cancelAnimationFrame(Y),ht(()=>{Y=window.requestAnimationFrame(()=>{Y=null,Xe()})}))}We(a,()=>{vt(),Z.value&&te()},{immediate:!0}),yn(()=>{vt(),document.fonts?.ready.then(vt)}),Ln(()=>{Y!==null&&(window.cancelAnimationFrame(Y),Y=null)});function $t(Ie){r("setPermission",Ie),bs()}const Vt=D(()=>Yr.find(Ie=>Ie.mode===i.status?.permission)),pn=D(()=>Vt.value?l(Vt.value.labelKey):""),In=D(()=>Vt.value?.icon??"hand"),Bn=V(!1),an=V(!1),An=V(!1),Hn=V(!1),Wn=V(null),Di=V(null);let ao=0,dr=0,Dc=0,xl=0;function wa(){const Ie=oo.value?getComputedStyle(oo.value):null;return{valveFloor:Ie?Ne(Ie,"--composer-valve-floor",56):56,expandMargin:Ie?Ne(Ie,"--composer-valve-expand-margin",48):48}}function Me(Ie){const at=Ie.getBoundingClientRect().left;for(const Ge of Ie.querySelectorAll(".compact-chip, .ctx-group, .model-pill, .stop, .send")){const kt=Ge.getBoundingClientRect();if(kt.width>0&&kt.leftIe.clientWidth+1||Ie.clientWidth===0&&(Ie.textContent?.length??0)>0}function Ft(){const Ie=oo.value;if(!Ie)return;const{valveFloor:at,expandMargin:Ge}=wa(),kt=Ie.getBoundingClientRect().width,Yt=Di.value;if(Hn.value){kt>xl+Ge&&(Hn.value=!1,ht(Ft));return}if(An.value){if(kt>Dc+Ge){An.value=!1,ht(Ft);return}Yt&&Me(Yt)&&(xl=kt,Hn.value=!0,ht(Ft));return}if(an.value){if(kt>dr+Ge){an.value=!1,ht(Ft);return}Yt&&Me(Yt)&&(Ds.value?(Dc=kt,An.value=!0):(xl=kt,Hn.value=!0),ht(Ft));return}if(Bn.value&&kt>ao+Ge){Bn.value=!1,ht(Ft);return}const mn=Wn.value;mn!==null&&nt(mn)&&mn.getBoundingClientRect().width{typeof ResizeObserver>"u"||!oo.value||(fn=new ResizeObserver(Ft),fn.observe(oo.value))}),Ln(()=>{fn?.disconnect(),fn=null});const{fontScale:$n}=X1();We([pn,lo,Ds,Fs,()=>i.status?.model,()=>i.working,()=>i.authReady,()=>i.managedSignedIn,()=>i.managedMembership,()=>i.models?.length,$n,a],()=>{Bn.value&&(Bn.value=!1),an.value&&(an.value=!1),An.value&&(An.value=!1),Hn.value&&(Hn.value=!1),ht(Ft)}),yn(()=>{document.fonts?.ready.then(Ft)});const Gn=D(()=>`${i.status?.model??""}${Fs.value}`),zn=D(()=>$o.value?.provider??""),bo=D(()=>!zn.value||!i.models?.length?[]:i.models.filter(Ie=>Ie.provider===zn.value)),Gs=D(()=>(i.models?.length??0)>0),Sl=D(()=>i.authReady===!1&&!Gs.value),Ca=D(()=>Sl.value&&!(i.managedSignedIn??!1)),mf=D(()=>Sl.value&&(i.managedSignedIn??!1)&&i.managedMembership==="free"),Aa=D(()=>new Set(i.starredIds??[]));function xa(Ie){return Aa.value.has(Ie)}const Zh=D(()=>i.models?.length?i.models.filter(Ie=>xa(Ie.id)&&Ie.provider!==zn.value):[]),eu=V(null);ld(ki,eu);function Hv(){const Ie=eu.value,at=oo.value;if(!Ie||!at)return;const Ge=getComputedStyle(Ie),kt=ve(Ge.getPropertyValue("--space-1"))||4,Yt=ve(Ge.getPropertyValue("--space-2"))||8,mn=window.visualViewport,En=mn?.offsetTop??0,Jn=En+(mn?.height??window.innerHeight),xn=at.getBoundingClientRect(),gi=xn.top-En-kt-Yt,hr=Jn-xn.bottom-kt-Yt;Ie.offsetHeight>gi&&hr>gi?(Pe.value=!0,xe.value=`${Math.max(Math.floor(hr),0)}px`):(Pe.value=!1,xe.value=`${Math.max(Math.floor(gi),0)}px`)}function es(){Vn()}function Ql(){window.addEventListener("resize",es),window.visualViewport?.addEventListener("resize",es),window.visualViewport?.addEventListener("scroll",es)}function am(){window.removeEventListener("resize",es),window.visualViewport?.removeEventListener("resize",es),window.visualViewport?.removeEventListener("scroll",es)}We(ki,async Ie=>{if(!Ie){am();return}Ql(),Pe.value=!1,xe.value="",await ht(),Hv(),(eu.value?.querySelector(".md-row.is-current")??eu.value?.querySelector(".md-row"))?.focus()}),Ln(()=>{am()});function um(Ie){if(Ie.key!=="ArrowDown"&&Ie.key!=="ArrowUp")return;const at=Array.from(eu.value?.querySelectorAll(".md-row:not(:disabled)")??[]);if(!at.length)return;Ie.preventDefault();const Ge=at.indexOf(document.activeElement),kt=Ie.key==="ArrowDown"?(Ge+1)%at.length:(Ge-1+at.length)%at.length;at[kt]?.focus()}function fr(Ie){r("selectModel",Ie),Vn()}return(Ie,at)=>(k(),L("div",{class:Re(["composer",{"drag-over":p(Gt),expanded:E.value}]),onDragover:at[18]||(at[18]=(...Ge)=>p(ji)&&p(ji)(...Ge)),onDragleave:at[19]||(at[19]=(...Ge)=>p(xi)&&p(xi)(...Ge)),onDrop:at[20]||(at[20]=(...Ge)=>p(Uo)&&p(Uo)(...Ge))},[A("div",{class:Re(["composer-card",{"labels-collapsed":Bn.value}])},[A("div",hct,[p(Z)&&!p(o)?(k(),de(fR,{key:0,ref_key:"slashMenuRef",ref:ft,items:p(ie),ranges:p(W),"active-index":p(Q),query:ge.value,onSelect:p(X),onHover:at[0]||(at[0]=Ge=>Q.value=Ge)},null,8,["items","ranges","active-index","query","onSelect"])):ee("",!0),p(fe)&&!p(o)?(k(),de(hR,{key:1,ref_key:"mentionMenuRef",ref:gt,items:p(G),"active-index":p(ae),loading:p(K),stale:p(re),onSelect:p(we),onHover:p(oe)},null,8,["items","active-index","loading","stale","onSelect","onHover"])):ee("",!0),U(ko,{name:"composer-menu-pop"},{default:ce(()=>[bi.value&&!p(o)?(k(),L("div",{key:0,ref_key:"addMenuRef",ref:so,class:"add-menu",onClick:at[2]||(at[2]=Tt(()=>{},["stop"])),onKeydown:Fn},[A("div",{ref_key:"addScrollRef",ref:ks,class:"am-scroll",role:"menu",onScroll:Gi},[(k(!0),L(De,null,Ct(St.value,Ge=>(k(),L("button",{key:Ge.id,type:"button",class:"am-row",role:"menuitem",onMousedown:at[1]||(at[1]=Tt(()=>{},["prevent"])),onClick:kt=>Rt(Ge)},[A("span",mct,[U(p(Ce),{name:Ge.icon,size:"sm"},null,8,["name"])]),A("span",gct,F(p(l)(Ge.nameKey)),1),Ge.descKey?(k(),L("span",vct,F(p(l)(Ge.descKey)),1)):ee("",!0)],40,pct))),128))],544),ro.value?(k(),L("div",{key:0,class:"scroll-thumb",style:on({top:`${ro.value.top}px`,height:`${ro.value.height}px`})},null,4)):ee("",!0)],544)):ee("",!0)]),_:1}),A("div",yct,[A("div",{ref_key:"editorHostRef",ref:I,class:"ph","data-empty":p(c).length===0,"data-wm":yo.value?"true":"false"},null,8,kct),U(p(Nn),{text:E.value?p(l)("composer.collapseTitle"):p(l)("composer.expandTitle")},{default:ce(()=>[E.value||O.value?(k(),L("button",{key:0,class:"expand-btn",type:"button","aria-label":E.value?p(l)("composer.collapseTitle"):p(l)("composer.expandTitle"),onClick:M},[E.value?(k(),de(p(Ce),{key:0,name:"collapse",size:"sm"})):(k(),de(p(Ce),{key:1,name:"expand",size:"sm"}))],8,bct)):ee("",!0)]),_:1},8,["text"])])]),io.value?(k(),L("input",{key:0,ref_key:"fileInputRef",ref:dn,type:"file",multiple:"",class:"file-input-hidden",onChange:at[3]||(at[3]=(...Ge)=>p(ci)&&p(ci)(...Ge))},null,544)):ee("",!0),A("div",{ref_key:"toolbarRef",ref:oo,class:"toolbar"},[A("div",{ref_key:"menuMeasureRef",ref:Kl,class:"menu-measure","aria-hidden":"true"},[...at[21]||(at[21]=[A("span",{class:"pd-desc"},null,-1)])],512),A("div",wct,[U(p(ln),{class:"composer-attach",size:"md",label:p(l)("composer.addMenu"),tooltip:p(l)("composer.addMenu"),"aria-haspopup":"menu","aria-expanded":bi.value,onMousedown:at[4]||(at[4]=Tt(()=>{},["prevent"])),onClick:Tt(Je,["stop"])},{default:ce(()=>[U(p(Ce),{name:"plus"})]),_:1},8,["label","tooltip","aria-expanded"]),e.status?(k(),de(p(Nn),{key:0,text:Bn.value?pn.value:null},{default:ce(()=>[A("span",{ref_key:"permPillRef",ref:Ns,class:Re(["perm-pill",["perm-"+e.status.permission,{open:di.value}]]),role:"button",tabindex:"0","aria-label":pn.value,onClick:Tt(qs,["stop"]),onKeydown:[Qo(qs,["enter"]),Qo(Tt(qs,["prevent"]),["space"])]},[U(p(Ce),{class:"perm-pill-icon",name:In.value,size:"md"},null,8,["name"]),A("span",Act,F(pn.value),1)],42,Cct)]),_:1},8,["text"])):ee("",!0),U(ko,{name:"composer-menu-pop"},{default:ce(()=>[di.value&&e.status?(k(),L("div",{key:0,ref_key:"permDropdownRef",ref:Ws,class:"perm-dropdown",style:on(Xa.value),role:"menu",onClick:at[5]||(at[5]=Tt(()=>{},["stop"]))},[(k(),L(De,null,Ct(Yr,Ge=>A("button",{key:Ge.mode,class:Re(["pd-row",{"is-current":Ge.mode===e.status.permission}]),role:"menuitem",onClick:kt=>$t(Ge.mode)},[A("span",{class:"pd-icon",style:on({color:Ge.color})},[U(p(Ce),{name:Ge.icon,size:"md"},null,8,["name"])],4),A("span",Sct,[A("span",{class:"pd-name",style:on({color:Ge.color})},F(p(l)(Ge.labelKey)),5),A("span",_ct,F(p(l)(Ge.descKey)),1)]),A("span",Mct,[Ge.mode===e.status.permission?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])],10,xct)),64))],4)):ee("",!0)]),_:1}),lo.value?(k(),L("span",Ict,[U(p(Ce),{class:"swarm-ic",name:"sparkles",size:"md"}),A("span",Tct,F(p(l)("status.swarmLabel")),1),U(p(ln),{class:"swarm-x",size:"sm",label:p(l)("status.swarmDismiss"),tooltip:p(l)("status.swarmDismiss"),onMousedown:at[6]||(at[6]=Tt(()=>{},["prevent"])),onClick:at[7]||(at[7]=Tt(Ge=>r("toggleSwarm"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])])):ee("",!0)]),A("div",{ref_key:"toolbarRightRef",ref:Di,class:"toolbar-right"},[Ds.value?(k(),L("button",{key:0,class:Re(["compact-chip",{gone:An.value}]),onClick:at[8]||(at[8]=Tt(Ge=>r("compact"),["stop"]))},"/compact",2)):ee("",!0),U(p(Nn),{text:Vs.value},{default:ce(()=>[e.status&&!e.hideContext?(k(),L("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":Vs.value},[U(p(Wne),{pct:Us.value},null,8,["pct"])],8,Ect)):ee("",!0)]),_:1},8,["text"]),e.status&&!Ca.value&&!mf.value?(k(),de(p(Nn),{key:1,text:an.value?Gn.value:null},{default:ce(()=>[A("button",{ref_key:"modelPillRef",ref:Jo,type:"button",class:Re(["model-pill",{open:ki.value,"icon-only":an.value,"model-gone":Hn.value}]),"aria-haspopup":"menu","aria-expanded":ki.value,"aria-label":an.value?Gn.value:void 0,onClick:Tt(Qi,["stop"])},[an.value?(k(),de(p(Ce),{key:0,name:"model",size:"md"})):(k(),L(De,{key:1},[A("span",{ref_key:"mpNameRef",ref:Wn,class:"mp-name"},F(e.status.model),513),Fs.value?(k(),L("span",Nct,F(Fs.value),1)):ee("",!0),U(p(Ce),{class:"cv",name:"chevron-down",size:"sm"})],64))],10,Lct)]),_:1},8,["text"])):e.status&&mf.value?(k(),L("button",{key:2,type:"button",class:Re(["model-pill login-pill",{"icon-only":an.value,"model-gone":Hn.value}]),"aria-label":an.value?p(l)("sidebar.upgrade"):void 0,onClick:at[9]||(at[9]=Tt(Ge=>p(mv)(),["stop"]))},[an.value?(k(),de(p(Ce),{key:0,name:"music",size:"md"})):(k(),L(De,{key:1},[U(p(Ce),{name:"music",size:"sm"}),A("span",{ref_key:"mpNameRef",ref:Wn,class:"mp-name"},F(p(l)("sidebar.upgrade")),513)],64))],10,Dct)):e.status&&Ca.value?(k(),L("button",{key:3,type:"button",class:Re(["model-pill login-pill",{"icon-only":an.value,"model-gone":Hn.value}]),"aria-label":an.value?p(l)("login.action"):void 0,onClick:at[10]||(at[10]=Tt(Ge=>r("login"),["stop"]))},[an.value?(k(),de(p(Ce),{key:0,name:"log-in",size:"md"})):(k(),L(De,{key:1},[U(p(Ce),{name:"log-in",size:"sm"}),A("span",{ref_key:"mpNameRef",ref:Wn,class:"mp-name"},F(p(l)("login.action")),513)],64))],10,Fct)):ee("",!0),e.working?(k(),de(p(Nn),{key:4,text:p(l)("composer.interruptTitle")},{default:ce(()=>[A("button",{class:"stop","aria-label":p(l)("composer.interrupt"),onClick:at[11]||(at[11]=Ge=>r("interrupt"))},[U(p(Ce),{name:"stop",size:"sm"})],8,Bct)]),_:1},8,["text"])):ee("",!0),U(p(Nn),{text:Hi.value},{default:ce(()=>[A("button",{class:Re(["send",{"is-starting":e.starting}]),"aria-label":Hi.value,disabled:e.starting||!Vo.value,onClick:at[12]||(at[12]=Ge=>Ti())},[e.starting?(k(),de(p(mo),{key:0,size:"sm"})):(k(),de(p(Ce),{key:1,name:"send",size:"sm"}))],10,Rct)]),_:1},8,["text"])],512),U(ko,{name:"composer-menu-pop"},{default:ce(()=>[ki.value&&e.status?(k(),L("div",{key:0,ref_key:"modelDropdownRef",ref:eu,class:Re(["model-dropdown",{"flip-down":Pe.value}]),style:on(rn.value),role:"menu",onClick:at[14]||(at[14]=Tt(()=>{},["stop"])),onKeydown:um},[A("div",$ct,[Zh.value.length>0?(k(),L("div",Oct,F(p(l)("status.starredModels")),1)):ee("",!0),(k(!0),L(De,null,Ct(Zh.value,Ge=>(k(),L("button",{key:Ge.id,class:Re(["md-row",{"is-current":Ge.id===e.status.modelId}]),role:"menuitem",onClick:kt=>fr(Ge.id)},[A("span",zct,[Ge.id===e.status.modelId?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),A("span",jct,F(Ge.displayName??Ge.model),1),A("span",Hct,F(Ge.provider),1),U(p(Ce),{class:"md-star",name:"star",size:"sm"})],10,Pct))),128)),Zh.value.length>0?(k(),L("div",Wct)):ee("",!0),bo.value.length>0?(k(),L("div",qct,F(zn.value),1)):ee("",!0),(k(!0),L(De,null,Ct(bo.value,Ge=>(k(),L("button",{key:Ge.id,class:Re(["md-row",{"is-current":Ge.id===e.status.modelId}]),role:"menuitem",onClick:kt=>fr(Ge.id)},[A("span",Vct,[Ge.id===e.status.modelId?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),A("span",Kct,F(Ge.displayName??Ge.model),1),xa(Ge.id)?(k(),de(p(Ce),{key:0,class:"md-star",name:"star",size:"sm"})):ee("",!0)],10,Uct))),128))]),bo.value.length>0?(k(),L("div",Zct)):ee("",!0),A("div",Gct,[A("span",Qct,F(p(l)("status.thinkingLabel")),1),zu.value==="unsupported"?(k(),L("span",Yct,F(p(l)("status.modeNotSupported")),1)):Ks.value.length>1?(k(),de(p(Ms),{key:1,"model-value":pf.value,options:Ya.value,size:"xs","onUpdate:modelValue":Cl},null,8,["model-value","options"])):(k(),L("span",Jct,F(p(Bd)(Ks.value[0]??Ul.value)),1))]),at[22]||(at[22]=A("div",{class:"md-divider"},null,-1)),A("div",Xct,F(p(l)("status.cacheNote")),1),at[23]||(at[23]=A("div",{class:"md-divider"},null,-1)),A("button",{class:"md-row md-row-more",role:"menuitem",onClick:at[13]||(at[13]=Ge=>{Vn(),r("pickModel")})},[A("span",edt,[U(p(Ce),{name:"list",size:"sm"})]),A("span",tdt,F(p(l)("status.moreModels")),1),U(p(Ce),{class:"md-more-arrow",name:"chevron-right",size:"sm"})])],38)):ee("",!0)]),_:1})],512)],2),Ie.$slots.footer?(k(),L("div",ndt,[Un(Ie.$slots,"footer",{},void 0,!0)])):ee("",!0),A("div",{class:Re(["drop-overlay",{show:p(Gt)}]),"aria-hidden":"true"},[A("div",idt,[U(p(Ce),{name:"file-plus",size:"lg"}),A("span",null,F(p(l)("composer.dropToAttach")),1)])],2),(k(),de(cs,{to:"body"},[U(p(y1),{"model-value":p(o)&&p(Z),title:p(l)("composer.slashSheetTitle"),"onUpdate:modelValue":Ee},{default:ce(()=>[A("div",odt,[U(p(_s),{ref_key:"slashSearchRef",ref:pe,modelValue:ye.value,"onUpdate:modelValue":at[15]||(at[15]=Ge=>ye.value=Ge),placeholder:p(l)("composer.slashSearchPlaceholder"),autocomplete:"off",spellcheck:"false",role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":!!ue.value,"aria-controls":ue.value,"aria-activedescendant":se.value,onKeydown:Zi,onCompositionstart:Er,onCompositionend:Bo},null,8,["modelValue","placeholder","aria-expanded","aria-controls","aria-activedescendant"])]),U(fR,{layout:"sheet",items:p(ie),ranges:p(W),"active-index":p(Q),query:ye.value,onSelect:p(X),onHover:at[16]||(at[16]=Ge=>Q.value=Ge)},null,8,["items","ranges","active-index","query","onSelect"])]),_:1},8,["model-value","title"])])),(k(),de(cs,{to:"body"},[U(p(y1),{"model-value":p(o)&&p(fe),title:p(l)("composer.mentionSheetTitle"),"onUpdate:modelValue":qe},{default:ce(()=>[A("div",sdt,[U(p(_s),{ref_key:"mentionSearchRef",ref:ne,modelValue:_e.value,"onUpdate:modelValue":at[17]||(at[17]=Ge=>_e.value=Ge),placeholder:p(l)("composer.mentionSearchPlaceholder"),autocomplete:"off",spellcheck:"false",role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":!!ue.value,"aria-controls":ue.value,"aria-activedescendant":se.value,onKeydown:Zi,onCompositionstart:Er,onCompositionend:Bo},null,8,["modelValue","placeholder","aria-expanded","aria-controls","aria-activedescendant"])]),U(hR,{layout:"sheet",items:p(G),"active-index":p(ae),loading:p(K),stale:p(re),onSelect:p(we),onHover:p(oe)},null,8,["items","active-index","loading","stale","onSelect","onHover"])]),_:1},8,["model-value","title"])])),(k(),de(cs,{to:"body"},[U(p(y1),{"model-value":p(o)&&bi.value,"onUpdate:modelValue":ze},{default:ce(()=>[A("div",{ref_key:"addSheetRef",ref:Mn,class:"msheet-add",role:"menu",onKeydown:Fn},[(k(!0),L(De,null,Ct(St.value,Ge=>(k(),L("button",{key:Ge.id,type:"button",class:"am-row",role:"menuitem",onClick:kt=>Rt(Ge)},[A("span",ldt,[U(p(Ce),{name:Ge.icon,size:"sm"},null,8,["name"])]),A("span",adt,F(p(l)(Ge.nameKey)),1),Ge.descKey?(k(),L("span",udt,F(p(l)(Ge.descKey)),1)):ee("",!0)],8,rdt))),128))],544)]),_:1},8,["model-value"])]))],34))}}),VZ=xt(cdt,[["__scopeId","data-v-d1a137e8"]]),ddt={class:"akind"},fdt={key:1,class:"apeek"},hdt={class:"ab"},pdt=["title"],mdt={class:"code-path"},gdt={key:2,class:"body-shell"},vdt={class:"shell-cmd"},ydt={key:0,class:"shell-cwd"},kdt={key:1,class:"shell-danger"},bdt={class:"code-path"},wdt={key:4,class:"body-chip"},Cdt={class:"chip-label"},Adt={class:"chip-value"},xdt={key:0,class:"chip-detail"},Sdt={key:5,class:"body-chip"},_dt={key:0,class:"chip-label"},Mdt={class:"chip-value"},Idt={key:6,class:"body-chip"},Tdt={class:"chip-label"},Edt={class:"chip-value"},Ldt={key:0,class:"chip-detail"},Ndt={key:7,class:"body-chip"},Ddt={class:"chip-label"},Fdt={class:"chip-value"},Bdt={key:0,class:"chip-detail"},Rdt={key:8,class:"body-todo"},$dt={class:"todo-glyph"},Odt={key:0,class:"plan-opts"},Pdt=["disabled","onClick"],zdt={class:"popt-key"},jdt={class:"popt-text"},Hdt={class:"popt-label"},Wdt={key:0,class:"popt-desc"},qdt={key:10,class:"body-generic"},Udt={class:"gen-text"},Vdt={key:11,class:"feedback-wrap"},Kdt={class:"feedback-hint"},Zdt={class:"af"},Gdt={class:"abtns"},Qdt={key:0,class:"knum"},Ydt={key:0,class:"knum"},Jdt=.4,Xdt=lt({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=Jt(qo),r=D(()=>{const fe=n.block;return fe.kind!=="plan_review"?null:{plan:fe.plan,path:fe.path,options:fe.options??[]}}),l=V(!1),a=V(null),u=V(null),c=V(null),d=V(!1),f=V(!1);function h(){d.value=(u.value?.scrollTop??0)>0||(c.value?.scrollTop??0)>0,f.value=(a.value?.scrollTop??0)>0}function m(){h()}const g=V(!1),v=D(()=>{const fe=n.block.kind;return fe==="plan_review"||fe==="diff"||fe==="file"});function y(){l.value&&(l.value=!1)}const b=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function w(){return b.includes(n.block.kind)?n.block.kind:"generic"}function C(){return o(`approval.title.${w()}`)}const T=D(()=>{const fe=n.block;switch(fe.kind){case"diff":case"file":case"fileop":return fe.path;case"shell":return fe.command;case"url":return fe.url;case"search":return fe.query;case"invocation":return fe.name;case"generic":return fe.summary;default:return""}}),N=V(!1),I=V(""),S=V(null);function _(){const fe=S.value?.el;if(!fe)return;fe.style.height="auto";const ae=(window.visualViewport?.height??window.innerHeight)*Jdt;fe.style.height=`${Math.min(fe.scrollHeight,ae)}px`,fe.style.overflowY=fe.scrollHeight>ae?"auto":"hidden"}We(I,()=>void ht(_)),We(l,fe=>{fe||ht(_)});const{fontScale:x}=X1();We(x,()=>void ht(_));let E=null,M=0;yn(()=>{window.addEventListener("resize",_),window.visualViewport?.addEventListener("resize",_),E=new ResizeObserver(fe=>{const G=fe[0]?.contentRect.width??0;G!==M&&(M=G,_())}),a.value&&E.observe(a.value)}),Ln(()=>{window.removeEventListener("resize",_),window.visualViewport?.removeEventListener("resize",_),E?.disconnect()});function R(){n.busy||(N.value=!0,I.value="",setTimeout(()=>S.value?.el?.focus(),0))}function q(){if(n.busy)return;const fe=I.value.trim();r.value?Z("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:fe||void 0}):Z("feedback",{decision:"rejected",feedback:fe||void 0}),N.value=!1,I.value=""}function z(){n.busy||(N.value=!1,I.value="")}const{handleCompositionStart:O,handleCompositionEnd:B,isComposingKeyEvent:P}=kl();function H(fe){P(fe)||(fe.key==="Enter"&&!fe.shiftKey?(fe.preventDefault(),q()):fe.key==="Escape"&&(fe.preventDefault(),z()))}const j=V(null);We(()=>n.busy,fe=>{fe||(j.value=null)});function Z(fe,G){n.busy||(j.value=fe,i("decide",G))}function ie(){Z("approve",{decision:"approved"})}function W(){Z("approveSession",{decision:"approved",scope:"session"})}function Q(){Z("reject",{decision:"rejected"})}function te(){Z("approvePlan",{decision:"approved"})}function X(fe){Z(`option:${fe}`,{decision:"approved",selectedLabel:fe})}function ge(){n.busy||R()}function ue(){Z("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function se(fe){const G=(document.activeElement?.tagName??"").toLowerCase();if(G==="input"||G==="textarea"||fe.metaKey||fe.ctrlKey||fe.altKey||rr.value>0||fe.defaultPrevented)return;if(N.value){fe.key==="Escape"&&(fe.preventDefault(),z());return}if(n.busy||l.value)return;const ae=r.value;if(ae){if(ae.options.length===0){fe.key==="1"?(fe.preventDefault(),te()):fe.key==="2"?(fe.preventDefault(),ge()):fe.key==="3"&&(fe.preventDefault(),ue());return}fe.key==="1"&&ae.options[0]?(fe.preventDefault(),X(ae.options[0].label)):fe.key==="2"&&ae.options[1]?(fe.preventDefault(),X(ae.options[1].label)):fe.key==="3"&&ae.options[2]&&(fe.preventDefault(),X(ae.options[2].label));return}fe.key==="1"?(fe.preventDefault(),ie()):fe.key==="2"?(fe.preventDefault(),W()):fe.key==="3"?(fe.preventDefault(),Q()):fe.key==="4"&&(fe.preventDefault(),R())}return yn(()=>document.addEventListener("keydown",se)),Ln(()=>document.removeEventListener("keydown",se)),W1(h),(fe,G)=>(k(),L("div",{ref_key:"cardRef",ref:a,class:Re(["appr",{minimized:l.value,scrolled:f.value}]),onScroll:h},[A("div",{class:Re(["ah",{clickable:l.value}]),onClick:y},[A("span",ddt,F(C()),1),e.agentName&&!l.value?(k(),de(p(ul),{key:0,variant:"neutral",size:"sm"},{default:ce(()=>[$e(F(p(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ee("",!0),l.value&&T.value?(k(),L("span",fdt,F(T.value),1)):ee("",!0),v.value&&!l.value?(k(),de(p(ln),{key:2,class:"aexpand",size:"sm",label:g.value?p(o)("approval.collapsePlan"):p(o)("approval.expandPlan"),tooltip:g.value?p(o)("approval.collapsePlan"):p(o)("approval.expandPlan"),onClick:G[0]||(G[0]=ae=>g.value=!g.value)},{default:ce(()=>[U(p(Ce),{name:g.value?"collapse":"expand",size:"md"},null,8,["name"])]),_:1},8,["label","tooltip"])):ee("",!0),U(p(ln),{class:"amin",size:"sm",label:l.value?p(o)("question.expand"):p(o)("question.minimize"),tooltip:l.value?p(o)("question.expand"):p(o)("question.minimize"),onClick:G[1]||(G[1]=Tt(ae=>l.value=!l.value,["stop"]))},{default:ce(()=>[l.value?(k(),de(p(Ce),{key:0,name:"chevron-up",size:"md"})):(k(),de(p(Ce),{key:1,name:"minus",size:"md"}))]),_:1},8,["label","tooltip"])],2),l.value?ee("",!0):(k(),L(De,{key:0},[A("div",hdt,[e.block.kind==="plan_review"&&e.block.path?(k(),L("button",{key:0,type:"button",class:"plan-path",title:e.block.path,onClick:G[2]||(G[2]=ae=>p(s)?.openFile({path:e.block.path,content:e.block.plan}))},F(e.block.path),9,pdt)):ee("",!0),e.block.kind==="diff"?(k(),L("div",{key:1,class:Re(["body-code",{expanded:g.value}])},[A("div",mdt,F(e.block.path),1),e.block.diff.length>0?(k(),de(p(Pa),{key:0,lines:e.block.diff,path:e.block.path},null,8,["lines","path"])):ee("",!0)],2)):e.block.kind==="shell"?(k(),L("div",gdt,[A("div",vdt,[G[4]||(G[4]=A("span",{class:"shell-dollar"},"$",-1)),$e(" "+F(e.block.command),1)]),e.block.cwd?(k(),L("div",ydt,"cwd: "+F(e.block.cwd),1)):ee("",!0),e.block.danger?(k(),L("div",kdt,[U(p(Ce),{name:"alert-triangle",size:"sm",class:"shell-danger-ic"}),A("span",null,F(p(o)("approval.danger",{detail:e.block.danger})),1)])):ee("",!0)])):e.block.kind==="file"?(k(),L("div",{key:3,class:Re(["body-code",{expanded:g.value}])},[A("div",bdt,F(e.block.path),1),U(p(Pa),{code:e.block.content,path:e.block.path},null,8,["code","path"])],2)):e.block.kind==="fileop"?(k(),L("div",wdt,[A("span",Cdt,F(e.block.op),1),A("span",Adt,F(e.block.path),1),e.block.detail?(k(),L("span",xdt,F(e.block.detail),1)):ee("",!0)])):e.block.kind==="url"?(k(),L("div",Sdt,[e.block.method?(k(),L("span",_dt,F(e.block.method),1)):ee("",!0),A("span",Mdt,F(e.block.url),1)])):e.block.kind==="search"?(k(),L("div",Idt,[A("span",Tdt,F(p(o)("approval.searchQueryLabel")),1),A("span",Edt,F(e.block.query),1),e.block.scope?(k(),L("span",Ldt,F(p(o)("approval.searchScope",{scope:e.block.scope})),1)):ee("",!0)])):e.block.kind==="invocation"?(k(),L("div",Ndt,[A("span",Ddt,F(e.block.kind2),1),A("span",Fdt,F(e.block.name),1),e.block.description?(k(),L("span",Bdt,F(e.block.description),1)):ee("",!0)])):e.block.kind==="todo"?(k(),L("div",Rdt,[(k(!0),L(De,null,Ct(e.block.items,(ae,K)=>(k(),L("div",{key:K,class:"todo-item"},[A("span",$dt,F(ae.status==="done"||ae.status==="completed"?"✓":"○"),1),A("span",{class:Re(["todo-title",{"todo-done":ae.status==="done"||ae.status==="completed"}])},F(ae.title),3)]))),128))])):e.block.kind==="plan_review"?(k(),L("div",{key:9,ref_key:"planWrapEl",ref:u,class:Re(["body-plan-wrap",{scrolled:d.value}]),onScroll:m},[A("div",{ref_key:"planBodyEl",ref:c,class:Re(["body-plan",{expanded:g.value}]),onScroll:m},[U(p(Sc),{text:e.block.plan,"open-file":p(s)?.openFile},null,8,["text","open-file"])],34),r.value&&r.value.options.length>0?(k(),L("div",Odt,[(k(!0),L(De,null,Ct(r.value.options,(ae,K)=>(k(),L("button",{key:K,type:"button",class:"popt",disabled:e.busy,onClick:re=>X(ae.label)},[A("span",zdt,F(K+1),1),A("span",jdt,[A("span",Hdt,F(ae.label),1),ae.description?(k(),L("span",Wdt,F(ae.description),1)):ee("",!0)]),j.value===`option:${ae.label}`?(k(),de(p(mo),{key:0,size:"sm",class:"popt-spin"})):ee("",!0)],8,Pdt))),128))])):ee("",!0)],34)):(k(),L("div",qdt,[A("span",Udt,F(e.block.summary),1)])),N.value?(k(),L("div",Vdt,[U(p(Hie),{ref_key:"feedbackRef",ref:S,modelValue:I.value,"onUpdate:modelValue":G[3]||(G[3]=ae=>I.value=ae),placeholder:p(o)("approval.feedbackPlaceholder"),rows:3,resize:!1,onKeydown:H,onCompositionstart:p(O),onCompositionend:p(B)},null,8,["modelValue","placeholder","onCompositionstart","onCompositionend"]),A("div",Kdt,F(p(o)("approval.feedbackHint")),1)])):ee("",!0)]),A("div",Zdt,[A("div",Gdt,[N.value?(k(),L(De,{key:0},[U(p(sn),{size:"md",variant:"danger-soft",loading:j.value==="feedback",disabled:e.busy,onClick:q},{default:ce(()=>[$e(F(p(o)("approval.feedbackSubmit")),1)]),_:1},8,["loading","disabled"]),U(p(sn),{size:"md",variant:"ghost",disabled:e.busy,onClick:z},{default:ce(()=>[$e(F(p(o)("approval.feedbackCancel")),1)]),_:1},8,["disabled"])],64)):r.value?(k(),L(De,{key:1},[r.value.options.length===0?(k(),de(p(sn),{key:0,class:"amain",size:"md",variant:"primary",loading:j.value==="approvePlan",disabled:e.busy,onClick:te},{default:ce(()=>[G[5]||(G[5]=A("span",{class:"knum"},"1",-1)),$e(F(p(o)("approval.approvePlan")),1)]),_:1},8,["loading","disabled"])):ee("",!0),U(p(sn),{size:"md",variant:"ghost",disabled:e.busy,onClick:ge},{default:ce(()=>[r.value.options.length===0?(k(),L("span",Qdt,"2")):ee("",!0),$e(F(p(o)("approval.revise")),1)]),_:1},8,["disabled"]),U(p(sn),{size:"md",variant:"ghost",loading:j.value==="rejectAndExit",disabled:e.busy,onClick:ue},{default:ce(()=>[r.value.options.length===0?(k(),L("span",Ydt,"3")):ee("",!0),$e(F(p(o)("approval.rejectAndExit")),1)]),_:1},8,["loading","disabled"])],64)):(k(),L(De,{key:2},[U(p(sn),{class:"amain",size:"md",variant:"primary",loading:j.value==="approve",disabled:e.busy,onClick:ie},{default:ce(()=>[G[6]||(G[6]=A("span",{class:"knum"},"1",-1)),$e(F(p(o)("approval.approve")),1)]),_:1},8,["loading","disabled"]),U(p(sn),{size:"md",variant:"ghost",loading:j.value==="approveSession",disabled:e.busy,onClick:W},{default:ce(()=>[G[7]||(G[7]=A("span",{class:"knum"},"2",-1)),$e(F(p(o)("approval.approveSession")),1)]),_:1},8,["loading","disabled"]),U(p(sn),{size:"md",variant:"ghost",loading:j.value==="reject",disabled:e.busy,onClick:Q},{default:ce(()=>[G[8]||(G[8]=A("span",{class:"knum"},"3",-1)),$e(F(p(o)("approval.reject")),1)]),_:1},8,["loading","disabled"]),U(p(sn),{size:"md",variant:"ghost",disabled:e.busy,onClick:R},{default:ce(()=>[G[9]||(G[9]=A("span",{class:"knum"},"4",-1)),$e(F(p(o)("approval.feedback")),1)]),_:1},8,["disabled"])],64))])])],64))],34))}}),eft=xt(Xdt,[["__scopeId","data-v-03ef6cfa"]]),tft={class:"dock-work-head"},nft={key:0,class:"dock-workbar"},ift={key:0,class:"dw-running"},oft={key:0,class:"dw-running"},sft={class:"dw-count"},rft=lt({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},working:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},authReady:{type:Boolean},managedSignedIn:{type:Boolean},managedMembership:{},starredIds:{},skills:{},skillsLoaded:{type:Boolean},goal:{},dockPanel:{},overlayOpen:{type:Boolean},sessionPlans:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","focusGoal","compact","pickModel","selectModel","login","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=qt(),{confirm:r,isConfirmOpen:l}=cf(),a=Jt(qo),u=D(()=>a?.isExpanded()===!0&&a.activeTabType()!=="btw"),c=D(()=>a?.isExpanded()===!0),d=D(()=>i.pendingQuestion!=null||i.pendingApproval!=null),f=D(()=>{switch(i.goal?.status){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete");default:return""}}),h=D(()=>i.goal?Fu(i.goal.wallClockMs,{h:s("status.timeUnitHour"),m:s("status.timeUnitMinute"),s:s("status.timeUnitSecond")}):"");async function m(){await r({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}const g=[{id:"active",labelKey:"tasks.filterRecent",icon:"clock"},{id:"running",labelKey:"tasks.filterRunning",icon:"play"},{id:"done",labelKey:"tasks.filterDone",icon:"circle-check"},{id:"all",labelKey:"tasks.filterAll",icon:"list"}];function v(_e,pe){return(pe.completedAt??pe.createdAt??"").localeCompare(_e.completedAt??_e.createdAt??"")||(pe.createdAt??"").localeCompare(_e.createdAt??"")}function y(_e,pe){if(pe==="all")return _e;if(pe==="running")return _e.filter(Ee=>Ee.state==="run");if(pe==="done")return _e.filter(Ee=>Ee.state!=="run");const ne=[];for(const Ee of _e){if(Ee.state==="run")continue;let qe=ne.length;for(;qe>0&&v(ne[qe-1],Ee)>0;)qe--;ne.splice(qe,0,Ee),ne.length>5&&(ne.length=5)}return[..._e.filter(Ee=>Ee.state==="run"),...ne]}const b=V("active"),w=V("active"),C=D(()=>y(i.bashTasks,b.value)),T=D(()=>y(i.subagentTasks,w.value)),N=D(()=>g.map(_e=>({value:_e.id,label:s(_e.labelKey),icon:_e.icon}))),I=D({get:()=>b.value,set:_e=>{b.value=_e}}),S=D({get:()=>w.value,set:_e=>{w.value=_e}}),_=D(()=>(i.todos?.length??0)>0&&i.todoDoneCount===(i.todos?.length??0)),x=D(()=>i.bashTasks.some(_e=>_e.kind==="tool")),E=D(()=>x.value?"tasks.dockTasks":"tasks.dockBash"),M=D(()=>`${s("status.goalLabel")} ${f.value}`.trim()),R=D(()=>i.bashRunning>0?`${s(E.value)} ${i.bashRunning} ${s("tasks.running")}`:s(E.value)),q=D(()=>i.subagentRunning>0?`${s("tasks.dockSubagent")} ${i.subagentRunning} ${s("tasks.running")}`:s("tasks.dockSubagent")),z=D(()=>`${s("tasks.todoProgressTitle")} ${i.todoDoneCount}/${i.todos?.length??0}`),O=D(()=>Object.values(i.sessionPlans??{}).at(-1)),B=D(()=>{const _e=O.value?.review?.state;return _e?s(`tools.plan.review.${_e}`):""});function P(){const _e=O.value;_e?.path&&a?.openFile(_e.plan?{path:_e.path,content:_e.plan}:{path:_e.path})}const H=V(null),j=D(()=>H.value?.anyPopupOpen===!0),Z=D(()=>j.value||i.dockPanel!=null),ie=V(null),W=V(null),Q=V(!1),te=V("50%");function X(_e,pe){if(i.pendingQuestion)return;const ne=pe.currentTarget;if(ne&&W.value){const Ee=ne.getBoundingClientRect(),qe=W.value.getBoundingClientRect();te.value=`${Ee.left+Ee.width/2-qe.left}px`}o("toggle-dock-panel",_e)}function ge(_e){return H.value?(H.value.loadForEdit(_e),!0):!1}function ue(_e,pe,ne){return H.value?(H.value.insertQuote(_e,pe,ne),!0):!1}function se(){return H.value!==null}function fe(_e){H.value?.loadAttachmentsForEdit(_e)}function G(){H.value?.focus()}const ae=()=>H.value?.isEmpty?.()??!1;function K(_e){if(!i.dockPanel)return;const pe=_e.target;pe&&(ie.value?.contains(pe)||pe instanceof Element&&pe.closest(".ui-pill")||o("close-dock-panel"))}function re(_e){_e.key!=="Escape"||_e.repeat||mS(_e)||_e.defaultPrevented||j.value||l.value||i.overlayOpen||(_e.preventDefault(),_e.stopImmediatePropagation(),o("close-dock-panel"))}const be=V(null),ke=V(!1);function we(){const _e=be.value;ke.value=_e?_e.scrollTop>0:!1}function oe(_e){ke.value=_e.target.scrollTop>0}let le=null;We(()=>i.dockPanel,async _e=>{typeof document<"u"&&(document.removeEventListener("mousedown",K,!0),document.removeEventListener("keydown",re,!0),_e&&(document.addEventListener("mousedown",K,!0),document.addEventListener("keydown",re,!0))),le?.disconnect(),le=null,_e?(await ht(),we(),typeof ResizeObserver=="function"&&be.value&&(le=new ResizeObserver(we),le.observe(be.value))):ke.value=!1},{immediate:!0}),We(()=>i.pendingQuestion,_e=>{_e&&i.dockPanel&&o("close-dock-panel")});let ye=null;function Ae(){const _e=W.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${_e}px`);const pe=Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--p-bp-sm"));Q.value=(W.value?.offsetWidth??0)<(Number.isFinite(pe)?pe:640)}return yn(()=>{pS(),!(typeof ResizeObserver!="function"||!W.value)&&(ye=new ResizeObserver(Ae),ye.observe(W.value),Ae())}),Ln(()=>{typeof document<"u"&&(document.removeEventListener("mousedown",K,!0),document.removeEventListener("keydown",re,!0)),ye?.disconnect(),ye=null,le?.disconnect(),le=null}),t({loadForEdit:ge,insertQuote:ue,hasInsertableComposer:se,loadAttachmentsForEdit:fe,focus:G,anyPopupOpen:j,isEmpty:ae}),(_e,pe)=>(k(),L("div",{ref_key:"dockRef",ref:W,class:Re(["chat-dock",[e.mobile?"align-mobile":"align-center",{"has-popup":Z.value,"has-approval":!!e.pendingApproval&&!e.pendingQuestion,"has-question":!!e.pendingQuestion,"pills-compact":Q.value}]]),onClick:pe[34]||(pe[34]=Tt(()=>{},["stop"]))},[U(ko,{name:"dock-panel"},{default:ce(()=>[e.dockPanel?(k(),L("div",{ref_key:"workPanelRef",ref:ie,key:e.dockPanel,class:Re(["dock-work-panel",[`panel-${e.dockPanel}`,{"body-scrolled-up":ke.value}]]),style:on({transformOrigin:`${te.value} 100%`}),onClick:pe[9]||(pe[9]=Tt(()=>{},["stop"]))},[A("div",tft,[e.dockPanel==="bash"?(k(),de(p(Qm),{key:0,icon:"terminal",title:p(s)(E.value),meta:`${e.bashRunning} ${p(s)("tasks.running")}`},{actions:ce(()=>[U(p(VB),{modelValue:I.value,"onUpdate:modelValue":pe[0]||(pe[0]=ne=>I.value=ne),options:N.value},null,8,["modelValue","options"])]),_:1},8,["title","meta"])):e.dockPanel==="subagent"?(k(),de(p(Qm),{key:1,icon:"sparkles",title:p(s)("tasks.dockSubagent"),meta:`${e.subagentRunning} ${p(s)("tasks.running")}`},{actions:ce(()=>[U(p(VB),{modelValue:S.value,"onUpdate:modelValue":pe[1]||(pe[1]=ne=>S.value=ne),options:N.value},null,8,["modelValue","options"])]),_:1},8,["title","meta"])):e.dockPanel==="todos"?(k(),de(p(Qm),{key:2,icon:_.value?"check-list":"list",title:p(s)("tasks.todoProgressTitle"),meta:`${e.todoDoneCount}/${e.todos?.length??0}`},null,8,["icon","title","meta"])):e.dockPanel==="goal"?(k(),de(p(Qm),{key:3,icon:"target",title:p(s)("status.goalLabel"),meta:h.value},{actions:ce(()=>[e.goal?(k(),L(De,{key:0},[e.goal.status==="active"?(k(),de(p(ln),{key:0,size:"sm",label:p(s)("status.goalPause"),tooltip:p(s)("status.goalPause"),onClick:pe[2]||(pe[2]=Tt(ne=>o("controlGoal","pause"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"pause",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(k(),de(p(ln),{key:1,size:"sm",label:p(s)("status.goalResume"),tooltip:p(s)("status.goalResume"),onClick:pe[3]||(pe[3]=Tt(ne=>o("controlGoal","resume"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"play",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(ln),{size:"sm",label:p(s)("status.goalCancel"),tooltip:p(s)("status.goalCancel"),onClick:Tt(m,["stop"])},{default:ce(()=>[U(p(Ce),{name:"power",size:"md"})]),_:1},8,["label","tooltip"]),U(p(ln),{size:"sm",label:p(s)("tasks.closePanel"),tooltip:p(s)("tasks.closePanel"),onClick:pe[4]||(pe[4]=Tt(ne=>o("close-dock-panel"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"close",size:"md"})]),_:1},8,["label","tooltip"])],64)):ee("",!0)]),_:1},8,["title","meta"])):e.dockPanel==="plan"?(k(),de(p(Qm),{key:4,icon:"file-edit",title:p(s)("status.planLabel"),meta:B.value},{actions:ce(()=>[O.value?.path?(k(),de(p(ln),{key:0,size:"sm",label:p(s)("tasks.openPanel"),tooltip:p(s)("tasks.openPanel"),onClick:Tt(P,["stop"])},{default:ce(()=>[U(p(Ce),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.planArmed||e.planMode?(k(),de(p(ln),{key:1,size:"sm",label:p(s)("status.workModeDismiss"),tooltip:p(s)("status.workModeDismiss"),onClick:pe[5]||(pe[5]=Tt(ne=>o("togglePlan"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"power",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(ln),{size:"sm",label:p(s)("tasks.closePanel"),tooltip:p(s)("tasks.closePanel"),onClick:pe[6]||(pe[6]=Tt(ne=>o("close-dock-panel"),["stop"]))},{default:ce(()=>[U(p(Ce),{name:"close",size:"md"})]),_:1},8,["label","tooltip"])]),_:1},8,["title","meta"])):ee("",!0)]),A("div",{ref_key:"workBodyRef",ref:be,class:"dock-work-body",onScroll:oe},[e.dockPanel==="bash"?(k(),de(p(Htt),{key:0,tasks:C.value,filter:b.value,onCancel:pe[7]||(pe[7]=ne=>o("cancelTask",ne))},null,8,["tasks","filter"])):e.dockPanel==="subagent"?(k(),de(p(Ttt),{key:1,tasks:T.value,filter:w.value,onCancel:pe[8]||(pe[8]=ne=>o("cancelTask",ne))},null,8,["tasks","filter"])):e.dockPanel==="todos"?(k(),de(p(Ktt),{key:2,todos:e.todos??[]},null,8,["todos"])):e.dockPanel==="goal"&&e.goal?(k(),de(p(ott),{key:3,goal:e.goal},null,8,["goal"])):e.dockPanel==="plan"?(k(),de(p(mtt),{key:4,plan:O.value,"plan-mode-on":e.planMode},null,8,["plan","plan-mode-on"])):ee("",!0)],544)],6)):ee("",!0)]),_:1}),e.hasDockWork||e.planMode||O.value?(k(),L("div",nft,[e.goal?(k(),de(p(Ym),{key:0,icon:"target",label:M.value,active:e.dockPanel==="goal",onClick:pe[10]||(pe[10]=ne=>X("goal",ne))},{meta:ce(()=>[A("span",{class:Re(["dw-goal-status",`dw-goal-status--${e.goal.status}`])},F(f.value),3)]),default:ce(()=>[$e(F(p(s)("status.goalLabel"))+" ",1)]),_:1},8,["label","active"])):ee("",!0),e.planMode||O.value?(k(),de(p(Ym),{key:1,icon:"file-edit",label:p(s)("status.planLabel"),active:e.dockPanel==="plan",onClick:pe[11]||(pe[11]=ne=>X("plan",ne))},{default:ce(()=>[$e(F(p(s)("status.planLabel")),1)]),_:1},8,["label","active"])):ee("",!0),e.bashTasks.length>0?(k(),de(p(Ym),{key:2,icon:"terminal",label:R.value,active:e.dockPanel==="bash",onClick:pe[12]||(pe[12]=ne=>X("bash",ne))},{meta:ce(()=>[e.bashRunning>0?(k(),L("span",ift,[U(p(Hl),{status:"running"}),$e(F(e.bashRunning),1)])):ee("",!0)]),default:ce(()=>[$e(F(p(s)(E.value))+" ",1)]),_:1},8,["label","active"])):ee("",!0),e.subagentTasks.length>0?(k(),de(p(Ym),{key:3,icon:"sparkles",label:q.value,active:e.dockPanel==="subagent",onClick:pe[13]||(pe[13]=ne=>X("subagent",ne))},{meta:ce(()=>[e.subagentRunning>0?(k(),L("span",oft,[U(p(Hl),{status:"running"}),$e(F(e.subagentRunning),1)])):ee("",!0)]),default:ce(()=>[$e(F(p(s)("tasks.dockSubagent"))+" ",1)]),_:1},8,["label","active"])):ee("",!0),(e.todos?.length??0)>0?(k(),de(p(Ym),{key:4,icon:_.value?"check-list":"list",label:z.value,active:e.dockPanel==="todos",onClick:pe[14]||(pe[14]=ne=>X("todos",ne))},{meta:ce(()=>[A("span",sft,F(e.todoDoneCount)+"/"+F(e.todos?.length??0),1)]),default:ce(()=>[$e(F(p(s)("tasks.todoProgressTitle"))+" ",1)]),_:1},8,["icon","label","active"])):ee("",!0)])):ee("",!0),(k(),de(cs,{defer:"",to:".pfc-host",disabled:!c.value},[e.pendingQuestion?(k(),de(p(yet),{key:e.pendingQuestion.questionId,class:"dock-question",question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:pe[15]||(pe[15]=(ne,Ee)=>o("answer",ne,Ee)),onDismiss:pe[16]||(pe[16]=ne=>o("dismiss",ne))},null,8,["question","busy-kind"])):e.pendingApproval?(k(),de(eft,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:pe[17]||(pe[17]=ne=>o("approval",e.pendingApproval.approvalId,ne))},null,8,["block","agent-name","busy"])):ee("",!0)],8,["disabled"])),d.value?ee("",!0):(k(),de(cs,{key:1,defer:"",to:".pfc-host",disabled:!u.value},[U(VZ,{ref_key:"composerRef",ref:H,"session-id":e.sessionId,running:e.running,working:e.working,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,"skills-loaded":e.skillsLoaded,starting:e.starting,onSubmit:pe[18]||(pe[18]=ne=>o("submit",ne)),onSteer:pe[19]||(pe[19]=ne=>o("steer",ne)),onCommand:pe[20]||(pe[20]=ne=>o("command",ne)),onInterrupt:pe[21]||(pe[21]=ne=>o("interrupt")),onSetPermission:pe[22]||(pe[22]=ne=>o("setPermission",ne)),onSetThinking:pe[23]||(pe[23]=ne=>o("setThinking",ne)),onTogglePlan:pe[24]||(pe[24]=ne=>o("togglePlan")),onToggleSwarm:pe[25]||(pe[25]=ne=>o("toggleSwarm")),onToggleGoal:pe[26]||(pe[26]=ne=>o("toggleGoal")),onCreateGoal:pe[27]||(pe[27]=ne=>o("createGoal",ne)),onControlGoal:pe[28]||(pe[28]=ne=>o("controlGoal",ne)),onFocusGoal:pe[29]||(pe[29]=ne=>o("focusGoal")),onCompact:pe[30]||(pe[30]=ne=>o("compact")),onPickModel:pe[31]||(pe[31]=ne=>o("pickModel")),onSelectModel:pe[32]||(pe[32]=ne=>o("selectModel",ne)),onLogin:pe[33]||(pe[33]=ne=>o("login"))},null,8,["session-id","running","working","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","swarm-mode","goal-mode","goal","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","skills-loaded","starting"])],8,["disabled"]))],2))}}),lft=xt(rft,[["__scopeId","data-v-a4f60a64"]]),aft={class:"ws-home"},uft={class:"ws-home-title"},cft={class:"ws-home-name"},dft={key:0,class:"ws-home-path"},fft=lt({__name:"WorkspaceHome",props:{workspaceName:{},workspaceRoot:{}},setup(e){return(t,n)=>(k(),L("div",aft,[A("div",uft,[U(p(Ce),{class:"ws-home-folder",name:"folder-closed"}),A("span",cft,F(e.workspaceName),1)]),e.workspaceRoot?(k(),L("div",dft,F(e.workspaceRoot),1)):ee("",!0)]))}}),hft=xt(fft,[["__scopeId","data-v-33dedf8a"]]),pft={class:"wrs"},mft={class:"wrs-caption"},gft=["onClick"],vft={class:"wrs-title"},yft={class:"wrs-time"},kft={class:"wrs-foot"},bft=lt({__name:"WorkspaceRecentSessions",props:{sessions:{}},emits:["selectSession","openSessionAdmin"],setup(e,{emit:t}){const n=t,{t:i}=qt();return(o,s)=>(k(),L("div",pft,[A("div",mft,F(p(i)("conversation.recentSessions")),1),(k(!0),L(De,null,Ct(e.sessions,r=>(k(),L("button",{key:r.id,type:"button",class:"wrs-row",onClick:l=>n("selectSession",r.id)},[A("span",{class:Re(["wrs-ico",r.archived?"wrs-ico--done":"wrs-ico--open"])},[U(p(Ce),{name:r.archived?"state-done":"state-open",size:"sm"},null,8,["name"])],2),A("span",vft,F(r.title),1),A("span",yft,F(r.time),1)],8,gft))),128)),A("div",kft,[U(p(Nn),{text:p(i)("conversation.sessionAdminTooltip")},{default:ce(()=>[A("button",{type:"button",class:"wrs-more",onClick:s[0]||(s[0]=r=>n("openSessionAdmin"))},[$e(F(p(i)("conversation.viewMoreSessions"))+" ",1),U(p(Ce),{name:"chevron-down",size:"sm"})])]),_:1},8,["text"])])]))}}),wft=xt(bft,[["__scopeId","data-v-460203b8"]]),Cft={class:"tsearch-main"},Aft=["placeholder"],xft={key:0,class:"tsearch-spin"},Sft=["inert"],_ft={class:"tsearch-foot"},Mft={class:"tsearch-count",role:"status"},Ift={class:"tsearch-rings","aria-hidden":"true"},Tft=800,Eft=400,Lft=1500,Nft=lt({__name:"TranscriptSearch",props:{pane:{},reveal:{},mobile:{type:Boolean,default:!1}},emits:["close"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=qt(),{handleCompositionStart:r,handleCompositionEnd:l,isComposingKeyEvent:a}=kl(),u=V(""),c=V(!1),d=V([]),f=V(0),h=V(null),m=D(()=>d.value.length),g=D(()=>u.value.trim()!==""&&!c.value),v=V(!1),y=D(()=>{if(m.value===0)return s("conversation.search.noResults");const ie={current:f.value+1,total:m.value};return v.value?s("conversation.search.resultsCapped",ie):s("conversation.search.results",ie)});let b=null,w=null,C=null,T=null,N=null,I=0;const S=V([]);function _(){const ie=i.pane,W=d.value[f.value];if(!ie||W===void 0){S.value=[];return}const Q=ie.getBoundingClientRect(),te=[];for(const X of W.getClientRects())te.push({top:`${X.top-Q.top+ie.scrollTop}px`,left:`${X.left-Q.left}px`,width:`${X.width}px`,height:`${X.height}px`});S.value=te}function x(ie,W){return ie.type==="attributes"&&ie.target===W?!0:E(ie)}function E(ie){const W=Q=>Q instanceof Element&&(Q.classList.contains("tsearch-rings")||Q.closest(".tsearch-rings")!==null);if(W(ie.target))return!0;if(ie.type==="childList"){const Q=[...ie.addedNodes,...ie.removedNodes];if(Q.length>0&&Q.every(W))return!0}return!1}function M(){S.value.length!==0&&(N!==null&&clearTimeout(N),N=setTimeout(()=>{N=null,_()},120))}function R(){return i.pane?.querySelector(".chat")??null}function q(){if(b!==null&&(clearTimeout(b),b=null),u.value.trim()===""){c.value=!1,z();return}c.value=!0,b=setTimeout(z,Tft)}function z(ie="first"){b!==null&&(clearTimeout(b),b=null),c.value=!1;const W=R();if(u.value.trim()===""||W===null){d.value=[],v.value=!1,f.value=0,Yw(),_();return}const Q=d.value[f.value],te=Q?.startContainer??null,X=Q?.startOffset??0,ge=Aae(W,u.value.trim()),ue=ge.ranges;if(v.value=ge.truncated,d.value=ue,ue.length===0){f.value=0,F3([],0),_();return}if(ie!==!1){const fe=O(ue);f.value=ie==="backward"?(fe-1+ue.length)%ue.length:fe,B();return}const se=te!==null?ue.findIndex(fe=>fe.startContainer===te&&fe.startOffset===X):-1;f.value=se>=0?se:O(ue),F3(ue,f.value),_()}function O(ie){const W=i.pane?.getBoundingClientRect().top??0,Q=ie.findIndex(te=>{const X=te.getClientRects(),ge=X[X.length-1];return ge!==void 0&&ge.bottom>=W});return Q===-1?0:Q}function B(){const ie=d.value[f.value];F3(d.value,f.value),ie!==void 0&&i.reveal(ie),_()}function P(ie){m.value!==0&&(f.value=(f.value+ie+m.value)%m.value,B())}function H(ie){if(ie.key==="Enter"&&!a(ie)){if(ie.preventDefault(),b!==null){z(ie.shiftKey?"backward":"first");return}P(ie.shiftKey?-1:1)}}function j(ie){ie.key==="Escape"&&(a(ie)||(ie.preventDefault(),ie.stopPropagation(),o("close")))}function Z(){const ie=h.value;ie&&(ie.focus(),ie.select())}return t({focusInput:Z}),yn(()=>{ht(()=>h.value?.focus()),i.pane&&typeof MutationObserver=="function"&&(C=new MutationObserver(W=>{if(u.value.trim()!==""&&!W.every(Q=>x(Q,i.pane))&&b===null){if(Date.now()-I>=Lft){I=Date.now(),w!==null&&(clearTimeout(w),w=null),z(!1);return}w!==null&&clearTimeout(w),w=setTimeout(()=>{w=null,b===null&&(I=Date.now(),z(!1))},Eft)}}),C.observe(i.pane,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["inert","style","class"]})),i.pane?.addEventListener("scroll",M,{passive:!0});const ie=[i.pane,i.pane?.querySelector(".content-wrap")??null];if(typeof ResizeObserver=="function"){T=new ResizeObserver(()=>_());for(const W of ie)W&&T.observe(W)}}),Ln(()=>{b!==null&&clearTimeout(b),w!==null&&clearTimeout(w),N!==null&&clearTimeout(N),C?.disconnect(),C=null,T?.disconnect(),T=null,i.pane?.removeEventListener("scroll",M),Yw()}),(ie,W)=>(k(),L("div",{class:Re(["tsearch",{mobile:e.mobile}]),role:"search",onKeydown:j},[A("div",Cft,[U(p(Ce),{class:"tsearch-icon",name:"search",size:"sm","aria-hidden":"true"}),ai(A("input",{ref_key:"inputRef",ref:h,"onUpdate:modelValue":W[0]||(W[0]=Q=>u.value=Q),type:"text",class:"tsearch-input",placeholder:p(s)("conversation.search.placeholder"),autocapitalize:"off",autocomplete:"off",spellcheck:"false",onInput:q,onKeydown:H,onCompositionstart:W[1]||(W[1]=(...Q)=>p(r)&&p(r)(...Q)),onCompositionend:W[2]||(W[2]=(...Q)=>p(l)&&p(l)(...Q))},null,40,Aft),[[ur,u.value]]),c.value?(k(),L("span",xft,[U(p(mo),{size:"sm",label:p(s)("conversation.search.searching")},null,8,["label"])])):ee("",!0),W[6]||(W[6]=A("span",{class:"tsearch-sep","aria-hidden":"true"},null,-1)),U(p(ln),{class:"tsearch-close",size:"sm",label:p(s)("conversation.search.close"),tooltip:p(s)("conversation.search.close"),onClick:W[3]||(W[3]=Q=>o("close"))},{default:ce(()=>[U(p(Ce),{name:"close"})]),_:1},8,["label","tooltip"])]),A("div",{class:Re(["tsearch-foot-wrap",{open:g.value}]),inert:!g.value},[A("div",_ft,[U(p(ln),{size:"sm",label:p(s)("conversation.search.previous"),tooltip:p(s)("conversation.search.previous"),disabled:m.value===0,onClick:W[4]||(W[4]=Q=>P(-1))},{default:ce(()=>[U(p(Ce),{name:"arrow-up"})]),_:1},8,["label","tooltip","disabled"]),U(p(ln),{size:"sm",label:p(s)("conversation.search.next"),tooltip:p(s)("conversation.search.next"),disabled:m.value===0,onClick:W[5]||(W[5]=Q=>P(1))},{default:ce(()=>[U(p(Ce),{name:"arrow-down"})]),_:1},8,["label","tooltip","disabled"]),A("span",Mft,F(y.value),1)])],10,Sft),e.pane?(k(),de(cs,{key:0,to:e.pane},[A("div",Ift,[(k(!0),L(De,null,Ct(S.value,(Q,te)=>(k(),L("div",{key:te,class:"tsearch-ring",style:on(Q)},null,4))),128))])],8,["to"])):ee("",!0)],34))}}),Dft=xt(Nft,[["__scopeId","data-v-43f7fb07"]]),Fft={key:1,class:"empty-hint"},Bft={class:"empty-hint-title"},Rft={key:1,class:"empty-hint-title is-starting"},$ft={key:2,class:"empty-hint-text"},Oft={key:2,class:"upgrade-banner"},Pft={class:"upgrade-banner-text"},zft={class:"ws-bar"},jft={key:0,class:"ws-anchor"},Hft=["aria-expanded"],Wft={class:"ws-chip-name"},qft={class:"ws-caption"},Uft=["onClick"],Vft={class:"ws-info"},Kft={class:"ws-name"},Zft={class:"ws-path"},Gft={class:"empty-spacer empty-tail"},Qft=["aria-label"],Yft={key:0,class:"undo-toast",role:"status","aria-live":"polite"},Jft={class:"undo-toast-text"},Xft=48,eg=80,yR=1e3,eht=420,tht=3e3,nht=5e3,iht=1e4,oht=2500,sht=lt({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},restTasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},sessionPlans:{},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},lastTurnReason:{},turnError:{},turnRetry:{},overlayOpen:{type:Boolean},starting:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},authReady:{type:Boolean},managedSignedIn:{type:Boolean},managedMembership:{},starredIds:{},skills:{},skillsLoaded:{type:Boolean},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},recentSessions:{},draftEntry:{},sessionTitle:{},sessionArchived:{type:Boolean},sessionPinned:{type:Boolean},pr:{}},emits:["submit","steer","approval","cancelTask","detachTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","steerQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","login","openMedia","refreshGitStatus","editMessage","quoteAction","selectWorkspace","addWorkspace","selectSession","openPr","renameSession","forkSession","togglePin","archiveSession","restoreSession","exportSession","openSessionAdmin"],setup(e,{expose:t,emit:n}){const{t:i}=qt(),o=e,s=n,r=V(!1),l=V(null);ld(r,l);const a=V(!1),u=V(null),c=D(()=>o.workspaces?.find(Ne=>Ne.id===o.activeWorkspaceId)?.name??o.workspaceName??""),{sidebarTabs:d}=em(),f=D(()=>!o.mobile&&!o.starting&&o.draftEntry==="workspace"&&d.value),h=D(()=>(o.workspaces?.length??0)>0),m=D(()=>o.authReady===!1&&(o.models?.length??0)===0&&o.managedSignedIn===!0&&o.managedMembership==="free"),g=D(()=>$ae(o.workspaces??[],o.activeWorkspaceId));function v(Me){if(r.value){r.value=!1;return}const Ne=Me.currentTarget?.closest(".ws-anchor"),nt=Ne?.closest(".panes");if(Ne instanceof HTMLElement&&nt instanceof HTMLElement){const Ft=Ne.getBoundingClientRect(),fn=nt.getBoundingClientRect(),$n=fn.bottom-Ft.bottom-4,Gn=Ft.top-fn.top-4;a.value=Gn>$n;const zn=Math.max(0,Math.floor(a.value?Gn:$n));u.value=`min(calc(var(--space-8) * 10), ${zn}px)`}else a.value=!1,u.value=null;r.value=!0}function y(Me){r.value=!1,Me!==o.activeWorkspaceId&&s("selectWorkspace",Me)}Sr(Cn.contentAlign);const b=V(null),w=V(null),C=V(null),T=V(!1);let N=null;function I(Me,Ne,nt){const Ft=C.value??w.value;return!Ft||Ft.loadForEdit(Me)===!1?!1:nt!==void 0&&Ft.restoreDraftEntries?(Ft.restoreDraftEntries(nt),!0):(Ft.loadAttachmentsForEdit(Ne??[]),!0)}function S(Me,Ne,nt){const Ft=C.value??w.value;return Ft?.insertQuote?Ft.insertQuote(Me,Ne,nt)!==!1:!1}function _(){const Me=C.value;return Me?.hasInsertableComposer!==void 0?Me.hasInsertableComposer():w.value?.insertQuote!==void 0}function x(){const Me=C.value??w.value;return Me?Me.isEmpty?.()??!0:!0}function E(){T.value=!0,N!==null&&clearTimeout(N),N=setTimeout(()=>{N=null,T.value=!1},2e3)}const M=D(()=>o.tasks.filter(Me=>Me.kind==="bash"||Me.kind==="tool"&&!Me.id.startsWith("question-"))),R=D(()=>o.tasks.filter(Me=>Me.kind==="subagent"&&Me.runInBackground)),q=D(()=>M.value.filter(Me=>Me.state==="run").length),z=D(()=>R.value.filter(Me=>Me.state==="run").length);function O(Me){const Ne=o.tasks,nt=Ne.find(fn=>fn.id===Me)??Ne.find(fn=>fn.parentToolCallId===Me);if(nt?.agentId)return nt.agentId;const Ft=Ne.filter(fn=>fn.kind==="subagent"&&!fn.parentToolCallId&&fn.agentId);if(Ft.length===1)return Ft[0].agentId}ii(XV,O);const B=Jt(im),P=Jt(om);function H(Me,Ne){const nt=Ne??O(Me);if(nt===void 0)return;const Ft=o.tasks.find(Gn=>Gn.agentId===nt||Gn.id===nt),fn=B?.(Ft?.model),$n=P?.(Ft?.thinkingEffort);if(!(fn===void 0&&$n===void 0))return{display:fn,effort:$n}}ii(eK,H);function j(Me,Ne){const nt=o.tasks.find(Ft=>Ft.parentToolCallId===Me);if(nt!==void 0)return nt.state;if(Ne!==void 0)return o.tasks.find(Ft=>(Ft.agentId===Ne||Ft.id===Ne)&&Ft.parentToolCallId===void 0)?.state}ii(tK,j);function Z(Me){const Ne=(o.restTasks??[]).filter(nt=>nt.parentToolCallId===Me);if(Ne.length!==0)return Ne.some(nt=>nt.status==="running"&&nt.runInBackground!==!0)}ii(qx,Z),ii(df,Ns);const ie=D(()=>(o.todos??[]).filter(Me=>Me.status==="done").length),W=D(()=>o.goal!=null||M.value.length>0||R.value.length>0||(o.todos?.length??0)>0),Q=V(null),te=D(()=>o.gitInfo?o.changes?.length??0:0);function X(Me){pe.value||(Q.value=Q.value===Me?null:Me)}function ge(){Q.value=null}function ue(){o.goal&&!pe.value&&(Q.value="goal")}We(()=>[o.goal,M.value.length,R.value.length,o.todos?.length,o.planMode,o.sessionPlans],()=>{const Me=Q.value;if(Me===null)return;Me==="goal"&&o.goal!=null||Me==="bash"&&M.value.length>0||Me==="subagent"&&R.value.length>0||Me==="todos"&&(o.todos?.length??0)>0||Me==="plan"&&(o.planMode===!0||Object.keys(o.sessionPlans??{}).length>0)||ge()});function se(Me){return Ast(Me,i)}const fe=D(()=>o.turns.filter(Me=>Me.role==="user").map((Me,Ne)=>({id:Me.id,role:Me.role,no:Ne+1,title:se(Me)}))),G=V(null);function ae(){const Me=ze.value;if(!Me)return;const Ne=fe.value;if(Ne.length===0)return;if(Gt()<=eg){G.value=Ne[Ne.length-1].id;return}if(re||K===null){const $n=Me.scrollTop,Gn=Me.getBoundingClientRect().top,zn=[];for(const bo of Me.querySelectorAll(".turn-anchor[data-turn-id]")){const Gs=bo.dataset.turnId;Gs&&zn.push({id:Gs,top:bo.getBoundingClientRect().top-Gn+$n})}K=zn,re=!1}const nt=new Set(Ne.map($n=>$n.id)),Ft=Me.scrollTop+Me.clientHeight/2;let fn=null;for(const $n of K)nt.has($n.id)&&$n.top<=Ft&&(fn=$n.id);G.value=fn??Ne[0].id}let K=null,re=!0;function be(){re=!0}let ke=0;function we(){ke||(ke=Hi(()=>{ke=0,ae()}))}const oe=V(!1);let le=0;function ye(){le||(le=Hi(()=>{le=0,_e()}))}function Ae(){ye(),be()}function _e(){const Me=ze.value,Ne=!o.mobile&&Me?Me.closest(".con")?.querySelector(".conversation-toc"):null,nt=Ne?.querySelector(".toc-bar");let Ft=!1;if(Me&&Ne&&nt){const fn=nt.getBoundingClientRect(),$n=Ne.getBoundingClientRect(),Gn=fn.left+fn.width/2;Ft=Array.from(Me.querySelectorAll(".table-node-wrapper")).some(zn=>{const bo=zn.getBoundingClientRect();return bo.left<=Gn&&Gn<=bo.right&&bo.top<$n.bottom&&bo.bottom>$n.top})}oe.value!==Ft&&(oe.value=Ft)}const pe=D(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),ne=D(()=>{const Me=pe.value;if(Me)return o.pendingQuestionActions?.[Me.questionId]}),Ee=D(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),qe=D(()=>{const Me=Ee.value;return Me?!!o.pendingApprovalActions?.[Me.approvalId]:!1}),ze=V(null),ft=V(null),gt=V(0),_t=V(0),Pt=V(!1),Ht=V(null);let jt=null;function Te(){if(o.turns.length!==0){if(Pt.value){Ht.value?.focusInput();return}jt=document.activeElement,Pt.value=!0}}function Fe(){Pt.value=!1,ht(()=>{jt instanceof HTMLElement&&jt.isConnected&&jt.focus(),jt=null})}We(()=>o.turns.length===0&&!o.sessionLoading,Me=>{Me&&Pt.value&&Fe()});const Ke=D(()=>({"--panes-scrollbar-width":`${gt.value}px`})),rt=D(()=>({"--chat-dock-height":`${_t.value+Xft}px`}));function Nt(Me){return Me instanceof HTMLElement?Me:Me&&"$el"in Me&&Me.$el instanceof HTMLElement?Me.$el:null}let Lt=0;function Qt(){Lt||(Lt=Hi(()=>{Lt=0;const Me=ze.value,Ne=Me?Math.max(0,Me.offsetWidth-Me.clientWidth):0;Ne!==gt.value&&(gt.value=Ne);const nt=ft.value?.offsetHeight??0;nt!==_t.value&&(_t.value=nt)}))}function Ut(Me){const Ne=Nt(Me);Ne!==ze.value&&(ze.value=Ne,Ne&&Fs())}function en(Me){const Ne=Nt(Me);Ne!==ft.value&&(ft.value=Ne??null,Me&&"loadForEdit"in Me&&typeof Me.loadForEdit=="function"&&"focus"in Me&&typeof Me.focus=="function"?C.value={loadForEdit:Me.loadForEdit.bind(Me),insertQuote:"insertQuote"in Me&&typeof Me.insertQuote=="function"?Me.insertQuote.bind(Me):void 0,hasInsertableComposer:"hasInsertableComposer"in Me&&typeof Me.hasInsertableComposer=="function"?Me.hasInsertableComposer.bind(Me):void 0,loadAttachmentsForEdit:"loadAttachmentsForEdit"in Me&&typeof Me.loadAttachmentsForEdit=="function"?Me.loadAttachmentsForEdit.bind(Me):()=>{},restoreDraftEntries:"restoreDraftEntries"in Me&&typeof Me.restoreDraftEntries=="function"?Me.restoreDraftEntries.bind(Me):void 0,focus:Me.focus.bind(Me),get anyPopupOpen(){return"anyPopupOpen"in Me&&Me.anyPopupOpen===!0},isEmpty:"isEmpty"in Me&&typeof Me.isEmpty=="function"?Me.isEmpty.bind(Me):void 0}:C.value=null,Ko())}const it=V(!0),dt=V(!1),wt=V(!1);let dn=null;function Gt(){const Me=ze.value;return Me?fi-Me.scrollTop-Mo:0}let ri=0,ci=0,ji=0,xi=0,Uo=0,ot=0,Ue=0;function st(){return Date.now(){wt.value=!1,dn=null},900);const Me=ze.value;if(!Me)return;const Ne=Me.scrollTop;if(Mn()){ri=Ne;return}if(performance.now()-ji<100){ri=Ne;return}const nt=Gt();if(st()){it.value=!0,dt.value=!1,ri=Ne;return}Ne1?Me.scrollHeight-Ne-Me.clientHeight>1&&(it.value=!1,dt.value=!0):nt<=eg&&Ne>ri+1&&Date.now()>=xi&&(it.value=!0,dt.value=!1),ri=Ne,we()}function bt(Me=!1){const Ne=ze.value;it.value=!0,dt.value=!1,no(),Ne&&(!Me&&performance.now(){Zn=0;const $n=Math.min(1,(performance.now()-Ft)/Me),Gn=1-Math.pow(1-$n,3);Ne.scrollTop=nt+(Ne.scrollHeight-nt)*Gn,ri=Ne.scrollTop,$n<1?Zn=Hi(fn):Uo=0};Zn=Hi(fn)}function go(Me,Ne){return(Ne.closest("[inert]")?.closest(".tool-group, .activity-run, .turn-fold")??Ne).getBoundingClientRect().top-Me.getBoundingClientRect().top+Me.scrollTop}function Ls(Me,Ne){const nt=Array.from(Me.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map($n=>({node:$n,top:go(Me,$n)})),Ft=nt.findIndex($n=>$n.top>=Ne),fn=Ft<0?Math.max(0,nt.length-1):Ft;return nt.slice(fn,fn+2).flatMap($n=>{const Gn=$n.node.dataset.scrollAnchorId,zn=Gn??$n.node.dataset.turnId;return zn?[{kind:Gn?"tool":"turn",id:zn,top:$n.top}]:[]})}const Hs=new Map;function ys(Me,Ne){for(const nt of Ne.anchors){const Ft=nt.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",fn=Me.querySelector(`[${Ft}="${Tr(nt.id)}"]`);if(fn)return go(Me,fn)-nt.top}return Me.scrollHeight-Ne.oldHeight}function Vo(Me,Ne,nt=Me.scrollTop){return Me.scrollTop=nt+ys(Me,Ne),ri=Me.scrollTop,Me.scrollTop}async function Ti(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||Ro.value||!o.hasMoreMessages)return;const Me=o.sessionId,Ne=ze.value,nt=Ne?.scrollTop??0,Ft={anchors:Ne?Ls(Ne,nt):[],oldHeight:Ne?.scrollHeight??0};mi(Me,!0),Ni();try{if(await ht(),await o.loadOlderMessages(Me),await ht(),o.sessionId!==Me){Hs.set(Me,Ft);return}const fn=ze.value;if(!fn)return;Vo(fn,Ft),Hs.delete(Me)}finally{mi(Me,!1)}}function Tr(Me){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Me):Me.replaceAll(/["\\]/g,"\\$&")}let vo=null;function no(){vo!==null&&(clearTimeout(vo),vo=null)}function _o(Me){Us(),it.value=!1,dt.value=Gt()>eg,Me.scrollIntoView({behavior:"smooth",block:"center"}),no(),vo=setTimeout(()=>{vo=null;const Ne=ze.value;if(!Ne||!Me.isConnected)return;const nt=Me.getBoundingClientRect().top+Me.offsetHeight/2-(Ne.getBoundingClientRect().top+Ne.clientHeight/2);Math.abs(nt)>48&&(Ne.scrollTop+=nt)},480)}function Er(Me){const Ne=ze.value;if(!Ne)return;const nt=Ne.querySelector(`.turn-anchor[data-turn-id="${Tr(Me)}"]`);nt&&_o(nt)}function Bo(Me,Ne){const nt=Me.startContainer.parentElement;if(nt!==null)for(let Ft=nt;Ft!==null&&Ft!==Ne;Ft=Ft.parentElement){const fn=getComputedStyle(Ft),$n=/(auto|scroll)/.test(fn.overflowY)&&Ft.scrollHeight>Ft.clientHeight,Gn=/(auto|scroll)/.test(fn.overflowX)&&Ft.scrollWidth>Ft.clientWidth;if(!$n&&!Gn)continue;const zn=Me.getClientRects()[0];if(!zn)return;const bo=Ft.getBoundingClientRect();$n&&(Ft.scrollTop+=zn.top+zn.height/2-(bo.top+Ft.clientHeight/2)),Gn&&(Ft.scrollLeft+=zn.left+zn.width/2-(bo.left+Ft.clientWidth/2))}}function Qn(Me){const Ne=ze.value;if(!Ne)return;const nt=Me.startContainer.parentElement;Us(),it.value=!1,dt.value=Gt()>eg,xi=Date.now()+700;const Ft=nt?.closest(".u-text-wrap.is-clamped");if(Ft){Ft.querySelector(".u-text-toggle")?.click(),ht(()=>Zi(Me,Ne));return}Zi(Me,Ne)}function Zi(Me,Ne){const nt=Me.startContainer.parentElement;Bo(Me,Ne);const Ft=Me.getClientRects()[0];if(!Ft){nt instanceof HTMLElement&&_o(nt);return}const fn=Ne.getBoundingClientRect(),$n=Ft.top+Ft.height/2-(fn.top+Ne.clientHeight/2),Gn=typeof window>"u"||!window.matchMedia("(prefers-reduced-motion: reduce)").matches;Ne.scrollTo({top:Ne.scrollTop+$n,behavior:Gn?"smooth":"auto"}),no(),vo=setTimeout(()=>{vo=null;const zn=ze.value,bo=Me.getClientRects()[0];if(!zn||!bo)return;const Gs=zn.getBoundingClientRect(),Sl=bo.top+bo.height/2-(Gs.top+zn.clientHeight/2);Math.abs(Sl)>48&&(zn.scrollTop+=Sl)},480)}function yi(){const Me=ze.value;if(!Me)return"none";const Ne=Me.firstElementChild,nt=Ne instanceof HTMLElement?Ne.offsetHeight:0,Ft=ft.value?.offsetHeight??0;return`${Me.scrollHeight}:${Me.clientHeight}:${nt}:${Ft}`}function Hi(Me){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Me):setTimeout(Me,16)}function io(Me){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Me):clearTimeout(Me)}let ki=0,di=0,bi=null,oo=0;const so=V(!1);function Mn(){return performance.now(){if(di=0,!bi)return;if(it.value){bi=null,so.value=!1;return}if(performance.now()>=ki){bi=null,so.value=!1,Ws();return}const fn=bi.getBoundingClientRect().top-oo;fn&&(nt.scrollTop+=fn),di=Hi(Ft)};di=Hi(Ft)}function Ws(){Gt()<=eg?(it.value=!0,dt.value=!1):(it.value=!1,dt.value=!0)}function Jo(Me=36,Ne){if(!it.value&&!st()){Ne?.();return}const nt=++Ue;let Ft="",fn=0,$n=0;ot&&(io(ot),ot=0);const Gn=()=>{if(ot=0,nt!==Ue)return;if(!it.value&&!st()){Ne?.();return}bt(!1);const zn=yi();fn=zn===Ft?fn+1:0,Ft=zn,$n++,fn<3&&$n0&&Ne.length>=Me.length&&Me.firstId!==Ne.firstId&&Me.lastId===Ne.lastId&&Me.lastTextLen===Ne.lastTextLen&&Me.lastThinkingLen===Ne.lastThinkingLen&&Me.lastToolsLen===Ne.lastToolsLen&&Me.approvalIds===Ne.approvalIds}const ro=D(()=>{const Me=(o.approvals??[]).map($n=>$n.approvalId).join(","),Ne=o.turns,nt=Ne.at(-1),Ft=nt?.thinking?.length??0,fn=nt?.tools?.reduce(($n,Gn)=>$n+Gn.name.length+(Gn.arg?.length??0)+(Gn.output?.join("").length??0),0)??0;return{length:Ne.length,firstId:Ne[0]?.id??"",lastId:nt?.id??"",lastTextLen:nt?.text.length??0,lastThinkingLen:Ft,lastToolsLen:fn,approvalIds:Me}});let eo=o.fileReloadKey;We(ro,async(Me,Ne)=>{const nt=o.fileReloadKey,Ft=nt!==eo;if(eo=nt,Ro.value&&ks(Ne,Me)){we();return}if(Ft){we();return}await ht(),it.value||st()?bt(Me.length{Ko()}),We(()=>o.mobile,async()=>{await ht(),Qt()});const to=new Map,Gi=V(!1);let je=0,xe=null;function Pe(){Gi.value=!0,je&&(io(je),je=0),xe&&clearTimeout(xe),xe=setTimeout(()=>{Gi.value=!1,xe=null},1200)}function rn(){if(!Gi.value)return;let Me=2;const Ne=()=>{if(je=0,Me--,Me>0){je=Hi(Ne);return}Gi.value=!1,xe&&(clearTimeout(xe),xe=null)};je&&io(je),je=Hi(Ne)}We(()=>o.fileReloadKey,async(Me,Ne)=>{const nt=ze.value;Ne&&nt&&to.set(String(Ne),{top:nt.scrollTop,following:it.value}),Us(),Pe(),await ht();const Ft=ze.value,fn=Me?to.get(String(Me)):void 0;if(fn&&Ft){const $n=Hs.get(String(Me)),Gn=$n?Vo(Ft,$n,fn.top):fn.top;$n&&Hs.delete(String(Me)),it.value=fn.following,Ft.scrollTop=Gn,ri=Ft.scrollTop,dt.value=!fn.following&&Gt()>1,fn.following?Jo(36,rn):rn()}else it.value=!0,ri=0,bt(!1),Jo(36,rn);be(),ae()}),We(()=>o.sessionLoading,async(Me,Ne)=>{Me||!Ne||(it.value=!0,await ht(),Jo(36,rn),we())}),We(()=>o.turnActive,async(Me,Ne)=>{Me||!Ne||!it.value&&!st()||(await ht(),Jo(48),we())});function Yn(){it.value=!0,dt.value=!1,ci=Date.now()+yR,ht(()=>{bt(!0),Jo(16)})}function ei(Me){Yn(),s("submit",Me)}function Qi(Me){it.value=!0,dt.value=!1,ci=Date.now()+yR,s("editMessage",{...Me,text:lU(Me.text)})}function Vn(Me){const Ne=o.queued?.[Me],nt=Ne?.editText??Ne?.text??"";I(nt,Ne?.attachments)&&s("editQueued",Me)}function qs(Me){s("reorderQueue",Me)}function bs(Me,Ne){Yn(),s("answer",Me,Ne)}function Je(Me,Ne){!Me||!Ne||s("approval",Me,Ne)}let Ve=null,St=null,Rt=null,Fn=null,fi=0,Mo=0,Io=0;const ni=V(new Set),Ro=D(()=>!!o.sessionId&&ni.value.has(o.sessionId));function mi(Me,Ne){const nt=new Set(ni.value);Ne?nt.add(Me):nt.delete(Me),ni.value=nt}function cr(){Ro.value||Io||(Io=Hi(()=>{Io=0,!Ro.value&&(Mn()||(it.value||st())&&bt(!1))}))}function Ni(){Ue++,ot&&(io(ot),ot=0),Io&&(io(Io),Io=0)}function Us(){const Me=ze.value;if(ci=0,xi=0,Ni(),ki=0,bi=null,so.value=!1,Zn&&(io(Zn),Zn=0),no(),Me){const Ne=Me.scrollTop;typeof Me.scrollTo=="function"?Me.scrollTo({top:Ne,behavior:"auto"}):Me.scrollTop=Ne}Uo=0,ji=Number.NEGATIVE_INFINITY,Me&&(ri=Me.scrollTop)}function Vs(){const Me=ze.value;!Me||Me.scrollHeight-Me.clientHeight<=1&&!o.hasMoreMessages||(it.value=!1,Us(),Me.scrollHeight-Me.clientHeight>1&&(dt.value=!0))}function Ds(Me){const Ne=ze.value;if(!Ne)return!1;for(const nt of Me.composedPath()){if(nt===Ne)return!1;if(nt instanceof HTMLElement&&nt.scrollHeight>nt.clientHeight+1&&nt.scrollTop>1)return!0}return!1}function $o(Me){Me.defaultPrevented||Me.ctrlKey||Me.shiftKey||(no(),!(Me.deltaY>=0||Ds(Me))&&Vs())}function zu(Me){const Ne=ze.value;if(!Ne||Me.defaultPrevented||Me.button!==0||Me.pointerType==="touch")return;const nt=Ne.getBoundingClientRect(),Ft=Ne.offsetWidth-Ne.clientWidth,fn=Ft>0?Ft:12;Me.target===Ne&&Me.clientX>=nt.right-fn&&Vs()}let Ks=null;function Ul(Me){Ks=Me.touches.length===1?Me.touches[0].clientY:null}function pf(Me){const Ne=Me.touches.length===1?Me.touches[0].clientY:null;no(),Ne!==null&&Ks!==null&&Ne>Ks+2&&!Ds(Me)&&Vs(),Ks=Ne}function Vl(){if(!St)return;const Me=ze.value?.firstElementChild??null;Me!==Rt&&(Rt&&St.unobserve(Rt),Rt=Me,Me&&St.observe(Me))}function Ko(){if(!St)return;const Me=ft.value;Me!==Fn&&(Fn&&St.unobserve(Fn),Fn=Me,Me&&St.observe(Me))}function Fs(){const Me=ze.value;Qt(),Ve&&(Ve.disconnect(),Me&&Ve.observe(Me,{childList:!0,subtree:!0,characterData:!0})),St&&(St.disconnect(),Rt=null,Fn=null,Me&&St.observe(Me),Vl(),Ko()),fi=Me?.scrollHeight??0,Mo=Me?.clientHeight??0,ye(),be()}function Cl(){Vl(),cr(),ye(),be()}function Ya(){typeof document>"u"||document.visibilityState==="visible"&&it.value&&Jo()}const Lr=V(!1);let lo=null;function Ja(){Lr.value=!0,lo!==null&&clearTimeout(lo),lo=setTimeout(()=>{Lr.value=!1},tht)}const Zs=V(null);let yo=null;const Xo=V(null);let Yr=null,Kl=!1;function Zl(){Zs.value=null,Xo.value=null,Kl=!1,yo!==null&&(clearTimeout(yo),yo=null),Yr!==null&&(clearTimeout(Yr),Yr=null)}function Nr(){for(let Me=o.turns.length-1;Me>=0;Me--){const Ne=o.turns[Me];if(Ne.goalContinuation)return null;if(Ne.role==="user")return Ne}return null}function Al(){if(Zs.value!==null||Xo.value!==null||!o.working||(o.queued?.length??0)>0)return;const Me=Nr();if(Me===null||Me.pluginCommand!==void 0||Me.skillActivation!==void 0&&!vU(Me.skillActivation,{revivePill:!0}))return;o.turns.slice(o.turns.indexOf(Me)+1).every(nt=>nt.role==="assistant"&&!GA(nt))?(Xo.value=Me.id,Kl=!1,Yr=setTimeout(()=>{Xo.value=null},iht)):Zs.value=Me.id}let Xa=!1,Gl=null;function ju(Me){if(Xa)return;Zl();const Ne=o.turns.find(fn=>fn.id===Me);if(Ne===void 0||Ne.role!=="user"||Nr()?.id!==Ne.id||(C.value??w.value)?.isEmpty?.()===!1)return;Xa=!0,Gl=setTimeout(()=>{Xa=!1,Gl=null},oht);const Ft=Ne.skillActivation?wx(Ne.skillActivation,{revivePill:!0})??Ne.text:Ne.text;Qi({text:Ft,attachments:oK(Ne)})}function Y(){Xo.value===null||o.working||!Kl||ju(Xo.value)}We(()=>o.working,(Me,Ne)=>{if(!(Ne!==!0||Me)){if(Xo.value!==null){Y();return}Zs.value!==null&&yo===null&&(yo=setTimeout(()=>{Zs.value=null,yo=null},nht))}}),We(()=>Nr()?.id??null,(Me,Ne)=>{Me!==Ne&&Zl()}),We(()=>o.sessionId,Zl),We(()=>o.queued?.length,Me=>{(Me??0)>0&&Zl()});const ve=D(()=>{if(o.lastTurnReason!=="cancelled"||o.working||o.turnActive)return null;const Me=o.turns[o.turns.length-1];return Me?.role==="assistant"&&GA(Me)?Me.id:null}),Be=D(()=>o.lastTurnReason==="failed"&&!o.working&&!o.turnActive&&o.turns.length>0);function He(){Yn(),s("submit",{text:i("conversation.turnFailedResumeText"),attachments:[]})}const Ye=D(()=>o.working?null:Zs.value);function Xe(){s("interrupt")}function vt(){return(C.value?.anyPopupOpen??w.value?.anyPopupOpen)===!0}const{handleCompositionStart:$t,handleCompositionEnd:Vt,isComposingKeyEvent:pn}=kl();let In=null;function Bn(Me){In=Me.target}function an(Me){const Ne=Me instanceof Element&&Me!==document.body?Me:In,nt=nre(Ne,".global-preview");if(nt){yI(nt);return}const Ft=ze.value?.querySelector(".chat");Ft&&yI(Ft)}function An(Me){if(!(Me.target instanceof Element&&Me.target.closest(".terminal-host")!==null)){if(Me.key==="Escape"&&!o.overlayOpen&&!vt()&&!Me.defaultPrevented&&!Me.repeat&&!pn(Me)){Ye.value!==null?(Me.preventDefault(),ju(Ye.value)):o.working&&(Me.preventDefault(),Al(),Xe());return}if(dae(Me)&&!o.overlayOpen&&o.turns.length>0){Me.preventDefault(),Te();return}ere(Me)&&!o.overlayOpen&&!tre(Me.target)&&(Me.preventDefault(),an(Me.target))}}function Hn(){it.value&&cr()}yn(()=>{ht(()=>{typeof MutationObserver=="function"&&(Ve=new MutationObserver(Cl)),typeof ResizeObserver=="function"&&(St=new ResizeObserver(()=>{ye(),be(),Qt();const Me=ze.value;if(!Me)return;const{scrollHeight:Ne,clientHeight:nt}=Me,Ft=Ne>fi+1,fn=nt{ze.value?.removeEventListener("kimi-table-layout",Ae),Ve&&Ve.disconnect(),St&&St.disconnect(),Io&&io(Io),ot&&io(ot),di&&io(di),Zn&&io(Zn),le&&io(le),ke&&io(ke),vo!==null&&clearTimeout(vo),dn&&clearTimeout(dn),lo!==null&&clearTimeout(lo),yo!==null&&clearTimeout(yo),Yr!==null&&clearTimeout(Yr),Gl!==null&&clearTimeout(Gl),N!==null&&(clearTimeout(N),N=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ya),document.removeEventListener("keydown",An),document.removeEventListener("pointerdown",Bn,!0),document.removeEventListener("compositionstart",$t),document.removeEventListener("compositionend",Vt)),window.visualViewport?.removeEventListener("resize",Hn)});function Wn(){(C.value??w.value)?.focus()}cPe({sessionId:()=>o.sessionId,mobile:()=>o.mobile===!0,starting:()=>o.starting===!0,dockedComposer:C,emptyComposer:w});function Di(){Ja()}function ao(Me){if(Xo.value!==null){if(!Me){Kl||Zl();return}Kl=!0,Y()}}const dr=Jt(qo),Dc=D(()=>dr?.isVisible()??!1),xl=D(()=>!o.mobile&&dr!==void 0&&!Dc.value&&o.turns.length===0&&!o.sessionLoading);async function wa(){dr?.togglePanel(),await ht(),document.querySelector(".ptb-hide")?.focus()}return t({loadComposerForEdit:I,insertComposerQuote:S,hasInsertableComposer:_,isComposerEmpty:x,focusComposer:Wn,notifyUndone:Di,onAbortOutcome:ao,selectAllRegion:an,focusGoal:ue,closeDockPanel:ge,composerPopupOpen:vt}),(Me,Ne)=>(k(),L("section",{class:Re(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(k(),de(_lt,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":te.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:T.value,archived:e.sessionArchived,pinned:e.sessionPinned,onCopyAll:Ne[0]||(Ne[0]=nt=>b.value?.copyConversation()),onCopyFinalSummary:Ne[1]||(Ne[1]=nt=>b.value?.copyFinalSummary()),onOpenPr:Ne[2]||(Ne[2]=nt=>e.pr&&s("openPr",e.pr.url)),onRenameSession:Ne[3]||(Ne[3]=(nt,Ft)=>s("renameSession",nt,Ft)),onForkSession:Ne[4]||(Ne[4]=nt=>s("forkSession",nt)),onTogglePin:Ne[5]||(Ne[5]=nt=>s("togglePin",nt)),onArchiveSession:Ne[6]||(Ne[6]=nt=>s("archiveSession",nt)),onRestoreSession:Ne[7]||(Ne[7]=nt=>s("restoreSession",nt)),onExportSession:Ne[8]||(Ne[8]=nt=>s("exportSession",nt))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied","archived","pinned"])):e.mobile?ee("",!0):(k(),L("div",{key:1,class:Re(["empty-drag",{"macos-desktop":p(Cd)}])},null,2)),xl.value?(k(),de(p(ln),{key:2,class:"empty-panel-btn",label:p(i)("panel.openPanel"),tooltip:p(i)("panel.openPanel"),onClick:wa},{default:ce(()=>[U(p(Ce),{name:"panel-expand-right",size:"sm"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(xXe),{items:fe.value,"active-turn-id":G.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:oe.value,onSelect:Er},null,8,["items","active-turn-id","mobile","session-loading","occluded"]),A("div",{class:"chat-layout",style:on(rt.value)},[A("div",{ref:Ut,class:Re(["panes chat-scroll",{"is-following":it.value,"history-prepending":Ro.value,"is-pinned":so.value,scrolling:wt.value,"session-settling":Gi.value}]),onScrollPassive:_n,onWheelPassive:$o,onPointerdownPassive:zu,onTouchstartPassive:Ul,onTouchmovePassive:pf},[A("div",{class:Re(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(k(),L(De,{key:0},[Ne[54]||(Ne[54]=A("div",{class:"empty-spacer"},null,-1)),f.value?(k(),de(hft,{key:0,"workspace-name":c.value,"workspace-root":e.workspaceRoot},null,8,["workspace-name","workspace-root"])):(k(),L("div",Fft,[e.starting?(k(),L("span",Rft,[U(p(mo),{size:"sm"}),A("span",null,F(p(i)("conversation.starting")),1)])):(k(),de(p(jOe),{key:0,class:"empty-doodle"},{fallback:ce(()=>[A("span",Bft,F(p(i)("composer.emptyConversationTitle")),1)]),_:1})),e.starting?ee("",!0):(k(),L("span",$ft,F(p(i)("composer.emptyConversation")),1))])),m.value?(k(),L("div",Oft,[U(p(Ce),{class:"upgrade-banner-icon",name:"music",size:"sm"}),A("span",Pft,F(p(i)("composer.upgradeBanner")),1),A("button",{type:"button",class:"upgrade-banner-cta",onClick:Ne[9]||(Ne[9]=nt=>p(mv)())},F(p(i)("sidebar.upgrade")),1)])):ee("",!0),U(VZ,{ref_key:"emptyComposerRef",ref:w,class:"empty-composer","session-id":e.sessionId,running:e.running,working:e.working,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,"skills-loaded":e.skillsLoaded,starting:e.starting,"hide-context":"",onSubmit:ei,onSteer:Ne[12]||(Ne[12]=nt=>s("steer",nt)),onCommand:Ne[13]||(Ne[13]=nt=>s("command",nt)),onInterrupt:Xe,onUnqueue:Ne[14]||(Ne[14]=nt=>s("unqueue",nt)),onEditQueued:Ne[15]||(Ne[15]=nt=>s("editQueued",nt)),onSetPermission:Ne[16]||(Ne[16]=nt=>s("setPermission",nt)),onSetThinking:Ne[17]||(Ne[17]=nt=>s("setThinking",nt)),onTogglePlan:Ne[18]||(Ne[18]=nt=>s("togglePlan")),onToggleSwarm:Ne[19]||(Ne[19]=nt=>s("toggleSwarm")),onToggleGoal:Ne[20]||(Ne[20]=nt=>s("toggleGoal")),onCreateGoal:Ne[21]||(Ne[21]=nt=>s("createGoal",nt)),onControlGoal:Ne[22]||(Ne[22]=nt=>s("controlGoal",nt)),onFocusGoal:ue,onCompact:Ne[23]||(Ne[23]=nt=>s("compact")),onPickModel:Ne[24]||(Ne[24]=nt=>s("pickModel")),onSelectModel:Ne[25]||(Ne[25]=nt=>s("selectModel",nt)),onLogin:Ne[26]||(Ne[26]=nt=>s("login"))},l$({_:2},[e.starting?void 0:{name:"footer",fn:ce(()=>[A("div",zft,[h.value?(k(),L("div",jft,[U(p(Nn),{text:p(i)("conversation.switchWorkspace")},{default:ce(()=>[A("button",{type:"button",class:Re(["ws-chip",{open:r.value}]),"aria-expanded":r.value,onClick:Tt(v,["stop"])},[U(p(Ce),{name:"folder"}),A("span",Wft,F(c.value),1),U(p(Ce),{class:"ws-chip-chev",name:"chevron-down",size:"sm"})],10,Hft)]),_:1},8,["text"]),r.value?(k(),L("div",{key:0,ref_key:"wsPanelRef",ref:l,class:Re(["ws-panel",{up:a.value}]),style:on(u.value?{maxHeight:u.value}:void 0),role:"menu"},[A("div",qft,F(p(i)("workspace.recentLabel")),1),(k(!0),L(De,null,Ct(g.value,nt=>(k(),L("button",{key:nt.id,type:"button",class:Re(["ws-row",{on:nt.id===e.activeWorkspaceId}]),role:"menuitem",onClick:Tt(Ft=>y(nt.id),["stop"])},[U(p(Ce),{name:"folder"}),A("span",Vft,[A("span",Kft,F(nt.name),1),A("span",Zft,F(nt.shortPath),1)]),nt.id===e.activeWorkspaceId?(k(),de(p(Ce),{key:0,class:"ws-check",name:"check",size:"sm"})):ee("",!0)],10,Uft))),128)),Ne[53]||(Ne[53]=A("div",{class:"ws-divider"},null,-1)),A("button",{type:"button",class:"ws-action",role:"menuitem",onClick:Ne[10]||(Ne[10]=Tt(nt=>{r.value=!1,s("addWorkspace")},["stop"]))},[U(p(Ce),{name:"folder-plus"}),A("span",null,F(p(i)("conversation.pickFolder")),1)])],6)):ee("",!0)])):(k(),L("button",{key:1,type:"button",class:"ws-chip ws-ghost",onClick:Ne[11]||(Ne[11]=nt=>s("addWorkspace"))},[U(p(Ce),{name:"folder-plus"}),A("span",null,F(p(i)("conversation.pickFolder")),1)]))])]),key:"0"}]),1032,["session-id","running","working","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","swarm-mode","goal-mode","goal","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","skills-loaded","starting"]),r.value?(k(),L("div",{key:3,class:"ws-backdrop",onClick:Ne[27]||(Ne[27]=nt=>r.value=!1)})):ee("",!0),A("div",Gft,[f.value&&(e.recentSessions?.length??0)>0?(k(),de(wft,{key:0,sessions:e.recentSessions??[],onSelectSession:Ne[28]||(Ne[28]=nt=>s("selectSession",nt)),onOpenSessionAdmin:Ne[29]||(Ne[29]=nt=>s("openSessionAdmin",e.activeWorkspaceId??void 0))},null,8,["sessions"])):ee("",!0)])],64)):(k(),de(p($P),{key:1},{default:ce(()=>[(k(),de(p(yS),{ref_key:"chatPaneRef",ref:b,key:e.fileReloadKey??"no-session",turns:e.turns,cwd:e.status.cwd,approvals:e.approvals,questions:e.questions,"turn-active":e.turnActive,working:e.working,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":it.value,queued:e.queued,"undo-hint-turn-id":Ye.value,"interrupted-turn-id":ve.value,"turn-failed":Be.value,"turn-error":e.turnError??null,"turn-retry":e.turnRetry??null,onResumeTurn:He,onOpenMedia:Ne[30]||(Ne[30]=nt=>s("openMedia",nt)),onDetach:Ne[31]||(Ne[31]=nt=>s("detachTask",nt)),onCopyConversationCopied:E,onEditMessage:Qi,onQuoteAction:Ne[32]||(Ne[32]=nt=>s("quoteAction",nt)),onArmedUndo:ju,onLoadOlderMessages:Ti,onUnqueue:Ne[33]||(Ne[33]=nt=>s("unqueue",nt)),onEditQueued:Vn,onReorderQueue:qs,onSteerQueued:Ne[34]||(Ne[34]=nt=>s("steerQueued",nt))},null,8,["turns","cwd","approvals","questions","turn-active","working","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued","undo-hint-turn-id","interrupted-turn-id","turn-failed","turn-error","turn-retry"]))]),_:1}))],2)],34),e.turns.length===0&&!e.sessionLoading?ee("",!0):(k(),de(lft,{key:0,ref:en,style:on(Ke.value),"session-id":e.sessionId,running:e.running,working:e.working,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,"skills-loaded":e.skillsLoaded,goal:e.goal,"session-plans":e.sessionPlans,"dock-panel":Q.value,"overlay-open":e.overlayOpen,"bash-tasks":M.value,"subagent-tasks":R.value,"bash-running":q.value,"subagent-running":z.value,"todo-done-count":ie.value,"has-dock-work":W.value,todos:e.todos,"pending-question":pe.value,"question-busy-kind":ne.value,"pending-approval":Ee.value,"approval-busy":qe.value,mobile:e.mobile,onToggleDockPanel:Ne[35]||(Ne[35]=nt=>X(nt)),onCloseDockPanel:Ne[36]||(Ne[36]=nt=>ge()),onAnswer:bs,onDismiss:Ne[37]||(Ne[37]=nt=>s("dismiss",nt)),onApproval:Je,onCancelTask:Ne[38]||(Ne[38]=nt=>s("cancelTask",nt)),onControlGoal:Ne[39]||(Ne[39]=nt=>s("controlGoal",nt)),onSubmit:ei,onSteer:Ne[40]||(Ne[40]=nt=>s("steer",nt)),onCommand:Ne[41]||(Ne[41]=nt=>s("command",nt)),onInterrupt:Xe,onSetPermission:Ne[42]||(Ne[42]=nt=>s("setPermission",nt)),onSetThinking:Ne[43]||(Ne[43]=nt=>s("setThinking",nt)),onTogglePlan:Ne[44]||(Ne[44]=nt=>s("togglePlan")),onToggleSwarm:Ne[45]||(Ne[45]=nt=>s("toggleSwarm")),onToggleGoal:Ne[46]||(Ne[46]=nt=>s("toggleGoal")),onCreateGoal:Ne[47]||(Ne[47]=nt=>s("createGoal",nt)),onFocusGoal:ue,onCompact:Ne[48]||(Ne[48]=nt=>s("compact")),onPickModel:Ne[49]||(Ne[49]=nt=>s("pickModel")),onSelectModel:Ne[50]||(Ne[50]=nt=>s("selectModel",nt)),onLogin:Ne[51]||(Ne[51]=nt=>s("login"))},null,8,["style","session-id","running","working","starting","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","swarm-mode","goal-mode","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","skills-loaded","goal","session-plans","dock-panel","overlay-open","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))],4),Pt.value?(k(),de(Dft,{key:3,ref_key:"transcriptSearchRef",ref:Ht,pane:ze.value,mobile:e.mobile,reveal:Qn,onClose:Fe},null,8,["pane","mobile"])):ee("",!0),U(ko,{name:"pill"},{default:ce(()=>[dt.value&&e.turns.length>0?(k(),L("button",{key:0,class:"newmsg-pill",style:on({bottom:`${_t.value+12}px`}),"aria-label":p(i)("conversation.jumpToLatestAria"),onClick:Ne[52]||(Ne[52]=nt=>bt(!0))},[U(p(Ce),{class:"pill-chevron",name:"arrow-down",size:"sm"}),$e(" "+F(p(i)("conversation.newMessages")),1)],12,Qft)):ee("",!0)]),_:1}),U(ko,{name:"undo-toast"},{default:ce(()=>[Lr.value?(k(),L("div",Yft,[A("span",Jft,F(p(i)("conversation.undone")),1)])):ee("",!0)]),_:1})],2))}}),rht=xt(sht,[["__scopeId","data-v-ac65bbbb"]]);function J4(){[...document.querySelectorAll(".ch-panel, .empty-panel-btn, .session-admin .sa-back")].find(n=>n.getClientRects().length>0)?.focus()}function ah(){ht(()=>{const e=document.querySelector(".ptb-tab.on .ptb-tab-main");if(e){e.focus();return}J4()})}const lht={class:"panel-tab-bar"},aht=["aria-selected","tabindex","title","onClick","onKeydown"],uht={class:"ptb-t"},cht=["aria-label","tabindex","onClick"],dht={class:"ptb-tail"},fht=lt({__name:"PanelTabBar",props:{tabs:{},activeTabId:{},expanded:{type:Boolean},visible:{type:Boolean},canExpand:{type:Boolean},canOpenDiff:{type:Boolean},canOpenBtw:{type:Boolean}},emits:["activate","close","add","toggleExpanded","hide"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=Ec();function r(S){return Dp[S.type].icon}const l=V(null);We(()=>n.activeTabId,async()=>{await ht(),l.value?.querySelector(".ptb-tab.on")?.scrollIntoView({inline:"nearest",block:"nearest"})});const a=new Map;function u(S){return _=>{_ instanceof HTMLElement?a.set(S,_):a.delete(S)}}function c(S,_){const x=n.tabs;let E=null;if(S.key==="ArrowLeft")E=Math.max(0,_-1);else if(S.key==="ArrowRight")E=Math.min(x.length-1,_+1);else if(S.key==="Home")E=0;else if(S.key==="End")E=x.length-1;else return;S.preventDefault();const M=x[E];M===void 0||E===_||(i("activate",M.id),a.get(M.id)?.focus())}const d=V(!1),f=V(null),h=V(null);function m(S){const _=S.target;h.value?.el?.contains(_)||f.value?.el?.contains(_)||b()}function g(S){S.key==="Escape"&&(S.stopPropagation(),S.preventDefault(),b({refocus:!0}))}function v(){d.value||(d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("keydown",g,!0),ht(()=>{h.value?.el?.querySelector(".ui-menu-item:not(:disabled)")?.focus()}))}function y(S){if(S.stopPropagation(),d.value){b();return}v()}function b(S){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("keydown",g,!0),S?.refocus&&f.value?.el?.focus()}function w(S){if(S.key!=="ArrowDown"&&S.key!=="ArrowUp")return;S.preventDefault();const _=Array.from(h.value?.el?.querySelectorAll(".ui-menu-item:not(:disabled)")??[]);if(_.length===0)return;const x=_.indexOf(document.activeElement),E=S.key==="ArrowDown"?(x+1)%_.length:(x-1+_.length)%_.length;_[E]?.focus()}function C(S){const _=S.relatedTarget;_&&(h.value?.el?.contains(_)||f.value?.el?.contains(_))||b()}We(()=>n.visible,S=>{S||b()}),We(()=>n.activeTabId,()=>b()),Ln(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("keydown",g,!0)});function T(S){b({refocus:!0}),i("add",S)}function N(S){i("close",S),ah()}function I(){i("hide"),ht(J4)}return(S,_)=>(k(),L("div",lht,[A("div",{ref_key:"tabsEl",ref:l,class:"ptb-tabs",role:"tablist"},[(k(!0),L(De,null,Ct(e.tabs,(x,E)=>(k(),L("div",{key:x.id,class:Re(["ptb-tab",{on:x.id===e.activeTabId}])},[A("button",{ref_for:!0,ref:u(x.id),type:"button",class:"ptb-tab-main",role:"tab","aria-selected":x.id===e.activeTabId,tabindex:x.id===e.activeTabId?0:-1,title:x.title,onClick:M=>i("activate",x.id),onKeydown:M=>c(M,E)},[U(p(Ce),{name:r(x),size:"sm"},null,8,["name"]),A("span",uht,F(x.title),1)],40,aht),A("button",{type:"button",class:"ptb-x","aria-label":p(o)("panel.closeTab"),tabindex:x.id===e.activeTabId?0:-1,onClick:M=>N(x.id)},[U(p(Ce),{name:"close",size:"sm"})],8,cht)],2))),128))],512),A("div",dht,[U(p(ln),{ref_key:"addBtnRef",ref:f,size:"sm",label:p(o)("panel.newTab"),tooltip:p(o)("panel.newTab"),"aria-haspopup":"menu","aria-expanded":d.value,onClick:y,onKeydown:[Qo(Tt(v,["prevent"]),["down"]),Qo(Tt(v,["prevent"]),["up"])],onFocusout:C},{default:ce(()=>[U(p(Ce),{name:"plus"})]),_:1},8,["label","tooltip","aria-expanded","onKeydown"]),e.canExpand&&e.tabs.length>0?(k(),de(p(ln),{key:0,size:"sm",label:e.expanded?p(o)("panel.collapse"):p(o)("panel.expand"),tooltip:e.expanded?p(o)("panel.collapse"):p(o)("panel.expand"),onClick:_[0]||(_[0]=x=>i("toggleExpanded"))},{default:ce(()=>[U(p(Ce),{name:e.expanded?"collapse":"expand"},null,8,["name"])]),_:1},8,["label","tooltip"])):ee("",!0),U(p(ln),{class:"ptb-hide",size:"sm",label:p(o)("panel.hide"),tooltip:p(o)("panel.hide"),onClick:I},{default:ce(()=>[U(p(Ce),{name:p(s)?"close":"panel-collapse-right"},null,8,["name"])]),_:1},8,["label","tooltip"])]),d.value?(k(),de(p(zs),{key:0,ref_key:"addMenuRef",ref:h,class:"panel-add-menu",onKeydown:w,onFocusout:C},{default:ce(()=>[U(p(nn),{disabled:!e.canOpenBtw,size:p(s)?"lg":"md",onClick:_[1]||(_[1]=x=>T("btw"))},{default:ce(()=>[U(p(Ce),{name:"message"}),$e(" "+F(p(o)("sideChat.title")),1)]),_:1},8,["disabled","size"]),U(p(nn),{disabled:!e.canOpenDiff,size:p(s)?"lg":"md",onClick:_[2]||(_[2]=x=>T("diff"))},{default:ce(()=>[U(p(Ce),{name:"git-fork"}),$e(" "+F(p(o)("panel.tabs.diff")),1)]),_:1},8,["disabled","size"])]),_:1},512)):ee("",!0)]))}}),hht=xt(fht,[["__scopeId","data-v-808fd300"]]),pht=["aria-label"],mht=lt({__name:"PanelLauncher",props:{canOpenDiff:{type:Boolean},canOpenBtw:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,i=t,{t:o}=qt(),s=Ec();return(r,l)=>(k(),L("div",{class:"pl",role:"group","aria-label":p(o)("panel.launcherAria")},[U(p(nn),{role:"button",size:p(s)?"lg":"md",disabled:!n.canOpenDiff,onClick:l[0]||(l[0]=a=>i("open","diff"))},{default:ce(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),$e(" "+F(p(o)("panel.tabs.diff")),1)]),_:1},8,["size","disabled"]),U(p(nn),{role:"button",size:p(s)?"lg":"md",disabled:!n.canOpenBtw,onClick:l[1]||(l[1]=a=>i("open","btw"))},{default:ce(()=>[U(p(Ce),{name:"message",size:"sm"}),$e(" "+F(p(o)("sideChat.title")),1)]),_:1},8,["size","disabled"])],8,pht))}}),ght=xt(mht,[["__scopeId","data-v-445e1a28"]]),vht={file:LOe,diff:JXe,"turn-diff":Yet,compaction:Uet,agent:vXe,btw:_et};function yht(e,t){const{panel:n,client:i,filePreview:o}=t,s=()=>{n.closeTab(e.id),ah()};switch(e.type){case"file":{const r=e.payload;return{file:o.previewFile.value,loading:o.previewLoading.value,error:o.previewError.value,line:r.line,downloadUrl:o.previewDownloadUrl.value,closable:!0,externalActions:o.previewExternalActions.value,openFile:l=>n.openFilePreview(l),onClose:s,onOpenExternal:()=>o.openPreviewInEditor(),onReveal:()=>o.revealPreviewFile()}}case"diff":return{mode:n.detailDiffMode.value,changes:i.changes.value,gitInfo:i.gitInfo.value,fileDiff:i.fileDiff.value,fullTexts:i.fileDiffTexts.value,emptyFile:i.fileDiffEmptyFile.value,selectedDiffPath:i.selectedDiffPath.value,fileDiffLoading:i.fileDiffLoading.value,closable:!0,onOpen:r=>void n.selectDiffFile(r),onBack:()=>{n.detailDiffMode.value="list",n.detailDiffPath.value=null,i.clearFileDiff()},onClose:()=>{n.closeDiffDetail(),ah()}};case"turn-diff":return{change:e.payload.change,cwd:i.status.value.cwd,closable:!0,onClose:s,onOpenFile:l=>n.openFilePreview({path:l})};case"compaction":{const r=e.payload,l=n.compactionPanelTextOf(r.turnId);return l===null?null:{text:l,subtitle:t.t("conversation.summaryTitle"),onClose:s}}case"agent":{const r=e.payload;return{member:n.agentPanelMemberOf(r),turns:n.agentPanelTurnsOf(r),running:n.agentPanelRunningOf(r),loading:n.agentPanelLoadingOf(r),loadError:n.agentPanelLoadErrorOf(r),hasMore:n.agentPanelHasMoreOf(r),loadingMore:n.agentPanelLoadingMoreOf(r),loadMoreError:n.agentPanelLoadMoreErrorOf(r),onClose:s,onLoadOlderMessages:()=>n.loadOlderAgentMessages(r),onOpenMedia:t.onOpenMedia}}case"btw":{const r=e.payload;return{turns:i.sideChatTurnsOf(r.agentId),running:i.sideChatRunningOf(r.agentId),sending:i.sideChatSendingOf(r.agentId),agentId:r.agentId,title:e.title,onSend:l=>i.sendSideChatPromptOn(r.parentId,r.agentId,l),onClose:s,onOpenMedia:t.onOpenMedia}}default:return null}}const kht=["aria-label","aria-hidden","inert"],bht={class:"pt-body"},wht=lt({__name:"PanelTabs",props:{panel:{},client:{},filePreview:{},onOpenMedia:{type:Function},onOpenBtw:{type:Function}},setup(e,{expose:t}){const n=e,{t:i}=qt(),o=Ec(),s={panel:n.panel,client:n.client,filePreview:n.filePreview,onOpenMedia:n.onOpenMedia,t:(g,v)=>v===void 0?i(g):i(g,v)},r=D(()=>{if(!n.panel.panelVisible.value)return null;const g=n.panel.activeTab.value;if(!g)return null;const v=vht[g.type];if(!v)return null;const y=yht(g,s);if(!y)return null;const b=g.type==="turn-diff"&&g.payload!==void 0?`${g.id}:${g.payload.turnId}:${g.payload.change.path}`:g.id;return{tabId:g.id,key:b,component:v,props:y}});We(()=>[n.panel.activeTab.value,n.panel.panelVisible.value],([g,v])=>{v&&g?.type==="file"&&g.payload!==void 0?n.filePreview.openFilePreview(g.payload):n.filePreview.closeFilePreview()},{immediate:!0});async function l(g){const v=document.activeElement instanceof HTMLElement&&document.activeElement.closest(".pl")!==null;let y;g==="diff"?n.panel.openDiffDetail():y=n.onOpenBtw();let b=!1;const w=T=>{T instanceof KeyboardEvent&&T.repeat||(b=!0,n.panel.bumpInteractionVersion(),C())},C=()=>{document.removeEventListener("pointerdown",w,!0),document.removeEventListener("keydown",w,!0),window.removeEventListener("blur",w),document.removeEventListener("visibilitychange",w)};g!=="diff"&&(document.addEventListener("pointerdown",w,!0),document.addEventListener("keydown",w,!0),window.addEventListener("blur",w),document.addEventListener("visibilitychange",w));try{const T=await y;if(b||!v||g==="btw"&&T?.sessionId!=null&&T.sessionId!==n.client.activeSessionId.value||!n.panel.panelVisible.value||n.panel.activeTabId.value===null)return;if(await ht(),g==="btw"){u();return}document.querySelector(".ptb-tab.on .ptb-tab-main")?.focus()}finally{C()}}const a=V(null);function u(){a.value?.focusInput?.()}const c=V(null);t({focusSideChatInput:u,rootEl:c});const d=V(null),f=V(0);let h=null;We(d,(g,v)=>{h?.disconnect(),h=null,g!==null&&typeof ResizeObserver<"u"&&(h=new ResizeObserver(()=>{f.value=g.offsetHeight}),h.observe(g)),f.value=g?.offsetHeight??0}),Ln(()=>h?.disconnect());function m(g){c.value?.style.setProperty("--preview-w",`${g}px`)}return We([c,()=>n.panel.previewPanelWidth.value],([g,v])=>g?.style.setProperty("--preview-w",`${v}px`),{immediate:!0}),(g,v)=>(k(),L("aside",{ref_key:"rootEl",ref:c,class:Re(["global-preview",{open:e.panel.panelVisible.value,mobile:p(o),expanded:e.panel.panelExpanded.value}]),role:"complementary","aria-label":p(i)("layout.detailPanelAria"),"aria-hidden":!e.panel.panelVisible.value,inert:!e.panel.panelVisible.value},[e.panel.panelVisible.value&&!p(o)&&!e.panel.panelExpanded.value?(k(),de(p(uZ),{key:0,class:"panel-resize","storage-key":e.panel.PREVIEW_WIDTH_KEY,"default-width":e.panel.previewDefaultWidth.value,min:e.panel.PREVIEW_MIN,max:e.panel.previewMax.value,reverse:"","aria-label":p(i)("layout.resizePreviewAria"),"apply-live":m,"onUpdate:width":v[0]||(v[0]=y=>e.panel.previewWidth.value=y),"onUpdate:dragging":v[1]||(v[1]=y=>e.panel.panelDragging.value=y)},null,8,["storage-key","default-width","min","max","aria-label"])):ee("",!0),A("div",{class:"pt-shell",style:on({"--pfc-host-h":`${f.value}px`})},[U(hht,{tabs:e.panel.panelTabs.value,"active-tab-id":e.panel.activeTabId.value,expanded:e.panel.panelExpanded.value,visible:e.panel.panelVisible.value,"can-expand":!p(o),"can-open-diff":!!e.client.activeSessionId.value,"can-open-btw":!!(e.client.activeSessionId.value||e.client.activeWorkspaceId.value),onActivate:v[2]||(v[2]=y=>e.panel.activateTab(y)),onClose:v[3]||(v[3]=y=>e.panel.closeTab(y)),onAdd:l,onToggleExpanded:v[4]||(v[4]=y=>e.panel.toggleExpanded()),onHide:v[5]||(v[5]=y=>e.panel.hidePanel())},null,8,["tabs","active-tab-id","expanded","visible","can-expand","can-open-diff","can-open-btw"]),A("div",bht,[r.value?(k(),de(Po(r.value.component),ui({key:r.value.key,ref_key:"activePanelRef",ref:a},r.value.props),null,16)):ee("",!0),!r.value&&e.panel.panelTabs.value.length===0?(k(),de(ght,{key:1,"can-open-diff":!!e.client.activeSessionId.value,"can-open-btw":!!(e.client.activeSessionId.value||e.client.activeWorkspaceId.value),onOpen:l},null,8,["can-open-diff","can-open-btw"])):ee("",!0)]),A("div",{ref_key:"pfcHostEl",ref:d,class:"pfc-host"},null,512)],4)],10,kht))}}),Cht=xt(wht,[["__scopeId","data-v-46c316da"]]),Aht={class:"sa-head"},xht={class:"sa-title"},Sht={class:"sa-scroll"},_ht={class:"sa-page"},Mht={class:"sa-subtitle"},Iht={class:"sa-f-label"},Tht={class:"sa-f-label"},Eht={class:"sa-f-label"},Lht={class:"sa-f-actions"},Nht=lt({__name:"SessionAdminView",props:{batchRunning:{}},emits:["archiveSessions","restoreSessions"],setup(e,{emit:t}){const{t:n}=qt(),i=Ga(),o=t,s=D(()=>i.sessionAdminItems.value),r=D(()=>i.sessionAdminTotal.value),l=D(()=>i.sessionAdminLoading.value),a=D(()=>i.sessionAdminPage.value),u=D(()=>i.sessionAdminPageSize.value),c=D(()=>i.workspacesView.value.map(E=>({id:E.id,name:E.name}))),d={"3d":3,"7d":7,"30d":30};function f(E){if(E==="all")return"";const M=new Date;M.setDate(M.getDate()-d[E]);const R=q=>String(q).padStart(2,"0");return`${M.getFullYear()}-${R(M.getMonth()+1)}-${R(M.getDate())}`}function h(E){for(const M of["3d","7d","30d"])if(f(M)===E)return M;return"all"}const m=V([]),g=V("all"),v=V("all");function y(){const E=i.sessionAdminFilters.value;m.value=[...E.workspaceIds],g.value=E.status,v.value=E.updatedFrom===""?h(E.updatedTo):"all"}y(),We(()=>i.mainView.value,E=>{E==="sessionAdmin"&&y()});function b(){i.applySessionAdminFilters({workspaceIds:[...m.value],status:g.value,updatedFrom:"",updatedTo:f(v.value)})}function w(){m.value=[],g.value="all",v.value="all",i.applySessionAdminFilters({workspaceIds:[],status:"all",updatedFrom:"",updatedTo:""})}const C=V(null),T=V(null),N=V(null),I=D(()=>C.value?.open===!0||T.value?.open===!0||N.value?.open===!0);function S(){I.value||b()}const _=D(()=>[{value:"all",label:n("admin.statusAll")},{value:"open",label:n("admin.statusOpen"),dot:"open"},{value:"done",label:n("admin.statusDone"),dot:"done"}]),x=D(()=>[{value:"all",label:n("admin.timeAll")},{value:"3d",label:n("admin.timeDaysAgo",{n:3})},{value:"7d",label:n("admin.timeDaysAgo",{n:7})},{value:"30d",label:n("admin.timeDaysAgo",{n:30})}]);return(E,M)=>(k(),L("section",{class:Re(["con session-admin",{"macos-desktop":p(Cd)}])},[A("header",Aht,[U(p(Nn),{text:p(n)("admin.back")},{default:ce(()=>[U(p(ln),{class:"sa-back",size:"sm",label:p(n)("admin.back"),onClick:M[0]||(M[0]=R=>p(i).closeSessionAdmin())},{default:ce(()=>[U(p(Ce),{name:"chevron-left"})]),_:1},8,["label"])]),_:1},8,["text"]),A("h1",xht,F(p(n)("admin.title")),1)]),A("div",Sht,[A("div",_ht,[A("p",Mht,F(p(n)("admin.subtitle")),1),A("div",{class:"sa-filters",onKeydown:Qo(S,["enter"])},[A("span",Iht,F(p(n)("admin.filterWorkspace")),1),U(p(Gqe),{ref_key:"wsMenuRef",ref:C,modelValue:m.value,"onUpdate:modelValue":M[1]||(M[1]=R=>m.value=R),options:c.value,"aria-label":p(n)("admin.filterWorkspace")},null,8,["modelValue","options","aria-label"]),A("span",Tht,F(p(n)("admin.filterStatus")),1),U(p(VA),{ref_key:"statusSelectRef",ref:T,modelValue:g.value,"onUpdate:modelValue":M[2]||(M[2]=R=>g.value=R),options:_.value,"aria-label":p(n)("admin.filterStatus")},null,8,["modelValue","options","aria-label"]),A("span",Eht,F(p(n)("admin.filterTime")),1),U(p(VA),{ref_key:"timeSelectRef",ref:N,modelValue:v.value,"onUpdate:modelValue":M[3]||(M[3]=R=>v.value=R),options:x.value,"aria-label":p(n)("admin.filterTime")},null,8,["modelValue","options","aria-label"]),A("div",Lht,[U(p(sn),{variant:"primary",size:"sm",onClick:b},{default:ce(()=>[$e(F(p(n)("admin.query")),1)]),_:1}),U(p(sn),{variant:"ghost",size:"sm",onClick:w},{default:ce(()=>[$e(F(p(n)("admin.reset")),1)]),_:1})])],32),U(p(PUe),{items:s.value,total:r.value,loading:l.value,workspaces:p(i).workspacesView.value,"batch-running":e.batchRunning,onArchiveSessions:M[4]||(M[4]=R=>o("archiveSessions",R)),onRestoreSessions:M[5]||(M[5]=R=>o("restoreSessions",R))},null,8,["items","total","loading","workspaces","batch-running"]),U(p(aUe),{page:a.value,"page-size":u.value,total:r.value,"onUpdate:page":M[6]||(M[6]=R=>p(i).setSessionAdminPage(R)),"onUpdate:pageSize":M[7]||(M[7]=R=>p(i).setSessionAdminPageSize(R))},null,8,["page","page-size","total"])])])],2))}}),Dht=xt(Nht,[["__scopeId","data-v-fd687e8e"]]),Fht=["mask"],Bht=lt({__name:"BrandLogo",props:{size:{default:64}},setup(e){const t=`bl-eyes-${HQ()}`,n=V(null);let i;function o(){const s=n.value;s&&(s.classList.remove("blink-now"),s.getBoundingClientRect(),s.classList.add("blink-now"),clearTimeout(i),i=setTimeout(()=>s.classList.remove("blink-now"),300))}return ti(()=>clearTimeout(i)),(s,r)=>(k(),L("svg",{ref_key:"logoRef",ref:n,class:"brand-logo",style:on({width:`${e.size}px`,height:`${e.size*22/32}px`}),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:o},[A("defs",null,[A("mask",{id:t,maskUnits:"userSpaceOnUse"},[...r[0]||(r[0]=[A("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"},null,-1),A("g",{class:"ch-eyes",fill:"#000"},[A("rect",{class:"ch-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),A("rect",{class:"ch-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})],-1)])])]),A("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--logo)",mask:`url(#${t})`},null,8,Fht)],4))}}),z1=xt(Bht,[["__scopeId","data-v-0904de71"]]),Rht={key:0,class:"nb-cards"},$ht={key:1,class:"center-body"},Oht={class:"center-text"},Pht={key:2,class:"nb"},zht={class:"nb-hero"},jht={class:"nb-hero-icon"},Hht={key:0,class:"nb-hero-title"},Wht={class:"nb-hero-hint"},qht={class:"nb-manual"},Uht={class:"nb-manual-label"},Vht={key:3,class:"center-body"},Kht={class:"center-text success-text"},Zht={class:"center-hint"},Ght={class:"center-body"},Qht={class:"center-text err-text"},Yht={class:"center-hint"},Jht={class:"actions"},Xht={class:"center-body"},ept={class:"center-text err-text"},tpt={class:"center-hint"},npt={class:"actions"},ipt={class:"center-body"},opt={class:"center-text warn-text"},spt={class:"center-hint"},rpt={class:"actions"},lpt=lt({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function},onGetOAuthRegion:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=qt(),i=V(!0),o=t,s=e,{step:r,pollError:l,flow:a,secondsLeft:u,autoOpenBlocked:c,startFlow:d,cancelFlow:f}=sK({onStartOAuthLogin:s.onStartOAuthLogin,onPollOAuthLogin:s.onPollOAuthLogin,onCancelOAuthLogin:s.onCancelOAuthLogin,onSuccess:()=>{o("success"),o("close")},autoOpen:bZ(),authWake:wZ()}),h=V(!1),m=V("choice"),g=[{region:"mainland-cn",titleKey:"login.regionCnTitle",hintKey:"login.regionCnHint"},{region:"global",titleKey:"login.regionOverseasTitle",hintKey:"login.regionOverseasHint"}],v={titleKey:"login.oauthTitle",hintKey:"login.oauthHint"},y=V("pending"),b=D(()=>ZO(y.value,g,v)),w=D(()=>a.value?.verificationUriComplete??"");yn(()=>{s.onGetOAuthRegion?.().then(_=>{y.value=_===null?"unsupported":"supported"})});function C(_){m.value="flow",d(_)}async function T(){!a.value||!await Es(w.value)||(h.value=!0,setTimeout(()=>{h.value=!1},2e3))}function N(){gS(w.value)&&window.open(w.value,"_blank","noopener,noreferrer")}async function I(){f(),o("close")}function S(_){const x=Math.floor(_/60),E=_%60;return`${x}:${String(E).padStart(2,"0")}`}return(_,x)=>(k(),de(p(ef),{open:i.value,"onUpdate:open":x[3]||(x[3]=E=>i.value=E),size:m.value==="choice"?"md":"sm",title:p(n)("login.title"),"close-on-overlay":!1,onClose:I},{default:ce(()=>[m.value==="choice"?(k(),L("div",Rht,[(k(!0),L(De,null,Ct(b.value,E=>(k(),de(p(rw),{key:E.region??"oauth",disabled:E.disabled,onSelect:M=>C(E.region)},{leading:ce(()=>[U(z1,{size:40})]),hint:ce(()=>[$e(F(p(n)(E.hintKey)),1)]),default:ce(()=>[$e(" "+F(p(n)(E.titleKey))+" ",1)]),_:2},1032,["disabled","onSelect"]))),128))])):p(r)==="starting"?(k(),L("div",$ht,[U(p(mo),{size:"md"}),A("span",Oht,F(p(n)("login.starting")),1)])):p(r)==="device-code"&&p(a)?(k(),L("div",Pht,[A("div",zht,[A("span",jht,[U(z1,{size:48})]),p(c)?(k(),L("div",Hht,F(p(n)("login.blockedTitle")),1)):ee("",!0),A("div",Wht,F(p(c)?p(n)("login.blockedHint"):p(n)("login.openedHint",{time:S(p(u))})),1)]),p(c)?(k(),de(p(sn),{key:0,variant:"primary",onClick:N},{default:ce(()=>[$e(F(p(n)("login.authorizeInBrowser"))+" ",1),U(p(Ce),{name:"external-link",size:"sm"})]),_:1})):ee("",!0),A("div",qht,[A("span",Uht,[$e(F(p(n)("login.notOpened"))+" ",1),U(p(sn),{variant:"text",class:Re(["nb-copy-text",{"is-copied":h.value}]),onClick:T},{default:ce(()=>[$e(F(h.value?p(n)("login.copied"):p(n)("login.copyLink")),1)]),_:1},8,["class"])])])])):p(r)==="success"?(k(),L("div",Vht,[U(p(md),{kind:"success"}),A("span",Kht,F(p(n)("login.success")),1),A("span",Zht,F(p(n)("login.successHint")),1)])):p(r)==="denied"?(k(),L(De,{key:4},[A("div",Ght,[U(p(md),{kind:"expired"}),A("span",Qht,F(p(n)("login.deniedTitle")),1),A("span",Yht,F(p(n)("login.expiredHint")),1)]),A("div",Jht,[U(p(sn),{variant:"primary",onClick:x[0]||(x[0]=E=>p(d)())},{default:ce(()=>[$e(F(p(n)("login.retry")),1)]),_:1}),U(p(sn),{variant:"secondary",onClick:I},{default:ce(()=>[$e(F(p(n)("login.closeBtn")),1)]),_:1})])],64)):p(r)==="expired"?(k(),L(De,{key:5},[A("div",Xht,[U(p(md),{kind:"expired"}),A("span",ept,F(p(n)("login.expiredTitle")),1),A("span",tpt,F(p(n)("login.expiredHint")),1)]),A("div",npt,[U(p(sn),{variant:"primary",onClick:x[1]||(x[1]=E=>p(d)())},{default:ce(()=>[$e(F(p(n)("login.retry")),1)]),_:1}),U(p(sn),{variant:"secondary",onClick:I},{default:ce(()=>[$e(F(p(n)("login.closeBtn")),1)]),_:1})])],64)):p(r)==="error"?(k(),L(De,{key:6},[A("div",ipt,[U(p(md),{kind:"error"}),A("span",opt,F(p(l)?p(n)("login.pollErrorTitle"):p(n)("login.errorTitle")),1),A("span",spt,F(p(l)?p(n)("login.pollErrorHint"):p(n)("login.errorHint")),1)]),A("div",rpt,[U(p(sn),{variant:"primary",onClick:x[2]||(x[2]=E=>p(d)())},{default:ce(()=>[$e(F(p(n)("login.retry")),1)]),_:1}),U(p(sn),{variant:"secondary",onClick:I},{default:ce(()=>[$e(F(p(n)("login.closeBtn")),1)]),_:1})])],64)):ee("",!0)]),_:1},8,["open","size","title"]))}}),apt=xt(lpt,[["__scopeId","data-v-d880fe1a"]]),KZ=lt({__name:"LanguageSwitcher",props:{size:{default:"md"}},setup(e){const{locale:t}=qt(),n=K4.map(o=>({value:o.code,label:o.label}));function i(o){t.value!==o&&bS(o)}return(o,s)=>(k(),de(p(Ms),{"model-value":p(t),options:p(n),size:e.size,"onUpdate:modelValue":i},null,8,["model-value","options","size"]))}}),upt={class:"sec"},cpt={class:"sec-title"},dpt={class:"pu-group"},fpt={key:0,class:"pu-row pu-state"},hpt={key:1,class:"pu-row pu-state"},ppt={class:"pu-error-text"},mpt={key:2,class:"pu-row pu-state pu-empty"},gpt={class:"pu-main"},vpt={class:"pu-label"},ypt={key:0,class:"pu-hint"},kpt={class:"pu-value"},bpt=["aria-valuenow","aria-valuemax"],wpt={key:0,class:"sec"},Cpt={class:"sec-title"},Apt={class:"pu-group"},xpt={class:"pu-row"},Spt={class:"pu-main"},_pt={class:"pu-label"},Mpt={class:"pu-value"},Ipt={key:0,class:"pu-value-sub"},Tpt={key:0,class:"pu-meter"},Ept={class:"pu-row"},Lpt={class:"pu-main"},Npt={class:"pu-label"},Dpt={class:"pu-value"},Fpt={class:"pu-row"},Bpt={class:"pu-main"},Rpt={class:"pu-label"},$pt={class:"pu-value"},Opt=lt({__name:"PlanUsageCard",props:{onFetchUsage:{type:Function}},setup(e){const t=e,{t:n}=qt(),i=V(!0),o=V(null);async function s(){i.value=!0;try{o.value=await t.onFetchUsage()}finally{i.value=!1}}yn(s);const r=D(()=>o.value?.kind==="ok"?o.value:null),l=D(()=>r.value?.extraUsage??null),a=D(()=>{const g=r.value;return g===null?[]:g.summary===null?g.limits:[g.summary,...g.limits]}),u=D(()=>a.value.length>0),c=D(()=>o.value?.kind==="error"?o.value.message:n("settings.planUsage.loadFailed")),d=D(()=>o.value?.kind==="error"&&(o.value.status===402||o.value.status===403)),f=D(()=>l.value!==null&&l.value.monthlyChargeLimitEnabled&&l.value.monthlyChargeLimitCents>0);function h(g,v){const y=wse(g,v);return`${y.symbol}${y.number}`}function m(g){return g.resetAt===void 0?"":eP(g.resetAt,n)}return(g,v)=>d.value?(k(),de(p(SZ),{key:0})):(k(),L(De,{key:1},[A("section",upt,[A("h3",cpt,F(p(n)("settings.planUsage.title")),1),A("div",dpt,[i.value?(k(),L("div",fpt,[U(p(mo),{size:"sm"})])):r.value===null?(k(),L("div",hpt,[A("span",ppt,F(c.value),1),U(p(sn),{variant:"ghost",size:"sm",onClick:s},{default:ce(()=>[$e(F(p(n)("settings.planUsage.retry")),1)]),_:1})])):u.value?(k(!0),L(De,{key:3},Ct(a.value,(y,b)=>(k(),L("div",{key:b,class:"pu-row"},[A("span",gpt,[A("span",vpt,F(p(XO)(y,p(n))),1),m(y)?(k(),L("span",ypt,F(m(y)),1)):ee("",!0)]),A("span",kpt,F(p(n)("settings.planUsage.usedPct",{pct:p(_y)(y.used,y.limit)})),1),A("span",{class:"pu-meter",role:"progressbar","aria-valuenow":y.used,"aria-valuemax":y.limit},[A("i",{class:Re(`sev-${p(Tw)(y.used,y.limit)}`),style:on({width:`${p(_y)(y.used,y.limit)}%`})},null,6)],8,bpt)]))),128)):(k(),L("div",mpt,F(p(n)("settings.planUsage.empty")),1))])]),l.value!==null?(k(),L("section",wpt,[A("h3",Cpt,F(p(n)("settings.planUsage.boosterTitle")),1),A("div",Apt,[A("div",xpt,[A("span",Spt,[A("span",_pt,F(p(n)("settings.planUsage.monthlyUsed")),1)]),A("span",Mpt,[$e(F(h(l.value.monthlyUsedCents,l.value.currency)),1),f.value?(k(),L("span",Ipt," / "+F(h(l.value.monthlyChargeLimitCents,l.value.currency)),1)):ee("",!0)]),f.value?(k(),L("span",Tpt,[A("i",{class:Re(`sev-${p(Tw)(l.value.monthlyUsedCents,l.value.monthlyChargeLimitCents)}`),style:on({width:`${p(_y)(l.value.monthlyUsedCents,l.value.monthlyChargeLimitCents)}%`})},null,6)])):ee("",!0)]),A("div",Ept,[A("span",Lpt,[A("span",Npt,F(p(n)("settings.planUsage.monthlyLimit")),1)]),A("span",Dpt,[f.value?(k(),L(De,{key:0},[$e(F(h(l.value.monthlyChargeLimitCents,l.value.currency)),1)],64)):(k(),L(De,{key:1},[$e(F(p(n)("settings.planUsage.unlimited")),1)],64))])]),A("div",Fpt,[A("span",Bpt,[A("span",Rpt,F(p(n)("settings.planUsage.boosterBalance")),1)]),A("span",$pt,F(h(l.value.balanceCents,l.value.currency)),1)])])])):ee("",!0)],64))}}),ZZ=xt(Opt,[["__scopeId","data-v-b460ecbf"]]),Ppt=["aria-label"],zpt={class:"settings-tabs-header"},jpt={class:"settings-dialog-title"},Hpt={class:"settings-tab-list"},Wpt=["aria-selected","onClick"],qpt={class:"settings-region"},Upt={class:"settings-region-header"},Vpt={class:"panel"},Kpt={class:"sec"},Zpt={class:"sec-title"},Gpt={class:"settings-group"},Qpt={class:"row"},Ypt={class:"rlabel"},Jpt={class:"hint"},Xpt={class:"row language-row"},e1t={class:"rlabel"},t1t={class:"hint"},n1t={class:"row font-size-row"},i1t={class:"rlabel"},o1t={class:"hint"},s1t={class:"sec notification-settings"},r1t={class:"sec-title"},l1t={class:"settings-group"},a1t={class:"row"},u1t={class:"rlabel"},c1t={class:"hint"},d1t={key:0,class:"hint"},f1t={class:"row"},h1t={class:"rlabel"},p1t={class:"hint"},m1t={class:"panel"},g1t={class:"sec"},v1t={class:"sec-title"},y1t={class:"settings-group"},k1t={class:"account-row"},b1t={class:"account-avatar","aria-hidden":"true"},w1t=["src"],C1t={class:"account-meta"},A1t={class:"account-name-row"},x1t={class:"account-name"},S1t={class:"account-sub"},_1t={key:0,class:"panel"},M1t={class:"panel"},I1t={class:"sec"},T1t={class:"sec-head"},E1t={class:"sec-title"},L1t={class:"settings-group"},N1t={class:"row"},D1t={class:"rlabel"},F1t={class:"hint"},B1t={key:0,class:"select-wrap"},R1t={key:1,class:"rvalue mono"},$1t={class:"row"},O1t={class:"rlabel"},P1t={class:"hint"},z1t={class:"row"},j1t={class:"rlabel"},H1t={class:"hint"},W1t={key:0,class:"rvalue mono"},q1t={key:1,class:"rvalue mono"},U1t={key:3,class:"rvalue mono"},V1t={class:"row"},K1t={class:"rlabel"},Z1t={class:"hint"},G1t={key:1,class:"empty-config"},Q1t={key:0,class:"sec"},Y1t={class:"sec-head"},J1t={class:"sec-title"},X1t={class:"settings-group"},emt={class:"row"},tmt={class:"rlabel"},nmt={class:"hint"},imt={key:0,class:"select-wrap"},omt={key:1,class:"rvalue mono"},smt={class:"panel"},rmt={class:"sec"},lmt={class:"sec-title"},amt={class:"settings-group"},umt={class:"row"},cmt={class:"rlabel"},dmt={class:"hint"},fmt={class:"rvalue"},hmt={class:"row"},pmt={class:"rlabel"},mmt={class:"hint"},gmt={class:"rvalue-wrap"},vmt={class:"rvalue"},ymt={class:"row"},kmt={class:"rlabel"},bmt={class:"hint"},wmt={class:"rvalue-wrap"},Cmt={class:"rvalue"},Amt={key:0,class:"row"},xmt={class:"rlabel"},Smt={key:0,class:"hint"},_mt={key:1,class:"hint"},Mmt={key:1,class:"row"},Imt={class:"rlabel"},Tmt={class:"hint"},Emt={key:0,class:"sec"},Lmt={class:"sec-title"},Nmt={class:"settings-group"},Dmt={class:"row"},Fmt={class:"rlabel"},Bmt={class:"hint"},Rmt={class:"hint"},$mt={class:"sec"},Omt={class:"sec-title"},Pmt={class:"settings-group"},zmt={class:"row"},jmt={class:"rlabel"},Hmt={class:"hint"},Wmt={key:0,class:"hint"},qmt={class:"sec"},Umt={class:"sec-title"},Vmt={class:"settings-group"},Kmt={class:"row"},Zmt={class:"rlabel"},Gmt={class:"hint"},Qmt={class:"row"},Ymt={class:"rlabel"},Jmt={class:"hint"},Xmt={class:"panel"},egt={class:"sec"},tgt={class:"sec-title"},ngt={class:"settings-group"},igt={class:"row"},ogt={class:"rlabel"},sgt={class:"hint"},rgt={class:"panel"},lgt={class:"panel-head"},agt={class:"panel-title"},ugt={class:"panel-desc"},cgt={class:"archive-toolbar"},dgt={class:"archive-search"},fgt=["placeholder"],hgt={key:0,class:"archive-empty"},pgt={key:0,class:"archive-list"},mgt={class:"archive-workspace"},ggt={class:"path"},vgt={class:"count"},ygt={class:"setting-card"},kgt={class:"archive-meta"},bgt={class:"archive-name"},wgt={class:"archive-time"},Cgt={key:1,class:"archive-empty"},Agt=100,xgt=lt({__name:"SettingsDialog",props:{colorScheme:{},fontScale:{},initialTab:{},managedProviderStatus:{},managedUserInfo:{},onFetchUsage:{type:Function},notify:{type:Boolean},notifyPermission:{},notifySound:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},experimentalFlags:{}},emits:["setColorScheme","setFontScale","setNotify","setNotifySound","login","logout","updateConfig","close"],setup(e,{emit:t}){const{t:n}=qt(),{sidebarTabs:i,setSidebarTabs:o}=em(),{turnFolding:s,setTurnFolding:r}=Vx(),{activityRunFolding:l,setActivityRunFolding:a}=Kx();function u(it){o(it)}const c=e,d=t,f=D(()=>c.managedProviderStatus==="authenticated"),h=D(()=>f.value?c.managedUserInfo?.nickname||n("sidebar.defaultUserName"):n("sidebar.notSignedIn")),m=D(()=>c.managedUserInfo?.userLevelName?.trim()??""),g=V(!1);We(()=>c.managedUserInfo?.avatar,()=>{g.value=!1});const v=D(()=>!!c.managedUserInfo?.avatar&&!g.value),y=D(()=>f.value?n("settings.signedIn"):n("settings.signedOutHint")),b=V(c.initialTab??"general"),w=V(!1);let C=null;function T(){w.value=!0,C&&clearTimeout(C),C=setTimeout(()=>{w.value=!1,C=null},900)}const N=[{id:"general",labelKey:"settings.tabs.general",icon:"sliders"},{id:"agent",labelKey:"settings.tabs.agent",icon:"robot"},{id:"account",labelKey:"settings.tabs.account",icon:"user"},{id:"providers",labelKey:"settings.tabs.providers",icon:"bolt"},{id:"advanced",labelKey:"settings.tabs.advanced",icon:"microscope"},{id:"lab",labelKey:"settings.tabs.lab",icon:"flask"},{id:"archived",labelKey:"settings.tabs.archived",icon:"archive"}],I=sct(),S=V(!1),_=V(!1);function x(){c.serverVersion&&Es(c.serverVersion).then(it=>{it&&(S.value=!0,setTimeout(()=>{S.value=!1},1500))})}function E(){Es(I).then(it=>{it&&(_.value=!0,setTimeout(()=>{_.value=!1},1500))})}const M=["manual","yolo","auto"],R={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},q=V(null);BZ(q);const{isConfirmOpen:z}=cf();function O(it){it.key==="Escape"&&!it.defaultPrevented&&!z.value&&d("close")}yn(()=>document.addEventListener("keydown",O)),Ln(()=>{document.removeEventListener("keydown",O),C&&clearTimeout(C)});function B(){qZ()}const P=(()=>{const it="0.38.0".trim()?"0.38.0":"";let dt="";if("2026-08-27T10:58:28.718Z".trim()){const dn=new Date("2026-08-27T10:58:28.718Z");if(!Number.isNaN(dn.getTime())){const Gt=ri=>String(ri).padStart(2,"0");dt=`${dn.getFullYear()}-${Gt(dn.getMonth()+1)}-${Gt(dn.getDate())} ${Gt(dn.getHours())}:${Gt(dn.getMinutes())}`}}const wt=dt===""?it:`${it} · ${dt}`;return wt===""?"-":wt})(),H=VPe(),j=V(!1),Z=V(null);async function ie(){if(!j.value){j.value=!0,Z.value=null;try{Z.value=await H.check()}finally{j.value=!1}}}const W=D(()=>{const it=Z.value;if(it===null)return"";switch(it.outcome){case"available":return H.status.value.state==="downloaded"?n("settings.updateCheckDownloaded",{version:it.version??""}):H.autoDownload.value?n("settings.updateCheckAvailableAuto",{version:it.version??""}):n("settings.updateCheckAvailable",{version:it.version??""});case"latest":return n("settings.updateCheckLatest");case"unsupported":return n("settings.updateCheckUnsupported");case"error":return n("settings.updateCheckFailed")}}),Q=D(()=>{const it=new Map;for(const dt of c.models??[])it.set(dt.id,{id:dt.id,label:dt.displayName??dt.model??dt.id,provider:dt.provider});for(const[dt,wt]of Object.entries(c.config?.models??{})){if(it.has(dt))continue;const dn=ue(wt);it.set(dt,{id:dt,label:se(dt,wt,dn),provider:dn??dt})}return Array.from(it.values())}),te=D(()=>{const it=new Map;for(const dt of Q.value){const wt=it.get(dt.provider)??[];wt.push(dt),it.set(dt.provider,wt)}for(const dt of it.values())dt.sort((wt,dn)=>wt.label.localeCompare(dn.label));return Array.from(it.entries()).toSorted(([dt],[wt])=>dt.localeCompare(wt)).map(([dt,wt])=>({provider:dt,options:wt}))}),X=D(()=>{const it=te.value.flatMap(dt=>dt.options.map(wt=>({value:wt.id,label:wt.label,group:dt.provider})));return c.config?.defaultModel||it.unshift({value:"",label:n("settings.noDefaultModel"),group:"",disabled:!0}),it}),ge=D(()=>{const it=c.config?.defaultPermissionMode;return it==="auto"||it==="yolo"||it==="manual"?it:"manual"});function ue(it){if(!it||typeof it!="object")return;const dt=it;return typeof dt.provider=="string"?dt.provider:void 0}function se(it,dt,wt){if(!dt||typeof dt!="object")return it;const dn=dt,Gt=typeof dn.model=="string"?dn.model:void 0,ri=wt??ue(dt);return Gt&&ri?`${it} (${ri}/${Gt})`:Gt?`${it} (${Gt})`:it}function fe(it){return it===!0}function G(it){!it||it===c.config?.defaultModel||d("updateConfig",{defaultModel:it})}function ae(it){it!==ge.value&&d("updateConfig",{defaultPermissionMode:it})}const K=D(()=>(c.experimentalFlags?.["secondary-model"]??c.config?.experimental?.["secondary-model"])===!0),re=D(()=>c.config?.secondaryModel?.model??""),be=D(()=>c.config?.secondaryModel?.defaultEffort??""),ke=D(()=>Object.fromEntries((c.models??[]).map(it=>[it.id,it])));function we(it){it.model===re.value&&(it.effort??"")===be.value||d("updateConfig",{secondaryModel:it.effort?{model:it.model,defaultEffort:it.effort}:{model:it.model}})}function oe(it){const dt=c.config?.[it];d("updateConfig",{[it]:!fe(dt)})}const le=D(()=>c.config?.defaultModel?ke.value[c.config.defaultModel]:void 0),ye=D(()=>K1(le.value)),Ae=D(()=>Z1(le.value));function _e(){return I6(c.config?.thinking,le.value)??fh(le.value)}const pe=D(()=>{const it=Ae.value,dt=_e();return it.includes(dt)?dt:""}),ne=D(()=>Ae.value.map(it=>({value:it,label:Bd(it)})));function Ee(it){const dt=wk(le.value,it);d("updateConfig",{thinking:Ioe(dt,le.value?.supportEfforts)})}function qe(){const it=c.config?.telemetry!==!1;d("updateConfig",{telemetry:!it})}function ze(it){b.value=it}const ft=Ga(),gt=D(()=>f.value&&ft.managedMembership.value==="free"),_t=V([]),Pt=V(!1),Ht=V(!1),jt=V(""),Te=V("all"),Fe=V("archived-desc");async function Ke(){if(!(Pt.value||Ht.value)){Pt.value=!0;try{const it=[];let dt;for(;;){const wt=await ft.loadArchivedSessions({beforeId:dt,pageSize:Agt});if(it.push(...wt.items),!wt.hasMore||wt.items.length===0)break;const dn=wt.items.at(-1)?.id;if(dn===void 0)break;dt=dn}_t.value=it,Ht.value=!0}catch(it){ja("loadAllArchived failed",it)}finally{Pt.value=!1}}}We(b,it=>{it==="archived"&&!Ht.value&&Ke()},{immediate:!0});const rt=D(()=>{const it=new Set;for(const dt of _t.value)it.add(dt.cwd);return Array.from(it).sort((dt,wt)=>dt.localeCompare(wt))}),Nt=D(()=>[{value:"all",label:n("settings.archivedAllWorkspaces")},...rt.value.map(it=>({value:it,label:it}))]),Lt=D(()=>{const it=jt.value.trim().toLowerCase();let dt=_t.value.filter(wt=>wt.archived===!0);return Te.value!=="all"&&(dt=dt.filter(wt=>wt.cwd===Te.value)),it&&(dt=dt.filter(wt=>wt.title.toLowerCase().includes(it))),dt=dt.slice(),Fe.value==="archived-desc"?dt.sort((wt,dn)=>(dn.archivedAt??dn.updatedAt).localeCompare(wt.archivedAt??wt.updatedAt)):Fe.value==="created-desc"?dt.sort((wt,dn)=>dn.createdAt.localeCompare(wt.createdAt)):dt.sort((wt,dn)=>wt.title.localeCompare(dn.title,"zh")),dt}),Qt=D(()=>{const it=new Map;for(const dt of Lt.value){const wt=it.get(dt.cwd)??[];wt.push(dt),it.set(dt.cwd,wt)}return Array.from(it.entries()).map(([dt,wt])=>({cwd:dt,items:wt}))});async function Ut(it){await ft.restoreSession(it)&&(_t.value=_t.value.filter(wt=>wt.id!==it))}function en(it){const dt=new Date(it);if(Number.isNaN(dt.getTime()))return it;const wt=dn=>String(dn).padStart(2,"0");return`${dt.getFullYear()}-${wt(dt.getMonth()+1)}-${wt(dt.getDate())} ${wt(dt.getHours())}:${wt(dt.getMinutes())}`}return(it,dt)=>(k(),de(p(ef),{open:!0,"close-on-esc":!1,"aria-label":p(n)("settings.title"),size:"xl",height:"fixed",padded:!1,level:"grouped",onClose:dt[15]||(dt[15]=wt=>d("close"))},{default:ce(()=>[A("div",{ref_key:"dialogRef",ref:q,class:"sd"},[A("nav",{class:"settings-tabs",role:"tablist","aria-label":p(n)("settings.title")},[A("header",zpt,[A("h2",jpt,F(p(n)("settings.title")),1)]),A("div",Hpt,[(k(),L(De,null,Ct(N,wt=>A("button",{key:wt.id,type:"button",class:Re(["tab",{on:b.value===wt.id}]),role:"tab","aria-selected":b.value===wt.id,onClick:dn=>ze(wt.id)},[U(p(Ce),{name:wt.icon,size:"md"},null,8,["name"]),A("span",null,F(p(n)(wt.labelKey)),1)],10,Wpt)),64))])],8,Ppt),A("section",qpt,[A("header",Upt,[U(p(ln),{size:"sm",label:p(n)("settings.close"),tooltip:p(n)("settings.close"),onClick:dt[0]||(dt[0]=wt=>d("close"))},{default:ce(()=>[U(p(Ce),{name:"close",size:"md"})]),_:1},8,["label","tooltip"])]),A("div",{class:Re(["body",{scrolling:w.value}]),onScroll:T},[ai(A("section",Vpt,[A("section",Kpt,[A("h3",Zpt,F(p(n)("settings.appearance")),1),A("div",Gpt,[A("div",Qpt,[A("span",Ypt,[$e(F(p(n)("theme.colorSchemeLabel"))+" ",1),A("span",Jpt,F(p(n)("settings.colorSchemeHint")),1)]),U(p(Ms),{"model-value":e.colorScheme,options:[{value:"light",label:p(n)("theme.light"),icon:"light-mode"},{value:"dark",label:p(n)("theme.dark"),icon:"dark-mode"},{value:"system",label:p(n)("theme.system")}],"onUpdate:modelValue":dt[1]||(dt[1]=wt=>d("setColorScheme",wt))},null,8,["model-value","options"])]),A("div",Xpt,[A("span",e1t,[$e(F(p(n)("sidebar.language"))+" ",1),A("span",t1t,F(p(n)("settings.languageHint")),1)]),U(KZ)]),A("div",n1t,[A("span",i1t,[$e(F(p(n)("settings.uiFontSize"))+" ",1),A("span",o1t,F(p(n)("settings.uiFontSizeHint")),1)]),U(p(Ms),{"model-value":e.fontScale,options:[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],"aria-label":p(n)("settings.uiFontSize"),"onUpdate:modelValue":dt[2]||(dt[2]=wt=>d("setFontScale",wt))},null,8,["model-value","aria-label"])])])]),A("section",s1t,[A("h3",r1t,F(p(n)("settings.notifications")),1),A("div",l1t,[A("div",a1t,[A("span",u1t,[$e(F(p(n)("settings.notifyEnabled"))+" ",1),A("span",c1t,F(p(n)("settings.notifyEnabledHint")),1),e.notifyPermission==="denied"?(k(),L("span",d1t,F(p(n)("settings.notifyDenied")),1)):ee("",!0)]),U(p(jc),{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:p(n)("settings.notifyEnabled"),"onUpdate:modelValue":dt[3]||(dt[3]=wt=>d("setNotify",wt))},null,8,["model-value","disabled","label"])]),A("div",f1t,[A("span",h1t,[$e(F(p(n)("settings.notifySound"))+" ",1),A("span",p1t,F(p(n)("settings.notifySoundHint")),1)]),U(p(jc),{"model-value":e.notifySound,label:p(n)("settings.notifySound"),"onUpdate:modelValue":dt[4]||(dt[4]=wt=>d("setNotifySound",wt))},null,8,["model-value","label"])])])])],512),[[Go,b.value==="general"]]),ai(A("section",m1t,[A("section",g1t,[A("h3",v1t,F(p(n)("settings.account")),1),A("div",y1t,[A("div",k1t,[A("span",b1t,[v.value?(k(),L("img",{key:0,src:c.managedUserInfo?.avatar,alt:"",onError:dt[5]||(dt[5]=wt=>g.value=!0)},null,40,w1t)):(k(),de(p(Ce),{key:1,name:"user",size:"md"}))]),A("span",C1t,[A("span",A1t,[A("span",x1t,F(h.value),1),m.value?(k(),de(p(ul),{key:0,class:"account-level",variant:"neutral",size:"sm"},{default:ce(()=>[$e(F(m.value),1)]),_:1})):ee("",!0)]),A("span",S1t,F(y.value),1)]),f.value?(k(),de(p(sn),{key:0,variant:"danger-soft",size:"sm",onClick:dt[6]||(dt[6]=wt=>d("logout"))},{default:ce(()=>[$e(F(p(n)("sidebar.signOut")),1)]),_:1})):(k(),de(p(sn),{key:1,variant:"primary",size:"sm",onClick:dt[7]||(dt[7]=wt=>d("login"))},{default:ce(()=>[$e(F(p(n)("sidebar.signIn")),1)]),_:1}))])])]),gt.value?(k(),de(p(SZ),{key:0})):f.value?(k(),de(ZZ,{key:1,"on-fetch-usage":c.onFetchUsage},null,8,["on-fetch-usage"])):ee("",!0)],512),[[Go,b.value==="account"]]),b.value==="providers"?(k(),L("section",_1t,[U(p(Yot))])):ee("",!0),ai(A("section",M1t,[A("section",I1t,[A("div",T1t,[A("h3",E1t,F(p(n)("settings.agentDefaults")),1)]),A("div",L1t,[e.config?(k(),L(De,{key:0},[A("div",N1t,[A("span",D1t,[$e(F(p(n)("settings.defaultModel"))+" ",1),A("span",F1t,F(p(n)("settings.defaultModelHint")),1)]),te.value.length>0?(k(),L("div",B1t,[U(p(Cw),{"model-value":e.config.defaultModel??"",options:X.value,"aria-label":p(n)("settings.defaultModel"),"onUpdate:modelValue":G},null,8,["model-value","options","aria-label"])])):(k(),L("span",R1t,F(e.config.defaultModel??p(n)("settings.noDefaultModel")),1))]),A("div",$1t,[A("span",O1t,[$e(F(p(n)("settings.defaultPermission"))+" ",1),A("span",P1t,F(p(n)("settings.defaultPermissionHint")),1)]),U(p(Ms),{"model-value":ge.value,options:M.map(wt=>({value:wt,label:p(n)(R[wt])})),"onUpdate:modelValue":dt[8]||(dt[8]=wt=>ae(wt))},null,8,["model-value","options"])]),A("div",z1t,[A("span",j1t,[$e(F(p(n)("settings.defaultThinking"))+" ",1),A("span",H1t,F(p(n)("settings.defaultThinkingHint")),1)]),e.config.defaultModel?ye.value==="unsupported"?(k(),L("span",q1t,F(p(n)("status.modeNotSupported")),1)):Ae.value.length>1?(k(),de(p(Ms),{key:2,"model-value":pe.value,options:ne.value,"aria-label":p(n)("settings.defaultThinking"),"onUpdate:modelValue":Ee},null,8,["model-value","options","aria-label"])):(k(),L("span",U1t,F(p(Bd)(Ae.value[0]??"on")),1)):(k(),L("span",W1t,F(p(n)("settings.noDefaultModel")),1))]),A("div",V1t,[A("span",K1t,[$e(F(p(n)("settings.defaultPlanMode"))+" ",1),A("span",Z1t,F(p(n)("settings.defaultPlanModeHint")),1)]),U(p(jc),{"model-value":fe(e.config.defaultPlanMode),label:p(n)("settings.defaultPlanMode"),"onUpdate:modelValue":dt[9]||(dt[9]=wt=>oe("defaultPlanMode"))},null,8,["model-value","label"])])],64)):(k(),L("div",G1t,F(p(n)("settings.configUnavailable")),1))])]),e.config&&K.value?(k(),L("section",Q1t,[A("div",Y1t,[A("h3",J1t,F(p(n)("settings.secondaryModelSection")),1)]),A("div",X1t,[A("div",emt,[A("span",tmt,[$e(F(p(n)("settings.secondaryModel"))+" ",1),A("span",nmt,F(p(n)("settings.secondaryModelHint")),1)]),te.value.length>0?(k(),L("div",imt,[U(p(fst),{"model-value":re.value,effort:be.value,groups:te.value,"model-info-by-id":ke.value,onSelect:we},null,8,["model-value","effort","groups","model-info-by-id"])])):(k(),L("span",omt,F(re.value||p(n)("settings.noSecondaryModel")),1))])])])):ee("",!0)],512),[[Go,b.value==="agent"]]),ai(A("section",smt,[A("section",rmt,[A("h3",lmt,F(p(n)("settings.versionAndUpdates")),1),A("div",amt,[A("div",umt,[A("span",cmt,[$e(F(p(n)("settings.appVersion"))+" ",1),A("span",dmt,F(p(n)("settings.appVersionHint")),1)]),A("span",fmt,F(p(P)),1)]),A("div",hmt,[A("span",pmt,[$e(F(p(n)("settings.serverVersion"))+" ",1),A("span",mmt,F(p(n)("settings.serverVersionHint")),1)]),A("span",gmt,[A("span",vmt,F(e.serverVersion||"-"),1),e.serverVersion?(k(),de(p(ln),{key:0,size:"sm",label:S.value?p(n)("settings.copied"):p(n)("settings.copyServerVersion"),tooltip:S.value?p(n)("settings.copied"):p(n)("settings.copyServerVersion"),onClick:x},{default:ce(()=>[S.value?(k(),de(p(Ce),{key:1,class:"sd-check",name:"check",size:"md"})):(k(),de(p(Ce),{key:0,name:"copy",size:"md"}))]),_:1},8,["label","tooltip"])):ee("",!0)])]),A("div",ymt,[A("span",kmt,[$e(F(p(n)("settings.serverAddress"))+" ",1),A("span",bmt,F(p(n)("settings.serverAddressHint")),1)]),A("span",wmt,[A("span",Cmt,F(p(I)),1),U(p(ln),{size:"sm",label:_.value?p(n)("settings.copied"):p(n)("settings.copyServerAddress"),tooltip:_.value?p(n)("settings.copied"):p(n)("settings.copyServerAddress"),onClick:E},{default:ce(()=>[_.value?(k(),de(p(Ce),{key:1,class:"sd-check",name:"check",size:"md"})):(k(),de(p(Ce),{key:0,name:"copy",size:"md"}))]),_:1},8,["label","tooltip"])])]),p(H).canCheck?(k(),L("div",Amt,[A("span",xmt,[$e(F(p(n)("settings.checkUpdate"))+" ",1),W.value?(k(),L("span",Smt,F(W.value),1)):(k(),L("span",_mt,F(p(n)("settings.checkUpdateHint")),1))]),U(p(sn),{variant:"secondary",size:"sm",disabled:j.value,onClick:ie},{default:ce(()=>[$e(F(j.value?p(n)("settings.updateChecking"):p(n)("settings.checkUpdateBtn")),1)]),_:1},8,["disabled"])])):ee("",!0),p(H).canToggleAutoDownload?(k(),L("div",Mmt,[A("span",Imt,[$e(F(p(n)("settings.autoDownloadUpdate"))+" ",1),A("span",Tmt,F(p(n)("settings.autoDownloadUpdateHint")),1)]),U(p(jc),{"model-value":p(H).autoDownload.value,label:p(n)("settings.autoDownloadUpdate"),"onUpdate:modelValue":dt[10]||(dt[10]=wt=>p(H).setAutoDownload(wt,"settings"))},null,8,["model-value","label"])])):ee("",!0)])]),e.config?(k(),L("section",Emt,[A("h3",Lmt,F(p(n)("settings.privacy")),1),A("div",Nmt,[A("div",Dmt,[A("span",Fmt,[$e(F(p(n)("settings.telemetry"))+" ",1),A("span",Bmt,F(p(n)("settings.telemetryHint")),1),A("span",Rmt,F(p(n)("settings.telemetryRestartHint")),1)]),U(p(jc),{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:p(n)("settings.telemetry"),"onUpdate:modelValue":dt[11]||(dt[11]=wt=>qe())},null,8,["model-value","disabled","label"])])])])):ee("",!0),A("section",$mt,[A("h3",Omt,F(p(n)("settings.diagnostics")),1),A("div",Pmt,[A("div",zmt,[A("span",jmt,[$e(F(p(n)("settings.exportLog"))+" ",1),A("span",Hmt,F(p(n)("settings.exportLogHint")),1),p(Qa)()?ee("",!0):(k(),L("span",Wmt,F(p(n)("settings.logHint")),1))]),U(p(sn),{variant:"secondary",size:"sm",onClick:B},{default:ce(()=>[$e(F(p(n)("settings.exportLogBtn")),1)]),_:1})])])]),A("section",qmt,[A("h3",Umt,F(p(n)("settings.messageFolding")),1),A("div",Vmt,[A("div",Kmt,[A("span",Zmt,[$e(F(p(n)("settings.turnFolding"))+" ",1),A("span",Gmt,F(p(n)("settings.turnFoldingHint")),1)]),U(p(jc),{"model-value":p(s),label:p(n)("settings.turnFolding"),"onUpdate:modelValue":p(r)},null,8,["model-value","label","onUpdate:modelValue"])]),A("div",Qmt,[A("span",Ymt,[$e(F(p(n)("settings.activityRunFolding"))+" ",1),A("span",Jmt,F(p(n)("settings.activityRunFoldingHint")),1)]),U(p(jc),{"model-value":p(l),label:p(n)("settings.activityRunFolding"),"onUpdate:modelValue":p(a)},null,8,["model-value","label","onUpdate:modelValue"])])])])],512),[[Go,b.value==="advanced"]]),ai(A("section",Xmt,[A("section",egt,[A("h3",tgt,F(p(n)("settings.tabs.lab")),1),A("div",ngt,[A("div",igt,[A("span",ogt,[$e(F(p(n)("settings.lab.sidebarTabs"))+" ",1),A("span",sgt,F(p(n)("settings.lab.sidebarTabsHint")),1)]),U(p(jc),{"model-value":p(i),label:p(n)("settings.lab.sidebarTabs"),"onUpdate:modelValue":u},null,8,["model-value","label"])])])])],512),[[Go,b.value==="lab"]]),ai(A("section",rgt,[A("div",lgt,[A("h4",agt,F(p(n)("settings.archivedTitle")),1),A("p",ugt,F(p(n)("settings.archivedDesc")),1)]),A("div",cgt,[A("label",dgt,[dt[16]||(dt[16]=A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[A("circle",{cx:"11",cy:"11",r:"7"}),A("path",{d:"m21 21-4.3-4.3"})],-1)),ai(A("input",{"onUpdate:modelValue":dt[12]||(dt[12]=wt=>jt.value=wt),placeholder:p(n)("settings.archivedSearch")},null,8,fgt),[[ur,jt.value]])]),U(p(Cw),{"model-value":Te.value,options:Nt.value,size:"sm","aria-label":p(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":dt[13]||(dt[13]=wt=>Te.value=wt)},null,8,["model-value","options","aria-label"]),U(p(Ms),{size:"sm","model-value":Fe.value,options:[{value:"archived-desc",label:p(n)("settings.archivedSortArchived"),icon:"clock"},{value:"created-desc",label:p(n)("settings.archivedSortCreated"),icon:"calendar-schedule"},{value:"name-asc",label:p(n)("settings.archivedSortName"),icon:"sort"}],"onUpdate:modelValue":dt[14]||(dt[14]=wt=>Fe.value=wt)},null,8,["model-value","options"])]),Pt.value?(k(),L("div",hgt,F(p(n)("settings.archivedLoadingAll")),1)):(k(),L(De,{key:1},[Qt.value.length>0?(k(),L("div",pgt,[(k(!0),L(De,null,Ct(Qt.value,wt=>(k(),L("section",{key:wt.cwd,class:"archive-card"},[A("div",mgt,[U(p(Ce),{name:"folder-closed",size:"md"}),A("span",ggt,F(wt.cwd),1),A("span",vgt,F(p(n)("settings.archivedSessionsCount",{count:wt.items.length})),1)]),A("div",ygt,[(k(!0),L(De,null,Ct(wt.items,dn=>(k(),L("div",{key:dn.id,class:"archive-row"},[A("div",kgt,[A("div",bgt,F(dn.title),1),A("div",wgt,F(p(n)("settings.archivedAt",{time:en(dn.archivedAt??dn.updatedAt)})),1)]),U(p(sn),{variant:"secondary",size:"sm",onClick:Gt=>Ut(dn.id)},{default:ce(()=>[U(p(Ce),{name:"undo",size:"sm"}),A("span",null,F(p(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(k(),L("div",Cgt,F(_t.value.length===0?p(n)("settings.archivedEmpty"):p(n)("settings.archivedNoMatch")),1))],64))],512),[[Go,b.value==="archived"]])],34)])],512)]),_:1},8,["aria-label"]))}}),Sgt=xt(xgt,[["__scopeId","data-v-08ed3275"]]),_gt={class:"actions"},Mgt={class:"view-tabs"},Igt={key:0,class:"mlist"},Tgt={key:0,class:"mempty"},Egt=["onClick"],Lgt={class:"mgh-name"},Ngt={class:"mgh-path"},Dgt={key:2,class:"att"},Fgt={key:0,class:"mempty small"},Bgt=["onClick"],Rgt={key:0,class:"att"},$gt={class:"time"},Ogt={key:1,class:"mshow-more-row"},Pgt=["disabled","onClick"],zgt={key:1,class:"mshow-more-sep","aria-hidden":"true"},jgt=["onClick"],Hgt={key:1,class:"mlist"},Wgt={key:0,class:"mempty"},qgt=["onClick"],Ugt={class:"srow-main"},Vgt={class:"srow-sub"},Kgt={key:0,class:"att"},Zgt={class:"time"},Ggt={key:1,class:"mshow-more-row"},Qgt=["disabled"],Ygt=lt({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},flatSessions:{},pinnedSessions:{},flatHasMore:{type:Boolean,default:!1},flatLoadingMore:{type:Boolean,default:!1},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore","ensureFlatSessions","loadMoreFlatSessions"],setup(e,{emit:t}){const{t:n}=qt(),i=e,o=t;function s(){o("update:modelValue",!1)}function r(B){o("select",B),s()}function l(B){o("createInWorkspace",B),s()}function a(){o("create"),s()}function u(){o("addWorkspace"),s()}const c=V(tae()),d=D(()=>[{value:"flat",label:n("mobile.viewFlat")},{value:"grouped",label:n("mobile.viewGrouped")}]);We(c,B=>nae(B)),We(()=>[i.modelValue,c.value],([B,P])=>{B&&P==="flat"&&o("ensureFlatSessions")},{immediate:!0});const f=D(()=>{const B=new Set,P=[];for(const H of[...i.flatSessions,...i.pinnedSessions])B.has(H.id)||(B.add(H.id),P.push(H));return P.sort((H,j)=>new Date(j.updatedAt??0).getTime()-new Date(H.updatedAt??0).getTime())}),h=D(()=>{const B=P=>P.sessions.length>0?new Date(P.sessions[0].updatedAt??0).getTime():0;return i.groups.map((P,H)=>({g:P,index:H,ms:B(P)})).sort((P,H)=>H.ms-P.ms||P.index-H.index).map(P=>P.g)}),m=V(new Set);function g(B){return m.value.has(B)}function v(B){const P=new Set(m.value);P.has(B)?P.delete(B):P.add(B),m.value=P,_.value=null,R.value=null}const y=V(new Map);function b(B){return y.value.get(B.workspace.id)??B.initialCount}function w(B){const P=B.sessions.slice(0,b(B));if(i.activeId&&!P.some(H=>H.id===i.activeId)){const H=B.sessions.find(j=>j.id===i.activeId);if(H)return[...P,H]}return P}function C(B){return B.sessions.length>b(B)||B.hasMore||B.loadingMore}function T(B){return b(B)>B.initialCount}function N(B){const P=i.groups.find(Z=>Z.workspace.id===B);if(!P)return;const H=b(P)+Zx,j=new Map(y.value);j.set(B,H),y.value=j,P.sessions.length(k(),de(p(y1),{"model-value":e.modelValue,"onUpdate:modelValue":P[5]||(P[5]=H=>o("update:modelValue",H))},{default:ce(()=>[U(RZ),A("div",_gt,[A("button",{type:"button",class:"newrow",onClick:a},[U(p(Ce),{name:"chat-new",size:"sm"}),$e(" "+F(p(n)("sidebar.newChat")),1)]),A("button",{type:"button",class:"newrow",onClick:u},[U(p(Ce),{name:"folder",size:"sm"}),$e(" "+F(p(n)("sidebar.newWorkspace")),1)])]),A("div",Mgt,[U(p(Ms),{modelValue:c.value,"onUpdate:modelValue":P[0]||(P[0]=H=>c.value=H),options:d.value,size:"sm"},null,8,["modelValue","options"])]),c.value==="grouped"?(k(),L("div",Igt,[h.value.length===0?(k(),L("div",Tgt,F(p(n)("workspace.noWorkspace")),1)):ee("",!0),(k(!0),L(De,null,Ct(h.value,H=>(k(),L("div",{key:H.workspace.id,class:"mgroup"},[A("div",{class:Re(["mgh",{on:H.workspace.id===e.activeWorkspaceId}]),onClick:j=>v(H.workspace.id)},[g(H.workspace.id)?(k(),de(p(Ce),{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(k(),de(p(Ce),{key:1,class:"mgh-folder",name:"folder",size:"sm"})),A("span",Lgt,F(H.workspace.name),1),U(p(Nn),{text:H.workspace.root},{default:ce(()=>[A("span",Ngt,F(H.workspace.shortPath),1)]),_:2},1032,["text"]),g(H.workspace.id)&&S(H.workspace.id)>0?(k(),L("span",Dgt,F(S(H.workspace.id)),1)):ee("",!0),U(p(ln),{size:"lg",class:"mgh-more",label:p(n)("sidebar.options"),onClick:Tt(j=>q(H.workspace.id),["stop"])},{default:ce(()=>[U(p(Ce),{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),U(p(ln),{size:"lg",class:"mgh-add",label:p(n)("workspace.newInGroup"),onClick:Tt(j=>l(H.workspace.id),["stop"])},{default:ce(()=>[U(p(Ce),{name:"chat-new",size:"md"})]),_:1},8,["label","onClick"]),R.value===H.workspace.id?(k(),de(p(zs),{key:3,class:"kmenu wsmenu",onClick:P[1]||(P[1]=Tt(()=>{},["stop"]))},{default:ce(()=>[U(p(nn),{size:"lg",onClick:j=>z(H.workspace)},{default:ce(()=>[$e(F(p(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),U(p(nn),{size:"lg",danger:"",onClick:j=>O(H.workspace)},{default:ce(()=>[$e(F(p(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ee("",!0)],10,Egt),ai(A("div",null,[H.sessions.length===0?(k(),L("div",Fgt,F(p(n)("sidebar.noSessions")),1)):ee("",!0),(k(!0),L(De,null,Ct(w(H),j=>(k(),L("div",{key:j.id,class:Re(["srow",{cur:j.id===e.activeId}]),onClick:Z=>r(j.id)},[A("span",{class:Re(["t",{run:j.busy,aborted:!j.busy&&(e.attentionBySession[j.id]??0)===0&&j.lastTurnReason==="failed"}])},F(j.title),3),(e.attentionBySession[j.id]??0)>0?(k(),L("span",Rgt,F(e.attentionBySession[j.id]),1)):ee("",!0),A("span",$gt,F(j.time),1),U(p(ln),{size:"lg",class:"kb",label:p(n)("sidebar.options"),onClick:Tt(Z=>x(j.id),["stop"])},{default:ce(()=>[U(p(Ce),{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),_.value===j.id?(k(),de(p(zs),{key:1,class:"kmenu",onClick:P[2]||(P[2]=Tt(()=>{},["stop"]))},{default:ce(()=>[U(p(nn),{size:"lg",onClick:Z=>E(j)},{default:ce(()=>[$e(F(p(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),U(p(nn),{size:"lg",onClick:Z=>M(j.id)},{default:ce(()=>[$e(F(p(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ee("",!0)],10,Bgt))),128)),C(H)||T(H)?(k(),L("div",Ogt,[C(H)?(k(),L("button",{key:0,type:"button",class:"mshow-more",disabled:H.loadingMore,onClick:Tt(j=>N(H.workspace.id),["stop"])},[U(p(Ce),{name:"chevron-down",size:"sm"}),$e(" "+F(H.loadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,Pgt)):ee("",!0),C(H)&&T(H)?(k(),L("span",zgt,"·")):ee("",!0),T(H)?(k(),L("button",{key:2,type:"button",class:"mshow-more",onClick:Tt(j=>I(H.workspace.id),["stop"])},[U(p(Ce),{name:"chevron-up",size:"sm"}),$e(" "+F(p(n)("sidebar.showLess")),1)],8,jgt)):ee("",!0)])):ee("",!0)],512),[[Go,!g(H.workspace.id)]])]))),128))])):(k(),L("div",Hgt,[f.value.length===0?(k(),L("div",Wgt,F(p(n)("sidebar.noSessions")),1)):ee("",!0),(k(!0),L(De,null,Ct(f.value,H=>(k(),L("div",{key:H.id,class:Re(["srow srow-flat",{cur:H.id===e.activeId}]),onClick:j=>r(H.id)},[A("span",Ugt,[A("span",{class:Re(["t",{run:H.busy,aborted:!H.busy&&(e.attentionBySession[H.id]??0)===0&&H.lastTurnReason==="failed"}])},F(H.title),3),A("span",Vgt,F(H.cwdLabel??"-"),1)]),(e.attentionBySession[H.id]??0)>0?(k(),L("span",Kgt,F(e.attentionBySession[H.id]),1)):ee("",!0),A("span",Zgt,F(H.time),1),U(p(ln),{size:"lg",class:"kb",label:p(n)("sidebar.options"),onClick:Tt(j=>x(H.id),["stop"])},{default:ce(()=>[U(p(Ce),{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),_.value===H.id?(k(),de(p(zs),{key:1,class:"kmenu",onClick:P[3]||(P[3]=Tt(()=>{},["stop"]))},{default:ce(()=>[U(p(nn),{size:"lg",onClick:j=>E(H)},{default:ce(()=>[$e(F(p(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),U(p(nn),{size:"lg",onClick:j=>M(H.id)},{default:ce(()=>[$e(F(p(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ee("",!0)],10,qgt))),128)),e.flatHasMore?(k(),L("div",Ggt,[A("button",{type:"button",class:"mshow-more",disabled:e.flatLoadingMore,onClick:P[4]||(P[4]=Tt(H=>o("loadMoreFlatSessions"),["stop"]))},[U(p(Ce),{name:"chevron-down",size:"sm"}),$e(" "+F(e.flatLoadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,Qgt)])):ee("",!0)]))]),_:1},8,["model-value"]))}}),Jgt=xt(Ygt,[["__scopeId","data-v-aaf2e643"]]),Xgt={class:"group-title"},e0t={class:"card"},t0t={class:"srow-main"},n0t={class:"srow-label"},i0t={class:"srow-sub"},o0t={class:"srow read-only"},s0t={class:"srow-main"},r0t={class:"srow-label"},l0t={key:0,class:"srow-sub"},a0t=["aria-checked"],u0t={class:"srow-main"},c0t={class:"srow-label"},d0t={class:"srow-sub"},f0t=["aria-checked"],h0t={class:"srow-main"},p0t={class:"srow-label"},m0t={class:"srow-sub"},g0t={class:"srow-main"},v0t={class:"srow-label"},y0t={class:"srow-sub"},k0t=["aria-checked"],b0t={class:"srow-main"},w0t={class:"srow-label"},C0t={class:"srow-sub"},A0t={class:"srow-main"},x0t={class:"srow-label"},S0t={class:"srow read-only"},_0t={class:"srow-main"},M0t={class:"srow-label"},I0t={class:"srow-sub"},T0t=["aria-label"],E0t={class:"cache-note"},L0t={class:"group-title"},N0t={class:"card"},D0t={class:"srow read-only pref"},F0t={class:"srow-main"},B0t={class:"srow-label"},R0t={class:"srow read-only pref"},$0t={class:"srow-main"},O0t={class:"srow-label"},P0t={class:"srow read-only pref"},z0t={class:"srow-main"},j0t={class:"srow-label"},H0t=["aria-checked"],W0t={class:"srow-main"},q0t={class:"srow-label"},U0t={class:"srow-sub"},V0t=["aria-checked"],K0t={class:"srow-main"},Z0t={class:"srow-label"},G0t={class:"srow-sub"},Q0t={key:0,class:"srow read-only"},Y0t={class:"srow-main"},J0t={class:"srow-label"},X0t={class:"srow-val dim"},evt={class:"group-title"},tvt={class:"card"},nvt={class:"srow read-only acct-profile"},ivt={class:"acct-avatar","aria-hidden":"true"},ovt=["src"],svt={class:"srow-main"},rvt={class:"acct-name-row"},lvt={class:"srow-label"},avt={class:"srow-sub"},uvt={class:"srow-main"},cvt={class:"srow-label"},dvt={class:"srow-main"},fvt={class:"srow-label"},hvt={key:0,class:"usage"},pvt=lt({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},goalMode:{type:Boolean},goalActive:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},fontScale:{default:"medium"},managedProviderStatus:{default:null},managedUserInfo:{default:null},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleGoal","focusGoal","toggleSwarm","setPermission","setColorScheme","setFontScale","login","logout"],setup(e,{emit:t}){const{t:n}=qt(),{isConfirmOpen:i}=cf(),{turnFolding:o,setTurnFolding:s}=Vx(),{activityRunFolding:r,setActivityRunFolding:l}=Kx(),a=Ga(),u=e,c=t;function d(Z){c("setColorScheme",Z)}const f=["manual","yolo","auto"],h=D(()=>u.models?.find(Z=>Z.id===u.status?.modelId)),m=D(()=>K1(h.value)),g=D(()=>Z1(h.value)),v=D(()=>M6(h.value,u.thinking)),y=D(()=>g.value.includes(v.value)?v.value:""),b=D(()=>g.value.map(Z=>({value:Z,label:Bd(Z)}))),w=D(()=>u.planMode===!0),C=D(()=>u.goalMode===!0);function T(){if(u.goalActive){c("focusGoal");return}!C.value&&w.value&&c("togglePlan"),c("toggleGoal")}function N(){!w.value&&C.value&&c("toggleGoal"),c("togglePlan")}const I=D(()=>u.swarmMode===!0),S=V(!1);We(()=>u.managedUserInfo?.avatar,()=>{S.value=!1});const _=D(()=>!!u.managedUserInfo?.avatar&&!S.value),x=D(()=>u.managedUserInfo?.userLevelName?.trim()??""),E=D(()=>u.managedProviderStatus==="authenticated"),M=D(()=>{const Z=u.status.permission;return Z==="auto"?"var(--color-danger)":Z==="yolo"?"var(--color-warning)":"var(--color-text-muted)"}),R=D(()=>{const Z=u.status.permission,ie=n(Z==="yolo"?"mobile.permYoloSub":Z==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${Z} · ${ie}`}),q=D(()=>u.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(u.status.ctxUsed/u.status.ctxMax*100))):0),z=D(()=>u.status.ctxMax>0?`${Ac(u.status.ctxUsed)}/${Ac(u.status.ctxMax)}`:n("status.statusNone"));function O(Z){c("setThinking",wk(h.value,Z))}function B(){const Z=f.indexOf(u.status.permission),ie=f[(Z+1)%f.length];c("setPermission",ie)}function P(){c("pickModel"),c("update:modelValue",!1)}function H(){c("login"),c("update:modelValue",!1)}function j(){c("logout"),c("update:modelValue",!1)}return(Z,ie)=>(k(),de(p(y1),{"model-value":e.modelValue,title:p(n)("mobile.settingsTitle"),"close-on-esc":!p(i),"onUpdate:modelValue":ie[5]||(ie[5]=W=>c("update:modelValue",W))},{default:ce(()=>[A("div",Xgt,F(p(n)("mobile.groupSession")),1),A("div",e0t,[A("button",{type:"button",class:"srow",onClick:P},[A("span",t0t,[A("span",n0t,F(p(n)("status.statusModel")),1),A("span",i0t,F(e.status.model),1)]),ie[6]||(ie[6]=A("span",{class:"chev"},"›",-1))]),A("div",o0t,[A("span",s0t,[A("span",r0t,F(p(n)("status.statusThinking")),1),m.value==="unsupported"?(k(),L("span",l0t,F(p(n)("status.modeNotSupported")),1)):ee("",!0)]),g.value.length>1?(k(),de(p(Ms),{key:0,"model-value":y.value,options:b.value,size:"sm","onUpdate:modelValue":O},null,8,["model-value","options"])):(k(),L("span",{key:1,class:Re(["srow-val",{dim:v.value==="off"}])},F(v.value==="off"?p(n)("status.planOff"):p(Bd)(v.value)),3))]),A("button",{type:"button",class:"srow",role:"switch","aria-checked":w.value,onClick:N},[A("span",u0t,[A("span",c0t,F(p(n)("status.statusPlanMode")),1),A("span",d0t,F(p(n)("mobile.planModeSub")),1)]),A("span",{class:Re(["toggle",{on:w.value}]),"aria-hidden":"true"},null,2)],8,a0t),e.goalActive?(k(),L("button",{key:1,type:"button",class:"srow",onClick:T},[A("span",g0t,[A("span",v0t,F(p(n)("status.goalLabel")),1),A("span",y0t,F(p(n)("mobile.goalModeSub")),1)]),U(p(Ce),{class:"srow-chevron",name:"chevron-right",size:"sm","aria-hidden":"true"})])):(k(),L("button",{key:0,type:"button",class:"srow",role:"switch","aria-checked":C.value,onClick:T},[A("span",h0t,[A("span",p0t,F(p(n)("status.goalLabel")),1),A("span",m0t,F(p(n)("mobile.goalModeSub")),1)]),A("span",{class:Re(["toggle",{on:C.value}]),"aria-hidden":"true"},null,2)],8,f0t)),A("button",{type:"button",class:"srow",role:"switch","aria-checked":I.value,onClick:ie[0]||(ie[0]=W=>c("toggleSwarm"))},[A("span",b0t,[A("span",w0t,F(p(n)("status.statusSwarmMode")),1),A("span",C0t,F(p(n)("mobile.swarmModeSub")),1)]),A("span",{class:Re(["toggle",{on:I.value}]),"aria-hidden":"true"},null,2)],8,k0t),A("button",{type:"button",class:"srow",onClick:B},[A("span",A0t,[A("span",x0t,F(p(n)("status.statusPermission")),1),A("span",{class:"srow-sub",style:on({color:M.value})},F(R.value),5)]),ie[7]||(ie[7]=A("span",{class:"chev"},"›",-1))]),A("div",S0t,[A("span",_0t,[A("span",M0t,F(p(n)("status.statusContext")),1),A("span",I0t,F(z.value),1)]),A("span",{class:"ctx-meter","aria-label":z.value},[A("i",{style:on({width:q.value+"%"})},null,4)],8,T0t)])]),A("div",E0t,F(p(n)("status.cacheNote")),1),A("div",L0t,F(p(n)("mobile.groupApp")),1),A("div",N0t,[A("div",D0t,[A("span",F0t,[A("span",B0t,F(p(n)("theme.colorSchemeLabel")),1)]),U(p(Ms),{"model-value":e.colorScheme??"system",options:[{value:"light",label:p(n)("theme.light"),icon:"light-mode"},{value:"dark",label:p(n)("theme.dark"),icon:"dark-mode"},{value:"system",label:p(n)("theme.system")}],"onUpdate:modelValue":d},null,8,["model-value","options"])]),A("div",R0t,[A("span",$0t,[A("span",O0t,F(p(n)("sidebar.language")),1)]),U(KZ)]),A("div",P0t,[A("span",z0t,[A("span",j0t,F(p(n)("settings.uiFontSize")),1)]),U(p(Ms),{"model-value":e.fontScale,options:[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],"aria-label":p(n)("settings.uiFontSize"),"onUpdate:modelValue":ie[1]||(ie[1]=W=>c("setFontScale",W))},null,8,["model-value","aria-label"])]),A("button",{type:"button",class:"srow",role:"switch","aria-checked":p(o),onClick:ie[2]||(ie[2]=W=>p(s)(!p(o)))},[A("span",W0t,[A("span",q0t,F(p(n)("settings.turnFolding")),1),A("span",U0t,F(p(n)("settings.turnFoldingHint")),1)]),A("span",{class:Re(["toggle",{on:p(o)}]),"aria-hidden":"true"},null,2)],8,H0t),A("button",{type:"button",class:"srow",role:"switch","aria-checked":p(r),onClick:ie[3]||(ie[3]=W=>p(l)(!p(r)))},[A("span",K0t,[A("span",Z0t,F(p(n)("settings.activityRunFolding")),1),A("span",G0t,F(p(n)("settings.activityRunFoldingHint")),1)]),A("span",{class:Re(["toggle",{on:p(r)}]),"aria-hidden":"true"},null,2)],8,V0t),e.serverVersion?(k(),L("div",Q0t,[A("span",Y0t,[A("span",J0t,F(p(n)("settings.serverVersion")),1)]),A("span",X0t,F(e.serverVersion),1)])):ee("",!0)]),A("div",evt,F(p(n)("mobile.groupAccount")),1),A("div",tvt,[E.value?(k(),L(De,{key:0},[A("div",nvt,[A("span",ivt,[_.value?(k(),L("img",{key:0,src:e.managedUserInfo?.avatar,alt:"",onError:ie[4]||(ie[4]=W=>S.value=!0)},null,40,ovt)):(k(),de(p(Ce),{key:1,name:"user",size:"md"}))]),A("span",svt,[A("span",rvt,[A("span",lvt,F(e.managedUserInfo?.nickname||p(n)("sidebar.defaultUserName")),1),x.value?(k(),de(p(ul),{key:0,class:"acct-level",variant:"neutral",size:"sm"},{default:ce(()=>[$e(F(x.value),1)]),_:1})):ee("",!0)]),A("span",avt,F(p(n)("settings.signedIn")),1)])]),A("button",{type:"button",class:"srow acct out",onClick:j},[A("span",uvt,[A("span",cvt,F(p(n)("sidebar.signOut")),1)])])],64)):(k(),L("button",{key:1,type:"button",class:"srow acct in",onClick:H},[A("span",dvt,[A("span",fvt,F(p(n)("sidebar.signIn")),1)])]))]),E.value&&e.modelValue?(k(),L("div",hvt,[U(ZZ,{"on-fetch-usage":p(a).getUsage},null,8,["on-fetch-usage"])])):ee("",!0)]),_:1},8,["model-value","title","close-on-esc"]))}}),mvt=xt(pvt,[["__scopeId","data-v-f46669a7"]]),gvt={key:0,class:"ls-done-card"},vvt={class:"ls-done-badge"},yvt={class:"ls-card-text"},kvt={class:"ls-card-title"},bvt={class:"ls-card-hint"},wvt={key:1,class:"ls-cards"},Cvt={class:"ls-card-icon"},Avt={key:2,class:"ls-flow"},xvt={key:0,class:"ls-center"},Svt={class:"ls-center-text"},_vt={key:1,class:"ls-device"},Mvt={class:"ls-hero"},Ivt={class:"ls-hero-icon"},Tvt={key:0,class:"ls-hero-title"},Evt={class:"ls-hero-hint"},Lvt={class:"ls-manual"},Nvt={class:"ls-manual-label"},Dvt={key:2,class:"ls-center"},Fvt={class:"ls-center-text ls-success-text"},Bvt={class:"ls-center-hint"},Rvt={class:"ls-center"},$vt={class:"ls-center-text ls-err-text"},Ovt={class:"ls-center-hint"},Pvt={class:"ls-actions"},zvt={class:"ls-center"},jvt={class:"ls-center-text ls-err-text"},Hvt={class:"ls-center-hint"},Wvt={class:"ls-actions"},qvt={class:"ls-center"},Uvt={class:"ls-center-text ls-warn-text"},Vvt={class:"ls-center-hint"},Kvt={class:"ls-actions"},Zvt=lt({__name:"OnboardingLoginStep",props:{authReady:{type:Boolean},onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function},onGetOAuthRegion:{type:Function}},emits:["success","addProvider"],setup(e,{emit:t}){const{t:n}=qt(),i=Ec(),o=e,s=t,r=V("choice"),{step:l,pollError:a,flow:u,secondsLeft:c,autoOpenBlocked:d,startFlow:f,cancelFlow:h}=sK({onStartOAuthLogin:o.onStartOAuthLogin,onPollOAuthLogin:o.onPollOAuthLogin,onCancelOAuthLogin:o.onCancelOAuthLogin,onSuccess:()=>s("success"),autoOpen:bZ(),authWake:wZ()}),m=V(!1),g=[{region:"mainland-cn",titleKey:"onboarding.login.kimiCnTitle",hintKey:"onboarding.login.kimiCnHint"},{region:"global",titleKey:"onboarding.login.kimiOverseasTitle",hintKey:"onboarding.login.kimiOverseasHint"}],v={titleKey:"onboarding.login.kimiTitle",hintKey:"onboarding.login.kimiHint"},y=V("pending"),b=D(()=>ZO(y.value,g,v));yn(()=>{o.onGetOAuthRegion?.().then(_=>{y.value=_===null?"unsupported":"supported"})});const w=D(()=>u.value?.verificationUriComplete??"");function C(_){r.value="flow",f(_)}function T(){h(),r.value="choice"}async function N(){!u.value||!await Es(w.value)||(m.value=!0,setTimeout(()=>{m.value=!1},2e3))}function I(){gS(w.value)&&window.open(w.value,"_blank","noopener,noreferrer")}function S(_){const x=Math.floor(_/60),E=_%60;return`${x}:${String(E).padStart(2,"0")}`}return(_,x)=>e.authReady?(k(),L("div",gvt,[A("span",vvt,[U(p(Ce),{name:"check",size:"sm"})]),A("div",yvt,[A("div",kvt,F(p(n)("onboarding.login.loggedInTitle")),1),A("div",bvt,F(p(n)("onboarding.login.loggedInHint")),1)])])):r.value==="choice"?(k(),L("div",wvt,[(k(!0),L(De,null,Ct(b.value,E=>(k(),de(p(rw),{key:E.region??"oauth",disabled:E.disabled,onSelect:M=>C(E.region)},{leading:ce(()=>[U(z1,{size:40})]),hint:ce(()=>[$e(F(p(n)(E.hintKey)),1)]),default:ce(()=>[$e(" "+F(p(n)(E.titleKey))+" ",1)]),_:2},1032,["disabled","onSelect"]))),128)),p(i)?ee("",!0):(k(),de(p(rw),{key:0,onSelect:x[0]||(x[0]=E=>s("addProvider"))},{leading:ce(()=>[A("span",Cvt,[U(p(Ce),{name:"bolt",size:"lg"})])]),hint:ce(()=>[$e(F(p(n)("onboarding.login.customProviderHint")),1)]),default:ce(()=>[$e(" "+F(p(n)("onboarding.login.customProviderTitle"))+" ",1)]),_:1}))])):(k(),L("div",Avt,[p(l)==="starting"?(k(),L("div",xvt,[U(p(mo),{size:"md"}),A("span",Svt,F(p(n)("login.starting")),1)])):p(l)==="device-code"&&p(u)?(k(),L("div",_vt,[A("div",Mvt,[A("span",Ivt,[U(z1,{size:48})]),p(d)?(k(),L("div",Tvt,F(p(n)("login.blockedTitle")),1)):ee("",!0),A("div",Evt,F(p(d)?p(n)("login.blockedHint"):p(n)("login.openedHint",{time:S(p(c))})),1)]),p(d)?(k(),de(p(sn),{key:0,variant:"primary",onClick:I},{default:ce(()=>[$e(F(p(n)("login.authorizeInBrowser"))+" ",1),U(p(Ce),{name:"external-link",size:"sm"})]),_:1})):ee("",!0),A("div",Lvt,[A("span",Nvt,[$e(F(p(n)("login.notOpened"))+" ",1),U(p(sn),{variant:"text",class:Re(["ls-copy-text",{"is-copied":m.value}]),onClick:N},{default:ce(()=>[$e(F(m.value?p(n)("login.copied"):p(n)("login.copyLink")),1)]),_:1},8,["class"])])])])):p(l)==="success"?(k(),L("div",Dvt,[U(p(md),{kind:"success"}),A("span",Fvt,F(p(n)("login.success")),1),A("span",Bvt,F(p(n)("login.successHint")),1)])):p(l)==="denied"?(k(),L(De,{key:3},[A("div",Rvt,[U(p(md),{kind:"expired"}),A("span",$vt,F(p(n)("login.deniedTitle")),1),A("span",Ovt,F(p(n)("login.expiredHint")),1)]),A("div",Pvt,[U(p(sn),{variant:"secondary",onClick:T},{default:ce(()=>[$e(F(p(n)("onboarding.back")),1)]),_:1}),U(p(sn),{variant:"primary",onClick:x[1]||(x[1]=E=>p(f)())},{default:ce(()=>[$e(F(p(n)("login.retry")),1)]),_:1})])],64)):p(l)==="expired"?(k(),L(De,{key:4},[A("div",zvt,[U(p(md),{kind:"expired"}),A("span",jvt,F(p(n)("login.expiredTitle")),1),A("span",Hvt,F(p(n)("login.expiredHint")),1)]),A("div",Wvt,[U(p(sn),{variant:"secondary",onClick:T},{default:ce(()=>[$e(F(p(n)("onboarding.back")),1)]),_:1}),U(p(sn),{variant:"primary",onClick:x[2]||(x[2]=E=>p(f)())},{default:ce(()=>[$e(F(p(n)("login.retry")),1)]),_:1})])],64)):p(l)==="error"?(k(),L(De,{key:5},[A("div",qvt,[U(p(md),{kind:"error"}),A("span",Uvt,F(p(a)?p(n)("login.pollErrorTitle"):p(n)("login.errorTitle")),1),A("span",Vvt,F(p(a)?p(n)("login.pollErrorHint"):p(n)("login.errorHint")),1)]),A("div",Kvt,[U(p(sn),{variant:"secondary",onClick:T},{default:ce(()=>[$e(F(p(n)("onboarding.back")),1)]),_:1}),U(p(sn),{variant:"primary",onClick:x[3]||(x[3]=E=>p(f)())},{default:ce(()=>[$e(F(p(n)("login.retry")),1)]),_:1})])],64)):ee("",!0)]))}}),Gvt=xt(Zvt,[["__scopeId","data-v-f2d724d4"]]),Qvt=["aria-label"],Yvt={class:"wiz-body"},Jvt={key:0,class:"wiz-step"},Xvt={class:"wiz-title"},e2t={class:"wiz-sub"},t2t={class:"pref-group"},n2t={class:"pref-label"},i2t={class:"lang-cards"},o2t=["onClick"],s2t={class:"opt-label"},r2t={class:"pref-group"},l2t={class:"pref-label"},a2t={class:"theme-cards"},u2t=["onClick"],c2t={class:"opt-label"},d2t={key:1,class:"wiz-step"},f2t={class:"wiz-title"},h2t={class:"wiz-sub"},p2t={class:"wiz-step-fill"},m2t={class:"wiz-foot"},g2t={class:"wiz-foot-ghost"},v2t=lt({__name:"OnboardingWizard",props:{authReady:{type:Boolean},onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function},onGetOAuthRegion:{type:Function}},emits:["complete","loginSuccess","addProvider"],setup(e,{emit:t}){const{t:n,locale:i}=qt(),o=e,s=t;function r(){s("addProvider")}const l=["preferences","login"],a=V(0),u=D(()=>l[a.value]??"preferences");function c(){a.value0&&a.value--}function f(y){i.value!==y&&bS(y)}const{colorScheme:h,setColorScheme:m}=X1(),g=[{value:"system",labelKey:"theme.system"},{value:"light",labelKey:"theme.light"},{value:"dark",labelKey:"theme.dark"}];function v(){s("loginSuccess")}return(y,b)=>(k(),L("div",{class:"wizard",role:"dialog","aria-modal":"true","aria-label":p(n)("onboarding.welcome.title")},[A("div",Yvt,[u.value==="preferences"?(k(),L("section",Jvt,[U(z1,{size:72}),A("h1",Xvt,F(p(n)("onboarding.welcome.title")),1),A("p",e2t,F(p(n)("onboarding.welcome.subtitle")),1),A("div",t2t,[A("div",n2t,F(p(n)("onboarding.welcome.languageLabel")),1),A("div",i2t,[(k(!0),L(De,null,Ct(p(K4),w=>(k(),L("button",{key:w.code,class:Re(["opt-card lang-card",{selected:p(i)===w.code}]),type:"button",onClick:C=>f(w.code)},[A("span",{class:Re(["opt-radio",{on:p(i)===w.code}])},null,2),A("span",s2t,F(w.label),1)],10,o2t))),128))])]),A("div",r2t,[A("div",l2t,F(p(n)("onboarding.welcome.themeLabel")),1),A("div",a2t,[(k(),L(De,null,Ct(g,w=>A("button",{key:w.value,class:Re(["opt-card theme-card",{selected:p(h)===w.value}]),type:"button",onClick:C=>p(m)(w.value)},[A("span",{class:Re(["tp",`tp-${w.value}`]),"aria-hidden":"true"},[w.value==="system"?(k(),L(De,{key:0},[b[2]||(b[2]=Qd('',2))],64)):(k(),L(De,{key:1},[b[3]||(b[3]=A("span",{class:"tp-side"},null,-1)),b[4]||(b[4]=A("span",{class:"tp-lines"},[A("span"),A("span"),A("span")],-1))],64))],2),A("span",c2t,F(p(n)(w.labelKey)),1)],10,u2t)),64))])])])):(k(),L("section",d2t,[U(z1,{size:72}),A("h1",f2t,F(p(n)("onboarding.login.title")),1),A("p",h2t,F(p(n)("onboarding.login.subtitle")),1),A("div",p2t,[U(Gvt,{"auth-ready":o.authReady,"on-start-o-auth-login":o.onStartOAuthLogin,"on-poll-o-auth-login":o.onPollOAuthLogin,"on-cancel-o-auth-login":o.onCancelOAuthLogin,"on-get-o-auth-region":o.onGetOAuthRegion,onSuccess:v,onAddProvider:r},null,8,["auth-ready","on-start-o-auth-login","on-poll-o-auth-login","on-cancel-o-auth-login","on-get-o-auth-region"])])])),A("div",m2t,[u.value==="preferences"?(k(),de(p(sn),{key:0,variant:"primary",size:"lg",class:"wiz-primary",onClick:c},{default:ce(()=>[$e(F(p(n)("onboarding.continue")),1)]),_:1})):u.value==="login"&&o.authReady?(k(),de(p(sn),{key:1,variant:"primary",size:"lg",class:"wiz-primary",onClick:b[0]||(b[0]=w=>s("complete"))},{default:ce(()=>[$e(F(p(n)("onboarding.login.finish")),1)]),_:1})):ee("",!0),A("div",g2t,[a.value>0?(k(),de(p(sn),{key:0,variant:"ghost",onClick:d},{default:ce(()=>[$e(F(p(n)("onboarding.back")),1)]),_:1})):ee("",!0),u.value==="login"&&o.authReady?ee("",!0):(k(),de(p(sn),{key:1,variant:"ghost",onClick:b[1]||(b[1]=w=>s("complete"))},{default:ce(()=>[$e(F(u.value==="login"?p(n)("onboarding.login.skip"):p(n)("onboarding.skip")),1)]),_:1}))])])])],8,Qvt))}}),y2t=xt(v2t,[["__scopeId","data-v-555fb599"]]),k2t={class:"kap-root"},b2t={class:"kap-head"},w2t={class:"kap-count"},C2t={class:"kap-head-actions"},A2t={class:"kap-filters"},x2t=["value"],S2t={class:"kap-check"},_2t={class:"kap-check"},M2t={class:"kap-view-toggle",role:"group"},I2t={key:0,class:"kap-empty"},T2t=["onClick"],E2t={class:"kap-ts"},L2t={class:"kap-label"},N2t={key:0,class:"kap-detail"},D2t={class:"kap-detail-actions"},F2t=["onClick"],B2t={key:1,class:"kap-agg"},R2t={class:"mono"},$2t={class:"mono"},O2t={class:"num"},P2t={class:"num"},z2t={key:0},j2t={class:"mono"},H2t={class:"num"},W2t={class:"num"},q2t={key:0},U2t=lt({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,i=V("all"),o=V(""),s=V(""),r=V(!1),l=V("timeline"),a=D(()=>(IS.value,[...Rut()])),u=D(()=>{const _=new Set;for(const x of a.value)x.sessionId&&_.add(x.sessionId);return[..._].sort()});function c(_){return _.kind==="rest:error"||_.code!==void 0&&_.code!==0||_.eventType==="error"||_.eventType==="parse-error"}const d=D(()=>{const _=o.value.trim().toLowerCase();return a.value.filter(x=>!(i.value!=="all"&&x.source!==i.value||s.value&&x.sessionId!==s.value||r.value&&!c(x)||_&&!`${x.label} ${x.kind} ${x.eventType??""} ${x.sessionId??""} ${x.requestId??""}`.toLowerCase().includes(_)))}),f=D(()=>{const _=new Map;for(const x of d.value){if(x.kind!=="ws:in"&&x.kind!=="ws:out")continue;const E=x.kind==="ws:in"?"←":"→",M=`${E} ${x.eventType??"?"} @ ${x.sessionId??"-"}`,R=_.get(M)??{key:M,sessionId:x.sessionId??"-",eventType:x.eventType??"?",dir:E,count:0};R.count++,x.seq!==void 0&&(R.lastSeq=x.seq),_.set(M,R)}return[..._.values()].sort((x,E)=>E.count-x.count)}),h=D(()=>{const _=new Map;for(const x of d.value){if(x.source!=="rest"||x.kind==="rest:request")continue;const E=`${x.method??"?"} ${x.path??"?"}`,M=_.get(E)??{count:0,errors:0,totalMs:0,timed:0};M.count++,c(x)&&M.errors++,x.durationMs!==void 0&&(M.totalMs+=x.durationMs,M.timed++),_.set(E,M)}return[..._.entries()].map(([x,E])=>({key:x,count:E.count,errors:E.errors,avgMs:E.timed>0?Math.round(E.totalMs/E.timed):0})).sort((x,E)=>E.count-x.count)}),m=V(null),g=V(!0),v=V(null),y=V(null);We(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await ht();const _=v.value;_&&(_.scrollTop=_.scrollHeight)});function b(_){m.value=m.value===_?null:_}function w(_){const x=new Date(_),E=(M,R=2)=>String(M).padStart(R,"0");return`${E(x.getHours())}:${E(x.getMinutes())}:${E(x.getSeconds())}.${E(x.getMilliseconds(),3)}`}function C(_){return JSON.stringify(_,null,2)}async function T(_){await Es(C(_))&&(y.value=_.id,setTimeout(()=>{y.value===_.id&&(y.value=null)},1500))}function N(){qZ(d.value)}function I(_){return c(_)||_.source==="client"?"b-err":_.source==="rest"?"b-rest":_.kind==="ws:lifecycle"?"b-life":_.kind==="ws:out"?"b-out":"b-in"}function S(_){return _.source==="rest"?"REST":_.source==="client"?"APP":"WS"}return(_,x)=>(k(),L("section",k2t,[A("header",b2t,[x[11]||(x[11]=A("strong",null,"KAP debug",-1)),A("span",w2t,F(d.value.length)+"/"+F(a.value.length),1),A("div",C2t,[A("button",{type:"button",class:Re({on:p(Ig)}),onClick:x[0]||(x[0]=E=>Ig.value=!p(Ig))},F(p(Ig)?"resume":"pause"),3),A("button",{type:"button",onClick:x[1]||(x[1]=E=>p($ut)())},"clear"),A("button",{type:"button",onClick:x[2]||(x[2]=E=>N())},"export jsonl"),U(p(Nn),{text:"Close window"},{default:ce(()=>[A("button",{type:"button",onClick:x[3]||(x[3]=E=>n("close"))},"✕")]),_:1})])]),A("div",A2t,[ai(A("select",{"onUpdate:modelValue":x[4]||(x[4]=E=>i.value=E),"aria-label":"Source filter"},[...x[12]||(x[12]=[A("option",{value:"all"},"rest + ws + app",-1),A("option",{value:"rest"},"rest",-1),A("option",{value:"ws"},"ws",-1),A("option",{value:"client"},"app errors",-1)])],512),[[sw,i.value]]),ai(A("select",{"onUpdate:modelValue":x[5]||(x[5]=E=>s.value=E),"aria-label":"Session filter"},[x[13]||(x[13]=A("option",{value:""},"all sessions",-1)),(k(!0),L(De,null,Ct(u.value,E=>(k(),L("option",{key:E,value:E},F(E),9,x2t))),128))],512),[[sw,s.value]]),ai(A("input",{"onUpdate:modelValue":x[6]||(x[6]=E=>o.value=E),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ur,o.value]]),A("label",S2t,[ai(A("input",{"onUpdate:modelValue":x[7]||(x[7]=E=>r.value=E),type:"checkbox"},null,512),[[_9,r.value]]),x[14]||(x[14]=$e(" errors",-1))]),A("label",_2t,[ai(A("input",{"onUpdate:modelValue":x[8]||(x[8]=E=>g.value=E),type:"checkbox"},null,512),[[_9,g.value]]),x[15]||(x[15]=$e(" follow",-1))]),A("div",M2t,[A("button",{type:"button",class:Re({on:l.value==="timeline"}),onClick:x[9]||(x[9]=E=>l.value="timeline")},"timeline",2),A("button",{type:"button",class:Re({on:l.value==="aggregate"}),onClick:x[10]||(x[10]=E=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(k(),L("div",{key:0,ref_key:"listRef",ref:v,class:"kap-list"},[d.value.length===0?(k(),L("div",I2t," No trace entries yet. REST calls and WS frames will appear here. ")):ee("",!0),(k(!0),L(De,null,Ct(d.value,E=>(k(),L("div",{key:E.id,class:"kap-row-wrap"},[A("button",{type:"button",class:Re(["kap-row",{expanded:m.value===E.id}]),onClick:M=>b(E.id)},[A("span",E2t,F(w(E.ts)),1),A("span",{class:Re(["kap-badge",I(E)])},F(S(E)),3),A("span",L2t,F(E.label),1)],10,T2t),m.value===E.id?(k(),L("div",N2t,[A("div",D2t,[A("button",{type:"button",onClick:M=>T(E)},F(y.value===E.id?"copied ✓":"copy json"),9,F2t)]),A("pre",null,F(C(E)),1)])):ee("",!0)]))),128))],512)):(k(),L("div",B2t,[x[20]||(x[20]=A("h4",null,"WS frames by session / type",-1)),A("table",null,[x[17]||(x[17]=A("thead",null,[A("tr",null,[A("th",null,"dir"),A("th",null,"type"),A("th",null,"session"),A("th",null,"count"),A("th",null,"last seq")])],-1)),A("tbody",null,[(k(!0),L(De,null,Ct(f.value,E=>(k(),L("tr",{key:E.key},[A("td",null,F(E.dir),1),A("td",R2t,F(E.eventType),1),A("td",$2t,F(E.sessionId),1),A("td",O2t,F(E.count),1),A("td",P2t,F(E.lastSeq??"—"),1)]))),128)),f.value.length===0?(k(),L("tr",z2t,[...x[16]||(x[16]=[A("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ee("",!0)])]),x[21]||(x[21]=A("h4",null,"REST by endpoint",-1)),A("table",null,[x[19]||(x[19]=A("thead",null,[A("tr",null,[A("th",null,"endpoint"),A("th",null,"count"),A("th",null,"errors"),A("th",null,"avg ms")])],-1)),A("tbody",null,[(k(!0),L(De,null,Ct(h.value,E=>(k(),L("tr",{key:E.key},[A("td",j2t,F(E.key),1),A("td",H2t,F(E.count),1),A("td",{class:Re(["num",{err:E.errors>0}])},F(E.errors),3),A("td",W2t,F(E.avgMs),1)]))),128)),h.value.length===0?(k(),L("tr",q2t,[...x[18]||(x[18]=[A("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ee("",!0)])])]))]))}}),V2t=xt(U2t,[["__scopeId","data-v-2b13888e"]]),K2t=lt({__name:"DebugPanel",setup(e){const t=V(!1);let n=null,i=null,o=null;const s=["data-color-scheme"];function r(c){const d=document.documentElement,f=c.documentElement;for(const h of s){const m=d.getAttribute(h);m!==null?f.setAttribute(h,m):f.removeAttribute(h)}}function l(c){const d=c.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const m of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(m.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){o?.disconnect(),o=null;try{i?.unmount()}catch{}i=null,n=null,t.value=!1}function u(){if(n&&!n.closed){n.focus();return}const c=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!c)return;n=c;const d=l(c),f=M9(V2t,{onClose:()=>c.close()});f.mount(d),i=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...s]}),c.addEventListener("pagehide",a),c.addEventListener("beforeunload",a)}return yn(()=>{u()}),ti(()=>{n&&!n.closed&&n.close(),a()}),(c,d)=>(k(),de(p(Nn),{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:ce(()=>[A("button",{class:"kap-fab",type:"button",onClick:u}," KAP ")]),_:1},8,["text"]))}}),Z2t=xt(K2t,[["__scopeId","data-v-21de79fc"]]),G2t=lt({__name:"ServerAuthDialog",setup(e){const t=V(""),n=V(null),i=V(!1);yn(()=>{ht(()=>n.value?.focus())});function o(){const r=t.value;!r||i.value||(i.value=!0,uP(r),window.location.reload())}function s(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(k(),de(p(ef),{open:!0,title:"Server token required","hide-close":!0,"close-on-overlay":!1,"close-on-esc":!1},{foot:ce(()=>[U(p(sn),{variant:"primary",disabled:!t.value||i.value,loading:i.value,onClick:o},{default:ce(()=>[$e(F(i.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])]),default:ce(()=>[l[1]||(l[1]=A("p",{class:"server-auth-hint"},[$e(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),A("code",null,"KIMI_CODE_PASSWORD"),$e("). ")],-1)),U(p(_s),{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:i.value,onKeydown:s},null,8,["modelValue","disabled"])]),_:1}))}}),Q2t=xt(G2t,[["__scopeId","data-v-05495fe9"]]),Y2t=["aria-label"],J2t=lt({__name:"InternalBuildBanner",setup(e){const{t}=qt(),n=Wh;return(i,o)=>p(n)?(k(),L("span",{key:0,class:"internal-build-tag",role:"note","aria-label":p(t)("app.internalBuildBanner")},[o[0]||(o[0]=A("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[A("path",{d:"M8 2 14 13H2L8 2Z"}),A("path",{d:"M8 6v3.5"}),A("path",{d:"M8 11.5h.01"})],-1)),A("span",null,F(p(t)("app.internalBuildBanner")),1)],8,Y2t)):ee("",!0)}}),X2t=xt(J2t,[["__scopeId","data-v-439d3299"]]),eyt={class:"app-shell"},tyt=["inert"],nyt=lt({__name:"App",setup(e){zse();const t=V(!1);let n=null;const i=Ga(),o=D(()=>!i.dangerousBypassAuth.value&&t.value);ii(p4,i.resolveImageUrl),ii(nK,je=>i.swarmMembersByToolCallId.value.get(je)??[]),ii(im,je=>xoe(je,i.models.value));const{t:s,locale:r}=qt();ii(om,je=>Soe(je));const{confirm:l}=cf(),a=Qa(),u=Ec(),c=V(!1),d=V(!1),f=D(()=>{const je=i.activeSessionId.value;return i.sessions.value.find(xe=>xe.id===je)?.title??""}),h=D(()=>{const je=i.activeSessionId.value;return!!je&&i.pinnedSessionIds.value.includes(je)}),m=V(null);function g(je){i.pinnedSessionIds.value.includes(je)||m.value?.revealPinnedSection(),i.togglePinSession(je)}const v=D(()=>{const je=i.activeSessionId.value;return i.sessions.value.find(xe=>xe.id===je)?.lastTurnReason??null}),y=D(()=>i.activity.value!=="idle"),b=D(()=>{const je=i.activeSessionId.value,xe=i.sessions.value.find(Pe=>Pe.id===je);return pv({busy:xe?.busy??!1,unread:i.unreadBySession.value[je??""]??!1,questionCount:i.questions.value.length,approvalCount:i.pendingApprovals.value.length,pendingInteraction:xe?.pendingInteraction,lastTurnReason:v.value??void 0})});TPe({running:y,title:i.documentBaseTitle});const w=D(()=>i.models.value.find(je=>je.id===i.status.value.modelId)),C=D(()=>M6(w.value,i.thinking.value)),T=V(!i.onboarded.value);function N(){i.setOnboarded(!0),T.value=!1}function I(){N(),ci.value="providers",ne.value=!0}function S(){ci.value="archived",ne.value=!0}let _=0;function x(){const je=window.visualViewport,xe=document.documentElement.style;xe.setProperty("--app-height",`${je?.height??window.innerHeight}px`),xe.setProperty("--app-top",`${je?.offsetTop??0}px`)}function E(){_||(_=requestAnimationFrame(()=>{_=0,x()}))}Sae(()=>i.getOAuthRegion());function M(){Jw(()=>i.getOAuthRegion())}yn(()=>{n=qse(()=>{t.value=!0,i.clearDangerousBypassAuth()}),i.load(),M(),X(),x(),window.visualViewport?.addEventListener("resize",E),window.visualViewport?.addEventListener("scroll",E),window.addEventListener("resize",E),document.addEventListener("keydown",R,!0),pS()}),Ln(()=>{document.removeEventListener("keydown",R,!0),window.visualViewport?.removeEventListener("resize",E),window.visualViewport?.removeEventListener("scroll",E),window.removeEventListener("resize",E),_&&(cancelAnimationFrame(_),_=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function R(je){je.key==="Escape"&&(mS(je)||ft.value||be.value?.composerPopupOpen()!==!0&&(je.defaultPrevented||ue.hidePanel()&&(je.stopImmediatePropagation(),je.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.closest(".global-preview")!==null&&ht(J4))))}const q=SPe({client:i,t:(je,xe)=>xe===void 0?s(je):s(je,xe)});yn(()=>{const je=dIe({resolveSkill:xe=>i.skills.value.find(Pe=>Pe.name===xe)??null,openPath:xe=>void ue.openFilePreview(xe),openAttachment:xe=>Lt(xe),openSkillLabel:()=>s("mention.openSkill"),copyPathLabel:()=>s("mention.copyPath"),copyQuoteLabel:()=>s("selection.copyQuote"),copyCommentLabel:()=>s("selection.copyComment"),quoteBlockLabel:()=>s("selection.quoteLabel"),commentBlockLabel:()=>s("selection.comment"),attachmentErrorLabel:xe=>xe==="upload-failed"?s("mention.attachmentUploadFailed"):xe==="upload-interrupted"?s("mention.attachmentUploadInterrupted"):void 0,resolveAttachmentPreviewUrl:async xe=>{const Pe=b1();try{const rn=xe.sessionId!==void 0?await Pe.getSessionMediaBlob(xe.sessionId,xe.fileId):await Pe.getFileBlob(xe.fileId);return URL.createObjectURL(rn)}catch{return null}},mediaFullscreenLabel:()=>s("mention.viewFullscreen"),mediaPreviewStateLabel:xe=>s(xe==="loading"?"mention.mediaPreviewLoading":xe==="uploading"?"mention.mediaPreviewUploading":"mention.mediaPreviewUnavailable"),mediaUploadStateLabel:xe=>s(xe==="uploading"?"mention.stateUploading":xe==="uploaded"?"mention.stateUploaded":"mention.stateUploadFailed"),probePath:(xe,Pe)=>i.probeWorkspacePath(xe,Pe),skillsLoaded:()=>i.skillsLoaded.value,probeScope:()=>i.activeSessionId.value||i.activeWorkspaceId.value});Ln(je)});const z=V(null),O=V(null);function B(je){O.value=je.originImg??null,z.value=je.media}const{SIDEBAR_WIDTH_KEY:P,SIDEBAR_DEFAULT:H,SIDEBAR_MIN:j,sidebarMax:Z,sessionColWidth:ie,sidebarCollapsed:W,sidebarDragging:Q,sideWidth:te,loadSidebarCollapsed:X,toggleSidebarCollapse:ge}=APe({previewOpen:()=>ue.panelVisible.value}),ue=kPe({client:i,sideWidth:te,t:(je,xe)=>xe===void 0?s(je):s(je,xe),locale:r}),se=new Map;function fe(){if(ue.activeTab.value?.type==="btw"&&ue.panelVisible.value){const Vn=ke.value?.rootEl??null,qs=Vn!==null&&Vn.contains(document.activeElement);ue.hidePanel(),qs&&ht(J4);return}const je=ue.panelTabs.value.findLast(Vn=>Vn.type==="btw"),xe=we();if(je){ue.activateTab(je.id),xe.focusWhenReady();return}const Pe=i.activeSessionId.value||`${BB}${i.activeWorkspaceId.value??"none"}`,rn=i.getDraftPromotion(),Yn=rn!==null&&rn.sessionId===Pe?`${BB}${rn.workspaceId}`:null,ei=se.get(Pe)??(Yn!==null?se.get(Yn):void 0);if(ei!==void 0){ei.then(Vn=>{if(Vn.agentId!==null&&(Vn.sessionId===null||Vn.sessionId===i.activeSessionId.value)){if(!xe.acted()){const bs=ue.panelTabs.value.find(Je=>Je.type==="btw"&&Je.payload?.agentId===Vn.agentId);bs&&ue.activateTab(bs.id)}xe.focusWhenReady()}});return}const Qi=ue.openSideChatTab();se.set(Pe,Qi),Qi.then(Vn=>{Vn.agentId!==null&&(Vn.sessionId===null||Vn.sessionId===i.activeSessionId.value)&&xe.focusWhenReady()}).finally(()=>{se.get(Pe)===Qi&&se.delete(Pe)})}function G(){return ue.openSideChatTab()}const ae=D(()=>ue.panelTabs.value.filter(je=>je.type==="btw"&&je.payload!==void 0).filter(je=>{const xe=je.payload;return!i.sideChatTargetsOfSession(xe.parentId).some(Pe=>Pe.agentId===xe.agentId)}).map(je=>je.id));We(ae,je=>{if(je.length===0)return;const xe=je.some(Yn=>Yn===ue.activeTabId.value),Pe=ke.value?.rootEl??null,rn=Pe!==null&&Pe.contains(document.activeElement);for(const Yn of je)ue.closeTab(Yn);if(rn){if(xe){ah();return}ht(()=>{document.activeElement===document.body&&ah()})}});const K=D(()=>i.sessionLoading.value?[]:ue.panelTabs.value.filter(je=>je.type==="compaction"&&je.payload!==void 0).filter(je=>{const{turnId:xe}=je.payload,Pe=i.turns.value.find(rn=>rn.id===xe);return!(Pe?.role==="compaction"&&Pe.text)}).map(je=>je.id));We(K,je=>{if(je.length===0)return;const xe=je.some(Yn=>Yn===ue.activeTabId.value),Pe=ke.value?.rootEl??null,rn=Pe!==null&&Pe.contains(document.activeElement);for(const Yn of je)ue.closeTab(Yn);if(rn){if(xe){ah();return}ht(()=>{document.activeElement===document.body&&ah()})}});function re(){be.value?.closeDockPanel()}ii(qo,{openFile:je=>{re(),ue.openFilePreview(je)},openAgent:je=>{re(),ue.openAgentPanel(je)},openTurnDiff:({turnId:je,change:xe})=>{re();const Pe=je||i.turns.value.find(rn=>NZ(rn).some(Yn=>Yn===xe))?.id||"";ue.openTurnDiff({turnId:Pe,change:xe})},openCompaction:je=>{re(),ue.openCompactionPanel(je)},openDiff:()=>{re(),ue.openDiffDetail()},openBtw:()=>{re(),G()},openTerm:()=>{},isVisible:()=>ue.panelVisible.value,isExpanded:()=>ue.panelExpanded.value,activeTabType:()=>ue.activeTab.value?.type??null,togglePanel:()=>{ue.panelVisible.value?ue.hidePanel():ue.showPanel()}}),We(()=>i.mainView.value,je=>{je!=="chat"&&ue.leaveChatView()});const be=V(null),ke=V(null);function we(){let je=!1;const xe=Pe=>{Pe instanceof KeyboardEvent&&Pe.repeat||(je=!0,ue.bumpInteractionVersion())};return document.addEventListener("pointerdown",xe,!0),document.addEventListener("keydown",xe,!0),window.addEventListener("blur",xe),document.addEventListener("visibilitychange",xe),{acted:()=>je,focusWhenReady:()=>{ht(()=>{document.removeEventListener("pointerdown",xe,!0),document.removeEventListener("keydown",xe,!0),window.removeEventListener("blur",xe),document.removeEventListener("visibilitychange",xe),!je&&document.hasFocus()&&(u.value||ft.value||ke.value?.focusSideChatInput())})}}}const oe=D(()=>{const je=i.goal.value?.status;return je==="active"||je==="paused"||je==="blocked"});function le(){d.value=!1,be.value?.focusGoal()}const ye=V(!1),Ae=V(!1),_e=V(!1),pe=V(!1),ne=V(!1);let Ee;yn(()=>{Ee=window.kimiDesktop?.onMenuAction?.(je=>{je==="open-settings"?ne.value=!0:je==="new-chat"&&ks()})}),Ln(()=>{Ee?.()});const qe=V(null),ze=V(null),ft=D(()=>rr.value>0||ye.value||Ae.value||_e.value||pe.value||ne.value||T.value||c.value||d.value),gt=V(!1),_t=V(!1),Pt=V(!1);async function Ht(){gt.value=!0,_t.value=!1,ye.value=!0;try{await i.refreshAllProviders()}catch{_t.value=!0}finally{gt.value=!1}}function jt(){Ae.value=!0}async function Te(){await l({title:s("sidebar.logoutConfirmTitle"),message:s("sidebar.logoutConfirmMessage"),variant:"danger",action:async()=>{await i.logout(),M()}})}async function Fe(je){ye.value=!1,await Ke(je)}async function Ke(je){await i.setModel(je)&&je!==i.defaultModel.value&&i.updateConfig({defaultModel:je})}const rt=V(null);let Nt=0;function Lt(je){if(je.kind==="image"||je.kind==="video"){B({media:{kind:je.kind,url:je.url,path:je.name,fileId:je.fileId,sessionId:je.sessionId}});return}const xe=je.fileId;xe!==void 0&&IQe(b1(),xe,je.name,je.mediaType).then(Pe=>{Pe==="unsupported"&&(rt.value={kind:"attachmentOpen",name:je.name||xe,key:++Nt})})}const Qt=V(null);async function Ut(je,xe){if(!(xe.length===0||Qt.value!==null)){Qt.value=je;try{const Pe=je==="archive"?await i.archiveSessions(xe):await i.restoreSessions(xe),rn=XB(je,Pe);if(rn===null){i.notify({severity:"error",title:s(je==="archive"?"admin.batchDoneFailedNotice":"admin.batchReopenFailedNotice",{n:Pe.failed})});return}rt.value={kind:"adminBatch",plan:rn,key:++Nt}}finally{Qt.value=null}}}async function en(){const je=rt.value;if(!je||je.kind!=="adminBatch")return;const xe=Bst(je.plan.direction),Pe=xe==="archive"?await i.archiveSessions(je.plan.ids):await i.restoreSessions(je.plan.ids),rn=XB(xe,Pe);rn!==null&&rt.value?.key===je.key&&(rt.value={kind:"adminBatch",plan:rn,key:++Nt})}async function it(je){await i.archiveSession(je),!i.sessionsForView.value.some(xe=>xe.id===je)&&(rt.value={kind:"archive",id:je,key:++Nt})}async function dt(je){await i.restoreSession(je)&&(rt.value={kind:"archive",id:je,reopen:!0,key:++Nt})}let wt=!1;async function dn(je){if(wt)return;wt=!0;const xe=++Nt,Pe=setTimeout(()=>{(rt.value===null||rt.value.key<=xe)&&(rt.value={kind:"export",state:"running",key:xe})},400);try{await i.exportSession(je)&&!Wh?(rt.value===null||rt.value.key<=xe)&&(rt.value={kind:"export",state:"done",key:++Nt}):rt.value?.kind==="export"&&rt.value.key===xe&&(rt.value=null)}finally{clearTimeout(Pe),wt=!1}}async function Gt(){const je=rt.value;if(!(!je||je.kind!=="archive")){if(je.reopen){if(await i.archiveSession(je.id),i.sessionsForView.value.some(xe=>xe.id===je.id)||rt.value?.key!==je.key)return;rt.value={kind:"archive",id:je.id,key:++Nt};return}await i.restoreSession(je.id)&&rt.value?.key===je.key&&(rt.value=null)}}function ri(je){je!==void 0&&rt.value?.key===je&&(rt.value=null)}const ci=V(void 0),{sidebarTabs:ji}=em();async function xi(je){const xe=i.workspacesView.value.find(rn=>rn.id===je)?.name??je;await l({title:s("sidebar.removeWorkspace"),message:s("workspace.removeWorkspaceConfirm",{name:xe}),variant:"danger",action:()=>i.deleteWorkspace(je)})&&i.workspacesView.value.some(rn=>rn.id===je)}async function Uo(je){Pt.value=!0;try{await i.updateConfig(je)&&await i.checkAuth()}finally{Pt.value=!1}}async function ot(je){return i.startOAuthLogin(je)}async function Ue(){return i.pollOAuthLogin()}async function st(){return i.cancelOAuthLogin()}async function _n(){return i.getOAuthRegion()}async function bt(){Ae.value=!1,await i.checkAuth(),await i.load(),M()}async function Zn(){N(),await i.checkAuth(),await i.load(),M()}async function vs(je){const xe=i.activeSessionId.value;await i.undo(je.undoCount??1)!==null&&(xe&&(i.invalidateSessionPlans(xe),i.refreshSessionPlans(xe)),await ht(),be.value?.loadComposerForEdit(je.text,je.attachments),be.value?.notifyUndone())}async function go(){const je=await i.abortCurrentPrompt();be.value?.onAbortOutcome(je)}const Ls=V([]);We(()=>[i.activeSessionId.value,be.value?.hasInsertableComposer()??!1],([je,xe])=>{Ls.value.length!==0&&(Ls.value=sze(Ls.value,je,Pe=>xe?be.value?.insertComposerQuote(Pe.quote,Pe.comment,Pe.source)===!0:!1))});function Hs(je,xe){const Pe=je.action==="comment"?je.comment:void 0;be.value?.insertComposerQuote(je.quote,Pe,xe)!==!0&&(Ls.value=[...Ls.value,{quote:je.quote,comment:Pe,source:xe,sessionId:i.activeSessionId.value}])}const ys=D(()=>ke.value?.rootEl??null),Vo=D(()=>{const je=ue.activeTab.value;return je?.type==="file"?je.payload.path:void 0}),{selectionBubble:Ti,selectionKeyboard:Tr,onMouseup:vo,onPointerdown:no,onBubbleClose:_o,onBubbleAction:Er}=uze({root:ys,containerSelector:XPe,captureSource:je=>eze(je,Vo.value??""),onAction:(je,xe)=>{Hs(je,xe),u.value&&ue.hidePanel()}});We(()=>[ue.activeTabId.value,ue.panelVisible.value,ue.panelExpanded.value],()=>{_o()});function Bo(je){const xe=b1();return je.map(Pe=>Ux(xe,Pe))}async function Qn(je,xe,Pe,rn){if(i.authReady.value||(await i.checkAuth(),i.authReady.value))return!0;const Yn=i.managedProviderStatus.value==="authenticated";Yn&&i.managedMembership.value===null&&await i.probeManagedMembership();const ei=Yn&&i.managedMembership.value==="free",Qi=await l(ei?{title:s("login.upgradeRequiredTitle"),message:s("login.upgradeRequiredMessage"),confirmLabel:s("sidebar.upgrade"),variant:"primary"}:{title:s("login.requiredTitle"),message:s("login.requiredMessage"),confirmLabel:s("login.goToLogin"),variant:"primary"});return be.value?.loadComposerForEdit(Pe??je,Bo(xe),rn),Qi&&(ei?mv():jt()),!1}async function Zi(je,xe=[],Pe,rn){if(i.activeSessionId.value||i.activeWorkspaceId.value)return!0;const Yn=await l({title:s("workspace.requiredTitle"),message:s("workspace.requiredMessage"),confirmLabel:s("conversation.pickFolder"),variant:"primary"});return be.value?.loadComposerForEdit(Pe??je,Bo(xe),rn),Yn&&(_e.value=!0),!1}async function yi(je,xe=[],Pe,rn){return await Qn(je,xe,Pe,rn)?Zi(je,xe,Pe,rn):!1}let Hi=0;async function io(je){const{cmd:xe,attachments:Pe,restoreText:rn,restoreEntries:Yn}=je;if(xe==="/compact"||xe.startsWith("/compact ")){if(!await yi(xe,[],rn,Yn))return;i.compact(xe.slice(8).trim()||void 0);return}if(xe==="/swarm"||xe.startsWith("/swarm ")){const ei=xe.slice(6).trim();if(ei==="on")i.setSwarmMode(!0);else if(ei==="off")i.setSwarmMode(!1);else if(ei){if(!await yi(xe,[],rn,Yn))return;i.setSwarmMode(!0),i.sendPrompt(ei,[],je.editText)}else i.toggleSwarmMode();return}if(xe==="/goal"||xe.startsWith("/goal ")){const ei=xe.slice(5).trim();if(ei==="pause"||ei==="resume"||ei==="cancel")i.controlGoal(ei);else if(ei){if(!await yi(xe,[],rn,Yn))return;i.createGoal(ei)}else i.toggleGoalMode();return}if(xe==="/btw"||xe.startsWith("/btw ")){const ei=xe.slice(4).trim();if(!ei)fe();else{const Qi=we();if(!await yi(xe,[],rn,Yn)){Qi.focusWhenReady();return}ue.openSideChatTab(ei).finally(()=>Qi.focusWhenReady())}return}switch(xe){case"/new":case"/clear":ks();break;case"/fork":i.forkSession();break;case"/export":dn();break;case"/undo":{const ei=i.activeSessionId.value;i.undo().then(Qi=>{Qi&&ei&&(i.invalidateSessionPlans(ei),i.refreshSessionPlans(ei))});break}case"/status":pe.value=!0;break;case"/login":jt();break;default:{const ei=xe.indexOf(" "),Qi=je.skillName??B6((ei===-1?xe:xe.slice(0,ei)).slice(1)),Vn=je.skillName?zle(xe,je.skillName,rn):ei===-1?void 0:xe.slice(ei+1).trim()||void 0;if(!Qi)break;const qs=++Hi;if(!await yi(xe,Pe,rn,Yn))return;if(!i.activeSessionId.value&&i.activeWorkspaceId.value){const bs=i.activeWorkspaceId.value,{sessionId:Je,activated:Ve}=await i.startSessionAndActivateSkill(bs,Qi,Vn,Pe);!Ve&&qs===Hi&&be.value?.isComposerEmpty()&&(Je===null?i.activeWorkspaceId.value===bs:i.activeSessionId.value===Je)&&be.value.loadComposerForEdit(rn??xe,Bo(Pe),Yn)}else{const bs=i.activeSessionId.value;i.activateSkill(Qi,Vn,Pe).then(Je=>{Je||i.activeSessionId.value===bs&&qs===Hi&&be.value?.isComposerEmpty()&&be.value.loadComposerForEdit(rn??xe,Bo(Pe),Yn)})}break}}}function ki(je){i.unqueue(je)}function di(je){i.unqueue(je)}function bi(je){i.reorderQueue(je.from,je.to)}function oo(je){Hi++,i.steerQueued(je)}async function so(je){if(!await Qn(je.text,je.attachments,je.restoreText,je.restoreEntries))return;Hi++;const xe=i.activeWorkspaceId.value;if(!i.activeSessionId.value&&xe){await i.startSessionAndSendPrompt(xe,je.text,je.attachments);return}if(!i.activeSessionId.value&&!xe){qe.value=je,await l({title:s("workspace.requiredTitle"),message:s("workspace.requiredMessage"),confirmLabel:s("conversation.pickFolder"),variant:"primary"})?_e.value=!0:Mn();return}i.sendPrompt(je.text,je.attachments,je.editText??je.restoreText)}function Mn(){const je=qe.value;qe.value=null,je&&be.value?.loadComposerForEdit(je.restoreText??je.text,Bo(je.attachments),je.restoreEntries)}async function Ns(je){if(ze.value=null,!await i.addWorkspaceByPath(je)){ze.value=s("workspace.addFailed");return}_e.value=!1;const Pe=qe.value;qe.value=null;const rn=i.activeWorkspaceId.value;Pe&&rn&&await i.startSessionAndSendPrompt(rn,Pe.text,Pe.attachments)===null&&be.value?.loadComposerForEdit(Pe.restoreText??Pe.text,Bo(Pe.attachments),Pe.restoreEntries)}function Ws(){Mn(),ze.value=null,_e.value=!1}function Jo(){ht(()=>{be.value?.focusComposer()})}function ks(){const je=i.activeWorkspaceId.value;je?i.openWorkspaceDraft(je,{entry:"newChat"}):i.clearActiveSession(),Jo()}function ro(je){i.openWorkspaceDraft(je,{entry:"workspace"}),Jo()}function eo(je){i.openWorkspaceDraft(je),Jo()}const to=D(()=>i.recentSessionsForWorkspace(i.activeWorkspaceId.value));function Gi(je){je&&window.open(je,"_blank","noopener")}return(je,xe)=>(k(),L("div",eyt,[o.value?(k(),de(Q2t,{key:0})):ee("",!0),A("div",{class:Re(["app",{mobile:p(u),"sidebar-collapsed":p(W)&&!p(u),"macos-desktop":p(Cd),"panel-expanded":p(ue).panelExpanded.value}]),inert:T.value},[p(u)?(k(),de(p(dit),{key:1,workspace:p(i).visibleWorkspace.value,"session-title":f.value,status:b.value,onOpenSwitcher:xe[27]||(xe[27]=Pe=>c.value=!0),onOpenSettings:xe[28]||(xe[28]=Pe=>d.value=!0)},null,8,["workspace","session-title","status"])):(k(),L(De,{key:0},[U(dlt,{ref_key:"sidebarRef",ref:m,collapsed:p(W),dragging:p(Q),"col-width":p(te),"active-workspace":p(i).visibleWorkspace.value,"active-workspace-id":p(i).activeWorkspaceId.value,sessions:p(i).sessionsForView.value,groups:p(i).workspaceGroups.value,"workspace-sort-mode":p(i).workspaceSortMode.value,"pinned-sessions":p(i).pinnedSessions.value,"flat-sessions":p(i).flatSessions.value,"flat-has-more":p(i).flatSessionsHasMore.value,"flat-loading-more":p(i).flatSessionsLoadingMore.value,"done-sessions":p(i).doneSessions.value,"done-has-more":p(i).doneSessionsHasMore.value,"done-loading-more":p(i).doneSessionsLoadingMore.value,initialized:p(i).initialized.value,"active-id":p(i).activeSessionId.value,"attention-by-session":p(i).attentionBySession.value,"pending-by-session":p(i).pendingBySession.value,"unread-by-session":p(i).unreadBySession.value,onSelect:xe[0]||(xe[0]=Pe=>p(i).selectSession(Pe)),onCreate:ks,onCreateInWorkspace:xe[1]||(xe[1]=Pe=>ro(Pe)),onSelectWorkspace:xe[2]||(xe[2]=Pe=>p(i).openWorkspace(Pe)),onAddWorkspace:xe[3]||(xe[3]=Pe=>_e.value=!0),onRename:xe[4]||(xe[4]=(Pe,rn)=>p(i).renameSession(Pe,rn)),onGenerateTitle:xe[5]||(xe[5]=(Pe,rn)=>void p(i).regenerateSessionTitle(Pe).then(rn)),onArchive:xe[6]||(xe[6]=Pe=>it(Pe)),onRestore:xe[7]||(xe[7]=Pe=>dt(Pe)),onFork:xe[8]||(xe[8]=Pe=>p(i).forkSession(Pe)),onExport:xe[9]||(xe[9]=Pe=>void dn(Pe)),onPin:xe[10]||(xe[10]=Pe=>p(i).togglePinSession(Pe)),onUnpin:xe[11]||(xe[11]=Pe=>p(i).unpinSession(Pe)),onDropPin:xe[12]||(xe[12]=Pe=>p(i).pinSession(Pe)),onRenameWorkspace:xe[13]||(xe[13]=(Pe,rn)=>p(i).renameWorkspace(Pe,rn)),onDeleteWorkspace:xe[14]||(xe[14]=Pe=>xi(Pe)),onReorderWorkspaces:xe[15]||(xe[15]=Pe=>p(i).reorderWorkspaces(Pe)),onSetWorkspaceSortMode:xe[16]||(xe[16]=Pe=>p(i).setWorkspaceSortMode(Pe)),onLoadMoreSessions:xe[17]||(xe[17]=Pe=>void p(i).loadMoreSessions(Pe)),onLoadAllSessions:xe[18]||(xe[18]=Pe=>void p(i).loadAllSessions()),onEnsureFlatSessions:xe[19]||(xe[19]=Pe=>void p(i).ensureFlatSessions()),onLoadMoreFlatSessions:xe[20]||(xe[20]=Pe=>void p(i).loadMoreFlatSessions()),onEnsureDoneSessions:xe[21]||(xe[21]=Pe=>void p(i).ensureDoneSessions()),onLoadMoreDoneSessions:xe[22]||(xe[22]=Pe=>void p(i).loadMoreDoneSessions()),onOpenSessionAdmin:xe[23]||(xe[23]=Pe=>p(i).openSessionAdmin()),onOpenSettings:xe[24]||(xe[24]=Pe=>ne.value=!0),onLogin:jt,onCollapse:p(ge)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","workspace-sort-mode","pinned-sessions","flat-sessions","flat-has-more","flat-loading-more","done-sessions","done-has-more","done-loading-more","initialized","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),ai(U(p(uZ),{class:"side-handle","storage-key":p(P),"default-width":p(H),min:p(j),max:p(Z),"onUpdate:width":xe[25]||(xe[25]=Pe=>ie.value=Pe),"onUpdate:dragging":xe[26]||(xe[26]=Pe=>Q.value=Pe)},null,8,["storage-key","default-width","min","max"]),[[Go,!p(W)]])],64)),ai(U(rht,{ref_key:"conversationPaneRef",ref:be,mobile:p(u),turns:p(i).turns.value,"session-id":p(i).activeSessionId.value,approvals:p(i).pendingApprovals.value,changes:p(i).changes.value,"git-info":p(i).gitInfo.value,tasks:p(i).tasks.value,"rest-tasks":p(i).activeRestTasks.value,todos:p(i).todos.value,goal:p(i).goal.value,"session-plans":p(i).sessionPlans.value,"activation-badges":p(i).activationBadges.value,status:p(i).status.value,thinking:p(i).thinking.value,"plan-mode":p(i).planMode.value,"plan-armed":p(i).planArmed.value,"swarm-mode":p(i).swarmMode.value,"goal-mode":p(i).goalMode.value,models:p(i).models.value,"auth-ready":p(i).authReady.value,"managed-signed-in":p(i).managedProviderStatus.value==="authenticated","managed-membership":p(i).managedMembership.value,"starred-ids":p(i).starredModelIds.value,skills:p(i).skills.value,"skills-loaded":p(i).skillsLoaded.value,questions:p(i).questions.value,"pending-question-actions":p(i).pendingQuestionActions,"pending-approval-actions":p(i).pendingApprovalActions,running:y.value,"overlay-open":ft.value,"turn-active":p(i).turnActive.value,queued:p(i).queued.value,"search-files":p(i).searchFiles,"upload-image":p(i).uploadImage,working:p(i).working.value,"last-turn-reason":v.value,"turn-error":p(i).activeTurnError.value??null,"turn-retry":p(i).activeTurnRetry.value??null,starting:p(i).isStartingFirstPrompt.value,"file-reload-key":p(i).activeSessionId.value,"session-loading":p(i).sessionLoading.value,compaction:p(i).compaction.value,"has-more-messages":p(i).hasMoreMessages.value,"loading-more":p(i).loadingMoreMessages.value,"loading-more-error":p(i).loadMoreMessagesError.value,"load-older-messages":p(i).loadOlderMessages,"workspace-name":p(i).visibleWorkspace.value?.name,"workspace-root":p(i).visibleWorkspace.value?.root??p(i).status.value.cwd,"git-diff-stats":p(i).gitDiffStats.value,workspaces:p(i).workspacesView.value,"active-workspace-id":p(i).activeWorkspaceId.value,"recent-sessions":to.value,"draft-entry":p(i).draftEntry.value,"session-title":f.value,"session-archived":p(i).activeSessionArchived.value,"session-pinned":h.value,pr:p(i).activePullRequest.value,onSelectWorkspace:xe[29]||(xe[29]=Pe=>eo(Pe)),onSelectSession:xe[30]||(xe[30]=Pe=>p(i).selectSession(Pe)),onAddWorkspace:xe[31]||(xe[31]=Pe=>_e.value=!0),onOpenPr:Gi,onOpenSessionAdmin:xe[32]||(xe[32]=Pe=>p(i).openSessionAdmin(Pe)),onSubmit:xe[33]||(xe[33]=Pe=>so(Pe)),onLogin:xe[34]||(xe[34]=Pe=>jt()),onSteer:xe[35]||(xe[35]=Pe=>p(i).steerPrompt(Pe.text,Pe.attachments)),onApproval:xe[36]||(xe[36]=(Pe,rn)=>p(i).respondApproval(Pe,rn)),onCancelTask:xe[37]||(xe[37]=Pe=>p(i).cancelTask(Pe)),onDetachTask:xe[38]||(xe[38]=Pe=>p(i).detachTask(Pe)),onAnswer:xe[39]||(xe[39]=(Pe,rn)=>p(i).respondQuestion(Pe,rn)),onDismiss:xe[40]||(xe[40]=Pe=>p(i).dismissQuestion(Pe)),onCommand:io,onInterrupt:go,onUnqueue:ki,onEditQueued:di,onReorderQueue:bi,onSteerQueued:oo,onSetPermission:xe[41]||(xe[41]=Pe=>p(i).setPermission(Pe)),onSetThinking:xe[42]||(xe[42]=Pe=>p(i).setThinking(Pe)),onTogglePlan:xe[43]||(xe[43]=Pe=>p(i).togglePlanMode()),onToggleSwarm:xe[44]||(xe[44]=Pe=>p(i).toggleSwarmMode()),onToggleGoal:xe[45]||(xe[45]=Pe=>p(i).toggleGoalMode()),onCreateGoal:xe[46]||(xe[46]=Pe=>p(i).createGoal(Pe)),onControlGoal:xe[47]||(xe[47]=Pe=>p(i).controlGoal(Pe)),onRefreshGitStatus:xe[48]||(xe[48]=Pe=>p(i).activeSessionId.value&&p(i).loadGitStatus(p(i).activeSessionId.value)),onRenameSession:xe[49]||(xe[49]=(Pe,rn)=>p(i).renameSession(Pe,rn)),onForkSession:xe[50]||(xe[50]=Pe=>p(i).forkSession(Pe)),onTogglePin:g,onArchiveSession:xe[51]||(xe[51]=Pe=>it(Pe)),onRestoreSession:xe[52]||(xe[52]=Pe=>dt(Pe)),onExportSession:xe[53]||(xe[53]=Pe=>void dn(Pe)),onCompact:xe[54]||(xe[54]=Pe=>p(i).compact()),onPickModel:xe[55]||(xe[55]=Pe=>Ht()),onSelectModel:xe[56]||(xe[56]=Pe=>Ke(Pe)),onOpenMedia:B,onEditMessage:vs,onQuoteAction:Hs},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","rest-tasks","todos","goal","session-plans","activation-badges","status","thinking","plan-mode","plan-armed","swarm-mode","goal-mode","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","skills-loaded","questions","pending-question-actions","pending-approval-actions","running","overlay-open","turn-active","queued","search-files","upload-image","working","last-turn-reason","turn-error","turn-retry","starting","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","recent-sessions","draft-entry","session-title","session-archived","session-pinned","pr"]),[[Go,p(i).mainView.value==="chat"]]),ai(U(Dht,{"batch-running":Qt.value,onArchiveSessions:xe[57]||(xe[57]=Pe=>void Ut("archive",Pe)),onRestoreSessions:xe[58]||(xe[58]=Pe=>void Ut("restore",Pe))},null,8,["batch-running"]),[[Go,p(i).mainView.value==="sessionAdmin"]]),!p(u)&&(p(Cd)||p(W))?(k(),de(p(ln),{key:2,class:"sidebar-toggle-btn",size:"sm",label:p(W)?p(s)("sidebar.expandSidebar"):p(s)("sidebar.collapseSidebar"),tooltip:p(W)?p(s)("sidebar.expandSidebar"):p(s)("sidebar.collapseSidebar"),onClick:p(ge)},{default:ce(()=>[U(p(Ce),{name:p(W)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","tooltip","onClick"])):ee("",!0),!p(u)&&p(W)?(k(),de(p(ln),{key:3,class:"new-chat-btn",size:"sm",label:p(s)("sidebar.newChat"),tooltip:p(s)("sidebar.newChat"),onClick:ks},{default:ce(()=>[U(p(Ce),{name:"chat-new"})]),_:1},8,["label","tooltip"])):ee("",!0),!p(u)||p(ue).panelVisible.value?(k(),de(Cht,{key:4,ref_key:"panelTabsRef",ref:ke,panel:p(ue),client:p(i),"file-preview":p(q),"on-open-media":B,"on-open-btw":G,onMouseup:p(vo),onPointerdown:p(no)},null,8,["panel","client","file-preview","onMouseup","onPointerdown"])):ee("",!0),U(p(AZ),{visible:p(Ti)!==null,x:p(Ti)?.x??0,y:p(Ti)?.y??0,bottom:p(Ti)?.bottom??0,px:p(Ti)?.px,py:p(Ti)?.py,quote:p(Ti)?.quote??"","focus-on-open":p(Tr),"focus-return-el":ys.value,onAction:p(Er),onClose:p(_o)},null,8,["visible","x","y","bottom","px","py","quote","focus-on-open","focus-return-el","onAction","onClose"]),U(X2t,{class:"internal-build-fab"}),ye.value?(k(),de(p(xot),{key:5,models:p(i).models.value,current:p(i).status.value.modelId,"starred-ids":p(i).starredModelIds.value,loading:gt.value,unavailable:_t.value,onSelect:xe[59]||(xe[59]=Pe=>Fe(Pe)),onToggleStar:xe[60]||(xe[60]=Pe=>p(i).toggleStarModel(Pe)),onClose:xe[61]||(xe[61]=Pe=>ye.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ee("",!0),U(p($P),{closable:"",onClose:xe[69]||(xe[69]=Pe=>ne.value=!1)},{default:ce(()=>[ne.value?(k(),de(Sgt,{key:0,"color-scheme":p(i).colorScheme.value,"font-scale":p(i).fontScale.value,"managed-provider-status":p(i).managedProviderStatus.value,"managed-user-info":p(i).managedUserInfo.value,"on-fetch-usage":p(i).getUsage,notify:p(i).notifyEnabled.value,"notify-permission":p(i).notifyPermission.value,"notify-sound":p(i).notifySound.value,config:p(i).config.value,models:p(i).models.value,"config-saving":Pt.value,"server-version":p(i).serverVersion.value,backend:p(i).backend.value,"experimental-flags":p(i).experimentalFlags.value,"initial-tab":ci.value,onSetColorScheme:xe[62]||(xe[62]=Pe=>p(i).setColorScheme(Pe)),onSetFontScale:xe[63]||(xe[63]=Pe=>p(i).setFontScale(Pe)),onSetNotify:xe[64]||(xe[64]=Pe=>p(i).setNotifyEnabled(Pe)),onSetNotifySound:xe[65]||(xe[65]=Pe=>p(i).setNotifySound(Pe)),onUpdateConfig:xe[66]||(xe[66]=Pe=>Uo(Pe)),onLogin:xe[67]||(xe[67]=()=>{ne.value=!1,jt()}),onLogout:Te,onClose:xe[68]||(xe[68]=Pe=>{ne.value=!1,ci.value=void 0})},null,8,["color-scheme","font-scale","managed-provider-status","managed-user-info","on-fetch-usage","notify","notify-permission","notify-sound","config","models","config-saving","server-version","backend","experimental-flags","initial-tab"])):ee("",!0)]),_:1}),pe.value?(k(),de(p(Het),{key:6,status:p(i).status.value,thinking:C.value,model:w.value,"plan-mode":p(i).planMode.value,"swarm-mode":p(i).swarmMode.value,"cost-usd":p(i).sessionCost.value,onClose:xe[70]||(xe[70]=Pe=>pe.value=!1),onSetThinking:xe[71]||(xe[71]=Pe=>p(i).setThinking(Pe))},null,8,["status","thinking","model","plan-mode","swarm-mode","cost-usd"])):ee("",!0),_e.value?(k(),de(p(Cnt),{key:7,"browse-fs":p(i).browseFs,"get-fs-home":p(i).getFsHome,"default-path":p(i).visibleWorkspace.value?.root??p(i).status.value.cwd,error:ze.value,onAdd:xe[72]||(xe[72]=Pe=>Ns(Pe)),onClose:Ws},null,8,["browse-fs","get-fs-home","default-path","error"])):ee("",!0),U(ko,{name:"gload-fade"},{default:ce(()=>[p(i).initialized.value?ee("",!0):(k(),de(p(ROe),{key:0,issue:p(i).connectIssue.value},null,8,["issue"]))]),_:1}),U(p(wqe),{warnings:p(i).warnings.value,onDismiss:p(i).dismissWarning},null,8,["warnings","onDismiss"]),(k(),de(cs,{to:"body"},[U(ko,{name:"action-toast"},{default:ce(()=>[rt.value?(k(),de(p(wne),{key:rt.value.key,duration:rt.value.kind==="export"?rt.value.state==="running"?6e4:4e3:rt.value.kind==="attachmentOpen"?4e3:8e3,"dismiss-token":rt.value.key,onDismiss:ri},{default:ce(()=>[rt.value.kind==="archive"?(k(),L(De,{key:0},[p(ji)?(k(),L(De,{key:0},[$e(F(rt.value.reopen?p(s)("sidebar.reopenToastLead"):p(s)("sidebar.completeToastLead"))+" ",1),A("button",{type:"button",onClick:Gt},F(p(s)("sidebar.archiveToastUndo")),1)],64)):(k(),L(De,{key:1},[A("button",{type:"button",onClick:Gt},F(p(s)("sidebar.archiveToastUndo")),1),p(u)?ee("",!0):(k(),L(De,{key:0},[$e(F(p(s)("sidebar.archiveToastMid"))+" ",1),A("button",{type:"button",onClick:S},F(p(s)("sidebar.archiveToastSettings")),1),$e(" "+F(p(s)("sidebar.archiveToastTail")),1)],64))],64))],64)):rt.value.kind==="adminBatch"?(k(),L(De,{key:1},[$e(F(rt.value.plan.direction==="archive"?p(s)("admin.batchDoneToast",{n:rt.value.plan.succeeded}):p(s)("admin.batchReopenedToast",{n:rt.value.plan.succeeded})),1),rt.value.plan.failed>0?(k(),L(De,{key:0},[$e(F(p(s)("admin.batchFailedSuffix",{n:rt.value.plan.failed})),1)],64)):ee("",!0),A("button",{type:"button",onClick:en},F(p(s)("admin.undo")),1)],64)):rt.value.kind==="attachmentOpen"?(k(),L(De,{key:2},[$e(F(p(s)("composer.attachmentOpenUnsupported",{name:rt.value.name})),1)],64)):(k(),L(De,{key:3},[$e(F(rt.value.state==="running"?p(s)("commands.export.started"):p(s)("commands.export.done")),1)],64))]),_:1},8,["duration","dismiss-token"])):ee("",!0)]),_:1})])),p(a)?(k(),de(Z2t,{key:8})):ee("",!0),U(p(Dnt)),p(u)?(k(),de(Jgt,{key:9,modelValue:c.value,"onUpdate:modelValue":xe[73]||(xe[73]=Pe=>c.value=Pe),groups:p(i).mobileWorkspaceGroups.value,"flat-sessions":p(i).flatSessions.value,"pinned-sessions":p(i).pinnedSessions.value,"flat-has-more":p(i).flatSessionsHasMore.value,"flat-loading-more":p(i).flatSessionsLoadingMore.value,"active-workspace-id":p(i).activeWorkspaceId.value,"active-id":p(i).activeSessionId.value,"attention-by-session":p(i).attentionBySession.value,"attention-by-workspace":p(i).attentionByWorkspace.value,onSelect:xe[74]||(xe[74]=Pe=>p(i).selectSession(Pe)),onCreate:ks,onCreateInWorkspace:xe[75]||(xe[75]=Pe=>ro(Pe)),onAddWorkspace:xe[76]||(xe[76]=Pe=>_e.value=!0),onRename:xe[77]||(xe[77]=(Pe,rn)=>p(i).renameSession(Pe,rn)),onArchive:xe[78]||(xe[78]=Pe=>it(Pe)),onDeleteWorkspace:xe[79]||(xe[79]=Pe=>xi(Pe)),onLoadMore:xe[80]||(xe[80]=Pe=>void p(i).loadMoreSessions(Pe)),onEnsureFlatSessions:xe[81]||(xe[81]=Pe=>void p(i).ensureFlatSessions()),onLoadMoreFlatSessions:xe[82]||(xe[82]=Pe=>void p(i).loadMoreFlatSessions())},null,8,["modelValue","groups","flat-sessions","pinned-sessions","flat-has-more","flat-loading-more","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ee("",!0),p(u)?(k(),de(mvt,{key:10,modelValue:d.value,"onUpdate:modelValue":xe[83]||(xe[83]=Pe=>d.value=Pe),status:p(i).status.value,thinking:p(i).thinking.value,models:p(i).models.value,"plan-mode":p(i).planArmed.value||p(i).planMode.value,"goal-mode":p(i).goalMode.value,"goal-active":oe.value,"swarm-mode":p(i).swarmMode.value,"color-scheme":p(i).colorScheme.value,"font-scale":p(i).fontScale.value,"managed-provider-status":p(i).managedProviderStatus.value,"managed-user-info":p(i).managedUserInfo.value,"server-version":p(i).serverVersion.value,onPickModel:xe[84]||(xe[84]=Pe=>Ht()),onSetThinking:xe[85]||(xe[85]=Pe=>p(i).setThinking(Pe)),onTogglePlan:xe[86]||(xe[86]=Pe=>p(i).togglePlanMode()),onToggleGoal:xe[87]||(xe[87]=Pe=>p(i).toggleGoalMode()),onFocusGoal:le,onToggleSwarm:xe[88]||(xe[88]=Pe=>p(i).toggleSwarmMode()),onSetPermission:xe[89]||(xe[89]=Pe=>p(i).setPermission(Pe)),onSetColorScheme:xe[90]||(xe[90]=Pe=>p(i).setColorScheme(Pe)),onSetFontScale:xe[91]||(xe[91]=Pe=>p(i).setFontScale(Pe)),onLogin:xe[92]||(xe[92]=()=>{d.value=!1,jt()}),onLogout:Te},null,8,["modelValue","status","thinking","models","plan-mode","goal-mode","goal-active","swarm-mode","color-scheme","font-scale","managed-provider-status","managed-user-info","server-version"])):ee("",!0)],10,tyt),p(i).initialized.value&&T.value?(k(),de(y2t,{key:1,"auth-ready":p(i).managedProviderStatus.value==="authenticated","on-start-o-auth-login":ot,"on-poll-o-auth-login":Ue,"on-cancel-o-auth-login":st,"on-get-o-auth-region":_n,onComplete:N,onLoginSuccess:Zn,onAddProvider:I},null,8,["auth-ready"])):ee("",!0),Ae.value?(k(),de(apt,{key:2,"on-start-o-auth-login":ot,"on-poll-o-auth-login":Ue,"on-cancel-o-auth-login":st,"on-get-o-auth-region":_n,onSuccess:bt,onClose:xe[93]||(xe[93]=Pe=>Ae.value=!1)})):ee("",!0),z.value?(k(),de(p(CZ),{key:3,media:z.value,"origin-img":O.value,onClose:xe[94]||(xe[94]=Pe=>{z.value=null,O.value=null})},null,8,["media","origin-img"])):ee("",!0)]))}}),iyt=xt(nyt,[["__scopeId","data-v-db3fae69"]]);Gut();Wze({api:b1,t:(e,t)=>t===void 0?zh.global.t(e):zh.global.t(e,t),traceClientEvent:Kut,traceKeyEvent:(e,t)=>lv(e,t),sessionExportTraceToJsonl:Xut});const jv=M9(iyt).use(zh);jv.config.errorHandler=(e,t,n)=>Zut(e,n);jv.use(sm);const oyt={t:(e,t)=>zh.global.t(e,t)};jv.provide(TO,oyt);jv.provide(tO,e=>t$e(e)?.component);jv.mount("#app");if(Wh){const e=window.kimiDesktop;if(e){const t=()=>{const n=document.documentElement.dataset.colorScheme;e.setTheme(n==="light"||n==="dark"?n:"system")};new MutationObserver(t).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),t()}}export{ak as $,l$ as A,jQ as B,ls as C,Jyt as D,SR as E,De as F,Qd as G,$e as H,U as I,kQ as J,Ayt as K,wu as L,lt as M,vJ as N,Myt as O,Iyt as P,Lyt as Q,l9 as R,t1 as S,cs as T,Tyt as U,g6 as V,_yt as W,e9t as X,Eyt as Y,Kyt as Z,syt as _,XR as a,Po as a$,ps as a0,uv as a1,dyt as a2,s6 as a3,L$ as a4,Tn as a5,H1 as a6,NQ as a7,i9t as a8,kyt as a9,o$ as aA,nY as aB,s$ as aC,yn as aD,lY as aE,rY as aF,Gd as aG,sY as aH,Ln as aI,W1 as aJ,SQ as aK,k as aL,pJ as aM,myt as aN,ii as aO,HR as aP,pyt as aQ,f9 as aR,po as aS,u9 as aT,V as aU,jyt as aV,NJ as aW,Ct as aX,Un as aY,uY as aZ,xyt as a_,Cyt as aa,wyt as ab,byt as ac,Wyt as ad,o9t as ae,Jt as af,UY as ag,hk as ah,Mu as ai,wc as aj,Ao as ak,Hyt as al,Fl as am,Dd as an,Et as ao,Fyt as ap,Byt as aq,ui as ar,ht as as,QY as at,Re as au,VG as av,on as aw,tY as ax,oY as ay,ti as az,hyt as b,m2e as b$,Qyt as b0,g0 as b1,k9 as b2,Zyt as b3,Nd as b4,_h as b5,lyt as b6,Ka as b7,DQ as b8,Gyt as b9,ur as bA,Go as bB,VY as bC,Uyt as bD,We as bE,Jp as bF,vyt as bG,BQ as bH,$yt as bI,ce as bJ,Nyt as bK,ai as bL,Qo as bM,qyt as bN,Tt as bO,gyt as bP,$i as bQ,Yo as bR,u9t as bS,c9t as bT,hH as bU,d9t as bV,Bve as bW,fH as bX,kC as bY,m9t as bZ,y2e as b_,ryt as ba,F as bb,wy as bc,Syt as bd,wi as be,ayt as bf,bQ as bg,Ea as bh,zyt as bi,gQ as bj,p as bk,q1 as bl,n9t as bm,Xyt as bn,kJ as bo,HQ as bp,Oyt as bq,FQ as br,t9t as bs,Dyt as bt,yyt as bu,JR as bv,_9 as bw,MJ as bx,K$ as by,sw as bz,Vyt as c,S7 as c0,A7 as c1,x7 as c2,v9t as c3,s4 as c4,zp as c5,i4 as c6,d2e as c7,f2e as c8,y9t as c9,g9t as ca,r9t as cb,k9t as cc,Ok as cd,ol as ce,I2e as cf,M2e as cg,Ive as ch,a9t as ci,xve as cj,Sve as ck,l9t as cl,_7 as cm,T2e as cn,EL as co,cL as cp,$ve as cq,o4 as cr,n4 as cs,f9t as ct,p9t as cu,s9t as cv,h9t as cw,Pyt as d,wd as e,uyt as f,ko as g,U$ as h,cyt as i,fyt as j,ga as k,cv as l,Ts as m,ok as n,Cc as o,Yyt as p,D as q,M9 as r,de as s,ee as t,L as u,A as v,LY as w,Ryt as x,EY as y,DJ as z}; +`)}function Qut(){return Jf.join(` +`)}const gR=xn.clientId,Yut="kimi-code-web",Jut="web";function Xut(){return{serverHttpUrl:tct(),clientId:ict(),clientName:Yut,clientVersion:oct(),clientUiMode:Jut}}function ect(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function tct(){const e=UZ();return YA(e||void 0)}const vR="kimi-desktop-server-origin";function UZ(){if(typeof window>"u")return;const e=new URLSearchParams(window.location.search).get("kimi_origin");try{return e?(window.sessionStorage.setItem(vR,e),e):window.sessionStorage.getItem(vR)??void 0}catch{return e??void 0}}function YA(e){const t=e&&e.trim()?e:ect(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function yR(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function nct(){if(typeof window<"u"){const t=UZ();if(t)return yR(YA(t))}const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return yR(e)}function ict(){const e=ps(gR);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ds(gR,t),t}function oct(){return"0.38.0".trim()?"0.38.0":"0.0.0-dev"}const sct={restRequest:e=>Rut(e),restResponse:e=>Out(e),restFailure:e=>$ut(e),wsEvent:e=>{switch(e.kind){case"lifecycle":Put(e.event,e.detail);break;case"in":jut(e.frame);break;case"out":zut(e.frame);break}},traceKeyEvent:(e,t)=>rv(e,t)},rct={getToken:zse,markAuthRequired:qse},lct=(e,t)=>t===void 0?jh.global.t(e):jh.global.t(e,t);function act(){const e=Xut();return Nwe({origin:e.serverHttpUrl,identity:{clientId:e.clientId,clientName:e.clientName,clientVersion:e.clientVersion,clientUiMode:e.clientUiMode},tracer:sct,credentialStore:rct,t:lct})}const uct=act();function b1(){return uct}const cct={class:"cin-wrap"},dct=["onClick"],fct={class:"am-icon"},hct={class:"am-name"},pct={key:0,class:"am-desc"},mct={class:"input-row"},gct=["data-placeholder","data-empty","data-wm"],vct=["aria-label"],yct={class:"toolbar-left"},kct=["aria-label","onKeydown"],bct={class:"perm-pill-label"},wct=["onClick"],Cct={class:"pd-info"},Act={class:"pd-desc"},xct={class:"pd-check"},Sct={key:1,class:"swarm-chip"},_ct={class:"swarm-label"},Mct=["aria-label"],Ict=["aria-expanded","aria-label"],Tct={key:0,class:"think-suffix"},Ect=["aria-label"],Lct=["aria-label"],Nct=["aria-label"],Dct=["aria-label","disabled"],Fct={class:"md-list"},Bct={key:0,class:"md-section"},Rct=["onClick"],Oct={class:"md-check"},$ct={class:"md-name"},Pct={class:"md-provider"},zct={key:1,class:"md-divider"},jct={key:2,class:"md-section"},Hct=["onClick"],Wct={class:"md-check"},qct={class:"md-name"},Uct={key:0,class:"md-divider"},Vct={class:"md-thinking"},Kct={class:"md-name"},Zct={key:0,class:"md-note"},Gct={key:2,class:"md-note"},Qct={class:"md-cache-note"},Yct={class:"md-check md-more-icon"},Jct={class:"md-name"},Xct={key:0,class:"composer-footer"},edt={class:"drop-card"},tdt={class:"msheet-search"},ndt={class:"msheet-search"},idt=["onClick"],odt={class:"am-icon"},sdt={class:"am-name"},rdt={key:0,class:"am-desc"},z5=new Map,ldt=rt({__name:"Composer",props:{running:{type:Boolean,default:!1},working:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},authReady:{type:Boolean},managedSignedIn:{type:Boolean},managedMembership:{},starredIds:{default:()=>[]},skills:{default:()=>[]},skillsLoaded:{type:Boolean,default:!1},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","focusGoal","compact","pickModel","selectModel","login"],setup(e,{expose:t,emit:n}){const i=e,o=Lc(),s=D(()=>i.starting?a("composer.starting"):i.running?a(o.value?"composer.placeholderRunningMobile":"composer.placeholderRunning"):i.goalMode?a("status.goalPlaceholder"):i.planArmed||i.planMode?a("status.planPlaceholder"):a("composer.placeholder")),r=D(()=>fI(s.value)),l=n,{t:a,locale:u}=Ut(),c=Xa(),{text:d,editorRef:f,loadForEdit:h,clearDraft:m,loadDraftAttachments:g,saveDraftAttachments:v,saveDraft:y}=sPe({sessionId:()=>i.sessionId,onBeforeSessionSave:_e=>{T(_e)}}),b=V([]);let w=null;function C(){H.resetBrowsing(),w=null}function T(_e){for(;H.isBrowsing();)H.recallNewer();w!==null&&(y(_e,d.value),v(_e,w),_?.setText(d.value,{entries:w}),w=null)}function N(_e){b.value=_e,v(i.sessionId,_e)}function I(){v(i.sessionId,[])}const S=V(null);let _=null,x=null,E=null;kn(()=>{const _e=S.value;if(!_e)return;_=CIe(_e,{initialText:d.value,onChange:Ke=>{d.value=Ke,Te()},handleKeyDown:Ke=>fi(Ke),onBlur:Ht,onWorkModeDismiss:_l,onCompositionStart:Bo,onCompositionEnd:qn,attachments:{initialEntries:g(i.sessionId),onRegistryChange:N,onEntryDropped:Ke=>{Ke.previewUrl!==void 0&&URL.revokeObjectURL(Ke.previewUrl)}}}),_.setEditable(!i.starting),f.value=_,x=_V(()=>S.value),p0(()=>{_?.setWorkMode(ho.value?{mode:ho.value,label:ho.value==="goal"?a("status.goalLabel"):a("status.planLabel"),dismissLabel:a("status.workModeDismiss")}:null)});function at(Ke){if(_){if(_.restoreState(Ke)){const bt=_.getText();bt!==d.value&&(d.value=bt)}else _.setText(d.value,{entries:g(Ke)});b.value=_.getAttachmentEntries(),Lt(),E?.(),E=c5(Ke,_)}}i.sessionId?at(i.sessionId):E=c5(ad,_),b.value=_.getAttachmentEntries(),Lt(),Ue(),We(()=>i.sessionId,(Ke,bt)=>{!_||Ke===bt||(bt&&_.stashState(bt),Ke?at(Ke):(E?.(),E=c5(ad,_),_.setText(d.value,{entries:g(void 0)}),b.value=_.getAttachmentEntries(),Lt()),Ue())}),We(d,Ke=>{if(_&&Ke!==_.getText()){const bt=Vt;Vt=null,_.setText(Ke,{entries:bt!==null?qt(_.getAttachmentEntries(),bt):_.getAttachmentEntries()})}}),We(b,()=>{const Ke=i.sessionId;for(const bt of b.value)bt.sessionId!==void 0&&bt.sessionId!==Ke&&bt.error===void 0&&_?.updateAttachmentEntry(bt.attId,{error:"upload-interrupted"})},{deep:!0}),We(()=>i.starting,Ke=>_?.setEditable(!Ke)),p0(()=>{const Ke=_?.dom;if(!Ke)return;Ke.setAttribute("aria-label",fI(s.value)),Ke.setAttribute("aria-expanded",String(!!se.value));const bt=se.value;bt?Ke.setAttribute("aria-controls",bt):Ke.removeAttribute("aria-controls");const Jt=pe.value;Jt?Ke.setAttribute("aria-activedescendant",Jt):Ke.removeAttribute("aria-activedescendant")})}),Ln(()=>{T(i.sessionId),_&&i.sessionId&&(d.value!==_.getText()&&_.setText(d.value,{entries:_.getAttachmentEntries()}),_.stashState(i.sessionId)),E?.(),E=null,x?.(),_?.destroy(),_=null,f.value=null});const M=V(!1);function R(){M.value=!M.value,ft(()=>{P(),_?.focus()})}function q(){M.value&&(M.value=!1,ft(P))}const z=36;function $(_e){if(typeof getComputedStyle>"u")return z;const at=Number.parseFloat(getComputedStyle(_e).minHeight);return Number.isFinite(at)&&at>0?at:z}const B=V(!1);function P(){const _e=S.value;B.value=!!_e&&_e.scrollHeight>$(_e)}We(d,()=>{ft(P)});const H=uPe({text:d,editorRef:f,sessionId:()=>i.sessionId});function j(){bo.value||(i.goalMode&&l("toggleGoal"),l("togglePlan"))}function G(){if(bs.value){l("focusGoal");return}i.goalMode||(bo.value&&l("togglePlan"),l("toggleGoal"))}const{open:ne,items:W,ranges:Q,active:te,update:X,select:ve}=cPe({text:d,editorRef:f,skills:()=>i.skills,emitCommand:_e=>{if(_e==="/plan"){j();return}if(_e==="/goal"){G();return}if(_e==="/swarm"){Sl.value||l("toggleSwarm");return}l("command",{cmd:_e,attachments:[]})},historyPush:_e=>H.push(_e),clearDraft:m,resolveDesc:_e=>_e.isSkill?_e.desc:a(_e.desc)}),ce=D(()=>d.value.startsWith("/")&&!d.value.includes(" ")?d.value.slice(1):""),se=D(()=>{if(ne.value)return"composer-slash-menu";if(Z.value)return"composer-mention-menu"}),pe=D(()=>{if(ne.value&&W.value.length>0)return`composer-slash-option-${te.value}`;if(Z.value&&ae.value.length>0)return`composer-mention-option-${K.value}`}),{open:Z,items:ae,active:K,loading:re,fileStale:we,update:be,close:ke,select:oe,navigate:le,getToken:ye}=pPe({text:d,editorRef:f,searchFiles:()=>i.searchFiles,skills:()=>i.skills,insertMention:(_e,at)=>{_?.insertMention(_e.kind==="skill"?{kind:"skill",name:_e.name,path:""}:{kind:_e.kind,name:_e.name,path:_e.path},at)}}),Ae=D({get:()=>ce.value,set:_e=>{d.value=`/${_e}`,X()}}),Me=V(null),fe=V("");We(fe,_e=>{const at=Me.value;if(at==null||!Z.value)return;const Ke=d.value,Jt=Ke.slice(at+1).search(/\s/),gn=Jt===-1?Ke.length:at+1+Jt;d.value=`${Ke.slice(0,at)}@${_e}${Ke.slice(gn)}`,ft(()=>{const En=f.value,Vn=at+1+_e.length;En?.setSelectionRange(Vn,Vn),be()})});const ie=V(null),Ee=V(null);We(ne,_e=>{_e&&o.value&&ft(()=>ie.value?.focus())}),We(Z,_e=>{if(_e&&o.value){const at=ye();Me.value=at?.start??null,fe.value=at?.token??"",ft(()=>Ee.value?.focus())}else Me.value=null});function qe(){ne.value=!1}function ze(){ke()}function ht(){wt()}const gt=V(null),_t=V(null),$t=D(()=>gt.value?.el??null),jt=D(()=>_t.value?.el??null);ld(ne,$t),ld(Z,jt),We(()=>i.sessionId,()=>{M.value=!1,ne.value=!1,ke()});function Ht(){o.value||(ne.value=!1,ke())}function Te(){C(),X(),be(),(ne.value||Z.value||Mi.value)&&wt()}function Fe(_e){const at=_;if(C(),!at)return;let Ke=document.activeElement===at.dom?at.selectionStart??void 0:at.getText().length;for(const bt of _e){const Jt=NPe(b.value,bt);at.insertAttachment({attId:Jt.attId,name:Jt.name,kind:"folder"},Ke),Ke=void 0,Jt.entry&&at.upsertAttachmentEntry(Jt.entry)}ne.value=!1,ke()}function Ve(_e,at,Ke,bt,Jt){const gn=`${Ke??ad} ${bt}`,En=(z5.get(gn)??0)+1;z5.set(gn,En);const Vn=()=>z5.get(gn)===En;let pn=-1,eo=0;Jt(_e,at,(Zs,Ia)=>{if(!Vn()||Ia<=0)return;const ta=Math.floor(Zs/Ia*100),Jr=Date.now();ta!==pn&&(Zs{Vn()&&un(Ke,bt,Zs?{fileId:Zs.fileId,mediaType:Zs.mediaType,uploading:!1,error:void 0,uploadProgress:void 0}:{uploading:!1,error:"upload-failed",uploadProgress:void 0})}).catch(()=>{Vn()&&un(Ke,bt,{uploading:!1,error:"upload-failed",uploadProgress:void 0})})}function lt(_e,at,Ke){const bt=_,Jt=i.uploadImage;if(!bt||!Jt)return!1;const gn=iK(_e.type);let En;Ke?En=bt.textOffsetAtCoords({left:Ke.clientX,top:Ke.clientY})??bt.getText().length:En=document.activeElement===bt.dom?bt.selectionStart??void 0:bt.getText().length;const Vn=LPe(b.value,{name:_e.name,size:_e.size,path:at,mediaType:_e.type||void 0,lastModified:_e.lastModified||void 0,kind:gn}),pn=gn!=="file"?URL.createObjectURL(_e):void 0;if(Vn.entry)bt.insertAttachment({attId:Vn.attId,name:_e.name,kind:gn},En),bt.upsertAttachmentEntry(pn!==void 0?{...Vn.entry,previewUrl:pn}:Vn.entry);else if(Vn.startUpload){const eo=b.value.find(Cs=>Cs.attId===Vn.attId);bt.upsertAttachmentEntry({...eo,key:eo.path!==void 0?eo.key:`blob:${Vn.attId}`,uploading:!0,error:void 0,uploadProgress:void 0,sessionId:void 0,size:_e.size,mediaType:_e.type||void 0,lastModified:_e.lastModified||void 0,...pn!==void 0?{previewUrl:pn}:{}})}else bt.insertAttachment({attId:Vn.attId,name:_e.name,kind:gn},En),pn!==void 0&&URL.revokeObjectURL(pn);return Vn.startUpload&&Ve(_e,_e.name,i.sessionId,Vn.attId,Jt),!0}const Ft=new Set;function Lt(){const _e=b1();for(const at of b.value){if(at.kind!=="image"||at.fileId===void 0||at.previewUrl!==void 0)continue;const{attId:Ke,fileId:bt,sessionId:Jt}=at,gn=`${Jt??""} ${Ke} ${bt}`;if(Ft.has(gn))continue;Ft.add(gn),(Jt!==void 0?_e.getSessionMediaBlob(Jt,bt):_e.getFileBlob(bt)).then(Vn=>{if(_===null)return;const pn=b.value.find(eo=>eo.attId===Ke);pn===void 0||pn.fileId!==bt||pn.sessionId!==Jt||pn.previewUrl!==void 0||_.updateAttachmentEntry(Ke,{previewUrl:URL.createObjectURL(Vn)})}).catch(()=>{}).finally(()=>{Ft.delete(gn)})}}let Vt=null;function qt(_e,at){const Ke=new Set(at.map(bt=>bt.attId));return[..._e.filter(bt=>!Ke.has(bt.attId)),...at]}function nn(_e,at){const Ke=_e.startsWith("m"),bt=Number(Ke?_e.slice(1):_e);if(!Number.isInteger(bt)||bt<1)return;let Jt=0;for(let gn=0;gn0&&!/\s/.test(gn.charAt(Jt-1))&&(Ke.insertTextAt(Jt," "),Jt+=1)}Ke.insertAttachment({attId:bt,name:_e.name??"file",kind:"file"},Jt),Ke.upsertAttachmentEntry({attId:bt,key:f1({kind:"file",attId:bt}),kind:"file",name:_e.name??"file",size:_e.size,mediaType:_e.mediaType,refCount:0,uploading:!1,fileId:_e.fileId})}function dt(_e,at){const Ke=_;if(!_e.fileId||!Ke)return;H.resetBrowsing();let bt;if(at!==void 0)Ke.insertTextAt(at," "),bt=at;else{const En=Ke.getText();bt=En.length,bt>0&&!/\s/.test(En.charAt(bt-1))&&(Ke.insertTextAt(bt," "),bt+=1)}const Jt=Nu(),gn=_e.kind==="video"?"video":"image";Ke.insertAttachment({attId:Jt,name:_e.name??gn,kind:gn},bt),Ke.upsertAttachmentEntry({attId:Jt,key:f1({kind:gn,attId:Jt}),kind:gn,name:_e.name??gn,size:_e.size,mediaType:_e.mediaType,refCount:0,uploading:!1,fileId:_e.fileId,sessionId:_e.sessionId}),Lt()}function At(_e,at){const Ke=_,bt=i.uploadImage;if(_e.url===""||!Ke||!bt)return;H.resetBrowsing();const Jt=i.sessionId;let gn;if(at!==void 0)Ke.insertTextAt(at," "),gn=at;else{const pn=Ke.getText();gn=pn.length,gn>0&&!/\s/.test(pn.charAt(gn-1))&&(Ke.insertTextAt(gn," "),gn+=1)}const En=Nu(),Vn=_e.kind==="video"?"video":"image";Ke.insertAttachment({attId:En,name:_e.name??Vn,kind:Vn},gn),Ke.upsertAttachmentEntry({attId:En,key:f1({kind:Vn,attId:En}),kind:Vn,name:_e.name??Vn,size:_e.size,mediaType:_e.mediaType,refCount:0,uploading:!0}),fetch(_e.url).then(pn=>pn.ok?pn.blob():Promise.reject(new Error(`media fetch ${pn.status}`))).then(pn=>{if(i.sessionId!==Jt){un(Jt,En,{uploading:!1,error:"upload-interrupted"});return}const eo=SV(Jt??ad);if(eo!==void 0){const Cs=eo.getAttachmentEntries().find(Zs=>Zs.attId===En);if(Cs===void 0||Cs.uploading!==!0)return;eo.updateAttachmentEntry(En,{size:pn.size||_e.size,mediaType:_e.mediaType||pn.type||void 0,previewUrl:URL.createObjectURL(pn)})}Ve(pn,_e.name??Vn,Jt,En,bt)}).catch(()=>{un(Jt,En,{uploading:!1,error:"upload-interrupted"})})}function un(_e,at,Ke){vIe(_e??ad,at,Ke,{loadEntries:()=>g(_e),saveEntries:bt=>v(_e,bt)}),w!==null&&(w=BPe(w,at,Ke))}const{fileInputRef:Qt,isDragOver:ei,openFilePicker:mi,handleFileInputChange:Hi,handleDragOver:wi,handleDragLeave:Vo,handleDrop:ot,adoptStoredDrafts:Ue}=PPe({api:b1(),uploadImage:()=>i.uploadImage,sessionId:()=>i.sessionId,insertFolderPaths:Fe,insertFileAttachment:lt,adoptFileAttachment:it,adoptMediaAttachment:dt});kn(()=>{d.value&&ft(P)}),Ln(()=>{Ir()});function st(){_?.focus({preventScroll:!0})}function In(_e,at,Ke){_?.insertQuote({text:_e,...Ke!==void 0&&Ke.length>0?{source:Ke}:{}},at)}function kt(_e){const at=RPe(_e);Vt=at,ft(()=>{const Ke=Vt;Vt=null;const bt=_;if(!bt)return;Ke!==null&&bt.setText(d.value,{entries:qt(bt.getAttachmentEntries(),Ke)});const Jt=new Set(bt.getOrderedAttachmentIds()),gn=new Map(al(bt.getText()).map(pn=>[pn.attrs.attId,pn.attrs.name]));for(const pn of at)Jt.has(pn.attId)&&bt.upsertAttachmentEntry(gn.has(pn.attId)?{...pn,name:gn.get(pn.attId)}:pn);Lt();const En=new Map(OPe(_e,Jt).map(({att:pn,ordinal:eo})=>[pn,eo])),Vn=new Set($Pe(_e,Jt).map(({att:pn})=>pn));for(const pn of _e){const eo=En.get(pn);if(eo!==void 0){const Ia=al(bt.getText()).find(ta=>{const Jr=Number(ta.attrs.attId);return Number.isInteger(Jr)&&Jr>eo});it(pn,Ia?.start);continue}if(!Vn.has(pn))continue;const Cs=_e.indexOf(pn),Zs=al(bt.getText()).find(Ia=>{const ta=nn(Ia.attrs.attId,_e);return ta!==void 0&&ta>Cs});if(pn.fileId!==void 0){dt(pn,Zs?.start);continue}At(pn,Zs?.start)}})}function ui(_e){Vt=_e,ft(()=>{const at=Vt;Vt=null;const Ke=_;if(!Ke)return;at!==null&&Ke.setText(d.value,{entries:qt(Ke.getAttachmentEntries(),at)});const bt=new Set(Ke.getOrderedAttachmentIds());for(const Jt of _e)bt.has(Jt.attId)&&Ke.upsertAttachmentEntry(Jt);Lt()})}const _o=D(()=>(d.value,FPe(b.value,_?.getOrderedAttachmentIds()??[],{sessionId:i.sessionId})));function co(){const _e=DPe(_?.getOrderedAttachmentIds()??[],b.value,{sessionId:i.sessionId});return{promptAttachments:_e.promptAttachments,fileAttIds:_e.fileAttIds,mediaAttIds:_e.mediaAttIds}}function Ns(_e,at){return cSe(_e,at,{resolveFolder:Ke=>b.value.find(bt=>bt.attId===Ke)?.path})}function Ds(){const _e=_;if(!_e)return()=>{};const at=new Map(b.value.map(bt=>[bt.attId,bt])),Ke=al(_e.getText()).map(bt=>bt.attrs.attId);return Ke.length===0?()=>{}:()=>{ft(()=>{const bt=_;if(!bt)return;const Jt=new Set;for(const gn of Ke){const En=at.get(gn);En!==void 0&&(bt.insertAttachment({attId:En.attId,name:En.name,kind:En.kind}),Jt.has(gn)||(bt.upsertAttachmentEntry(En),Jt.add(gn)))}})}}function Fs(){const _e=_;if(!_e)return;const at=new Map(b.value.map(En=>[En.attId,En])),Ke=al(_e.getText()).map(En=>En.attrs.attId),bt=[],Jt=new Set,gn=[];for(const En of Ke){const Vn=at.get(En);Vn!==void 0&&(Jt.has(En)||(bt.push(Vn),Jt.add(En)),gn.push(Ud({attId:Vn.attId,name:Vn.name,kind:Vn.kind})))}gn.length!==0&&(v(i.sessionId,bt),d.value=gn.join(" "))}function Fo(){const _e=d.value.trim(),at=co();return vQe({text:_e,rewritten:Ns(_e,at),blocked:_o.value.uploading||_o.value.errored||_o.value.missing,assembly:at,skillMentions:_?.getSkillMentions()??[],skills:i.skills,skillsLoaded:i.skillsLoaded,working:i.working,running:i.running,queueLength:i.queued.length,goalMode:i.goalMode})}const Ei=D(()=>Fo().kind!=="noop");function ur(){const _e=Fo();if(_e.kind!=="noop"){if(_e.kind==="invalid-command"){c.notify({severity:"warning",title:a("composer.noArgCommand",{cmd:_e.cmd})});return}switch(H.push(_e.historyText),w=null,_e.kind){case"mode":{const at=Ds();d.value="",m(),ne.value=!1,q(),_e.mode==="plan"?j():_e.mode==="goal"?G():Sl.value||l("toggleSwarm"),at();return}case"skill-activation":case"skill-command":case"unresolved-skill-command":{d.value="",m(),I(),ne.value=!1,q(),ke(),_e.kind==="skill-activation"?l("command",{cmd:_e.cmd,attachments:_e.attachments,restoreText:_e.restoreText,skillName:_e.skillName,restoreEntries:b.value}):_e.kind==="skill-command"?l("command",{cmd:_e.cmd,attachments:_e.attachments,restoreText:_e.restoreText,skillName:_e.skillName,restoreEntries:b.value}):l("command",{cmd:_e.cmd,attachments:_e.attachments,restoreText:_e.restoreText,restoreEntries:b.value});return}case"builtin-command":{if(d.value="",m(),ne.value=!1,q(),_e.leave){Fs(),l("command",{cmd:_e.cmd,attachments:[],restoreText:_e.restoreText,restoreEntries:b.value});return}Ds()(),l("command",{cmd:_e.cmd,attachments:[],restoreText:_e.restoreText,restoreEntries:b.value,editText:_e.editText});return}case"submit":{d.value="",m(),I(),ne.value=!1,ke(),q(),l("submit",{text:_e.text,restoreText:_e.restoreText,editText:_e.editText,attachments:_e.attachments,restoreEntries:b.value});return}}}}function Mo(){if(!i.running||_o.value.uploading||_o.value.errored||_o.value.missing)return;const _e=d.value.trim(),at=co();if(!_e&&at.promptAttachments.length===0&&i.queued.length===0)return;const Ke={text:Bp(Ns(_e,at)).trim(),attachments:at.promptAttachments};H.push(gQe(_e)),w=null,d.value="",m(),I(),ne.value=!1,ke(),q(),l("steer",Ke)}let go=!1,fo=null;function Ir(){fo!==null&&(clearTimeout(fo),fo=null)}function Bo(){Ir(),go=!0}function qn(){Ir(),fo=setTimeout(()=>{fo=null,go=!1},0)}function to(_e){return go||_e.isComposing||_e.keyCode===229}function fi(_e){if(to(_e))return!1;if(ho.value&&_e.key==="Backspace"&&!_e.shiftKey&&!_e.altKey&&!_e.metaKey&&!_e.ctrlKey){const Ke=f.value;if(Ke?.selectionStart===0&&Ke.selectionEnd===0)return _e.preventDefault(),_l(),!0}if(_e.key==="Escape"){if(Mi.value)return _e.preventDefault(),wt(),!0;if(ri.value)return _e.preventDefault(),vs(),!0;if(Li.value)return _e.preventDefault(),Je(),!0}if(ne.value){if(_e.key==="Escape")return _e.preventDefault(),ne.value=!1,!0;if(_e.key==="Tab"&&W.value.length===0)return ne.value=!1,!1}if(ne.value&&W.value.length>0){if(_e.key==="ArrowDown")return _e.preventDefault(),te.value=(te.value+1)%W.value.length,!0;if(_e.key==="ArrowUp")return _e.preventDefault(),te.value=(te.value-1+W.value.length)%W.value.length,!0;if(_e.key==="Enter"||_e.key==="Tab"){_e.preventDefault();const Ke=W.value[te.value];return Ke&&ve(Ke),!0}}if(Z.value){if(_e.key==="Escape")return _e.preventDefault(),ke(),!0;if(_e.key==="Tab"&&ae.value.length===0)return ke(),!1;if(ae.value.length>0){if(_e.key==="ArrowDown")return _e.preventDefault(),le((K.value+1)%ae.value.length),!0;if(_e.key==="ArrowUp")return _e.preventDefault(),le((K.value-1+ae.value.length)%ae.value.length),!0;if(_e.key==="Enter"||_e.key==="Tab"){_e.preventDefault();const Ke=ae.value[K.value];return Ke&&oe(Ke),!0}}}if(_e.key==="s"&&(_e.ctrlKey||_e.metaKey)&&!_e.shiftKey&&!_e.altKey)return _e.preventDefault(),i.running&&Mo(),!0;const at=ne.value&&W.value.length>0;if(!M.value&&!at&&!Z.value&&!_e.shiftKey&&!_e.altKey&&!_e.metaKey&&!_e.ctrlKey){const Ke=H.isBrowsing();if(_e.key==="ArrowUp"&&H.canRecallOlder())return _e.preventDefault(),Ke||(w=b.value.map(bt=>{const{previewUrl:Jt,...gn}=bt;return gn})),H.recallOlder(),ne.value=!1,!0;if(_e.key==="ArrowDown"&&Ke){if(_e.preventDefault(),H.recallNewer(),ne.value=!1,!H.isBrowsing()){const bt=w;w=null,bt!==null&&bt.length>0&&ft(()=>{const Jt=_;if(!Jt)return;const gn=new Set(Jt.getOrderedAttachmentIds());for(const En of bt)gn.has(En.attId)&&Jt.upsertAttachmentEntry(En);Lt()})}return!0}}return _e.key==="Enter"&&_e.shiftKey&&!_e.metaKey&&!_e.ctrlKey&&!_e.altKey?(_e.preventDefault(),Zi(),!0):_e.key==="Enter"&&!_e.shiftKey&&!_e.altKey&&(_e.metaKey||_e.ctrlKey||!M.value)?(_e.preventDefault(),ur(),!0):!1}function Zi(){if(!_){d.value+=` +`,Te();return}_.insertNewlineAtCaret()}const no=D(()=>a("composer.send")),Ko=D(()=>!!i.uploadImage),ri=V(!1),Li=V(!1),Mi=V(!1),Ni=V(null),_n=V(null),gs=V(null),qs=V(null),Xo=V(null),Us=V(null);ld(Mi,_n),ld(Li,Xo);const vo=V(null),Ji=V(null);let Oi=null;function $i(){const _e=vo.value;if(!_e)return;const{scrollTop:at,scrollHeight:Ke,clientHeight:bt}=_e;if(Ke<=bt+1){Ji.value=null;return}const Jt=getComputedStyle(_e),gn=parseFloat(Jt.getPropertyValue("--menu-scrollbar-track-inset"))||0,En=parseFloat(Jt.getPropertyValue("--menu-scrollbar-thumb-min"))||24,Vn=bt-gn*2,pn=Math.max(En,bt/Ke*Vn),eo=Ke-bt,Cs=_e.offsetTop+gn+at/eo*(Vn-pn);Ji.value={top:Cs,height:pn}}function je(){$i()}We(Mi,async _e=>{Oi?.disconnect(),Oi=null,Ji.value=null,_e&&(await ft(),$i(),typeof ResizeObserver=="function"&&vo.value&&(Oi=new ResizeObserver($i),Oi.observe(vo.value)))}),Ln(()=>{Oi?.disconnect(),Oi=null});const Se=V(""),Pe=V(""),on=V(!1),Zn=D(()=>{const _e={};return Se.value&&(_e.right=Se.value),Pe.value&&(_e.maxHeight=Pe.value),_e}),Gn=D(()=>ri.value||Li.value||Mi.value||ne.value||Z.value);t({loadForEdit:h,insertQuote:In,loadAttachmentsForEdit:kt,restoreDraftEntries:ui,focus:st,anyPopupOpen:Gn,isEmpty:()=>d.value.trim().length===0&&b.value.length===0});function ti(){ri.value=!ri.value,ri.value?(Y(),Li.value=!1,Mi.value=!1,document.addEventListener("click",ko,!0)):document.removeEventListener("click",ko,!0)}function vs(){ri.value=!1,!Li.value&&!Mi.value&&document.removeEventListener("click",ko,!0)}function ys(){Li.value=!Li.value,Li.value?(ju(),ri.value=!1,Mi.value=!1,document.addEventListener("click",ko,!0)):document.removeEventListener("click",ko,!0)}function Je(){Li.value=!1,!ri.value&&!Mi.value&&document.removeEventListener("click",ko,!0)}function Ye(){Mi.value=!Mi.value,Mi.value?(ri.value=!1,Li.value=!1,ne.value=!1,ke(),document.addEventListener("click",ko,!0),ft(()=>{(o.value?gs.value:_n.value)?.querySelector(".am-row")?.focus()})):document.removeEventListener("click",ko,!0)}function wt(){Mi.value=!1,!ri.value&&!Li.value&&document.removeEventListener("click",ko,!0)}const Bt=D(()=>{const _e=[];return Ko.value&&_e.push({id:"files",icon:"attachment",nameKey:"composer.addFiles",descKey:"composer.addFilesDesc",action:Ro}),o.value&&(_e.push({id:"slash",icon:"terminal",nameKey:"composer.addSlash",descKey:"composer.addSlashDesc",action:ni}),_e.push({id:"mention",icon:"link",nameKey:"composer.addMention",descKey:"composer.addMentionDesc",action:Oo})),_e.push({id:"goal",icon:"target",nameKey:"status.goalLabel",descKey:"composer.addGoalDesc",action:gi}),_e.push({id:"plan",icon:"file-edit",nameKey:"status.planLabel",descKey:"composer.addPlanDesc",action:cr}),_e.push({id:"swarm",icon:"sparkles",nameKey:"status.swarmLabel",descKey:"composer.addSwarmDesc",action:$o}),_e});function Bn(_e){_e.action(),!(o.value&&_e.id==="files")&&st()}function ci(_e){if(_e.key==="Escape"){_e.preventDefault(),wt(),st();return}if(_e.key==="Tab"){wt();return}if(_e.key!=="ArrowDown"&&_e.key!=="ArrowUp")return;_e.preventDefault();const at=o.value?gs.value:_n.value,Ke=Array.from(at?.querySelectorAll(".am-row")??[]);if(Ke.length===0)return;const bt=Ke.indexOf(document.activeElement),Jt=_e.key==="ArrowDown"?(bt+1)%Ke.length:(bt-1+Ke.length)%Ke.length;Ke[Jt]?.focus()}function Ro(){wt(),mi()}function yo(_e){wt(),d.value=_e,ft(()=>{const at=f.value,Ke=d.value.length;at?.setSelectionRange(Ke,Ke),_e==="/"?X():be()})}function ni(){yo("/")}function Oo(){yo("@")}function gi(){wt(),i.goalMode||G()}function cr(){wt(),bo.value||j()}function $o(){wt(),Sl.value||l("toggleSwarm")}function ko(_e){const at=_e.target,Ke=Ni.value?.contains(at)??!1,bt=_n.value?.contains(at)??!1;!Ke&&!bt&&(vs(),Je(),wt())}Ln(()=>{document.removeEventListener("click",ko,!0)});const Bs=D(()=>{const _e=i.status?.ctxMax??0;return _e<=0?0:Math.min(100,Math.max(0,Math.ceil((i.status?.ctxUsed??0)/_e*100)))}),Vs=D(()=>{const _e=xc(i.status?.ctxUsed??0),at=xc(i.status?.ctxMax??0);return a("status.ctxTooltip",{used:_e,max:at,pct:Bs.value})}),ks=D(()=>Bs.value>=80),Al=D(()=>i.models?.find(_e=>_e.id===i.status?.modelId)),Yr=D(()=>K1(Al.value)),Zl=D(()=>Z1(Al.value)),_a=D(()=>_6(Al.value,i.thinking)),Gl=D(()=>Zl.value.includes(_a.value)?_a.value:""),Zo=D(()=>Moe(_a.value)),Tr=D(()=>Yr.value==="unsupported"||Zl.value.length<=1),dr=D(()=>{if(!Zo.value)return"";const _e=(Al.value?.supportEfforts?.length??0)>0,at=_a.value;return _e&&at!=="on"?a("composer.thinkingSuffixEffort",{level:at}):a("composer.thinkingSuffix")});function tu(_e){Tr.value||l("setThinking",bk(Al.value,_e))}const xl=D(()=>Zl.value.map(_e=>({value:_e,label:Bd(_e)}))),bo=D(()=>i.planArmed===!0||i.planMode===!0),Sl=D(()=>i.swarmMode===!0),Rs=D(()=>i.goal?.status??i.activationBadges?.goal?.status??null),bs=D(()=>Rs.value!==null&&Rs.value!=="complete"),ho=D(()=>i.goalMode?"goal":i.planArmed?"plan":null);function _l(){ho.value==="goal"?l("toggleGoal"):ho.value==="plan"&&l("togglePlan")}const Ml=[{mode:"manual",icon:"hand",color:"var(--color-text)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",icon:"shield-question",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",icon:"full-access",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Ql=V(null),Il=V(""),fr=V("");function nu(_e){const at={};return _e&&(at["--composer-menu-desc-width"]=_e),at}const Yl=D(()=>({...nu(Il.value),...fr.value?{left:fr.value}:{}}));function ju(){const _e=qs.value,at=Ni.value;if(!_e||!at){fr.value="";return}fr.value=`${Math.round(_e.getBoundingClientRect().left-at.getBoundingClientRect().left)}px`}function Y(){const _e=Us.value,at=Ni.value;if(!_e||!at){Se.value="";return}Se.value=`${Math.round(at.getBoundingClientRect().right-_e.getBoundingClientRect().right)}px`}let ge=null;function Be(_e){const at=Number.parseFloat(_e);return Number.isFinite(at)?at:0}function He(_e){return`${_e.fontStyle||"normal"} ${_e.fontWeight||"400"} ${_e.fontSize} ${_e.fontFamily}`}function Qe(_e){return _e.letterSpacing==="normal"?0:Be(_e.letterSpacing)}function Xe(_e,at){if(!_e)return 0;const Ke=rut(_e,He(at),{letterSpacing:Qe(at)});return lut(Ke)}function yt(){const _e=Ql.value?.querySelector(".pd-desc");if(!_e)return;const at=getComputedStyle(_e),Ke=Math.max(0,...Ml.map(bt=>Xe(a(bt.descKey),at)));Il.value=Ke>0?`${Math.ceil(Ke)}px`:""}function Rt(){typeof window>"u"||(ge!==null&&window.cancelAnimationFrame(ge),ft(()=>{ge=window.requestAnimationFrame(()=>{ge=null,yt()})}))}We(u,()=>{Rt(),ne.value&&X()},{immediate:!0}),kn(()=>{Rt(),document.fonts?.ready.then(Rt)}),Ln(()=>{ge!==null&&(window.cancelAnimationFrame(ge),ge=null)});function Kt(_e){l("setPermission",_e),Je()}const wn=D(()=>Ml.find(_e=>_e.mode===i.status?.permission)),Sn=D(()=>wn.value?a(wn.value.labelKey):""),Un=D(()=>wn.value?.icon??"hand"),mn=V(!1),fn=V(!1),Qn=V(!1),On=V(!1),Ci=V(null),io=V(null);let hr=0,Fc=0,Jl=0,Tl=0;function Ie(){const _e=Ni.value?getComputedStyle(Ni.value):null;return{valveFloor:_e?nt(_e,"--composer-valve-floor",56):56,expandMargin:_e?nt(_e,"--composer-valve-expand-margin",48):48}}function Ne(_e){const at=_e.getBoundingClientRect().left;for(const Ke of _e.querySelectorAll(".compact-chip, .ctx-group, .model-pill, .stop, .send")){const bt=Ke.getBoundingClientRect();if(bt.width>0&&bt.left_e.clientWidth+1||_e.clientWidth===0&&(_e.textContent?.length??0)>0}function ln(){const _e=Ni.value;if(!_e)return;const{valveFloor:at,expandMargin:Ke}=Ie(),bt=_e.getBoundingClientRect().width,Jt=io.value;if(On.value){bt>Tl+Ke&&(On.value=!1,ft(ln));return}if(Qn.value){if(bt>Jl+Ke){Qn.value=!1,ft(ln);return}Jt&&Ne(Jt)&&(Tl=bt,On.value=!0,ft(ln));return}if(fn.value){if(bt>Fc+Ke){fn.value=!1,ft(ln);return}Jt&&Ne(Jt)&&(ks.value?(Jl=bt,Qn.value=!0):(Tl=bt,On.value=!0),ft(ln));return}if(mn.value&&bt>hr+Ke){mn.value=!1,ft(ln);return}const gn=Ci.value;gn!==null&&Pt(gn)&&gn.getBoundingClientRect().width{typeof ResizeObserver>"u"||!Ni.value||(Dn=new ResizeObserver(ln),Dn.observe(Ni.value))}),Ln(()=>{Dn?.disconnect(),Dn=null});const{fontScale:Yn}=X1();We([Sn,Sl,ks,dr,()=>i.status?.model,()=>i.working,()=>i.authReady,()=>i.managedSignedIn,()=>i.managedMembership,()=>i.models?.length,Yn,u],()=>{mn.value&&(mn.value=!1),fn.value&&(fn.value=!1),Qn.value&&(Qn.value=!1),On.value&&(On.value=!1),ft(ln)}),kn(()=>{document.fonts?.ready.then(ln)});const jn=D(()=>`${i.status?.model??""}${dr.value}`),po=D(()=>Al.value?.provider??""),ws=D(()=>!po.value||!i.models?.length?[]:i.models.filter(_e=>_e.provider===po.value)),Xl=D(()=>(i.models?.length??0)>0),Ma=D(()=>i.authReady===!1&&!Xl.value),pf=D(()=>Ma.value&&!(i.managedSignedIn??!1)),ea=D(()=>Ma.value&&(i.managedSignedIn??!1)&&i.managedMembership==="free"),iu=D(()=>new Set(i.starredIds??[]));function am(_e){return iu.value.has(_e)}const mf=D(()=>i.models?.length?i.models.filter(_e=>am(_e.id)&&_e.provider!==po.value):[]),Hu=V(null);ld(ri,Hu);function Er(){const _e=Hu.value,at=Ni.value;if(!_e||!at)return;const Ke=getComputedStyle(_e),bt=Be(Ke.getPropertyValue("--space-1"))||4,Jt=Be(Ke.getPropertyValue("--space-2"))||8,gn=window.visualViewport,En=gn?.offsetTop??0,Vn=En+(gn?.height??window.innerHeight),pn=at.getBoundingClientRect(),eo=pn.top-En-bt-Jt,Cs=Vn-pn.bottom-bt-Jt;_e.offsetHeight>eo&&Cs>eo?(on.value=!0,Pe.value=`${Math.max(Math.floor(Cs),0)}px`):(on.value=!1,Pe.value=`${Math.max(Math.floor(eo),0)}px`)}function Ks(){vs()}function jv(){window.addEventListener("resize",Ks),window.visualViewport?.addEventListener("resize",Ks),window.visualViewport?.addEventListener("scroll",Ks)}function Gh(){window.removeEventListener("resize",Ks),window.visualViewport?.removeEventListener("resize",Ks),window.visualViewport?.removeEventListener("scroll",Ks)}We(ri,async _e=>{if(!_e){Gh();return}jv(),on.value=!1,Pe.value="",await ft(),Er(),(Hu.value?.querySelector(".md-row.is-current")??Hu.value?.querySelector(".md-row"))?.focus()}),Ln(()=>{Gh()});function Lr(_e){if(_e.key!=="ArrowDown"&&_e.key!=="ArrowUp")return;const at=Array.from(Hu.value?.querySelectorAll(".md-row:not(:disabled)")??[]);if(!at.length)return;_e.preventDefault();const Ke=at.indexOf(document.activeElement),bt=_e.key==="ArrowDown"?(Ke+1)%at.length:(Ke-1+at.length)%at.length;at[bt]?.focus()}function gf(_e){l("selectModel",_e),vs()}return(_e,at)=>(k(),L("div",{class:Re(["composer",{"drag-over":p(ei),expanded:M.value}]),onDragover:at[18]||(at[18]=(...Ke)=>p(wi)&&p(wi)(...Ke)),onDragleave:at[19]||(at[19]=(...Ke)=>p(Vo)&&p(Vo)(...Ke)),onDrop:at[20]||(at[20]=(...Ke)=>p(ot)&&p(ot)(...Ke))},[A("div",{class:Re(["composer-card",{"labels-collapsed":mn.value}])},[A("div",cct,[p(ne)&&!p(o)?(k(),de(hR,{key:0,ref_key:"slashMenuRef",ref:gt,items:p(W),ranges:p(Q),"active-index":p(te),query:ce.value,onSelect:p(ve),onHover:at[0]||(at[0]=Ke=>te.value=Ke)},null,8,["items","ranges","active-index","query","onSelect"])):ee("",!0),p(Z)&&!p(o)?(k(),de(pR,{key:1,ref_key:"mentionMenuRef",ref:_t,items:p(ae),"active-index":p(K),loading:p(re),stale:p(we),onSelect:p(oe),onHover:p(le)},null,8,["items","active-index","loading","stale","onSelect","onHover"])):ee("",!0),U(mo,{name:"composer-menu-pop"},{default:ue(()=>[Mi.value&&!p(o)?(k(),L("div",{key:0,ref_key:"addMenuRef",ref:_n,class:"add-menu",onClick:at[2]||(at[2]=Tt(()=>{},["stop"])),onKeydown:ci},[A("div",{ref_key:"addScrollRef",ref:vo,class:"am-scroll",role:"menu",onScroll:je},[(k(!0),L(De,null,Ct(Bt.value,Ke=>(k(),L("button",{key:Ke.id,type:"button",class:"am-row",role:"menuitem",onMousedown:at[1]||(at[1]=Tt(()=>{},["prevent"])),onClick:bt=>Bn(Ke)},[A("span",fct,[U(p(Ce),{name:Ke.icon,size:"sm"},null,8,["name"])]),A("span",hct,F(p(a)(Ke.nameKey)),1),Ke.descKey?(k(),L("span",pct,F(p(a)(Ke.descKey)),1)):ee("",!0)],40,dct))),128))],544),Ji.value?(k(),L("div",{key:0,class:"scroll-thumb",style:sn({top:`${Ji.value.top}px`,height:`${Ji.value.height}px`})},null,4)):ee("",!0)],544)):ee("",!0)]),_:1}),A("div",mct,[A("div",{ref_key:"editorHostRef",ref:S,class:"ph","data-placeholder":r.value,"data-empty":p(d).length===0,"data-wm":ho.value?"true":"false"},null,8,gct),U(p(Nn),{text:M.value?p(a)("composer.collapseTitle"):p(a)("composer.expandTitle")},{default:ue(()=>[M.value||B.value?(k(),L("button",{key:0,class:"expand-btn",type:"button","aria-label":M.value?p(a)("composer.collapseTitle"):p(a)("composer.expandTitle"),onClick:R},[M.value?(k(),de(p(Ce),{key:0,name:"collapse",size:"sm"})):(k(),de(p(Ce),{key:1,name:"expand",size:"sm"}))],8,vct)):ee("",!0)]),_:1},8,["text"])])]),Ko.value?(k(),L("input",{key:0,ref_key:"fileInputRef",ref:Qt,type:"file",multiple:"",class:"file-input-hidden",onChange:at[3]||(at[3]=(...Ke)=>p(Hi)&&p(Hi)(...Ke))},null,544)):ee("",!0),A("div",{ref_key:"toolbarRef",ref:Ni,class:"toolbar"},[A("div",{ref_key:"menuMeasureRef",ref:Ql,class:"menu-measure","aria-hidden":"true"},[...at[21]||(at[21]=[A("span",{class:"pd-desc"},null,-1)])],512),A("div",yct,[U(p(an),{class:"composer-attach",size:"md",label:p(a)("composer.addMenu"),tooltip:p(a)("composer.addMenu"),"aria-haspopup":"menu","aria-expanded":Mi.value,onMousedown:at[4]||(at[4]=Tt(()=>{},["prevent"])),onClick:Tt(Ye,["stop"])},{default:ue(()=>[U(p(Ce),{name:"plus"})]),_:1},8,["label","tooltip","aria-expanded"]),e.status?(k(),de(p(Nn),{key:0,text:mn.value?Sn.value:null},{default:ue(()=>[A("span",{ref_key:"permPillRef",ref:qs,class:Re(["perm-pill",["perm-"+e.status.permission,{open:Li.value}]]),role:"button",tabindex:"0","aria-label":Sn.value,onClick:Tt(ys,["stop"]),onKeydown:[Yo(ys,["enter"]),Yo(Tt(ys,["prevent"]),["space"])]},[U(p(Ce),{class:"perm-pill-icon",name:Un.value,size:"md"},null,8,["name"]),A("span",bct,F(Sn.value),1)],42,kct)]),_:1},8,["text"])):ee("",!0),U(mo,{name:"composer-menu-pop"},{default:ue(()=>[Li.value&&e.status?(k(),L("div",{key:0,ref_key:"permDropdownRef",ref:Xo,class:"perm-dropdown",style:sn(Yl.value),role:"menu",onClick:at[5]||(at[5]=Tt(()=>{},["stop"]))},[(k(),L(De,null,Ct(Ml,Ke=>A("button",{key:Ke.mode,class:Re(["pd-row",{"is-current":Ke.mode===e.status.permission}]),role:"menuitem",onClick:bt=>Kt(Ke.mode)},[A("span",{class:"pd-icon",style:sn({color:Ke.color})},[U(p(Ce),{name:Ke.icon,size:"md"},null,8,["name"])],4),A("span",Cct,[A("span",{class:"pd-name",style:sn({color:Ke.color})},F(p(a)(Ke.labelKey)),5),A("span",Act,F(p(a)(Ke.descKey)),1)]),A("span",xct,[Ke.mode===e.status.permission?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)])],10,wct)),64))],4)):ee("",!0)]),_:1}),Sl.value?(k(),L("span",Sct,[U(p(Ce),{class:"swarm-ic",name:"sparkles",size:"md"}),A("span",_ct,F(p(a)("status.swarmLabel")),1),U(p(an),{class:"swarm-x",size:"sm",label:p(a)("status.swarmDismiss"),tooltip:p(a)("status.swarmDismiss"),onMousedown:at[6]||(at[6]=Tt(()=>{},["prevent"])),onClick:at[7]||(at[7]=Tt(Ke=>l("toggleSwarm"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])])):ee("",!0)]),A("div",{ref_key:"toolbarRightRef",ref:io,class:"toolbar-right"},[ks.value?(k(),L("button",{key:0,class:Re(["compact-chip",{gone:Qn.value}]),onClick:at[8]||(at[8]=Tt(Ke=>l("compact"),["stop"]))},"/compact",2)):ee("",!0),U(p(Nn),{text:Vs.value},{default:ue(()=>[e.status&&!e.hideContext?(k(),L("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":Vs.value},[U(p(Wne),{pct:Bs.value},null,8,["pct"])],8,Mct)):ee("",!0)]),_:1},8,["text"]),e.status&&!pf.value&&!ea.value?(k(),de(p(Nn),{key:1,text:fn.value?jn.value:null},{default:ue(()=>[A("button",{ref_key:"modelPillRef",ref:Us,type:"button",class:Re(["model-pill",{open:ri.value,"icon-only":fn.value,"model-gone":On.value}]),"aria-haspopup":"menu","aria-expanded":ri.value,"aria-label":fn.value?jn.value:void 0,onClick:Tt(ti,["stop"])},[fn.value?(k(),de(p(Ce),{key:0,name:"model",size:"md"})):(k(),L(De,{key:1},[A("span",{ref_key:"mpNameRef",ref:Ci,class:"mp-name"},F(e.status.model),513),dr.value?(k(),L("span",Tct,F(dr.value),1)):ee("",!0),U(p(Ce),{class:"cv",name:"chevron-down",size:"sm"})],64))],10,Ict)]),_:1},8,["text"])):e.status&&ea.value?(k(),L("button",{key:2,type:"button",class:Re(["model-pill login-pill",{"icon-only":fn.value,"model-gone":On.value}]),"aria-label":fn.value?p(a)("sidebar.upgrade"):void 0,onClick:at[9]||(at[9]=Tt(Ke=>p(pv)(),["stop"]))},[fn.value?(k(),de(p(Ce),{key:0,name:"music",size:"md"})):(k(),L(De,{key:1},[U(p(Ce),{name:"music",size:"sm"}),A("span",{ref_key:"mpNameRef",ref:Ci,class:"mp-name"},F(p(a)("sidebar.upgrade")),513)],64))],10,Ect)):e.status&&pf.value?(k(),L("button",{key:3,type:"button",class:Re(["model-pill login-pill",{"icon-only":fn.value,"model-gone":On.value}]),"aria-label":fn.value?p(a)("login.action"):void 0,onClick:at[10]||(at[10]=Tt(Ke=>l("login"),["stop"]))},[fn.value?(k(),de(p(Ce),{key:0,name:"log-in",size:"md"})):(k(),L(De,{key:1},[U(p(Ce),{name:"log-in",size:"sm"}),A("span",{ref_key:"mpNameRef",ref:Ci,class:"mp-name"},F(p(a)("login.action")),513)],64))],10,Lct)):ee("",!0),e.working?(k(),de(p(Nn),{key:4,text:p(a)("composer.interruptTitle")},{default:ue(()=>[A("button",{class:"stop","aria-label":p(a)("composer.interrupt"),onClick:at[11]||(at[11]=Ke=>l("interrupt"))},[U(p(Ce),{name:"stop",size:"sm"})],8,Nct)]),_:1},8,["text"])):ee("",!0),U(p(Nn),{text:no.value},{default:ue(()=>[A("button",{class:Re(["send",{"is-starting":e.starting}]),"aria-label":no.value,disabled:e.starting||!Ei.value,onClick:at[12]||(at[12]=Ke=>ur())},[e.starting?(k(),de(p(uo),{key:0,size:"sm"})):(k(),de(p(Ce),{key:1,name:"send",size:"sm"}))],10,Dct)]),_:1},8,["text"])],512),U(mo,{name:"composer-menu-pop"},{default:ue(()=>[ri.value&&e.status?(k(),L("div",{key:0,ref_key:"modelDropdownRef",ref:Hu,class:Re(["model-dropdown",{"flip-down":on.value}]),style:sn(Zn.value),role:"menu",onClick:at[14]||(at[14]=Tt(()=>{},["stop"])),onKeydown:Lr},[A("div",Fct,[mf.value.length>0?(k(),L("div",Bct,F(p(a)("status.starredModels")),1)):ee("",!0),(k(!0),L(De,null,Ct(mf.value,Ke=>(k(),L("button",{key:Ke.id,class:Re(["md-row",{"is-current":Ke.id===e.status.modelId}]),role:"menuitem",onClick:bt=>gf(Ke.id)},[A("span",Oct,[Ke.id===e.status.modelId?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),A("span",$ct,F(Ke.displayName??Ke.model),1),A("span",Pct,F(Ke.provider),1),U(p(Ce),{class:"md-star",name:"star",size:"sm"})],10,Rct))),128)),mf.value.length>0?(k(),L("div",zct)):ee("",!0),ws.value.length>0?(k(),L("div",jct,F(po.value),1)):ee("",!0),(k(!0),L(De,null,Ct(ws.value,Ke=>(k(),L("button",{key:Ke.id,class:Re(["md-row",{"is-current":Ke.id===e.status.modelId}]),role:"menuitem",onClick:bt=>gf(Ke.id)},[A("span",Wct,[Ke.id===e.status.modelId?(k(),de(p(Ce),{key:0,name:"check",size:"sm"})):ee("",!0)]),A("span",qct,F(Ke.displayName??Ke.model),1),am(Ke.id)?(k(),de(p(Ce),{key:0,class:"md-star",name:"star",size:"sm"})):ee("",!0)],10,Hct))),128))]),ws.value.length>0?(k(),L("div",Uct)):ee("",!0),A("div",Vct,[A("span",Kct,F(p(a)("status.thinkingLabel")),1),Yr.value==="unsupported"?(k(),L("span",Zct,F(p(a)("status.modeNotSupported")),1)):Zl.value.length>1?(k(),de(p(Is),{key:1,"model-value":Gl.value,options:xl.value,size:"xs","onUpdate:modelValue":tu},null,8,["model-value","options"])):(k(),L("span",Gct,F(p(Bd)(Zl.value[0]??_a.value)),1))]),at[22]||(at[22]=A("div",{class:"md-divider"},null,-1)),A("div",Qct,F(p(a)("status.cacheNote")),1),at[23]||(at[23]=A("div",{class:"md-divider"},null,-1)),A("button",{class:"md-row md-row-more",role:"menuitem",onClick:at[13]||(at[13]=Ke=>{vs(),l("pickModel")})},[A("span",Yct,[U(p(Ce),{name:"list",size:"sm"})]),A("span",Jct,F(p(a)("status.moreModels")),1),U(p(Ce),{class:"md-more-arrow",name:"chevron-right",size:"sm"})])],38)):ee("",!0)]),_:1})],512)],2),_e.$slots.footer?(k(),L("div",Xct,[Wn(_e.$slots,"footer",{},void 0,!0)])):ee("",!0),A("div",{class:Re(["drop-overlay",{show:p(ei)}]),"aria-hidden":"true"},[A("div",edt,[U(p(Ce),{name:"file-plus",size:"lg"}),A("span",null,F(p(a)("composer.dropToAttach")),1)])],2),(k(),de(us,{to:"body"},[U(p(y1),{"model-value":p(o)&&p(ne),title:p(a)("composer.slashSheetTitle"),"onUpdate:modelValue":qe},{default:ue(()=>[A("div",tdt,[U(p(Ms),{ref_key:"slashSearchRef",ref:ie,modelValue:Ae.value,"onUpdate:modelValue":at[15]||(at[15]=Ke=>Ae.value=Ke),placeholder:p(a)("composer.slashSearchPlaceholder"),autocomplete:"off",spellcheck:"false",role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":!!se.value,"aria-controls":se.value,"aria-activedescendant":pe.value,onKeydown:fi,onCompositionstart:Bo,onCompositionend:qn},null,8,["modelValue","placeholder","aria-expanded","aria-controls","aria-activedescendant"])]),U(hR,{layout:"sheet",items:p(W),ranges:p(Q),"active-index":p(te),query:Ae.value,onSelect:p(ve),onHover:at[16]||(at[16]=Ke=>te.value=Ke)},null,8,["items","ranges","active-index","query","onSelect"])]),_:1},8,["model-value","title"])])),(k(),de(us,{to:"body"},[U(p(y1),{"model-value":p(o)&&p(Z),title:p(a)("composer.mentionSheetTitle"),"onUpdate:modelValue":ze},{default:ue(()=>[A("div",ndt,[U(p(Ms),{ref_key:"mentionSearchRef",ref:Ee,modelValue:fe.value,"onUpdate:modelValue":at[17]||(at[17]=Ke=>fe.value=Ke),placeholder:p(a)("composer.mentionSearchPlaceholder"),autocomplete:"off",spellcheck:"false",role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":!!se.value,"aria-controls":se.value,"aria-activedescendant":pe.value,onKeydown:fi,onCompositionstart:Bo,onCompositionend:qn},null,8,["modelValue","placeholder","aria-expanded","aria-controls","aria-activedescendant"])]),U(pR,{layout:"sheet",items:p(ae),"active-index":p(K),loading:p(re),stale:p(we),onSelect:p(oe),onHover:p(le)},null,8,["items","active-index","loading","stale","onSelect","onHover"])]),_:1},8,["model-value","title"])])),(k(),de(us,{to:"body"},[U(p(y1),{"model-value":p(o)&&Mi.value,"onUpdate:modelValue":ht},{default:ue(()=>[A("div",{ref_key:"addSheetRef",ref:gs,class:"msheet-add",role:"menu",onKeydown:ci},[(k(!0),L(De,null,Ct(Bt.value,Ke=>(k(),L("button",{key:Ke.id,type:"button",class:"am-row",role:"menuitem",onClick:bt=>Bn(Ke)},[A("span",odt,[U(p(Ce),{name:Ke.icon,size:"sm"},null,8,["name"])]),A("span",sdt,F(p(a)(Ke.nameKey)),1),Ke.descKey?(k(),L("span",rdt,F(p(a)(Ke.descKey)),1)):ee("",!0)],8,idt))),128))],544)]),_:1},8,["model-value"])]))],34))}}),VZ=St(ldt,[["__scopeId","data-v-f4448519"]]),adt={class:"akind"},udt={key:1,class:"apeek"},cdt={class:"ab"},ddt=["title"],fdt={class:"code-path"},hdt={key:2,class:"body-shell"},pdt={class:"shell-cmd"},mdt={key:0,class:"shell-cwd"},gdt={key:1,class:"shell-danger"},vdt={class:"code-path"},ydt={key:4,class:"body-chip"},kdt={class:"chip-label"},bdt={class:"chip-value"},wdt={key:0,class:"chip-detail"},Cdt={key:5,class:"body-chip"},Adt={key:0,class:"chip-label"},xdt={class:"chip-value"},Sdt={key:6,class:"body-chip"},_dt={class:"chip-label"},Mdt={class:"chip-value"},Idt={key:0,class:"chip-detail"},Tdt={key:7,class:"body-chip"},Edt={class:"chip-label"},Ldt={class:"chip-value"},Ndt={key:0,class:"chip-detail"},Ddt={key:8,class:"body-todo"},Fdt={class:"todo-glyph"},Bdt={key:0,class:"plan-opts"},Rdt=["disabled","onClick"],Odt={class:"popt-key"},$dt={class:"popt-text"},Pdt={class:"popt-label"},zdt={key:0,class:"popt-desc"},jdt={key:10,class:"body-generic"},Hdt={class:"gen-text"},Wdt={key:11,class:"feedback-wrap"},qdt={class:"feedback-hint"},Udt={class:"af"},Vdt={class:"abtns"},Kdt={key:0,class:"knum"},Zdt={key:0,class:"knum"},Gdt=.4,Qdt=rt({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=Yt(Uo),r=D(()=>{const pe=n.block;return pe.kind!=="plan_review"?null:{plan:pe.plan,path:pe.path,options:pe.options??[]}}),l=V(!1),a=V(null),u=V(null),c=V(null),d=V(!1),f=V(!1);function h(){d.value=(u.value?.scrollTop??0)>0||(c.value?.scrollTop??0)>0,f.value=(a.value?.scrollTop??0)>0}function m(){h()}const g=V(!1),v=D(()=>{const pe=n.block.kind;return pe==="plan_review"||pe==="diff"||pe==="file"});function y(){l.value&&(l.value=!1)}const b=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function w(){return b.includes(n.block.kind)?n.block.kind:"generic"}function C(){return o(`approval.title.${w()}`)}const T=D(()=>{const pe=n.block;switch(pe.kind){case"diff":case"file":case"fileop":return pe.path;case"shell":return pe.command;case"url":return pe.url;case"search":return pe.query;case"invocation":return pe.name;case"generic":return pe.summary;default:return""}}),N=V(!1),I=V(""),S=V(null);function _(){const pe=S.value?.el;if(!pe)return;pe.style.height="auto";const ae=(window.visualViewport?.height??window.innerHeight)*Gdt;pe.style.height=`${Math.min(pe.scrollHeight,ae)}px`,pe.style.overflowY=pe.scrollHeight>ae?"auto":"hidden"}We(I,()=>void ft(_)),We(l,pe=>{pe||ft(_)});const{fontScale:x}=X1();We(x,()=>void ft(_));let E=null,M=0;kn(()=>{window.addEventListener("resize",_),window.visualViewport?.addEventListener("resize",_),E=new ResizeObserver(pe=>{const Z=pe[0]?.contentRect.width??0;Z!==M&&(M=Z,_())}),a.value&&E.observe(a.value)}),Ln(()=>{window.removeEventListener("resize",_),window.visualViewport?.removeEventListener("resize",_),E?.disconnect()});function R(){n.busy||(N.value=!0,I.value="",setTimeout(()=>S.value?.el?.focus(),0))}function q(){if(n.busy)return;const pe=I.value.trim();r.value?G("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:pe||void 0}):G("feedback",{decision:"rejected",feedback:pe||void 0}),N.value=!1,I.value=""}function z(){n.busy||(N.value=!1,I.value="")}const{handleCompositionStart:$,handleCompositionEnd:B,isComposingKeyEvent:P}=bl();function H(pe){P(pe)||(pe.key==="Enter"&&!pe.shiftKey?(pe.preventDefault(),q()):pe.key==="Escape"&&(pe.preventDefault(),z()))}const j=V(null);We(()=>n.busy,pe=>{pe||(j.value=null)});function G(pe,Z){n.busy||(j.value=pe,i("decide",Z))}function ne(){G("approve",{decision:"approved"})}function W(){G("approveSession",{decision:"approved",scope:"session"})}function Q(){G("reject",{decision:"rejected"})}function te(){G("approvePlan",{decision:"approved"})}function X(pe){G(`option:${pe}`,{decision:"approved",selectedLabel:pe})}function ve(){n.busy||R()}function ce(){G("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function se(pe){const Z=(document.activeElement?.tagName??"").toLowerCase();if(Z==="input"||Z==="textarea"||pe.metaKey||pe.ctrlKey||pe.altKey||sr.value>0||pe.defaultPrevented)return;if(N.value){pe.key==="Escape"&&(pe.preventDefault(),z());return}if(n.busy||l.value)return;const ae=r.value;if(ae){if(ae.options.length===0){pe.key==="1"?(pe.preventDefault(),te()):pe.key==="2"?(pe.preventDefault(),ve()):pe.key==="3"&&(pe.preventDefault(),ce());return}pe.key==="1"&&ae.options[0]?(pe.preventDefault(),X(ae.options[0].label)):pe.key==="2"&&ae.options[1]?(pe.preventDefault(),X(ae.options[1].label)):pe.key==="3"&&ae.options[2]&&(pe.preventDefault(),X(ae.options[2].label));return}pe.key==="1"?(pe.preventDefault(),ne()):pe.key==="2"?(pe.preventDefault(),W()):pe.key==="3"?(pe.preventDefault(),Q()):pe.key==="4"&&(pe.preventDefault(),R())}return kn(()=>document.addEventListener("keydown",se)),Ln(()=>document.removeEventListener("keydown",se)),W1(h),(pe,Z)=>(k(),L("div",{ref_key:"cardRef",ref:a,class:Re(["appr",{minimized:l.value,scrolled:f.value}]),onScroll:h},[A("div",{class:Re(["ah",{clickable:l.value}]),onClick:y},[A("span",adt,F(C()),1),e.agentName&&!l.value?(k(),de(p(cl),{key:0,variant:"neutral",size:"sm"},{default:ue(()=>[Oe(F(p(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ee("",!0),l.value&&T.value?(k(),L("span",udt,F(T.value),1)):ee("",!0),v.value&&!l.value?(k(),de(p(an),{key:2,class:"aexpand",size:"sm",label:g.value?p(o)("approval.collapsePlan"):p(o)("approval.expandPlan"),tooltip:g.value?p(o)("approval.collapsePlan"):p(o)("approval.expandPlan"),onClick:Z[0]||(Z[0]=ae=>g.value=!g.value)},{default:ue(()=>[U(p(Ce),{name:g.value?"collapse":"expand",size:"md"},null,8,["name"])]),_:1},8,["label","tooltip"])):ee("",!0),U(p(an),{class:"amin",size:"sm",label:l.value?p(o)("question.expand"):p(o)("question.minimize"),tooltip:l.value?p(o)("question.expand"):p(o)("question.minimize"),onClick:Z[1]||(Z[1]=Tt(ae=>l.value=!l.value,["stop"]))},{default:ue(()=>[l.value?(k(),de(p(Ce),{key:0,name:"chevron-up",size:"md"})):(k(),de(p(Ce),{key:1,name:"minus",size:"md"}))]),_:1},8,["label","tooltip"])],2),l.value?ee("",!0):(k(),L(De,{key:0},[A("div",cdt,[e.block.kind==="plan_review"&&e.block.path?(k(),L("button",{key:0,type:"button",class:"plan-path",title:e.block.path,onClick:Z[2]||(Z[2]=ae=>p(s)?.openFile({path:e.block.path,content:e.block.plan}))},F(e.block.path),9,ddt)):ee("",!0),e.block.kind==="diff"?(k(),L("div",{key:1,class:Re(["body-code",{expanded:g.value}])},[A("div",fdt,F(e.block.path),1),e.block.diff.length>0?(k(),de(p(Wa),{key:0,lines:e.block.diff,path:e.block.path},null,8,["lines","path"])):ee("",!0)],2)):e.block.kind==="shell"?(k(),L("div",hdt,[A("div",pdt,[Z[4]||(Z[4]=A("span",{class:"shell-dollar"},"$",-1)),Oe(" "+F(e.block.command),1)]),e.block.cwd?(k(),L("div",mdt,"cwd: "+F(e.block.cwd),1)):ee("",!0),e.block.danger?(k(),L("div",gdt,[U(p(Ce),{name:"alert-triangle",size:"sm",class:"shell-danger-ic"}),A("span",null,F(p(o)("approval.danger",{detail:e.block.danger})),1)])):ee("",!0)])):e.block.kind==="file"?(k(),L("div",{key:3,class:Re(["body-code",{expanded:g.value}])},[A("div",vdt,F(e.block.path),1),U(p(Wa),{code:e.block.content,path:e.block.path},null,8,["code","path"])],2)):e.block.kind==="fileop"?(k(),L("div",ydt,[A("span",kdt,F(e.block.op),1),A("span",bdt,F(e.block.path),1),e.block.detail?(k(),L("span",wdt,F(e.block.detail),1)):ee("",!0)])):e.block.kind==="url"?(k(),L("div",Cdt,[e.block.method?(k(),L("span",Adt,F(e.block.method),1)):ee("",!0),A("span",xdt,F(e.block.url),1)])):e.block.kind==="search"?(k(),L("div",Sdt,[A("span",_dt,F(p(o)("approval.searchQueryLabel")),1),A("span",Mdt,F(e.block.query),1),e.block.scope?(k(),L("span",Idt,F(p(o)("approval.searchScope",{scope:e.block.scope})),1)):ee("",!0)])):e.block.kind==="invocation"?(k(),L("div",Tdt,[A("span",Edt,F(e.block.kind2),1),A("span",Ldt,F(e.block.name),1),e.block.description?(k(),L("span",Ndt,F(e.block.description),1)):ee("",!0)])):e.block.kind==="todo"?(k(),L("div",Ddt,[(k(!0),L(De,null,Ct(e.block.items,(ae,K)=>(k(),L("div",{key:K,class:"todo-item"},[A("span",Fdt,F(ae.status==="done"||ae.status==="completed"?"✓":"○"),1),A("span",{class:Re(["todo-title",{"todo-done":ae.status==="done"||ae.status==="completed"}])},F(ae.title),3)]))),128))])):e.block.kind==="plan_review"?(k(),L("div",{key:9,ref_key:"planWrapEl",ref:u,class:Re(["body-plan-wrap",{scrolled:d.value}]),onScroll:m},[A("div",{ref_key:"planBodyEl",ref:c,class:Re(["body-plan",{expanded:g.value}]),onScroll:m},[U(p(_c),{text:e.block.plan,"open-file":p(s)?.openFile},null,8,["text","open-file"])],34),r.value&&r.value.options.length>0?(k(),L("div",Bdt,[(k(!0),L(De,null,Ct(r.value.options,(ae,K)=>(k(),L("button",{key:K,type:"button",class:"popt",disabled:e.busy,onClick:re=>X(ae.label)},[A("span",Odt,F(K+1),1),A("span",$dt,[A("span",Pdt,F(ae.label),1),ae.description?(k(),L("span",zdt,F(ae.description),1)):ee("",!0)]),j.value===`option:${ae.label}`?(k(),de(p(uo),{key:0,size:"sm",class:"popt-spin"})):ee("",!0)],8,Rdt))),128))])):ee("",!0)],34)):(k(),L("div",jdt,[A("span",Hdt,F(e.block.summary),1)])),N.value?(k(),L("div",Wdt,[U(p(Hie),{ref_key:"feedbackRef",ref:S,modelValue:I.value,"onUpdate:modelValue":Z[3]||(Z[3]=ae=>I.value=ae),placeholder:p(o)("approval.feedbackPlaceholder"),rows:3,resize:!1,onKeydown:H,onCompositionstart:p($),onCompositionend:p(B)},null,8,["modelValue","placeholder","onCompositionstart","onCompositionend"]),A("div",qdt,F(p(o)("approval.feedbackHint")),1)])):ee("",!0)]),A("div",Udt,[A("div",Vdt,[N.value?(k(),L(De,{key:0},[U(p(rn),{size:"md",variant:"danger-soft",loading:j.value==="feedback",disabled:e.busy,onClick:q},{default:ue(()=>[Oe(F(p(o)("approval.feedbackSubmit")),1)]),_:1},8,["loading","disabled"]),U(p(rn),{size:"md",variant:"ghost",disabled:e.busy,onClick:z},{default:ue(()=>[Oe(F(p(o)("approval.feedbackCancel")),1)]),_:1},8,["disabled"])],64)):r.value?(k(),L(De,{key:1},[r.value.options.length===0?(k(),de(p(rn),{key:0,class:"amain",size:"md",variant:"primary",loading:j.value==="approvePlan",disabled:e.busy,onClick:te},{default:ue(()=>[Z[5]||(Z[5]=A("span",{class:"knum"},"1",-1)),Oe(F(p(o)("approval.approvePlan")),1)]),_:1},8,["loading","disabled"])):ee("",!0),U(p(rn),{size:"md",variant:"ghost",disabled:e.busy,onClick:ve},{default:ue(()=>[r.value.options.length===0?(k(),L("span",Kdt,"2")):ee("",!0),Oe(F(p(o)("approval.revise")),1)]),_:1},8,["disabled"]),U(p(rn),{size:"md",variant:"ghost",loading:j.value==="rejectAndExit",disabled:e.busy,onClick:ce},{default:ue(()=>[r.value.options.length===0?(k(),L("span",Zdt,"3")):ee("",!0),Oe(F(p(o)("approval.rejectAndExit")),1)]),_:1},8,["loading","disabled"])],64)):(k(),L(De,{key:2},[U(p(rn),{class:"amain",size:"md",variant:"primary",loading:j.value==="approve",disabled:e.busy,onClick:ne},{default:ue(()=>[Z[6]||(Z[6]=A("span",{class:"knum"},"1",-1)),Oe(F(p(o)("approval.approve")),1)]),_:1},8,["loading","disabled"]),U(p(rn),{size:"md",variant:"ghost",loading:j.value==="approveSession",disabled:e.busy,onClick:W},{default:ue(()=>[Z[7]||(Z[7]=A("span",{class:"knum"},"2",-1)),Oe(F(p(o)("approval.approveSession")),1)]),_:1},8,["loading","disabled"]),U(p(rn),{size:"md",variant:"ghost",loading:j.value==="reject",disabled:e.busy,onClick:Q},{default:ue(()=>[Z[8]||(Z[8]=A("span",{class:"knum"},"3",-1)),Oe(F(p(o)("approval.reject")),1)]),_:1},8,["loading","disabled"]),U(p(rn),{size:"md",variant:"ghost",disabled:e.busy,onClick:R},{default:ue(()=>[Z[9]||(Z[9]=A("span",{class:"knum"},"4",-1)),Oe(F(p(o)("approval.feedback")),1)]),_:1},8,["disabled"])],64))])])],64))],34))}}),Ydt=St(Qdt,[["__scopeId","data-v-03ef6cfa"]]),Jdt={class:"dock-work-head"},Xdt={key:0,class:"dock-workbar"},eft={key:0,class:"dw-running"},tft={key:0,class:"dw-running"},nft={class:"dw-count"},ift=rt({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},working:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},authReady:{type:Boolean},managedSignedIn:{type:Boolean},managedMembership:{},starredIds:{},skills:{},skillsLoaded:{type:Boolean},goal:{},dockPanel:{},overlayOpen:{type:Boolean},sessionPlans:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","focusGoal","compact","pickModel","selectModel","login","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=Ut(),{confirm:r,isConfirmOpen:l}=cf(),a=Yt(Uo),u=D(()=>a?.isExpanded()===!0&&a.activeTabType()!=="btw"),c=D(()=>a?.isExpanded()===!0),d=D(()=>i.pendingQuestion!=null||i.pendingApproval!=null),f=D(()=>{switch(i.goal?.status){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete");default:return""}}),h=D(()=>i.goal?Bu(i.goal.wallClockMs,{h:s("status.timeUnitHour"),m:s("status.timeUnitMinute"),s:s("status.timeUnitSecond")}):"");async function m(){await r({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}const g=[{id:"active",labelKey:"tasks.filterRecent",icon:"clock"},{id:"running",labelKey:"tasks.filterRunning",icon:"play"},{id:"done",labelKey:"tasks.filterDone",icon:"circle-check"},{id:"all",labelKey:"tasks.filterAll",icon:"list"}];function v(Me,fe){return(fe.completedAt??fe.createdAt??"").localeCompare(Me.completedAt??Me.createdAt??"")||(fe.createdAt??"").localeCompare(Me.createdAt??"")}function y(Me,fe){if(fe==="all")return Me;if(fe==="running")return Me.filter(Ee=>Ee.state==="run");if(fe==="done")return Me.filter(Ee=>Ee.state!=="run");const ie=[];for(const Ee of Me){if(Ee.state==="run")continue;let qe=ie.length;for(;qe>0&&v(ie[qe-1],Ee)>0;)qe--;ie.splice(qe,0,Ee),ie.length>5&&(ie.length=5)}return[...Me.filter(Ee=>Ee.state==="run"),...ie]}const b=V("active"),w=V("active"),C=D(()=>y(i.bashTasks,b.value)),T=D(()=>y(i.subagentTasks,w.value)),N=D(()=>g.map(Me=>({value:Me.id,label:s(Me.labelKey),icon:Me.icon}))),I=D({get:()=>b.value,set:Me=>{b.value=Me}}),S=D({get:()=>w.value,set:Me=>{w.value=Me}}),_=D(()=>(i.todos?.length??0)>0&&i.todoDoneCount===(i.todos?.length??0)),x=D(()=>i.bashTasks.some(Me=>Me.kind==="tool")),E=D(()=>x.value?"tasks.dockTasks":"tasks.dockBash"),M=D(()=>`${s("status.goalLabel")} ${f.value}`.trim()),R=D(()=>i.bashRunning>0?`${s(E.value)} ${i.bashRunning} ${s("tasks.running")}`:s(E.value)),q=D(()=>i.subagentRunning>0?`${s("tasks.dockSubagent")} ${i.subagentRunning} ${s("tasks.running")}`:s("tasks.dockSubagent")),z=D(()=>`${s("tasks.todoProgressTitle")} ${i.todoDoneCount}/${i.todos?.length??0}`),$=D(()=>Object.values(i.sessionPlans??{}).at(-1)),B=D(()=>{const Me=$.value?.review?.state;return Me?s(`tools.plan.review.${Me}`):""});function P(){const Me=$.value;Me?.path&&a?.openFile(Me.plan?{path:Me.path,content:Me.plan}:{path:Me.path})}const H=V(null),j=D(()=>H.value?.anyPopupOpen===!0),G=D(()=>j.value||i.dockPanel!=null),ne=V(null),W=V(null),Q=V(!1),te=V("50%");function X(Me,fe){if(i.pendingQuestion)return;const ie=fe.currentTarget;if(ie&&W.value){const Ee=ie.getBoundingClientRect(),qe=W.value.getBoundingClientRect();te.value=`${Ee.left+Ee.width/2-qe.left}px`}o("toggle-dock-panel",Me)}function ve(Me){return H.value?(H.value.loadForEdit(Me),!0):!1}function ce(Me,fe,ie){return H.value?(H.value.insertQuote(Me,fe,ie),!0):!1}function se(){return H.value!==null}function pe(Me){H.value?.loadAttachmentsForEdit(Me)}function Z(){H.value?.focus()}const ae=()=>H.value?.isEmpty?.()??!1;function K(Me){if(!i.dockPanel)return;const fe=Me.target;fe&&(ne.value?.contains(fe)||fe instanceof Element&&fe.closest(".ui-pill")||o("close-dock-panel"))}function re(Me){Me.key!=="Escape"||Me.repeat||pS(Me)||Me.defaultPrevented||j.value||l.value||i.overlayOpen||(Me.preventDefault(),Me.stopImmediatePropagation(),o("close-dock-panel"))}const we=V(null),be=V(!1);function ke(){const Me=we.value;be.value=Me?Me.scrollTop>0:!1}function oe(Me){be.value=Me.target.scrollTop>0}let le=null;We(()=>i.dockPanel,async Me=>{typeof document<"u"&&(document.removeEventListener("mousedown",K,!0),document.removeEventListener("keydown",re,!0),Me&&(document.addEventListener("mousedown",K,!0),document.addEventListener("keydown",re,!0))),le?.disconnect(),le=null,Me?(await ft(),ke(),typeof ResizeObserver=="function"&&we.value&&(le=new ResizeObserver(ke),le.observe(we.value))):be.value=!1},{immediate:!0}),We(()=>i.pendingQuestion,Me=>{Me&&i.dockPanel&&o("close-dock-panel")});let ye=null;function Ae(){const Me=W.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${Me}px`);const fe=Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--p-bp-sm"));Q.value=(W.value?.offsetWidth??0)<(Number.isFinite(fe)?fe:640)}return kn(()=>{hS(),!(typeof ResizeObserver!="function"||!W.value)&&(ye=new ResizeObserver(Ae),ye.observe(W.value),Ae())}),Ln(()=>{typeof document<"u"&&(document.removeEventListener("mousedown",K,!0),document.removeEventListener("keydown",re,!0)),ye?.disconnect(),ye=null,le?.disconnect(),le=null}),t({loadForEdit:ve,insertQuote:ce,hasInsertableComposer:se,loadAttachmentsForEdit:pe,focus:Z,anyPopupOpen:j,isEmpty:ae}),(Me,fe)=>(k(),L("div",{ref_key:"dockRef",ref:W,class:Re(["chat-dock",[e.mobile?"align-mobile":"align-center",{"has-popup":G.value,"has-approval":!!e.pendingApproval&&!e.pendingQuestion,"has-question":!!e.pendingQuestion,"pills-compact":Q.value}]]),onClick:fe[34]||(fe[34]=Tt(()=>{},["stop"]))},[U(mo,{name:"dock-panel"},{default:ue(()=>[e.dockPanel?(k(),L("div",{ref_key:"workPanelRef",ref:ne,key:e.dockPanel,class:Re(["dock-work-panel",[`panel-${e.dockPanel}`,{"body-scrolled-up":be.value}]]),style:sn({transformOrigin:`${te.value} 100%`}),onClick:fe[9]||(fe[9]=Tt(()=>{},["stop"]))},[A("div",Jdt,[e.dockPanel==="bash"?(k(),de(p(Gm),{key:0,icon:"terminal",title:p(s)(E.value),meta:`${e.bashRunning} ${p(s)("tasks.running")}`},{actions:ue(()=>[U(p(KB),{modelValue:I.value,"onUpdate:modelValue":fe[0]||(fe[0]=ie=>I.value=ie),options:N.value},null,8,["modelValue","options"])]),_:1},8,["title","meta"])):e.dockPanel==="subagent"?(k(),de(p(Gm),{key:1,icon:"sparkles",title:p(s)("tasks.dockSubagent"),meta:`${e.subagentRunning} ${p(s)("tasks.running")}`},{actions:ue(()=>[U(p(KB),{modelValue:S.value,"onUpdate:modelValue":fe[1]||(fe[1]=ie=>S.value=ie),options:N.value},null,8,["modelValue","options"])]),_:1},8,["title","meta"])):e.dockPanel==="todos"?(k(),de(p(Gm),{key:2,icon:_.value?"check-list":"list",title:p(s)("tasks.todoProgressTitle"),meta:`${e.todoDoneCount}/${e.todos?.length??0}`},null,8,["icon","title","meta"])):e.dockPanel==="goal"?(k(),de(p(Gm),{key:3,icon:"target",title:p(s)("status.goalLabel"),meta:h.value},{actions:ue(()=>[e.goal?(k(),L(De,{key:0},[e.goal.status==="active"?(k(),de(p(an),{key:0,size:"sm",label:p(s)("status.goalPause"),tooltip:p(s)("status.goalPause"),onClick:fe[2]||(fe[2]=Tt(ie=>o("controlGoal","pause"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"pause",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(k(),de(p(an),{key:1,size:"sm",label:p(s)("status.goalResume"),tooltip:p(s)("status.goalResume"),onClick:fe[3]||(fe[3]=Tt(ie=>o("controlGoal","resume"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"play",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(an),{size:"sm",label:p(s)("status.goalCancel"),tooltip:p(s)("status.goalCancel"),onClick:Tt(m,["stop"])},{default:ue(()=>[U(p(Ce),{name:"power",size:"md"})]),_:1},8,["label","tooltip"]),U(p(an),{size:"sm",label:p(s)("tasks.closePanel"),tooltip:p(s)("tasks.closePanel"),onClick:fe[4]||(fe[4]=Tt(ie=>o("close-dock-panel"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"close",size:"md"})]),_:1},8,["label","tooltip"])],64)):ee("",!0)]),_:1},8,["title","meta"])):e.dockPanel==="plan"?(k(),de(p(Gm),{key:4,icon:"file-edit",title:p(s)("status.planLabel"),meta:B.value},{actions:ue(()=>[$.value?.path?(k(),de(p(an),{key:0,size:"sm",label:p(s)("tasks.openPanel"),tooltip:p(s)("tasks.openPanel"),onClick:Tt(P,["stop"])},{default:ue(()=>[U(p(Ce),{name:"external-link",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),e.planArmed||e.planMode?(k(),de(p(an),{key:1,size:"sm",label:p(s)("status.workModeDismiss"),tooltip:p(s)("status.workModeDismiss"),onClick:fe[5]||(fe[5]=Tt(ie=>o("togglePlan"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"power",size:"md"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(an),{size:"sm",label:p(s)("tasks.closePanel"),tooltip:p(s)("tasks.closePanel"),onClick:fe[6]||(fe[6]=Tt(ie=>o("close-dock-panel"),["stop"]))},{default:ue(()=>[U(p(Ce),{name:"close",size:"md"})]),_:1},8,["label","tooltip"])]),_:1},8,["title","meta"])):ee("",!0)]),A("div",{ref_key:"workBodyRef",ref:we,class:"dock-work-body",onScroll:oe},[e.dockPanel==="bash"?(k(),de(p(Ptt),{key:0,tasks:C.value,filter:b.value,onCancel:fe[7]||(fe[7]=ie=>o("cancelTask",ie))},null,8,["tasks","filter"])):e.dockPanel==="subagent"?(k(),de(p(_tt),{key:1,tasks:T.value,filter:w.value,onCancel:fe[8]||(fe[8]=ie=>o("cancelTask",ie))},null,8,["tasks","filter"])):e.dockPanel==="todos"?(k(),de(p(qtt),{key:2,todos:e.todos??[]},null,8,["todos"])):e.dockPanel==="goal"&&e.goal?(k(),de(p(ttt),{key:3,goal:e.goal},null,8,["goal"])):e.dockPanel==="plan"?(k(),de(p(ftt),{key:4,plan:$.value,"plan-mode-on":e.planMode},null,8,["plan","plan-mode-on"])):ee("",!0)],544)],6)):ee("",!0)]),_:1}),e.hasDockWork||e.planMode||$.value?(k(),L("div",Xdt,[e.goal?(k(),de(p(Qm),{key:0,icon:"target",label:M.value,active:e.dockPanel==="goal",onClick:fe[10]||(fe[10]=ie=>X("goal",ie))},{meta:ue(()=>[A("span",{class:Re(["dw-goal-status",`dw-goal-status--${e.goal.status}`])},F(f.value),3)]),default:ue(()=>[Oe(F(p(s)("status.goalLabel"))+" ",1)]),_:1},8,["label","active"])):ee("",!0),e.planMode||$.value?(k(),de(p(Qm),{key:1,icon:"file-edit",label:p(s)("status.planLabel"),active:e.dockPanel==="plan",onClick:fe[11]||(fe[11]=ie=>X("plan",ie))},{default:ue(()=>[Oe(F(p(s)("status.planLabel")),1)]),_:1},8,["label","active"])):ee("",!0),e.bashTasks.length>0?(k(),de(p(Qm),{key:2,icon:"terminal",label:R.value,active:e.dockPanel==="bash",onClick:fe[12]||(fe[12]=ie=>X("bash",ie))},{meta:ue(()=>[e.bashRunning>0?(k(),L("span",eft,[U(p(Ul),{status:"running"}),Oe(F(e.bashRunning),1)])):ee("",!0)]),default:ue(()=>[Oe(F(p(s)(E.value))+" ",1)]),_:1},8,["label","active"])):ee("",!0),e.subagentTasks.length>0?(k(),de(p(Qm),{key:3,icon:"sparkles",label:q.value,active:e.dockPanel==="subagent",onClick:fe[13]||(fe[13]=ie=>X("subagent",ie))},{meta:ue(()=>[e.subagentRunning>0?(k(),L("span",tft,[U(p(Ul),{status:"running"}),Oe(F(e.subagentRunning),1)])):ee("",!0)]),default:ue(()=>[Oe(F(p(s)("tasks.dockSubagent"))+" ",1)]),_:1},8,["label","active"])):ee("",!0),(e.todos?.length??0)>0?(k(),de(p(Qm),{key:4,icon:_.value?"check-list":"list",label:z.value,active:e.dockPanel==="todos",onClick:fe[14]||(fe[14]=ie=>X("todos",ie))},{meta:ue(()=>[A("span",nft,F(e.todoDoneCount)+"/"+F(e.todos?.length??0),1)]),default:ue(()=>[Oe(F(p(s)("tasks.todoProgressTitle"))+" ",1)]),_:1},8,["icon","label","active"])):ee("",!0)])):ee("",!0),(k(),de(us,{defer:"",to:".pfc-host",disabled:!c.value},[e.pendingQuestion?(k(),de(p(met),{key:e.pendingQuestion.questionId,class:"dock-question",question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:fe[15]||(fe[15]=(ie,Ee)=>o("answer",ie,Ee)),onDismiss:fe[16]||(fe[16]=ie=>o("dismiss",ie))},null,8,["question","busy-kind"])):e.pendingApproval?(k(),de(Ydt,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:fe[17]||(fe[17]=ie=>o("approval",e.pendingApproval.approvalId,ie))},null,8,["block","agent-name","busy"])):ee("",!0)],8,["disabled"])),d.value?ee("",!0):(k(),de(us,{key:1,defer:"",to:".pfc-host",disabled:!u.value},[U(VZ,{ref_key:"composerRef",ref:H,"session-id":e.sessionId,running:e.running,working:e.working,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,"skills-loaded":e.skillsLoaded,starting:e.starting,onSubmit:fe[18]||(fe[18]=ie=>o("submit",ie)),onSteer:fe[19]||(fe[19]=ie=>o("steer",ie)),onCommand:fe[20]||(fe[20]=ie=>o("command",ie)),onInterrupt:fe[21]||(fe[21]=ie=>o("interrupt")),onSetPermission:fe[22]||(fe[22]=ie=>o("setPermission",ie)),onSetThinking:fe[23]||(fe[23]=ie=>o("setThinking",ie)),onTogglePlan:fe[24]||(fe[24]=ie=>o("togglePlan")),onToggleSwarm:fe[25]||(fe[25]=ie=>o("toggleSwarm")),onToggleGoal:fe[26]||(fe[26]=ie=>o("toggleGoal")),onCreateGoal:fe[27]||(fe[27]=ie=>o("createGoal",ie)),onControlGoal:fe[28]||(fe[28]=ie=>o("controlGoal",ie)),onFocusGoal:fe[29]||(fe[29]=ie=>o("focusGoal")),onCompact:fe[30]||(fe[30]=ie=>o("compact")),onPickModel:fe[31]||(fe[31]=ie=>o("pickModel")),onSelectModel:fe[32]||(fe[32]=ie=>o("selectModel",ie)),onLogin:fe[33]||(fe[33]=ie=>o("login"))},null,8,["session-id","running","working","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","swarm-mode","goal-mode","goal","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","skills-loaded","starting"])],8,["disabled"]))],2))}}),oft=St(ift,[["__scopeId","data-v-a4f60a64"]]),sft={class:"ws-home"},rft={class:"ws-home-title"},lft={class:"ws-home-name"},aft={key:0,class:"ws-home-path"},uft=rt({__name:"WorkspaceHome",props:{workspaceName:{},workspaceRoot:{}},setup(e){return(t,n)=>(k(),L("div",sft,[A("div",rft,[U(p(Ce),{class:"ws-home-folder",name:"folder-closed"}),A("span",lft,F(e.workspaceName),1)]),e.workspaceRoot?(k(),L("div",aft,F(e.workspaceRoot),1)):ee("",!0)]))}}),cft=St(uft,[["__scopeId","data-v-33dedf8a"]]),dft={class:"wrs"},fft={class:"wrs-caption"},hft=["onClick"],pft={class:"wrs-title"},mft={class:"wrs-time"},gft={class:"wrs-foot"},vft=rt({__name:"WorkspaceRecentSessions",props:{sessions:{}},emits:["selectSession","openSessionAdmin"],setup(e,{emit:t}){const n=t,{t:i}=Ut();return(o,s)=>(k(),L("div",dft,[A("div",fft,F(p(i)("conversation.recentSessions")),1),(k(!0),L(De,null,Ct(e.sessions,r=>(k(),L("button",{key:r.id,type:"button",class:"wrs-row",onClick:l=>n("selectSession",r.id)},[A("span",{class:Re(["wrs-ico",r.archived?"wrs-ico--done":"wrs-ico--open"])},[U(p(Ce),{name:r.archived?"state-done":"state-open",size:"sm"},null,8,["name"])],2),A("span",pft,F(r.title),1),A("span",mft,F(r.time),1)],8,hft))),128)),A("div",gft,[U(p(Nn),{text:p(i)("conversation.sessionAdminTooltip")},{default:ue(()=>[A("button",{type:"button",class:"wrs-more",onClick:s[0]||(s[0]=r=>n("openSessionAdmin"))},[Oe(F(p(i)("conversation.viewMoreSessions"))+" ",1),U(p(Ce),{name:"chevron-down",size:"sm"})])]),_:1},8,["text"])])]))}}),yft=St(vft,[["__scopeId","data-v-460203b8"]]),kft={class:"tsearch-main"},bft=["placeholder"],wft={key:0,class:"tsearch-spin"},Cft=["inert"],Aft={class:"tsearch-foot"},xft={class:"tsearch-count",role:"status"},Sft={class:"tsearch-rings","aria-hidden":"true"},_ft=800,Mft=400,Ift=1500,Tft=rt({__name:"TranscriptSearch",props:{pane:{},reveal:{},mobile:{type:Boolean,default:!1}},emits:["close"],setup(e,{expose:t,emit:n}){const i=e,o=n,{t:s}=Ut(),{handleCompositionStart:r,handleCompositionEnd:l,isComposingKeyEvent:a}=bl(),u=V(""),c=V(!1),d=V([]),f=V(0),h=V(null),m=D(()=>d.value.length),g=D(()=>u.value.trim()!==""&&!c.value),v=V(!1),y=D(()=>{if(m.value===0)return s("conversation.search.noResults");const ne={current:f.value+1,total:m.value};return v.value?s("conversation.search.resultsCapped",ne):s("conversation.search.results",ne)});let b=null,w=null,C=null,T=null,N=null,I=0;const S=V([]);function _(){const ne=i.pane,W=d.value[f.value];if(!ne||W===void 0){S.value=[];return}const Q=ne.getBoundingClientRect(),te=[];for(const X of W.getClientRects())te.push({top:`${X.top-Q.top+ne.scrollTop}px`,left:`${X.left-Q.left}px`,width:`${X.width}px`,height:`${X.height}px`});S.value=te}function x(ne,W){return ne.type==="attributes"&&ne.target===W?!0:E(ne)}function E(ne){const W=Q=>Q instanceof Element&&(Q.classList.contains("tsearch-rings")||Q.closest(".tsearch-rings")!==null);if(W(ne.target))return!0;if(ne.type==="childList"){const Q=[...ne.addedNodes,...ne.removedNodes];if(Q.length>0&&Q.every(W))return!0}return!1}function M(){S.value.length!==0&&(N!==null&&clearTimeout(N),N=setTimeout(()=>{N=null,_()},120))}function R(){return i.pane?.querySelector(".chat")??null}function q(){if(b!==null&&(clearTimeout(b),b=null),u.value.trim()===""){c.value=!1,z();return}c.value=!0,b=setTimeout(z,_ft)}function z(ne="first"){b!==null&&(clearTimeout(b),b=null),c.value=!1;const W=R();if(u.value.trim()===""||W===null){d.value=[],v.value=!1,f.value=0,Qw(),_();return}const Q=d.value[f.value],te=Q?.startContainer??null,X=Q?.startOffset??0,ve=Cae(W,u.value.trim()),ce=ve.ranges;if(v.value=ve.truncated,d.value=ce,ce.length===0){f.value=0,D3([],0),_();return}if(ne!==!1){const pe=$(ce);f.value=ne==="backward"?(pe-1+ce.length)%ce.length:pe,B();return}const se=te!==null?ce.findIndex(pe=>pe.startContainer===te&&pe.startOffset===X):-1;f.value=se>=0?se:$(ce),D3(ce,f.value),_()}function $(ne){const W=i.pane?.getBoundingClientRect().top??0,Q=ne.findIndex(te=>{const X=te.getClientRects(),ve=X[X.length-1];return ve!==void 0&&ve.bottom>=W});return Q===-1?0:Q}function B(){const ne=d.value[f.value];D3(d.value,f.value),ne!==void 0&&i.reveal(ne),_()}function P(ne){m.value!==0&&(f.value=(f.value+ne+m.value)%m.value,B())}function H(ne){if(ne.key==="Enter"&&!a(ne)){if(ne.preventDefault(),b!==null){z(ne.shiftKey?"backward":"first");return}P(ne.shiftKey?-1:1)}}function j(ne){ne.key==="Escape"&&(a(ne)||(ne.preventDefault(),ne.stopPropagation(),o("close")))}function G(){const ne=h.value;ne&&(ne.focus(),ne.select())}return t({focusInput:G}),kn(()=>{ft(()=>h.value?.focus()),i.pane&&typeof MutationObserver=="function"&&(C=new MutationObserver(W=>{if(u.value.trim()!==""&&!W.every(Q=>x(Q,i.pane))&&b===null){if(Date.now()-I>=Ift){I=Date.now(),w!==null&&(clearTimeout(w),w=null),z(!1);return}w!==null&&clearTimeout(w),w=setTimeout(()=>{w=null,b===null&&(I=Date.now(),z(!1))},Mft)}}),C.observe(i.pane,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["inert","style","class"]})),i.pane?.addEventListener("scroll",M,{passive:!0});const ne=[i.pane,i.pane?.querySelector(".content-wrap")??null];if(typeof ResizeObserver=="function"){T=new ResizeObserver(()=>_());for(const W of ne)W&&T.observe(W)}}),Ln(()=>{b!==null&&clearTimeout(b),w!==null&&clearTimeout(w),N!==null&&clearTimeout(N),C?.disconnect(),C=null,T?.disconnect(),T=null,i.pane?.removeEventListener("scroll",M),Qw()}),(ne,W)=>(k(),L("div",{class:Re(["tsearch",{mobile:e.mobile}]),role:"search",onKeydown:j},[A("div",kft,[U(p(Ce),{class:"tsearch-icon",name:"search",size:"sm","aria-hidden":"true"}),ai(A("input",{ref_key:"inputRef",ref:h,"onUpdate:modelValue":W[0]||(W[0]=Q=>u.value=Q),type:"text",class:"tsearch-input",placeholder:p(s)("conversation.search.placeholder"),autocapitalize:"off",autocomplete:"off",spellcheck:"false",onInput:q,onKeydown:H,onCompositionstart:W[1]||(W[1]=(...Q)=>p(r)&&p(r)(...Q)),onCompositionend:W[2]||(W[2]=(...Q)=>p(l)&&p(l)(...Q))},null,40,bft),[[ar,u.value]]),c.value?(k(),L("span",wft,[U(p(uo),{size:"sm",label:p(s)("conversation.search.searching")},null,8,["label"])])):ee("",!0),W[6]||(W[6]=A("span",{class:"tsearch-sep","aria-hidden":"true"},null,-1)),U(p(an),{class:"tsearch-close",size:"sm",label:p(s)("conversation.search.close"),tooltip:p(s)("conversation.search.close"),onClick:W[3]||(W[3]=Q=>o("close"))},{default:ue(()=>[U(p(Ce),{name:"close"})]),_:1},8,["label","tooltip"])]),A("div",{class:Re(["tsearch-foot-wrap",{open:g.value}]),inert:!g.value},[A("div",Aft,[U(p(an),{size:"sm",label:p(s)("conversation.search.previous"),tooltip:p(s)("conversation.search.previous"),disabled:m.value===0,onClick:W[4]||(W[4]=Q=>P(-1))},{default:ue(()=>[U(p(Ce),{name:"arrow-up"})]),_:1},8,["label","tooltip","disabled"]),U(p(an),{size:"sm",label:p(s)("conversation.search.next"),tooltip:p(s)("conversation.search.next"),disabled:m.value===0,onClick:W[5]||(W[5]=Q=>P(1))},{default:ue(()=>[U(p(Ce),{name:"arrow-down"})]),_:1},8,["label","tooltip","disabled"]),A("span",xft,F(y.value),1)])],10,Cft),e.pane?(k(),de(us,{key:0,to:e.pane},[A("div",Sft,[(k(!0),L(De,null,Ct(S.value,(Q,te)=>(k(),L("div",{key:te,class:"tsearch-ring",style:sn(Q)},null,4))),128))])],8,["to"])):ee("",!0)],34))}}),Eft=St(Tft,[["__scopeId","data-v-43f7fb07"]]),Lft={key:1,class:"empty-hint"},Nft={class:"empty-hint-title"},Dft={key:1,class:"empty-hint-title is-starting"},Fft={key:2,class:"empty-hint-text"},Bft={key:2,class:"upgrade-banner"},Rft={class:"upgrade-banner-text"},Oft={class:"ws-bar"},$ft={key:0,class:"ws-anchor"},Pft=["aria-expanded"],zft={class:"ws-chip-name"},jft={class:"ws-caption"},Hft=["onClick"],Wft={class:"ws-info"},qft={class:"ws-name"},Uft={class:"ws-path"},Vft={class:"empty-spacer empty-tail"},Kft=["aria-label"],Zft={key:0,class:"undo-toast",role:"status","aria-live":"polite"},Gft={class:"undo-toast-text"},Qft=48,Xm=80,kR=1e3,Yft=420,Jft=3e3,Xft=5e3,eht=1e4,tht=2500,nht=rt({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},restTasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},sessionPlans:{},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},lastTurnReason:{},turnError:{},turnRetry:{},overlayOpen:{type:Boolean},starting:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},authReady:{type:Boolean},managedSignedIn:{type:Boolean},managedMembership:{},starredIds:{},skills:{},skillsLoaded:{type:Boolean},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},recentSessions:{},draftEntry:{},sessionTitle:{},sessionArchived:{type:Boolean},sessionPinned:{type:Boolean},pr:{}},emits:["submit","steer","approval","cancelTask","detachTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","steerQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","login","openMedia","refreshGitStatus","editMessage","quoteAction","selectWorkspace","addWorkspace","selectSession","openPr","renameSession","forkSession","togglePin","archiveSession","restoreSession","exportSession","openSessionAdmin"],setup(e,{expose:t,emit:n}){const{t:i}=Ut(),o=e,s=n,r=V(!1),l=V(null);ld(r,l);const a=V(!1),u=V(null),c=D(()=>o.workspaces?.find(Ne=>Ne.id===o.activeWorkspaceId)?.name??o.workspaceName??""),{sidebarTabs:d}=em(),f=D(()=>!o.mobile&&!o.starting&&o.draftEntry==="workspace"&&d.value),h=D(()=>(o.workspaces?.length??0)>0),m=D(()=>o.authReady===!1&&(o.models?.length??0)===0&&o.managedSignedIn===!0&&o.managedMembership==="free"),g=D(()=>Rae(o.workspaces??[],o.activeWorkspaceId));function v(Ie){if(r.value){r.value=!1;return}const Ne=Ie.currentTarget?.closest(".ws-anchor"),nt=Ne?.closest(".panes");if(Ne instanceof HTMLElement&&nt instanceof HTMLElement){const Pt=Ne.getBoundingClientRect(),ln=nt.getBoundingClientRect(),Dn=ln.bottom-Pt.bottom-4,Yn=Pt.top-ln.top-4;a.value=Yn>Dn;const jn=Math.max(0,Math.floor(a.value?Yn:Dn));u.value=`min(calc(var(--space-8) * 10), ${jn}px)`}else a.value=!1,u.value=null;r.value=!0}function y(Ie){r.value=!1,Ie!==o.activeWorkspaceId&&s("selectWorkspace",Ie)}xr(xn.contentAlign);const b=V(null),w=V(null),C=V(null),T=V(!1);let N=null;function I(Ie,Ne,nt){const Pt=C.value??w.value;return!Pt||Pt.loadForEdit(Ie)===!1?!1:nt!==void 0&&Pt.restoreDraftEntries?(Pt.restoreDraftEntries(nt),!0):(Pt.loadAttachmentsForEdit(Ne??[]),!0)}function S(Ie,Ne,nt){const Pt=C.value??w.value;return Pt?.insertQuote?Pt.insertQuote(Ie,Ne,nt)!==!1:!1}function _(){const Ie=C.value;return Ie?.hasInsertableComposer!==void 0?Ie.hasInsertableComposer():w.value?.insertQuote!==void 0}function x(){const Ie=C.value??w.value;return Ie?Ie.isEmpty?.()??!0:!0}function E(){T.value=!0,N!==null&&clearTimeout(N),N=setTimeout(()=>{N=null,T.value=!1},2e3)}const M=D(()=>o.tasks.filter(Ie=>Ie.kind==="bash"||Ie.kind==="tool"&&!Ie.id.startsWith("question-"))),R=D(()=>o.tasks.filter(Ie=>Ie.kind==="subagent"&&Ie.runInBackground)),q=D(()=>M.value.filter(Ie=>Ie.state==="run").length),z=D(()=>R.value.filter(Ie=>Ie.state==="run").length);function $(Ie){const Ne=o.tasks,nt=Ne.find(ln=>ln.id===Ie)??Ne.find(ln=>ln.parentToolCallId===Ie);if(nt?.agentId)return nt.agentId;const Pt=Ne.filter(ln=>ln.kind==="subagent"&&!ln.parentToolCallId&&ln.agentId);if(Pt.length===1)return Pt[0].agentId}ii(XV,$);const B=Yt(im),P=Yt(om);function H(Ie,Ne){const nt=Ne??$(Ie);if(nt===void 0)return;const Pt=o.tasks.find(Yn=>Yn.agentId===nt||Yn.id===nt),ln=B?.(Pt?.model),Dn=P?.(Pt?.thinkingEffort);if(!(ln===void 0&&Dn===void 0))return{display:ln,effort:Dn}}ii(eK,H);function j(Ie,Ne){const nt=o.tasks.find(Pt=>Pt.parentToolCallId===Ie);if(nt!==void 0)return nt.state;if(Ne!==void 0)return o.tasks.find(Pt=>(Pt.agentId===Ne||Pt.id===Ne)&&Pt.parentToolCallId===void 0)?.state}ii(tK,j);function G(Ie){const Ne=(o.restTasks??[]).filter(nt=>nt.parentToolCallId===Ie);if(Ne.length!==0)return Ne.some(nt=>nt.status==="running"&&nt.runInBackground!==!0)}ii(Wx,G),ii(df,gs);const ne=D(()=>(o.todos??[]).filter(Ie=>Ie.status==="done").length),W=D(()=>o.goal!=null||M.value.length>0||R.value.length>0||(o.todos?.length??0)>0),Q=V(null),te=D(()=>o.gitInfo?o.changes?.length??0:0);function X(Ie){fe.value||(Q.value=Q.value===Ie?null:Ie)}function ve(){Q.value=null}function ce(){o.goal&&!fe.value&&(Q.value="goal")}We(()=>[o.goal,M.value.length,R.value.length,o.todos?.length,o.planMode,o.sessionPlans],()=>{const Ie=Q.value;if(Ie===null)return;Ie==="goal"&&o.goal!=null||Ie==="bash"&&M.value.length>0||Ie==="subagent"&&R.value.length>0||Ie==="todos"&&(o.todos?.length??0)>0||Ie==="plan"&&(o.planMode===!0||Object.keys(o.sessionPlans??{}).length>0)||ve()});function se(Ie){return bst(Ie,i)}const pe=D(()=>o.turns.filter(Ie=>Ie.role==="user").map((Ie,Ne)=>({id:Ie.id,role:Ie.role,no:Ne+1,title:se(Ie)}))),Z=V(null);function ae(){const Ie=ze.value;if(!Ie)return;const Ne=pe.value;if(Ne.length===0)return;if(Qt()<=Xm){Z.value=Ne[Ne.length-1].id;return}if(re||K===null){const Dn=Ie.scrollTop,Yn=Ie.getBoundingClientRect().top,jn=[];for(const po of Ie.querySelectorAll(".turn-anchor[data-turn-id]")){const ws=po.dataset.turnId;ws&&jn.push({id:ws,top:po.getBoundingClientRect().top-Yn+Dn})}K=jn,re=!1}const nt=new Set(Ne.map(Dn=>Dn.id)),Pt=Ie.scrollTop+Ie.clientHeight/2;let ln=null;for(const Dn of K)nt.has(Dn.id)&&Dn.top<=Pt&&(ln=Dn.id);Z.value=ln??Ne[0].id}let K=null,re=!0;function we(){re=!0}let be=0;function ke(){be||(be=Zi(()=>{be=0,ae()}))}const oe=V(!1);let le=0;function ye(){le||(le=Zi(()=>{le=0,Me()}))}function Ae(){ye(),we()}function Me(){const Ie=ze.value,Ne=!o.mobile&&Ie?Ie.closest(".con")?.querySelector(".conversation-toc"):null,nt=Ne?.querySelector(".toc-bar");let Pt=!1;if(Ie&&Ne&&nt){const ln=nt.getBoundingClientRect(),Dn=Ne.getBoundingClientRect(),Yn=ln.left+ln.width/2;Pt=Array.from(Ie.querySelectorAll(".table-node-wrapper")).some(jn=>{const po=jn.getBoundingClientRect();return po.left<=Yn&&Yn<=po.right&&po.topDn.top})}oe.value!==Pt&&(oe.value=Pt)}const fe=D(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),ie=D(()=>{const Ie=fe.value;if(Ie)return o.pendingQuestionActions?.[Ie.questionId]}),Ee=D(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),qe=D(()=>{const Ie=Ee.value;return Ie?!!o.pendingApprovalActions?.[Ie.approvalId]:!1}),ze=V(null),ht=V(null),gt=V(0),_t=V(0),$t=V(!1),jt=V(null);let Ht=null;function Te(){if(o.turns.length!==0){if($t.value){jt.value?.focusInput();return}Ht=document.activeElement,$t.value=!0}}function Fe(){$t.value=!1,ft(()=>{Ht instanceof HTMLElement&&Ht.isConnected&&Ht.focus(),Ht=null})}We(()=>o.turns.length===0&&!o.sessionLoading,Ie=>{Ie&&$t.value&&Fe()});const Ve=D(()=>({"--panes-scrollbar-width":`${gt.value}px`})),lt=D(()=>({"--chat-dock-height":`${_t.value+Qft}px`}));function Ft(Ie){return Ie instanceof HTMLElement?Ie:Ie&&"$el"in Ie&&Ie.$el instanceof HTMLElement?Ie.$el:null}let Lt=0;function Vt(){Lt||(Lt=Zi(()=>{Lt=0;const Ie=ze.value,Ne=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0;Ne!==gt.value&&(gt.value=Ne);const nt=ht.value?.offsetHeight??0;nt!==_t.value&&(_t.value=nt)}))}function qt(Ie){const Ne=Ft(Ie);Ne!==ze.value&&(ze.value=Ne,Ne&&Tr())}function nn(Ie){const Ne=Ft(Ie);Ne!==ht.value&&(ht.value=Ne??null,Ie&&"loadForEdit"in Ie&&typeof Ie.loadForEdit=="function"&&"focus"in Ie&&typeof Ie.focus=="function"?C.value={loadForEdit:Ie.loadForEdit.bind(Ie),insertQuote:"insertQuote"in Ie&&typeof Ie.insertQuote=="function"?Ie.insertQuote.bind(Ie):void 0,hasInsertableComposer:"hasInsertableComposer"in Ie&&typeof Ie.hasInsertableComposer=="function"?Ie.hasInsertableComposer.bind(Ie):void 0,loadAttachmentsForEdit:"loadAttachmentsForEdit"in Ie&&typeof Ie.loadAttachmentsForEdit=="function"?Ie.loadAttachmentsForEdit.bind(Ie):()=>{},restoreDraftEntries:"restoreDraftEntries"in Ie&&typeof Ie.restoreDraftEntries=="function"?Ie.restoreDraftEntries.bind(Ie):void 0,focus:Ie.focus.bind(Ie),get anyPopupOpen(){return"anyPopupOpen"in Ie&&Ie.anyPopupOpen===!0},isEmpty:"isEmpty"in Ie&&typeof Ie.isEmpty=="function"?Ie.isEmpty.bind(Ie):void 0}:C.value=null,Zo())}const it=V(!0),dt=V(!1),At=V(!1);let un=null;function Qt(){const Ie=ze.value;return Ie?ci-Ie.scrollTop-Ro:0}let ei=0,mi=0,Hi=0,wi=0,Vo=0,ot=0,Ue=0;function st(){return Date.now(){At.value=!1,un=null},900);const Ie=ze.value;if(!Ie)return;const Ne=Ie.scrollTop;if(_n()){ei=Ne;return}if(performance.now()-Hi<100){ei=Ne;return}const nt=Qt();if(st()){it.value=!0,dt.value=!1,ei=Ne;return}Ne1?Ie.scrollHeight-Ne-Ie.clientHeight>1&&(it.value=!1,dt.value=!0):nt<=Xm&&Ne>ei+1&&Date.now()>=wi&&(it.value=!0,dt.value=!1),ei=Ne,ke()}function kt(Ie=!1){const Ne=ze.value;it.value=!0,dt.value=!1,go(),Ne&&(!Ie&&performance.now(){ui=0;const Dn=Math.min(1,(performance.now()-Pt)/Ie),Yn=1-Math.pow(1-Dn,3);Ne.scrollTop=nt+(Ne.scrollHeight-nt)*Yn,ei=Ne.scrollTop,Dn<1?ui=Zi(ln):Vo=0};ui=Zi(ln)}function co(Ie,Ne){return(Ne.closest("[inert]")?.closest(".tool-group, .activity-run, .turn-fold")??Ne).getBoundingClientRect().top-Ie.getBoundingClientRect().top+Ie.scrollTop}function Ns(Ie,Ne){const nt=Array.from(Ie.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(Dn=>({node:Dn,top:co(Ie,Dn)})),Pt=nt.findIndex(Dn=>Dn.top>=Ne),ln=Pt<0?Math.max(0,nt.length-1):Pt;return nt.slice(ln,ln+2).flatMap(Dn=>{const Yn=Dn.node.dataset.scrollAnchorId,jn=Yn??Dn.node.dataset.turnId;return jn?[{kind:Yn?"tool":"turn",id:jn,top:Dn.top}]:[]})}const Ds=new Map;function Fs(Ie,Ne){for(const nt of Ne.anchors){const Pt=nt.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",ln=Ie.querySelector(`[${Pt}="${ur(nt.id)}"]`);if(ln)return co(Ie,ln)-nt.top}return Ie.scrollHeight-Ne.oldHeight}function Fo(Ie,Ne,nt=Ie.scrollTop){return Ie.scrollTop=nt+Fs(Ie,Ne),ei=Ie.scrollTop,Ie.scrollTop}async function Ei(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||Oo.value||!o.hasMoreMessages)return;const Ie=o.sessionId,Ne=ze.value,nt=Ne?.scrollTop??0,Pt={anchors:Ne?Ns(Ne,nt):[],oldHeight:Ne?.scrollHeight??0};gi(Ie,!0),$o();try{if(await ft(),await o.loadOlderMessages(Ie),await ft(),o.sessionId!==Ie){Ds.set(Ie,Pt);return}const ln=ze.value;if(!ln)return;Fo(ln,Pt),Ds.delete(Ie)}finally{gi(Ie,!1)}}function ur(Ie){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ie):Ie.replaceAll(/["\\]/g,"\\$&")}let Mo=null;function go(){Mo!==null&&(clearTimeout(Mo),Mo=null)}function fo(Ie){ko(),it.value=!1,dt.value=Qt()>Xm,Ie.scrollIntoView({behavior:"smooth",block:"center"}),go(),Mo=setTimeout(()=>{Mo=null;const Ne=ze.value;if(!Ne||!Ie.isConnected)return;const nt=Ie.getBoundingClientRect().top+Ie.offsetHeight/2-(Ne.getBoundingClientRect().top+Ne.clientHeight/2);Math.abs(nt)>48&&(Ne.scrollTop+=nt)},480)}function Ir(Ie){const Ne=ze.value;if(!Ne)return;const nt=Ne.querySelector(`.turn-anchor[data-turn-id="${ur(Ie)}"]`);nt&&fo(nt)}function Bo(Ie,Ne){const nt=Ie.startContainer.parentElement;if(nt!==null)for(let Pt=nt;Pt!==null&&Pt!==Ne;Pt=Pt.parentElement){const ln=getComputedStyle(Pt),Dn=/(auto|scroll)/.test(ln.overflowY)&&Pt.scrollHeight>Pt.clientHeight,Yn=/(auto|scroll)/.test(ln.overflowX)&&Pt.scrollWidth>Pt.clientWidth;if(!Dn&&!Yn)continue;const jn=Ie.getClientRects()[0];if(!jn)return;const po=Pt.getBoundingClientRect();Dn&&(Pt.scrollTop+=jn.top+jn.height/2-(po.top+Pt.clientHeight/2)),Yn&&(Pt.scrollLeft+=jn.left+jn.width/2-(po.left+Pt.clientWidth/2))}}function qn(Ie){const Ne=ze.value;if(!Ne)return;const nt=Ie.startContainer.parentElement;ko(),it.value=!1,dt.value=Qt()>Xm,wi=Date.now()+700;const Pt=nt?.closest(".u-text-wrap.is-clamped");if(Pt){Pt.querySelector(".u-text-toggle")?.click(),ft(()=>to(Ie,Ne));return}to(Ie,Ne)}function to(Ie,Ne){const nt=Ie.startContainer.parentElement;Bo(Ie,Ne);const Pt=Ie.getClientRects()[0];if(!Pt){nt instanceof HTMLElement&&fo(nt);return}const ln=Ne.getBoundingClientRect(),Dn=Pt.top+Pt.height/2-(ln.top+Ne.clientHeight/2),Yn=typeof window>"u"||!window.matchMedia("(prefers-reduced-motion: reduce)").matches;Ne.scrollTo({top:Ne.scrollTop+Dn,behavior:Yn?"smooth":"auto"}),go(),Mo=setTimeout(()=>{Mo=null;const jn=ze.value,po=Ie.getClientRects()[0];if(!jn||!po)return;const ws=jn.getBoundingClientRect(),Xl=po.top+po.height/2-(ws.top+jn.clientHeight/2);Math.abs(Xl)>48&&(jn.scrollTop+=Xl)},480)}function fi(){const Ie=ze.value;if(!Ie)return"none";const Ne=Ie.firstElementChild,nt=Ne instanceof HTMLElement?Ne.offsetHeight:0,Pt=ht.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${nt}:${Pt}`}function Zi(Ie){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ie):setTimeout(Ie,16)}function no(Ie){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ie):clearTimeout(Ie)}let Ko=0,ri=0,Li=null,Mi=0;const Ni=V(!1);function _n(){return performance.now(){if(ri=0,!Li)return;if(it.value){Li=null,Ni.value=!1;return}if(performance.now()>=Ko){Li=null,Ni.value=!1,qs();return}const ln=Li.getBoundingClientRect().top-Mi;ln&&(nt.scrollTop+=ln),ri=Zi(Pt)};ri=Zi(Pt)}function qs(){Qt()<=Xm?(it.value=!0,dt.value=!1):(it.value=!1,dt.value=!0)}function Xo(Ie=36,Ne){if(!it.value&&!st()){Ne?.();return}const nt=++Ue;let Pt="",ln=0,Dn=0;ot&&(no(ot),ot=0);const Yn=()=>{if(ot=0,nt!==Ue)return;if(!it.value&&!st()){Ne?.();return}kt(!1);const jn=fi();ln=jn===Pt?ln+1:0,Pt=jn,Dn++,ln<3&&Dn0&&Ne.length>=Ie.length&&Ie.firstId!==Ne.firstId&&Ie.lastId===Ne.lastId&&Ie.lastTextLen===Ne.lastTextLen&&Ie.lastThinkingLen===Ne.lastThinkingLen&&Ie.lastToolsLen===Ne.lastToolsLen&&Ie.approvalIds===Ne.approvalIds}const vo=D(()=>{const Ie=(o.approvals??[]).map(Dn=>Dn.approvalId).join(","),Ne=o.turns,nt=Ne.at(-1),Pt=nt?.thinking?.length??0,ln=nt?.tools?.reduce((Dn,Yn)=>Dn+Yn.name.length+(Yn.arg?.length??0)+(Yn.output?.join("").length??0),0)??0;return{length:Ne.length,firstId:Ne[0]?.id??"",lastId:nt?.id??"",lastTextLen:nt?.text.length??0,lastThinkingLen:Pt,lastToolsLen:ln,approvalIds:Ie}});let Ji=o.fileReloadKey;We(vo,async(Ie,Ne)=>{const nt=o.fileReloadKey,Pt=nt!==Ji;if(Ji=nt,Oo.value&&Us(Ne,Ie)){ke();return}if(Pt){ke();return}await ft(),it.value||st()?kt(Ie.length{Zo()}),We(()=>o.mobile,async()=>{await ft(),Vt()});const Oi=new Map,$i=V(!1);let je=0,Se=null;function Pe(){$i.value=!0,je&&(no(je),je=0),Se&&clearTimeout(Se),Se=setTimeout(()=>{$i.value=!1,Se=null},1200)}function on(){if(!$i.value)return;let Ie=2;const Ne=()=>{if(je=0,Ie--,Ie>0){je=Zi(Ne);return}$i.value=!1,Se&&(clearTimeout(Se),Se=null)};je&&no(je),je=Zi(Ne)}We(()=>o.fileReloadKey,async(Ie,Ne)=>{const nt=ze.value;Ne&&nt&&Oi.set(String(Ne),{top:nt.scrollTop,following:it.value}),ko(),Pe(),await ft();const Pt=ze.value,ln=Ie?Oi.get(String(Ie)):void 0;if(ln&&Pt){const Dn=Ds.get(String(Ie)),Yn=Dn?Fo(Pt,Dn,ln.top):ln.top;Dn&&Ds.delete(String(Ie)),it.value=ln.following,Pt.scrollTop=Yn,ei=Pt.scrollTop,dt.value=!ln.following&&Qt()>1,ln.following?Xo(36,on):on()}else it.value=!0,ei=0,kt(!1),Xo(36,on);we(),ae()}),We(()=>o.sessionLoading,async(Ie,Ne)=>{Ie||!Ne||(it.value=!0,await ft(),Xo(36,on),ke())}),We(()=>o.turnActive,async(Ie,Ne)=>{Ie||!Ne||!it.value&&!st()||(await ft(),Xo(48),ke())});function Zn(){it.value=!0,dt.value=!1,mi=Date.now()+kR,ft(()=>{kt(!0),Xo(16)})}function Gn(Ie){Zn(),s("submit",Ie)}function Xi(Ie){it.value=!0,dt.value=!1,mi=Date.now()+kR,s("editMessage",{...Ie,text:lU(Ie.text)})}function ti(Ie){const Ne=o.queued?.[Ie],nt=Ne?.editText??Ne?.text??"";I(nt,Ne?.attachments)&&s("editQueued",Ie)}function vs(Ie){s("reorderQueue",Ie)}function ys(Ie,Ne){Zn(),s("answer",Ie,Ne)}function Je(Ie,Ne){!Ie||!Ne||s("approval",Ie,Ne)}let Ye=null,wt=null,Bt=null,Bn=null,ci=0,Ro=0,yo=0;const ni=V(new Set),Oo=D(()=>!!o.sessionId&&ni.value.has(o.sessionId));function gi(Ie,Ne){const nt=new Set(ni.value);Ne?nt.add(Ie):nt.delete(Ie),ni.value=nt}function cr(){Oo.value||yo||(yo=Zi(()=>{yo=0,!Oo.value&&(_n()||(it.value||st())&&kt(!1))}))}function $o(){Ue++,ot&&(no(ot),ot=0),yo&&(no(yo),yo=0)}function ko(){const Ie=ze.value;if(mi=0,wi=0,$o(),Ko=0,Li=null,Ni.value=!1,ui&&(no(ui),ui=0),go(),Ie){const Ne=Ie.scrollTop;typeof Ie.scrollTo=="function"?Ie.scrollTo({top:Ne,behavior:"auto"}):Ie.scrollTop=Ne}Vo=0,Hi=Number.NEGATIVE_INFINITY,Ie&&(ei=Ie.scrollTop)}function Bs(){const Ie=ze.value;!Ie||Ie.scrollHeight-Ie.clientHeight<=1&&!o.hasMoreMessages||(it.value=!1,ko(),Ie.scrollHeight-Ie.clientHeight>1&&(dt.value=!0))}function Vs(Ie){const Ne=ze.value;if(!Ne)return!1;for(const nt of Ie.composedPath()){if(nt===Ne)return!1;if(nt instanceof HTMLElement&&nt.scrollHeight>nt.clientHeight+1&&nt.scrollTop>1)return!0}return!1}function ks(Ie){Ie.defaultPrevented||Ie.ctrlKey||Ie.shiftKey||(go(),!(Ie.deltaY>=0||Vs(Ie))&&Bs())}function Al(Ie){const Ne=ze.value;if(!Ne||Ie.defaultPrevented||Ie.button!==0||Ie.pointerType==="touch")return;const nt=Ne.getBoundingClientRect(),Pt=Ne.offsetWidth-Ne.clientWidth,ln=Pt>0?Pt:12;Ie.target===Ne&&Ie.clientX>=nt.right-ln&&Bs()}let Yr=null;function Zl(Ie){Yr=Ie.touches.length===1?Ie.touches[0].clientY:null}function _a(Ie){const Ne=Ie.touches.length===1?Ie.touches[0].clientY:null;go(),Ne!==null&&Yr!==null&&Ne>Yr+2&&!Vs(Ie)&&Bs(),Yr=Ne}function Gl(){if(!wt)return;const Ie=ze.value?.firstElementChild??null;Ie!==Bt&&(Bt&&wt.unobserve(Bt),Bt=Ie,Ie&&wt.observe(Ie))}function Zo(){if(!wt)return;const Ie=ht.value;Ie!==Bn&&(Bn&&wt.unobserve(Bn),Bn=Ie,Ie&&wt.observe(Ie))}function Tr(){const Ie=ze.value;Vt(),Ye&&(Ye.disconnect(),Ie&&Ye.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),wt&&(wt.disconnect(),Bt=null,Bn=null,Ie&&wt.observe(Ie),Gl(),Zo()),ci=Ie?.scrollHeight??0,Ro=Ie?.clientHeight??0,ye(),we()}function dr(){Gl(),cr(),ye(),we()}function tu(){typeof document>"u"||document.visibilityState==="visible"&&it.value&&Xo()}const xl=V(!1);let bo=null;function Sl(){xl.value=!0,bo!==null&&clearTimeout(bo),bo=setTimeout(()=>{xl.value=!1},Jft)}const Rs=V(null);let bs=null;const ho=V(null);let _l=null,Ml=!1;function Ql(){Rs.value=null,ho.value=null,Ml=!1,bs!==null&&(clearTimeout(bs),bs=null),_l!==null&&(clearTimeout(_l),_l=null)}function Il(){for(let Ie=o.turns.length-1;Ie>=0;Ie--){const Ne=o.turns[Ie];if(Ne.goalContinuation)return null;if(Ne.role==="user")return Ne}return null}function fr(){if(Rs.value!==null||ho.value!==null||!o.working||(o.queued?.length??0)>0)return;const Ie=Il();if(Ie===null||Ie.pluginCommand!==void 0||Ie.skillActivation!==void 0&&!vU(Ie.skillActivation,{revivePill:!0}))return;o.turns.slice(o.turns.indexOf(Ie)+1).every(nt=>nt.role==="assistant"&&!ZA(nt))?(ho.value=Ie.id,Ml=!1,_l=setTimeout(()=>{ho.value=null},eht)):Rs.value=Ie.id}let nu=!1,Yl=null;function ju(Ie){if(nu)return;Ql();const Ne=o.turns.find(ln=>ln.id===Ie);if(Ne===void 0||Ne.role!=="user"||Il()?.id!==Ne.id||(C.value??w.value)?.isEmpty?.()===!1)return;nu=!0,Yl=setTimeout(()=>{nu=!1,Yl=null},tht);const Pt=Ne.skillActivation?bx(Ne.skillActivation,{revivePill:!0})??Ne.text:Ne.text;Xi({text:Pt,attachments:oK(Ne)})}function Y(){ho.value===null||o.working||!Ml||ju(ho.value)}We(()=>o.working,(Ie,Ne)=>{if(!(Ne!==!0||Ie)){if(ho.value!==null){Y();return}Rs.value!==null&&bs===null&&(bs=setTimeout(()=>{Rs.value=null,bs=null},Xft))}}),We(()=>Il()?.id??null,(Ie,Ne)=>{Ie!==Ne&&Ql()}),We(()=>o.sessionId,Ql),We(()=>o.queued?.length,Ie=>{(Ie??0)>0&&Ql()});const ge=D(()=>{if(o.lastTurnReason!=="cancelled"||o.working||o.turnActive)return null;const Ie=o.turns[o.turns.length-1];return Ie?.role==="assistant"&&ZA(Ie)?Ie.id:null}),Be=D(()=>o.lastTurnReason==="failed"&&!o.working&&!o.turnActive&&o.turns.length>0);function He(){Zn(),s("submit",{text:i("conversation.turnFailedResumeText"),attachments:[]})}const Qe=D(()=>o.working?null:Rs.value);function Xe(){s("interrupt")}function yt(){return(C.value?.anyPopupOpen??w.value?.anyPopupOpen)===!0}const{handleCompositionStart:Rt,handleCompositionEnd:Kt,isComposingKeyEvent:wn}=bl();let Sn=null;function Un(Ie){Sn=Ie.target}function mn(Ie){const Ne=Ie instanceof Element&&Ie!==document.body?Ie:Sn,nt=tre(Ne,".global-preview");if(nt){kI(nt);return}const Pt=ze.value?.querySelector(".chat");Pt&&kI(Pt)}function fn(Ie){if(!(Ie.target instanceof Element&&Ie.target.closest(".terminal-host")!==null)){if(Ie.key==="Escape"&&!o.overlayOpen&&!yt()&&!Ie.defaultPrevented&&!Ie.repeat&&!wn(Ie)){Qe.value!==null?(Ie.preventDefault(),ju(Qe.value)):o.working&&(Ie.preventDefault(),fr(),Xe());return}if(cae(Ie)&&!o.overlayOpen&&o.turns.length>0){Ie.preventDefault(),Te();return}Xse(Ie)&&!o.overlayOpen&&!ere(Ie.target)&&(Ie.preventDefault(),mn(Ie.target))}}function Qn(){it.value&&cr()}kn(()=>{ft(()=>{typeof MutationObserver=="function"&&(Ye=new MutationObserver(dr)),typeof ResizeObserver=="function"&&(wt=new ResizeObserver(()=>{ye(),we(),Vt();const Ie=ze.value;if(!Ie)return;const{scrollHeight:Ne,clientHeight:nt}=Ie,Pt=Ne>ci+1,ln=nt{ze.value?.removeEventListener("kimi-table-layout",Ae),Ye&&Ye.disconnect(),wt&&wt.disconnect(),yo&&no(yo),ot&&no(ot),ri&&no(ri),ui&&no(ui),le&&no(le),be&&no(be),Mo!==null&&clearTimeout(Mo),un&&clearTimeout(un),bo!==null&&clearTimeout(bo),bs!==null&&clearTimeout(bs),_l!==null&&clearTimeout(_l),Yl!==null&&clearTimeout(Yl),N!==null&&(clearTimeout(N),N=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",tu),document.removeEventListener("keydown",fn),document.removeEventListener("pointerdown",Un,!0),document.removeEventListener("compositionstart",Rt),document.removeEventListener("compositionend",Kt)),window.visualViewport?.removeEventListener("resize",Qn)});function On(){(C.value??w.value)?.focus()}lPe({sessionId:()=>o.sessionId,mobile:()=>o.mobile===!0,starting:()=>o.starting===!0,dockedComposer:C,emptyComposer:w});function Ci(){Sl()}function io(Ie){if(ho.value!==null){if(!Ie){Ml||Ql();return}Ml=!0,Y()}}const hr=Yt(Uo),Fc=D(()=>hr?.isVisible()??!1),Jl=D(()=>!o.mobile&&hr!==void 0&&!Fc.value&&o.turns.length===0&&!o.sessionLoading);async function Tl(){hr?.togglePanel(),await ft(),document.querySelector(".ptb-hide")?.focus()}return t({loadComposerForEdit:I,insertComposerQuote:S,hasInsertableComposer:_,isComposerEmpty:x,focusComposer:On,notifyUndone:Ci,onAbortOutcome:io,selectAllRegion:mn,focusGoal:ce,closeDockPanel:ve,composerPopupOpen:yt}),(Ie,Ne)=>(k(),L("section",{class:Re(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(k(),de(Alt,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":te.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:T.value,archived:e.sessionArchived,pinned:e.sessionPinned,onCopyAll:Ne[0]||(Ne[0]=nt=>b.value?.copyConversation()),onCopyFinalSummary:Ne[1]||(Ne[1]=nt=>b.value?.copyFinalSummary()),onOpenPr:Ne[2]||(Ne[2]=nt=>e.pr&&s("openPr",e.pr.url)),onRenameSession:Ne[3]||(Ne[3]=(nt,Pt)=>s("renameSession",nt,Pt)),onForkSession:Ne[4]||(Ne[4]=nt=>s("forkSession",nt)),onTogglePin:Ne[5]||(Ne[5]=nt=>s("togglePin",nt)),onArchiveSession:Ne[6]||(Ne[6]=nt=>s("archiveSession",nt)),onRestoreSession:Ne[7]||(Ne[7]=nt=>s("restoreSession",nt)),onExportSession:Ne[8]||(Ne[8]=nt=>s("exportSession",nt))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied","archived","pinned"])):e.mobile?ee("",!0):(k(),L("div",{key:1,class:Re(["empty-drag",{"macos-desktop":p(Cd)}])},null,2)),Jl.value?(k(),de(p(an),{key:2,class:"empty-panel-btn",label:p(i)("panel.openPanel"),tooltip:p(i)("panel.openPanel"),onClick:Tl},{default:ue(()=>[U(p(Ce),{name:"panel-expand-right",size:"sm"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(wXe),{items:pe.value,"active-turn-id":Z.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:oe.value,onSelect:Ir},null,8,["items","active-turn-id","mobile","session-loading","occluded"]),A("div",{class:"chat-layout",style:sn(lt.value)},[A("div",{ref:qt,class:Re(["panes chat-scroll",{"is-following":it.value,"history-prepending":Oo.value,"is-pinned":Ni.value,scrolling:At.value,"session-settling":$i.value}]),onScrollPassive:In,onWheelPassive:ks,onPointerdownPassive:Al,onTouchstartPassive:Zl,onTouchmovePassive:_a},[A("div",{class:Re(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(k(),L(De,{key:0},[Ne[54]||(Ne[54]=A("div",{class:"empty-spacer"},null,-1)),f.value?(k(),de(cft,{key:0,"workspace-name":c.value,"workspace-root":e.workspaceRoot},null,8,["workspace-name","workspace-root"])):(k(),L("div",Lft,[e.starting?(k(),L("span",Dft,[U(p(uo),{size:"sm"}),A("span",null,F(p(i)("conversation.starting")),1)])):(k(),de(p($$e),{key:0,class:"empty-doodle"},{fallback:ue(()=>[A("span",Nft,F(p(i)("composer.emptyConversationTitle")),1)]),_:1})),e.starting?ee("",!0):(k(),L("span",Fft,F(p(i)("composer.emptyConversation")),1))])),m.value?(k(),L("div",Bft,[U(p(Ce),{class:"upgrade-banner-icon",name:"music",size:"sm"}),A("span",Rft,F(p(i)("composer.upgradeBanner")),1),A("button",{type:"button",class:"upgrade-banner-cta",onClick:Ne[9]||(Ne[9]=nt=>p(pv)())},F(p(i)("sidebar.upgrade")),1)])):ee("",!0),U(VZ,{ref_key:"emptyComposerRef",ref:w,class:"empty-composer","session-id":e.sessionId,running:e.running,working:e.working,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,"skills-loaded":e.skillsLoaded,starting:e.starting,"hide-context":"",onSubmit:Gn,onSteer:Ne[12]||(Ne[12]=nt=>s("steer",nt)),onCommand:Ne[13]||(Ne[13]=nt=>s("command",nt)),onInterrupt:Xe,onUnqueue:Ne[14]||(Ne[14]=nt=>s("unqueue",nt)),onEditQueued:Ne[15]||(Ne[15]=nt=>s("editQueued",nt)),onSetPermission:Ne[16]||(Ne[16]=nt=>s("setPermission",nt)),onSetThinking:Ne[17]||(Ne[17]=nt=>s("setThinking",nt)),onTogglePlan:Ne[18]||(Ne[18]=nt=>s("togglePlan")),onToggleSwarm:Ne[19]||(Ne[19]=nt=>s("toggleSwarm")),onToggleGoal:Ne[20]||(Ne[20]=nt=>s("toggleGoal")),onCreateGoal:Ne[21]||(Ne[21]=nt=>s("createGoal",nt)),onControlGoal:Ne[22]||(Ne[22]=nt=>s("controlGoal",nt)),onFocusGoal:ce,onCompact:Ne[23]||(Ne[23]=nt=>s("compact")),onPickModel:Ne[24]||(Ne[24]=nt=>s("pickModel")),onSelectModel:Ne[25]||(Ne[25]=nt=>s("selectModel",nt)),onLogin:Ne[26]||(Ne[26]=nt=>s("login"))},aO({_:2},[e.starting?void 0:{name:"footer",fn:ue(()=>[A("div",Oft,[h.value?(k(),L("div",$ft,[U(p(Nn),{text:p(i)("conversation.switchWorkspace")},{default:ue(()=>[A("button",{type:"button",class:Re(["ws-chip",{open:r.value}]),"aria-expanded":r.value,onClick:Tt(v,["stop"])},[U(p(Ce),{name:"folder"}),A("span",zft,F(c.value),1),U(p(Ce),{class:"ws-chip-chev",name:"chevron-down",size:"sm"})],10,Pft)]),_:1},8,["text"]),r.value?(k(),L("div",{key:0,ref_key:"wsPanelRef",ref:l,class:Re(["ws-panel",{up:a.value}]),style:sn(u.value?{maxHeight:u.value}:void 0),role:"menu"},[A("div",jft,F(p(i)("workspace.recentLabel")),1),(k(!0),L(De,null,Ct(g.value,nt=>(k(),L("button",{key:nt.id,type:"button",class:Re(["ws-row",{on:nt.id===e.activeWorkspaceId}]),role:"menuitem",onClick:Tt(Pt=>y(nt.id),["stop"])},[U(p(Ce),{name:"folder"}),A("span",Wft,[A("span",qft,F(nt.name),1),A("span",Uft,F(nt.shortPath),1)]),nt.id===e.activeWorkspaceId?(k(),de(p(Ce),{key:0,class:"ws-check",name:"check",size:"sm"})):ee("",!0)],10,Hft))),128)),Ne[53]||(Ne[53]=A("div",{class:"ws-divider"},null,-1)),A("button",{type:"button",class:"ws-action",role:"menuitem",onClick:Ne[10]||(Ne[10]=Tt(nt=>{r.value=!1,s("addWorkspace")},["stop"]))},[U(p(Ce),{name:"folder-plus"}),A("span",null,F(p(i)("conversation.pickFolder")),1)])],6)):ee("",!0)])):(k(),L("button",{key:1,type:"button",class:"ws-chip ws-ghost",onClick:Ne[11]||(Ne[11]=nt=>s("addWorkspace"))},[U(p(Ce),{name:"folder-plus"}),A("span",null,F(p(i)("conversation.pickFolder")),1)]))])]),key:"0"}]),1032,["session-id","running","working","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","swarm-mode","goal-mode","goal","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","skills-loaded","starting"]),r.value?(k(),L("div",{key:3,class:"ws-backdrop",onClick:Ne[27]||(Ne[27]=nt=>r.value=!1)})):ee("",!0),A("div",Vft,[f.value&&(e.recentSessions?.length??0)>0?(k(),de(yft,{key:0,sessions:e.recentSessions??[],onSelectSession:Ne[28]||(Ne[28]=nt=>s("selectSession",nt)),onOpenSessionAdmin:Ne[29]||(Ne[29]=nt=>s("openSessionAdmin",e.activeWorkspaceId??void 0))},null,8,["sessions"])):ee("",!0)])],64)):(k(),de(p(OP),{key:1},{default:ue(()=>[(k(),de(p(vS),{ref_key:"chatPaneRef",ref:b,key:e.fileReloadKey??"no-session",turns:e.turns,cwd:e.status.cwd,approvals:e.approvals,questions:e.questions,"turn-active":e.turnActive,working:e.working,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":it.value,queued:e.queued,"undo-hint-turn-id":Qe.value,"interrupted-turn-id":ge.value,"turn-failed":Be.value,"turn-error":e.turnError??null,"turn-retry":e.turnRetry??null,onResumeTurn:He,onOpenMedia:Ne[30]||(Ne[30]=nt=>s("openMedia",nt)),onDetach:Ne[31]||(Ne[31]=nt=>s("detachTask",nt)),onCopyConversationCopied:E,onEditMessage:Xi,onQuoteAction:Ne[32]||(Ne[32]=nt=>s("quoteAction",nt)),onArmedUndo:ju,onLoadOlderMessages:Ei,onUnqueue:Ne[33]||(Ne[33]=nt=>s("unqueue",nt)),onEditQueued:ti,onReorderQueue:vs,onSteerQueued:Ne[34]||(Ne[34]=nt=>s("steerQueued",nt))},null,8,["turns","cwd","approvals","questions","turn-active","working","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued","undo-hint-turn-id","interrupted-turn-id","turn-failed","turn-error","turn-retry"]))]),_:1}))],2)],34),e.turns.length===0&&!e.sessionLoading?ee("",!0):(k(),de(oft,{key:0,ref:nn,style:sn(Ve.value),"session-id":e.sessionId,running:e.running,working:e.working,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"auth-ready":e.authReady,"managed-signed-in":e.managedSignedIn,"managed-membership":e.managedMembership,"starred-ids":e.starredIds,skills:e.skills,"skills-loaded":e.skillsLoaded,goal:e.goal,"session-plans":e.sessionPlans,"dock-panel":Q.value,"overlay-open":e.overlayOpen,"bash-tasks":M.value,"subagent-tasks":R.value,"bash-running":q.value,"subagent-running":z.value,"todo-done-count":ne.value,"has-dock-work":W.value,todos:e.todos,"pending-question":fe.value,"question-busy-kind":ie.value,"pending-approval":Ee.value,"approval-busy":qe.value,mobile:e.mobile,onToggleDockPanel:Ne[35]||(Ne[35]=nt=>X(nt)),onCloseDockPanel:Ne[36]||(Ne[36]=nt=>ve()),onAnswer:ys,onDismiss:Ne[37]||(Ne[37]=nt=>s("dismiss",nt)),onApproval:Je,onCancelTask:Ne[38]||(Ne[38]=nt=>s("cancelTask",nt)),onControlGoal:Ne[39]||(Ne[39]=nt=>s("controlGoal",nt)),onSubmit:Gn,onSteer:Ne[40]||(Ne[40]=nt=>s("steer",nt)),onCommand:Ne[41]||(Ne[41]=nt=>s("command",nt)),onInterrupt:Xe,onSetPermission:Ne[42]||(Ne[42]=nt=>s("setPermission",nt)),onSetThinking:Ne[43]||(Ne[43]=nt=>s("setThinking",nt)),onTogglePlan:Ne[44]||(Ne[44]=nt=>s("togglePlan")),onToggleSwarm:Ne[45]||(Ne[45]=nt=>s("toggleSwarm")),onToggleGoal:Ne[46]||(Ne[46]=nt=>s("toggleGoal")),onCreateGoal:Ne[47]||(Ne[47]=nt=>s("createGoal",nt)),onFocusGoal:ce,onCompact:Ne[48]||(Ne[48]=nt=>s("compact")),onPickModel:Ne[49]||(Ne[49]=nt=>s("pickModel")),onSelectModel:Ne[50]||(Ne[50]=nt=>s("selectModel",nt)),onLogin:Ne[51]||(Ne[51]=nt=>s("login"))},null,8,["style","session-id","running","working","starting","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","swarm-mode","goal-mode","activation-badges","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","skills-loaded","goal","session-plans","dock-panel","overlay-open","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))],4),$t.value?(k(),de(Eft,{key:3,ref_key:"transcriptSearchRef",ref:jt,pane:ze.value,mobile:e.mobile,reveal:qn,onClose:Fe},null,8,["pane","mobile"])):ee("",!0),U(mo,{name:"pill"},{default:ue(()=>[dt.value&&e.turns.length>0?(k(),L("button",{key:0,class:"newmsg-pill",style:sn({bottom:`${_t.value+12}px`}),"aria-label":p(i)("conversation.jumpToLatestAria"),onClick:Ne[52]||(Ne[52]=nt=>kt(!0))},[U(p(Ce),{class:"pill-chevron",name:"arrow-down",size:"sm"}),Oe(" "+F(p(i)("conversation.newMessages")),1)],12,Kft)):ee("",!0)]),_:1}),U(mo,{name:"undo-toast"},{default:ue(()=>[xl.value?(k(),L("div",Zft,[A("span",Gft,F(p(i)("conversation.undone")),1)])):ee("",!0)]),_:1})],2))}}),iht=St(nht,[["__scopeId","data-v-ac65bbbb"]]);function Y4(){[...document.querySelectorAll(".ch-panel, .empty-panel-btn, .session-admin .sa-back")].find(n=>n.getClientRects().length>0)?.focus()}function uh(){ft(()=>{const e=document.querySelector(".ptb-tab.on .ptb-tab-main");if(e){e.focus();return}Y4()})}const oht={class:"panel-tab-bar"},sht=["aria-selected","tabindex","title","onClick","onKeydown"],rht={class:"ptb-t"},lht=["aria-label","tabindex","onClick"],aht={class:"ptb-tail"},uht=rt({__name:"PanelTabBar",props:{tabs:{},activeTabId:{},expanded:{type:Boolean},visible:{type:Boolean},canExpand:{type:Boolean},canOpenDiff:{type:Boolean},canOpenBtw:{type:Boolean}},emits:["activate","close","add","toggleExpanded","hide"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=Lc();function r(S){return Fp[S.type].icon}const l=V(null);We(()=>n.activeTabId,async()=>{await ft(),l.value?.querySelector(".ptb-tab.on")?.scrollIntoView({inline:"nearest",block:"nearest"})});const a=new Map;function u(S){return _=>{_ instanceof HTMLElement?a.set(S,_):a.delete(S)}}function c(S,_){const x=n.tabs;let E=null;if(S.key==="ArrowLeft")E=Math.max(0,_-1);else if(S.key==="ArrowRight")E=Math.min(x.length-1,_+1);else if(S.key==="Home")E=0;else if(S.key==="End")E=x.length-1;else return;S.preventDefault();const M=x[E];M===void 0||E===_||(i("activate",M.id),a.get(M.id)?.focus())}const d=V(!1),f=V(null),h=V(null);function m(S){const _=S.target;h.value?.el?.contains(_)||f.value?.el?.contains(_)||b()}function g(S){S.key==="Escape"&&(S.stopPropagation(),S.preventDefault(),b({refocus:!0}))}function v(){d.value||(d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("keydown",g,!0),ft(()=>{h.value?.el?.querySelector(".ui-menu-item:not(:disabled)")?.focus()}))}function y(S){if(S.stopPropagation(),d.value){b();return}v()}function b(S){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("keydown",g,!0),S?.refocus&&f.value?.el?.focus()}function w(S){if(S.key!=="ArrowDown"&&S.key!=="ArrowUp")return;S.preventDefault();const _=Array.from(h.value?.el?.querySelectorAll(".ui-menu-item:not(:disabled)")??[]);if(_.length===0)return;const x=_.indexOf(document.activeElement),E=S.key==="ArrowDown"?(x+1)%_.length:(x-1+_.length)%_.length;_[E]?.focus()}function C(S){const _=S.relatedTarget;_&&(h.value?.el?.contains(_)||f.value?.el?.contains(_))||b()}We(()=>n.visible,S=>{S||b()}),We(()=>n.activeTabId,()=>b()),Ln(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("keydown",g,!0)});function T(S){b({refocus:!0}),i("add",S)}function N(S){i("close",S),uh()}function I(){i("hide"),ft(Y4)}return(S,_)=>(k(),L("div",oht,[A("div",{ref_key:"tabsEl",ref:l,class:"ptb-tabs",role:"tablist"},[(k(!0),L(De,null,Ct(e.tabs,(x,E)=>(k(),L("div",{key:x.id,class:Re(["ptb-tab",{on:x.id===e.activeTabId}])},[A("button",{ref_for:!0,ref:u(x.id),type:"button",class:"ptb-tab-main",role:"tab","aria-selected":x.id===e.activeTabId,tabindex:x.id===e.activeTabId?0:-1,title:x.title,onClick:M=>i("activate",x.id),onKeydown:M=>c(M,E)},[U(p(Ce),{name:r(x),size:"sm"},null,8,["name"]),A("span",rht,F(x.title),1)],40,sht),A("button",{type:"button",class:"ptb-x","aria-label":p(o)("panel.closeTab"),tabindex:x.id===e.activeTabId?0:-1,onClick:M=>N(x.id)},[U(p(Ce),{name:"close",size:"sm"})],8,lht)],2))),128))],512),A("div",aht,[U(p(an),{ref_key:"addBtnRef",ref:f,size:"sm",label:p(o)("panel.newTab"),tooltip:p(o)("panel.newTab"),"aria-haspopup":"menu","aria-expanded":d.value,onClick:y,onKeydown:[Yo(Tt(v,["prevent"]),["down"]),Yo(Tt(v,["prevent"]),["up"])],onFocusout:C},{default:ue(()=>[U(p(Ce),{name:"plus"})]),_:1},8,["label","tooltip","aria-expanded","onKeydown"]),e.canExpand&&e.tabs.length>0?(k(),de(p(an),{key:0,size:"sm",label:e.expanded?p(o)("panel.collapse"):p(o)("panel.expand"),tooltip:e.expanded?p(o)("panel.collapse"):p(o)("panel.expand"),onClick:_[0]||(_[0]=x=>i("toggleExpanded"))},{default:ue(()=>[U(p(Ce),{name:e.expanded?"collapse":"expand"},null,8,["name"])]),_:1},8,["label","tooltip"])):ee("",!0),U(p(an),{class:"ptb-hide",size:"sm",label:p(o)("panel.hide"),tooltip:p(o)("panel.hide"),onClick:I},{default:ue(()=>[U(p(Ce),{name:p(s)?"close":"panel-collapse-right"},null,8,["name"])]),_:1},8,["label","tooltip"])]),d.value?(k(),de(p(Hs),{key:0,ref_key:"addMenuRef",ref:h,class:"panel-add-menu",onKeydown:w,onFocusout:C},{default:ue(()=>[U(p(tn),{disabled:!e.canOpenBtw,size:p(s)?"lg":"md",onClick:_[1]||(_[1]=x=>T("btw"))},{default:ue(()=>[U(p(Ce),{name:"message"}),Oe(" "+F(p(o)("sideChat.title")),1)]),_:1},8,["disabled","size"]),U(p(tn),{disabled:!e.canOpenDiff,size:p(s)?"lg":"md",onClick:_[2]||(_[2]=x=>T("diff"))},{default:ue(()=>[U(p(Ce),{name:"git-fork"}),Oe(" "+F(p(o)("panel.tabs.diff")),1)]),_:1},8,["disabled","size"])]),_:1},512)):ee("",!0)]))}}),cht=St(uht,[["__scopeId","data-v-808fd300"]]),dht=["aria-label"],fht=rt({__name:"PanelLauncher",props:{canOpenDiff:{type:Boolean},canOpenBtw:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Ut(),s=Lc();return(r,l)=>(k(),L("div",{class:"pl",role:"group","aria-label":p(o)("panel.launcherAria")},[U(p(tn),{role:"button",size:p(s)?"lg":"md",disabled:!n.canOpenDiff,onClick:l[0]||(l[0]=a=>i("open","diff"))},{default:ue(()=>[U(p(Ce),{name:"git-fork",size:"sm"}),Oe(" "+F(p(o)("panel.tabs.diff")),1)]),_:1},8,["size","disabled"]),U(p(tn),{role:"button",size:p(s)?"lg":"md",disabled:!n.canOpenBtw,onClick:l[1]||(l[1]=a=>i("open","btw"))},{default:ue(()=>[U(p(Ce),{name:"message",size:"sm"}),Oe(" "+F(p(o)("sideChat.title")),1)]),_:1},8,["size","disabled"])],8,dht))}}),hht=St(fht,[["__scopeId","data-v-445e1a28"]]),pht={file:I$e,diff:GXe,"turn-diff":Zet,compaction:Het,agent:pXe,btw:Cet};function mht(e,t){const{panel:n,client:i,filePreview:o}=t,s=()=>{n.closeTab(e.id),uh()};switch(e.type){case"file":{const r=e.payload;return{file:o.previewFile.value,loading:o.previewLoading.value,error:o.previewError.value,line:r.line,downloadUrl:o.previewDownloadUrl.value,closable:!0,externalActions:o.previewExternalActions.value,openFile:l=>n.openFilePreview(l),onClose:s,onOpenExternal:()=>o.openPreviewInEditor(),onReveal:()=>o.revealPreviewFile()}}case"diff":return{mode:n.detailDiffMode.value,changes:i.changes.value,gitInfo:i.gitInfo.value,fileDiff:i.fileDiff.value,fullTexts:i.fileDiffTexts.value,emptyFile:i.fileDiffEmptyFile.value,selectedDiffPath:i.selectedDiffPath.value,fileDiffLoading:i.fileDiffLoading.value,closable:!0,onOpen:r=>void n.selectDiffFile(r),onBack:()=>{n.detailDiffMode.value="list",n.detailDiffPath.value=null,i.clearFileDiff()},onClose:()=>{n.closeDiffDetail(),uh()}};case"turn-diff":return{change:e.payload.change,cwd:i.status.value.cwd,closable:!0,onClose:s,onOpenFile:l=>n.openFilePreview({path:l})};case"compaction":{const r=e.payload,l=n.compactionPanelTextOf(r.turnId);return l===null?null:{text:l,subtitle:t.t("conversation.summaryTitle"),onClose:s}}case"agent":{const r=e.payload;return{member:n.agentPanelMemberOf(r),turns:n.agentPanelTurnsOf(r),running:n.agentPanelRunningOf(r),loading:n.agentPanelLoadingOf(r),loadError:n.agentPanelLoadErrorOf(r),hasMore:n.agentPanelHasMoreOf(r),loadingMore:n.agentPanelLoadingMoreOf(r),loadMoreError:n.agentPanelLoadMoreErrorOf(r),onClose:s,onLoadOlderMessages:()=>n.loadOlderAgentMessages(r),onOpenMedia:t.onOpenMedia}}case"btw":{const r=e.payload;return{turns:i.sideChatTurnsOf(r.agentId),running:i.sideChatRunningOf(r.agentId),sending:i.sideChatSendingOf(r.agentId),agentId:r.agentId,title:e.title,onSend:l=>i.sendSideChatPromptOn(r.parentId,r.agentId,l),onClose:s,onOpenMedia:t.onOpenMedia}}default:return null}}const ght=["aria-label","aria-hidden","inert"],vht={class:"pt-body"},yht=rt({__name:"PanelTabs",props:{panel:{},client:{},filePreview:{},onOpenMedia:{type:Function},onOpenBtw:{type:Function}},setup(e,{expose:t}){const n=e,{t:i}=Ut(),o=Lc(),s={panel:n.panel,client:n.client,filePreview:n.filePreview,onOpenMedia:n.onOpenMedia,t:(g,v)=>v===void 0?i(g):i(g,v)},r=D(()=>{if(!n.panel.panelVisible.value)return null;const g=n.panel.activeTab.value;if(!g)return null;const v=pht[g.type];if(!v)return null;const y=mht(g,s);if(!y)return null;const b=g.type==="turn-diff"&&g.payload!==void 0?`${g.id}:${g.payload.turnId}:${g.payload.change.path}`:g.id;return{tabId:g.id,key:b,component:v,props:y}});We(()=>[n.panel.activeTab.value,n.panel.panelVisible.value],([g,v])=>{v&&g?.type==="file"&&g.payload!==void 0?n.filePreview.openFilePreview(g.payload):n.filePreview.closeFilePreview()},{immediate:!0});async function l(g){const v=document.activeElement instanceof HTMLElement&&document.activeElement.closest(".pl")!==null;let y;g==="diff"?n.panel.openDiffDetail():y=n.onOpenBtw();let b=!1;const w=T=>{T instanceof KeyboardEvent&&T.repeat||(b=!0,n.panel.bumpInteractionVersion(),C())},C=()=>{document.removeEventListener("pointerdown",w,!0),document.removeEventListener("keydown",w,!0),window.removeEventListener("blur",w),document.removeEventListener("visibilitychange",w)};g!=="diff"&&(document.addEventListener("pointerdown",w,!0),document.addEventListener("keydown",w,!0),window.addEventListener("blur",w),document.addEventListener("visibilitychange",w));try{const T=await y;if(b||!v||g==="btw"&&T?.sessionId!=null&&T.sessionId!==n.client.activeSessionId.value||!n.panel.panelVisible.value||n.panel.activeTabId.value===null)return;if(await ft(),g==="btw"){u();return}document.querySelector(".ptb-tab.on .ptb-tab-main")?.focus()}finally{C()}}const a=V(null);function u(){a.value?.focusInput?.()}const c=V(null);t({focusSideChatInput:u,rootEl:c});const d=V(null),f=V(0);let h=null;We(d,(g,v)=>{h?.disconnect(),h=null,g!==null&&typeof ResizeObserver<"u"&&(h=new ResizeObserver(()=>{f.value=g.offsetHeight}),h.observe(g)),f.value=g?.offsetHeight??0}),Ln(()=>h?.disconnect());function m(g){c.value?.style.setProperty("--preview-w",`${g}px`)}return We([c,()=>n.panel.previewPanelWidth.value],([g,v])=>g?.style.setProperty("--preview-w",`${v}px`),{immediate:!0}),(g,v)=>(k(),L("aside",{ref_key:"rootEl",ref:c,class:Re(["global-preview",{open:e.panel.panelVisible.value,mobile:p(o),expanded:e.panel.panelExpanded.value}]),role:"complementary","aria-label":p(i)("layout.detailPanelAria"),"aria-hidden":!e.panel.panelVisible.value,inert:!e.panel.panelVisible.value},[e.panel.panelVisible.value&&!p(o)&&!e.panel.panelExpanded.value?(k(),de(p(uZ),{key:0,class:"panel-resize","storage-key":e.panel.PREVIEW_WIDTH_KEY,"default-width":e.panel.previewDefaultWidth.value,min:e.panel.PREVIEW_MIN,max:e.panel.previewMax.value,reverse:"","aria-label":p(i)("layout.resizePreviewAria"),"apply-live":m,"onUpdate:width":v[0]||(v[0]=y=>e.panel.previewWidth.value=y),"onUpdate:dragging":v[1]||(v[1]=y=>e.panel.panelDragging.value=y)},null,8,["storage-key","default-width","min","max","aria-label"])):ee("",!0),A("div",{class:"pt-shell",style:sn({"--pfc-host-h":`${f.value}px`})},[U(cht,{tabs:e.panel.panelTabs.value,"active-tab-id":e.panel.activeTabId.value,expanded:e.panel.panelExpanded.value,visible:e.panel.panelVisible.value,"can-expand":!p(o),"can-open-diff":!!e.client.activeSessionId.value,"can-open-btw":!!(e.client.activeSessionId.value||e.client.activeWorkspaceId.value),onActivate:v[2]||(v[2]=y=>e.panel.activateTab(y)),onClose:v[3]||(v[3]=y=>e.panel.closeTab(y)),onAdd:l,onToggleExpanded:v[4]||(v[4]=y=>e.panel.toggleExpanded()),onHide:v[5]||(v[5]=y=>e.panel.hidePanel())},null,8,["tabs","active-tab-id","expanded","visible","can-expand","can-open-diff","can-open-btw"]),A("div",vht,[r.value?(k(),de(zo(r.value.component),di({key:r.value.key,ref_key:"activePanelRef",ref:a},r.value.props),null,16)):ee("",!0),!r.value&&e.panel.panelTabs.value.length===0?(k(),de(hht,{key:1,"can-open-diff":!!e.client.activeSessionId.value,"can-open-btw":!!(e.client.activeSessionId.value||e.client.activeWorkspaceId.value),onOpen:l},null,8,["can-open-diff","can-open-btw"])):ee("",!0)]),A("div",{ref_key:"pfcHostEl",ref:d,class:"pfc-host"},null,512)],4)],10,ght))}}),kht=St(yht,[["__scopeId","data-v-46c316da"]]),bht={class:"sa-head"},wht={class:"sa-title"},Cht={class:"sa-scroll"},Aht={class:"sa-page"},xht={class:"sa-subtitle"},Sht={class:"sa-f-label"},_ht={class:"sa-f-label"},Mht={class:"sa-f-label"},Iht={class:"sa-f-actions"},Tht=rt({__name:"SessionAdminView",props:{batchRunning:{}},emits:["archiveSessions","restoreSessions"],setup(e,{emit:t}){const{t:n}=Ut(),i=Xa(),o=t,s=D(()=>i.sessionAdminItems.value),r=D(()=>i.sessionAdminTotal.value),l=D(()=>i.sessionAdminLoading.value),a=D(()=>i.sessionAdminPage.value),u=D(()=>i.sessionAdminPageSize.value),c=D(()=>i.workspacesView.value.map(E=>({id:E.id,name:E.name}))),d={"3d":3,"7d":7,"30d":30};function f(E){if(E==="all")return"";const M=new Date;M.setDate(M.getDate()-d[E]);const R=q=>String(q).padStart(2,"0");return`${M.getFullYear()}-${R(M.getMonth()+1)}-${R(M.getDate())}`}function h(E){for(const M of["3d","7d","30d"])if(f(M)===E)return M;return"all"}const m=V([]),g=V("all"),v=V("all");function y(){const E=i.sessionAdminFilters.value;m.value=[...E.workspaceIds],g.value=E.status,v.value=E.updatedFrom===""?h(E.updatedTo):"all"}y(),We(()=>i.mainView.value,E=>{E==="sessionAdmin"&&y()});function b(){i.applySessionAdminFilters({workspaceIds:[...m.value],status:g.value,updatedFrom:"",updatedTo:f(v.value)})}function w(){m.value=[],g.value="all",v.value="all",i.applySessionAdminFilters({workspaceIds:[],status:"all",updatedFrom:"",updatedTo:""})}const C=V(null),T=V(null),N=V(null),I=D(()=>C.value?.open===!0||T.value?.open===!0||N.value?.open===!0);function S(){I.value||b()}const _=D(()=>[{value:"all",label:n("admin.statusAll")},{value:"open",label:n("admin.statusOpen"),dot:"open"},{value:"done",label:n("admin.statusDone"),dot:"done"}]),x=D(()=>[{value:"all",label:n("admin.timeAll")},{value:"3d",label:n("admin.timeDaysAgo",{n:3})},{value:"7d",label:n("admin.timeDaysAgo",{n:7})},{value:"30d",label:n("admin.timeDaysAgo",{n:30})}]);return(E,M)=>(k(),L("section",{class:Re(["con session-admin",{"macos-desktop":p(Cd)}])},[A("header",bht,[U(p(Nn),{text:p(n)("admin.back")},{default:ue(()=>[U(p(an),{class:"sa-back",size:"sm",label:p(n)("admin.back"),onClick:M[0]||(M[0]=R=>p(i).closeSessionAdmin())},{default:ue(()=>[U(p(Ce),{name:"chevron-left"})]),_:1},8,["label"])]),_:1},8,["text"]),A("h1",wht,F(p(n)("admin.title")),1)]),A("div",Cht,[A("div",Aht,[A("p",xht,F(p(n)("admin.subtitle")),1),A("div",{class:"sa-filters",onKeydown:Yo(S,["enter"])},[A("span",Sht,F(p(n)("admin.filterWorkspace")),1),U(p(Vqe),{ref_key:"wsMenuRef",ref:C,modelValue:m.value,"onUpdate:modelValue":M[1]||(M[1]=R=>m.value=R),options:c.value,"aria-label":p(n)("admin.filterWorkspace")},null,8,["modelValue","options","aria-label"]),A("span",_ht,F(p(n)("admin.filterStatus")),1),U(p(UA),{ref_key:"statusSelectRef",ref:T,modelValue:g.value,"onUpdate:modelValue":M[2]||(M[2]=R=>g.value=R),options:_.value,"aria-label":p(n)("admin.filterStatus")},null,8,["modelValue","options","aria-label"]),A("span",Mht,F(p(n)("admin.filterTime")),1),U(p(UA),{ref_key:"timeSelectRef",ref:N,modelValue:v.value,"onUpdate:modelValue":M[3]||(M[3]=R=>v.value=R),options:x.value,"aria-label":p(n)("admin.filterTime")},null,8,["modelValue","options","aria-label"]),A("div",Iht,[U(p(rn),{variant:"primary",size:"sm",onClick:b},{default:ue(()=>[Oe(F(p(n)("admin.query")),1)]),_:1}),U(p(rn),{variant:"ghost",size:"sm",onClick:w},{default:ue(()=>[Oe(F(p(n)("admin.reset")),1)]),_:1})])],32),U(p(RUe),{items:s.value,total:r.value,loading:l.value,workspaces:p(i).workspacesView.value,"batch-running":e.batchRunning,onArchiveSessions:M[4]||(M[4]=R=>o("archiveSessions",R)),onRestoreSessions:M[5]||(M[5]=R=>o("restoreSessions",R))},null,8,["items","total","loading","workspaces","batch-running"]),U(p(sUe),{page:a.value,"page-size":u.value,total:r.value,"onUpdate:page":M[6]||(M[6]=R=>p(i).setSessionAdminPage(R)),"onUpdate:pageSize":M[7]||(M[7]=R=>p(i).setSessionAdminPageSize(R))},null,8,["page","page-size","total"])])])],2))}}),Eht=St(Tht,[["__scopeId","data-v-fd687e8e"]]),Lht=["mask"],Nht=rt({__name:"BrandLogo",props:{size:{default:64}},setup(e){const t=`bl-eyes-${HQ()}`,n=V(null);let i;function o(){const s=n.value;s&&(s.classList.remove("blink-now"),s.getBoundingClientRect(),s.classList.add("blink-now"),clearTimeout(i),i=setTimeout(()=>s.classList.remove("blink-now"),300))}return Xn(()=>clearTimeout(i)),(s,r)=>(k(),L("svg",{ref_key:"logoRef",ref:n,class:"brand-logo",style:sn({width:`${e.size}px`,height:`${e.size*22/32}px`}),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:o},[A("defs",null,[A("mask",{id:t,maskUnits:"userSpaceOnUse"},[...r[0]||(r[0]=[A("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"},null,-1),A("g",{class:"ch-eyes",fill:"#000"},[A("rect",{class:"ch-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),A("rect",{class:"ch-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})],-1)])])]),A("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--logo)",mask:`url(#${t})`},null,8,Lht)],4))}}),z1=St(Nht,[["__scopeId","data-v-0904de71"]]),Dht={key:0,class:"nb-cards"},Fht={key:1,class:"center-body"},Bht={class:"center-text"},Rht={key:2,class:"nb"},Oht={class:"nb-hero"},$ht={class:"nb-hero-icon"},Pht={key:0,class:"nb-hero-title"},zht={class:"nb-hero-hint"},jht={class:"nb-manual"},Hht={class:"nb-manual-label"},Wht={key:3,class:"center-body"},qht={class:"center-text success-text"},Uht={class:"center-hint"},Vht={class:"center-body"},Kht={class:"center-text err-text"},Zht={class:"center-hint"},Ght={class:"actions"},Qht={class:"center-body"},Yht={class:"center-text err-text"},Jht={class:"center-hint"},Xht={class:"actions"},ept={class:"center-body"},tpt={class:"center-text warn-text"},npt={class:"center-hint"},ipt={class:"actions"},opt=rt({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function},onGetOAuthRegion:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Ut(),i=V(!0),o=t,s=e,{step:r,pollError:l,flow:a,secondsLeft:u,autoOpenBlocked:c,startFlow:d,cancelFlow:f}=sK({onStartOAuthLogin:s.onStartOAuthLogin,onPollOAuthLogin:s.onPollOAuthLogin,onCancelOAuthLogin:s.onCancelOAuthLogin,onSuccess:()=>{o("success"),o("close")},autoOpen:bZ(),authWake:wZ()}),h=V(!1),m=V("choice"),g=[{region:"mainland-cn",titleKey:"login.regionCnTitle",hintKey:"login.regionCnHint"},{region:"global",titleKey:"login.regionOverseasTitle",hintKey:"login.regionOverseasHint"}],v={titleKey:"login.oauthTitle",hintKey:"login.oauthHint"},y=V("pending"),b=D(()=>G$(y.value,g,v)),w=D(()=>a.value?.verificationUriComplete??"");kn(()=>{s.onGetOAuthRegion?.().then(_=>{y.value=_===null?"unsupported":"supported"})});function C(_){m.value="flow",d(_)}async function T(){!a.value||!await Ls(w.value)||(h.value=!0,setTimeout(()=>{h.value=!1},2e3))}function N(){mS(w.value)&&window.open(w.value,"_blank","noopener,noreferrer")}async function I(){f(),o("close")}function S(_){const x=Math.floor(_/60),E=_%60;return`${x}:${String(E).padStart(2,"0")}`}return(_,x)=>(k(),de(p(ef),{open:i.value,"onUpdate:open":x[3]||(x[3]=E=>i.value=E),size:m.value==="choice"?"md":"sm",title:p(n)("login.title"),"close-on-overlay":!1,onClose:I},{default:ue(()=>[m.value==="choice"?(k(),L("div",Dht,[(k(!0),L(De,null,Ct(b.value,E=>(k(),de(p(sw),{key:E.region??"oauth",disabled:E.disabled,onSelect:M=>C(E.region)},{leading:ue(()=>[U(z1,{size:40})]),hint:ue(()=>[Oe(F(p(n)(E.hintKey)),1)]),default:ue(()=>[Oe(" "+F(p(n)(E.titleKey))+" ",1)]),_:2},1032,["disabled","onSelect"]))),128))])):p(r)==="starting"?(k(),L("div",Fht,[U(p(uo),{size:"md"}),A("span",Bht,F(p(n)("login.starting")),1)])):p(r)==="device-code"&&p(a)?(k(),L("div",Rht,[A("div",Oht,[A("span",$ht,[U(z1,{size:48})]),p(c)?(k(),L("div",Pht,F(p(n)("login.blockedTitle")),1)):ee("",!0),A("div",zht,F(p(c)?p(n)("login.blockedHint"):p(n)("login.openedHint",{time:S(p(u))})),1)]),p(c)?(k(),de(p(rn),{key:0,variant:"primary",onClick:N},{default:ue(()=>[Oe(F(p(n)("login.authorizeInBrowser"))+" ",1),U(p(Ce),{name:"external-link",size:"sm"})]),_:1})):ee("",!0),A("div",jht,[A("span",Hht,[Oe(F(p(n)("login.notOpened"))+" ",1),U(p(rn),{variant:"text",class:Re(["nb-copy-text",{"is-copied":h.value}]),onClick:T},{default:ue(()=>[Oe(F(h.value?p(n)("login.copied"):p(n)("login.copyLink")),1)]),_:1},8,["class"])])])])):p(r)==="success"?(k(),L("div",Wht,[U(p(md),{kind:"success"}),A("span",qht,F(p(n)("login.success")),1),A("span",Uht,F(p(n)("login.successHint")),1)])):p(r)==="denied"?(k(),L(De,{key:4},[A("div",Vht,[U(p(md),{kind:"expired"}),A("span",Kht,F(p(n)("login.deniedTitle")),1),A("span",Zht,F(p(n)("login.expiredHint")),1)]),A("div",Ght,[U(p(rn),{variant:"primary",onClick:x[0]||(x[0]=E=>p(d)())},{default:ue(()=>[Oe(F(p(n)("login.retry")),1)]),_:1}),U(p(rn),{variant:"secondary",onClick:I},{default:ue(()=>[Oe(F(p(n)("login.closeBtn")),1)]),_:1})])],64)):p(r)==="expired"?(k(),L(De,{key:5},[A("div",Qht,[U(p(md),{kind:"expired"}),A("span",Yht,F(p(n)("login.expiredTitle")),1),A("span",Jht,F(p(n)("login.expiredHint")),1)]),A("div",Xht,[U(p(rn),{variant:"primary",onClick:x[1]||(x[1]=E=>p(d)())},{default:ue(()=>[Oe(F(p(n)("login.retry")),1)]),_:1}),U(p(rn),{variant:"secondary",onClick:I},{default:ue(()=>[Oe(F(p(n)("login.closeBtn")),1)]),_:1})])],64)):p(r)==="error"?(k(),L(De,{key:6},[A("div",ept,[U(p(md),{kind:"error"}),A("span",tpt,F(p(l)?p(n)("login.pollErrorTitle"):p(n)("login.errorTitle")),1),A("span",npt,F(p(l)?p(n)("login.pollErrorHint"):p(n)("login.errorHint")),1)]),A("div",ipt,[U(p(rn),{variant:"primary",onClick:x[2]||(x[2]=E=>p(d)())},{default:ue(()=>[Oe(F(p(n)("login.retry")),1)]),_:1}),U(p(rn),{variant:"secondary",onClick:I},{default:ue(()=>[Oe(F(p(n)("login.closeBtn")),1)]),_:1})])],64)):ee("",!0)]),_:1},8,["open","size","title"]))}}),spt=St(opt,[["__scopeId","data-v-d880fe1a"]]),KZ=rt({__name:"LanguageSwitcher",props:{size:{default:"md"}},setup(e){const{locale:t}=Ut(),n=V4.map(o=>({value:o.code,label:o.label}));function i(o){t.value!==o&&kS(o)}return(o,s)=>(k(),de(p(Is),{"model-value":p(t),options:p(n),size:e.size,"onUpdate:modelValue":i},null,8,["model-value","options","size"]))}}),rpt={class:"sec"},lpt={class:"sec-title"},apt={class:"pu-group"},upt={key:0,class:"pu-row pu-state"},cpt={key:1,class:"pu-row pu-state"},dpt={class:"pu-error-text"},fpt={key:2,class:"pu-row pu-state pu-empty"},hpt={class:"pu-main"},ppt={class:"pu-label"},mpt={key:0,class:"pu-hint"},gpt={class:"pu-value"},vpt=["aria-valuenow","aria-valuemax"],ypt={key:0,class:"sec"},kpt={class:"sec-title"},bpt={class:"pu-group"},wpt={class:"pu-row"},Cpt={class:"pu-main"},Apt={class:"pu-label"},xpt={class:"pu-value"},Spt={key:0,class:"pu-value-sub"},_pt={key:0,class:"pu-meter"},Mpt={class:"pu-row"},Ipt={class:"pu-main"},Tpt={class:"pu-label"},Ept={class:"pu-value"},Lpt={class:"pu-row"},Npt={class:"pu-main"},Dpt={class:"pu-label"},Fpt={class:"pu-value"},Bpt=rt({__name:"PlanUsageCard",props:{onFetchUsage:{type:Function}},setup(e){const t=e,{t:n}=Ut(),i=V(!0),o=V(null);async function s(){i.value=!0;try{o.value=await t.onFetchUsage()}finally{i.value=!1}}kn(s);const r=D(()=>o.value?.kind==="ok"?o.value:null),l=D(()=>r.value?.extraUsage??null),a=D(()=>{const g=r.value;return g===null?[]:g.summary===null?g.limits:[g.summary,...g.limits]}),u=D(()=>a.value.length>0),c=D(()=>o.value?.kind==="error"?o.value.message:n("settings.planUsage.loadFailed")),d=D(()=>o.value?.kind==="error"&&(o.value.status===402||o.value.status===403)),f=D(()=>l.value!==null&&l.value.monthlyChargeLimitEnabled&&l.value.monthlyChargeLimitCents>0);function h(g,v){const y=bse(g,v);return`${y.symbol}${y.number}`}function m(g){return g.resetAt===void 0?"":eP(g.resetAt,n)}return(g,v)=>d.value?(k(),de(p(SZ),{key:0})):(k(),L(De,{key:1},[A("section",rpt,[A("h3",lpt,F(p(n)("settings.planUsage.title")),1),A("div",apt,[i.value?(k(),L("div",upt,[U(p(uo),{size:"sm"})])):r.value===null?(k(),L("div",cpt,[A("span",dpt,F(c.value),1),U(p(rn),{variant:"ghost",size:"sm",onClick:s},{default:ue(()=>[Oe(F(p(n)("settings.planUsage.retry")),1)]),_:1})])):u.value?(k(!0),L(De,{key:3},Ct(a.value,(y,b)=>(k(),L("div",{key:b,class:"pu-row"},[A("span",hpt,[A("span",ppt,F(p(X$)(y,p(n))),1),m(y)?(k(),L("span",mpt,F(m(y)),1)):ee("",!0)]),A("span",gpt,F(p(n)("settings.planUsage.usedPct",{pct:p(Sy)(y.used,y.limit)})),1),A("span",{class:"pu-meter",role:"progressbar","aria-valuenow":y.used,"aria-valuemax":y.limit},[A("i",{class:Re(`sev-${p(Iw)(y.used,y.limit)}`),style:sn({width:`${p(Sy)(y.used,y.limit)}%`})},null,6)],8,vpt)]))),128)):(k(),L("div",fpt,F(p(n)("settings.planUsage.empty")),1))])]),l.value!==null?(k(),L("section",ypt,[A("h3",kpt,F(p(n)("settings.planUsage.boosterTitle")),1),A("div",bpt,[A("div",wpt,[A("span",Cpt,[A("span",Apt,F(p(n)("settings.planUsage.monthlyUsed")),1)]),A("span",xpt,[Oe(F(h(l.value.monthlyUsedCents,l.value.currency)),1),f.value?(k(),L("span",Spt," / "+F(h(l.value.monthlyChargeLimitCents,l.value.currency)),1)):ee("",!0)]),f.value?(k(),L("span",_pt,[A("i",{class:Re(`sev-${p(Iw)(l.value.monthlyUsedCents,l.value.monthlyChargeLimitCents)}`),style:sn({width:`${p(Sy)(l.value.monthlyUsedCents,l.value.monthlyChargeLimitCents)}%`})},null,6)])):ee("",!0)]),A("div",Mpt,[A("span",Ipt,[A("span",Tpt,F(p(n)("settings.planUsage.monthlyLimit")),1)]),A("span",Ept,[f.value?(k(),L(De,{key:0},[Oe(F(h(l.value.monthlyChargeLimitCents,l.value.currency)),1)],64)):(k(),L(De,{key:1},[Oe(F(p(n)("settings.planUsage.unlimited")),1)],64))])]),A("div",Lpt,[A("span",Npt,[A("span",Dpt,F(p(n)("settings.planUsage.boosterBalance")),1)]),A("span",Fpt,F(h(l.value.balanceCents,l.value.currency)),1)])])])):ee("",!0)],64))}}),ZZ=St(Bpt,[["__scopeId","data-v-b460ecbf"]]),Rpt=["aria-label"],Opt={class:"settings-tabs-header"},$pt={class:"settings-dialog-title"},Ppt={class:"settings-tab-list"},zpt=["aria-selected","onClick"],jpt={class:"settings-region"},Hpt={class:"settings-region-header"},Wpt={class:"panel"},qpt={class:"sec"},Upt={class:"sec-title"},Vpt={class:"settings-group"},Kpt={class:"row"},Zpt={class:"rlabel"},Gpt={class:"hint"},Qpt={class:"row language-row"},Ypt={class:"rlabel"},Jpt={class:"hint"},Xpt={class:"row font-size-row"},e1t={class:"rlabel"},t1t={class:"hint"},n1t={class:"sec notification-settings"},i1t={class:"sec-title"},o1t={class:"settings-group"},s1t={class:"row"},r1t={class:"rlabel"},l1t={class:"hint"},a1t={key:0,class:"hint"},u1t={class:"row"},c1t={class:"rlabel"},d1t={class:"hint"},f1t={class:"panel"},h1t={class:"sec"},p1t={class:"sec-title"},m1t={class:"settings-group"},g1t={class:"account-row"},v1t={class:"account-avatar","aria-hidden":"true"},y1t=["src"],k1t={class:"account-meta"},b1t={class:"account-name-row"},w1t={class:"account-name"},C1t={class:"account-sub"},A1t={key:0,class:"panel"},x1t={class:"panel"},S1t={class:"sec"},_1t={class:"sec-head"},M1t={class:"sec-title"},I1t={class:"settings-group"},T1t={class:"row"},E1t={class:"rlabel"},L1t={class:"hint"},N1t={key:0,class:"select-wrap"},D1t={key:1,class:"rvalue mono"},F1t={class:"row"},B1t={class:"rlabel"},R1t={class:"hint"},O1t={class:"row"},$1t={class:"rlabel"},P1t={class:"hint"},z1t={key:0,class:"rvalue mono"},j1t={key:1,class:"rvalue mono"},H1t={key:3,class:"rvalue mono"},W1t={class:"row"},q1t={class:"rlabel"},U1t={class:"hint"},V1t={key:1,class:"empty-config"},K1t={key:0,class:"sec"},Z1t={class:"sec-head"},G1t={class:"sec-title"},Q1t={class:"settings-group"},Y1t={class:"row"},J1t={class:"rlabel"},X1t={class:"hint"},emt={key:0,class:"select-wrap"},tmt={key:1,class:"rvalue mono"},nmt={class:"panel"},imt={class:"sec"},omt={class:"sec-title"},smt={class:"settings-group"},rmt={class:"row"},lmt={class:"rlabel"},amt={class:"hint"},umt={class:"rvalue"},cmt={class:"row"},dmt={class:"rlabel"},fmt={class:"hint"},hmt={class:"rvalue-wrap"},pmt={class:"rvalue"},mmt={class:"row"},gmt={class:"rlabel"},vmt={class:"hint"},ymt={class:"rvalue-wrap"},kmt={class:"rvalue"},bmt={key:0,class:"row"},wmt={class:"rlabel"},Cmt={key:0,class:"hint"},Amt={key:1,class:"hint"},xmt={key:1,class:"row"},Smt={class:"rlabel"},_mt={class:"hint"},Mmt={key:0,class:"sec"},Imt={class:"sec-title"},Tmt={class:"settings-group"},Emt={class:"row"},Lmt={class:"rlabel"},Nmt={class:"hint"},Dmt={class:"hint"},Fmt={class:"sec"},Bmt={class:"sec-title"},Rmt={class:"settings-group"},Omt={class:"row"},$mt={class:"rlabel"},Pmt={class:"hint"},zmt={key:0,class:"hint"},jmt={class:"sec"},Hmt={class:"sec-title"},Wmt={class:"settings-group"},qmt={class:"row"},Umt={class:"rlabel"},Vmt={class:"hint"},Kmt={class:"row"},Zmt={class:"rlabel"},Gmt={class:"hint"},Qmt={class:"panel"},Ymt={class:"sec"},Jmt={class:"sec-title"},Xmt={class:"settings-group"},egt={class:"row"},tgt={class:"rlabel"},ngt={class:"hint"},igt={class:"panel"},ogt={class:"panel-head"},sgt={class:"panel-title"},rgt={class:"panel-desc"},lgt={class:"archive-toolbar"},agt={class:"archive-search"},ugt=["placeholder"],cgt={key:0,class:"archive-empty"},dgt={key:0,class:"archive-list"},fgt={class:"archive-workspace"},hgt={class:"path"},pgt={class:"count"},mgt={class:"setting-card"},ggt={class:"archive-meta"},vgt={class:"archive-name"},ygt={class:"archive-time"},kgt={key:1,class:"archive-empty"},bgt=100,wgt=rt({__name:"SettingsDialog",props:{colorScheme:{},fontScale:{},initialTab:{},managedProviderStatus:{},managedUserInfo:{},onFetchUsage:{type:Function},notify:{type:Boolean},notifyPermission:{},notifySound:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},experimentalFlags:{}},emits:["setColorScheme","setFontScale","setNotify","setNotifySound","login","logout","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Ut(),{sidebarTabs:i,setSidebarTabs:o}=em(),{turnFolding:s,setTurnFolding:r}=Ux(),{activityRunFolding:l,setActivityRunFolding:a}=Vx();function u(it){o(it)}const c=e,d=t,f=D(()=>c.managedProviderStatus==="authenticated"),h=D(()=>f.value?c.managedUserInfo?.nickname||n("sidebar.defaultUserName"):n("sidebar.notSignedIn")),m=D(()=>c.managedUserInfo?.userLevelName?.trim()??""),g=V(!1);We(()=>c.managedUserInfo?.avatar,()=>{g.value=!1});const v=D(()=>!!c.managedUserInfo?.avatar&&!g.value),y=D(()=>f.value?n("settings.signedIn"):n("settings.signedOutHint")),b=V(c.initialTab??"general"),w=V(!1);let C=null;function T(){w.value=!0,C&&clearTimeout(C),C=setTimeout(()=>{w.value=!1,C=null},900)}const N=[{id:"general",labelKey:"settings.tabs.general",icon:"sliders"},{id:"agent",labelKey:"settings.tabs.agent",icon:"robot"},{id:"account",labelKey:"settings.tabs.account",icon:"user"},{id:"providers",labelKey:"settings.tabs.providers",icon:"bolt"},{id:"advanced",labelKey:"settings.tabs.advanced",icon:"microscope"},{id:"lab",labelKey:"settings.tabs.lab",icon:"flask"},{id:"archived",labelKey:"settings.tabs.archived",icon:"archive"}],I=nct(),S=V(!1),_=V(!1);function x(){c.serverVersion&&Ls(c.serverVersion).then(it=>{it&&(S.value=!0,setTimeout(()=>{S.value=!1},1500))})}function E(){Ls(I).then(it=>{it&&(_.value=!0,setTimeout(()=>{_.value=!1},1500))})}const M=["manual","yolo","auto"],R={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},q=V(null);BZ(q);const{isConfirmOpen:z}=cf();function $(it){it.key==="Escape"&&!it.defaultPrevented&&!z.value&&d("close")}kn(()=>document.addEventListener("keydown",$)),Ln(()=>{document.removeEventListener("keydown",$),C&&clearTimeout(C)});function B(){qZ()}const P=(()=>{const it="0.38.0".trim()?"0.38.0":"";let dt="";if("2026-08-28T05:12:49.967Z".trim()){const un=new Date("2026-08-28T05:12:49.967Z");if(!Number.isNaN(un.getTime())){const Qt=ei=>String(ei).padStart(2,"0");dt=`${un.getFullYear()}-${Qt(un.getMonth()+1)}-${Qt(un.getDate())} ${Qt(un.getHours())}:${Qt(un.getMinutes())}`}}const At=dt===""?it:`${it} · ${dt}`;return At===""?"-":At})(),H=WPe(),j=V(!1),G=V(null);async function ne(){if(!j.value){j.value=!0,G.value=null;try{G.value=await H.check()}finally{j.value=!1}}}const W=D(()=>{const it=G.value;if(it===null)return"";switch(it.outcome){case"available":return H.status.value.state==="downloaded"?n("settings.updateCheckDownloaded",{version:it.version??""}):H.autoDownload.value?n("settings.updateCheckAvailableAuto",{version:it.version??""}):n("settings.updateCheckAvailable",{version:it.version??""});case"latest":return n("settings.updateCheckLatest");case"unsupported":return n("settings.updateCheckUnsupported");case"error":return n("settings.updateCheckFailed")}}),Q=D(()=>{const it=new Map;for(const dt of c.models??[])it.set(dt.id,{id:dt.id,label:dt.displayName??dt.model??dt.id,provider:dt.provider});for(const[dt,At]of Object.entries(c.config?.models??{})){if(it.has(dt))continue;const un=ce(At);it.set(dt,{id:dt,label:se(dt,At,un),provider:un??dt})}return Array.from(it.values())}),te=D(()=>{const it=new Map;for(const dt of Q.value){const At=it.get(dt.provider)??[];At.push(dt),it.set(dt.provider,At)}for(const dt of it.values())dt.sort((At,un)=>At.label.localeCompare(un.label));return Array.from(it.entries()).toSorted(([dt],[At])=>dt.localeCompare(At)).map(([dt,At])=>({provider:dt,options:At}))}),X=D(()=>{const it=te.value.flatMap(dt=>dt.options.map(At=>({value:At.id,label:At.label,group:dt.provider})));return c.config?.defaultModel||it.unshift({value:"",label:n("settings.noDefaultModel"),group:"",disabled:!0}),it}),ve=D(()=>{const it=c.config?.defaultPermissionMode;return it==="auto"||it==="yolo"||it==="manual"?it:"manual"});function ce(it){if(!it||typeof it!="object")return;const dt=it;return typeof dt.provider=="string"?dt.provider:void 0}function se(it,dt,At){if(!dt||typeof dt!="object")return it;const un=dt,Qt=typeof un.model=="string"?un.model:void 0,ei=At??ce(dt);return Qt&&ei?`${it} (${ei}/${Qt})`:Qt?`${it} (${Qt})`:it}function pe(it){return it===!0}function Z(it){!it||it===c.config?.defaultModel||d("updateConfig",{defaultModel:it})}function ae(it){it!==ve.value&&d("updateConfig",{defaultPermissionMode:it})}const K=D(()=>(c.experimentalFlags?.["secondary-model"]??c.config?.experimental?.["secondary-model"])===!0),re=D(()=>c.config?.secondaryModel?.model??""),we=D(()=>c.config?.secondaryModel?.defaultEffort??""),be=D(()=>Object.fromEntries((c.models??[]).map(it=>[it.id,it])));function ke(it){it.model===re.value&&(it.effort??"")===we.value||d("updateConfig",{secondaryModel:it.effort?{model:it.model,defaultEffort:it.effort}:{model:it.model}})}function oe(it){const dt=c.config?.[it];d("updateConfig",{[it]:!pe(dt)})}const le=D(()=>c.config?.defaultModel?be.value[c.config.defaultModel]:void 0),ye=D(()=>K1(le.value)),Ae=D(()=>Z1(le.value));function Me(){return M6(c.config?.thinking,le.value)??hh(le.value)}const fe=D(()=>{const it=Ae.value,dt=Me();return it.includes(dt)?dt:""}),ie=D(()=>Ae.value.map(it=>({value:it,label:Bd(it)})));function Ee(it){const dt=bk(le.value,it);d("updateConfig",{thinking:Ioe(dt,le.value?.supportEfforts)})}function qe(){const it=c.config?.telemetry!==!1;d("updateConfig",{telemetry:!it})}function ze(it){b.value=it}const ht=Xa(),gt=D(()=>f.value&&ht.managedMembership.value==="free"),_t=V([]),$t=V(!1),jt=V(!1),Ht=V(""),Te=V("all"),Fe=V("archived-desc");async function Ve(){if(!($t.value||jt.value)){$t.value=!0;try{const it=[];let dt;for(;;){const At=await ht.loadArchivedSessions({beforeId:dt,pageSize:bgt});if(it.push(...At.items),!At.hasMore||At.items.length===0)break;const un=At.items.at(-1)?.id;if(un===void 0)break;dt=un}_t.value=it,jt.value=!0}catch(it){Ua("loadAllArchived failed",it)}finally{$t.value=!1}}}We(b,it=>{it==="archived"&&!jt.value&&Ve()},{immediate:!0});const lt=D(()=>{const it=new Set;for(const dt of _t.value)it.add(dt.cwd);return Array.from(it).sort((dt,At)=>dt.localeCompare(At))}),Ft=D(()=>[{value:"all",label:n("settings.archivedAllWorkspaces")},...lt.value.map(it=>({value:it,label:it}))]),Lt=D(()=>{const it=Ht.value.trim().toLowerCase();let dt=_t.value.filter(At=>At.archived===!0);return Te.value!=="all"&&(dt=dt.filter(At=>At.cwd===Te.value)),it&&(dt=dt.filter(At=>At.title.toLowerCase().includes(it))),dt=dt.slice(),Fe.value==="archived-desc"?dt.sort((At,un)=>(un.archivedAt??un.updatedAt).localeCompare(At.archivedAt??At.updatedAt)):Fe.value==="created-desc"?dt.sort((At,un)=>un.createdAt.localeCompare(At.createdAt)):dt.sort((At,un)=>At.title.localeCompare(un.title,"zh")),dt}),Vt=D(()=>{const it=new Map;for(const dt of Lt.value){const At=it.get(dt.cwd)??[];At.push(dt),it.set(dt.cwd,At)}return Array.from(it.entries()).map(([dt,At])=>({cwd:dt,items:At}))});async function qt(it){await ht.restoreSession(it)&&(_t.value=_t.value.filter(At=>At.id!==it))}function nn(it){const dt=new Date(it);if(Number.isNaN(dt.getTime()))return it;const At=un=>String(un).padStart(2,"0");return`${dt.getFullYear()}-${At(dt.getMonth()+1)}-${At(dt.getDate())} ${At(dt.getHours())}:${At(dt.getMinutes())}`}return(it,dt)=>(k(),de(p(ef),{open:!0,"close-on-esc":!1,"aria-label":p(n)("settings.title"),size:"xl",height:"fixed",padded:!1,level:"grouped",onClose:dt[15]||(dt[15]=At=>d("close"))},{default:ue(()=>[A("div",{ref_key:"dialogRef",ref:q,class:"sd"},[A("nav",{class:"settings-tabs",role:"tablist","aria-label":p(n)("settings.title")},[A("header",Opt,[A("h2",$pt,F(p(n)("settings.title")),1)]),A("div",Ppt,[(k(),L(De,null,Ct(N,At=>A("button",{key:At.id,type:"button",class:Re(["tab",{on:b.value===At.id}]),role:"tab","aria-selected":b.value===At.id,onClick:un=>ze(At.id)},[U(p(Ce),{name:At.icon,size:"md"},null,8,["name"]),A("span",null,F(p(n)(At.labelKey)),1)],10,zpt)),64))])],8,Rpt),A("section",jpt,[A("header",Hpt,[U(p(an),{size:"sm",label:p(n)("settings.close"),tooltip:p(n)("settings.close"),onClick:dt[0]||(dt[0]=At=>d("close"))},{default:ue(()=>[U(p(Ce),{name:"close",size:"md"})]),_:1},8,["label","tooltip"])]),A("div",{class:Re(["body",{scrolling:w.value}]),onScroll:T},[ai(A("section",Wpt,[A("section",qpt,[A("h3",Upt,F(p(n)("settings.appearance")),1),A("div",Vpt,[A("div",Kpt,[A("span",Zpt,[Oe(F(p(n)("theme.colorSchemeLabel"))+" ",1),A("span",Gpt,F(p(n)("settings.colorSchemeHint")),1)]),U(p(Is),{"model-value":e.colorScheme,options:[{value:"light",label:p(n)("theme.light"),icon:"light-mode"},{value:"dark",label:p(n)("theme.dark"),icon:"dark-mode"},{value:"system",label:p(n)("theme.system")}],"onUpdate:modelValue":dt[1]||(dt[1]=At=>d("setColorScheme",At))},null,8,["model-value","options"])]),A("div",Qpt,[A("span",Ypt,[Oe(F(p(n)("sidebar.language"))+" ",1),A("span",Jpt,F(p(n)("settings.languageHint")),1)]),U(KZ)]),A("div",Xpt,[A("span",e1t,[Oe(F(p(n)("settings.uiFontSize"))+" ",1),A("span",t1t,F(p(n)("settings.uiFontSizeHint")),1)]),U(p(Is),{"model-value":e.fontScale,options:[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],"aria-label":p(n)("settings.uiFontSize"),"onUpdate:modelValue":dt[2]||(dt[2]=At=>d("setFontScale",At))},null,8,["model-value","aria-label"])])])]),A("section",n1t,[A("h3",i1t,F(p(n)("settings.notifications")),1),A("div",o1t,[A("div",s1t,[A("span",r1t,[Oe(F(p(n)("settings.notifyEnabled"))+" ",1),A("span",l1t,F(p(n)("settings.notifyEnabledHint")),1),e.notifyPermission==="denied"?(k(),L("span",a1t,F(p(n)("settings.notifyDenied")),1)):ee("",!0)]),U(p(jc),{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:p(n)("settings.notifyEnabled"),"onUpdate:modelValue":dt[3]||(dt[3]=At=>d("setNotify",At))},null,8,["model-value","disabled","label"])]),A("div",u1t,[A("span",c1t,[Oe(F(p(n)("settings.notifySound"))+" ",1),A("span",d1t,F(p(n)("settings.notifySoundHint")),1)]),U(p(jc),{"model-value":e.notifySound,label:p(n)("settings.notifySound"),"onUpdate:modelValue":dt[4]||(dt[4]=At=>d("setNotifySound",At))},null,8,["model-value","label"])])])])],512),[[Qo,b.value==="general"]]),ai(A("section",f1t,[A("section",h1t,[A("h3",p1t,F(p(n)("settings.account")),1),A("div",m1t,[A("div",g1t,[A("span",v1t,[v.value?(k(),L("img",{key:0,src:c.managedUserInfo?.avatar,alt:"",onError:dt[5]||(dt[5]=At=>g.value=!0)},null,40,y1t)):(k(),de(p(Ce),{key:1,name:"user",size:"md"}))]),A("span",k1t,[A("span",b1t,[A("span",w1t,F(h.value),1),m.value?(k(),de(p(cl),{key:0,class:"account-level",variant:"neutral",size:"sm"},{default:ue(()=>[Oe(F(m.value),1)]),_:1})):ee("",!0)]),A("span",C1t,F(y.value),1)]),f.value?(k(),de(p(rn),{key:0,variant:"danger-soft",size:"sm",onClick:dt[6]||(dt[6]=At=>d("logout"))},{default:ue(()=>[Oe(F(p(n)("sidebar.signOut")),1)]),_:1})):(k(),de(p(rn),{key:1,variant:"primary",size:"sm",onClick:dt[7]||(dt[7]=At=>d("login"))},{default:ue(()=>[Oe(F(p(n)("sidebar.signIn")),1)]),_:1}))])])]),gt.value?(k(),de(p(SZ),{key:0})):f.value?(k(),de(ZZ,{key:1,"on-fetch-usage":c.onFetchUsage},null,8,["on-fetch-usage"])):ee("",!0)],512),[[Qo,b.value==="account"]]),b.value==="providers"?(k(),L("section",A1t,[U(p(Zot))])):ee("",!0),ai(A("section",x1t,[A("section",S1t,[A("div",_1t,[A("h3",M1t,F(p(n)("settings.agentDefaults")),1)]),A("div",I1t,[e.config?(k(),L(De,{key:0},[A("div",T1t,[A("span",E1t,[Oe(F(p(n)("settings.defaultModel"))+" ",1),A("span",L1t,F(p(n)("settings.defaultModelHint")),1)]),te.value.length>0?(k(),L("div",N1t,[U(p(ww),{"model-value":e.config.defaultModel??"",options:X.value,"aria-label":p(n)("settings.defaultModel"),"onUpdate:modelValue":Z},null,8,["model-value","options","aria-label"])])):(k(),L("span",D1t,F(e.config.defaultModel??p(n)("settings.noDefaultModel")),1))]),A("div",F1t,[A("span",B1t,[Oe(F(p(n)("settings.defaultPermission"))+" ",1),A("span",R1t,F(p(n)("settings.defaultPermissionHint")),1)]),U(p(Is),{"model-value":ve.value,options:M.map(At=>({value:At,label:p(n)(R[At])})),"onUpdate:modelValue":dt[8]||(dt[8]=At=>ae(At))},null,8,["model-value","options"])]),A("div",O1t,[A("span",$1t,[Oe(F(p(n)("settings.defaultThinking"))+" ",1),A("span",P1t,F(p(n)("settings.defaultThinkingHint")),1)]),e.config.defaultModel?ye.value==="unsupported"?(k(),L("span",j1t,F(p(n)("status.modeNotSupported")),1)):Ae.value.length>1?(k(),de(p(Is),{key:2,"model-value":fe.value,options:ie.value,"aria-label":p(n)("settings.defaultThinking"),"onUpdate:modelValue":Ee},null,8,["model-value","options","aria-label"])):(k(),L("span",H1t,F(p(Bd)(Ae.value[0]??"on")),1)):(k(),L("span",z1t,F(p(n)("settings.noDefaultModel")),1))]),A("div",W1t,[A("span",q1t,[Oe(F(p(n)("settings.defaultPlanMode"))+" ",1),A("span",U1t,F(p(n)("settings.defaultPlanModeHint")),1)]),U(p(jc),{"model-value":pe(e.config.defaultPlanMode),label:p(n)("settings.defaultPlanMode"),"onUpdate:modelValue":dt[9]||(dt[9]=At=>oe("defaultPlanMode"))},null,8,["model-value","label"])])],64)):(k(),L("div",V1t,F(p(n)("settings.configUnavailable")),1))])]),e.config&&K.value?(k(),L("section",K1t,[A("div",Z1t,[A("h3",G1t,F(p(n)("settings.secondaryModelSection")),1)]),A("div",Q1t,[A("div",Y1t,[A("span",J1t,[Oe(F(p(n)("settings.secondaryModel"))+" ",1),A("span",X1t,F(p(n)("settings.secondaryModelHint")),1)]),te.value.length>0?(k(),L("div",emt,[U(p(ust),{"model-value":re.value,effort:we.value,groups:te.value,"model-info-by-id":be.value,onSelect:ke},null,8,["model-value","effort","groups","model-info-by-id"])])):(k(),L("span",tmt,F(re.value||p(n)("settings.noSecondaryModel")),1))])])])):ee("",!0)],512),[[Qo,b.value==="agent"]]),ai(A("section",nmt,[A("section",imt,[A("h3",omt,F(p(n)("settings.versionAndUpdates")),1),A("div",smt,[A("div",rmt,[A("span",lmt,[Oe(F(p(n)("settings.appVersion"))+" ",1),A("span",amt,F(p(n)("settings.appVersionHint")),1)]),A("span",umt,F(p(P)),1)]),A("div",cmt,[A("span",dmt,[Oe(F(p(n)("settings.serverVersion"))+" ",1),A("span",fmt,F(p(n)("settings.serverVersionHint")),1)]),A("span",hmt,[A("span",pmt,F(e.serverVersion||"-"),1),e.serverVersion?(k(),de(p(an),{key:0,size:"sm",label:S.value?p(n)("settings.copied"):p(n)("settings.copyServerVersion"),tooltip:S.value?p(n)("settings.copied"):p(n)("settings.copyServerVersion"),onClick:x},{default:ue(()=>[S.value?(k(),de(p(Ce),{key:1,class:"sd-check",name:"check",size:"md"})):(k(),de(p(Ce),{key:0,name:"copy",size:"md"}))]),_:1},8,["label","tooltip"])):ee("",!0)])]),A("div",mmt,[A("span",gmt,[Oe(F(p(n)("settings.serverAddress"))+" ",1),A("span",vmt,F(p(n)("settings.serverAddressHint")),1)]),A("span",ymt,[A("span",kmt,F(p(I)),1),U(p(an),{size:"sm",label:_.value?p(n)("settings.copied"):p(n)("settings.copyServerAddress"),tooltip:_.value?p(n)("settings.copied"):p(n)("settings.copyServerAddress"),onClick:E},{default:ue(()=>[_.value?(k(),de(p(Ce),{key:1,class:"sd-check",name:"check",size:"md"})):(k(),de(p(Ce),{key:0,name:"copy",size:"md"}))]),_:1},8,["label","tooltip"])])]),p(H).canCheck?(k(),L("div",bmt,[A("span",wmt,[Oe(F(p(n)("settings.checkUpdate"))+" ",1),W.value?(k(),L("span",Cmt,F(W.value),1)):(k(),L("span",Amt,F(p(n)("settings.checkUpdateHint")),1))]),U(p(rn),{variant:"secondary",size:"sm",disabled:j.value,onClick:ne},{default:ue(()=>[Oe(F(j.value?p(n)("settings.updateChecking"):p(n)("settings.checkUpdateBtn")),1)]),_:1},8,["disabled"])])):ee("",!0),p(H).canToggleAutoDownload?(k(),L("div",xmt,[A("span",Smt,[Oe(F(p(n)("settings.autoDownloadUpdate"))+" ",1),A("span",_mt,F(p(n)("settings.autoDownloadUpdateHint")),1)]),U(p(jc),{"model-value":p(H).autoDownload.value,label:p(n)("settings.autoDownloadUpdate"),"onUpdate:modelValue":dt[10]||(dt[10]=At=>p(H).setAutoDownload(At,"settings"))},null,8,["model-value","label"])])):ee("",!0)])]),e.config?(k(),L("section",Mmt,[A("h3",Imt,F(p(n)("settings.privacy")),1),A("div",Tmt,[A("div",Emt,[A("span",Lmt,[Oe(F(p(n)("settings.telemetry"))+" ",1),A("span",Nmt,F(p(n)("settings.telemetryHint")),1),A("span",Dmt,F(p(n)("settings.telemetryRestartHint")),1)]),U(p(jc),{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:p(n)("settings.telemetry"),"onUpdate:modelValue":dt[11]||(dt[11]=At=>qe())},null,8,["model-value","disabled","label"])])])])):ee("",!0),A("section",Fmt,[A("h3",Bmt,F(p(n)("settings.diagnostics")),1),A("div",Rmt,[A("div",Omt,[A("span",$mt,[Oe(F(p(n)("settings.exportLog"))+" ",1),A("span",Pmt,F(p(n)("settings.exportLogHint")),1),p(eu)()?ee("",!0):(k(),L("span",zmt,F(p(n)("settings.logHint")),1))]),U(p(rn),{variant:"secondary",size:"sm",onClick:B},{default:ue(()=>[Oe(F(p(n)("settings.exportLogBtn")),1)]),_:1})])])]),A("section",jmt,[A("h3",Hmt,F(p(n)("settings.messageFolding")),1),A("div",Wmt,[A("div",qmt,[A("span",Umt,[Oe(F(p(n)("settings.turnFolding"))+" ",1),A("span",Vmt,F(p(n)("settings.turnFoldingHint")),1)]),U(p(jc),{"model-value":p(s),label:p(n)("settings.turnFolding"),"onUpdate:modelValue":p(r)},null,8,["model-value","label","onUpdate:modelValue"])]),A("div",Kmt,[A("span",Zmt,[Oe(F(p(n)("settings.activityRunFolding"))+" ",1),A("span",Gmt,F(p(n)("settings.activityRunFoldingHint")),1)]),U(p(jc),{"model-value":p(l),label:p(n)("settings.activityRunFolding"),"onUpdate:modelValue":p(a)},null,8,["model-value","label","onUpdate:modelValue"])])])])],512),[[Qo,b.value==="advanced"]]),ai(A("section",Qmt,[A("section",Ymt,[A("h3",Jmt,F(p(n)("settings.tabs.lab")),1),A("div",Xmt,[A("div",egt,[A("span",tgt,[Oe(F(p(n)("settings.lab.sidebarTabs"))+" ",1),A("span",ngt,F(p(n)("settings.lab.sidebarTabsHint")),1)]),U(p(jc),{"model-value":p(i),label:p(n)("settings.lab.sidebarTabs"),"onUpdate:modelValue":u},null,8,["model-value","label"])])])])],512),[[Qo,b.value==="lab"]]),ai(A("section",igt,[A("div",ogt,[A("h4",sgt,F(p(n)("settings.archivedTitle")),1),A("p",rgt,F(p(n)("settings.archivedDesc")),1)]),A("div",lgt,[A("label",agt,[dt[16]||(dt[16]=A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[A("circle",{cx:"11",cy:"11",r:"7"}),A("path",{d:"m21 21-4.3-4.3"})],-1)),ai(A("input",{"onUpdate:modelValue":dt[12]||(dt[12]=At=>Ht.value=At),placeholder:p(n)("settings.archivedSearch")},null,8,ugt),[[ar,Ht.value]])]),U(p(ww),{"model-value":Te.value,options:Ft.value,size:"sm","aria-label":p(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":dt[13]||(dt[13]=At=>Te.value=At)},null,8,["model-value","options","aria-label"]),U(p(Is),{size:"sm","model-value":Fe.value,options:[{value:"archived-desc",label:p(n)("settings.archivedSortArchived"),icon:"clock"},{value:"created-desc",label:p(n)("settings.archivedSortCreated"),icon:"calendar-schedule"},{value:"name-asc",label:p(n)("settings.archivedSortName"),icon:"sort"}],"onUpdate:modelValue":dt[14]||(dt[14]=At=>Fe.value=At)},null,8,["model-value","options"])]),$t.value?(k(),L("div",cgt,F(p(n)("settings.archivedLoadingAll")),1)):(k(),L(De,{key:1},[Vt.value.length>0?(k(),L("div",dgt,[(k(!0),L(De,null,Ct(Vt.value,At=>(k(),L("section",{key:At.cwd,class:"archive-card"},[A("div",fgt,[U(p(Ce),{name:"folder-closed",size:"md"}),A("span",hgt,F(At.cwd),1),A("span",pgt,F(p(n)("settings.archivedSessionsCount",{count:At.items.length})),1)]),A("div",mgt,[(k(!0),L(De,null,Ct(At.items,un=>(k(),L("div",{key:un.id,class:"archive-row"},[A("div",ggt,[A("div",vgt,F(un.title),1),A("div",ygt,F(p(n)("settings.archivedAt",{time:nn(un.archivedAt??un.updatedAt)})),1)]),U(p(rn),{variant:"secondary",size:"sm",onClick:Qt=>qt(un.id)},{default:ue(()=>[U(p(Ce),{name:"undo",size:"sm"}),A("span",null,F(p(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(k(),L("div",kgt,F(_t.value.length===0?p(n)("settings.archivedEmpty"):p(n)("settings.archivedNoMatch")),1))],64))],512),[[Qo,b.value==="archived"]])],34)])],512)]),_:1},8,["aria-label"]))}}),Cgt=St(wgt,[["__scopeId","data-v-08ed3275"]]),Agt={class:"actions"},xgt={class:"view-tabs"},Sgt={key:0,class:"mlist"},_gt={key:0,class:"mempty"},Mgt=["onClick"],Igt={class:"mgh-name"},Tgt={class:"mgh-path"},Egt={key:2,class:"att"},Lgt={key:0,class:"mempty small"},Ngt=["onClick"],Dgt={key:0,class:"att"},Fgt={class:"time"},Bgt={key:1,class:"mshow-more-row"},Rgt=["disabled","onClick"],Ogt={key:1,class:"mshow-more-sep","aria-hidden":"true"},$gt=["onClick"],Pgt={key:1,class:"mlist"},zgt={key:0,class:"mempty"},jgt=["onClick"],Hgt={class:"srow-main"},Wgt={class:"srow-sub"},qgt={key:0,class:"att"},Ugt={class:"time"},Vgt={key:1,class:"mshow-more-row"},Kgt=["disabled"],Zgt=rt({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},flatSessions:{},pinnedSessions:{},flatHasMore:{type:Boolean,default:!1},flatLoadingMore:{type:Boolean,default:!1},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore","ensureFlatSessions","loadMoreFlatSessions"],setup(e,{emit:t}){const{t:n}=Ut(),i=e,o=t;function s(){o("update:modelValue",!1)}function r(B){o("select",B),s()}function l(B){o("createInWorkspace",B),s()}function a(){o("create"),s()}function u(){o("addWorkspace"),s()}const c=V(eae()),d=D(()=>[{value:"flat",label:n("mobile.viewFlat")},{value:"grouped",label:n("mobile.viewGrouped")}]);We(c,B=>tae(B)),We(()=>[i.modelValue,c.value],([B,P])=>{B&&P==="flat"&&o("ensureFlatSessions")},{immediate:!0});const f=D(()=>{const B=new Set,P=[];for(const H of[...i.flatSessions,...i.pinnedSessions])B.has(H.id)||(B.add(H.id),P.push(H));return P.sort((H,j)=>new Date(j.updatedAt??0).getTime()-new Date(H.updatedAt??0).getTime())}),h=D(()=>{const B=P=>P.sessions.length>0?new Date(P.sessions[0].updatedAt??0).getTime():0;return i.groups.map((P,H)=>({g:P,index:H,ms:B(P)})).sort((P,H)=>H.ms-P.ms||P.index-H.index).map(P=>P.g)}),m=V(new Set);function g(B){return m.value.has(B)}function v(B){const P=new Set(m.value);P.has(B)?P.delete(B):P.add(B),m.value=P,_.value=null,R.value=null}const y=V(new Map);function b(B){return y.value.get(B.workspace.id)??B.initialCount}function w(B){const P=B.sessions.slice(0,b(B));if(i.activeId&&!P.some(H=>H.id===i.activeId)){const H=B.sessions.find(j=>j.id===i.activeId);if(H)return[...P,H]}return P}function C(B){return B.sessions.length>b(B)||B.hasMore||B.loadingMore}function T(B){return b(B)>B.initialCount}function N(B){const P=i.groups.find(G=>G.workspace.id===B);if(!P)return;const H=b(P)+Kx,j=new Map(y.value);j.set(B,H),y.value=j,P.sessions.length(k(),de(p(y1),{"model-value":e.modelValue,"onUpdate:modelValue":P[5]||(P[5]=H=>o("update:modelValue",H))},{default:ue(()=>[U(RZ),A("div",Agt,[A("button",{type:"button",class:"newrow",onClick:a},[U(p(Ce),{name:"chat-new",size:"sm"}),Oe(" "+F(p(n)("sidebar.newChat")),1)]),A("button",{type:"button",class:"newrow",onClick:u},[U(p(Ce),{name:"folder",size:"sm"}),Oe(" "+F(p(n)("sidebar.newWorkspace")),1)])]),A("div",xgt,[U(p(Is),{modelValue:c.value,"onUpdate:modelValue":P[0]||(P[0]=H=>c.value=H),options:d.value,size:"sm"},null,8,["modelValue","options"])]),c.value==="grouped"?(k(),L("div",Sgt,[h.value.length===0?(k(),L("div",_gt,F(p(n)("workspace.noWorkspace")),1)):ee("",!0),(k(!0),L(De,null,Ct(h.value,H=>(k(),L("div",{key:H.workspace.id,class:"mgroup"},[A("div",{class:Re(["mgh",{on:H.workspace.id===e.activeWorkspaceId}]),onClick:j=>v(H.workspace.id)},[g(H.workspace.id)?(k(),de(p(Ce),{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(k(),de(p(Ce),{key:1,class:"mgh-folder",name:"folder",size:"sm"})),A("span",Igt,F(H.workspace.name),1),U(p(Nn),{text:H.workspace.root},{default:ue(()=>[A("span",Tgt,F(H.workspace.shortPath),1)]),_:2},1032,["text"]),g(H.workspace.id)&&S(H.workspace.id)>0?(k(),L("span",Egt,F(S(H.workspace.id)),1)):ee("",!0),U(p(an),{size:"lg",class:"mgh-more",label:p(n)("sidebar.options"),onClick:Tt(j=>q(H.workspace.id),["stop"])},{default:ue(()=>[U(p(Ce),{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),U(p(an),{size:"lg",class:"mgh-add",label:p(n)("workspace.newInGroup"),onClick:Tt(j=>l(H.workspace.id),["stop"])},{default:ue(()=>[U(p(Ce),{name:"chat-new",size:"md"})]),_:1},8,["label","onClick"]),R.value===H.workspace.id?(k(),de(p(Hs),{key:3,class:"kmenu wsmenu",onClick:P[1]||(P[1]=Tt(()=>{},["stop"]))},{default:ue(()=>[U(p(tn),{size:"lg",onClick:j=>z(H.workspace)},{default:ue(()=>[Oe(F(p(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),U(p(tn),{size:"lg",danger:"",onClick:j=>$(H.workspace)},{default:ue(()=>[Oe(F(p(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ee("",!0)],10,Mgt),ai(A("div",null,[H.sessions.length===0?(k(),L("div",Lgt,F(p(n)("sidebar.noSessions")),1)):ee("",!0),(k(!0),L(De,null,Ct(w(H),j=>(k(),L("div",{key:j.id,class:Re(["srow",{cur:j.id===e.activeId}]),onClick:G=>r(j.id)},[A("span",{class:Re(["t",{run:j.busy,aborted:!j.busy&&(e.attentionBySession[j.id]??0)===0&&j.lastTurnReason==="failed"}])},F(j.title),3),(e.attentionBySession[j.id]??0)>0?(k(),L("span",Dgt,F(e.attentionBySession[j.id]),1)):ee("",!0),A("span",Fgt,F(j.time),1),U(p(an),{size:"lg",class:"kb",label:p(n)("sidebar.options"),onClick:Tt(G=>x(j.id),["stop"])},{default:ue(()=>[U(p(Ce),{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),_.value===j.id?(k(),de(p(Hs),{key:1,class:"kmenu",onClick:P[2]||(P[2]=Tt(()=>{},["stop"]))},{default:ue(()=>[U(p(tn),{size:"lg",onClick:G=>E(j)},{default:ue(()=>[Oe(F(p(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),U(p(tn),{size:"lg",onClick:G=>M(j.id)},{default:ue(()=>[Oe(F(p(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ee("",!0)],10,Ngt))),128)),C(H)||T(H)?(k(),L("div",Bgt,[C(H)?(k(),L("button",{key:0,type:"button",class:"mshow-more",disabled:H.loadingMore,onClick:Tt(j=>N(H.workspace.id),["stop"])},[U(p(Ce),{name:"chevron-down",size:"sm"}),Oe(" "+F(H.loadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,Rgt)):ee("",!0),C(H)&&T(H)?(k(),L("span",Ogt,"·")):ee("",!0),T(H)?(k(),L("button",{key:2,type:"button",class:"mshow-more",onClick:Tt(j=>I(H.workspace.id),["stop"])},[U(p(Ce),{name:"chevron-up",size:"sm"}),Oe(" "+F(p(n)("sidebar.showLess")),1)],8,$gt)):ee("",!0)])):ee("",!0)],512),[[Qo,!g(H.workspace.id)]])]))),128))])):(k(),L("div",Pgt,[f.value.length===0?(k(),L("div",zgt,F(p(n)("sidebar.noSessions")),1)):ee("",!0),(k(!0),L(De,null,Ct(f.value,H=>(k(),L("div",{key:H.id,class:Re(["srow srow-flat",{cur:H.id===e.activeId}]),onClick:j=>r(H.id)},[A("span",Hgt,[A("span",{class:Re(["t",{run:H.busy,aborted:!H.busy&&(e.attentionBySession[H.id]??0)===0&&H.lastTurnReason==="failed"}])},F(H.title),3),A("span",Wgt,F(H.cwdLabel??"-"),1)]),(e.attentionBySession[H.id]??0)>0?(k(),L("span",qgt,F(e.attentionBySession[H.id]),1)):ee("",!0),A("span",Ugt,F(H.time),1),U(p(an),{size:"lg",class:"kb",label:p(n)("sidebar.options"),onClick:Tt(j=>x(H.id),["stop"])},{default:ue(()=>[U(p(Ce),{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),_.value===H.id?(k(),de(p(Hs),{key:1,class:"kmenu",onClick:P[3]||(P[3]=Tt(()=>{},["stop"]))},{default:ue(()=>[U(p(tn),{size:"lg",onClick:j=>E(H)},{default:ue(()=>[Oe(F(p(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),U(p(tn),{size:"lg",onClick:j=>M(H.id)},{default:ue(()=>[Oe(F(p(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ee("",!0)],10,jgt))),128)),e.flatHasMore?(k(),L("div",Vgt,[A("button",{type:"button",class:"mshow-more",disabled:e.flatLoadingMore,onClick:P[4]||(P[4]=Tt(H=>o("loadMoreFlatSessions"),["stop"]))},[U(p(Ce),{name:"chevron-down",size:"sm"}),Oe(" "+F(e.flatLoadingMore?p(n)("sidebar.loadingMore"):p(n)("sidebar.showMore")),1)],8,Kgt)])):ee("",!0)]))]),_:1},8,["model-value"]))}}),Ggt=St(Zgt,[["__scopeId","data-v-aaf2e643"]]),Qgt={class:"group-title"},Ygt={class:"card"},Jgt={class:"srow-main"},Xgt={class:"srow-label"},e0t={class:"srow-sub"},t0t={class:"srow read-only"},n0t={class:"srow-main"},i0t={class:"srow-label"},o0t={key:0,class:"srow-sub"},s0t=["aria-checked"],r0t={class:"srow-main"},l0t={class:"srow-label"},a0t={class:"srow-sub"},u0t=["aria-checked"],c0t={class:"srow-main"},d0t={class:"srow-label"},f0t={class:"srow-sub"},h0t={class:"srow-main"},p0t={class:"srow-label"},m0t={class:"srow-sub"},g0t=["aria-checked"],v0t={class:"srow-main"},y0t={class:"srow-label"},k0t={class:"srow-sub"},b0t={class:"srow-main"},w0t={class:"srow-label"},C0t={class:"srow read-only"},A0t={class:"srow-main"},x0t={class:"srow-label"},S0t={class:"srow-sub"},_0t=["aria-label"],M0t={class:"cache-note"},I0t={class:"group-title"},T0t={class:"card"},E0t={class:"srow read-only pref"},L0t={class:"srow-main"},N0t={class:"srow-label"},D0t={class:"srow read-only pref"},F0t={class:"srow-main"},B0t={class:"srow-label"},R0t={class:"srow read-only pref"},O0t={class:"srow-main"},$0t={class:"srow-label"},P0t=["aria-checked"],z0t={class:"srow-main"},j0t={class:"srow-label"},H0t={class:"srow-sub"},W0t=["aria-checked"],q0t={class:"srow-main"},U0t={class:"srow-label"},V0t={class:"srow-sub"},K0t={key:0,class:"srow read-only"},Z0t={class:"srow-main"},G0t={class:"srow-label"},Q0t={class:"srow-val dim"},Y0t={class:"group-title"},J0t={class:"card"},X0t={class:"srow read-only acct-profile"},evt={class:"acct-avatar","aria-hidden":"true"},tvt=["src"],nvt={class:"srow-main"},ivt={class:"acct-name-row"},ovt={class:"srow-label"},svt={class:"srow-sub"},rvt={class:"srow-main"},lvt={class:"srow-label"},avt={class:"srow-main"},uvt={class:"srow-label"},cvt={key:0,class:"usage"},dvt=rt({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},goalMode:{type:Boolean},goalActive:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},fontScale:{default:"medium"},managedProviderStatus:{default:null},managedUserInfo:{default:null},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleGoal","focusGoal","toggleSwarm","setPermission","setColorScheme","setFontScale","login","logout"],setup(e,{emit:t}){const{t:n}=Ut(),{isConfirmOpen:i}=cf(),{turnFolding:o,setTurnFolding:s}=Ux(),{activityRunFolding:r,setActivityRunFolding:l}=Vx(),a=Xa(),u=e,c=t;function d(G){c("setColorScheme",G)}const f=["manual","yolo","auto"],h=D(()=>u.models?.find(G=>G.id===u.status?.modelId)),m=D(()=>K1(h.value)),g=D(()=>Z1(h.value)),v=D(()=>_6(h.value,u.thinking)),y=D(()=>g.value.includes(v.value)?v.value:""),b=D(()=>g.value.map(G=>({value:G,label:Bd(G)}))),w=D(()=>u.planMode===!0),C=D(()=>u.goalMode===!0);function T(){if(u.goalActive){c("focusGoal");return}!C.value&&w.value&&c("togglePlan"),c("toggleGoal")}function N(){!w.value&&C.value&&c("toggleGoal"),c("togglePlan")}const I=D(()=>u.swarmMode===!0),S=V(!1);We(()=>u.managedUserInfo?.avatar,()=>{S.value=!1});const _=D(()=>!!u.managedUserInfo?.avatar&&!S.value),x=D(()=>u.managedUserInfo?.userLevelName?.trim()??""),E=D(()=>u.managedProviderStatus==="authenticated"),M=D(()=>{const G=u.status.permission;return G==="auto"?"var(--color-danger)":G==="yolo"?"var(--color-warning)":"var(--color-text-muted)"}),R=D(()=>{const G=u.status.permission,ne=n(G==="yolo"?"mobile.permYoloSub":G==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${G} · ${ne}`}),q=D(()=>u.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(u.status.ctxUsed/u.status.ctxMax*100))):0),z=D(()=>u.status.ctxMax>0?`${xc(u.status.ctxUsed)}/${xc(u.status.ctxMax)}`:n("status.statusNone"));function $(G){c("setThinking",bk(h.value,G))}function B(){const G=f.indexOf(u.status.permission),ne=f[(G+1)%f.length];c("setPermission",ne)}function P(){c("pickModel"),c("update:modelValue",!1)}function H(){c("login"),c("update:modelValue",!1)}function j(){c("logout"),c("update:modelValue",!1)}return(G,ne)=>(k(),de(p(y1),{"model-value":e.modelValue,title:p(n)("mobile.settingsTitle"),"close-on-esc":!p(i),"onUpdate:modelValue":ne[5]||(ne[5]=W=>c("update:modelValue",W))},{default:ue(()=>[A("div",Qgt,F(p(n)("mobile.groupSession")),1),A("div",Ygt,[A("button",{type:"button",class:"srow",onClick:P},[A("span",Jgt,[A("span",Xgt,F(p(n)("status.statusModel")),1),A("span",e0t,F(e.status.model),1)]),ne[6]||(ne[6]=A("span",{class:"chev"},"›",-1))]),A("div",t0t,[A("span",n0t,[A("span",i0t,F(p(n)("status.statusThinking")),1),m.value==="unsupported"?(k(),L("span",o0t,F(p(n)("status.modeNotSupported")),1)):ee("",!0)]),g.value.length>1?(k(),de(p(Is),{key:0,"model-value":y.value,options:b.value,size:"sm","onUpdate:modelValue":$},null,8,["model-value","options"])):(k(),L("span",{key:1,class:Re(["srow-val",{dim:v.value==="off"}])},F(v.value==="off"?p(n)("status.planOff"):p(Bd)(v.value)),3))]),A("button",{type:"button",class:"srow",role:"switch","aria-checked":w.value,onClick:N},[A("span",r0t,[A("span",l0t,F(p(n)("status.statusPlanMode")),1),A("span",a0t,F(p(n)("mobile.planModeSub")),1)]),A("span",{class:Re(["toggle",{on:w.value}]),"aria-hidden":"true"},null,2)],8,s0t),e.goalActive?(k(),L("button",{key:1,type:"button",class:"srow",onClick:T},[A("span",h0t,[A("span",p0t,F(p(n)("status.goalLabel")),1),A("span",m0t,F(p(n)("mobile.goalModeSub")),1)]),U(p(Ce),{class:"srow-chevron",name:"chevron-right",size:"sm","aria-hidden":"true"})])):(k(),L("button",{key:0,type:"button",class:"srow",role:"switch","aria-checked":C.value,onClick:T},[A("span",c0t,[A("span",d0t,F(p(n)("status.goalLabel")),1),A("span",f0t,F(p(n)("mobile.goalModeSub")),1)]),A("span",{class:Re(["toggle",{on:C.value}]),"aria-hidden":"true"},null,2)],8,u0t)),A("button",{type:"button",class:"srow",role:"switch","aria-checked":I.value,onClick:ne[0]||(ne[0]=W=>c("toggleSwarm"))},[A("span",v0t,[A("span",y0t,F(p(n)("status.statusSwarmMode")),1),A("span",k0t,F(p(n)("mobile.swarmModeSub")),1)]),A("span",{class:Re(["toggle",{on:I.value}]),"aria-hidden":"true"},null,2)],8,g0t),A("button",{type:"button",class:"srow",onClick:B},[A("span",b0t,[A("span",w0t,F(p(n)("status.statusPermission")),1),A("span",{class:"srow-sub",style:sn({color:M.value})},F(R.value),5)]),ne[7]||(ne[7]=A("span",{class:"chev"},"›",-1))]),A("div",C0t,[A("span",A0t,[A("span",x0t,F(p(n)("status.statusContext")),1),A("span",S0t,F(z.value),1)]),A("span",{class:"ctx-meter","aria-label":z.value},[A("i",{style:sn({width:q.value+"%"})},null,4)],8,_0t)])]),A("div",M0t,F(p(n)("status.cacheNote")),1),A("div",I0t,F(p(n)("mobile.groupApp")),1),A("div",T0t,[A("div",E0t,[A("span",L0t,[A("span",N0t,F(p(n)("theme.colorSchemeLabel")),1)]),U(p(Is),{"model-value":e.colorScheme??"system",options:[{value:"light",label:p(n)("theme.light"),icon:"light-mode"},{value:"dark",label:p(n)("theme.dark"),icon:"dark-mode"},{value:"system",label:p(n)("theme.system")}],"onUpdate:modelValue":d},null,8,["model-value","options"])]),A("div",D0t,[A("span",F0t,[A("span",B0t,F(p(n)("sidebar.language")),1)]),U(KZ)]),A("div",R0t,[A("span",O0t,[A("span",$0t,F(p(n)("settings.uiFontSize")),1)]),U(p(Is),{"model-value":e.fontScale,options:[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],"aria-label":p(n)("settings.uiFontSize"),"onUpdate:modelValue":ne[1]||(ne[1]=W=>c("setFontScale",W))},null,8,["model-value","aria-label"])]),A("button",{type:"button",class:"srow",role:"switch","aria-checked":p(o),onClick:ne[2]||(ne[2]=W=>p(s)(!p(o)))},[A("span",z0t,[A("span",j0t,F(p(n)("settings.turnFolding")),1),A("span",H0t,F(p(n)("settings.turnFoldingHint")),1)]),A("span",{class:Re(["toggle",{on:p(o)}]),"aria-hidden":"true"},null,2)],8,P0t),A("button",{type:"button",class:"srow",role:"switch","aria-checked":p(r),onClick:ne[3]||(ne[3]=W=>p(l)(!p(r)))},[A("span",q0t,[A("span",U0t,F(p(n)("settings.activityRunFolding")),1),A("span",V0t,F(p(n)("settings.activityRunFoldingHint")),1)]),A("span",{class:Re(["toggle",{on:p(r)}]),"aria-hidden":"true"},null,2)],8,W0t),e.serverVersion?(k(),L("div",K0t,[A("span",Z0t,[A("span",G0t,F(p(n)("settings.serverVersion")),1)]),A("span",Q0t,F(e.serverVersion),1)])):ee("",!0)]),A("div",Y0t,F(p(n)("mobile.groupAccount")),1),A("div",J0t,[E.value?(k(),L(De,{key:0},[A("div",X0t,[A("span",evt,[_.value?(k(),L("img",{key:0,src:e.managedUserInfo?.avatar,alt:"",onError:ne[4]||(ne[4]=W=>S.value=!0)},null,40,tvt)):(k(),de(p(Ce),{key:1,name:"user",size:"md"}))]),A("span",nvt,[A("span",ivt,[A("span",ovt,F(e.managedUserInfo?.nickname||p(n)("sidebar.defaultUserName")),1),x.value?(k(),de(p(cl),{key:0,class:"acct-level",variant:"neutral",size:"sm"},{default:ue(()=>[Oe(F(x.value),1)]),_:1})):ee("",!0)]),A("span",svt,F(p(n)("settings.signedIn")),1)])]),A("button",{type:"button",class:"srow acct out",onClick:j},[A("span",rvt,[A("span",lvt,F(p(n)("sidebar.signOut")),1)])])],64)):(k(),L("button",{key:1,type:"button",class:"srow acct in",onClick:H},[A("span",avt,[A("span",uvt,F(p(n)("sidebar.signIn")),1)])]))]),E.value&&e.modelValue?(k(),L("div",cvt,[U(ZZ,{"on-fetch-usage":p(a).getUsage},null,8,["on-fetch-usage"])])):ee("",!0)]),_:1},8,["model-value","title","close-on-esc"]))}}),fvt=St(dvt,[["__scopeId","data-v-f46669a7"]]),hvt={key:0,class:"ls-done-card"},pvt={class:"ls-done-badge"},mvt={class:"ls-card-text"},gvt={class:"ls-card-title"},vvt={class:"ls-card-hint"},yvt={key:1,class:"ls-cards"},kvt={class:"ls-card-icon"},bvt={key:2,class:"ls-flow"},wvt={key:0,class:"ls-center"},Cvt={class:"ls-center-text"},Avt={key:1,class:"ls-device"},xvt={class:"ls-hero"},Svt={class:"ls-hero-icon"},_vt={key:0,class:"ls-hero-title"},Mvt={class:"ls-hero-hint"},Ivt={class:"ls-manual"},Tvt={class:"ls-manual-label"},Evt={key:2,class:"ls-center"},Lvt={class:"ls-center-text ls-success-text"},Nvt={class:"ls-center-hint"},Dvt={class:"ls-center"},Fvt={class:"ls-center-text ls-err-text"},Bvt={class:"ls-center-hint"},Rvt={class:"ls-actions"},Ovt={class:"ls-center"},$vt={class:"ls-center-text ls-err-text"},Pvt={class:"ls-center-hint"},zvt={class:"ls-actions"},jvt={class:"ls-center"},Hvt={class:"ls-center-text ls-warn-text"},Wvt={class:"ls-center-hint"},qvt={class:"ls-actions"},Uvt=rt({__name:"OnboardingLoginStep",props:{authReady:{type:Boolean},onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function},onGetOAuthRegion:{type:Function}},emits:["success","addProvider"],setup(e,{emit:t}){const{t:n}=Ut(),i=Lc(),o=e,s=t,r=V("choice"),{step:l,pollError:a,flow:u,secondsLeft:c,autoOpenBlocked:d,startFlow:f,cancelFlow:h}=sK({onStartOAuthLogin:o.onStartOAuthLogin,onPollOAuthLogin:o.onPollOAuthLogin,onCancelOAuthLogin:o.onCancelOAuthLogin,onSuccess:()=>s("success"),autoOpen:bZ(),authWake:wZ()}),m=V(!1),g=[{region:"mainland-cn",titleKey:"onboarding.login.kimiCnTitle",hintKey:"onboarding.login.kimiCnHint"},{region:"global",titleKey:"onboarding.login.kimiOverseasTitle",hintKey:"onboarding.login.kimiOverseasHint"}],v={titleKey:"onboarding.login.kimiTitle",hintKey:"onboarding.login.kimiHint"},y=V("pending"),b=D(()=>G$(y.value,g,v));kn(()=>{o.onGetOAuthRegion?.().then(_=>{y.value=_===null?"unsupported":"supported"})});const w=D(()=>u.value?.verificationUriComplete??"");function C(_){r.value="flow",f(_)}function T(){h(),r.value="choice"}async function N(){!u.value||!await Ls(w.value)||(m.value=!0,setTimeout(()=>{m.value=!1},2e3))}function I(){mS(w.value)&&window.open(w.value,"_blank","noopener,noreferrer")}function S(_){const x=Math.floor(_/60),E=_%60;return`${x}:${String(E).padStart(2,"0")}`}return(_,x)=>e.authReady?(k(),L("div",hvt,[A("span",pvt,[U(p(Ce),{name:"check",size:"sm"})]),A("div",mvt,[A("div",gvt,F(p(n)("onboarding.login.loggedInTitle")),1),A("div",vvt,F(p(n)("onboarding.login.loggedInHint")),1)])])):r.value==="choice"?(k(),L("div",yvt,[(k(!0),L(De,null,Ct(b.value,E=>(k(),de(p(sw),{key:E.region??"oauth",disabled:E.disabled,onSelect:M=>C(E.region)},{leading:ue(()=>[U(z1,{size:40})]),hint:ue(()=>[Oe(F(p(n)(E.hintKey)),1)]),default:ue(()=>[Oe(" "+F(p(n)(E.titleKey))+" ",1)]),_:2},1032,["disabled","onSelect"]))),128)),p(i)?ee("",!0):(k(),de(p(sw),{key:0,onSelect:x[0]||(x[0]=E=>s("addProvider"))},{leading:ue(()=>[A("span",kvt,[U(p(Ce),{name:"bolt",size:"lg"})])]),hint:ue(()=>[Oe(F(p(n)("onboarding.login.customProviderHint")),1)]),default:ue(()=>[Oe(" "+F(p(n)("onboarding.login.customProviderTitle"))+" ",1)]),_:1}))])):(k(),L("div",bvt,[p(l)==="starting"?(k(),L("div",wvt,[U(p(uo),{size:"md"}),A("span",Cvt,F(p(n)("login.starting")),1)])):p(l)==="device-code"&&p(u)?(k(),L("div",Avt,[A("div",xvt,[A("span",Svt,[U(z1,{size:48})]),p(d)?(k(),L("div",_vt,F(p(n)("login.blockedTitle")),1)):ee("",!0),A("div",Mvt,F(p(d)?p(n)("login.blockedHint"):p(n)("login.openedHint",{time:S(p(c))})),1)]),p(d)?(k(),de(p(rn),{key:0,variant:"primary",onClick:I},{default:ue(()=>[Oe(F(p(n)("login.authorizeInBrowser"))+" ",1),U(p(Ce),{name:"external-link",size:"sm"})]),_:1})):ee("",!0),A("div",Ivt,[A("span",Tvt,[Oe(F(p(n)("login.notOpened"))+" ",1),U(p(rn),{variant:"text",class:Re(["ls-copy-text",{"is-copied":m.value}]),onClick:N},{default:ue(()=>[Oe(F(m.value?p(n)("login.copied"):p(n)("login.copyLink")),1)]),_:1},8,["class"])])])])):p(l)==="success"?(k(),L("div",Evt,[U(p(md),{kind:"success"}),A("span",Lvt,F(p(n)("login.success")),1),A("span",Nvt,F(p(n)("login.successHint")),1)])):p(l)==="denied"?(k(),L(De,{key:3},[A("div",Dvt,[U(p(md),{kind:"expired"}),A("span",Fvt,F(p(n)("login.deniedTitle")),1),A("span",Bvt,F(p(n)("login.expiredHint")),1)]),A("div",Rvt,[U(p(rn),{variant:"secondary",onClick:T},{default:ue(()=>[Oe(F(p(n)("onboarding.back")),1)]),_:1}),U(p(rn),{variant:"primary",onClick:x[1]||(x[1]=E=>p(f)())},{default:ue(()=>[Oe(F(p(n)("login.retry")),1)]),_:1})])],64)):p(l)==="expired"?(k(),L(De,{key:4},[A("div",Ovt,[U(p(md),{kind:"expired"}),A("span",$vt,F(p(n)("login.expiredTitle")),1),A("span",Pvt,F(p(n)("login.expiredHint")),1)]),A("div",zvt,[U(p(rn),{variant:"secondary",onClick:T},{default:ue(()=>[Oe(F(p(n)("onboarding.back")),1)]),_:1}),U(p(rn),{variant:"primary",onClick:x[2]||(x[2]=E=>p(f)())},{default:ue(()=>[Oe(F(p(n)("login.retry")),1)]),_:1})])],64)):p(l)==="error"?(k(),L(De,{key:5},[A("div",jvt,[U(p(md),{kind:"error"}),A("span",Hvt,F(p(a)?p(n)("login.pollErrorTitle"):p(n)("login.errorTitle")),1),A("span",Wvt,F(p(a)?p(n)("login.pollErrorHint"):p(n)("login.errorHint")),1)]),A("div",qvt,[U(p(rn),{variant:"secondary",onClick:T},{default:ue(()=>[Oe(F(p(n)("onboarding.back")),1)]),_:1}),U(p(rn),{variant:"primary",onClick:x[3]||(x[3]=E=>p(f)())},{default:ue(()=>[Oe(F(p(n)("login.retry")),1)]),_:1})])],64)):ee("",!0)]))}}),Vvt=St(Uvt,[["__scopeId","data-v-f2d724d4"]]),Kvt=["aria-label"],Zvt={class:"wiz-body"},Gvt={key:0,class:"wiz-step"},Qvt={class:"wiz-title"},Yvt={class:"wiz-sub"},Jvt={class:"pref-group"},Xvt={class:"pref-label"},e2t={class:"lang-cards"},t2t=["onClick"],n2t={class:"opt-label"},i2t={class:"pref-group"},o2t={class:"pref-label"},s2t={class:"theme-cards"},r2t=["onClick"],l2t={class:"opt-label"},a2t={key:1,class:"wiz-step"},u2t={class:"wiz-title"},c2t={class:"wiz-sub"},d2t={class:"wiz-step-fill"},f2t={class:"wiz-foot"},h2t={class:"wiz-foot-ghost"},p2t=rt({__name:"OnboardingWizard",props:{authReady:{type:Boolean},onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function},onGetOAuthRegion:{type:Function}},emits:["complete","loginSuccess","addProvider"],setup(e,{emit:t}){const{t:n,locale:i}=Ut(),o=e,s=t;function r(){s("addProvider")}const l=["preferences","login"],a=V(0),u=D(()=>l[a.value]??"preferences");function c(){a.value0&&a.value--}function f(y){i.value!==y&&kS(y)}const{colorScheme:h,setColorScheme:m}=X1(),g=[{value:"system",labelKey:"theme.system"},{value:"light",labelKey:"theme.light"},{value:"dark",labelKey:"theme.dark"}];function v(){s("loginSuccess")}return(y,b)=>(k(),L("div",{class:"wizard",role:"dialog","aria-modal":"true","aria-label":p(n)("onboarding.welcome.title")},[A("div",Zvt,[u.value==="preferences"?(k(),L("section",Gvt,[U(z1,{size:72}),A("h1",Qvt,F(p(n)("onboarding.welcome.title")),1),A("p",Yvt,F(p(n)("onboarding.welcome.subtitle")),1),A("div",Jvt,[A("div",Xvt,F(p(n)("onboarding.welcome.languageLabel")),1),A("div",e2t,[(k(!0),L(De,null,Ct(p(V4),w=>(k(),L("button",{key:w.code,class:Re(["opt-card lang-card",{selected:p(i)===w.code}]),type:"button",onClick:C=>f(w.code)},[A("span",{class:Re(["opt-radio",{on:p(i)===w.code}])},null,2),A("span",n2t,F(w.label),1)],10,t2t))),128))])]),A("div",i2t,[A("div",o2t,F(p(n)("onboarding.welcome.themeLabel")),1),A("div",s2t,[(k(),L(De,null,Ct(g,w=>A("button",{key:w.value,class:Re(["opt-card theme-card",{selected:p(h)===w.value}]),type:"button",onClick:C=>p(m)(w.value)},[A("span",{class:Re(["tp",`tp-${w.value}`]),"aria-hidden":"true"},[w.value==="system"?(k(),L(De,{key:0},[b[2]||(b[2]=Qd('',2))],64)):(k(),L(De,{key:1},[b[3]||(b[3]=A("span",{class:"tp-side"},null,-1)),b[4]||(b[4]=A("span",{class:"tp-lines"},[A("span"),A("span"),A("span")],-1))],64))],2),A("span",l2t,F(p(n)(w.labelKey)),1)],10,r2t)),64))])])])):(k(),L("section",a2t,[U(z1,{size:72}),A("h1",u2t,F(p(n)("onboarding.login.title")),1),A("p",c2t,F(p(n)("onboarding.login.subtitle")),1),A("div",d2t,[U(Vvt,{"auth-ready":o.authReady,"on-start-o-auth-login":o.onStartOAuthLogin,"on-poll-o-auth-login":o.onPollOAuthLogin,"on-cancel-o-auth-login":o.onCancelOAuthLogin,"on-get-o-auth-region":o.onGetOAuthRegion,onSuccess:v,onAddProvider:r},null,8,["auth-ready","on-start-o-auth-login","on-poll-o-auth-login","on-cancel-o-auth-login","on-get-o-auth-region"])])])),A("div",f2t,[u.value==="preferences"?(k(),de(p(rn),{key:0,variant:"primary",size:"lg",class:"wiz-primary",onClick:c},{default:ue(()=>[Oe(F(p(n)("onboarding.continue")),1)]),_:1})):u.value==="login"&&o.authReady?(k(),de(p(rn),{key:1,variant:"primary",size:"lg",class:"wiz-primary",onClick:b[0]||(b[0]=w=>s("complete"))},{default:ue(()=>[Oe(F(p(n)("onboarding.login.finish")),1)]),_:1})):ee("",!0),A("div",h2t,[a.value>0?(k(),de(p(rn),{key:0,variant:"ghost",onClick:d},{default:ue(()=>[Oe(F(p(n)("onboarding.back")),1)]),_:1})):ee("",!0),u.value==="login"&&o.authReady?ee("",!0):(k(),de(p(rn),{key:1,variant:"ghost",onClick:b[1]||(b[1]=w=>s("complete"))},{default:ue(()=>[Oe(F(u.value==="login"?p(n)("onboarding.login.skip"):p(n)("onboarding.skip")),1)]),_:1}))])])])],8,Kvt))}}),m2t=St(p2t,[["__scopeId","data-v-555fb599"]]),g2t={class:"kap-root"},v2t={class:"kap-head"},y2t={class:"kap-count"},k2t={class:"kap-head-actions"},b2t={class:"kap-filters"},w2t=["value"],C2t={class:"kap-check"},A2t={class:"kap-check"},x2t={class:"kap-view-toggle",role:"group"},S2t={key:0,class:"kap-empty"},_2t=["onClick"],M2t={class:"kap-ts"},I2t={class:"kap-label"},T2t={key:0,class:"kap-detail"},E2t={class:"kap-detail-actions"},L2t=["onClick"],N2t={key:1,class:"kap-agg"},D2t={class:"mono"},F2t={class:"mono"},B2t={class:"num"},R2t={class:"num"},O2t={key:0},$2t={class:"mono"},P2t={class:"num"},z2t={class:"num"},j2t={key:0},H2t=rt({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,i=V("all"),o=V(""),s=V(""),r=V(!1),l=V("timeline"),a=D(()=>(MS.value,[...Dut()])),u=D(()=>{const _=new Set;for(const x of a.value)x.sessionId&&_.add(x.sessionId);return[..._].sort()});function c(_){return _.kind==="rest:error"||_.code!==void 0&&_.code!==0||_.eventType==="error"||_.eventType==="parse-error"}const d=D(()=>{const _=o.value.trim().toLowerCase();return a.value.filter(x=>!(i.value!=="all"&&x.source!==i.value||s.value&&x.sessionId!==s.value||r.value&&!c(x)||_&&!`${x.label} ${x.kind} ${x.eventType??""} ${x.sessionId??""} ${x.requestId??""}`.toLowerCase().includes(_)))}),f=D(()=>{const _=new Map;for(const x of d.value){if(x.kind!=="ws:in"&&x.kind!=="ws:out")continue;const E=x.kind==="ws:in"?"←":"→",M=`${E} ${x.eventType??"?"} @ ${x.sessionId??"-"}`,R=_.get(M)??{key:M,sessionId:x.sessionId??"-",eventType:x.eventType??"?",dir:E,count:0};R.count++,x.seq!==void 0&&(R.lastSeq=x.seq),_.set(M,R)}return[..._.values()].sort((x,E)=>E.count-x.count)}),h=D(()=>{const _=new Map;for(const x of d.value){if(x.source!=="rest"||x.kind==="rest:request")continue;const E=`${x.method??"?"} ${x.path??"?"}`,M=_.get(E)??{count:0,errors:0,totalMs:0,timed:0};M.count++,c(x)&&M.errors++,x.durationMs!==void 0&&(M.totalMs+=x.durationMs,M.timed++),_.set(E,M)}return[..._.entries()].map(([x,E])=>({key:x,count:E.count,errors:E.errors,avgMs:E.timed>0?Math.round(E.totalMs/E.timed):0})).sort((x,E)=>E.count-x.count)}),m=V(null),g=V(!0),v=V(null),y=V(null);We(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await ft();const _=v.value;_&&(_.scrollTop=_.scrollHeight)});function b(_){m.value=m.value===_?null:_}function w(_){const x=new Date(_),E=(M,R=2)=>String(M).padStart(R,"0");return`${E(x.getHours())}:${E(x.getMinutes())}:${E(x.getSeconds())}.${E(x.getMilliseconds(),3)}`}function C(_){return JSON.stringify(_,null,2)}async function T(_){await Ls(C(_))&&(y.value=_.id,setTimeout(()=>{y.value===_.id&&(y.value=null)},1500))}function N(){qZ(d.value)}function I(_){return c(_)||_.source==="client"?"b-err":_.source==="rest"?"b-rest":_.kind==="ws:lifecycle"?"b-life":_.kind==="ws:out"?"b-out":"b-in"}function S(_){return _.source==="rest"?"REST":_.source==="client"?"APP":"WS"}return(_,x)=>(k(),L("section",g2t,[A("header",v2t,[x[11]||(x[11]=A("strong",null,"KAP debug",-1)),A("span",y2t,F(d.value.length)+"/"+F(a.value.length),1),A("div",k2t,[A("button",{type:"button",class:Re({on:p(Mg)}),onClick:x[0]||(x[0]=E=>Mg.value=!p(Mg))},F(p(Mg)?"resume":"pause"),3),A("button",{type:"button",onClick:x[1]||(x[1]=E=>p(Fut)())},"clear"),A("button",{type:"button",onClick:x[2]||(x[2]=E=>N())},"export jsonl"),U(p(Nn),{text:"Close window"},{default:ue(()=>[A("button",{type:"button",onClick:x[3]||(x[3]=E=>n("close"))},"✕")]),_:1})])]),A("div",b2t,[ai(A("select",{"onUpdate:modelValue":x[4]||(x[4]=E=>i.value=E),"aria-label":"Source filter"},[...x[12]||(x[12]=[A("option",{value:"all"},"rest + ws + app",-1),A("option",{value:"rest"},"rest",-1),A("option",{value:"ws"},"ws",-1),A("option",{value:"client"},"app errors",-1)])],512),[[ow,i.value]]),ai(A("select",{"onUpdate:modelValue":x[5]||(x[5]=E=>s.value=E),"aria-label":"Session filter"},[x[13]||(x[13]=A("option",{value:""},"all sessions",-1)),(k(!0),L(De,null,Ct(u.value,E=>(k(),L("option",{key:E,value:E},F(E),9,w2t))),128))],512),[[ow,s.value]]),ai(A("input",{"onUpdate:modelValue":x[6]||(x[6]=E=>o.value=E),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ar,o.value]]),A("label",C2t,[ai(A("input",{"onUpdate:modelValue":x[7]||(x[7]=E=>r.value=E),type:"checkbox"},null,512),[[S9,r.value]]),x[14]||(x[14]=Oe(" errors",-1))]),A("label",A2t,[ai(A("input",{"onUpdate:modelValue":x[8]||(x[8]=E=>g.value=E),type:"checkbox"},null,512),[[S9,g.value]]),x[15]||(x[15]=Oe(" follow",-1))]),A("div",x2t,[A("button",{type:"button",class:Re({on:l.value==="timeline"}),onClick:x[9]||(x[9]=E=>l.value="timeline")},"timeline",2),A("button",{type:"button",class:Re({on:l.value==="aggregate"}),onClick:x[10]||(x[10]=E=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(k(),L("div",{key:0,ref_key:"listRef",ref:v,class:"kap-list"},[d.value.length===0?(k(),L("div",S2t," No trace entries yet. REST calls and WS frames will appear here. ")):ee("",!0),(k(!0),L(De,null,Ct(d.value,E=>(k(),L("div",{key:E.id,class:"kap-row-wrap"},[A("button",{type:"button",class:Re(["kap-row",{expanded:m.value===E.id}]),onClick:M=>b(E.id)},[A("span",M2t,F(w(E.ts)),1),A("span",{class:Re(["kap-badge",I(E)])},F(S(E)),3),A("span",I2t,F(E.label),1)],10,_2t),m.value===E.id?(k(),L("div",T2t,[A("div",E2t,[A("button",{type:"button",onClick:M=>T(E)},F(y.value===E.id?"copied ✓":"copy json"),9,L2t)]),A("pre",null,F(C(E)),1)])):ee("",!0)]))),128))],512)):(k(),L("div",N2t,[x[20]||(x[20]=A("h4",null,"WS frames by session / type",-1)),A("table",null,[x[17]||(x[17]=A("thead",null,[A("tr",null,[A("th",null,"dir"),A("th",null,"type"),A("th",null,"session"),A("th",null,"count"),A("th",null,"last seq")])],-1)),A("tbody",null,[(k(!0),L(De,null,Ct(f.value,E=>(k(),L("tr",{key:E.key},[A("td",null,F(E.dir),1),A("td",D2t,F(E.eventType),1),A("td",F2t,F(E.sessionId),1),A("td",B2t,F(E.count),1),A("td",R2t,F(E.lastSeq??"—"),1)]))),128)),f.value.length===0?(k(),L("tr",O2t,[...x[16]||(x[16]=[A("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ee("",!0)])]),x[21]||(x[21]=A("h4",null,"REST by endpoint",-1)),A("table",null,[x[19]||(x[19]=A("thead",null,[A("tr",null,[A("th",null,"endpoint"),A("th",null,"count"),A("th",null,"errors"),A("th",null,"avg ms")])],-1)),A("tbody",null,[(k(!0),L(De,null,Ct(h.value,E=>(k(),L("tr",{key:E.key},[A("td",$2t,F(E.key),1),A("td",P2t,F(E.count),1),A("td",{class:Re(["num",{err:E.errors>0}])},F(E.errors),3),A("td",z2t,F(E.avgMs),1)]))),128)),h.value.length===0?(k(),L("tr",j2t,[...x[18]||(x[18]=[A("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ee("",!0)])])]))]))}}),W2t=St(H2t,[["__scopeId","data-v-2b13888e"]]),q2t=rt({__name:"DebugPanel",setup(e){const t=V(!1);let n=null,i=null,o=null;const s=["data-color-scheme"];function r(c){const d=document.documentElement,f=c.documentElement;for(const h of s){const m=d.getAttribute(h);m!==null?f.setAttribute(h,m):f.removeAttribute(h)}}function l(c){const d=c.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const m of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(m.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){o?.disconnect(),o=null;try{i?.unmount()}catch{}i=null,n=null,t.value=!1}function u(){if(n&&!n.closed){n.focus();return}const c=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!c)return;n=c;const d=l(c),f=_9(W2t,{onClose:()=>c.close()});f.mount(d),i=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...s]}),c.addEventListener("pagehide",a),c.addEventListener("beforeunload",a)}return kn(()=>{u()}),Xn(()=>{n&&!n.closed&&n.close(),a()}),(c,d)=>(k(),de(p(Nn),{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:ue(()=>[A("button",{class:"kap-fab",type:"button",onClick:u}," KAP ")]),_:1},8,["text"]))}}),U2t=St(q2t,[["__scopeId","data-v-21de79fc"]]),V2t=rt({__name:"ServerAuthDialog",setup(e){const t=V(""),n=V(null),i=V(!1);kn(()=>{ft(()=>n.value?.focus())});function o(){const r=t.value;!r||i.value||(i.value=!0,uP(r),window.location.reload())}function s(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(k(),de(p(ef),{open:!0,title:"Server token required","hide-close":!0,"close-on-overlay":!1,"close-on-esc":!1},{foot:ue(()=>[U(p(rn),{variant:"primary",disabled:!t.value||i.value,loading:i.value,onClick:o},{default:ue(()=>[Oe(F(i.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])]),default:ue(()=>[l[1]||(l[1]=A("p",{class:"server-auth-hint"},[Oe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),A("code",null,"KIMI_CODE_PASSWORD"),Oe("). ")],-1)),U(p(Ms),{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:i.value,onKeydown:s},null,8,["modelValue","disabled"])]),_:1}))}}),K2t=St(V2t,[["__scopeId","data-v-05495fe9"]]),Z2t=["aria-label"],G2t=rt({__name:"InternalBuildBanner",setup(e){const{t}=Ut(),n=qh;return(i,o)=>p(n)?(k(),L("span",{key:0,class:"internal-build-tag",role:"note","aria-label":p(t)("app.internalBuildBanner")},[o[0]||(o[0]=A("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[A("path",{d:"M8 2 14 13H2L8 2Z"}),A("path",{d:"M8 6v3.5"}),A("path",{d:"M8 11.5h.01"})],-1)),A("span",null,F(p(t)("app.internalBuildBanner")),1)],8,Z2t)):ee("",!0)}}),Q2t=St(G2t,[["__scopeId","data-v-439d3299"]]),Y2t={class:"app-shell"},J2t=["inert"],X2t=rt({__name:"App",setup(e){Pse();const t=V(!1);let n=null;const i=Xa(),o=D(()=>!i.dangerousBypassAuth.value&&t.value);ii(h4,i.resolveImageUrl),ii(nK,je=>i.swarmMembersByToolCallId.value.get(je)??[]),ii(im,je=>xoe(je,i.models.value));const{t:s,locale:r}=Ut();ii(om,je=>Soe(je));const{confirm:l}=cf(),a=eu(),u=Lc(),c=V(!1),d=V(!1),f=D(()=>{const je=i.activeSessionId.value;return i.sessions.value.find(Se=>Se.id===je)?.title??""}),h=D(()=>{const je=i.activeSessionId.value;return!!je&&i.pinnedSessionIds.value.includes(je)}),m=V(null);function g(je){i.pinnedSessionIds.value.includes(je)||m.value?.revealPinnedSection(),i.togglePinSession(je)}const v=D(()=>{const je=i.activeSessionId.value;return i.sessions.value.find(Se=>Se.id===je)?.lastTurnReason??null}),y=D(()=>i.activity.value!=="idle"),b=D(()=>{const je=i.activeSessionId.value,Se=i.sessions.value.find(Pe=>Pe.id===je);return hv({busy:Se?.busy??!1,unread:i.unreadBySession.value[je??""]??!1,questionCount:i.questions.value.length,approvalCount:i.pendingApprovals.value.length,pendingInteraction:Se?.pendingInteraction,lastTurnReason:v.value??void 0})});_Pe({running:y,title:i.documentBaseTitle});const w=D(()=>i.models.value.find(je=>je.id===i.status.value.modelId)),C=D(()=>_6(w.value,i.thinking.value)),T=V(!i.onboarded.value);function N(){i.setOnboarded(!0),T.value=!1}function I(){N(),mi.value="providers",ie.value=!0}function S(){mi.value="archived",ie.value=!0}let _=0;function x(){const je=window.visualViewport,Se=document.documentElement.style;Se.setProperty("--app-height",`${je?.height??window.innerHeight}px`),Se.setProperty("--app-top",`${je?.offsetTop??0}px`)}function E(){_||(_=requestAnimationFrame(()=>{_=0,x()}))}xae(()=>i.getOAuthRegion());function M(){Yw(()=>i.getOAuthRegion())}kn(()=>{n=Wse(()=>{t.value=!0,i.clearDangerousBypassAuth()}),i.load(),M(),X(),x(),window.visualViewport?.addEventListener("resize",E),window.visualViewport?.addEventListener("scroll",E),window.addEventListener("resize",E),document.addEventListener("keydown",R,!0),hS()}),Ln(()=>{document.removeEventListener("keydown",R,!0),window.visualViewport?.removeEventListener("resize",E),window.visualViewport?.removeEventListener("scroll",E),window.removeEventListener("resize",E),_&&(cancelAnimationFrame(_),_=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function R(je){je.key==="Escape"&&(pS(je)||ht.value||we.value?.composerPopupOpen()!==!0&&(je.defaultPrevented||ce.hidePanel()&&(je.stopImmediatePropagation(),je.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.closest(".global-preview")!==null&&ft(Y4))))}const q=CPe({client:i,t:(je,Se)=>Se===void 0?s(je):s(je,Se)});kn(()=>{const je=aIe({resolveSkill:Se=>i.skills.value.find(Pe=>Pe.name===Se)??null,openPath:Se=>void ce.openFilePreview(Se),openAttachment:Se=>Lt(Se),openSkillLabel:()=>s("mention.openSkill"),copyPathLabel:()=>s("mention.copyPath"),copyQuoteLabel:()=>s("selection.copyQuote"),copyCommentLabel:()=>s("selection.copyComment"),quoteBlockLabel:()=>s("selection.quoteLabel"),commentBlockLabel:()=>s("selection.comment"),attachmentErrorLabel:Se=>Se==="upload-failed"?s("mention.attachmentUploadFailed"):Se==="upload-interrupted"?s("mention.attachmentUploadInterrupted"):void 0,resolveAttachmentPreviewUrl:async Se=>{const Pe=b1();try{const on=Se.sessionId!==void 0?await Pe.getSessionMediaBlob(Se.sessionId,Se.fileId):await Pe.getFileBlob(Se.fileId);return URL.createObjectURL(on)}catch{return null}},mediaFullscreenLabel:()=>s("mention.viewFullscreen"),mediaPreviewStateLabel:Se=>s(Se==="loading"?"mention.mediaPreviewLoading":Se==="uploading"?"mention.mediaPreviewUploading":"mention.mediaPreviewUnavailable"),mediaUploadStateLabel:Se=>s(Se==="uploading"?"mention.stateUploading":Se==="uploaded"?"mention.stateUploaded":"mention.stateUploadFailed"),probePath:(Se,Pe)=>i.probeWorkspacePath(Se,Pe),skillsLoaded:()=>i.skillsLoaded.value,probeScope:()=>i.activeSessionId.value||i.activeWorkspaceId.value});Ln(je)});const z=V(null),$=V(null);function B(je){$.value=je.originImg??null,z.value=je.media}const{SIDEBAR_WIDTH_KEY:P,SIDEBAR_DEFAULT:H,SIDEBAR_MIN:j,sidebarMax:G,sessionColWidth:ne,sidebarCollapsed:W,sidebarDragging:Q,sideWidth:te,loadSidebarCollapsed:X,toggleSidebarCollapse:ve}=bPe({previewOpen:()=>ce.panelVisible.value}),ce=gPe({client:i,sideWidth:te,t:(je,Se)=>Se===void 0?s(je):s(je,Se),locale:r}),se=new Map;function pe(){if(ce.activeTab.value?.type==="btw"&&ce.panelVisible.value){const ti=be.value?.rootEl??null,vs=ti!==null&&ti.contains(document.activeElement);ce.hidePanel(),vs&&ft(Y4);return}const je=ce.panelTabs.value.findLast(ti=>ti.type==="btw"),Se=ke();if(je){ce.activateTab(je.id),Se.focusWhenReady();return}const Pe=i.activeSessionId.value||`${RB}${i.activeWorkspaceId.value??"none"}`,on=i.getDraftPromotion(),Zn=on!==null&&on.sessionId===Pe?`${RB}${on.workspaceId}`:null,Gn=se.get(Pe)??(Zn!==null?se.get(Zn):void 0);if(Gn!==void 0){Gn.then(ti=>{if(ti.agentId!==null&&(ti.sessionId===null||ti.sessionId===i.activeSessionId.value)){if(!Se.acted()){const ys=ce.panelTabs.value.find(Je=>Je.type==="btw"&&Je.payload?.agentId===ti.agentId);ys&&ce.activateTab(ys.id)}Se.focusWhenReady()}});return}const Xi=ce.openSideChatTab();se.set(Pe,Xi),Xi.then(ti=>{ti.agentId!==null&&(ti.sessionId===null||ti.sessionId===i.activeSessionId.value)&&Se.focusWhenReady()}).finally(()=>{se.get(Pe)===Xi&&se.delete(Pe)})}function Z(){return ce.openSideChatTab()}const ae=D(()=>ce.panelTabs.value.filter(je=>je.type==="btw"&&je.payload!==void 0).filter(je=>{const Se=je.payload;return!i.sideChatTargetsOfSession(Se.parentId).some(Pe=>Pe.agentId===Se.agentId)}).map(je=>je.id));We(ae,je=>{if(je.length===0)return;const Se=je.some(Zn=>Zn===ce.activeTabId.value),Pe=be.value?.rootEl??null,on=Pe!==null&&Pe.contains(document.activeElement);for(const Zn of je)ce.closeTab(Zn);if(on){if(Se){uh();return}ft(()=>{document.activeElement===document.body&&uh()})}});const K=D(()=>i.sessionLoading.value?[]:ce.panelTabs.value.filter(je=>je.type==="compaction"&&je.payload!==void 0).filter(je=>{const{turnId:Se}=je.payload,Pe=i.turns.value.find(on=>on.id===Se);return!(Pe?.role==="compaction"&&Pe.text)}).map(je=>je.id));We(K,je=>{if(je.length===0)return;const Se=je.some(Zn=>Zn===ce.activeTabId.value),Pe=be.value?.rootEl??null,on=Pe!==null&&Pe.contains(document.activeElement);for(const Zn of je)ce.closeTab(Zn);if(on){if(Se){uh();return}ft(()=>{document.activeElement===document.body&&uh()})}});function re(){we.value?.closeDockPanel()}ii(Uo,{openFile:je=>{re(),ce.openFilePreview(je)},openAgent:je=>{re(),ce.openAgentPanel(je)},openTurnDiff:({turnId:je,change:Se})=>{re();const Pe=je||i.turns.value.find(on=>NZ(on).some(Zn=>Zn===Se))?.id||"";ce.openTurnDiff({turnId:Pe,change:Se})},openCompaction:je=>{re(),ce.openCompactionPanel(je)},openDiff:()=>{re(),ce.openDiffDetail()},openBtw:()=>{re(),Z()},openTerm:()=>{},isVisible:()=>ce.panelVisible.value,isExpanded:()=>ce.panelExpanded.value,activeTabType:()=>ce.activeTab.value?.type??null,togglePanel:()=>{ce.panelVisible.value?ce.hidePanel():ce.showPanel()}}),We(()=>i.mainView.value,je=>{je!=="chat"&&ce.leaveChatView()});const we=V(null),be=V(null);function ke(){let je=!1;const Se=Pe=>{Pe instanceof KeyboardEvent&&Pe.repeat||(je=!0,ce.bumpInteractionVersion())};return document.addEventListener("pointerdown",Se,!0),document.addEventListener("keydown",Se,!0),window.addEventListener("blur",Se),document.addEventListener("visibilitychange",Se),{acted:()=>je,focusWhenReady:()=>{ft(()=>{document.removeEventListener("pointerdown",Se,!0),document.removeEventListener("keydown",Se,!0),window.removeEventListener("blur",Se),document.removeEventListener("visibilitychange",Se),!je&&document.hasFocus()&&(u.value||ht.value||be.value?.focusSideChatInput())})}}}const oe=D(()=>{const je=i.goal.value?.status;return je==="active"||je==="paused"||je==="blocked"});function le(){d.value=!1,we.value?.focusGoal()}const ye=V(!1),Ae=V(!1),Me=V(!1),fe=V(!1),ie=V(!1);let Ee;kn(()=>{Ee=window.kimiDesktop?.onMenuAction?.(je=>{je==="open-settings"?ie.value=!0:je==="new-chat"&&Us()})}),Ln(()=>{Ee?.()});const qe=V(null),ze=V(null),ht=D(()=>sr.value>0||ye.value||Ae.value||Me.value||fe.value||ie.value||T.value||c.value||d.value),gt=V(!1),_t=V(!1),$t=V(!1);async function jt(){gt.value=!0,_t.value=!1,ye.value=!0;try{await i.refreshAllProviders()}catch{_t.value=!0}finally{gt.value=!1}}function Ht(){Ae.value=!0}async function Te(){await l({title:s("sidebar.logoutConfirmTitle"),message:s("sidebar.logoutConfirmMessage"),variant:"danger",action:async()=>{await i.logout(),M()}})}async function Fe(je){ye.value=!1,await Ve(je)}async function Ve(je){await i.setModel(je)&&je!==i.defaultModel.value&&i.updateConfig({defaultModel:je})}const lt=V(null);let Ft=0;function Lt(je){if(je.kind==="image"||je.kind==="video"){B({media:{kind:je.kind,url:je.url,path:je.name,fileId:je.fileId,sessionId:je.sessionId}});return}const Se=je.fileId;Se!==void 0&&SQe(b1(),Se,je.name,je.mediaType).then(Pe=>{Pe==="unsupported"&&(lt.value={kind:"attachmentOpen",name:je.name||Se,key:++Ft})})}const Vt=V(null);async function qt(je,Se){if(!(Se.length===0||Vt.value!==null)){Vt.value=je;try{const Pe=je==="archive"?await i.archiveSessions(Se):await i.restoreSessions(Se),on=eR(je,Pe);if(on===null){i.notify({severity:"error",title:s(je==="archive"?"admin.batchDoneFailedNotice":"admin.batchReopenFailedNotice",{n:Pe.failed})});return}lt.value={kind:"adminBatch",plan:on,key:++Ft}}finally{Vt.value=null}}}async function nn(){const je=lt.value;if(!je||je.kind!=="adminBatch")return;const Se=Nst(je.plan.direction),Pe=Se==="archive"?await i.archiveSessions(je.plan.ids):await i.restoreSessions(je.plan.ids),on=eR(Se,Pe);on!==null&<.value?.key===je.key&&(lt.value={kind:"adminBatch",plan:on,key:++Ft})}async function it(je){await i.archiveSession(je),!i.sessionsForView.value.some(Se=>Se.id===je)&&(lt.value={kind:"archive",id:je,key:++Ft})}async function dt(je){await i.restoreSession(je)&&(lt.value={kind:"archive",id:je,reopen:!0,key:++Ft})}let At=!1;async function un(je){if(At)return;At=!0;const Se=++Ft,Pe=setTimeout(()=>{(lt.value===null||lt.value.key<=Se)&&(lt.value={kind:"export",state:"running",key:Se})},400);try{await i.exportSession(je)&&!qh?(lt.value===null||lt.value.key<=Se)&&(lt.value={kind:"export",state:"done",key:++Ft}):lt.value?.kind==="export"&<.value.key===Se&&(lt.value=null)}finally{clearTimeout(Pe),At=!1}}async function Qt(){const je=lt.value;if(!(!je||je.kind!=="archive")){if(je.reopen){if(await i.archiveSession(je.id),i.sessionsForView.value.some(Se=>Se.id===je.id)||lt.value?.key!==je.key)return;lt.value={kind:"archive",id:je.id,key:++Ft};return}await i.restoreSession(je.id)&<.value?.key===je.key&&(lt.value=null)}}function ei(je){je!==void 0&<.value?.key===je&&(lt.value=null)}const mi=V(void 0),{sidebarTabs:Hi}=em();async function wi(je){const Se=i.workspacesView.value.find(on=>on.id===je)?.name??je;await l({title:s("sidebar.removeWorkspace"),message:s("workspace.removeWorkspaceConfirm",{name:Se}),variant:"danger",action:()=>i.deleteWorkspace(je)})&&i.workspacesView.value.some(on=>on.id===je)}async function Vo(je){$t.value=!0;try{await i.updateConfig(je)&&await i.checkAuth()}finally{$t.value=!1}}async function ot(je){return i.startOAuthLogin(je)}async function Ue(){return i.pollOAuthLogin()}async function st(){return i.cancelOAuthLogin()}async function In(){return i.getOAuthRegion()}async function kt(){Ae.value=!1,await i.checkAuth(),await i.load(),M()}async function ui(){N(),await i.checkAuth(),await i.load(),M()}async function _o(je){const Se=i.activeSessionId.value;await i.undo(je.undoCount??1)!==null&&(Se&&(i.invalidateSessionPlans(Se),i.refreshSessionPlans(Se)),await ft(),we.value?.loadComposerForEdit(je.text,je.attachments),we.value?.notifyUndone())}async function co(){const je=await i.abortCurrentPrompt();we.value?.onAbortOutcome(je)}const Ns=V([]);We(()=>[i.activeSessionId.value,we.value?.hasInsertableComposer()??!1],([je,Se])=>{Ns.value.length!==0&&(Ns.value=nze(Ns.value,je,Pe=>Se?we.value?.insertComposerQuote(Pe.quote,Pe.comment,Pe.source)===!0:!1))});function Ds(je,Se){const Pe=je.action==="comment"?je.comment:void 0;we.value?.insertComposerQuote(je.quote,Pe,Se)!==!0&&(Ns.value=[...Ns.value,{quote:je.quote,comment:Pe,source:Se,sessionId:i.activeSessionId.value}])}const Fs=D(()=>be.value?.rootEl??null),Fo=D(()=>{const je=ce.activeTab.value;return je?.type==="file"?je.payload.path:void 0}),{selectionBubble:Ei,selectionKeyboard:ur,onMouseup:Mo,onPointerdown:go,onBubbleClose:fo,onBubbleAction:Ir}=rze({root:Fs,containerSelector:QPe,captureSource:je=>YPe(je,Fo.value??""),onAction:(je,Se)=>{Ds(je,Se),u.value&&ce.hidePanel()}});We(()=>[ce.activeTabId.value,ce.panelVisible.value,ce.panelExpanded.value],()=>{fo()});function Bo(je){const Se=b1();return je.map(Pe=>qx(Se,Pe))}async function qn(je,Se,Pe,on){if(i.authReady.value||(await i.checkAuth(),i.authReady.value))return!0;const Zn=i.managedProviderStatus.value==="authenticated";Zn&&i.managedMembership.value===null&&await i.probeManagedMembership();const Gn=Zn&&i.managedMembership.value==="free",Xi=await l(Gn?{title:s("login.upgradeRequiredTitle"),message:s("login.upgradeRequiredMessage"),confirmLabel:s("sidebar.upgrade"),variant:"primary"}:{title:s("login.requiredTitle"),message:s("login.requiredMessage"),confirmLabel:s("login.goToLogin"),variant:"primary"});return we.value?.loadComposerForEdit(Pe??je,Bo(Se),on),Xi&&(Gn?pv():Ht()),!1}async function to(je,Se=[],Pe,on){if(i.activeSessionId.value||i.activeWorkspaceId.value)return!0;const Zn=await l({title:s("workspace.requiredTitle"),message:s("workspace.requiredMessage"),confirmLabel:s("conversation.pickFolder"),variant:"primary"});return we.value?.loadComposerForEdit(Pe??je,Bo(Se),on),Zn&&(Me.value=!0),!1}async function fi(je,Se=[],Pe,on){return await qn(je,Se,Pe,on)?to(je,Se,Pe,on):!1}let Zi=0;async function no(je){const{cmd:Se,attachments:Pe,restoreText:on,restoreEntries:Zn}=je;if(Se==="/compact"||Se.startsWith("/compact ")){if(!await fi(Se,[],on,Zn))return;i.compact(Se.slice(8).trim()||void 0);return}if(Se==="/swarm"||Se.startsWith("/swarm ")){const Gn=Se.slice(6).trim();if(Gn==="on")i.setSwarmMode(!0);else if(Gn==="off")i.setSwarmMode(!1);else if(Gn){if(!await fi(Se,[],on,Zn))return;i.setSwarmMode(!0),i.sendPrompt(Gn,[],je.editText)}else i.toggleSwarmMode();return}if(Se==="/goal"||Se.startsWith("/goal ")){const Gn=Se.slice(5).trim();if(Gn==="pause"||Gn==="resume"||Gn==="cancel")i.controlGoal(Gn);else if(Gn){if(!await fi(Se,[],on,Zn))return;i.createGoal(Gn)}else i.toggleGoalMode();return}if(Se==="/btw"||Se.startsWith("/btw ")){const Gn=Se.slice(4).trim();if(!Gn)pe();else{const Xi=ke();if(!await fi(Se,[],on,Zn)){Xi.focusWhenReady();return}ce.openSideChatTab(Gn).finally(()=>Xi.focusWhenReady())}return}switch(Se){case"/new":case"/clear":Us();break;case"/fork":i.forkSession();break;case"/export":un();break;case"/undo":{const Gn=i.activeSessionId.value;i.undo().then(Xi=>{Xi&&Gn&&(i.invalidateSessionPlans(Gn),i.refreshSessionPlans(Gn))});break}case"/status":fe.value=!0;break;case"/login":Ht();break;default:{const Gn=Se.indexOf(" "),Xi=je.skillName??F6((Gn===-1?Se:Se.slice(0,Gn)).slice(1)),ti=je.skillName?Ple(Se,je.skillName,on):Gn===-1?void 0:Se.slice(Gn+1).trim()||void 0;if(!Xi)break;const vs=++Zi;if(!await fi(Se,Pe,on,Zn))return;if(!i.activeSessionId.value&&i.activeWorkspaceId.value){const ys=i.activeWorkspaceId.value,{sessionId:Je,activated:Ye}=await i.startSessionAndActivateSkill(ys,Xi,ti,Pe);!Ye&&vs===Zi&&we.value?.isComposerEmpty()&&(Je===null?i.activeWorkspaceId.value===ys:i.activeSessionId.value===Je)&&we.value.loadComposerForEdit(on??Se,Bo(Pe),Zn)}else{const ys=i.activeSessionId.value;i.activateSkill(Xi,ti,Pe).then(Je=>{Je||i.activeSessionId.value===ys&&vs===Zi&&we.value?.isComposerEmpty()&&we.value.loadComposerForEdit(on??Se,Bo(Pe),Zn)})}break}}}function Ko(je){i.unqueue(je)}function ri(je){i.unqueue(je)}function Li(je){i.reorderQueue(je.from,je.to)}function Mi(je){Zi++,i.steerQueued(je)}async function Ni(je){if(!await qn(je.text,je.attachments,je.restoreText,je.restoreEntries))return;Zi++;const Se=i.activeWorkspaceId.value;if(!i.activeSessionId.value&&Se){await i.startSessionAndSendPrompt(Se,je.text,je.attachments);return}if(!i.activeSessionId.value&&!Se){qe.value=je,await l({title:s("workspace.requiredTitle"),message:s("workspace.requiredMessage"),confirmLabel:s("conversation.pickFolder"),variant:"primary"})?Me.value=!0:_n();return}i.sendPrompt(je.text,je.attachments,je.editText??je.restoreText)}function _n(){const je=qe.value;qe.value=null,je&&we.value?.loadComposerForEdit(je.restoreText??je.text,Bo(je.attachments),je.restoreEntries)}async function gs(je){if(ze.value=null,!await i.addWorkspaceByPath(je)){ze.value=s("workspace.addFailed");return}Me.value=!1;const Pe=qe.value;qe.value=null;const on=i.activeWorkspaceId.value;Pe&&on&&await i.startSessionAndSendPrompt(on,Pe.text,Pe.attachments)===null&&we.value?.loadComposerForEdit(Pe.restoreText??Pe.text,Bo(Pe.attachments),Pe.restoreEntries)}function qs(){_n(),ze.value=null,Me.value=!1}function Xo(){ft(()=>{we.value?.focusComposer()})}function Us(){const je=i.activeWorkspaceId.value;je?i.openWorkspaceDraft(je,{entry:"newChat"}):i.clearActiveSession(),Xo()}function vo(je){i.openWorkspaceDraft(je,{entry:"workspace"}),Xo()}function Ji(je){i.openWorkspaceDraft(je),Xo()}const Oi=D(()=>i.recentSessionsForWorkspace(i.activeWorkspaceId.value));function $i(je){je&&window.open(je,"_blank","noopener")}return(je,Se)=>(k(),L("div",Y2t,[o.value?(k(),de(K2t,{key:0})):ee("",!0),A("div",{class:Re(["app",{mobile:p(u),"sidebar-collapsed":p(W)&&!p(u),"macos-desktop":p(Cd),"panel-expanded":p(ce).panelExpanded.value}]),inert:T.value},[p(u)?(k(),de(p(ait),{key:1,workspace:p(i).visibleWorkspace.value,"session-title":f.value,status:b.value,onOpenSwitcher:Se[27]||(Se[27]=Pe=>c.value=!0),onOpenSettings:Se[28]||(Se[28]=Pe=>d.value=!0)},null,8,["workspace","session-title","status"])):(k(),L(De,{key:0},[U(alt,{ref_key:"sidebarRef",ref:m,collapsed:p(W),dragging:p(Q),"col-width":p(te),"active-workspace":p(i).visibleWorkspace.value,"active-workspace-id":p(i).activeWorkspaceId.value,sessions:p(i).sessionsForView.value,groups:p(i).workspaceGroups.value,"workspace-sort-mode":p(i).workspaceSortMode.value,"pinned-sessions":p(i).pinnedSessions.value,"flat-sessions":p(i).flatSessions.value,"flat-has-more":p(i).flatSessionsHasMore.value,"flat-loading-more":p(i).flatSessionsLoadingMore.value,"done-sessions":p(i).doneSessions.value,"done-has-more":p(i).doneSessionsHasMore.value,"done-loading-more":p(i).doneSessionsLoadingMore.value,initialized:p(i).initialized.value,"active-id":p(i).activeSessionId.value,"attention-by-session":p(i).attentionBySession.value,"pending-by-session":p(i).pendingBySession.value,"unread-by-session":p(i).unreadBySession.value,onSelect:Se[0]||(Se[0]=Pe=>p(i).selectSession(Pe)),onCreate:Us,onCreateInWorkspace:Se[1]||(Se[1]=Pe=>vo(Pe)),onSelectWorkspace:Se[2]||(Se[2]=Pe=>p(i).openWorkspace(Pe)),onAddWorkspace:Se[3]||(Se[3]=Pe=>Me.value=!0),onRename:Se[4]||(Se[4]=(Pe,on)=>p(i).renameSession(Pe,on)),onGenerateTitle:Se[5]||(Se[5]=(Pe,on)=>void p(i).regenerateSessionTitle(Pe).then(on)),onArchive:Se[6]||(Se[6]=Pe=>it(Pe)),onRestore:Se[7]||(Se[7]=Pe=>dt(Pe)),onFork:Se[8]||(Se[8]=Pe=>p(i).forkSession(Pe)),onExport:Se[9]||(Se[9]=Pe=>void un(Pe)),onPin:Se[10]||(Se[10]=Pe=>p(i).togglePinSession(Pe)),onUnpin:Se[11]||(Se[11]=Pe=>p(i).unpinSession(Pe)),onDropPin:Se[12]||(Se[12]=Pe=>p(i).pinSession(Pe)),onRenameWorkspace:Se[13]||(Se[13]=(Pe,on)=>p(i).renameWorkspace(Pe,on)),onDeleteWorkspace:Se[14]||(Se[14]=Pe=>wi(Pe)),onReorderWorkspaces:Se[15]||(Se[15]=Pe=>p(i).reorderWorkspaces(Pe)),onSetWorkspaceSortMode:Se[16]||(Se[16]=Pe=>p(i).setWorkspaceSortMode(Pe)),onLoadMoreSessions:Se[17]||(Se[17]=Pe=>void p(i).loadMoreSessions(Pe)),onLoadAllSessions:Se[18]||(Se[18]=Pe=>void p(i).loadAllSessions()),onEnsureFlatSessions:Se[19]||(Se[19]=Pe=>void p(i).ensureFlatSessions()),onLoadMoreFlatSessions:Se[20]||(Se[20]=Pe=>void p(i).loadMoreFlatSessions()),onEnsureDoneSessions:Se[21]||(Se[21]=Pe=>void p(i).ensureDoneSessions()),onLoadMoreDoneSessions:Se[22]||(Se[22]=Pe=>void p(i).loadMoreDoneSessions()),onOpenSessionAdmin:Se[23]||(Se[23]=Pe=>p(i).openSessionAdmin()),onOpenSettings:Se[24]||(Se[24]=Pe=>ie.value=!0),onLogin:Ht,onCollapse:p(ve)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","workspace-sort-mode","pinned-sessions","flat-sessions","flat-has-more","flat-loading-more","done-sessions","done-has-more","done-loading-more","initialized","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),ai(U(p(uZ),{class:"side-handle","storage-key":p(P),"default-width":p(H),min:p(j),max:p(G),"onUpdate:width":Se[25]||(Se[25]=Pe=>ne.value=Pe),"onUpdate:dragging":Se[26]||(Se[26]=Pe=>Q.value=Pe)},null,8,["storage-key","default-width","min","max"]),[[Qo,!p(W)]])],64)),ai(U(iht,{ref_key:"conversationPaneRef",ref:we,mobile:p(u),turns:p(i).turns.value,"session-id":p(i).activeSessionId.value,approvals:p(i).pendingApprovals.value,changes:p(i).changes.value,"git-info":p(i).gitInfo.value,tasks:p(i).tasks.value,"rest-tasks":p(i).activeRestTasks.value,todos:p(i).todos.value,goal:p(i).goal.value,"session-plans":p(i).sessionPlans.value,"activation-badges":p(i).activationBadges.value,status:p(i).status.value,thinking:p(i).thinking.value,"plan-mode":p(i).planMode.value,"plan-armed":p(i).planArmed.value,"swarm-mode":p(i).swarmMode.value,"goal-mode":p(i).goalMode.value,models:p(i).models.value,"auth-ready":p(i).authReady.value,"managed-signed-in":p(i).managedProviderStatus.value==="authenticated","managed-membership":p(i).managedMembership.value,"starred-ids":p(i).starredModelIds.value,skills:p(i).skills.value,"skills-loaded":p(i).skillsLoaded.value,questions:p(i).questions.value,"pending-question-actions":p(i).pendingQuestionActions,"pending-approval-actions":p(i).pendingApprovalActions,running:y.value,"overlay-open":ht.value,"turn-active":p(i).turnActive.value,queued:p(i).queued.value,"search-files":p(i).searchFiles,"upload-image":p(i).uploadImage,working:p(i).working.value,"last-turn-reason":v.value,"turn-error":p(i).activeTurnError.value??null,"turn-retry":p(i).activeTurnRetry.value??null,starting:p(i).isStartingFirstPrompt.value,"file-reload-key":p(i).activeSessionId.value,"session-loading":p(i).sessionLoading.value,compaction:p(i).compaction.value,"has-more-messages":p(i).hasMoreMessages.value,"loading-more":p(i).loadingMoreMessages.value,"loading-more-error":p(i).loadMoreMessagesError.value,"load-older-messages":p(i).loadOlderMessages,"workspace-name":p(i).visibleWorkspace.value?.name,"workspace-root":p(i).visibleWorkspace.value?.root??p(i).status.value.cwd,"git-diff-stats":p(i).gitDiffStats.value,workspaces:p(i).workspacesView.value,"active-workspace-id":p(i).activeWorkspaceId.value,"recent-sessions":Oi.value,"draft-entry":p(i).draftEntry.value,"session-title":f.value,"session-archived":p(i).activeSessionArchived.value,"session-pinned":h.value,pr:p(i).activePullRequest.value,onSelectWorkspace:Se[29]||(Se[29]=Pe=>Ji(Pe)),onSelectSession:Se[30]||(Se[30]=Pe=>p(i).selectSession(Pe)),onAddWorkspace:Se[31]||(Se[31]=Pe=>Me.value=!0),onOpenPr:$i,onOpenSessionAdmin:Se[32]||(Se[32]=Pe=>p(i).openSessionAdmin(Pe)),onSubmit:Se[33]||(Se[33]=Pe=>Ni(Pe)),onLogin:Se[34]||(Se[34]=Pe=>Ht()),onSteer:Se[35]||(Se[35]=Pe=>p(i).steerPrompt(Pe.text,Pe.attachments)),onApproval:Se[36]||(Se[36]=(Pe,on)=>p(i).respondApproval(Pe,on)),onCancelTask:Se[37]||(Se[37]=Pe=>p(i).cancelTask(Pe)),onDetachTask:Se[38]||(Se[38]=Pe=>p(i).detachTask(Pe)),onAnswer:Se[39]||(Se[39]=(Pe,on)=>p(i).respondQuestion(Pe,on)),onDismiss:Se[40]||(Se[40]=Pe=>p(i).dismissQuestion(Pe)),onCommand:no,onInterrupt:co,onUnqueue:Ko,onEditQueued:ri,onReorderQueue:Li,onSteerQueued:Mi,onSetPermission:Se[41]||(Se[41]=Pe=>p(i).setPermission(Pe)),onSetThinking:Se[42]||(Se[42]=Pe=>p(i).setThinking(Pe)),onTogglePlan:Se[43]||(Se[43]=Pe=>p(i).togglePlanMode()),onToggleSwarm:Se[44]||(Se[44]=Pe=>p(i).toggleSwarmMode()),onToggleGoal:Se[45]||(Se[45]=Pe=>p(i).toggleGoalMode()),onCreateGoal:Se[46]||(Se[46]=Pe=>p(i).createGoal(Pe)),onControlGoal:Se[47]||(Se[47]=Pe=>p(i).controlGoal(Pe)),onRefreshGitStatus:Se[48]||(Se[48]=Pe=>p(i).activeSessionId.value&&p(i).loadGitStatus(p(i).activeSessionId.value)),onRenameSession:Se[49]||(Se[49]=(Pe,on)=>p(i).renameSession(Pe,on)),onForkSession:Se[50]||(Se[50]=Pe=>p(i).forkSession(Pe)),onTogglePin:g,onArchiveSession:Se[51]||(Se[51]=Pe=>it(Pe)),onRestoreSession:Se[52]||(Se[52]=Pe=>dt(Pe)),onExportSession:Se[53]||(Se[53]=Pe=>void un(Pe)),onCompact:Se[54]||(Se[54]=Pe=>p(i).compact()),onPickModel:Se[55]||(Se[55]=Pe=>jt()),onSelectModel:Se[56]||(Se[56]=Pe=>Ve(Pe)),onOpenMedia:B,onEditMessage:_o,onQuoteAction:Ds},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","rest-tasks","todos","goal","session-plans","activation-badges","status","thinking","plan-mode","plan-armed","swarm-mode","goal-mode","models","auth-ready","managed-signed-in","managed-membership","starred-ids","skills","skills-loaded","questions","pending-question-actions","pending-approval-actions","running","overlay-open","turn-active","queued","search-files","upload-image","working","last-turn-reason","turn-error","turn-retry","starting","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","recent-sessions","draft-entry","session-title","session-archived","session-pinned","pr"]),[[Qo,p(i).mainView.value==="chat"]]),ai(U(Eht,{"batch-running":Vt.value,onArchiveSessions:Se[57]||(Se[57]=Pe=>void qt("archive",Pe)),onRestoreSessions:Se[58]||(Se[58]=Pe=>void qt("restore",Pe))},null,8,["batch-running"]),[[Qo,p(i).mainView.value==="sessionAdmin"]]),!p(u)&&(p(Cd)||p(W))?(k(),de(p(an),{key:2,class:"sidebar-toggle-btn",size:"sm",label:p(W)?p(s)("sidebar.expandSidebar"):p(s)("sidebar.collapseSidebar"),tooltip:p(W)?p(s)("sidebar.expandSidebar"):p(s)("sidebar.collapseSidebar"),onClick:p(ve)},{default:ue(()=>[U(p(Ce),{name:p(W)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","tooltip","onClick"])):ee("",!0),!p(u)&&p(W)?(k(),de(p(an),{key:3,class:"new-chat-btn",size:"sm",label:p(s)("sidebar.newChat"),tooltip:p(s)("sidebar.newChat"),onClick:Us},{default:ue(()=>[U(p(Ce),{name:"chat-new"})]),_:1},8,["label","tooltip"])):ee("",!0),!p(u)||p(ce).panelVisible.value?(k(),de(kht,{key:4,ref_key:"panelTabsRef",ref:be,panel:p(ce),client:p(i),"file-preview":p(q),"on-open-media":B,"on-open-btw":Z,onMouseup:p(Mo),onPointerdown:p(go)},null,8,["panel","client","file-preview","onMouseup","onPointerdown"])):ee("",!0),U(p(AZ),{visible:p(Ei)!==null,x:p(Ei)?.x??0,y:p(Ei)?.y??0,bottom:p(Ei)?.bottom??0,px:p(Ei)?.px,py:p(Ei)?.py,quote:p(Ei)?.quote??"","focus-on-open":p(ur),"focus-return-el":Fs.value,onAction:p(Ir),onClose:p(fo)},null,8,["visible","x","y","bottom","px","py","quote","focus-on-open","focus-return-el","onAction","onClose"]),U(Q2t,{class:"internal-build-fab"}),ye.value?(k(),de(p(wot),{key:5,models:p(i).models.value,current:p(i).status.value.modelId,"starred-ids":p(i).starredModelIds.value,loading:gt.value,unavailable:_t.value,onSelect:Se[59]||(Se[59]=Pe=>Fe(Pe)),onToggleStar:Se[60]||(Se[60]=Pe=>p(i).toggleStarModel(Pe)),onClose:Se[61]||(Se[61]=Pe=>ye.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ee("",!0),U(p(OP),{closable:"",onClose:Se[69]||(Se[69]=Pe=>ie.value=!1)},{default:ue(()=>[ie.value?(k(),de(Cgt,{key:0,"color-scheme":p(i).colorScheme.value,"font-scale":p(i).fontScale.value,"managed-provider-status":p(i).managedProviderStatus.value,"managed-user-info":p(i).managedUserInfo.value,"on-fetch-usage":p(i).getUsage,notify:p(i).notifyEnabled.value,"notify-permission":p(i).notifyPermission.value,"notify-sound":p(i).notifySound.value,config:p(i).config.value,models:p(i).models.value,"config-saving":$t.value,"server-version":p(i).serverVersion.value,backend:p(i).backend.value,"experimental-flags":p(i).experimentalFlags.value,"initial-tab":mi.value,onSetColorScheme:Se[62]||(Se[62]=Pe=>p(i).setColorScheme(Pe)),onSetFontScale:Se[63]||(Se[63]=Pe=>p(i).setFontScale(Pe)),onSetNotify:Se[64]||(Se[64]=Pe=>p(i).setNotifyEnabled(Pe)),onSetNotifySound:Se[65]||(Se[65]=Pe=>p(i).setNotifySound(Pe)),onUpdateConfig:Se[66]||(Se[66]=Pe=>Vo(Pe)),onLogin:Se[67]||(Se[67]=()=>{ie.value=!1,Ht()}),onLogout:Te,onClose:Se[68]||(Se[68]=Pe=>{ie.value=!1,mi.value=void 0})},null,8,["color-scheme","font-scale","managed-provider-status","managed-user-info","on-fetch-usage","notify","notify-permission","notify-sound","config","models","config-saving","server-version","backend","experimental-flags","initial-tab"])):ee("",!0)]),_:1}),fe.value?(k(),de(p(Pet),{key:6,status:p(i).status.value,thinking:C.value,model:w.value,"plan-mode":p(i).planMode.value,"swarm-mode":p(i).swarmMode.value,"cost-usd":p(i).sessionCost.value,onClose:Se[70]||(Se[70]=Pe=>fe.value=!1),onSetThinking:Se[71]||(Se[71]=Pe=>p(i).setThinking(Pe))},null,8,["status","thinking","model","plan-mode","swarm-mode","cost-usd"])):ee("",!0),Me.value?(k(),de(p(knt),{key:7,"browse-fs":p(i).browseFs,"get-fs-home":p(i).getFsHome,"default-path":p(i).visibleWorkspace.value?.root??p(i).status.value.cwd,error:ze.value,onAdd:Se[72]||(Se[72]=Pe=>gs(Pe)),onClose:qs},null,8,["browse-fs","get-fs-home","default-path","error"])):ee("",!0),U(mo,{name:"gload-fade"},{default:ue(()=>[p(i).initialized.value?ee("",!0):(k(),de(p(D$e),{key:0,issue:p(i).connectIssue.value},null,8,["issue"]))]),_:1}),U(p(yqe),{warnings:p(i).warnings.value,onDismiss:p(i).dismissWarning},null,8,["warnings","onDismiss"]),(k(),de(us,{to:"body"},[U(mo,{name:"action-toast"},{default:ue(()=>[lt.value?(k(),de(p(wne),{key:lt.value.key,duration:lt.value.kind==="export"?lt.value.state==="running"?6e4:4e3:lt.value.kind==="attachmentOpen"?4e3:8e3,"dismiss-token":lt.value.key,onDismiss:ei},{default:ue(()=>[lt.value.kind==="archive"?(k(),L(De,{key:0},[p(Hi)?(k(),L(De,{key:0},[Oe(F(lt.value.reopen?p(s)("sidebar.reopenToastLead"):p(s)("sidebar.completeToastLead"))+" ",1),A("button",{type:"button",onClick:Qt},F(p(s)("sidebar.archiveToastUndo")),1)],64)):(k(),L(De,{key:1},[A("button",{type:"button",onClick:Qt},F(p(s)("sidebar.archiveToastUndo")),1),p(u)?ee("",!0):(k(),L(De,{key:0},[Oe(F(p(s)("sidebar.archiveToastMid"))+" ",1),A("button",{type:"button",onClick:S},F(p(s)("sidebar.archiveToastSettings")),1),Oe(" "+F(p(s)("sidebar.archiveToastTail")),1)],64))],64))],64)):lt.value.kind==="adminBatch"?(k(),L(De,{key:1},[Oe(F(lt.value.plan.direction==="archive"?p(s)("admin.batchDoneToast",{n:lt.value.plan.succeeded}):p(s)("admin.batchReopenedToast",{n:lt.value.plan.succeeded})),1),lt.value.plan.failed>0?(k(),L(De,{key:0},[Oe(F(p(s)("admin.batchFailedSuffix",{n:lt.value.plan.failed})),1)],64)):ee("",!0),A("button",{type:"button",onClick:nn},F(p(s)("admin.undo")),1)],64)):lt.value.kind==="attachmentOpen"?(k(),L(De,{key:2},[Oe(F(p(s)("composer.attachmentOpenUnsupported",{name:lt.value.name})),1)],64)):(k(),L(De,{key:3},[Oe(F(lt.value.state==="running"?p(s)("commands.export.started"):p(s)("commands.export.done")),1)],64))]),_:1},8,["duration","dismiss-token"])):ee("",!0)]),_:1})])),p(a)?(k(),de(U2t,{key:8})):ee("",!0),U(p(Ent)),p(u)?(k(),de(Ggt,{key:9,modelValue:c.value,"onUpdate:modelValue":Se[73]||(Se[73]=Pe=>c.value=Pe),groups:p(i).mobileWorkspaceGroups.value,"flat-sessions":p(i).flatSessions.value,"pinned-sessions":p(i).pinnedSessions.value,"flat-has-more":p(i).flatSessionsHasMore.value,"flat-loading-more":p(i).flatSessionsLoadingMore.value,"active-workspace-id":p(i).activeWorkspaceId.value,"active-id":p(i).activeSessionId.value,"attention-by-session":p(i).attentionBySession.value,"attention-by-workspace":p(i).attentionByWorkspace.value,onSelect:Se[74]||(Se[74]=Pe=>p(i).selectSession(Pe)),onCreate:Us,onCreateInWorkspace:Se[75]||(Se[75]=Pe=>vo(Pe)),onAddWorkspace:Se[76]||(Se[76]=Pe=>Me.value=!0),onRename:Se[77]||(Se[77]=(Pe,on)=>p(i).renameSession(Pe,on)),onArchive:Se[78]||(Se[78]=Pe=>it(Pe)),onDeleteWorkspace:Se[79]||(Se[79]=Pe=>wi(Pe)),onLoadMore:Se[80]||(Se[80]=Pe=>void p(i).loadMoreSessions(Pe)),onEnsureFlatSessions:Se[81]||(Se[81]=Pe=>void p(i).ensureFlatSessions()),onLoadMoreFlatSessions:Se[82]||(Se[82]=Pe=>void p(i).loadMoreFlatSessions())},null,8,["modelValue","groups","flat-sessions","pinned-sessions","flat-has-more","flat-loading-more","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ee("",!0),p(u)?(k(),de(fvt,{key:10,modelValue:d.value,"onUpdate:modelValue":Se[83]||(Se[83]=Pe=>d.value=Pe),status:p(i).status.value,thinking:p(i).thinking.value,models:p(i).models.value,"plan-mode":p(i).planArmed.value||p(i).planMode.value,"goal-mode":p(i).goalMode.value,"goal-active":oe.value,"swarm-mode":p(i).swarmMode.value,"color-scheme":p(i).colorScheme.value,"font-scale":p(i).fontScale.value,"managed-provider-status":p(i).managedProviderStatus.value,"managed-user-info":p(i).managedUserInfo.value,"server-version":p(i).serverVersion.value,onPickModel:Se[84]||(Se[84]=Pe=>jt()),onSetThinking:Se[85]||(Se[85]=Pe=>p(i).setThinking(Pe)),onTogglePlan:Se[86]||(Se[86]=Pe=>p(i).togglePlanMode()),onToggleGoal:Se[87]||(Se[87]=Pe=>p(i).toggleGoalMode()),onFocusGoal:le,onToggleSwarm:Se[88]||(Se[88]=Pe=>p(i).toggleSwarmMode()),onSetPermission:Se[89]||(Se[89]=Pe=>p(i).setPermission(Pe)),onSetColorScheme:Se[90]||(Se[90]=Pe=>p(i).setColorScheme(Pe)),onSetFontScale:Se[91]||(Se[91]=Pe=>p(i).setFontScale(Pe)),onLogin:Se[92]||(Se[92]=()=>{d.value=!1,Ht()}),onLogout:Te},null,8,["modelValue","status","thinking","models","plan-mode","goal-mode","goal-active","swarm-mode","color-scheme","font-scale","managed-provider-status","managed-user-info","server-version"])):ee("",!0)],10,J2t),p(i).initialized.value&&T.value?(k(),de(m2t,{key:1,"auth-ready":p(i).managedProviderStatus.value==="authenticated","on-start-o-auth-login":ot,"on-poll-o-auth-login":Ue,"on-cancel-o-auth-login":st,"on-get-o-auth-region":In,onComplete:N,onLoginSuccess:ui,onAddProvider:I},null,8,["auth-ready"])):ee("",!0),Ae.value?(k(),de(spt,{key:2,"on-start-o-auth-login":ot,"on-poll-o-auth-login":Ue,"on-cancel-o-auth-login":st,"on-get-o-auth-region":In,onSuccess:kt,onClose:Se[93]||(Se[93]=Pe=>Ae.value=!1)})):ee("",!0),z.value?(k(),de(p(CZ),{key:3,media:z.value,"origin-img":$.value,onClose:Se[94]||(Se[94]=Pe=>{z.value=null,$.value=null})},null,8,["media","origin-img"])):ee("",!0)]))}}),eyt=St(X2t,[["__scopeId","data-v-db3fae69"]]);Vut();zze({api:b1,t:(e,t)=>t===void 0?jh.global.t(e):jh.global.t(e,t),traceClientEvent:qut,traceKeyEvent:(e,t)=>rv(e,t),sessionExportTraceToJsonl:Qut});const zv=_9(eyt).use(jh);zv.config.errorHandler=(e,t,n)=>Uut(e,n);zv.use(sm);const tyt={t:(e,t)=>jh.global.t(e,t)};zv.provide(E$,tyt);zv.provide(n$,e=>JRe(e)?.component);zv.mount("#app");if(qh){const e=window.kimiDesktop;if(e){const t=()=>{const n=document.documentElement.dataset.colorScheme;e.setTheme(n==="light"||n==="dark"?n:"system")};new MutationObserver(t).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),t()}}export{lk as $,aO as A,jQ as B,rs as C,Gyt as D,_R as E,De as F,Qd as G,Oe as H,U as I,kQ as J,byt as K,Cu as L,rt as M,vJ as N,xyt as O,Syt as P,Iyt as Q,r9 as R,t1 as S,us as T,_yt as U,m6 as V,Ayt as W,Yyt as X,Myt as Y,qyt as Z,nyt as _,eO as a,zo as a$,hs as a0,av as a1,ayt as a2,o6 as a3,NO as a4,Tn as a5,H1 as a6,NQ as a7,e9t as a8,gyt as a9,sO as aA,nY as aB,rO as aC,kn as aD,lY as aE,rY as aF,Gd as aG,sY as aH,Ln as aI,W1 as aJ,SQ as aK,k as aL,pJ as aM,fyt as aN,ii as aO,WR as aP,dyt as aQ,d9 as aR,ao as aS,a9 as aT,V as aU,$yt as aV,NJ as aW,Ct as aX,Wn as aY,uY as aZ,wyt as a_,kyt as aa,yyt as ab,vyt as ac,zyt as ad,t9t as ae,Yt as af,UY as ag,fk as ah,Iu as ai,Cc as aj,Ao as ak,Pyt as al,Ol as am,Dd as an,Et as ao,Lyt as ap,Nyt as aq,di as ar,ft as as,QY as at,Re as au,VG as av,sn as aw,tY as ax,oY as ay,Xn as az,cyt as b,p2e as b$,Kyt as b0,m0 as b1,y9 as b2,Uyt as b3,Nd as b4,Mh as b5,oyt as b6,Ya as b7,DQ as b8,Vyt as b9,ar as bA,Qo as bB,VY as bC,Hyt as bD,We as bE,p0 as bF,pyt as bG,BQ as bH,Fyt as bI,ue as bJ,Tyt as bK,ai as bL,Yo as bM,jyt as bN,Tt as bO,hyt as bP,Ri as bQ,Jo as bR,r9t as bS,l9t as bT,hH as bU,a9t as bV,Fve as bW,fH as bX,yC as bY,f9t as bZ,v2e as b_,iyt as ba,F as bb,by as bc,Cyt as bd,yi as be,syt as bf,bQ as bg,Fa as bh,Oyt as bi,gQ as bj,p as bk,q1 as bl,Xyt as bm,Qyt as bn,kJ as bo,HQ as bp,Byt as bq,FQ as br,Jyt as bs,Eyt as bt,myt as bu,XR as bv,S9 as bw,MJ as bx,ZO as by,ow as bz,Wyt as c,x7 as c0,C7 as c1,A7 as c2,p9t as c3,o4 as c4,jp as c5,n4 as c6,c2e as c7,d2e as c8,m9t as c9,h9t as ca,i9t as cb,g9t as cc,Ok as cd,sl as ce,M2e as cf,_2e as cg,Mve as ch,s9t as ci,Ave as cj,xve as ck,o9t as cl,S7 as cm,I2e as cn,LL as co,dL as cp,Rve as cq,i4 as cr,t4 as cs,u9t as ct,d9t as cu,n9t as cv,c9t as cw,Ryt as d,wd as e,ryt as f,mo as g,VO as h,lyt as i,uyt as j,wa as k,uv as l,Es as m,ik as n,Ac as o,Zyt as p,D as q,_9 as r,de as s,ee as t,L as u,A as v,LY as w,Dyt as x,EY as y,DJ as z}; diff --git a/apps/kimi-code/dist-web/assets/index-DuIqvsra.js b/apps/kimi-code/dist-web/assets/index-DzigsE_1.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index-DuIqvsra.js rename to apps/kimi-code/dist-web/assets/index-DzigsE_1.js index 6d24426bbd7..53aca1f8893 100644 --- a/apps/kimi-code/dist-web/assets/index-DuIqvsra.js +++ b/apps/kimi-code/dist-web/assets/index-DzigsE_1.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-HNnZUWAn.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-2xfisSek.js","assets/html-derivative-DlHx6ybY.js","assets/sql-CRqJ_cUM.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-UfJy6YNI.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-DGywbUpC.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-Dm6A9KJ5.js","assets/ruby-DyJCeAvU.js","assets/haml-D5jkg6IW.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-DbPARsA_.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-D7OTSIA_.js","assets/r-Dspwwk_N.js","assets/just-CUsbIsdP.js","assets/perl-B9cMNwum.js","assets/latex-CaSxy8MP.js","assets/tex-idrVyKtj.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-DTYItulj.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/php-Csjmro_R.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BjBPvh-w.js","assets/csharp-DSvCPggb.js","assets/rst-CpCqk9r5.js","assets/cmake-D1j8_8rp.js","assets/sas-DEy46yEz.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-8wufbnw4.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DI20mbqo.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/go-C27-OAKa.js","assets/ts-tags-D351s5mN.js","assets/twig-CW1WmMYd.js","assets/vue-D2xRrEX4.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]); -import{bR as c}from"./index-CvgiEu-R.js";var Ft=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,to=Object.getOwnPropertyNames,no=Object.prototype.hasOwnProperty,an=(e,t)=>{let n={};for(var r in e)Ft(n,r,{get:e[r],enumerable:!0});return Ft(n,Symbol.toStringTag,{value:"Module"}),n},ro=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=to(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=eo(t,a))||r.enumerable});return e},Sr=(e,t,n)=>(ro(e,t,"default"),n);const Ne=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>c(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-Dqspr-GT.js"),[]))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>c(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-BIv1doCn.js"),[]))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-MRO5bC_T.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>c(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>c(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-CaSxy8MP.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-KW6xsasC.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>c(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>c(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>c(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>c(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[]))}],at=Object.fromEntries(Ne.map(e=>[e.id,e.import])),lt=Object.fromEntries(Ne.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ut={...at,...lt},ct=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>c(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],dt=Object.fromEntries(ct.map(e=>[e.id,e.import]));var ln=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function io(){return 2147483648}function oo(){return typeof performance<"u"?performance.now():Date.now()}const so=(e,t)=>e+(t-e%t)%t;async function ao(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,E){r.HEAPU8.copyWithin(h,m,m+E)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const E=io();if(h>E)return!1;for(let b=1;b<=4;b*=2){let g=m*(1+.2/b);g=Math.min(g,h+100663296);const y=Math.min(E,so(Math.max(h,g),65536));if(s(y))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,E=1024){const b=m+E;let g=m;for(;h[g]&&!(g>=b);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let y="";for(;m>10,56320|I&1023)}}return y}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:oo,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=p}return await f(),r}var lo=Object.defineProperty,uo=(e,t,n)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>uo(e,typeof t!="symbol"?t+"":t,n);let D=null;function co(e){throw new ln(e.UTF8ToString(e.getLastOnigError()))}class pt{constructor(t){P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16Value"),P(this,"utf8Value"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16");const n=t.length,r=pt._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&p<=56319&&u+1=56320&&h<=57343&&(d=(p-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const ht=class X{constructor(t){if(P(this,"id",++X.LAST_ID),P(this,"_onigBinding"),P(this,"content"),P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16"),P(this,"ptr"),!D)throw new ln("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new pt(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!X._sharedPtrInUse?(X._sharedPtr||(X._sharedPtr=D.omalloc(1e4)),X._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,X._sharedPtr),this.ptr=X._sharedPtr):this.ptr=n.createString(D)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===X._sharedPtr?X._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};P(ht,"LAST_ID",0);P(ht,"_sharedPtr",0);P(ht,"_sharedPtrInUse",!1);let Lr=ht;class po{constructor(t){if(P(this,"_onigBinding"),P(this,"_ptr"),!D)throw new ln("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),ho(r)?r=await r.instantiator(n):fo(r)?r=await r.default(n):(mo(r)&&(r=r.data),go(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await yo(r)(n):r=await Eo(r)(n):_o(r)?r=await Lt(r)(n):r instanceof WebAssembly.Module?r=await Lt(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Lt(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Fe=t(),Fe}function Lt(e){return t=>WebAssembly.instantiate(e,t)}function yo(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Eo(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let Rr;function bo(e){Rr=e}function wo(){return Rr}async function un(e){return e&&await ft(e),{createScanner(t){return new po(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Lr(t)}}}const vo=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:un,getDefaultWasmLoader:wo,loadWasm:ft,setDefaultWasmLoader:bo},Symbol.toStringTag,{value:"Module"}));var Ir=an({});Sr(Ir,vo);var L=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Co(e){return cn(e)}function cn(e){return Array.isArray(e)?Ao(e):e instanceof RegExp?e:typeof e=="object"?ko(e):e}function Ao(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function Pr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Pr(e.substring(0,e.length-1)):e.substr(~t+1)}var Rt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,je=class{static hasCaptures(e){return e===null?!1:(Rt.lastIndex=0,Rt.test(e))}static replaceCaptures(e,t,n){return e.replace(Rt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Or(e,t){return et?1:0}function xr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>So(e.parent,i.parentScopes));return r?new Vr(r.fontStyle,r.foreground,r.background):null}},It=class Ke{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Ke(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Lo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Lo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Vr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ro(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new Io(E,b,i,l,u,p)}}return n}var Io=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},$=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($||{});function To(e,t){e.sort((l,u)=>{let p=Or(l.scope,u.scope);return p!==0||(p=xr(l.parentScopes,u.parentScopes),p!==0)?p:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Po(t),s=new Vr(n,o.getId(r),o.getId(i)),a=new xo(new jt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},xo=class Ht{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ht._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Ht(this._mainRule.clone(),jt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,d=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(p=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|p<<10|d<<11|f<<15|h<<24)>>>0}};function Ze(e,t){const n=[],r=Do(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(Mn(i)){const l=[];do l.push(i),i=r.next();while(Mn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return p=>l.every(d=>d(p))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return p=>l.some(d=>d(p))}}function Mn(e){return!!e&&!!e.match(/[\w\.:]+/)}function Do(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Mr(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},No=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vo=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},$o=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Vo;for(const n of e)Mo(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Mo(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Qe({baseGrammar:o,selfGrammar:i},r):Wt(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Se(a))}function Wt(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];et([r],t,n)}}function Qe(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&et(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&et(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function et(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Tr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&et(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Gr(o);switch(s.kind){case 0:Qe({...t,selfGrammar:t.baseGrammar},n);break;case 1:Qe(t,n);break;case 2:Wt(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?Wt(s.ruleName,l,n):Qe(l,n)}else s.kind===4?n.add(new No(s.scopeName,s.ruleName)):n.add(new Se(s.scopeName));break}}}var Go=class{kind=0},Bo=class{kind=1},Uo=class{constructor(e){this.ruleName=e}kind=2},Fo=class{constructor(e){this.scopeName=e}kind=3},jo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Gr(e){if(e==="$base")return new Go;if(e==="$self")return new Bo;const t=e.indexOf("#");if(t===-1)return new Fo(e);if(t===0)return new Uo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new jo(n,r)}}var Ho=/\\(\d+)/,Gn=/\\(\d+)/g,Wo=-1,Br=-2;var Ve=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=je.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=je.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Pr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:je.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:je.replaceCaptures(this._contentName,e,t)}},zo=class extends Ve{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},qo=class extends Ve{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Le(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Bn=class extends Ve{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zt=class extends Ve{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this._end=new Le(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},tt=class extends Ve{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Le(s,Br),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Ur=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new zo(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new qo(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Tr({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Bn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new tt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,V._compileCaptures(t.whileCaptures||t.captures,n,r),V._compilePatterns(t.patterns,n,r)):new zt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,V._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,V._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=V.getCompiledRuleId(t[s],n,r)),i[a]=V.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Gn.lastIndex=0,this.source.replace(Gn,(i,o)=>Dr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new Un(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new Un(e,r,this._items.map(i=>i.ruleId))}},Un=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{let n={};for(var r in e)Ft(n,r,{get:e[r],enumerable:!0});return Ft(n,Symbol.toStringTag,{value:"Module"}),n},ro=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=to(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=eo(t,a))||r.enumerable});return e},Sr=(e,t,n)=>(ro(e,t,"default"),n);const Ne=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>c(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-Dqspr-GT.js"),[]))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>c(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-BIv1doCn.js"),[]))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-MRO5bC_T.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>c(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>c(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-CaSxy8MP.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-KW6xsasC.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>c(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>c(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>c(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>c(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[]))}],at=Object.fromEntries(Ne.map(e=>[e.id,e.import])),lt=Object.fromEntries(Ne.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ut={...at,...lt},ct=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>c(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],dt=Object.fromEntries(ct.map(e=>[e.id,e.import]));var ln=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function io(){return 2147483648}function oo(){return typeof performance<"u"?performance.now():Date.now()}const so=(e,t)=>e+(t-e%t)%t;async function ao(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,E){r.HEAPU8.copyWithin(h,m,m+E)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const E=io();if(h>E)return!1;for(let b=1;b<=4;b*=2){let g=m*(1+.2/b);g=Math.min(g,h+100663296);const y=Math.min(E,so(Math.max(h,g),65536));if(s(y))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,E=1024){const b=m+E;let g=m;for(;h[g]&&!(g>=b);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let y="";for(;m>10,56320|I&1023)}}return y}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:oo,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=p}return await f(),r}var lo=Object.defineProperty,uo=(e,t,n)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>uo(e,typeof t!="symbol"?t+"":t,n);let D=null;function co(e){throw new ln(e.UTF8ToString(e.getLastOnigError()))}class pt{constructor(t){P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16Value"),P(this,"utf8Value"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16");const n=t.length,r=pt._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&p<=56319&&u+1=56320&&h<=57343&&(d=(p-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const ht=class X{constructor(t){if(P(this,"id",++X.LAST_ID),P(this,"_onigBinding"),P(this,"content"),P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16"),P(this,"ptr"),!D)throw new ln("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new pt(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!X._sharedPtrInUse?(X._sharedPtr||(X._sharedPtr=D.omalloc(1e4)),X._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,X._sharedPtr),this.ptr=X._sharedPtr):this.ptr=n.createString(D)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===X._sharedPtr?X._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};P(ht,"LAST_ID",0);P(ht,"_sharedPtr",0);P(ht,"_sharedPtrInUse",!1);let Lr=ht;class po{constructor(t){if(P(this,"_onigBinding"),P(this,"_ptr"),!D)throw new ln("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),ho(r)?r=await r.instantiator(n):fo(r)?r=await r.default(n):(mo(r)&&(r=r.data),go(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await yo(r)(n):r=await Eo(r)(n):_o(r)?r=await Lt(r)(n):r instanceof WebAssembly.Module?r=await Lt(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Lt(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Fe=t(),Fe}function Lt(e){return t=>WebAssembly.instantiate(e,t)}function yo(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Eo(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let Rr;function bo(e){Rr=e}function wo(){return Rr}async function un(e){return e&&await ft(e),{createScanner(t){return new po(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Lr(t)}}}const vo=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:un,getDefaultWasmLoader:wo,loadWasm:ft,setDefaultWasmLoader:bo},Symbol.toStringTag,{value:"Module"}));var Ir=an({});Sr(Ir,vo);var L=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Co(e){return cn(e)}function cn(e){return Array.isArray(e)?Ao(e):e instanceof RegExp?e:typeof e=="object"?ko(e):e}function Ao(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function Pr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Pr(e.substring(0,e.length-1)):e.substr(~t+1)}var Rt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,je=class{static hasCaptures(e){return e===null?!1:(Rt.lastIndex=0,Rt.test(e))}static replaceCaptures(e,t,n){return e.replace(Rt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Or(e,t){return et?1:0}function xr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>So(e.parent,i.parentScopes));return r?new Vr(r.fontStyle,r.foreground,r.background):null}},It=class Ke{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Ke(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Lo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Lo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Vr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ro(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new Io(E,b,i,l,u,p)}}return n}var Io=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},$=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($||{});function To(e,t){e.sort((l,u)=>{let p=Or(l.scope,u.scope);return p!==0||(p=xr(l.parentScopes,u.parentScopes),p!==0)?p:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Po(t),s=new Vr(n,o.getId(r),o.getId(i)),a=new xo(new jt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},xo=class Ht{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ht._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Ht(this._mainRule.clone(),jt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,d=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(p=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|p<<10|d<<11|f<<15|h<<24)>>>0}};function Ze(e,t){const n=[],r=Do(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(Mn(i)){const l=[];do l.push(i),i=r.next();while(Mn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return p=>l.every(d=>d(p))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return p=>l.some(d=>d(p))}}function Mn(e){return!!e&&!!e.match(/[\w\.:]+/)}function Do(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Mr(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},No=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vo=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},$o=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Vo;for(const n of e)Mo(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Mo(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Qe({baseGrammar:o,selfGrammar:i},r):Wt(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Se(a))}function Wt(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];et([r],t,n)}}function Qe(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&et(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&et(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function et(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Tr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&et(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Gr(o);switch(s.kind){case 0:Qe({...t,selfGrammar:t.baseGrammar},n);break;case 1:Qe(t,n);break;case 2:Wt(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?Wt(s.ruleName,l,n):Qe(l,n)}else s.kind===4?n.add(new No(s.scopeName,s.ruleName)):n.add(new Se(s.scopeName));break}}}var Go=class{kind=0},Bo=class{kind=1},Uo=class{constructor(e){this.ruleName=e}kind=2},Fo=class{constructor(e){this.scopeName=e}kind=3},jo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Gr(e){if(e==="$base")return new Go;if(e==="$self")return new Bo;const t=e.indexOf("#");if(t===-1)return new Fo(e);if(t===0)return new Uo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new jo(n,r)}}var Ho=/\\(\d+)/,Gn=/\\(\d+)/g,Wo=-1,Br=-2;var Ve=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=je.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=je.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Pr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:je.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:je.replaceCaptures(this._contentName,e,t)}},zo=class extends Ve{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},qo=class extends Ve{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Le(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Bn=class extends Ve{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zt=class extends Ve{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this._end=new Le(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},tt=class extends Ve{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Le(s,Br),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Ur=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new zo(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new qo(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Tr({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Bn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new tt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,V._compileCaptures(t.whileCaptures||t.captures,n,r),V._compilePatterns(t.patterns,n,r)):new zt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,V._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,V._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=V.getCompiledRuleId(t[s],n,r)),i[a]=V.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Gn.lastIndex=0,this.source.replace(Gn,(i,o)=>Dr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new Un(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new Un(e,r,this._items.map(i=>i.ruleId))}},Un=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Tt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(qt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ko=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Dr(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Fn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function jr(e,t,n,r,i,o,s,a){const l=t.content.length;let u=!1,p=-1;if(s){const h=Qo(e,t,n,r,i,o);i=h.stack,r=h.linePos,n=h.isFirstLine,p=h.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Fn(i,!0);f()}return new Fn(i,!1);function f(){const h=Jo(e,t,n,r,i,p);if(!h){o.produce(i,l),u=!0;return}const m=h.captureIndices,E=h.matchedRuleId,b=m&&m.length>0?m[0].end>r:!1;if(E===Wo){const g=i.getRule(e);o.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ce(e,t,n,i,o,g.endCaptures,m),o.produce(i,m[0].end);const y=i;if(i=i.parent,p=y.getAnchorPos(),!b&&y.getEnterPos()===r){i=y,o.produce(i,l),u=!0;return}}else{const g=e.getRule(E);o.produce(i,m[0].start);const y=i,w=g.getName(t.content,m),A=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(E,r,p,m[0].end===l,null,A,A),g instanceof zt){const k=g;Ce(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const I=k.getContentName(t.content,m),M=A.pushAttributed(I,e);if(i=i.withContentNameScopesList(M),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(t.content,m))),!b&&y.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(g instanceof tt){const k=g;Ce(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const I=k.getContentName(t.content,m),M=A.pushAttributed(I,e);if(i=i.withContentNameScopesList(M),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(t.content,m))),!b&&y.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(Ce(e,t,n,i,o,g.captures,m),o.produce(i,m[0].end),i=i.pop(),!b){i=i.safePop(),o.produce(i,l),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function Qo(e,t,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(e);u instanceof tt&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:p}=es(l.rule,e,l.stack.endRule,n,r===s),d=u.findNextMatchSync(t,r,p);if(d){if(d.ruleId!==Br){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(l.stack,d.captureIndices[0].start),Ce(e,t,n,l.stack,o,l.rule.whileCaptures,d.captureIndices),o.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function Jo(e,t,n,r,i,o){const s=Yo(e,t,n,r,i,o),a=e.getInjections();if(a.length===0)return s;const l=Zo(a,e,t,n,r,i,o);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,p=l.captureIndices[0].start;return p=a)&&(a=w,l=y.captureIndices,u=y.ruleId,p=m.priority,a===i))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:u}:null}function Hr(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function es(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Ce(e,t,n,r,i,o,s){if(o.length===0)return;const a=t.content,l=Math.min(o.length,s.length),u=[],p=s[0].end;for(let d=0;dp)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,h.start):i.produce(r,h.start),f.retokenizeCapturedWithRuleId){const E=f.getName(a,s),b=r.contentNameScopesList.pushAttributed(E,e),g=f.getContentName(a,s),y=b.pushAttributed(g,e),w=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,b,y),A=e.createOnigString(a.substring(0,h.end));jr(e,A,n&&h.start===0,h.start,w,i,!1,0),Mr(A);continue}const m=f.getName(a,s);if(m!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new ts(b,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var ts=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ns(e,t,n,r,i,o,s,a){return new is(e,t,n,r,i,o,s,a)}function jn(e,t,n,r,i){const o=Ze(t,nt),s=Ur.getCompiledRuleId(n,r,i.repository);for(const a of o)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:i,priority:a.priority})}function nt(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var is=class{constructor(e,t,n,r,i,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Xo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Hn(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=Ze(l,nt);for(const p of u)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)jn(t,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&jn(t,l,a,this,a)}})}return t.sort((i,o)=>i.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Hn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Ur.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Xt.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),d=le.set(0,u.languageId,u.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Ae.createRootAndLookUpScopeName(f,d,this):h=Ae.createRoot("unknown",d),t=new Xt(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,t.reset();e=e+` `;const o=this.createOnigString(e),s=o.content.length,a=new ss(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=jr(this,o,i,0,t,a,!0,r);return Mr(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Hn(e,t){return e=Co(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ae=class K{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const o of n)i=It.push(i,o.scopeNames),r=new K(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new K(null,new It(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new It(null,t),s=r.themeProvider.themeMatch(o),a=K.mergeAttributes(n,i,s);return new K(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return K.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),le.set(t,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return K._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=K._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),s=r.themeProvider.themeMatch(o),a=K.mergeAttributes(t.tokenAttributes,i,s);return new K(t,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Xt=class ie{constructor(t,n,r,i,o,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new ie(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ie._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ae.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){ie._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,s,a){return new ie(this,t,n,r,i,o,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new ie(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Ae.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new ie(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ae.fromExtension(r,n.contentNameScopesList))}},os=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Ze(n,nt).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Ze(n,nt).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ss=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(r=le.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=le.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,r,i,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},Kt=Xt.NULL;function Ie(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function ee(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Wr(e){return Array.isArray(e)?e:[e]}async function dn(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function $e(e){return!e||["plaintext","txt","text","plain"].includes(e)}function pn(e){return e==="ansi"||$e(e)}function Me(e){return e==="none"}function hn(e){return Me(e)}const us=/(\r?\n)/g;function Ge(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(us);let r=0;const i=[];for(let o=0;o!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?Wn.light:Wn.dark),n||(n=t.type==="light"?zn.light:zn.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const o=new Map;function s(a){if(o.has(a))return o.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(o.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const p={...a,settings:{...a.settings}};if(l){const d=s(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,p.settings.foreground=d}if(u){const d=s(a.settings.background);t.colorReplacements[d]=a.settings.background,p.settings.background=d}return p});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,qn,{enumerable:!1,writable:!1,value:!0}),t}async function zr(e){return[...new Set((await Promise.all(e.filter(t=>!pn(t)).map(async t=>await dn(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function qr(e){return(await Promise.all(e.map(async t=>hn(t)?null:mt(await dn(t))))).filter(t=>!!t)}function Xr(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new L(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var cs=class extends ls{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=mt(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Ye.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Xr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,i])=>!i);if(n.length){const r=t.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>n.map(([a])=>a).includes(s)):!1).filter(i=>!n.includes(i));throw new L(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},ds=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let ve=0;function gt(e){ve+=1,e.warnings!==!1&&ve>=10&&ve%10===0&&console.warn(`[Shiki] ${ve} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new L("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(mt),i=new cs(new ds(e.engine,n),r,n,e.langAlias);let o;function s(y){return Xr(y,e.langAlias)}function a(y){b();const w=i.getGrammar(typeof y=="string"?y:y.name);if(!w)throw new L(`Language \`${y}\` not found, you may need to load it first`);return w}function l(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const w=i.getTheme(y);if(!w)throw new L(`Theme \`${y}\` not found, you may need to load it first`);return w}function u(y){b();const w=l(y);return o!==y&&(i.setTheme(w),o=y),{theme:w,colorMap:i.getColorMap()}}function p(){return b(),i.getLoadedThemes()}function d(){return b(),i.getLoadedLanguages()}function f(...y){b(),i.loadLanguages(y.flat(1))}async function h(...y){return f(await zr(y))}function m(...y){b();for(const w of y.flat(1))i.loadTheme(w)}async function E(...y){return b(),m(await qr(y))}function b(){if(t)throw new L("Shiki instance has been disposed")}function g(){t||(t=!0,i.dispose(),ve-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:p,getLoadedLanguages:d,resolveLangAlias:s,loadLanguage:h,loadLanguageSync:f,loadTheme:E,loadThemeSync:m,dispose:g,[Symbol.dispose]:g}}const ps=gt;async function fn(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([qr(e.themes||[]),zr(e.langs||[]),e.engine]);return gt({...e,themes:t,langs:n,engine:r})}const hs=fn,Kr=new WeakMap;function _t(e,t){Kr.set(e,t)}function Te(e){return Kr.get(e)}var yt=class Qr{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Qr(Object.fromEntries(Wr(n).map(r=>[r,Kt])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return fs(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function fs(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function ms(e,t){if(!(e instanceof yt))throw new L("Invalid grammar state");return e.getInternalStack(t)}const gs=/,/,_s=/ /;function Jr(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if($e(e.resolveLangAlias(n.lang||"text"))||Me(r))return Ge(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:o}=e.setTheme(r),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new L(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new L(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Zr(t,s,i,o,n)}function Yr(...e){if(e.length===2)return Te(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if($e(i)||Me(o))throw new L("Plain language does not have grammar state");if(i==="ansi")throw new L("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(i);return new yt(mn(n,l,s,a,r).stateStack,l.name,s.name)}function Zr(e,t,n,r,i){const o=mn(e,t,n,r,i),s=new yt(o.stateStack,t.name,n.name);return _t(o.tokens,s),o.tokens}function mn(e,t,n,r,i){const o=Ie(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=i,u=Ge(e);let p=i.grammarState?ms(i.grammarState,n.name)??Kt:i.grammarContextCode!=null?mn(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Kt,d=[];const f=[];for(let h=0,m=u.length;h0&&E.length>=s){d=[],f.push([{content:E,offset:b,color:"",fontStyle:0}]);continue}let g,y,w;l&&l!=="tokenType"&&(g=t.tokenizeLine(E,p,a),y=g.tokens,w=0);const A=t.tokenizeLine2(E,p,a),k=A.tokens.length/2;for(let I=0;ISt.trim());break;case"object":he=Q.scope;break;default:continue}Nn.push({settings:Q,selectors:he.map(St=>St.split(_s))})}q.explanation=[];let Vn=0;for(;M+Vn({scopeName:t}))}function Es(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)Xn(e[r],n[i])&&(r-=1),i-=1;return r===-1}function ws(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const s of i)if(bs(s,t,n)){r.push(o);break}return r}function gn(e,t,n,r=Jr){const i=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=i.map(u=>{const p=r(e,t,{...n,theme:u.theme});return{tokens:p,state:Te(p),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),s=vs(...o.map(u=>u.tokens)),a=s[0].map((u,p)=>u.map((d,f)=>{const h={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=d.explanation),s.forEach((m,E)=>{const{content:b,explanation:g,offset:y,...w}=m[p][f];h.variants[i[E].color]=w}),h})),l=o[0].state?new yt(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return l&&_t(a,l),a}function vs(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;rl[r]),o=t.map(()=>[]);t.forEach((l,u)=>l.push(o[u]));const s=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u4&&n.slice(0,4)==="data"&&Rs.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Qn,Ps);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Qn.test(o)){let s=o.replace(Ls,Ts);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=_n}return new i(r,t)}function Ts(e){return"-"+e.toLowerCase()}function Ps(e){return e.charAt(1).toUpperCase()}const Os=ei([ti,ks,ii,oi,si],"html"),ai=ei([ti,Ss,ii,oi,si],"svg"),Jn={}.hasOwnProperty;function xs(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&Jn.call(i,e)){const l=String(i[e]);s=Jn.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Ds=/["&'<>`]/g,Ns=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Vs=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,$s=/[|\\{}()[\]^$+*?.]/g,Yn=new WeakMap;function Ms(e,t){if(e=e.replace(t.subset?Gs(t.subset):Ds,r),t.subset||t.escapeOnly)return e;return e.replace(Ns,n).replace(Vs,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function Gs(e){let t=Yn.get(e);return t||(t=Bs(e),Yn.set(e,t)),t}function Bs(e){const t=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},zs=["cent","copy","divide","gt","lt","not","para","times"],li={}.hasOwnProperty,Zt={};let He;for(He in Ot)li.call(Ot,He)&&(Zt[Ot[He]]=He);const qs=/[^\dA-Za-z]/;function Xs(e,t,n,r){const i=String.fromCharCode(e);if(li.call(Zt,i)){const o=Zt[i],s="&"+o;return n&&Ws.includes(o)&&!zs.includes(o)&&(!r||t&&t!==61&&qs.test(String.fromCharCode(t)))?s:s+";"}return""}function Ks(e,t,n){let r=Fs(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Xs(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=Hs(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],Ys=["<",">"];function Zs(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return ye(o,Object.assign({},r.settings.characterReferences,{subset:Ys}))}}function ea(e,t,n,r){return""}function Zn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ta(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function na(e){return e.join(" ").trim()}const ra=/[ \t\n\f\r]/g;function yn(e){return typeof e=="object"?e.type==="text"?er(e.value):!1:er(e)}function er(e){return e.replace(ra,"")===""}const x=ci(1),ui=ci(-1),ia=[];function ci(e){return t;function t(n,r,i){const o=n?n.children:ia;let s=(r||0)+e,a=o[s];if(!i)for(;a&&yn(a);)s+=e,a=o[s];return a}}const oa={}.hasOwnProperty;function di(e){return t;function t(n,r,i){return oa.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const En=di({body:aa,caption:xt,colgroup:xt,dd:da,dt:ca,head:xt,html:sa,li:ua,optgroup:pa,option:ha,p:la,rp:tr,rt:tr,tbody:ma,td:nr,tfoot:ga,th:nr,thead:fa,tr:_a});function xt(e,t,n){const r=x(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&yn(r.value.charAt(0)))}function sa(e,t,n){const r=x(n,t);return!r||r.type!=="comment"}function aa(e,t,n){const r=x(n,t);return!r||r.type!=="comment"}function la(e,t,n){const r=x(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ua(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="li"}function ca(e,t,n){const r=x(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function da(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function tr(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function pa(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function ha(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function fa(e,t,n){const r=x(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ma(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function ga(e,t,n){return!x(n,t)}function _a(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function nr(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ya=di({body:wa,colgroup:va,head:ba,html:Ea,tbody:Ca});function Ea(e){const t=x(e,-1);return!t||t.type!=="comment"}function ba(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function wa(e){const t=x(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&yn(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function va(e,t,n){const r=ui(n,t),i=x(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&En(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Ca(e,t,n){const r=ui(n,t),i=x(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&En(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const We={name:[[` \f\r &/=>`.split(""),` diff --git a/apps/kimi-code/dist-web/assets/index-BxiMZi52.css b/apps/kimi-code/dist-web/assets/index-QkzZp0Kk.css similarity index 73% rename from apps/kimi-code/dist-web/assets/index-BxiMZi52.css rename to apps/kimi-code/dist-web/assets/index-QkzZp0Kk.css index cd5e0fc1eae..c0b1dbf648c 100644 --- a/apps/kimi-code/dist-web/assets/index-BxiMZi52.css +++ b/apps/kimi-code/dist-web/assets/index-QkzZp0Kk.css @@ -29,4 +29,4 @@ * The original design remains. The terminal itself * has been extended to include xterm CSI codes, among * other features. - */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;inset:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;inset:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.toasts[data-v-f46ca0b3]{position:fixed;right:16px;bottom:84px;display:flex;flex-direction:column;gap:var(--space-2);z-index:var(--z-toast);width:min(440px,calc(100vw - 32px));max-height:56vh;overflow-y:auto}.toasts.below-overlay[data-v-f46ca0b3]{z-index:var(--z-dropdown)}.toast-enter-active[data-v-f46ca0b3],.toast-leave-active[data-v-f46ca0b3]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.toast-enter-from[data-v-f46ca0b3],.toast-leave-to[data-v-f46ca0b3]{opacity:0;transform:translate(16px)}.toast-move[data-v-f46ca0b3]{transition:transform var(--duration-base) var(--ease-out)}.actions[data-v-f46ca0b3]{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-2)}.link[data-v-f46ca0b3]{border:0;padding:0;background:none;color:var(--color-accent);cursor:pointer;font:inherit;font-size:var(--ui-font-size-xs)}.link[data-v-f46ca0b3]:hover{text-decoration:underline}.details[data-v-f46ca0b3]{display:grid;gap:5px;margin:8px 0 0;padding:8px;border:.5px solid var(--color-line);border-radius:var(--radius-sm);background:var(--color-surface-sunken)}.detail-row[data-v-f46ca0b3]{display:grid;grid-template-columns:minmax(88px,.34fr) minmax(0,1fr);gap:8px}.detail-row dt[data-v-f46ca0b3]{color:var(--color-text-muted)}.detail-row dd[data-v-f46ca0b3]{margin:0;color:var(--color-text);overflow-wrap:anywhere;white-space:pre-wrap}@media(max-width:640px){.toasts[data-v-f46ca0b3]{left:12px;right:12px;bottom:calc(var(--dock-h, 76px) + 8px);width:auto;max-height:50vh}.detail-row[data-v-f46ca0b3]{grid-template-columns:1fr;gap:2px}}.group.dragging[data-v-643ef903]{opacity:.45}.group.pinned-drag-active[data-v-643ef903],.group.pinned-drop-hover[data-v-643ef903]{border-radius:var(--radius-sm)}.group.pinned-drag-active[data-v-643ef903]{box-shadow:inset 0 0 0 1px var(--color-accent)}.group.pinned-drop-hover[data-v-643ef903]{box-shadow:inset 0 0 0 2px var(--color-accent)}.group.pinned-drop-blocked[data-v-643ef903],.group.pinned-drop-blocked[data-v-643ef903] *{cursor:no-drop}.se-locate-flash[data-v-643ef903]{isolation:isolate}.se-locate-flash[data-v-643ef903]:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:var(--radius-sm);background:var(--color-accent-soft);pointer-events:none;animation:se-locate-fade-643ef903 var(--duration-flash) var(--ease-out) forwards}@keyframes se-locate-fade-643ef903{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.se-locate-flash[data-v-643ef903]:before{animation:none}}.group-sessions[data-v-643ef903]{height:auto;overflow:hidden;transition:height var(--duration-base) var(--ease-out)}.group-sessions.collapsed[data-v-643ef903]{height:0}.gh[data-v-643ef903]{display:flex;flex-direction:column;margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border-radius:var(--radius-sm);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text);user-select:none;position:relative;cursor:grab}.gh[data-v-643ef903]:active{cursor:grabbing}.gh[data-v-643ef903]:hover{background:var(--sb-hover, var(--color-hover))}.gh.on[data-v-643ef903]{background:var(--sb-selected, var(--color-selected))}.gh-top[data-v-643ef903]{position:relative;display:flex;align-items:center;gap:var(--sb-gap)}.gh-folder[data-v-643ef903]{flex:none;color:var(--color-text-muted)}.gh-name[data-v-643ef903]{font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);color:var(--color-text-muted);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.gh-actions[data-v-643ef903]{position:absolute;right:calc(var(--sb-action-inset) - (var(--sb-pad-x) - var(--sb-inset)));top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:var(--space-1);padding-left:var(--space-1);border-radius:var(--radius-sm);isolation:isolate;opacity:0;pointer-events:none}.gh-name[data-v-643ef903]{--sb-fade: 0px;--sb-fade-len: 16px;text-overflow:clip;-webkit-mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - var(--sb-fade) - var(--sb-fade-len)),transparent calc(100% - var(--sb-fade)));mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - var(--sb-fade) - var(--sb-fade-len)),transparent calc(100% - var(--sb-fade)))}.gh:hover .gh-name[data-v-643ef903],.gh:focus-within .gh-name[data-v-643ef903],.gh:has(.gh-actions.open) .gh-name[data-v-643ef903]{--sb-fade: 64px;--sb-fade-len: 26px}.gh-actions[data-v-643ef903]>*{position:relative;z-index:1}.gh:hover .gh-actions[data-v-643ef903],.gh:focus-within .gh-actions[data-v-643ef903],.gh-actions.open[data-v-643ef903]{opacity:1;pointer-events:auto}.gh-more.open[data-v-643ef903]{color:var(--color-text);background:var(--color-line)}.group-empty[data-v-643ef903]{padding:var(--space-1) var(--space-2) var(--space-1) calc(var(--sb-pad-x) - var(--sb-inset) + var(--sb-gutter) + var(--sb-gap));font-size:var(--text-xs);color:var(--color-text-faint);font-family:var(--font-ui);user-select:none}.show-more-row[data-v-643ef903]{display:flex;align-items:center;padding-left:calc(var(--sb-gutter) + var(--sb-gap))}.show-more[data-v-643ef903]{display:flex;align-items:center;gap:var(--sb-gap);margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));min-width:0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);text-align:left;cursor:pointer}.show-more[data-v-643ef903]:hover{background:var(--sb-hover, var(--color-hover))}.show-more[data-v-643ef903]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.show-more-sep[data-v-643ef903]{margin:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-xs);user-select:none}.show-more-label[data-v-643ef903]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gh-rename[data-v-643ef903]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-regular);color:var(--color-text);background:var(--color-bg);border:.5px solid var(--color-accent);border-radius:var(--radius-xs);padding:2px 5px;outline:none}.gh-rename[data-v-643ef903]{border-radius:var(--radius-sm);font-family:var(--sans)}.gh-add[data-v-643ef903]{color:var(--faint)}.gh-add[data-v-643ef903]:hover{color:var(--dim)}.sa-select[data-v-d0588d0e]{display:inline-flex;align-items:center;gap:var(--space-1-5);height:30px;padding:0 var(--space-3);border:.5px solid var(--color-line);border-radius:var(--radius-md);background:transparent;color:var(--color-text);font-size:var(--text-sm);font-weight:var(--weight-option-label);line-height:1;white-space:nowrap;transition:background var(--duration-fast) var(--ease-out)}.sa-select[data-v-d0588d0e]:hover,.sa-select.is-open[data-v-d0588d0e]{background:var(--color-hover)}.sa-select-chev[data-v-d0588d0e]{color:var(--color-text-faint)}.sa-menu[data-v-d0588d0e]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.sa-check[data-v-d0588d0e]{display:inline-flex;flex:none;width:14px}.sa-dot[data-v-d0588d0e]{flex:none;width:8px;height:8px;border-radius:var(--radius-full)}.sa-dot--open[data-v-d0588d0e]{background:var(--color-success)}.sa-dot--done[data-v-d0588d0e]{background:var(--color-done)}.menu-pop-enter-active[data-v-d0588d0e]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-d0588d0e]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-d0588d0e],.menu-pop-leave-to[data-v-d0588d0e]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}.sa-select[data-v-967a19b0]{display:inline-flex;align-items:center;gap:var(--space-1-5);min-height:30px;padding:0 var(--space-2);border:.5px solid var(--color-line);border-radius:var(--radius-md);background:transparent;color:var(--color-text);font-size:var(--text-sm);font-weight:var(--weight-option-label);line-height:1;white-space:nowrap;cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}.sa-select[data-v-967a19b0]:hover,.sa-select.is-open[data-v-967a19b0]{background:var(--color-hover)}.sa-select[data-v-967a19b0]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.sa-select-chev[data-v-967a19b0]{color:var(--color-text-faint)}.sa-tag[data-v-967a19b0]{display:inline-flex;align-items:center;gap:1px;height:20px;padding:0 2px 0 var(--space-1-5);border-radius:var(--radius-xs);background:var(--color-selected);font-size:var(--text-xs)}.sa-tag-name[data-v-967a19b0]{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sa-tag-x[data-v-967a19b0]{display:inline-flex;align-items:center;justify-content:center;flex:none;width:16px;height:16px;padding:0;border:none;border-radius:var(--radius-xs);background:transparent;color:var(--color-text-faint);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.sa-tag-x[data-v-967a19b0]:hover{background:var(--color-hover);color:var(--color-text)}.sa-tag-more[data-v-967a19b0]{color:var(--color-text-muted);font-size:var(--text-xs)}.sa-menu[data-v-967a19b0]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.sa-search[data-v-967a19b0]{display:flex;align-items:center;gap:7px;padding:5px 9px;color:var(--color-text-faint)}.sa-search-input[data-v-967a19b0]{flex:1;min-width:0;border:none;outline:none;background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-sm);line-height:var(--leading-tight)}.sa-search-input[data-v-967a19b0]::placeholder{color:var(--color-text-faint)}.sa-ws-name[data-v-967a19b0]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sa-opts[data-v-967a19b0]{max-height:320px;overflow-y:auto;overscroll-behavior:contain}.sa-menu-empty[data-v-967a19b0]{padding:5px 9px;color:var(--color-text-faint);font-size:var(--text-sm)}.menu-pop-enter-active[data-v-967a19b0]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-967a19b0]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-967a19b0],.menu-pop-leave-to[data-v-967a19b0]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}.sa-menu[data-v-b35c02be]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.sa-menu-head[data-v-b35c02be]{padding:var(--space-1) var(--space-2) var(--space-05);color:var(--color-text-faint);font-size:var(--text-xs);user-select:none}.menu-pop-enter-active[data-v-b35c02be]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-b35c02be]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-b35c02be],.menu-pop-leave-to[data-v-b35c02be]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}.sa-pager[data-v-d8059995]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-wrap:wrap;margin-top:var(--space-3)}.sa-total[data-v-d8059995]{color:var(--color-text-muted);font-size:var(--text-sm);font-variant-numeric:tabular-nums;user-select:none}.sa-pager-right[data-v-d8059995]{display:flex;align-items:center;gap:var(--space-3)}.sa-pages[data-v-d8059995]{display:flex;align-items:center;gap:var(--space-05)}.sa-pg[data-v-d8059995]{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;padding:0 var(--space-1-5);border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-size:var(--text-sm);font-variant-numeric:tabular-nums;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.sa-pg[data-v-d8059995]:hover{background:var(--color-hover);color:var(--color-text)}.sa-pg.cur[data-v-d8059995]{background:var(--color-selected);color:var(--color-text);font-weight:var(--weight-medium)}.sa-pg.cur[data-v-d8059995]:hover{background:var(--color-selected)}.sa-pg[data-v-d8059995]:disabled{opacity:.38;cursor:default}.sa-pg[data-v-d8059995]:disabled:hover{background:transparent;color:var(--color-text-muted)}.sa-ellipsis[data-v-d8059995]{padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-sm);user-select:none}.sa-table-card[data-v-dd5dbf42]{border:.5px solid var(--color-line);border-radius:var(--radius-lg);background:var(--color-bg);overflow-x:auto;container-type:inline-size;transition:opacity var(--duration-fast) var(--ease-out)}.sa-table-card.is-loading[data-v-dd5dbf42]{opacity:.45;pointer-events:none}table[data-v-dd5dbf42]{width:100%;min-width:640px;border-collapse:collapse;table-layout:fixed}.sa-col-cb[data-v-dd5dbf42]{width:36px}.sa-col-title[data-v-dd5dbf42]{width:max(200px,20%)}.sa-col-ws[data-v-dd5dbf42]{width:116px}.sa-col-status[data-v-dd5dbf42]{width:88px}.sa-col-time[data-v-dd5dbf42]{width:140px}.sa-col-act[data-v-dd5dbf42]{width:84px}.sa-time--compact[data-v-dd5dbf42]{display:none}@container (max-width: 1020px){.sa-col-time[data-v-dd5dbf42]{width:108px}.sa-time--full[data-v-dd5dbf42]{display:none}.sa-time--compact[data-v-dd5dbf42]{display:inline}}@container (max-width: 760px){col.sa-col-time[data-v-dd5dbf42],.sa-c-time[data-v-dd5dbf42]{display:none}.sa-col-ws[data-v-dd5dbf42]{width:96px}}thead th[data-v-dd5dbf42]{height:32px;padding:0 var(--space-3);border-bottom:.5px solid var(--color-line);color:var(--color-text-faint);font-size:var(--text-xs);font-weight:var(--weight-medium);text-align:left;white-space:nowrap;user-select:none}th.sa-col-cb[data-v-dd5dbf42],td.sa-col-cb[data-v-dd5dbf42]{padding-right:0}tbody td[data-v-dd5dbf42]{height:40px;padding:0 var(--space-3);border-bottom:.5px solid var(--color-subtle);font-size:var(--text-sm);line-height:var(--leading-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}tbody tr:last-child td[data-v-dd5dbf42]{border-bottom:none}tbody tr[data-v-dd5dbf42]{transition:background var(--duration-fast) var(--ease-out)}tbody tr[data-v-dd5dbf42]:hover{background:var(--color-hover)}.sa-cb[data-v-dd5dbf42]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border:.5px solid var(--color-line-strong);border-radius:var(--radius-xs);color:var(--color-text-on-accent);vertical-align:middle;transition:background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out)}.sa-cb[data-v-dd5dbf42]:hover{border-color:var(--color-text-faint)}.sa-cb.on[data-v-dd5dbf42],.sa-cb.ind[data-v-dd5dbf42]{background:var(--color-accent);border-color:var(--color-accent)}.sa-batch-inner[data-v-dd5dbf42]{display:flex;align-items:center;gap:var(--space-2)}.sa-batch-count[data-v-dd5dbf42]{margin-right:var(--space-1);color:var(--color-text-muted);font-size:var(--text-sm);white-space:nowrap;user-select:none}.sa-batch-link[data-v-dd5dbf42]{display:inline-flex;align-items:center;height:24px;padding:0 var(--space-1);border:none;background:transparent;color:var(--color-accent);font-size:var(--text-sm);font-weight:var(--weight-medium);white-space:nowrap}.sa-batch-link[data-v-dd5dbf42]:hover{text-decoration:underline}.sa-batch-link[data-v-dd5dbf42]:disabled{color:var(--color-text-faint);cursor:default;text-decoration:none}.sa-btn-q[data-v-dd5dbf42]{display:inline-flex;align-items:center;gap:var(--space-1-5);height:24px;padding:0 var(--space-2);border:.5px solid var(--color-line);border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-size:var(--text-xs);font-weight:var(--weight-medium);line-height:1;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.sa-btn-q[data-v-dd5dbf42]:hover{background:var(--color-hover)}.sa-btn-q[data-v-dd5dbf42]:disabled{opacity:.42;cursor:default}.sa-btn-q[data-v-dd5dbf42]:disabled:hover{background:transparent}.sa-btn-q[data-v-dd5dbf42] :first-child{color:var(--color-text-muted)}.sa-btn-q[data-v-dd5dbf42]:hover :first-child{color:var(--color-text)}.sa-btn-q--primary[data-v-dd5dbf42],.sa-btn-q--primary[data-v-dd5dbf42] :first-child{border-color:var(--color-accent);background:var(--color-accent);color:var(--color-text-on-accent)}.sa-btn-q--primary[data-v-dd5dbf42]:hover,.sa-btn-q--primary[data-v-dd5dbf42]:hover :first-child{border-color:var(--color-accent-hover);background:var(--color-accent-hover);color:var(--color-text-on-accent)}.sa-btn-q--primary[data-v-dd5dbf42]:disabled,.sa-btn-q--primary[data-v-dd5dbf42]:disabled:hover,.sa-btn-q--primary[data-v-dd5dbf42]:disabled :first-child,.sa-btn-q--primary[data-v-dd5dbf42]:disabled:hover :first-child{border-color:var(--color-accent);background:var(--color-accent);color:var(--color-text-on-accent)}.sa-st[data-v-dd5dbf42]{display:inline-flex;align-items:center;gap:var(--space-1-5)}.sa-st--open[data-v-dd5dbf42]{color:var(--color-success)}.sa-st--done[data-v-dd5dbf42]{color:var(--color-done)}.sa-title[data-v-dd5dbf42]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text);font-weight:var(--weight-option-label)}.sa-rename[data-v-dd5dbf42]{width:100%;height:26px;padding:0 var(--space-1-5);border:1px solid var(--color-accent);border-radius:var(--radius-sm);outline:none;box-shadow:0 0 0 2px var(--color-accent-bd);background:var(--color-bg);color:var(--color-text);font-family:inherit;font-size:var(--text-sm)}.sa-ws[data-v-dd5dbf42]{display:inline-flex;align-items:center;max-width:100%;color:var(--color-text-muted)}.sa-ws span[data-v-dd5dbf42]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sa-prompt[data-v-dd5dbf42]{color:var(--color-text-muted)}.sa-time[data-v-dd5dbf42]{color:var(--color-text-muted);font-family:var(--font-mono);font-size:var(--text-xs);font-variant-numeric:tabular-nums;white-space:nowrap}.sa-none[data-v-dd5dbf42]{color:var(--color-text-faint)}.sa-act[data-v-dd5dbf42]{display:flex;align-items:center;gap:var(--space-05)}.sa-state[data-v-dd5dbf42]{display:flex;align-items:center;justify-content:center;padding:calc(var(--space-8) + var(--space-6)) var(--space-4)}.sa-empty[data-v-dd5dbf42]{color:var(--color-text-faint);font-size:var(--text-sm)}.activity-notice[data-v-fd031610]{display:inline-flex;align-items:center;gap:9px;align-self:flex-start;margin:0;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text-muted)}.think[data-v-39bd75ea]{margin:0}.think-head[data-v-39bd75ea]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-1) 0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm);line-height:1;text-align:left;cursor:pointer;user-select:none;transition:color var(--duration-base) var(--ease-out)}.think-head[data-v-39bd75ea]:hover{color:var(--color-text)}.think-head[data-v-39bd75ea]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.think-bulb[data-v-39bd75ea]{flex:none}.think-title[data-v-39bd75ea]{font-weight:var(--weight-medium)}.think-time[data-v-39bd75ea]{color:var(--color-text-faint);font-weight:400;flex:none}.think.streaming .think-title[data-v-39bd75ea]{animation:think-breathe-39bd75ea 1.6s var(--ease-in-out) infinite}@keyframes think-breathe-39bd75ea{0%,to{opacity:1}50%{opacity:.45}}@media(prefers-reduced-motion:reduce){.think.streaming .think-title[data-v-39bd75ea]{animation:none}}.think-car[data-v-39bd75ea]{color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.think.open .think-car[data-v-39bd75ea]{transform:rotate(90deg)}.think-body[data-v-39bd75ea]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.think-body.instant[data-v-39bd75ea]{transition:none}.think-body.open[data-v-39bd75ea]{grid-template-rows:minmax(0,1fr)}.think-body-inner[data-v-39bd75ea]{min-height:0;overflow:hidden}.think-text[data-v-39bd75ea]{font:var(--text-base)/var(--leading-relaxed) var(--font-ui);font-weight:400;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-word;margin:0;padding:var(--space-1) 0 var(--space-2)}.mob .think-text[data-v-39bd75ea]{color:var(--color-text-faint);line-height:var(--leading-normal)}.op[data-v-ad2b6614]{font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text);background:var(--color-well);border:.5px solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3);white-space:pre-wrap;word-break:break-word;max-height:12lh;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.op-empty[data-v-ad2b6614]{color:var(--color-text-faint);font-style:italic}.agent-card[data-v-4a2d5e3d]{margin:var(--space-1) 0;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);overflow:hidden;transition:border-color var(--duration-base) var(--ease-out)}.agent-card[data-v-4a2d5e3d]:hover{border-color:var(--color-line-strong)}.agent-card.err[data-v-4a2d5e3d]{border-color:color-mix(in srgb,var(--color-danger) 45%,var(--bg))}.head[data-v-4a2d5e3d]{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--space-2) var(--space-3);border:none;background:transparent;color:var(--color-text);font-family:var(--font-ui);text-align:left;cursor:pointer}.head[data-v-4a2d5e3d]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.head[data-v-4a2d5e3d]:disabled{cursor:default}.head-row[data-v-4a2d5e3d]{display:flex;align-items:center}.head-row .head[data-v-4a2d5e3d]{flex:1;min-width:0}.detach[data-v-4a2d5e3d]{position:relative;flex:none;margin-right:var(--space-1)}.detach.touch[data-v-4a2d5e3d]:after{content:"";position:absolute;inset:-9px}.go-slot[data-v-4a2d5e3d]{display:inline-flex;align-items:center;padding-right:var(--space-3);cursor:pointer;flex:none}.lead[data-v-4a2d5e3d]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--radius-md);background:var(--color-surface-sunken);color:var(--color-text-muted);flex:none}.main[data-v-4a2d5e3d]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.task[data-v-4a2d5e3d]{font-size:var(--ui-font-size);line-height:var(--leading-caption);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.type[data-v-4a2d5e3d]{font-size:var(--text-xs);line-height:var(--leading-caption);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tail[data-v-4a2d5e3d]{display:flex;align-items:center;gap:var(--space-2);flex:none}.st[data-v-4a2d5e3d]{display:inline-flex;align-items:center}.st.ok[data-v-4a2d5e3d]{color:var(--color-success)}.st.error[data-v-4a2d5e3d]{color:var(--color-danger)}.st.cancelled[data-v-4a2d5e3d]{color:var(--color-text-faint)}.go[data-v-4a2d5e3d]{color:var(--color-text-faint);transition:color var(--duration-base) var(--ease-out)}.agent-card:hover .head:not(:disabled) .go[data-v-4a2d5e3d]{color:var(--color-text)}.go.car[data-v-4a2d5e3d]{transition:color var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.go.car.open[data-v-4a2d5e3d]{transform:rotate(90deg)}.saved-result[data-v-4a2d5e3d]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-2) var(--space-3);border:none;border-top:.5px solid var(--color-line);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-xs);text-align:left;cursor:pointer}.saved-result[data-v-4a2d5e3d]:hover{color:var(--color-text-muted)}.saved-result[data-v-4a2d5e3d]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.saved-result__chevron[data-v-4a2d5e3d]{transition:transform var(--duration-base) var(--ease-out)}.saved-result__chevron.open[data-v-4a2d5e3d]{transform:rotate(90deg)}.result[data-v-4a2d5e3d]{padding:var(--space-2) var(--space-3)}.result--legacy[data-v-4a2d5e3d]{border-top:.5px solid var(--color-line)}.tl-head[data-v-e445a9a3]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-1) 0;border-radius:var(--radius-sm);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-sm);line-height:1;text-align:left}.tl-head.clickable[data-v-e445a9a3]{cursor:pointer;user-select:none}.tl-ic[data-v-e445a9a3]{display:inline-flex;align-items:center;justify-content:flex-start;flex:none;color:var(--color-text-faint)}.tl-main[data-v-e445a9a3]{flex:1;min-width:0;display:flex;align-items:center;gap:var(--space-1)}.tl-tail[data-v-e445a9a3]{margin-left:auto;display:flex;align-items:center;gap:var(--space-1);flex:none}.tl-status[data-v-e445a9a3]{display:inline-flex;align-items:center;flex:none}.tl-status.ok[data-v-e445a9a3]{color:var(--color-success)}.tl-status.error[data-v-e445a9a3]{color:var(--color-danger)}.tl-car[data-v-e445a9a3]{display:inline-flex;align-items:center;justify-content:center;align-self:center;width:16px;height:16px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);cursor:pointer;flex:none}.tl-car[data-v-e445a9a3]:hover{color:var(--color-text)}.tl-car[data-v-e445a9a3]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tl-car-ic[data-v-e445a9a3]{transition:transform var(--duration-base) var(--ease-out)}.tool-line.open .tl-car-ic[data-v-e445a9a3]{transform:rotate(90deg)}.tl-body[data-v-e445a9a3]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.tl-body.open[data-v-e445a9a3]{grid-template-rows:minmax(0,1fr)}.tl-body-inner[data-v-e445a9a3]{min-height:0;overflow:hidden;padding:2px var(--space-2) var(--space-1) 0}.tl-main .tl-name[data-v-e445a9a3-s]{font-weight:var(--weight-regular);color:var(--color-text-muted);flex:none}.tl-main .tl-dim[data-v-e445a9a3-s]{color:var(--color-text-muted);line-height:var(--leading-tight);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-main .tl-faint[data-v-e445a9a3-s]{color:var(--color-text-faint);line-height:var(--leading-tight);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-main .tl-mono[data-v-e445a9a3-s]{font-family:var(--font-mono);font-size:var(--text-xs);font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text-muted);line-height:normal;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-main .tl-file[data-v-e445a9a3-s]{font-weight:var(--weight-regular);color:var(--color-text);line-height:var(--leading-tight);flex:none;max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:none;border-radius:var(--radius-xs);background:transparent;padding:0 1px;font-family:inherit;font-size:inherit;cursor:pointer}.tl-main .tl-file[data-v-e445a9a3-s]:hover{color:var(--color-accent);text-decoration:underline;text-underline-offset:3px}.tl-main .tl-file[data-v-e445a9a3-s]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tl-tail .tl-pill[data-v-e445a9a3-s]{font-size:var(--text-xs);line-height:1.5;padding:0 var(--space-2);border-radius:var(--radius-full);flex:none;white-space:nowrap}.tl-tail .tl-chip[data-v-e445a9a3-s]{color:var(--color-text-faint);font-size:var(--text-xs);flex:none;white-space:nowrap}.tl-tail .tl-add[data-v-e445a9a3-s]{color:var(--color-success);font-family:var(--font-mono);font-size:var(--text-xs);flex:none}.tl-tail .tl-del[data-v-e445a9a3-s]{color:var(--color-danger);font-family:var(--font-mono);font-size:var(--text-xs);flex:none}.ask-receipt[data-v-928d131f]{max-width:560px;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-xs);padding:var(--space-2) var(--space-3) 10px;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text)}.ask-receipt.flat[data-v-928d131f]{color:var(--color-text-faint);font-style:italic;padding-top:6px;padding-bottom:6px}.rc-head[data-v-928d131f]{display:flex;align-items:center;gap:var(--space-2);color:var(--color-text-faint);font-size:var(--text-xs);margin-bottom:6px}.rc-st[data-v-928d131f]{margin-left:auto;color:var(--color-success);display:inline-flex}.rc-q+.rc-q[data-v-928d131f]{margin-top:6px}.rc-qtext[data-v-928d131f]{display:flex;align-items:baseline;gap:var(--space-2);margin-bottom:3px;font-weight:var(--weight-medium);color:var(--color-text)}.rc-opt[data-v-928d131f]{display:flex;align-items:center;gap:var(--space-2);padding:1.5px 0;color:var(--color-text)}.rc-qskip[data-v-928d131f]{padding:1.5px 0;color:var(--color-text-faint);font-style:italic}.rc-lb[data-v-928d131f]{min-width:0}.rc-ds[data-v-928d131f]{color:var(--color-text-faint);font-size:var(--text-xs)}.rc-g[data-v-928d131f]{width:14px;height:14px;flex:none;border:.5px solid var(--color-line-strong);position:relative}.rc-g.chk[data-v-928d131f]{border-radius:var(--radius-xs)}.rc-g.rad[data-v-928d131f]{border-radius:50%}.rc-g.on[data-v-928d131f]{border-color:var(--color-accent)}.rc-g.chk.on[data-v-928d131f]{background:var(--color-accent)}.rc-g.chk.on[data-v-928d131f]:after{content:"";position:absolute;left:3.5px;top:.5px;width:4px;height:8px;border-right:1.5px solid var(--color-text-on-accent);border-bottom:1.5px solid var(--color-text-on-accent);transform:rotate(45deg)}.rc-g.rad.on[data-v-928d131f]:after{content:"";position:absolute;inset:2.5px;border-radius:50%;background:var(--color-accent)}.cmd-echo[data-v-e0f3f8fe]{font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-all;margin-bottom:var(--space-1)}.tl-detach[data-v-e0f3f8fe]{position:relative;display:inline-flex;align-items:center;justify-content:center;align-self:center;width:16px;height:16px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);cursor:pointer;flex:none}.tl-detach[data-v-e0f3f8fe]:hover{color:var(--color-text)}.tl-detach[data-v-e0f3f8fe]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tl-detach.touch[data-v-e0f3f8fe]{width:44px;height:44px;margin-left:14px}.diffbar[data-v-b25ea4cc]{display:inline-flex;width:36px;height:3px;border-radius:var(--radius-full);overflow:hidden;gap:1px;flex:none}.seg-add[data-v-b25ea4cc]{background:var(--color-success)}.seg-del[data-v-b25ea4cc]{background:var(--color-danger)}.gl[data-v-c64dda93]{display:inline-flex;align-items:center}.arg-full[data-v-c64dda93]{font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-all;margin-bottom:var(--space-1)}.file-list[data-v-ef9af25f]{display:flex;flex-direction:column;border:.5px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-well);padding:var(--space-1);max-height:calc(12 * 1.6 * var(--content-font-size));overflow-y:auto;overscroll-behavior:contain}.file-row[data-v-ef9af25f]{width:100%;border:none;border-radius:var(--radius-sm);background:transparent;padding:2px var(--space-2);font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text);text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.file-row[data-v-ef9af25f]:hover{background:var(--color-hover);color:var(--color-accent)}.file-row[data-v-ef9af25f]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tl-pill.pill-active[data-v-50602502]{color:var(--color-accent);background:var(--color-accent-soft)}.tl-pill.pill-done[data-v-50602502]{color:var(--color-success);background:var(--color-success-soft)}.tl-pill.pill-blocked[data-v-50602502]{color:var(--color-warning);background:var(--color-warning-soft)}.goal-block[data-v-50602502]{margin-bottom:var(--space-1)}.goal-text[data-v-50602502]{color:var(--color-text);font-size:calc(var(--content-font-size) - 1px);line-height:1.6;white-space:pre-wrap;word-break:break-word}.goal-criterion[data-v-50602502]{color:var(--color-text-muted);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;margin-top:2px;white-space:pre-wrap;word-break:break-word}.match-list[data-v-e5f2e791]{display:flex;flex-direction:column;border:.5px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-well);padding:var(--space-1);max-height:calc(12 * 1.6 * var(--content-font-size));overflow-y:auto;overscroll-behavior:contain}.match-row[data-v-e5f2e791]{display:flex;align-items:baseline;gap:var(--space-2);width:100%;border:none;border-radius:var(--radius-sm);background:transparent;padding:2px var(--space-2);font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text);text-align:left;cursor:default}.match-row.link[data-v-e5f2e791]{cursor:pointer}.match-row.link[data-v-e5f2e791]:hover{background:var(--color-hover)}.match-row[data-v-e5f2e791]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.mref[data-v-e5f2e791]{flex:none;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-faint)}.match-row.link:hover .mref[data-v-e5f2e791]{color:var(--color-accent)}.mtext[data-v-e5f2e791]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.is-resolving[data-v-7bd83e15]{visibility:hidden}.media-tool[data-v-8ea09226]{display:inline-flex;flex-direction:column;gap:6px;max-width:320px}.media-title[data-v-8ea09226]{font-size:var(--text-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.media-image-button[data-v-8ea09226]{padding:0;border:none;background:transparent;cursor:pointer;border-radius:var(--radius-md);overflow:hidden}.media-image[data-v-8ea09226]{display:block;max-width:100%;border-radius:var(--radius-md);background:var(--media-alpha-canvas)}.media-video[data-v-8ea09226],.media-audio[data-v-8ea09226]{max-width:100%;border-radius:var(--radius-md)}.media-video[data-v-8ea09226]{display:block}.media-video-button[data-v-8ea09226]{position:relative}.media-video-tile[data-v-8ea09226]{display:block;width:320px;max-width:100%;aspect-ratio:16 / 9;background:var(--color-well)}.media-play-badge[data-v-8ea09226]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:var(--radius-full);background:var(--color-surface-raised);border:.5px solid var(--color-line);color:var(--color-text);box-shadow:var(--shadow-sm);pointer-events:none}.plan-glyph[data-v-ae3acb2d]{display:inline-flex;align-items:center}.plan-path[data-v-ae3acb2d]{display:block;max-width:100%;margin:0 0 var(--space-2);padding:0;overflow:hidden;border:none;background:transparent;color:var(--color-accent);font-family:var(--font-mono);font-size:var(--text-xs);text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.plan-path[data-v-ae3acb2d]:hover{text-decoration:underline}.plan-path[data-v-ae3acb2d]:focus-visible{outline:none;border-radius:var(--radius-xs);box-shadow:var(--p-focus-ring)}.plan-content[data-v-ae3acb2d]{padding:var(--space-3);border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-well);color:var(--color-text)}.plan-review[data-v-ae3acb2d]{display:flex;flex-direction:column;gap:var(--space-1);margin-top:var(--space-2);color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);line-height:var(--leading-normal)}.plan-review>div[data-v-ae3acb2d]{display:flex;align-items:baseline;gap:var(--space-2)}.review-label[data-v-ae3acb2d]{flex:none;color:var(--color-text-faint)}.review-feedback[data-v-ae3acb2d]{white-space:pre-wrap}.path-link[data-v-a487370d]{display:block;width:100%;border:none;border-radius:var(--radius-xs);background:transparent;padding:0 0 var(--space-1);font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);color:var(--color-text-muted);text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.path-link[data-v-a487370d]:hover{color:var(--color-accent);text-decoration:underline;text-underline-offset:3px}.path-link[data-v-a487370d]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.swarm-card[data-v-a03fd23e]{margin:0;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);overflow:hidden;transition:border-color var(--duration-base) var(--ease-out)}.swarm-card.err[data-v-a03fd23e]{border-color:color-mix(in srgb,var(--color-danger) 45%,var(--bg))}.head[data-v-a03fd23e]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:34px;padding:0 var(--space-2) 0 var(--space-3);border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--ui-font-size);text-align:left;cursor:pointer;user-select:none}.head[data-v-a03fd23e]:hover{background:var(--color-hover);color:var(--color-text)}.head[data-v-a03fd23e]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.ic[data-v-a03fd23e]{color:var(--color-text-faint);flex:none}.title[data-v-a03fd23e]{font-weight:var(--weight-medium);color:var(--color-text);flex:none}.meta[data-v-a03fd23e]{color:var(--color-text-faint);flex:none}.sum-txt[data-v-a03fd23e]{color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.rt[data-v-a03fd23e]{margin-left:auto;display:flex;align-items:center;gap:var(--space-2);flex:none;color:var(--color-text-muted);font-size:var(--text-xs)}.status[data-v-a03fd23e]{display:inline-flex;align-items:center;flex:none}.status[data-v-a03fd23e]:has(>svg){color:var(--color-success)}.err .status[data-v-a03fd23e]:has(>svg){color:var(--color-danger)}.chip[data-v-a03fd23e]{color:var(--color-text-muted);font-family:var(--font-mono)}.tm[data-v-a03fd23e]{color:var(--color-text-faint);font-family:var(--font-mono)}.car[data-v-a03fd23e]{margin-left:2px;color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.swarm-card.open .car[data-v-a03fd23e]{transform:rotate(90deg)}.body[data-v-a03fd23e]{border-top:.5px solid var(--color-line)}.overview[data-v-a03fd23e]{padding:10px var(--space-3) var(--space-2);border-bottom:.5px solid var(--color-line)}.overview-line[data-v-a03fd23e]{display:flex;align-items:baseline;gap:var(--space-2)}.big[data-v-a03fd23e]{font-family:var(--font-mono);font-weight:var(--weight-medium);color:var(--color-text);font-size:15px}.lbl[data-v-a03fd23e]{color:var(--color-text-muted);font-size:var(--text-xs)}.seg[data-v-a03fd23e]{display:flex;height:5px;border-radius:var(--radius-full);overflow:hidden;margin:var(--space-2) 0 var(--space-1);gap:2px}.seg>span[data-v-a03fd23e]{height:100%;border-radius:var(--radius-full);min-width:3px}.s-ok[data-v-a03fd23e]{background:var(--color-success)}.s-run[data-v-a03fd23e]{background:var(--color-accent)}.s-warn[data-v-a03fd23e]{background:var(--color-warning)}.s-fail[data-v-a03fd23e]{background:var(--color-danger)}.s-queue[data-v-a03fd23e]{background:var(--color-line)}.legend[data-v-a03fd23e]{display:flex;flex-wrap:wrap;gap:10px}.legend span[data-v-a03fd23e]{display:inline-flex;align-items:center;gap:5px;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted)}.lg-dot[data-v-a03fd23e]{width:6px;height:6px;border-radius:var(--radius-full)}.member[data-v-a03fd23e]{border-bottom:.5px solid var(--color-line)}.member[data-v-a03fd23e]:last-child{border-bottom:none}.member-head[data-v-a03fd23e]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:30px;padding:0 var(--space-2) 0 var(--space-3);border:none;background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size);text-align:left;cursor:pointer;user-select:none}.member-head[data-v-a03fd23e]:not(:disabled):hover{background:var(--color-hover)}.member-head[data-v-a03fd23e]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.member-head[data-v-a03fd23e]:disabled{cursor:default}.row-dot[data-v-a03fd23e]{flex:none}.mname[data-v-a03fd23e]{flex:none;min-width:0;max-width:46%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-medium);color:var(--color-text)}.mact[data-v-a03fd23e]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-muted);font-size:var(--text-xs)}.mphase[data-v-a03fd23e]{flex:none;margin-left:auto;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint)}.phase-completed .mphase[data-v-a03fd23e]{color:var(--color-success)}.phase-failed .mphase[data-v-a03fd23e]{color:var(--color-danger)}.phase-working .mphase[data-v-a03fd23e]{color:var(--color-accent)}.phase-suspended .mphase[data-v-a03fd23e]{color:var(--color-warning)}.mcar[data-v-a03fd23e]{margin-left:var(--space-1);color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.member.open .mcar[data-v-a03fd23e]{transform:rotate(90deg)}.member-saved[data-v-a03fd23e]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-1) var(--space-3);border:none;border-top:.5px solid var(--color-line);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-xs);text-align:left;cursor:pointer}.member-saved[data-v-a03fd23e]:hover{color:var(--color-text-muted)}.member-saved[data-v-a03fd23e]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.member-saved-car[data-v-a03fd23e]{transition:transform var(--duration-base) var(--ease-out)}.member-saved-car.open[data-v-a03fd23e]{transform:rotate(90deg)}.member-body[data-v-a03fd23e]{padding:var(--space-1) var(--space-3) 10px 31px;color:var(--color-text-muted);font-size:calc(var(--content-font-size) - 2px);line-height:1.65;white-space:pre-wrap;word-break:break-word}.waiting[data-v-a03fd23e]{padding:6px var(--space-3) 10px;color:var(--color-text-muted);font-size:var(--text-xs)}.fallback-output[data-v-a03fd23e]{padding:10px var(--space-3);color:var(--color-text);font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;white-space:pre-wrap;word-break:break-word}.status-glyph[data-v-77ce35f9]{flex:none;width:16px;display:inline-flex;align-items:center;justify-content:center;user-select:none}.status-glyph.s-run[data-v-77ce35f9]{color:var(--color-accent)}.status-glyph.s-done[data-v-77ce35f9]{color:var(--color-success)}.status-glyph.s-fail[data-v-77ce35f9]{color:var(--color-danger)}.status-glyph.s-pending[data-v-77ce35f9]{color:var(--color-text-faint)}.todo-bar[data-v-9c43594f]{display:inline-flex;width:36px;height:3px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden;flex:none}.todo-fill[data-v-9c43594f]{background:var(--color-success);border-radius:var(--radius-full);transition:width var(--duration-slow) var(--ease-out)}.todo-list[data-v-9c43594f]{display:flex;flex-direction:column;gap:1px;border:.5px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-well);padding:var(--space-2) var(--space-3);max-height:calc(12 * 1.6 * var(--content-font-size));overflow-y:auto;overscroll-behavior:contain}.todo-row[data-v-9c43594f]{display:flex;align-items:center;gap:7px;padding:2px 0;font-size:calc(var(--content-font-size) - 1px);color:var(--color-text)}.todo-title[data-v-9c43594f]{flex:1;min-width:0;overflow-wrap:anywhere;line-height:1.4}.todo-row.s-in_progress .todo-title[data-v-9c43594f]{font-weight:var(--weight-medium)}.todo-row.s-done .todo-title[data-v-9c43594f]{color:var(--color-text-faint);text-decoration:line-through}.wf-glance[data-v-3a167d7c]{margin-bottom:var(--space-1)}.wf-main[data-v-3a167d7c]{color:var(--color-text);font-size:var(--text-sm);line-height:var(--leading-prose);white-space:pre-wrap;word-break:break-word}.wf-sub[data-v-3a167d7c]{color:var(--color-text-muted);font-size:var(--text-xs);line-height:var(--leading-prose);white-space:pre-wrap;word-break:break-word}.fetch-url[data-v-214a8617]{font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;color:var(--color-text-faint);white-space:pre-wrap;word-break:break-all;margin-bottom:var(--space-1)}.activity-run[data-v-0970b9ea]{display:flex;flex-direction:column;animation:kimi-card-in var(--duration-base) var(--ease-out)}.ar-head[data-v-0970b9ea]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-2) 0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm);line-height:1;text-align:left;cursor:pointer;user-select:none;transition:color var(--duration-base) var(--ease-out)}.ar-head[data-v-0970b9ea]:hover{color:var(--color-text)}.ar-head.is-static[data-v-0970b9ea],.ar-head.is-static[data-v-0970b9ea]:hover{cursor:default;color:var(--color-text-faint)}.ar-head[data-v-0970b9ea]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.ar-glyph[data-v-0970b9ea]{display:inline-flex;align-items:center;flex:none;color:var(--color-text-faint)}.ar-glyph.ok[data-v-0970b9ea]{color:var(--color-success)}.ar-glyph.err[data-v-0970b9ea]{color:var(--color-danger)}.ar-glyph.run[data-v-0970b9ea]{color:var(--color-text-muted);animation:ar-breathe-0970b9ea 1.6s var(--ease-in-out) infinite}@keyframes ar-breathe-0970b9ea{0%,to{opacity:1}50%{opacity:.45}}@media(prefers-reduced-motion:reduce){.ar-glyph.run[data-v-0970b9ea]{animation:none}}.ar-sum[data-v-0970b9ea]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-regular)}.ar-danger[data-v-0970b9ea]{color:var(--color-danger)}.ar-faint[data-v-0970b9ea],.ar-sep[data-v-0970b9ea]{color:var(--color-text-faint)}.ar-car[data-v-0970b9ea]{color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.activity-run.open .ar-car[data-v-0970b9ea]{transform:rotate(90deg)}.ar-body[data-v-0970b9ea]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.ar-body.open[data-v-0970b9ea]{grid-template-rows:minmax(0,1fr)}.ar-body-inner[data-v-0970b9ea]{min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:var(--space-2);padding-top:var(--space-1)}.msg-time[data-v-182ed7d4]{display:inline-flex;align-items:center;min-height:22px;box-sizing:border-box;padding:2px 5px;border-radius:var(--radius-sm);color:var(--muted);font-size:var(--text-xs);font-weight:var(--weight-medium);line-height:1;opacity:.7;white-space:nowrap}.ntf-list[data-v-2962a217]{display:flex;flex-direction:column;align-items:flex-end;gap:var(--space-3);margin:var(--space-2) 0}.ntn[data-v-2962a217]{margin-left:auto;max-width:var(--p-bubble-max);display:flex;flex-direction:column;align-items:flex-end}.ntn-head[data-v-2962a217]{display:flex;align-items:center;gap:var(--space-2);margin-bottom:var(--space-1);padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal);overflow-wrap:anywhere}.ntn-ico[data-v-2962a217]{flex:none}.ntn.ok .ntn-ico[data-v-2962a217]{color:var(--color-success)}.ntn.err .ntn-ico[data-v-2962a217]{color:var(--color-danger)}.ntn.warn .ntn-ico[data-v-2962a217]{color:var(--color-warning)}.ntn-bubble[data-v-2962a217]{box-sizing:border-box;max-width:100%;padding:var(--space-2) var(--space-3);background:var(--color-user-bubble-bg);border-radius:var(--radius-lg);color:var(--color-text);font-size:var(--content-font-size);line-height:var(--leading-normal);white-space:pre-wrap;overflow-wrap:anywhere}.ntn-line+.ntn-line[data-v-2962a217]{margin-top:var(--space-1)}.ntn-out[data-v-2962a217]{display:flex;align-items:center;gap:var(--space-2);background:var(--color-surface-raised);border-radius:var(--radius-md);padding:var(--space-1) var(--space-2);box-shadow:var(--shadow-xs);white-space:normal}.ntn-out-ic[data-v-2962a217]{color:var(--color-text-faint);flex:none}.ntn-out-path[data-v-2962a217]{flex:1;min-width:0;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.ntn-out-size[data-v-2962a217]{flex:none;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint)}.ntn-out-copy[data-v-2962a217]{display:inline-flex;align-items:center;height:var(--space-6);padding:0 var(--space-2);border-radius:var(--radius-full);font-size:var(--text-xs);color:var(--color-text-muted);border:.5px solid var(--color-line-strong);background:var(--color-surface-raised);flex:none;transition:color var(--duration-fast) var(--ease-out)}.ntn-out-copy[data-v-2962a217]:hover{color:var(--color-text)}.ntn-preview-cap[data-v-2962a217]{font-size:var(--text-xs);color:var(--color-text-faint);margin-bottom:var(--space-05)}.ntn-preview-text[data-v-2962a217]{margin:0;font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--leading-normal);color:var(--color-text-muted);white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:8;overflow:hidden}.ntn-meta[data-v-2962a217]{margin-top:var(--space-1);padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal)}.ntn-raw[data-v-2962a217]{max-width:100%}.ntn-raw summary[data-v-2962a217]{list-style:none;display:flex;align-items:center;gap:var(--space-1);cursor:pointer;font-size:var(--text-xs);color:var(--color-text-faint);user-select:none}.ntn-raw summary[data-v-2962a217]::-webkit-details-marker{display:none}.ntn-raw summary[data-v-2962a217]:hover{color:var(--color-text)}.ntn-raw-car[data-v-2962a217]{transition:transform var(--duration-base) var(--ease-out)}.ntn-raw[open] .ntn-raw-car[data-v-2962a217]{transform:rotate(90deg)}.ntn-raw-in[data-v-2962a217]{margin-top:var(--space-1);display:flex;flex-direction:column;gap:var(--space-2)}.ntn-raw-fields[data-v-2962a217]{display:grid;grid-template-columns:auto 1fr;gap:var(--space-1) var(--space-3)}.ntn-raw-fields .k[data-v-2962a217]{color:var(--color-text-faint);font-size:var(--text-xs)}.ntn-raw-fields .v[data-v-2962a217]{color:var(--color-text-muted);font-size:var(--text-xs);font-family:var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ntn-raw-pre[data-v-2962a217]{margin:0;padding:var(--space-2) var(--space-3);background:var(--color-surface-raised);border-radius:var(--radius-sm);box-shadow:var(--shadow-xs);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--leading-normal);color:var(--color-text-muted);white-space:pre;overflow:auto;max-width:100%;max-height:13lh}.turn-fold[data-v-d69de1b5]{display:flex;flex-direction:column}.tf-head[data-v-d69de1b5]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-2) 0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm);line-height:1;text-align:left;cursor:pointer;user-select:none;transition:color var(--duration-base) var(--ease-out)}.tf-head[data-v-d69de1b5]:hover{color:var(--color-text)}.tf-head[data-v-d69de1b5]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.tf-sum[data-v-d69de1b5]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-regular)}.tf-car[data-v-d69de1b5]{color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.turn-fold.open .tf-car[data-v-d69de1b5]{transform:rotate(90deg)}.tf-body[data-v-d69de1b5]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.tf-body.open[data-v-d69de1b5]{grid-template-rows:minmax(0,1fr)}.tf-body-inner[data-v-d69de1b5]{min-height:0;overflow:hidden;display:flex;flex-direction:column}.tf-body-inner>.msg[data-v-d69de1b5],.tf-body-inner[data-v-d69de1b5]>.think,.tf-body-inner[data-v-d69de1b5]>.tool-group,.tf-body-inner[data-v-d69de1b5]>.activity-run,.tf-body-inner[data-v-d69de1b5]>.agent-card,.tf-body-inner[data-v-d69de1b5]>.agent-group,.tf-body-inner[data-v-d69de1b5]>.tool-line,.tf-body-inner[data-v-d69de1b5]>.swarm-card,.tf-body-inner[data-v-d69de1b5]>.media-tool,.tf-body-inner[data-v-d69de1b5]>.ask-receipt{margin-top:var(--chat-block-gap)}.turn-fold.streaming .tf-body-inner>.msg[data-v-d69de1b5]:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.think:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.tool-group:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.activity-run:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.agent-card:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.agent-group:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.tool-line:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.swarm-card:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.media-tool:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.ask-receipt:first-child{margin-top:0}.tf-body-inner .msg[data-v-d69de1b5]{font-size:var(--ui-font-size);line-height:var(--leading-prose);color:var(--color-text);font-weight:var(--weight-medium)}.tf-body-inner .msg[data-v-d69de1b5] p{margin:0}.tf-body-inner .msg[data-v-d69de1b5] p+p{margin-top:var(--space-2)}@container (min-width: 760px){.tf-body-inner .msg[data-v-d69de1b5] .markstream-vue.markdown-renderer:has(.table-node-wrapper.md-table-wide){content-visibility:visible}.tf-body-inner .msg[data-v-d69de1b5] .table-node-wrapper.md-table-wide{position:relative;left:50%;width:max-content;min-width:100%;max-width:min(var(--p-table-max),calc(100cqi - var(--space-5) - var(--space-5)))!important;transform:translate(-50%)}.tf-body-inner .msg[data-v-d69de1b5] .table-node-wrapper:not(.md-table-wide){--table-cell-cap: min(var(--p-table-cell-max), 36cqi)}}.turn-files[data-v-c82a66d2]{margin-top:var(--chat-block-gap)}.turn-files[data-v-c82a66d2] .ui-card__head{font-family:var(--font-ui);font-weight:var(--weight-regular);padding:var(--space-2) var(--space-3)}.turn-files[data-v-c82a66d2] .ui-card__body{padding:var(--space-1) var(--space-3)}.turn-files[data-v-c82a66d2] .ui-card__foot{padding:0;justify-content:stretch}.tf-ic[data-v-c82a66d2]{display:inline-flex;align-items:center;color:var(--color-text-faint);flex:none}.tf-title[data-v-c82a66d2]{font-size:var(--text-sm);color:var(--color-text);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tf-stats[data-v-c82a66d2]{margin-left:auto;display:inline-flex;align-items:center;gap:var(--space-1);flex:none}.tf-add[data-v-c82a66d2],.tf-del[data-v-c82a66d2]{font-family:var(--font-mono);font-size:var(--text-xs);flex:none}.tf-add[data-v-c82a66d2]{color:var(--color-success)}.tf-del[data-v-c82a66d2]{color:var(--color-danger)}.tf-list[data-v-c82a66d2]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.tf-row[data-v-c82a66d2]{display:flex;align-items:center;gap:var(--space-1);min-width:0;padding:var(--space-1) 0;font-size:var(--text-sm);line-height:var(--leading-tight)}.tf-file[data-v-c82a66d2]{display:flex;align-items:baseline;border:none;border-radius:var(--radius-xs);background:transparent;padding:0;font-family:inherit;font-size:inherit;color:var(--color-text);flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-align:left}button.tf-file[data-v-c82a66d2]{cursor:pointer}button.tf-file[data-v-c82a66d2]:hover{text-decoration:underline;text-decoration-color:var(--color-text-faint);text-underline-offset:3px}.tf-file[data-v-c82a66d2]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tf-dir[data-v-c82a66d2]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--color-text-faint)}.tf-base[data-v-c82a66d2]{flex:none;font-weight:var(--weight-medium);color:var(--color-text)}.tf-more[data-v-c82a66d2]{width:100%;justify-content:flex-start;border-radius:0}.turn-files .tf-more[data-v-c82a66d2]:not(:disabled):active{transform:none}.tf-more-car[data-v-c82a66d2]{color:var(--color-text-faint);transition:transform var(--duration-base) var(--ease-out)}.tf-more-car.open[data-v-c82a66d2]{transform:rotate(180deg)}.diffbar[data-v-c82a66d2]{display:inline-flex;width:36px;height:3px;border-radius:var(--radius-full);overflow:hidden;flex:none}.seg-add[data-v-c82a66d2]{background:var(--color-success)}.seg-del[data-v-c82a66d2]{background:var(--color-danger)}.cn[data-v-bbd9b071]{margin:0;align-self:flex-end;max-width:78%;display:flex;flex-direction:column;align-items:flex-end}.cn-head[data-v-bbd9b071]{align-self:flex-end;display:flex;align-items:center;gap:var(--space-2);margin-bottom:var(--space-1);padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal);overflow-wrap:anywhere}.cn-head-ico[data-v-bbd9b071]{flex:none}.cn-head.error .cn-head-ico[data-v-bbd9b071]{color:var(--color-danger)}.cn-bubble[data-v-bbd9b071]{box-sizing:border-box;max-width:100%;padding:10px 12px;background:var(--color-user-bubble-bg);border-radius:var(--radius-lg);color:var(--color-text);font-size:var(--content-font-size);line-height:var(--leading-normal);white-space:pre-wrap;overflow-wrap:anywhere}.cn-meta[data-v-bbd9b071]{margin-top:var(--space-1);padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal)}/*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */.pswp{--pswp-bg: #000;--pswp-placeholder-bg: #222;--pswp-root-z-index: 100000;--pswp-preloader-color: rgba(79, 79, 79, .4);--pswp-preloader-color-secondary: rgba(255, 255, 255, .9);--pswp-icon-color: #fff;--pswp-icon-color-secondary: #4f4f4f;--pswp-icon-stroke-color: #4f4f4f;--pswp-icon-stroke-width: 2px;--pswp-error-text-color: var(--pswp-icon-color)}.pswp{position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--pswp-root-z-index);display:none;touch-action:none;outline:0;opacity:.003;contain:layout style size;-webkit-tap-highlight-color:rgba(0,0,0,0)}.pswp:focus{outline:0}.pswp *{box-sizing:border-box}.pswp img{max-width:none}.pswp--open{display:block}.pswp,.pswp__bg{transform:translateZ(0);will-change:opacity}.pswp__bg{opacity:.005;background:var(--pswp-bg)}.pswp,.pswp__scroll-wrap{overflow:hidden}.pswp__scroll-wrap,.pswp__bg,.pswp__container,.pswp__item,.pswp__content,.pswp__img,.pswp__zoom-wrap{position:absolute;top:0;left:0;width:100%;height:100%}.pswp__img,.pswp__zoom-wrap{width:auto;height:auto}.pswp--click-to-zoom.pswp--zoom-allowed .pswp__img{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,.pswp__img{cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out}.pswp__container,.pswp__img,.pswp__button,.pswp__counter{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pswp__item{z-index:1;overflow:hidden}.pswp__hidden{display:none!important}.pswp__content{pointer-events:none}.pswp__content>*{pointer-events:auto}.pswp__error-msg-container{display:grid}.pswp__error-msg{margin:auto;font-size:1em;line-height:1;color:var(--pswp-error-text-color)}.pswp .pswp__hide-on-close{opacity:.005;will-change:opacity;transition:opacity var(--pswp-transition-duration) cubic-bezier(.4,0,.22,1);z-index:10;pointer-events:none}.pswp--ui-visible .pswp__hide-on-close{opacity:1;pointer-events:auto}.pswp__button{position:relative;display:block;width:50px;height:60px;padding:0;margin:0;overflow:hidden;cursor:pointer;background:none;border:0;box-shadow:none;opacity:.85;-webkit-appearance:none;-webkit-touch-callout:none}.pswp__button:hover,.pswp__button:active,.pswp__button:focus{transition:none;padding:0;background:none;border:0;box-shadow:none;opacity:1}.pswp__button:disabled{opacity:.3;cursor:auto}.pswp__icn{fill:var(--pswp-icon-color);color:var(--pswp-icon-color-secondary)}.pswp__icn{position:absolute;top:14px;left:9px;width:32px;height:32px;overflow:hidden;pointer-events:none}.pswp__icn-shadow{stroke:var(--pswp-icon-stroke-color);stroke-width:var(--pswp-icon-stroke-width);fill:none}.pswp__icn:focus{outline:0}div.pswp__img--placeholder,.pswp__img--with-bg{background:var(--pswp-placeholder-bg)}.pswp__top-bar{position:absolute;left:0;top:0;width:100%;height:60px;display:flex;flex-direction:row;justify-content:flex-end;z-index:10;pointer-events:none!important}.pswp__top-bar>*{pointer-events:auto;will-change:opacity}.pswp__button--close{margin-right:6px}.pswp__button--arrow{position:absolute;width:75px;height:100px;top:50%;margin-top:-50px}.pswp__button--arrow:disabled{display:none;cursor:default}.pswp__button--arrow .pswp__icn{top:50%;margin-top:-30px;width:60px;height:60px;background:none;border-radius:0}.pswp--one-slide .pswp__button--arrow{display:none}.pswp--touch .pswp__button--arrow{visibility:hidden}.pswp--has_mouse .pswp__button--arrow{visibility:visible}.pswp__button--arrow--prev{right:auto;left:0}.pswp__button--arrow--next{right:0}.pswp__button--arrow--next .pswp__icn{left:auto;right:14px;transform:scaleX(-1)}.pswp__button--zoom{display:none}.pswp--zoom-allowed .pswp__button--zoom{display:block}.pswp--zoomed-in .pswp__zoom-icn-bar-v{display:none}.pswp__preloader{position:relative;overflow:hidden;width:50px;height:60px;margin-right:auto}.pswp__preloader .pswp__icn{opacity:0;transition:opacity .2s linear;animation:pswp-clockwise .6s linear infinite}.pswp__preloader--active .pswp__icn{opacity:.85}@keyframes pswp-clockwise{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.pswp__counter{height:30px;margin-top:15px;margin-inline-start:20px;font-size:14px;line-height:30px;color:var(--pswp-icon-color);text-shadow:1px 1px 3px var(--pswp-icon-color-secondary);opacity:.85}.pswp--one-slide .pswp__counter{display:none}.pswp{--pswp-root-z-index: var(--z-modal);--pswp-bg: var(--color-scrim-strong)}.media-preview-caption{position:absolute;left:0;right:0;bottom:var(--space-4);padding:0 var(--space-6);color:var(--color-text-on-scrim);font-size:var(--ui-font-size-xs);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.media-lightbox[data-v-14fb6a4a]{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;padding:var(--space-6);background:var(--color-scrim-strong)}.media-lightbox-card[data-v-14fb6a4a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);max-width:min(960px,calc(100vw - var(--space-6) * 2));max-height:calc(var(--app-height, 100vh) - var(--space-6) * 2)}.media-lightbox-frame[data-v-14fb6a4a]{max-width:100%;border-radius:var(--radius-md);overflow:hidden;background:var(--color-bg);box-shadow:var(--shadow-xl)}.media-lightbox-media[data-v-14fb6a4a]{display:block;max-width:100%;max-height:calc(var(--app-height, 100vh) - var(--space-6) * 4);object-fit:contain}.media-lightbox-name[data-v-14fb6a4a]{max-width:100%;color:var(--color-text-on-scrim);font-size:var(--ui-font-size-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.media-lightbox-close[data-v-14fb6a4a]{position:fixed;top:var(--space-4);right:var(--space-6);display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:.5px solid var(--color-line);border-radius:var(--radius-full);background:var(--color-surface-raised);color:var(--color-text);box-shadow:var(--shadow-sm);cursor:pointer;z-index:var(--z-modal-dropdown)}.media-lightbox-close[data-v-14fb6a4a]:before{content:"";position:absolute;inset:-6px}.media-lightbox-close[data-v-14fb6a4a]:hover{border-color:var(--color-line-strong);background:var(--color-surface-sunken)}.working-indicator[data-v-cd612157]{display:inline-flex;align-items:center;gap:var(--space-2);align-self:flex-start;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text-muted)}.wi-mascot[data-v-cd612157]{flex:none;width:40px}.wi-label[data-v-cd612157]{animation:wi-breathe-cd612157 1.6s var(--ease-in-out) infinite}@keyframes wi-breathe-cd612157{0%,to{opacity:1}50%{opacity:.45}}.sab[data-v-73604c69]{position:fixed;top:0;left:0;z-index:var(--z-dropdown);min-width:0;max-width:calc(100vw - 2 * var(--p-mention-tip-vmargin));max-height:calc(100vh - 2 * var(--p-mention-tip-vmargin));overflow-y:auto}.sab[data-v-73604c69] .ui-menu-item{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sab-comment[data-v-73604c69]{display:flex;align-items:center;gap:var(--space-2);width:100%;max-width:var(--p-selection-bubble-w);padding:var(--space-1)}.chat-empty[data-v-999e1e60]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px 16px;color:var(--faint);text-align:center}.chat-empty-text[data-v-999e1e60]{font-size:var(--ui-font-size-sm)}.chat-loading[data-v-999e1e60]{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:24px 16px;color:var(--muted)}.chat-loading-text[data-v-999e1e60]{font-size:var(--ui-font-size-sm)}.chat[data-v-999e1e60]{--chat-turn-gap: 16px;--chat-block-gap: 10px;--chat-section-gap: 18px;display:flex;flex-direction:column;gap:0;padding:16px 14px 20px;flex:1;min-height:0;position:relative}.chat .chat-empty[data-v-999e1e60]{align-self:stretch}.chat>.u-turn[data-v-999e1e60],.chat>.a-msg[data-v-999e1e60],.chat>.compact-divider[data-v-999e1e60],.chat>.cron-notice[data-v-999e1e60],.chat>.sending-placeholder[data-v-999e1e60],.chat[data-v-999e1e60]>.activity-notice{margin-top:var(--chat-turn-gap)}.chat>.a-msg[data-v-999e1e60]{margin-top:10px}.chat>.u-turn[data-v-999e1e60]:first-child,.chat>.a-msg[data-v-999e1e60]:first-child,.chat>.compact-divider[data-v-999e1e60]:first-child,.chat>.cron-notice[data-v-999e1e60]:first-child,.chat>.sending-placeholder[data-v-999e1e60]:first-child,.chat[data-v-999e1e60]>.activity-notice:first-child{margin-top:0}.u-turn[data-v-999e1e60]{display:flex;flex-direction:column;align-items:flex-end;align-self:flex-start;width:100%}.u-bub[data-v-999e1e60]{align-self:flex-end;max-width:78%;background:var(--color-user-bubble-bg);color:var(--color-text);border-radius:var(--radius-lg);padding:10px 12px;font-size:var(--content-font-size);line-height:var(--leading-normal)}.u-meta[data-v-999e1e60]{align-self:flex-end;display:flex;justify-content:flex-end;align-items:center;max-width:78%;margin-top:var(--space-2);margin-right:4px}.u-meta .u-edit[data-v-999e1e60]{min-height:22px;box-sizing:border-box}.u-text[data-v-999e1e60]{white-space:pre-wrap;overflow-wrap:anywhere}.u-text-wrap[data-v-999e1e60]{position:relative;display:flex;flex-direction:column}.u-text-wrap-args[data-v-999e1e60]{margin-top:var(--space-1)}.u-text-wrap.is-clamped[data-v-999e1e60]{min-width:120px}.u-text-wrap.is-clamped>.u-text[data-v-999e1e60],.u-text-wrap.is-clamped>.skill-act-args[data-v-999e1e60]{max-height:10lh;overflow:hidden;mask-image:linear-gradient(to bottom,black calc(100% - 5lh),transparent calc(100% - 1lh));-webkit-mask-image:linear-gradient(to bottom,black calc(100% - 5lh),transparent calc(100% - 1lh))}.u-text-wrap.is-clamped>.q-body[data-v-999e1e60]{max-height:3lh;overflow:hidden;mask-image:linear-gradient(to bottom,black calc(100% - 1.2lh),transparent calc(100% - .2lh));-webkit-mask-image:linear-gradient(to bottom,black calc(100% - 1.2lh),transparent calc(100% - .2lh))}.u-text-toggle[data-v-999e1e60]{display:inline-flex;align-items:center;gap:var(--space-1);align-self:center;margin-top:var(--space-2);padding:var(--space-2) var(--space-4);border:none;border-radius:var(--radius-full);background:var(--color-surface-raised);box-shadow:var(--shadow-sm);color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);line-height:1;cursor:pointer;user-select:none;transition:box-shadow var(--duration-base) var(--ease-out)}.u-text-toggle[data-v-999e1e60]:hover{box-shadow:var(--shadow-md)}.u-text-toggle[data-v-999e1e60]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.u-text-wrap.is-clamped .u-text-toggle[data-v-999e1e60]{position:absolute;bottom:0;left:50%;transform:translate(-50%);margin-top:0}.u-text-toggle-car[data-v-999e1e60]{transition:transform var(--duration-base) var(--ease-out)}.u-text-toggle[aria-expanded=true] .u-text-toggle-car[data-v-999e1e60]{transform:rotate(180deg)}.u-edit[data-v-999e1e60]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s}.u-edit svg[data-v-999e1e60]{display:block;flex:none}.u-edit[data-v-999e1e60]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.u-edit-armed[data-v-999e1e60]{--undo-hint-duration: 5s;gap:var(--space-1);opacity:1;color:var(--color-text);animation:u-edit-armed-blink-999e1e60 var(--undo-hint-duration) linear forwards}.u-edit-armed[data-v-999e1e60]:hover{color:var(--color-accent);background:var(--hover)}.u-edit-hint[data-v-999e1e60]{display:inline-flex;align-items:center;gap:var(--space-1);font-size:var(--text-xs);font-weight:var(--weight-medium);white-space:nowrap}@keyframes u-edit-armed-blink-999e1e60{0%,55%{opacity:1}62%{opacity:.45}69%{opacity:1}75%{opacity:.4}81%{opacity:.95}86%{opacity:.35}91%{opacity:.85}95%{opacity:.3}to{opacity:0}}@media(prefers-reduced-motion:reduce){.u-edit-armed[data-v-999e1e60]{animation:none}}.u-copy[data-v-999e1e60]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s;min-height:22px;box-sizing:border-box}.u-copy svg[data-v-999e1e60]{display:block;flex:none}.u-copy[data-v-999e1e60]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.u-edit-wrap[data-v-999e1e60]{display:flex;justify-content:flex-end}.chat>.u-edit-wrap[data-v-999e1e60]{margin-top:4px}.chat>.u-edit-wrap+.a-msg[data-v-999e1e60]{margin-top:8px}.compact-divider[data-v-999e1e60]{display:flex;align-items:center;gap:10px;align-self:stretch;width:100%;margin:var(--chat-section-gap) 0 0}.chat>.compact-divider[data-v-999e1e60]:first-child{margin-top:0}.cd-line[data-v-999e1e60]{flex:1;height:1px;background:var(--line)}.cd-label[data-v-999e1e60]{flex:none;display:inline-flex;align-items:center;gap:8px;max-width:80%;font-size:var(--text-base);color:var(--muted);white-space:nowrap}.cd-btn[data-v-999e1e60]{background:none;border:none;padding:0;cursor:pointer;font:inherit;font-size:var(--text-base);color:var(--muted)}.cd-view[data-v-999e1e60]{color:var(--color-accent)}.cd-btn:hover .cd-view[data-v-999e1e60]{text-decoration:underline}.chat>.turn-failed[data-v-999e1e60]{margin-top:var(--chat-turn-gap)}.chat>.turn-failed[data-v-999e1e60]:first-child{margin-top:0}.turn-failed[data-v-999e1e60]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border:var(--p-hairline) solid var(--color-danger-bd);border-radius:var(--radius-lg);background:var(--color-danger-soft);box-shadow:var(--shadow-xs);animation:kimi-card-in var(--duration-slow) var(--ease-out)}.tf-chip[data-v-999e1e60]{display:inline-flex;align-items:center;justify-content:center;width:var(--space-6);height:var(--space-6);border-radius:var(--radius-md);background:var(--color-surface-raised);box-shadow:var(--shadow-xs);flex:none;color:var(--color-danger)}.tf-main[data-v-999e1e60]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.tf-title[data-v-999e1e60]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);line-height:var(--leading-normal)}.tf-sub[data-v-999e1e60]{font-size:var(--text-xs);color:var(--color-text-muted);line-height:var(--leading-normal);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tf-meta[data-v-999e1e60]{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint);line-height:var(--leading-normal);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.goal-prov[data-v-999e1e60]{display:flex;align-items:center;gap:var(--space-1);margin-bottom:var(--space-1);color:var(--color-text-faint);font-size:var(--text-xs);line-height:var(--leading-normal);user-select:none}.a-msg[data-v-999e1e60]{align-self:flex-start;max-width:94%;width:94%}.a-msg-ft[data-v-999e1e60]{display:flex;justify-content:flex-start;align-items:center;gap:8px;height:auto;margin-top:var(--chat-block-gap);overflow:visible}.a-time[data-v-999e1e60]{display:inline-flex;align-items:center;font-size:var(--text-base);color:var(--muted);line-height:1}.a-cpbtn[data-v-999e1e60]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s;min-height:22px;box-sizing:border-box}.a-cpbtn[data-v-999e1e60]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.a-cpbtn svg[data-v-999e1e60]{display:block;flex:none}@media(hover:none){.a-msg-ft[data-v-999e1e60]{height:auto;margin-top:var(--chat-block-gap);opacity:1;pointer-events:auto}.a-cpbtn[data-v-999e1e60]{font-size:var(--ui-font-size-sm);padding:8px 10px;margin:-4px -6px}}.a-msg .msg[data-v-999e1e60]{font-size:var(--ui-font-size);line-height:var(--leading-prose);color:var(--color-text);font-weight:500}.a-msg .msg[data-v-999e1e60] p{margin:0}.a-msg .msg[data-v-999e1e60] p+p{margin-top:8px}.a-msg>.msg[data-v-999e1e60],.a-msg[data-v-999e1e60]>.think,.a-msg[data-v-999e1e60]>.tool-group,.a-msg[data-v-999e1e60]>.activity-run,.a-msg[data-v-999e1e60]>.agent-card,.a-msg[data-v-999e1e60]>.agent-group,.a-msg[data-v-999e1e60]>.tool-line,.a-msg[data-v-999e1e60]>.swarm-card,.a-msg[data-v-999e1e60]>.media-tool,.a-msg[data-v-999e1e60]>.ask-receipt{margin-top:var(--chat-block-gap)}.a-msg>.msg[data-v-999e1e60]:first-child,.a-msg[data-v-999e1e60]>.think:first-child,.a-msg[data-v-999e1e60]>.tool-group:first-child,.a-msg[data-v-999e1e60]>.activity-run:first-child,.a-msg[data-v-999e1e60]>.agent-card:first-child,.a-msg[data-v-999e1e60]>.agent-group:first-child,.a-msg[data-v-999e1e60]>.tool-line:first-child,.a-msg[data-v-999e1e60]>.swarm-card:first-child,.a-msg[data-v-999e1e60]>.media-tool:first-child,.a-msg[data-v-999e1e60]>.ask-receipt:first-child{margin-top:0}.a-msg>.goal-prov:first-child+.msg[data-v-999e1e60],.a-msg>.goal-prov[data-v-999e1e60]:first-child+.think,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.tool-group,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.activity-run,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.agent-card,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.agent-group,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.tool-line,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.swarm-card,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.media-tool,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.ask-receipt,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.turn-fold{margin-top:0}.a-msg[data-v-999e1e60] :not(pre)>code{font:.9em var(--font-mono);background:var(--color-inline-code-bg);border:.5px solid var(--color-line);border-radius:var(--radius-sm);padding:1px 6px;color:var(--color-accent-hover)}@container (min-width: 760px){.a-msg .msg[data-v-999e1e60] .markstream-vue.markdown-renderer:has(.table-node-wrapper.md-table-wide){content-visibility:visible}.a-msg .msg[data-v-999e1e60] .table-node-wrapper.md-table-wide{position:relative;left:50%;width:max-content;min-width:100%;max-width:min(var(--p-table-max),calc(100cqi - var(--space-5) - var(--space-5)))!important;transform:translate(-50%)}.a-msg .msg[data-v-999e1e60] .table-node-wrapper:not(.md-table-wide){--table-cell-cap: min(var(--p-table-cell-max), 36cqi)}}.u-atts[data-v-999e1e60]{display:flex;flex-wrap:wrap;gap:var(--space-1-5);margin-bottom:var(--space-2)}.u-atts button.attachment-pill[data-v-999e1e60]{appearance:none;border:none;background:none;padding-block:0;font-family:inherit;font-size:inherit}.sending-placeholder[data-v-999e1e60]{align-self:flex-start;padding:10px 0}.skill-act[data-v-999e1e60]{display:flex;flex-direction:column;gap:2px}.skill-act-head[data-v-999e1e60]{font-size:var(--ui-font-size-sm);font-weight:500;color:var(--color-accent-hover);display:flex;align-items:center;gap:6px}.skill-act-arrow[data-v-999e1e60]{color:var(--color-accent);font-size:var(--text-base)}.skill-act-args[data-v-999e1e60]{font-size:var(--text-base);color:var(--muted);padding-left:17px;white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:640px){.chat[data-v-999e1e60]{box-sizing:border-box;width:100%;padding:14px max(12px,var(--safe-right)) 18px max(12px,var(--safe-left))}.u-bub[data-v-999e1e60]{max-width:min(88%,calc(100vw - 52px))}.a-msg[data-v-999e1e60]{width:100%;max-width:100%}.a-msg[data-v-999e1e60] .md,.a-msg[data-v-999e1e60] .markdown-renderer,.a-msg[data-v-999e1e60] .code-block-container,.a-msg[data-v-999e1e60] .diff-wrap,.a-msg[data-v-999e1e60] pre{max-width:100%}.a-msg[data-v-999e1e60] .code-block-container pre,.a-msg[data-v-999e1e60] .diff-pre{overflow-x:auto;-webkit-overflow-scrolling:touch}.a-msg[data-v-999e1e60] .media-tool.mob{width:min(44vw,160px)}.cd-label[data-v-999e1e60]{min-width:0;max-width:calc(100% - 48px);overflow:hidden;text-overflow:ellipsis}.u-edit-confirm[data-v-999e1e60]{flex-wrap:wrap;justify-content:flex-end;max-width:calc(100vw - 28px)}.ts[data-v-999e1e60]{font-size:var(--ui-font-size-sm)}.chat-empty-text[data-v-999e1e60],.chat-loading-text[data-v-999e1e60]{font-size:var(--ui-font-size-lg)}.cd-label[data-v-999e1e60],.cd-btn[data-v-999e1e60]{font-size:var(--ui-font-size)}}.top-sentinel[data-v-999e1e60]{display:flex;align-items:center;justify-content:center;padding:12px 0;min-height:28px;user-select:none}.top-sentinel-loading[data-v-999e1e60]{opacity:.8}.top-sentinel-btn[data-v-999e1e60]{appearance:none;border:.5px solid var(--border);background:transparent;color:var(--muted);font-size:var(--ui-font-size-sm);padding:4px 12px;border-radius:999px;cursor:pointer;transition:color .15s ease,border-color .15s ease}.top-sentinel-btn[data-v-999e1e60]:hover{color:var(--fg);border-color:var(--fg)}.top-sentinel-text[data-v-999e1e60]{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:var(--ui-font-size-sm)}.chat[data-v-999e1e60]{background:transparent}.chat[data-v-999e1e60]{gap:0;padding:22px 20px 26px}.u-bub[data-v-999e1e60]{background:var(--color-user-bubble-bg);border-radius:var(--radius-lg);padding:10px 12px}.a-msg[data-v-999e1e60]{max-width:100%;width:100%}.chat>.q-stack[data-v-999e1e60]{margin-top:var(--chat-turn-gap)}.chat>.q-stack[data-v-999e1e60]:first-child{margin-top:0}.q-stack[data-v-999e1e60]{align-self:flex-end;width:100%;display:flex;flex-direction:column;gap:8px}.q-head[data-v-999e1e60]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0 6px;color:var(--color-text-faint);font-size:var(--ui-font-size-xs)}.q-title[data-v-999e1e60]{display:inline-flex;align-items:center;gap:6px}.q-title b[data-v-999e1e60]{color:var(--color-accent-hover);font-weight:var(--weight-medium)}.q-turn[data-v-999e1e60]{position:relative;flex-direction:row;align-items:center;justify-content:flex-end;gap:var(--space-2)}.q-send[data-v-999e1e60]{flex:none;width:var(--space-6);height:var(--space-6);display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;border-radius:var(--radius-full);background:var(--color-accent);color:var(--color-text-on-accent);box-shadow:var(--shadow-xs);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.q-send[data-v-999e1e60]:hover{background:var(--color-accent-hover)}.q-send[data-v-999e1e60]:active{transform:scale(.92)}.q-send[data-v-999e1e60]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.q-send svg[data-v-999e1e60]{display:block;flex:none}.q-bub[data-v-999e1e60]{display:flex;align-items:center;gap:8px;width:fit-content;background:var(--color-user-bubble-bg);padding:8px 8px 8px 6px;transition:background var(--duration-fast) var(--ease-out)}.q-bub[data-v-999e1e60]:hover{background:var(--hover)}.q-grip[data-v-999e1e60]{flex:none;display:inline-flex;align-items:center;padding:2px;color:var(--color-text-faint);cursor:grab;opacity:.7}.q-grip[data-v-999e1e60]:hover{opacity:1}.q-grip[data-v-999e1e60]:active{cursor:grabbing}.q-clamp[data-v-999e1e60]{flex:1;min-width:0}.q-body[data-v-999e1e60]{flex:1;min-width:0;background:none;border:none;padding:0;margin:0;font:inherit;color:var(--color-text);text-align:left;cursor:pointer;opacity:.82}.q-bub:hover .q-body[data-v-999e1e60]{opacity:1}.q-body[data-v-999e1e60]:disabled{cursor:default}.q-text[data-v-999e1e60]{white-space:pre-wrap;overflow-wrap:anywhere}.q-text-placeholder[data-v-999e1e60]{display:inline-flex;align-items:center;gap:4px;color:var(--color-text-muted)}.q-imgs[data-v-999e1e60]{display:flex;gap:4px;flex:none}.q-img[data-v-999e1e60]{width:28px;height:28px;object-fit:cover;border-radius:var(--radius-sm);border:.5px solid var(--color-line)}.q-file[data-v-999e1e60]{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 6px;border-radius:var(--radius-sm);border:.5px solid var(--color-line);color:var(--color-text-muted);font-size:calc(var(--ui-font-size) - 3px);max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.q-rm[data-v-999e1e60]{flex:none;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;background:none;border:none;border-radius:var(--radius-sm);color:var(--color-text-faint);cursor:pointer;opacity:0;transition:opacity .12s ease,background .12s ease,color .12s ease}.q-bub:hover .q-rm[data-v-999e1e60],.q-bub:focus-within .q-rm[data-v-999e1e60],.q-rm[data-v-999e1e60]:focus-visible{opacity:1}.q-rm[data-v-999e1e60]:hover{background:var(--color-danger-soft);color:var(--color-danger)}.q-edit[data-v-999e1e60]{display:none;flex:none;width:22px;height:22px;align-items:center;justify-content:center;background:none;border:none;border-radius:var(--radius-sm);color:var(--color-text-faint);cursor:pointer}.q-edit[data-v-999e1e60]:hover{background:var(--color-hover);color:var(--color-text)}@media(hover:none){.q-grip[data-v-999e1e60]{display:none}.q-edit[data-v-999e1e60]{display:inline-flex}.q-rm[data-v-999e1e60],.q-edit[data-v-999e1e60]{opacity:1;position:relative}.q-rm[data-v-999e1e60]:before,.q-edit[data-v-999e1e60]:before{content:"";position:absolute;inset:-11px}}.q-turn.q-dragging .q-bub[data-v-999e1e60]{opacity:.45}.q-turn.drop-before[data-v-999e1e60]:before,.q-turn.drop-after[data-v-999e1e60]:after{content:"";position:absolute;left:0;right:0;height:2px;background:var(--color-accent);border-radius:var(--radius-full);z-index:1}.q-turn.drop-before[data-v-999e1e60]:before{top:-5px}.q-turn.drop-after[data-v-999e1e60]:after{bottom:-5px}.agent-panel[data-v-1441b1f4]{height:100%;min-height:0;display:flex;flex-direction:column;position:relative;background:var(--color-bg)}.agent-meta[data-v-1441b1f4]{flex:none;display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-3) var(--space-2);user-select:none}.agent-meta[data-v-1441b1f4]:before,.agent-meta[data-v-1441b1f4]:after{content:"";flex:1;height:.5px;background:var(--color-line)}.agent-meta-text[data-v-1441b1f4]{font-size:var(--text-xs);line-height:1;color:var(--color-text-muted);white-space:nowrap;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis}.agent-prompt[data-v-1441b1f4]{flex:none;display:flex;flex-direction:column;padding:0 var(--space-3) var(--space-2)}.agent-prompt-bubble[data-v-1441b1f4]{display:flex;flex-direction:column;align-self:flex-end;max-width:78%;padding:10px 12px;background:var(--color-user-bubble-bg);border-radius:var(--radius-lg)}.agent-prompt-wrap[data-v-1441b1f4]{position:relative;display:flex;flex-direction:column}.agent-prompt-text[data-v-1441b1f4]{white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--content-font-size);line-height:var(--leading-normal);color:var(--color-text)}.agent-prompt-text.is-command[data-v-1441b1f4]{font-family:var(--font-mono)}.agent-prompt-wrap.is-clamped>.agent-prompt-text[data-v-1441b1f4]{max-height:6lh;overflow:hidden;mask-image:linear-gradient(to bottom,black calc(100% - 2.5lh),transparent calc(100% - .5lh));-webkit-mask-image:linear-gradient(to bottom,black calc(100% - 2.5lh),transparent calc(100% - .5lh))}.agent-prompt-toggle[data-v-1441b1f4]{display:inline-flex;align-items:center;gap:var(--space-1);align-self:center;margin-top:var(--space-1);padding:var(--space-1) var(--space-3);border:none;border-radius:var(--radius-full);background:var(--color-surface-raised);box-shadow:var(--shadow-sm);color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);line-height:1;cursor:pointer;user-select:none;transition:box-shadow var(--duration-base) var(--ease-out)}.agent-prompt-toggle[data-v-1441b1f4]:hover{box-shadow:var(--shadow-md)}.agent-prompt-toggle[data-v-1441b1f4]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.agent-prompt-wrap.is-clamped .agent-prompt-toggle[data-v-1441b1f4]{position:absolute;bottom:0;left:50%;transform:translate(-50%);margin-top:0}.agent-prompt-toggle-car[data-v-1441b1f4]{transition:transform var(--duration-base) var(--ease-out)}.agent-prompt-toggle-car.open[data-v-1441b1f4]{transform:rotate(180deg)}.agent-transcript[data-v-1441b1f4]{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--pfc-host-h, 0px)}.agent-transcript-inner[data-v-1441b1f4]{display:flex;flex-direction:column;min-height:100%;width:100%;max-width:var(--p-content-max);margin-inline:auto}.agent-transcript[data-v-1441b1f4] .think-body,.agent-transcript[data-v-1441b1f4] .ar-body,.agent-transcript[data-v-1441b1f4] .tf-body,.agent-transcript[data-v-1441b1f4] .bb,.agent-transcript[data-v-1441b1f4] .tl-body{transition:none}.agent-error[data-v-1441b1f4]{color:var(--color-danger);font:var(--text-sm)/var(--leading-normal) var(--font-ui)}.agent-jump-btn[data-v-1441b1f4]{position:absolute;left:50%;bottom:var(--space-3);transform:translate(-50%);z-index:var(--z-sticky);display:inline-flex;align-items:center;gap:6px;padding:6px var(--space-3);border:.5px solid var(--color-line);border-radius:var(--radius-full);background:var(--color-surface);box-shadow:var(--shadow-sm);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-ui-strong);line-height:1.5;white-space:nowrap;cursor:pointer;user-select:none}.agent-jump-car[data-v-1441b1f4]{width:12px;height:12px}.agent-jump-btn[data-v-1441b1f4]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.agent-jump-enter-active[data-v-1441b1f4],.agent-jump-leave-active[data-v-1441b1f4]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.agent-jump-enter-from[data-v-1441b1f4],.agent-jump-leave-to[data-v-1441b1f4]{opacity:0;transform:translate(-50%) translateY(8px)}.agent-fallback[data-v-1441b1f4]{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-4)}.agent-fallback.prose[data-v-1441b1f4] .op{font-family:var(--font-ui)}.conversation-toc[data-v-9c0a5438]{position:absolute;z-index:var(--z-sticky);top:50%;transform:translateY(-50%);--toc-content-max: min( var(--p-content-max), calc(100cqi - var(--space-5) - var(--space-5)) );left:calc(50% + (var(--toc-content-max) / 2) + 14px);max-height:calc(100% - 160px);display:flex;flex-direction:column;justify-content:center;opacity:.5;transition:opacity var(--duration-base) var(--ease-out)}.conversation-toc[data-v-9c0a5438]:before{content:"";position:absolute;inset:0 -48px 0 -14px;z-index:0}.conversation-toc[data-v-9c0a5438]:hover,.conversation-toc[data-v-9c0a5438]:focus-within{opacity:1}.conversation-toc[data-v-9c0a5438]:hover:not(:focus-within){transition-delay:var(--duration-hover-intent)}.toc-scroll[data-v-9c0a5438]{position:relative;z-index:1;display:flex;flex-direction:column;gap:7px;padding:8px 0;min-height:0;overflow-y:auto;scrollbar-width:none}.toc-scroll[data-v-9c0a5438]::-webkit-scrollbar{display:none}.toc-row[data-v-9c0a5438]{display:flex;align-items:center;gap:10px;height:18px;padding:0;border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);text-align:left;cursor:pointer;white-space:nowrap}.toc-row[data-v-9c0a5438]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.toc-bar[data-v-9c0a5438]{flex:none;width:3px;height:14px;border-radius:var(--radius-full);background:var(--color-accent);opacity:.3;transition:opacity var(--duration-fast) var(--ease-out),height var(--duration-fast) var(--ease-out)}.toc-label[data-v-9c0a5438]{display:block;max-width:0;overflow:hidden;opacity:0;text-overflow:ellipsis;transition:max-width .22s var(--ease-out),opacity var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.conversation-toc:hover .toc-bar[data-v-9c0a5438],.conversation-toc:focus-within .toc-bar[data-v-9c0a5438]{height:18px;opacity:.5}.conversation-toc:hover .toc-label[data-v-9c0a5438],.conversation-toc:focus-within .toc-label[data-v-9c0a5438]{max-width:220px;opacity:1}.conversation-toc:hover:not(:focus-within) .toc-bar[data-v-9c0a5438]{transition-delay:0ms,var(--duration-hover-intent)}.conversation-toc:hover:not(:focus-within) .toc-label[data-v-9c0a5438]{transition-delay:var(--duration-hover-intent),var(--duration-hover-intent),0ms}.toc-row.active .toc-bar[data-v-9c0a5438]{opacity:1;height:18px}.toc-row.active .toc-label[data-v-9c0a5438]{color:var(--color-accent);font-weight:var(--weight-medium)}.toc-row:hover .toc-bar[data-v-9c0a5438]{opacity:1}.toc-row:hover .toc-label[data-v-9c0a5438]{color:var(--color-text)}.conversation-toc.toc-clipped[data-v-9c0a5438]{visibility:hidden;pointer-events:none}.changes-pane[data-v-2c83d74b]{display:flex;flex-direction:column;height:100%;background:var(--bg);font-family:var(--mono)}.dv-path[data-v-2c83d74b],.dv-change-count[data-v-2c83d74b]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:var(--ui-font-size-xs);color:var(--muted)}.dv-change-count[data-v-2c83d74b]{flex:1;align-self:stretch;display:inline-flex;align-items:center;font-family:var(--font-ui)}.dv-path[data-v-2c83d74b]{font-family:var(--font-ui)}.ch-head[data-v-2c83d74b]{display:flex;align-items:center;gap:8px;padding:8px var(--space-3);border-bottom:.5px solid var(--line);background:var(--panel);font-size:var(--text-base);color:var(--dim);flex:none;white-space:nowrap;overflow:hidden;font-family:var(--font-ui);user-select:none}.br-heading[data-v-2c83d74b]{display:inline-flex;align-items:center;gap:var(--space-1);flex:none}.br-icon[data-v-2c83d74b]{flex:none;color:var(--muted)}.br-label[data-v-2c83d74b]{color:var(--muted);font-size:var(--text-xs);font-weight:500}.br-name[data-v-2c83d74b]{color:var(--color-text);font-weight:500;font-size:var(--text-xs)}.sync-info[data-v-2c83d74b]{display:flex;align-items:center;gap:4px}.ahead[data-v-2c83d74b]{color:var(--color-accent);font-size:var(--text-xs)}.behind[data-v-2c83d74b]{color:var(--color-warning);font-size:var(--text-xs)}.empty-head[data-v-2c83d74b]{color:var(--muted);font-size:var(--text-base)}.ch-list[data-v-2c83d74b]{flex:1;min-height:0}.ch-list-content[data-v-2c83d74b]{min-height:100%;padding:4px 0;padding-bottom:max(4px,var(--pfc-host-h, 0px))}.ch-row[data-v-2c83d74b]{display:flex;align-items:center;gap:6px;padding:3px 8px;cursor:pointer;font-size:var(--text-xs);line-height:1.6;width:100%;background:none;border:none;text-align:left;font-family:var(--font-ui);color:inherit}.ch-row[data-v-2c83d74b]:hover{background:var(--panel2)}.ch-row[data-v-2c83d74b]:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}.ch-tree[data-v-2c83d74b]{--tree-base-indent: 14px;--tree-indent-step: 12px;font-family:var(--font-ui)}.tree-list[data-v-2c83d74b]{list-style:none;margin:0}.tree-node[data-v-2c83d74b]{overflow:hidden;interpolate-size:allow-keywords}.tree-collapse-enter-active[data-v-2c83d74b],.tree-collapse-leave-active[data-v-2c83d74b]{transition:block-size var(--duration-base) var(--ease-out),opacity var(--duration-fast) var(--ease-out),transform var(--duration-base) var(--ease-out)}.tree-collapse-enter-from[data-v-2c83d74b],.tree-collapse-leave-to[data-v-2c83d74b]{block-size:0;opacity:0;transform:translateY(-3px)}.tree-collapse-enter-to[data-v-2c83d74b],.tree-collapse-leave-from[data-v-2c83d74b]{block-size:auto;opacity:1;transform:translateY(0)}.tree-row[data-v-2c83d74b]{position:relative;display:flex;align-items:center;gap:6px;width:100%;margin-top:1px;padding:3px 8px;background:none;border:none;text-align:left;font-family:inherit;font-size:var(--text-xs);color:inherit;cursor:pointer}.tree-row[data-v-2c83d74b]:before{content:"";position:absolute;top:0;bottom:0;left:calc(var(--tree-base-indent) + 6px);width:calc(var(--tree-depth, 0) * var(--tree-indent-step));background:repeating-linear-gradient(to right,var(--color-line) 0 1px,transparent 1px var(--tree-indent-step));pointer-events:none}.tree-row[data-v-2c83d74b]:hover{background:var(--panel2)}.tree-row[data-v-2c83d74b]:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}.tree-folder[data-v-2c83d74b]{color:var(--color-text);font-weight:500}.tree-file[data-v-2c83d74b]{color:var(--color-text);font-weight:450}.tree-icon[data-v-2c83d74b]{flex:none;color:var(--muted)}.tree-name[data-v-2c83d74b]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge[data-v-2c83d74b]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-xs);font-size:max(9px,calc(var(--ui-font-size) - 4px));font-weight:500;flex:none;user-select:none}.badge.modified[data-v-2c83d74b]{background:var(--color-warning-soft);color:var(--color-warning)}.badge.added[data-v-2c83d74b]{background:var(--color-success-soft);color:var(--color-success)}.badge.deleted[data-v-2c83d74b]{background:var(--color-danger-soft);color:var(--color-danger)}.badge.renamed[data-v-2c83d74b]{background:var(--color-done-soft);color:var(--color-done)}.badge.untracked[data-v-2c83d74b]{background:var(--color-success-soft);color:var(--color-success)}.badge.conflicted[data-v-2c83d74b]{background:color-mix(in srgb,var(--color-danger) 10%,var(--bg));color:var(--color-danger);font-size:max(9px,calc(var(--ui-font-size) - 5px))}.badge.ignored[data-v-2c83d74b]{background:var(--color-well);color:var(--faint)}.badge.clean[data-v-2c83d74b]{background:transparent;color:var(--faint)}.badge.unknown[data-v-2c83d74b]{background:var(--color-well);color:var(--muted)}.fpath[data-v-2c83d74b]{color:var(--color-text);font-size:var(--text-xs);font-weight:450;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:left;min-width:0}.fpath[data-v-2c83d74b]:before,.fpath[data-v-2c83d74b]:after{content:"‎"}.empty-state[data-v-2c83d74b]{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);padding:32px 20px;color:var(--muted);font-size:var(--ui-font-size);text-align:center;user-select:none}.empty-state-icon[data-v-2c83d74b]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--color-well);color:var(--color-text-muted)}.diff-head[data-v-2c83d74b]{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:.5px solid var(--line);background:var(--panel);flex:none;white-space:nowrap;overflow:hidden}.dv-lines-wrap[data-v-2c83d74b]{flex:1;min-height:0;overflow:auto;padding-bottom:var(--pfc-host-h, 0px)}.diff-content-enter-active[data-v-2c83d74b],.diff-content-leave-active[data-v-2c83d74b]{transition:opacity var(--duration-base) var(--ease-out)}.diff-content-enter-from[data-v-2c83d74b],.diff-content-leave-to[data-v-2c83d74b]{opacity:0}@media(max-width:640px){.ch-head[data-v-2c83d74b]{padding:10px 14px}.ch-list[data-v-2c83d74b]{padding:2px 0 12px}.ch-row[data-v-2c83d74b]{min-height:44px;padding:8px 14px;gap:12px;font-size:var(--text-xs)}.ch-row[data-v-2c83d74b]:active{background:var(--panel2)}.badge[data-v-2c83d74b]{width:18px;height:18px}.fpath[data-v-2c83d74b]{font-size:var(--text-xs)}.tree-row[data-v-2c83d74b]{min-height:40px;padding:8px 14px}.diff-head[data-v-2c83d74b]{padding:8px 12px;gap:10px}.diff-path[data-v-2c83d74b]{font-size:var(--text-base)}}.changes-pane .empty-state[data-v-2c83d74b],.br-label[data-v-2c83d74b],.empty-head[data-v-2c83d74b]{font-family:var(--sans)}.ch-row[data-v-2c83d74b],.ct-row[data-v-2c83d74b]{margin:1px 6px;width:calc(100% - 12px);border-radius:var(--radius-md)}.changes-pane .badge[data-v-2c83d74b],.changed-tree .badge[data-v-2c83d74b]{border-radius:var(--radius-sm)}.change-count[data-v-2c83d74b]{font-family:var(--sans);border-radius:999px}.qcard[data-v-645038cd]{display:flex;flex-direction:column;max-height:calc(var(--app-height, 100dvh) - var(--dock-card-top-clearance));margin:var(--space-2) 0;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);overflow:hidden auto;animation:kimi-card-in var(--duration-base) var(--ease-out)}.qcard>.qh[data-v-645038cd],.qcard>.qfoot[data-v-645038cd]{flex:none}.qcard.minimized[data-v-645038cd]{transition:background var(--duration-fast) var(--ease-out)}.qcard.minimized[data-v-645038cd]:hover{background:var(--color-hover)}.qh[data-v-645038cd]{display:flex;align-items:flex-start;gap:var(--space-2);padding:var(--space-3) var(--space-4) 0}.qcard.minimized .qh[data-v-645038cd]{padding-bottom:var(--space-3);align-items:center}.qcard.minimized .qh.clickable[data-v-645038cd]{cursor:pointer}.qh-chip[data-v-645038cd]{width:var(--p-chip-num);height:var(--p-chip-num);border-radius:var(--radius-sm);background:var(--color-inline-code-bg);color:var(--color-text);font:var(--weight-medium) var(--text-xs)/var(--p-chip-num) var(--font-ui);text-align:center;flex:none}.qtitle[data-v-645038cd]{flex:1;min-width:0;color:var(--color-text);font-size:var(--text-lg);font-weight:var(--weight-semibold);line-height:var(--leading-tight);overflow-wrap:anywhere}.qcard.minimized .qtitle[data-v-645038cd]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.qmin[data-v-645038cd],.qclose[data-v-645038cd]{flex:none;margin-top:calc((var(--text-lg) * var(--leading-tight) - var(--icon-button-sm)) / 2)}.qmin[data-v-645038cd]{margin-left:auto}.qcard.minimized .qmin[data-v-645038cd],.qcard.minimized .qclose[data-v-645038cd]{margin-top:0}.qbody[data-v-645038cd]{min-height:min(var(--question-card-body-min-h),calc(var(--app-height, 100dvh) * .25));overflow-y:auto;padding:var(--space-3) var(--space-4) 0;color:var(--color-text);font:var(--text-base)/var(--leading-normal) var(--font-ui)}.qmdbody[data-v-645038cd]{margin-bottom:var(--space-2)}.qopts[data-v-645038cd]{display:flex;flex-direction:column;gap:2px;margin-top:var(--space-2)}.qopt[data-v-645038cd]{display:flex;align-items:flex-start;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);cursor:pointer;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text);transition:background var(--duration-fast) var(--ease-out);user-select:none}.qopt[data-v-645038cd]:hover,.qopt.highlighted[data-v-645038cd]{background:var(--color-hover)}.qopt-key[data-v-645038cd]{width:var(--p-chip-num);height:var(--p-chip-num);margin-top:calc((var(--text-base) * var(--leading-normal) - var(--p-chip-num)) / 2);border-radius:var(--radius-sm);background:var(--color-inline-code-bg);color:var(--color-text);font:var(--weight-medium) var(--text-xs)/var(--p-chip-num) var(--font-ui);text-align:center;flex:none}.qopt-key[data-v-645038cd]:empty{background:transparent}.qopt-glyph[data-v-645038cd]{width:16px;height:16px;margin-top:calc((var(--text-base) * var(--leading-normal) - 16px) / 2);flex:none;border:.5px solid var(--color-line-strong);position:relative;transition:border-color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out)}.qopt-glyph.rad[data-v-645038cd]{border-radius:50%}.qopt-glyph.chk[data-v-645038cd]{border-radius:var(--radius-xs)}.qopt.selected .qopt-glyph[data-v-645038cd]{border-color:var(--color-accent)}.qopt.selected .qopt-glyph.rad[data-v-645038cd]:after{content:"";position:absolute;inset:3px;border-radius:50%;background:var(--color-accent)}.qopt.selected .qopt-glyph.chk[data-v-645038cd]{background:var(--color-accent)}.qopt.selected .qopt-glyph.chk[data-v-645038cd]:after{content:"";position:absolute;left:4.5px;top:1.5px;width:4px;height:8px;border-right:1.5px solid var(--color-text-on-accent);border-bottom:1.5px solid var(--color-text-on-accent);transform:rotate(45deg)}.qopt-text[data-v-645038cd]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.qopt-label[data-v-645038cd]{color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium)}.qopt-desc[data-v-645038cd]{color:var(--color-text-muted);font:var(--text-xs)/var(--leading-normal) var(--font-ui)}.qopt-text-other[data-v-645038cd]{flex:0 1 auto}.other-input[data-v-645038cd]{flex:1;font:var(--text-base) var(--font-ui);border:none;border-bottom:.5px solid var(--color-line);outline:none;padding:2px var(--space-1);color:var(--color-text);background:transparent;min-width:12ch}.other-input[data-v-645038cd]:focus-visible{border-bottom-color:var(--color-accent);box-shadow:0 1px 0 0 var(--color-accent)}.qfoot[data-v-645038cd]{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-3);padding:var(--space-3) var(--space-4);border-top:.5px solid var(--color-line)}.qbtns[data-v-645038cd]{display:flex;align-items:center;gap:var(--space-1)}.qhint[data-v-645038cd]{margin-left:auto;color:var(--color-text-faint);font:var(--text-xs) var(--font-ui);user-select:none}@media(max-width:640px){.qopt[data-v-645038cd]{min-height:44px;padding:var(--space-3)}.other-input[data-v-645038cd]{flex-basis:100%;min-height:28px}.qfoot[data-v-645038cd]{flex-direction:column;align-items:stretch}.qhint[data-v-645038cd]{display:none}.qbtns[data-v-645038cd]{flex-direction:column;gap:var(--space-2)}.qbtns[data-v-645038cd] .ui-button{width:100%;min-height:46px}}.sc[data-v-9932e21c]{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--bg);position:relative}.sc-body[data-v-9932e21c]{flex:1;min-height:0;overflow-y:auto}.sc-empty[data-v-9932e21c]{padding:24px 16px;text-align:center;color:var(--muted);font-size:var(--ui-font-size)}.sc-composer[data-v-9932e21c]{position:absolute;left:0;right:0;bottom:0;z-index:var(--z-sticky);display:flex;align-items:flex-end;gap:6px;padding:8px 10px;border-top:.5px solid var(--color-line);background:var(--color-surface-raised)}.sc-input[data-v-9932e21c]{flex:1;min-width:0;resize:none;border:.5px solid var(--color-line);border-radius:var(--r-sm);padding:7px 9px;background:var(--bg);color:var(--color-text);font:var(--ui-font-size)/1.5 var(--sans);outline:none;max-height:160px}.sc-input[data-v-9932e21c]:focus{border-color:var(--color-accent-bd)}.sc-send[data-v-9932e21c]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:var(--r-sm);background:var(--color-accent);color:var(--color-text-on-accent);cursor:pointer}.sc-send[data-v-9932e21c]:disabled{opacity:.4;cursor:default}.sc-send[data-v-9932e21c]:not(:disabled):hover{background:var(--color-accent-hover)}.sc-loading[data-v-9932e21c]{flex:none;padding:8px 12px 12px}.sc-body[data-v-9932e21c] .sending-placeholder,.sc-body[data-v-9932e21c] .sending-line{display:none}.rows[data-v-1e95fd47]{margin:0;padding:0}.row[data-v-1e95fd47]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) 0;font-size:var(--text-base)}.row dt[data-v-1e95fd47]{width:96px;flex:none;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.04em;font-size:var(--text-xs)}.row dd[data-v-1e95fd47]{margin:0;color:var(--color-text);font-weight:var(--weight-medium);display:flex;align-items:center;gap:var(--space-2);min-width:0}.row dd.plan-on[data-v-1e95fd47],.row dd.swarm-on[data-v-1e95fd47]{color:var(--color-accent)}.row dd.thinking-value[data-v-1e95fd47]{flex-direction:column;align-items:flex-start;gap:var(--space-1)}.cache-note[data-v-1e95fd47]{color:var(--color-text-faint);font-weight:var(--weight-regular);font-size:var(--text-xs)}.ctx-text[data-v-1e95fd47]{flex:none}.bar[data-v-1e95fd47]{width:80px;height:5px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden;flex:none}.bar i[data-v-1e95fd47]{display:block;height:100%;background:var(--color-accent)}@media(max-width:640px){.rows[data-v-1e95fd47]{overflow-y:auto;-webkit-overflow-scrolling:touch}.row[data-v-1e95fd47]{align-items:flex-start;flex-direction:column;gap:var(--space-1);min-height:48px}.row dt[data-v-1e95fd47]{width:auto}.row dd[data-v-1e95fd47]{max-width:100%;flex-wrap:wrap}}.tp[data-v-5ecb9355]{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--color-bg)}.tp-body[data-v-5ecb9355]{flex:1;min-height:0;overflow-y:auto;margin:0;padding:12px 14px;padding-bottom:max(12px,var(--pfc-host-h, 0px));font:var(--text-base)/var(--leading-relaxed) var(--font-ui);font-weight:400;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-word}.td[data-v-6c964102]{display:flex;flex-direction:column;height:100%;min-height:0}.td-path[data-v-6c964102]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--ui-c1) var(--font-mono);color:var(--color-text-muted)}.td-body[data-v-6c964102]{flex:1;min-height:0;overflow:auto;padding-bottom:var(--pfc-host-h, 0px)}.td-empty[data-v-6c964102]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-3);height:100%;padding:var(--space-6);color:var(--color-text-muted);font-size:var(--text-sm);text-align:center}.filter-control[data-v-9d5b56c7]{display:inline-flex;min-width:0}.fc-chevron[data-v-9d5b56c7]{color:var(--color-text-faint);transition:transform var(--duration-base) var(--ease-out)}.fc-trigger[aria-expanded=true] .fc-chevron[data-v-9d5b56c7]{transform:rotate(180deg)}.fc-menu[data-v-9d5b56c7]{position:fixed;z-index:var(--z-dropdown)}.fc-menu[data-v-9d5b56c7] .ui-menu{min-width:0}.fc-label[data-v-9d5b56c7]{flex:1;white-space:nowrap}.filter-control[data-v-9d5b56c7] .ui-seg__item[data-icon=circle-check] .ui-seg__icon,.fc-menu .kw-icon[data-icon=circle-check][data-v-9d5b56c7]{transform:scale(.91)}.fc-check[data-v-9d5b56c7]{color:var(--color-accent)}.goal-panel[data-v-6dea2f18]{display:flex;flex-direction:column;gap:var(--space-2);overflow-wrap:anywhere}.goal-criterion[data-v-6dea2f18]{padding-top:var(--space-2);border-top:.5px solid var(--color-line)}.goal-criterion-label[data-v-6dea2f18]{display:flex;align-items:center;gap:var(--space-1);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-section-label);line-height:var(--leading-normal);margin-bottom:var(--space-1)}.plan-panel[data-v-69db97fc]{display:flex;flex-direction:column;gap:var(--space-2)}.plan-review-row[data-v-69db97fc]{display:flex;gap:var(--space-2);font-size:var(--text-sm)}.plan-review-label[data-v-69db97fc]{flex:none;color:var(--color-text-muted)}.plan-review-feedback[data-v-69db97fc]{color:var(--color-text-muted)}.plan-path-only[data-v-69db97fc]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-1)}.plan-path-hint[data-v-69db97fc]{color:var(--color-text-muted);font-size:var(--text-sm)}.plan-path[data-v-69db97fc]{max-width:100%;font-family:var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.plan-empty[data-v-69db97fc]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);padding:var(--space-6) var(--space-4);color:var(--color-text-faint);font-size:var(--text-sm)}.plan-empty-ico[data-v-69db97fc]{width:var(--p-empty-ico);height:var(--p-empty-ico);color:var(--color-line-strong)}.sg-empty[data-v-13735c1e]{height:100%;display:flex;align-items:center;justify-content:center;color:var(--color-text-faint);font-size:var(--text-sm);user-select:none}.sg-grid[data-v-13735c1e]{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--p-subagent-card-min),1fr));gap:var(--space-2)}.sg-card[data-v-13735c1e]{position:relative;display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-3);border-radius:var(--radius-lg);background:var(--color-selected)}.sg-card.openable[data-v-13735c1e]{cursor:pointer}.sg-card.openable[data-v-13735c1e]:hover{background:var(--color-selected-hover)}.sg-card[data-v-13735c1e]:not(.openable){cursor:not-allowed}.sg-open[data-v-13735c1e]{position:absolute;inset:0;padding:0;border:none;border-radius:var(--radius-lg);background:transparent;cursor:pointer}.sg-open[data-v-13735c1e]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.sg-top[data-v-13735c1e]{display:flex;align-items:center;gap:var(--space-2)}.sg-name[data-v-13735c1e]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text);font-weight:var(--weight-medium)}.sg-num[data-v-13735c1e]{flex:none;color:var(--color-text-muted);font-size:var(--text-sm);font-variant-numeric:tabular-nums}.sg-card:has(.sg-cancel) .sg-top[data-v-13735c1e]{padding-right:calc(var(--icon-button-sm) + var(--space-1))}@media(hover:none){.sg-card:has(.sg-cancel) .sg-top[data-v-13735c1e]{padding-right:calc(var(--touch-target-min) + var(--space-1))}}.sg-desc[data-v-13735c1e]{color:var(--color-text-muted);font-size:var(--text-sm);line-height:var(--leading-caption);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.sg-foot[data-v-13735c1e]{display:flex;flex-direction:column;gap:var(--space-1)}.sg-model[data-v-13735c1e]{display:flex;align-items:center;gap:var(--space-1);color:var(--color-text-muted);font-size:var(--text-xs)}.sg-model span[data-v-13735c1e]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sg-status[data-v-13735c1e]{display:flex;align-items:center}.sg-state[data-v-13735c1e]{display:inline-flex;align-items:center;gap:var(--space-1);color:var(--color-text-muted);font-size:var(--text-xs);text-autospace:normal}.sg-ic-done[data-v-13735c1e]{color:var(--color-success);transform:scale(.91)}.s-fail .sg-state[data-v-13735c1e]{color:var(--color-danger)}.sg-time[data-v-13735c1e]{margin-left:auto;display:inline-flex;align-items:center;gap:var(--space-1);color:var(--color-text-muted);font-size:var(--text-xs);font-variant-numeric:tabular-nums;text-autospace:normal}.sg-cancel[data-v-13735c1e]{position:absolute;top:var(--space-2);right:var(--space-2);color:var(--color-text-muted);opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.sg-card:hover .sg-cancel[data-v-13735c1e],.sg-cancel[data-v-13735c1e]:focus-visible{opacity:1}.sg-cancel[data-v-13735c1e]:hover{color:var(--color-danger)}@media(hover:none){.sg-cancel[data-v-13735c1e]{top:0;right:0;width:var(--touch-target-min);height:var(--touch-target-min);opacity:1}}.taskspane[data-v-25d6e0cb]{flex:1;min-height:0;display:flex;flex-direction:column}.tp-list[data-v-25d6e0cb]{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:var(--space-05)}.tp-row[data-v-25d6e0cb]{padding:var(--space-1) 0}.tp-row.fail .tp-name[data-v-25d6e0cb]{color:var(--color-danger)}.tp-main[data-v-25d6e0cb]{display:flex;align-items:center;gap:var(--space-2);font-size:var(--text-base)}.tp-row.expandable>.tp-main[data-v-25d6e0cb]{position:relative;border-radius:var(--radius-lg);padding:var(--space-1) var(--space-2);margin:calc(-1 * var(--space-1)) 0}.tp-row.expandable>.tp-main[data-v-25d6e0cb]:hover{background:var(--color-hover)}.tp-row[data-v-25d6e0cb]:not(.expandable){cursor:not-allowed}.tp-open[data-v-25d6e0cb]{position:absolute;inset:0;padding:0;border:none;border-radius:var(--radius-lg);background:transparent;cursor:pointer}.tp-open[data-v-25d6e0cb]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tp-chevron[data-v-25d6e0cb]{flex:none;color:var(--muted)}.tp-name[data-v-25d6e0cb]{color:var(--color-text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-meta[data-v-25d6e0cb]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-muted)}.tp-glyph[data-v-25d6e0cb]{flex:none;width:var(--p-ic-md);height:var(--p-ic-md);display:inline-flex;align-items:center;justify-content:center}.tp-done[data-v-25d6e0cb]{color:var(--color-success);transform:scale(.91)}.tp-cancelled[data-v-25d6e0cb]{color:var(--color-text-muted)}.tp-fail[data-v-25d6e0cb]{color:var(--color-danger)}.tp-time[data-v-25d6e0cb]{flex:none;font-size:var(--text-base);color:var(--muted);font-variant-numeric:tabular-nums;text-autospace:normal}.tp-model[data-v-25d6e0cb]{flex:0 1 auto;min-width:0;font-size:var(--text-base);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-stop[data-v-25d6e0cb]{position:relative;flex:none;color:var(--color-danger)}.tp-stop[data-v-25d6e0cb]:hover{color:var(--color-danger)}@media(hover:none){.tp-stop[data-v-25d6e0cb]{width:var(--touch-target-min);height:var(--touch-target-min)}.tp-row.expandable>.tp-main[data-v-25d6e0cb]{min-height:var(--touch-target-min)}}.tp-empty[data-v-25d6e0cb]{flex:1;display:flex;align-items:center;justify-content:center;color:var(--faint);font-size:var(--ui-font-size-sm);user-select:none}@media(max-width:640px){.tp-main[data-v-25d6e0cb]{flex-wrap:wrap;row-gap:var(--space-1)}.tp-name[data-v-25d6e0cb]{font-size:var(--ui-font-size-sm)}.tp-meta[data-v-25d6e0cb]{order:10;flex:1 1 100%;padding-left:calc(var(--p-ic-md) + var(--space-2));font-size:var(--ui-font-size-xs)}}.todo-card[data-v-1b02ea7b]{display:flex;flex-direction:column;gap:var(--space-3);font-size:var(--text-base)}.tc-row[data-v-1b02ea7b]{display:flex;align-items:center;gap:var(--space-2);color:var(--color-text)}.tc-name[data-v-1b02ea7b]{flex:1;min-width:0;overflow-wrap:anywhere;line-height:var(--leading-caption)}.tc-row.s-in_progress .tc-name[data-v-1b02ea7b]{font-weight:var(--weight-medium)}.tc-row.s-pending .tc-name[data-v-1b02ea7b]{color:var(--color-text-muted)}.tc-glyph[data-v-1b02ea7b]{flex:none;width:var(--p-ic-md);height:var(--p-ic-md);display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-full)}.tc-glyph.g-done[data-v-1b02ea7b]{color:var(--color-success)}.tc-glyph.g-pending[data-v-1b02ea7b]{border:var(--p-ring-stroke) solid var(--color-line-strong)}.tc-glyph .tc-spin[data-v-1b02ea7b]{color:var(--color-text)}.tc-empty[data-v-1b02ea7b]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);padding:var(--space-6) var(--space-4);color:var(--color-text-faint);font-size:var(--text-sm)}.tc-empty-ico[data-v-1b02ea7b]{width:var(--p-empty-ico);height:var(--p-empty-ico);color:var(--color-line-strong)}@media(max-width:640px){.todo-card[data-v-1b02ea7b]{font-size:var(--text-lg)}.tc-row[data-v-1b02ea7b]{padding:var(--space-2) var(--space-3)}}.wp-head-tab[data-v-c935b92a]{display:inline-flex;align-items:center;gap:var(--space-2);padding:0;border:.5px solid transparent;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium);line-height:var(--leading-solid);white-space:nowrap;flex:none}.wp-head-tab[data-v-c935b92a] svg{width:1.5em;height:1.5em}.wp-head-meta[data-v-c935b92a]{color:var(--color-text-muted);text-autospace:normal}.wp-head-actions[data-v-c935b92a]{margin-left:auto;display:flex;align-items:center;gap:var(--space-1);flex:none}@media(max-width:480px){.wp-head-actions[data-v-c935b92a]{flex-basis:100%;margin-left:0}}@media(hover:none){.wp-head-actions[data-v-c935b92a] .ui-seg__item{min-height:var(--touch-target-min)}}@media(max-width:640px),(hover:none){.wp-head-actions[data-v-c935b92a] .ui-seg__item{height:var(--touch-target-min)}.wp-head-actions[data-v-c935b92a] .ui-icon-button{width:var(--touch-target-min);height:var(--touch-target-min)}.wp-head-actions[data-v-c935b92a] .fc-trigger{min-height:var(--touch-target-min)}}.aw[data-v-e24668bd]{padding-top:4px}.crumbbar[data-v-e24668bd]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) 22px;border-bottom:.5px solid var(--color-line)}.crumbs[data-v-e24668bd]{display:flex;align-items:center;flex-wrap:wrap;gap:1px;min-width:0;font-size:var(--text-sm)}.crumb-sep[data-v-e24668bd]{color:var(--color-text-muted)}.crumb[data-v-e24668bd]{background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-muted);padding:1px var(--space-1);border-radius:var(--radius-xs)}.crumb[data-v-e24668bd]:hover{color:var(--color-text);background:var(--color-hover)}.crumb.last[data-v-e24668bd]{color:var(--color-text);font-weight:var(--weight-medium)}.filterbar[data-v-e24668bd]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) 22px;border-bottom:.5px solid var(--color-line)}.filter-icon[data-v-e24668bd]{flex:none;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--color-text-muted)}.filter-input[data-v-e24668bd]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-base);padding:var(--space-1) 0;border:none;background:none;color:var(--color-text);outline:none}.filter-input[data-v-e24668bd]::placeholder{color:var(--color-text-muted)}.search-rel[data-v-e24668bd]{color:var(--color-text)}.folder-list[data-v-e24668bd]{height:300px;overflow-y:auto;padding:var(--space-1) var(--space-2)}.fl-loading[data-v-e24668bd],.fl-empty[data-v-e24668bd]{padding:var(--space-6) var(--space-4);text-align:center;color:var(--color-text-muted);font-size:var(--text-sm)}.folder-row[data-v-e24668bd]{display:flex;align-items:center;gap:var(--space-2);width:100%;background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-base);color:var(--color-text);text-align:left;padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);transition:background var(--duration-fast) var(--ease-out)}.folder-row[data-v-e24668bd]:hover{background:var(--color-hover)}.dir-icon[data-v-e24668bd]{flex:none;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--color-text-muted)}.folder-name[data-v-e24668bd]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text)}.paste-section[data-v-e24668bd]{padding:var(--space-3) 22px;border-top:.5px solid var(--color-line)}.paste-section.paste-only[data-v-e24668bd]{border-top:none}.paste-row[data-v-e24668bd]{display:flex;align-items:center;gap:var(--space-2)}.paste-input-wrap[data-v-e24668bd]{flex:1;min-width:0}.add-error[data-v-e24668bd]{margin:0 22px var(--space-2);padding:var(--space-2) var(--space-3);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-danger);background:var(--color-danger-soft);border:.5px solid var(--color-danger-bd);border-radius:var(--radius-sm)}.actions[data-v-e24668bd]{display:flex;justify-content:flex-end;gap:var(--space-2);padding:var(--space-3) 22px}.footer-hint[data-v-e24668bd]{padding:var(--space-2) var(--space-4);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint);border-top:.5px solid var(--color-line)}@media(max-width:640px){.folder-row[data-v-e24668bd]{min-height:44px}.crumbbar[data-v-e24668bd]{align-items:flex-start}.actions[data-v-e24668bd]{flex-wrap:wrap}}.sheet-root[data-v-91fc927c]{position:fixed;inset:0;z-index:var(--z-overlay);display:flex;flex-direction:column;justify-content:flex-end}.sheet-scrim[data-v-91fc927c]{position:absolute;inset:0;background:#0d111773}.sheet-panel[data-v-91fc927c]{position:relative;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-bottom:none;border-radius:var(--radius-xl) var(--radius-xl) 0 0;box-shadow:var(--shadow-xl);max-height:calc(var(--app-height, 100dvh) * .86);display:flex;flex-direction:column;min-height:0;font-family:var(--font-ui);color:var(--color-text)}.sheet-grab[data-v-91fc927c]{flex:none;align-self:center;width:56px;height:18px;padding:0;border:none;background:none;cursor:pointer;position:relative;margin-top:4px}.sheet-grab[data-v-91fc927c]:after{content:"";position:absolute;left:50%;top:7px;transform:translate(-50%);width:38px;height:5px;border-radius:var(--radius-full);background:var(--color-line)}.sheet-head[data-v-91fc927c]{flex:none;display:flex;align-items:center;justify-content:space-between;padding:6px 16px 10px}.sheet-title[data-v-91fc927c]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.sheet-body[data-v-91fc927c]{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:max(16px,var(--safe-bottom))}.sheet-enter-active[data-v-91fc927c],.sheet-leave-active[data-v-91fc927c]{transition:opacity var(--duration-slow) var(--ease-out)}.sheet-enter-active .sheet-panel[data-v-91fc927c],.sheet-leave-active .sheet-panel[data-v-91fc927c]{transition:transform var(--duration-slow) var(--ease-out)}.sheet-enter-from[data-v-91fc927c],.sheet-leave-to[data-v-91fc927c]{opacity:0}.sheet-enter-from .sheet-panel[data-v-91fc927c],.sheet-leave-to .sheet-panel[data-v-91fc927c]{transform:translateY(102%)}.confirm-dialog__message[data-v-32237722]{margin:0;font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted)}.sd-search[data-v-35cdd013]{position:relative;margin:0 22px;padding-bottom:var(--space-1)}.sd-search[data-v-35cdd013] .ui-input{padding-right:30px}.search-clear[data-v-35cdd013]{position:absolute;top:0;bottom:var(--space-1);right:var(--space-2);margin-block:auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;border-radius:var(--radius-full);background:var(--color-hover);color:var(--color-text-faint);cursor:pointer;visibility:hidden;opacity:0;transition:opacity var(--duration-fast) var(--ease-out),visibility var(--duration-fast),background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.search-clear.is-on[data-v-35cdd013]{visibility:visible;opacity:1}.search-clear[data-v-35cdd013]:hover{background:var(--color-selected);color:var(--color-text-muted)}.search-clear[data-v-35cdd013]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}@media(prefers-reduced-motion:reduce){.search-clear[data-v-35cdd013]{transition:none}}.sd-body[data-v-35cdd013]{height:100%;min-height:0;display:flex;flex-direction:column;gap:var(--space-2);padding-top:4px}.sd-list[data-v-35cdd013]{flex:1;min-height:0;overflow-y:auto;padding:var(--space-1) var(--space-2);--sd-gutter: var(--p-ic-md);--sd-gap: var(--space-2)}.sd-section[data-v-35cdd013]{display:flex;align-items:baseline;gap:var(--space-1);padding:var(--space-2) var(--space-3) var(--space-1);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-section-label);text-transform:uppercase;color:var(--color-text-faint);user-select:none}.sd-section-count[data-v-35cdd013]{font-weight:var(--weight-regular)}.sd-section[data-v-35cdd013]:first-child{padding-top:var(--space-1)}.sd-section[data-v-35cdd013]:not(:first-child){margin-top:var(--space-1);border-top:var(--p-hairline) solid var(--color-line)}.sd-row[data-v-35cdd013]{display:flex;flex-direction:column;gap:2px;width:100%;padding:var(--space-2) var(--space-3);border:none;border-radius:var(--radius-md);background:none;cursor:pointer;text-align:left;font-family:var(--font-ui);color:var(--color-text)}.sd-row[data-v-35cdd013]:hover{background:var(--color-hover)}.sd-row.on[data-v-35cdd013]{background:var(--color-selected)}.sd-row.active .sd-title[data-v-35cdd013]{color:var(--color-accent-hover)}.sd-row-ws[data-v-35cdd013]{flex-direction:row;align-items:center;gap:var(--sd-gap)}.sd-folder[data-v-35cdd013]{flex:none;width:var(--sd-gutter);color:var(--color-text-muted)}.sd-ws-name[data-v-35cdd013]{flex:none;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);color:var(--color-text)}.sd-ws-path[data-v-35cdd013]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;font-size:var(--text-xs);color:var(--color-text-faint)}.sd-line1[data-v-35cdd013],.sd-line2[data-v-35cdd013]{padding-left:calc(var(--sd-gutter) + var(--sd-gap))}.sd-line1[data-v-35cdd013]{display:flex;align-items:baseline;gap:var(--space-2);min-width:0}.sd-title[data-v-35cdd013]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);color:var(--color-text)}.sd-time[data-v-35cdd013]{flex:none;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint)}.sd-line2[data-v-35cdd013]{display:flex;align-items:center;gap:var(--space-1);min-width:0;font-size:var(--text-xs);color:var(--color-text-muted)}.sd-meta-ws[data-v-35cdd013]{flex:none;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-meta-sep[data-v-35cdd013]{color:var(--color-text-faint)}.sd-meta-snippet[data-v-35cdd013]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-title[data-v-35cdd013] mark,.sd-ws-name[data-v-35cdd013] mark{background:var(--color-accent-soft);color:inherit;font-weight:var(--weight-semibold);border-radius:var(--radius-xs);padding:0 1px}.sd-line2[data-v-35cdd013] mark,.sd-ws-path[data-v-35cdd013] mark{background:var(--color-accent-soft);color:var(--color-text);font-weight:var(--weight-medium);border-radius:var(--radius-xs);padding:0 1px}.sd-empty[data-v-35cdd013]{height:100%;display:flex;align-items:center;justify-content:center}.sd-foot[data-v-35cdd013]{flex:none;display:flex;align-items:center;gap:var(--space-1);padding:var(--space-2) var(--space-4);border-top:.5px solid var(--color-line);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint)}.sd-hint[data-v-35cdd013]{display:inline-flex;align-items:center;gap:var(--space-1)}.sd-dot[data-v-35cdd013]{margin:0 var(--space-1)}.topbar[data-v-78cbb21c]{display:flex;align-items:center;height:calc(50px + var(--safe-top));flex:none;padding:var(--safe-top) max(12px,var(--safe-right)) 0 max(12px,var(--safe-left));border-bottom:.5px solid var(--color-line);background:var(--color-topbar-bg-frost);-webkit-backdrop-filter:var(--p-topbar-backdrop);backdrop-filter:var(--p-topbar-backdrop);font-family:var(--font-ui);-webkit-user-select:none;user-select:none}.tb-main[data-v-78cbb21c]{flex:1;min-width:0;height:100%;display:flex;align-items:center;gap:8px;margin-right:4px;padding:0 6px 0 0;background:none;border:none;border-radius:var(--radius-md);font:inherit;color:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity var(--duration-fast) var(--ease-out)}.tb-main[data-v-78cbb21c]:active{opacity:.55}.st[data-v-78cbb21c]{flex:none;display:inline-flex;align-items:center}.tb-line[data-v-78cbb21c]{flex:1;min-width:0;display:flex;align-items:baseline;gap:4px;font-size:max(16px,var(--ui-font-size-xl));line-height:1.25;white-space:nowrap}.tb-line .dir[data-v-78cbb21c]{flex:none;max-width:42%;overflow:hidden;text-overflow:ellipsis;color:var(--color-text-faint)}.tb-line .dir.solo[data-v-78cbb21c]{max-width:none;min-width:0;color:var(--color-text);font-weight:var(--weight-semibold)}.tb-line .sl[data-v-78cbb21c]{flex:none;color:var(--color-text-faint)}.tb-line .tt[data-v-78cbb21c]{min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--color-text);font-weight:var(--weight-semibold)}.tb-line .cv[data-v-78cbb21c]{flex:none;align-self:center;color:var(--color-text-faint)}.unread-dot[data-v-78cbb21c]{width:7px;height:7px;border-radius:var(--radius-full);background:var(--color-accent)}.pf-form[data-v-5ad95550]{display:flex;flex-direction:column;gap:var(--space-4);padding:var(--space-4) var(--space-4) var(--space-5);border-top:.5px solid var(--color-line)}.pf-guard[data-v-5ad95550] .ui-banner__text{display:flex;align-items:center;gap:var(--space-2);width:100%}.pf-guard .msg[data-v-5ad95550]{flex:1}.pf-field[data-v-5ad95550]{display:flex;flex-direction:column;gap:6px}.pf-key-wrap[data-v-5ad95550]{position:relative}.pf-key-wrap[data-v-5ad95550] .ui-input{padding-right:calc(var(--icon-button-sm) + var(--space-2))}.pf-key-eye[data-v-5ad95550]{position:absolute;right:var(--space-1);top:50%;transform:translateY(-50%)}.pf-field-label[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted)}.req[data-v-5ad95550]{color:var(--color-danger)}.pf-models[data-v-5ad95550]{display:flex;flex-direction:column;gap:var(--space-2)}.pf-model-grid[data-v-5ad95550]{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,2fr) auto;gap:var(--space-2);align-items:center}.pf-model-head span[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint)}.pf-models-empty[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}.pf-foot[data-v-5ad95550]{display:flex;align-items:center;gap:var(--space-2);padding-top:var(--space-4);border-top:.5px solid var(--color-line)}.pf-foot .spacer[data-v-5ad95550]{flex:1}.pf-confirm-msg[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-danger)}.pf-managed-note[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}@media(max-width:640px){.pf-model-grid[data-v-5ad95550]{grid-template-columns:minmax(0,1fr) auto}}.af[data-v-96ec6ac0]{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-4) var(--space-4) var(--space-5);border-top:.5px solid var(--color-line)}.af-guard[data-v-96ec6ac0] .ui-banner__text{display:flex;align-items:center;gap:var(--space-2);width:100%}.af-guard .msg[data-v-96ec6ac0]{flex:1}.af-catalog[data-v-96ec6ac0]{display:flex;flex-direction:column;gap:var(--space-3)}.af-center[data-v-96ec6ac0]{display:flex;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-4) 0;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.af-error[data-v-96ec6ac0]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-2)}.af-list[data-v-96ec6ac0]{display:flex;flex-direction:column;max-height:320px;overflow-y:auto;border:.5px solid var(--color-line);border-radius:var(--radius-md)}.af-list[data-v-96ec6ac0]>*+*{border-top:.5px solid var(--color-line)}.af-entry[data-v-96ec6ac0]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:34px;padding:var(--space-1) var(--space-3);border:none;background:transparent;text-align:left;font-family:var(--font-ui);color:var(--color-text);cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}.af-entry[data-v-96ec6ac0]:hover:not(:disabled){background:var(--color-hover)}.af-entry[data-v-96ec6ac0]:disabled{cursor:not-allowed;opacity:.55}.af-entry-name[data-v-96ec6ac0]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);font-weight:var(--weight-medium)}.af-entry .grow[data-v-96ec6ac0]{flex:1;min-width:0}.af-entry-count[data-v-96ec6ac0],.af-entry-reason[data-v-96ec6ac0]{flex:none;font-size:var(--text-xs);color:var(--color-text-faint);white-space:nowrap}.af-empty[data-v-96ec6ac0]{padding:var(--space-4);text-align:center;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm)}.af-import[data-v-96ec6ac0],.af-registry[data-v-96ec6ac0]{display:flex;flex-direction:column;gap:var(--space-4)}.af-hint[data-v-96ec6ac0]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}.af-back[data-v-96ec6ac0]{display:inline-flex;align-items:center;gap:var(--space-1);align-self:flex-start;padding:0;border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);cursor:pointer;transition:color var(--duration-fast) var(--ease-out)}.af-back[data-v-96ec6ac0]:hover{color:var(--color-text)}.af-field[data-v-96ec6ac0]{display:flex;flex-direction:column;gap:6px}.af-label[data-v-96ec6ac0]{font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted)}.req[data-v-96ec6ac0]{color:var(--color-danger)}.af-key-wrap[data-v-96ec6ac0]{position:relative}.af-key-wrap[data-v-96ec6ac0] .ui-input{padding-right:calc(var(--icon-button-sm) + var(--space-2))}.af-key-eye[data-v-96ec6ac0]{position:absolute;right:var(--space-1);top:50%;transform:translateY(-50%)}.af-note[data-v-96ec6ac0]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}.af-foot[data-v-96ec6ac0]{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-2);padding-top:var(--space-4);border-top:.5px solid var(--color-line)}.af-manual[data-v-96ec6ac0] .pf-form{padding:0;border-top:none}.mp[data-v-49f293b0]{display:flex;flex-direction:column;gap:var(--space-2);height:100%;min-height:0;padding-top:4px}.mp--sheet[data-v-49f293b0]{height:auto;padding-top:0}.mp--sheet .search-wrap[data-v-49f293b0],.mp--sheet .chip-strip[data-v-49f293b0]{margin:0 16px}.search-wrap[data-v-49f293b0]{position:relative;margin:0 22px;padding-bottom:var(--space-1)}.search-wrap[data-v-49f293b0] .ui-input{padding-right:30px}.search-clear[data-v-49f293b0]{position:absolute;top:0;bottom:var(--space-1);right:var(--space-2);margin-block:auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;border-radius:var(--radius-full);background:var(--color-hover);color:var(--color-text-faint);cursor:pointer;visibility:hidden;opacity:0;transition:opacity var(--duration-fast) var(--ease-out),visibility var(--duration-fast),background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.search-clear.is-on[data-v-49f293b0]{visibility:visible;opacity:1}.search-clear[data-v-49f293b0]:hover{background:var(--color-selected);color:var(--color-text-muted)}.search-clear[data-v-49f293b0]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.chip-strip[data-v-49f293b0]{display:flex;gap:var(--space-1);margin:0 22px;overflow-x:auto;scrollbar-width:none}.chip-strip[data-v-49f293b0]::-webkit-scrollbar{display:none}.chip[data-v-49f293b0]{flex:none;height:28px;padding:0 var(--space-3);border:none;border-radius:var(--radius-full);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base);white-space:nowrap;cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.chip[data-v-49f293b0]:hover{background:var(--color-hover);color:var(--color-text)}.chip.is-active[data-v-49f293b0]{background:var(--color-selected);color:var(--color-text);font-weight:var(--weight-medium)}.chip[data-v-49f293b0]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.model-list[data-v-49f293b0]{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;padding:var(--space-1) var(--space-2)}.model-row[data-v-49f293b0]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);cursor:pointer;color:var(--color-text);min-width:0;transition:background var(--duration-fast) var(--ease-out)}.model-row[data-v-49f293b0]:hover,.model-row.is-selected[data-v-49f293b0]{background:var(--color-hover)}.model-row.is-current[data-v-49f293b0]{background:var(--color-selected)}.model-main[data-v-49f293b0]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.model-name[data-v-49f293b0]{font-family:var(--font-ui);font-size:var(--text-base);line-height:20px;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-row.is-current .model-name[data-v-49f293b0]{font-weight:var(--weight-medium)}.model-meta[data-v-49f293b0]{font-family:var(--font-ui);font-size:var(--text-xs);line-height:18px;color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-side[data-v-49f293b0]{display:flex;align-items:center;gap:var(--space-1);flex:none}.model-check[data-v-49f293b0]{color:var(--color-text)}.model-star[data-v-49f293b0]{color:var(--color-text-faint);visibility:hidden;opacity:0;transition:opacity var(--duration-fast) var(--ease-out),visibility var(--duration-fast)}.model-row:hover .model-star[data-v-49f293b0],.model-row.is-selected .model-star[data-v-49f293b0],.model-star.is-starred[data-v-49f293b0],.model-star[data-v-49f293b0]:focus-visible{visibility:visible;opacity:1}.model-star.is-starred[data-v-49f293b0]{color:var(--star)}@media(hover:none){.model-star[data-v-49f293b0]{visibility:visible;opacity:1}}.state-row[data-v-49f293b0]{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;gap:var(--space-2);color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.state-row.unavail[data-v-49f293b0]{color:var(--color-warning)}.empty[data-v-49f293b0]{flex:1;display:flex;align-items:center;justify-content:center;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.footer-hint[data-v-49f293b0]{flex:none;display:flex;align-items:center;gap:var(--space-1);padding:var(--space-2) var(--space-4);border-top:.5px solid var(--color-line);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint)}.hint-dot[data-v-49f293b0]{margin:0 var(--space-1)}@media(hover:none){.footer-hint[data-v-49f293b0]{display:none}}@media(prefers-reduced-motion:reduce){.chip[data-v-49f293b0],.model-row[data-v-49f293b0],.model-star[data-v-49f293b0],.search-clear[data-v-49f293b0]{transition:none}}.sec[data-v-3cd02b1c]{margin-bottom:var(--space-5)}.sec-title[data-v-3cd02b1c]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);margin:0 0 var(--space-3)}.pu-group[data-v-3cd02b1c]{overflow:hidden;border-radius:var(--radius-xl);background:var(--color-surface)}.pu-row[data-v-3cd02b1c]{display:flex;align-items:center;gap:var(--space-3);min-height:52px;padding:var(--space-3) var(--space-4)}.pu-main[data-v-3cd02b1c]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.pu-label[data-v-3cd02b1c]{font-size:var(--text-sm);color:var(--color-text)}.pu-hint[data-v-3cd02b1c]{font-size:var(--text-xs);color:var(--color-text-faint)}.pp[data-v-f7054f75]{display:flex;flex-direction:column}.pp-head[data-v-f7054f75]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-3)}.pp-title[data-v-f7054f75]{margin:0;font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.pp-loading[data-v-f7054f75]{display:flex;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-4) 0;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.pp-group[data-v-f7054f75]{overflow:hidden;border:.5px solid var(--color-line);border-radius:var(--radius-xl);background:var(--color-surface-raised)}.pp-group[data-v-f7054f75]>*+*{border-top:.5px solid var(--color-line)}.pp-row[data-v-f7054f75]{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:40px;padding:var(--space-2) var(--space-4);border:none;background:transparent;text-align:left;font-family:var(--font-ui);color:var(--color-text);cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}.pp-row[data-v-f7054f75]:hover{background:var(--color-hover)}.pp-item.open>.pp-row[data-v-f7054f75]{background:var(--color-surface-sunken)}.pp-row .grow[data-v-f7054f75]{flex:1;min-width:0;display:flex;align-items:center;gap:var(--space-2)}.pp-id[data-v-f7054f75]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-count[data-v-f7054f75]{flex:none;font-size:var(--text-xs);color:var(--color-text-faint);white-space:nowrap}.pp-chev[data-v-f7054f75]{display:inline-flex;flex:none;color:var(--color-text-faint);transition:transform var(--duration-base) var(--ease-out)}.pp-item.open .pp-chev[data-v-f7054f75]{transform:rotate(90deg)}.pp-add-row[data-v-f7054f75]{gap:var(--space-2);color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium)}.pp-acc[data-v-f7054f75]{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--duration-slow) var(--ease-out)}.pp-item.open>.pp-acc[data-v-f7054f75]{grid-template-rows:1fr}.pp-acc-in[data-v-f7054f75]{overflow:hidden;min-height:0}.pp-item.open .pp-acc-in[data-v-f7054f75]{overflow:visible}.pp-item.flash>.pp-row[data-v-f7054f75]{animation:pp-flash-f7054f75 1.2s var(--ease-out)}@keyframes pp-flash-f7054f75{0%{background:var(--color-accent-soft)}to{background:transparent}}.pp-empty[data-v-f7054f75]{padding:var(--space-5) var(--space-4);color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm);text-align:center}.sm-picker[data-v-ae75986f]{position:relative;width:100%;font-family:var(--font-ui)}.sm-picker__trigger[data-v-ae75986f]{display:flex;align-items:center;gap:var(--space-2);width:100%;height:38px;padding:0 var(--space-3);border:.5px solid var(--color-line-strong);border-radius:var(--radius-md);background:transparent;box-shadow:none;color:var(--color-text);font:inherit;font-size:var(--text-base);line-height:var(--leading-normal);text-align:left;cursor:pointer;transition:border-color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out),background var(--duration-base) var(--ease-out)}.sm-picker__trigger[data-v-ae75986f]:focus-visible,.sm-picker.is-open .sm-picker__trigger[data-v-ae75986f]{outline:none;border-color:var(--color-accent);box-shadow:var(--p-focus-ring)}.sm-picker__value[data-v-ae75986f]{min-width:0;flex:1;display:flex;align-items:center;overflow:hidden;white-space:nowrap}.sm-picker__value-text[data-v-ae75986f]{min-width:0;overflow:hidden;text-overflow:ellipsis}.sm-picker__value.is-placeholder[data-v-ae75986f]{color:var(--color-text-faint)}.sm-picker__chevron[data-v-ae75986f]{flex:none;color:var(--color-text-muted);transition:transform var(--duration-base) var(--ease-out)}.sm-picker.is-open .sm-picker__chevron[data-v-ae75986f]{transform:rotate(180deg)}.sm-picker__menu[data-v-ae75986f]{position:fixed;z-index:var(--z-modal-dropdown);width:252px;max-width:calc(100vw - 64px);border:.5px solid var(--color-line-strong);border-radius:var(--radius-md);background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);box-shadow:var(--shadow-lg)}.sm-picker__models[data-v-ae75986f]{max-height:280px;overflow-y:auto;padding:var(--space-1);border-radius:var(--radius-md)}.sm-picker__flyout[data-v-ae75986f]{position:absolute;width:180px;max-height:280px;overflow-y:auto;padding:var(--space-1);border:.5px solid var(--color-line-strong);border-radius:var(--radius-md);background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);box-shadow:var(--shadow-lg)}.sm-picker__flyout--right[data-v-ae75986f]{left:calc(100% + var(--space-1))}.sm-picker__flyout--left[data-v-ae75986f]{right:calc(100% + var(--space-1))}.sm-picker__group[data-v-ae75986f]{padding:var(--space-2) var(--space-2) var(--space-1);color:var(--color-text-faint);font-size:var(--text-xs);font-weight:var(--weight-medium)}.sm-picker__option[data-v-ae75986f]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:32px;padding:var(--space-1) var(--space-2);border:none;border-radius:var(--radius-select-option);background:transparent;color:var(--color-text);font:inherit;font-size:var(--text-sm);text-align:left;cursor:pointer}.sm-picker__option.is-active[data-v-ae75986f]{background:var(--color-hover);color:var(--color-text-strong)}.sm-picker__option.is-muted[data-v-ae75986f]{color:var(--color-text-muted)}.sm-picker__option-label[data-v-ae75986f]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm-picker__check[data-v-ae75986f]{flex:none;color:transparent}.sm-picker__option.is-selected .sm-picker__check[data-v-ae75986f]{color:var(--color-accent)}.sm-picker__flyout-caret[data-v-ae75986f]{flex:none;margin-left:auto;color:var(--color-text-faint)}.rc-dev[data-v-cfe04ecf]{--sb-inset: var(--space-2);--sb-pad-x: var(--space-4);--sb-gap: var(--space-2);--sb-hover: var(--color-hover);position:relative;padding:0 var(--sb-inset) var(--space-1)}.rc-dev--mobile[data-v-cfe04ecf]{padding:var(--space-1) var(--sb-inset) var(--space-2)}.rc-dev--mobile .rc-dev-trigger[data-v-cfe04ecf]{min-height:44px}.rc-dev-trigger[data-v-cfe04ecf]{display:flex;align-items:center;gap:var(--sb-gap);width:100%;min-width:0;padding:6px calc(var(--sb-pad-x) - var(--sb-inset));border:.5px solid var(--color-line);border-radius:var(--radius-md);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);cursor:pointer;text-align:left}.rc-dev-trigger[data-v-cfe04ecf]:hover,.rc-dev-trigger[aria-expanded=true][data-v-cfe04ecf]{background:var(--sb-hover)}.rc-dev-trigger[data-v-cfe04ecf]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.rc-dev-trigger svg[data-v-cfe04ecf]{flex:none}.rc-dev-name[data-v-cfe04ecf]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rc-dev-chevron[data-v-cfe04ecf]{margin-left:auto;color:var(--color-text-faint)}.rc-dev-menu[data-v-cfe04ecf]{position:fixed;top:0;left:0;z-index:var(--z-dropdown);max-height:calc(100vh - 16px);overflow-y:auto;overflow-x:hidden;user-select:none}.rc-dev-menu--mobile[data-v-cfe04ecf]{position:absolute;top:100%;left:var(--sb-inset);right:var(--sb-inset);bottom:auto;max-height:min(50vh,320px);transform-origin:top center}.rc-dev-menu--mobile .rc-dev-offline[data-v-cfe04ecf]{min-height:44px;padding:12px 14px}.menu-pop-enter-active[data-v-cfe04ecf]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-cfe04ecf]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-cfe04ecf],.menu-pop-leave-to[data-v-cfe04ecf]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, 2px))}.rc-dev-state[data-v-cfe04ecf]{display:flex;align-items:center;justify-content:center;padding:var(--space-3)}.rc-dev-failed[data-v-cfe04ecf]{color:var(--color-text-muted);font-size:var(--text-sm)}.rc-dev-caption[data-v-cfe04ecf]{padding:var(--space-2) var(--menu-item-padding-inline) 2px;color:var(--color-text-faint);font-size:var(--text-xs);font-weight:var(--weight-medium);line-height:var(--leading-tight)}.rc-dev-item-name[data-v-cfe04ecf]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rc-dev-item-status[data-v-cfe04ecf]{display:flex;align-items:center;gap:6px;flex:none;color:var(--color-text-muted)}.rc-dev-item-check[data-v-cfe04ecf]{display:flex;align-items:center;justify-content:center;width:var(--p-ic-md);height:var(--p-ic-md);flex:none}.rc-dev-offline[data-v-cfe04ecf]{padding:var(--menu-item-padding-block) var(--menu-item-padding-inline);border-radius:var(--radius-menu-item);color:var(--color-text-muted);font-size:var(--text-sm);font-weight:var(--weight-option-label);line-height:var(--leading-tight)}.rc-dev-offline.is-current[data-v-cfe04ecf]{background:var(--color-hover);color:var(--color-text)}.rc-dev-offline-row[data-v-cfe04ecf]{display:flex;align-items:center;gap:7px}.rc-dev-offline-row svg[data-v-cfe04ecf]{display:block;width:var(--p-ic-md);height:var(--p-ic-md);flex:none}.user-menu-trigger[data-v-b8060ccc]{display:flex;align-items:center;gap:var(--sb-gap);width:100%;min-width:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);cursor:pointer;text-align:left}.user-menu-trigger[data-v-b8060ccc]:hover,.user-menu-trigger[aria-expanded=true][data-v-b8060ccc]{background:var(--sb-hover)}.user-menu-trigger[data-v-b8060ccc]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}html.macos-desktop .user-menu-trigger[data-v-b8060ccc]{border-bottom-left-radius:var(--radius-window-chip)}.user-menu-trigger svg[data-v-b8060ccc]{flex:none}.user-menu-avatar[data-v-b8060ccc]{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex:none;border-radius:var(--radius-full);background:var(--color-surface-sunken);color:var(--color-text-muted);overflow:hidden}.user-menu-avatar img[data-v-b8060ccc]{width:100%;height:100%;object-fit:cover}.user-menu-name[data-v-b8060ccc]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-menu[data-v-b8060ccc]{position:fixed;top:0;left:0;z-index:var(--z-dropdown);max-height:calc(100vh - 16px);overflow-y:auto;overflow-x:hidden;user-select:none}.user-submenu[data-v-b8060ccc]{position:fixed;top:0;left:0;z-index:var(--z-dropdown);width:max-content;max-height:calc(100vh - 16px);overflow-y:auto;overflow-x:hidden;user-select:none}.menu-pop-enter-active[data-v-b8060ccc]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-b8060ccc]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-b8060ccc],.menu-pop-leave-to[data-v-b8060ccc]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, 2px))}.user-menu-usage[data-v-b8060ccc]{display:flex;flex-direction:column;gap:calc(var(--menu-item-padding-block) * 2);padding:var(--menu-item-padding-block) var(--menu-item-padding-inline)}.user-menu-usage-state[data-v-b8060ccc]{display:flex;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-1) 0;color:var(--color-text-muted);font-size:var(--text-sm)}.user-menu-usage-error[data-v-b8060ccc]{flex:1;min-width:0}.user-menu-usage-empty[data-v-b8060ccc]{color:var(--color-text-faint)}.user-menu-usage-row[data-v-b8060ccc]{display:grid;grid-template-columns:auto 1fr;column-gap:var(--space-3);row-gap:var(--space-05)}.user-menu-usage-label[data-v-b8060ccc]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-sm);line-height:var(--leading-tight);color:var(--color-text)}.user-menu-usage-hint[data-v-b8060ccc]{grid-column:1 / -1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-text-faint)}.user-menu-usage-value[data-v-b8060ccc]{justify-self:end;font-size:var(--text-sm);line-height:var(--leading-tight);font-weight:var(--weight-medium);color:var(--color-text);font-variant-numeric:tabular-nums;white-space:nowrap}.user-menu-usage-value.sev-warn[data-v-b8060ccc]{color:var(--color-warning)}.user-menu-usage-value.sev-danger[data-v-b8060ccc]{color:var(--color-danger)}.user-menu-item-label[data-v-b8060ccc]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-menu-login-label[data-v-b8060ccc]{color:var(--color-accent)}.user-menu-row-value[data-v-b8060ccc]{flex:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);color:var(--color-text-faint)}.side[data-v-a5d7cf12]{background:var(--color-sidebar-bg);display:flex;flex-direction:row;justify-content:flex-end;overflow:hidden;min-width:0;height:100%;transition:width .28s cubic-bezier(.4,0,.2,1),visibility .28s;--sb-inset: var(--space-2);--sb-pad-x: var(--space-4);--sb-gutter: 16px;--sb-gap: var(--space-2);--sb-action-inset: calc((max(var(--ui-font-size-sm) * var(--leading-tight), var(--p-ic-md)) + 2 * var(--space-2) - var(--icon-button-sm)) / 2);--sb-hover: var(--color-hover);--sb-selected: color-mix(in srgb, var(--color-selected) 75%, transparent)}.side.no-anim[data-v-a5d7cf12]{transition:none}.side.collapsed[data-v-a5d7cf12]{visibility:hidden}.col[data-v-a5d7cf12]{flex:none;min-width:0;display:flex;flex-direction:column;min-height:0;width:100%;box-sizing:border-box;border-right:.5px solid var(--line);container-type:inline-size;container-name:sidebar-col;position:relative}.ch[data-v-a5d7cf12]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:var(--space-3);min-height:calc(26px + 2 * var(--space-3));width:100%;box-sizing:border-box}.side.macos-desktop .ch[data-v-a5d7cf12]{padding-left:80px;-webkit-app-region:drag}.side.macos-desktop .ch-brand[data-v-a5d7cf12]{display:none}.ch-logo[data-v-a5d7cf12]{height:22px;width:32px;flex:none;display:block;cursor:pointer;user-select:none;touch-action:none;transition:transform .18s ease}.ch-logo[data-v-a5d7cf12]:hover{transform:scale(1.08)}.ch-brand[data-v-a5d7cf12]{display:flex;align-items:center;gap:8px;min-width:0;flex:1;user-select:none;touch-action:none}.ch-tail[data-v-a5d7cf12]{display:flex;align-items:center;gap:var(--space-2);flex:none;min-width:0;margin-left:auto}.ch-name[data-v-a5d7cf12]{font-size:var(--ui-font-size);font-weight:500;line-height:22px;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@container sidebar-col (max-width: 250px){.ch-name[data-v-a5d7cf12]{display:none}}.sidebar-actions[data-v-a5d7cf12]{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 var(--space-2);padding:0 var(--sb-inset) var(--space-1);position:relative;z-index:1;background:var(--color-sidebar-bg)}.sessions-head[data-v-a5d7cf12]{position:relative;z-index:1;padding:var(--space-3) var(--sb-inset) 0;border-bottom:.5px solid transparent;transition:border-color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out)}.sessions-head[data-v-a5d7cf12]:after,.side-footer[data-v-a5d7cf12]:before{content:"";position:absolute;left:0;right:0;height:var(--p-sidebar-seam-h);pointer-events:none;opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.sessions-head[data-v-a5d7cf12]:after{top:100%;background:linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.5%,transparent),transparent 35%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1%,transparent),transparent 65%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) .75%,transparent),transparent);transition-duration:var(--duration-slow)}.sessions-head--scrolled[data-v-a5d7cf12]{border-bottom-color:var(--line)}.sessions-head--scrolled[data-v-a5d7cf12]:after{opacity:1}.btn-new-chat[data-v-a5d7cf12]{grid-column:1 / -1;display:flex;align-items:center;gap:var(--sb-gap);width:100%;min-width:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);cursor:pointer;text-align:left}.sidebar-actions--has-workspace-action .btn-new-chat[data-v-a5d7cf12]{grid-column:1}.btn-new-chat[data-v-a5d7cf12]:hover{background:var(--sb-hover)}.btn-new-chat[data-v-a5d7cf12]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.btn-new-chat svg[data-v-a5d7cf12]{flex:none}.btn-new-chat span[data-v-a5d7cf12]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn-new-chat[data-v-a5d7cf12] .ui-kbd{margin-left:auto}.btn-new-chat[data-v-a5d7cf12] .ui-kbd,.search[data-v-a5d7cf12] .ui-kbd{opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.btn-new-chat[data-v-a5d7cf12]:hover .ui-kbd,.btn-new-chat[data-v-a5d7cf12]:focus-visible .ui-kbd,.search[data-v-a5d7cf12]:hover .ui-kbd,.search[data-v-a5d7cf12]:focus-visible .ui-kbd{opacity:1}.search[data-v-a5d7cf12]{grid-column:1 / -1;display:flex;align-items:center;gap:var(--sb-gap);width:100%;margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font:inherit;text-align:left;cursor:pointer}.search[data-v-a5d7cf12]:hover{background:var(--sb-hover)}.search[data-v-a5d7cf12]:focus-visible{background:var(--sb-hover);color:var(--color-text);outline:2px solid var(--color-accent-bd);outline-offset:-2px}.search-icon[data-v-a5d7cf12]{flex:none;transform:translateY(-.5px)}.search-input[data-v-a5d7cf12]{flex:1;min-width:0;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-tabs[data-v-a5d7cf12]{padding:var(--space-2) var(--sb-inset) 0}.status-seg[data-v-a5d7cf12]{width:100%;display:flex}.status-seg[data-v-a5d7cf12] .ui-seg__item{flex:1;min-width:0;justify-content:center;padding:0 var(--space-1);overflow:hidden}.ws-dir[data-v-a5d7cf12]{display:block;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border-radius:var(--radius-sm);cursor:pointer;position:relative;user-select:none}.ws-dir[data-v-a5d7cf12]:hover{background:var(--sb-hover, var(--color-hover))}.ws-dir.on[data-v-a5d7cf12]{background:var(--sb-selected, var(--color-selected))}.ws-dir+.ws-dir[data-v-a5d7cf12]{margin-top:var(--space-05)}.ws-dir-row[data-v-a5d7cf12]{display:flex;align-items:center;gap:var(--sb-gap);min-width:0}.ws-dir-icon[data-v-a5d7cf12]{flex:none;color:var(--color-text-muted)}.ws-dir-name[data-v-a5d7cf12]{flex:1;min-width:0;font-size:var(--ui-font-size-sm);font-weight:var(--weight-caption);line-height:var(--leading-tight);color:var(--color-text);overflow:hidden;white-space:nowrap;text-overflow:clip;-webkit-mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent);mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent)}.ws-dir-act[data-v-a5d7cf12]{position:absolute;top:0;bottom:0;right:var(--sb-action-inset);display:inline-flex;align-items:center;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--ease-out),visibility 0s linear var(--duration-fast)}.ws-dir-rename[data-v-a5d7cf12]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-caption);color:var(--color-text);background:var(--color-bg);border:.5px solid var(--color-accent);border-radius:var(--radius-sm);padding:2px 5px;outline:none}.ws-dir:hover .ws-dir-act[data-v-a5d7cf12],.ws-dir:focus-within .ws-dir-act[data-v-a5d7cf12]{opacity:1;visibility:visible;transition:opacity var(--duration-fast) var(--ease-out)}.ws-dir-sub[data-v-a5d7cf12]{margin:var(--space-1) 0 0;color:var(--color-text-faint);font-size:var(--text-xs);line-height:var(--leading-tight);overflow:hidden;white-space:nowrap;text-overflow:clip;-webkit-mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent);mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent)}.ws-dir:hover .ws-dir-name[data-v-a5d7cf12],.ws-dir:focus-within .ws-dir-name[data-v-a5d7cf12],.ws-dir:hover .ws-dir-sub[data-v-a5d7cf12],.ws-dir:focus-within .ws-dir-sub[data-v-a5d7cf12]{margin-right:calc(var(--icon-button-sm) + var(--space-2))}.done-gh[data-v-a5d7cf12]{display:flex;align-items:center;gap:var(--sb-gap);padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border-radius:var(--radius-sm);font-family:var(--font-ui);color:var(--color-text);user-select:none;position:relative;cursor:pointer}.done-gh[data-v-a5d7cf12]:hover{background:var(--sb-hover, var(--color-hover))}.done-gh-folder[data-v-a5d7cf12]{flex:none;color:var(--color-text-muted)}.done-gh-name[data-v-a5d7cf12]{flex:1;min-width:0;font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);color:var(--color-text-muted);overflow:hidden;white-space:nowrap;text-overflow:clip;-webkit-mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent);mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent)}.done-gh-count[data-v-a5d7cf12]{flex:none;color:var(--color-text-faint);font-size:var(--text-xs);font-variant-numeric:tabular-nums}.done-gh-act[data-v-a5d7cf12]{position:absolute;top:0;bottom:0;right:var(--sb-action-inset);display:inline-flex;align-items:center;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--ease-out),visibility 0s linear var(--duration-fast)}.done-gh:hover .done-gh-act[data-v-a5d7cf12],.done-gh:focus-within .done-gh-act[data-v-a5d7cf12]{opacity:1;visibility:visible;transition:opacity var(--duration-fast) var(--ease-out)}.done-gh:hover .done-gh-count[data-v-a5d7cf12],.done-gh:focus-within .done-gh-count[data-v-a5d7cf12]{opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--ease-out),visibility 0s linear var(--duration-fast)}.sessions[data-v-a5d7cf12]{flex:1;overflow-y:auto;padding:0 var(--sb-inset) var(--space-3);min-height:0;--overlay-scrollbar-thumb-min: var(--space-6);scrollbar-width:none}.sessions[data-v-a5d7cf12]::-webkit-scrollbar{display:none}.sessions-thumb[data-v-a5d7cf12]{position:absolute;right:0;width:var(--space-1);border-radius:var(--radius-full);background:color-mix(in srgb,var(--color-text) 12%,transparent);opacity:0;pointer-events:none;transition:opacity var(--duration-base) var(--ease-out),background var(--duration-base) var(--ease-out);z-index:var(--z-raised);touch-action:none}.sessions-thumb.visible[data-v-a5d7cf12]{opacity:1;pointer-events:auto}.sessions-thumb.visible[data-v-a5d7cf12]:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}.sessions-thumb[data-v-a5d7cf12]:before{content:"";position:absolute;top:0;bottom:0;left:calc(-1 * var(--space-2));right:0}.side-footer[data-v-a5d7cf12]{flex:none;position:relative;z-index:1;display:flex;align-items:center;gap:var(--space-1);padding:var(--space-2) var(--sb-inset);border-top:.5px solid var(--line);background:var(--color-sidebar-bg)}.side-footer-account[data-v-a5d7cf12]{flex:1 1 auto;min-width:0}.side-footer-settings[data-v-a5d7cf12]{flex:none}.side-footer[data-v-a5d7cf12]:before{bottom:100%;background:linear-gradient(to top,color-mix(in srgb,var(--color-text) 1.5%,transparent),transparent 35%),linear-gradient(to top,color-mix(in srgb,var(--color-text) 1%,transparent),transparent 65%),linear-gradient(to top,color-mix(in srgb,var(--color-text) .75%,transparent),transparent);transition-duration:var(--duration-slow)}.side-footer--shadowed[data-v-a5d7cf12]:before{opacity:1}.side-section-label[data-v-a5d7cf12]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 var(--sb-action-inset) var(--space-1) var(--space-2);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-section-label);text-transform:uppercase;color:var(--faint);user-select:none}.side-section-title[data-v-a5d7cf12]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sessions-head .pinned+.side-section-label[data-v-a5d7cf12]{margin-top:var(--space-1)}.side-section-toggle[data-v-a5d7cf12]{color:var(--faint)}.side-section-toggle[data-v-a5d7cf12]:hover{color:var(--dim)}.side-section-toggle svg[data-v-a5d7cf12]{width:13px;height:13px}.side-section-actions[data-v-a5d7cf12]{display:flex;align-items:center;gap:2px}.ws-drop-target.drop-before[data-v-a5d7cf12]{box-shadow:inset 0 2px 0 var(--color-accent)}.ws-drop-target.drop-after[data-v-a5d7cf12]{box-shadow:inset 0 -2px 0 var(--color-accent)}.ws-drop-target.ws-locate-flash[data-v-a5d7cf12] .gh{isolation:isolate}.ws-drop-target.ws-locate-flash[data-v-a5d7cf12] .gh:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:var(--radius-sm);background:var(--color-accent-soft);pointer-events:none;animation:ws-locate-fade-a5d7cf12 var(--duration-flash) var(--ease-out) forwards}@keyframes ws-locate-fade-a5d7cf12{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.ws-drop-target.ws-locate-flash[data-v-a5d7cf12] .gh:before{animation:none}}.sessions.pinned-drag-active[data-v-a5d7cf12]{box-shadow:inset 0 0 0 1px var(--color-accent)}.sessions.flat-pinned-drop-hover[data-v-a5d7cf12]{box-shadow:inset 0 0 0 2px var(--color-accent)}.show-more-row[data-v-a5d7cf12]{display:flex;align-items:center;justify-content:center}.show-more[data-v-a5d7cf12]{display:flex;align-items:center;justify-content:center;gap:var(--space-1);margin:0;padding:6px var(--space-3);min-width:0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);cursor:pointer}.show-more[data-v-a5d7cf12]:hover{background:var(--sb-hover, var(--color-hover))}.show-more[data-v-a5d7cf12]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.show-more-label[data-v-a5d7cf12]{flex:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.folder-drop-overlay[data-v-a5d7cf12]{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;padding:var(--space-3);box-sizing:border-box;background:color-mix(in srgb,var(--color-sidebar-bg) 72%,transparent);pointer-events:none;opacity:0;visibility:hidden;transition:opacity var(--duration-base) ease,visibility var(--duration-base)}.folder-drop-overlay.show[data-v-a5d7cf12]{opacity:1;visibility:visible}.folder-drop-card[data-v-a5d7cf12]{display:flex;align-items:center;gap:var(--space-3);max-width:100%;box-sizing:border-box;padding:var(--space-4);border-radius:var(--radius-lg);border:.5px dashed var(--color-accent);background:var(--color-bg);color:var(--color-accent);font-size:var(--ui-font-size-lg);font-weight:var(--weight-medium);box-shadow:var(--shadow-md)}.folder-drop-card svg[data-v-a5d7cf12]{flex:none}.folder-drop-card span[data-v-a5d7cf12]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty[data-v-a5d7cf12]{padding:var(--space-6) var(--space-3);text-align:center;color:var(--faint);font-size:calc(var(--ui-font-size) - 3px);line-height:1.6}.ws-menu[data-v-a5d7cf12],.gh-menu[data-v-a5d7cf12],.view-menu[data-v-a5d7cf12]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.view-menu-label[data-v-a5d7cf12]{padding:var(--space-1) var(--space-2) var(--space-05);font-size:var(--text-xs);color:var(--faint);user-select:none}.view-menu-check[data-v-a5d7cf12]{margin-left:auto;display:inline-flex}.menu-pop-enter-active[data-v-a5d7cf12]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-a5d7cf12]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-a5d7cf12],.menu-pop-leave-to[data-v-a5d7cf12]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}[data-v-a5d7cf12] .workspace-rename-item{font-size:var(--text-xs);font-weight:var(--weight-option-label)}.section-menu-check[data-v-a5d7cf12]{display:inline-flex;flex:none;width:14px}.chat-header[data-v-927e8637]{flex:none;display:flex;align-items:center;gap:14px;height:var(--panel-head-h, 48px);padding:0 16px;border-bottom:.5px solid var(--color-line);background:var(--color-bg);font-family:var(--font-ui);min-width:0;user-select:none;container-type:inline-size}.chat-header.macos-desktop[data-v-927e8637]{-webkit-app-region:drag}.chat-header.macos-desktop button[data-v-927e8637],.chat-header.macos-desktop input[data-v-927e8637]{-webkit-app-region:no-drag}.app:not(.mobile) .chat-header{transition:padding-left .28s cubic-bezier(.4,0,.2,1)}.app.sidebar-collapsed .chat-header{padding-left:78px}.app.sidebar-collapsed.macos-desktop .chat-header{padding-left:146px}.ch-id[data-v-927e8637]{display:flex;align-items:center;gap:6px;min-width:0;flex:none;max-width:46%}.ch-ws[data-v-927e8637]{color:var(--color-text-muted);font-size:var(--text-base);font-weight:var(--weight-medium);flex:none}.ch-sep[data-v-927e8637]{color:var(--color-text-faint);flex:none}.ch-ses[data-v-927e8637]{color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ch-rename[data-v-927e8637]{flex:1;min-width:0;font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);background:var(--color-bg);border:.5px solid var(--color-accent);border-radius:var(--radius-xs);padding:2px 5px;outline:none;user-select:text}.ch-git[data-v-927e8637]{display:flex;align-items:center;gap:4px;border:none;background:transparent;padding:0;color:var(--muted);font-family:var(--font-ui);font-size:calc(var(--ui-font-size) - 2px);flex:0 1 auto;max-width:none;min-width:0;cursor:pointer}.ch-git:hover .ch-branch[data-v-927e8637]{color:var(--color-text)}.ch-branch-icon[data-v-927e8637]{flex:none;color:var(--color-text-muted)}.ch-branch[data-v-927e8637]{color:var(--dim);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:4px}.ch-detached[data-v-927e8637]{color:var(--muted);font-style:italic}.ch-pill[data-v-927e8637]{display:inline-flex;align-items:center;gap:3px;padding:1px 5px;border-radius:999px;background:var(--panel);border:.5px solid var(--line);font-size:calc(var(--ui-font-size) - 3px)}.ch-sync-pill[data-v-927e8637]{border-color:var(--line)}.ch-diff-pill[data-v-927e8637]{border-color:color-mix(in srgb,var(--color-success) 20%,var(--line));font-variant-numeric:tabular-nums}.ch-ahead[data-v-927e8637]{color:var(--color-warning);flex:none}.ch-behind[data-v-927e8637]{color:var(--color-accent-hover);flex:none}.ch-add[data-v-927e8637]{color:var(--color-success);flex:none}.ch-del[data-v-927e8637]{color:var(--color-danger);flex:none}.ch-spacer[data-v-927e8637]{flex:1;min-width:0}@container (max-width: 720px){.ch-ws[data-v-927e8637],.ch-sep[data-v-927e8637]{display:none}.ch-id[data-v-927e8637]{flex:0 1 auto;max-width:none}}.chat-header .ch-act-more[data-v-927e8637]{width:24px;height:24px;border-radius:var(--radius-sm)}.chat-header .ch-act-more[data-v-927e8637] svg{width:14px;height:14px}.ch-act-more.open[data-v-927e8637]{background:var(--color-well);color:var(--color-text)}.chat-header .ch-panel[data-v-927e8637]{width:var(--icon-button-sm);height:var(--icon-button-sm);border-radius:var(--radius-sm)}.chat-header .ch-panel[data-v-927e8637] svg{width:var(--p-ic-md);height:var(--p-ic-md)}.ch-dev[data-v-927e8637]{display:inline-flex;align-items:center;height:22px;padding:0 9px;flex:none;border:.5px solid var(--color-warning-bd);border-radius:var(--radius-full);background:var(--color-warning-soft);color:var(--color-warning);font-size:var(--text-xs);font-weight:500}.ch-pr[data-v-927e8637]{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 9px;flex:none;border:.5px solid var(--color-line);border-radius:var(--radius-full);background:var(--color-well);color:var(--color-text-muted);font-size:var(--text-xs);font-weight:500;cursor:pointer}.ch-pr svg[data-v-927e8637]{flex:none}.ch-pr.pr-open[data-v-927e8637]{color:var(--color-success);border-color:var(--color-success-bd);background:var(--color-success-soft)}.ch-pr.pr-merged[data-v-927e8637]{color:var(--color-done);border-color:var(--color-done-bd);background:var(--color-done-soft)}.ch-pr.pr-closed[data-v-927e8637]{color:var(--color-danger);border-color:var(--color-danger-bd);background:var(--color-danger-soft)}.ch-pr.pr-draft[data-v-927e8637],.ch-pr.pr-unknown[data-v-927e8637]{color:var(--color-text-muted);border-color:var(--color-line-strong);background:var(--color-well)}.ch-pr[data-v-927e8637]:hover{border-color:var(--color-line-strong)}.ch-done-pill[data-v-927e8637]{cursor:default}.ch-done-pill[data-v-927e8637]:hover{border-color:var(--color-done-bd)}@container (max-width: 980px){.ch-sync-pill[data-v-927e8637],.ch-diff-pill[data-v-927e8637]{display:none}}@container (max-width: 860px){.ch-git[data-v-927e8637],.ch-pr[data-v-927e8637]{display:none}}.ch-menu[data-v-927e8637]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.menu-pop-enter-active[data-v-927e8637]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-927e8637]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-927e8637],.menu-pop-leave-to[data-v-927e8637]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}@media(max-width:980px){.ch-act-label[data-v-927e8637]{display:none}}@media(max-width:640px){.chat-header[data-v-927e8637]{display:none}}.slash-menu[data-menu-frame][data-v-62eaf4c2]{position:absolute;bottom:calc(100% + var(--space-2));left:0;right:0;padding:var(--space-1-5) var(--space-3);background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);z-index:var(--z-dropdown)}.slash-menu.is-sheet[data-menu-frame][data-v-62eaf4c2]{position:static;padding:0;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;border:none;border-radius:0;box-shadow:none;z-index:auto}.slash-menu.is-sheet .slash-scroll[data-v-62eaf4c2]{margin:0;padding:var(--space-1) var(--space-2)}.slash-menu.is-sheet .slash-item[data-v-62eaf4c2]{margin:0;padding-left:var(--space-2);padding-right:var(--space-2)}.slash-scroll[data-v-62eaf4c2]{max-height:var(--p-slash-menu-h);margin:0 calc(-1 * var(--menu-row-hug));padding:0 var(--menu-row-hug);overflow-y:auto;scrollbar-width:none}.slash-scroll[data-v-62eaf4c2]::-webkit-scrollbar{display:none}.scroll-thumb[data-v-62eaf4c2]{position:absolute;right:var(--menu-scrollbar-edge);width:var(--menu-scrollbar-width);border-radius:var(--radius-full);background:var(--color-menu-scrollbar);transition:background var(--duration-base) var(--ease-out);cursor:default;touch-action:none;z-index:var(--z-raised)}.slash-menu:hover .scroll-thumb[data-v-62eaf4c2]{background:var(--color-menu-scrollbar-hover)}.scroll-thumb[data-v-62eaf4c2]:before{content:"";position:absolute;top:0;bottom:0;left:calc(-1 * var(--space-2));right:0}.slash-item[data-v-62eaf4c2]{display:flex;align-items:baseline;gap:var(--space-2);margin:0 calc(-1 * var(--menu-row-hug));padding:var(--menu-row-padding-block) var(--menu-row-padding-inline);cursor:pointer;font-family:var(--font-ui);font-size:var(--ui-b2);border-radius:var(--radius-menu-row)}.slash-item[data-v-62eaf4c2]:hover{background:var(--color-hover)}.slash-item.active[data-v-62eaf4c2]{background:var(--color-selected)}.slash-item+.slash-item[data-v-62eaf4c2]{margin-top:var(--menu-rows-seam)}.slash-name[data-v-62eaf4c2]{flex:none;max-width:60%;color:var(--color-text);font-weight:500;min-width:0;line-height:var(--leading-normal);overflow-wrap:anywhere}.slash-match[data-v-62eaf4c2]{font-weight:var(--weight-semibold)}.slash-empty[data-v-62eaf4c2]{padding:var(--space-1-5) var(--space-1);color:var(--color-text-muted)}@media(hover:none){.slash-item[data-v-62eaf4c2]{min-height:var(--touch-target-min);padding-top:var(--menu-row-touch-padding-block);padding-bottom:var(--menu-row-touch-padding-block)}}.slash-desc[data-v-62eaf4c2]{flex:1;min-width:0;color:var(--color-text-muted);font-size:var(--ui-b2);font-weight:var(--weight-regular);line-height:var(--leading-normal);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slash-desc-match[data-v-62eaf4c2]{font-weight:var(--weight-semibold)}@media(max-width:520px){.slash-item[data-v-62eaf4c2]{flex-direction:column;align-items:stretch;gap:var(--space-05)}.slash-name[data-v-62eaf4c2]{max-width:none}}.mention-menu[data-menu-frame][data-v-7c3431cd]{position:absolute;bottom:calc(100% + var(--space-2));left:0;right:0;padding:var(--space-1-5) var(--space-3);background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);z-index:var(--z-dropdown)}.mention-menu.is-sheet[data-menu-frame][data-v-7c3431cd]{position:static;padding:0;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;border:none;border-radius:0;box-shadow:none;z-index:auto}.mention-menu.is-sheet .mention-scroll[data-v-7c3431cd]{margin:0;padding:var(--space-1) var(--space-2)}.mention-menu.is-sheet .mention-item[data-v-7c3431cd]{margin:0;padding-left:var(--space-2);padding-right:var(--space-2)}.mention-menu.is-sheet .mention-state[data-v-7c3431cd]{padding-left:var(--space-4)}.mention-scroll[data-v-7c3431cd]{max-height:var(--p-mention-menu-h);margin:0 calc(-1 * var(--menu-row-hug));padding:0 var(--menu-row-hug);overflow-y:auto;scrollbar-width:none}.mention-scroll[data-v-7c3431cd]::-webkit-scrollbar{display:none}.scroll-thumb[data-v-7c3431cd]{position:absolute;right:var(--menu-scrollbar-edge);width:var(--menu-scrollbar-width);border-radius:var(--radius-full);background:var(--color-menu-scrollbar);transition:background var(--duration-base) var(--ease-out);cursor:default;touch-action:none;z-index:var(--z-raised)}.mention-menu:hover .scroll-thumb[data-v-7c3431cd]{background:var(--color-menu-scrollbar-hover)}.scroll-thumb[data-v-7c3431cd]:before{content:"";position:absolute;top:0;bottom:0;left:calc(-1 * var(--space-2));right:0}.mention-state[data-v-7c3431cd]{padding:var(--space-2) var(--space-1);font-family:var(--font-ui);font-size:var(--ui-b2)}.mention-spin[data-v-7c3431cd]{position:absolute;top:var(--space-2);right:var(--space-3);color:var(--color-text-muted);z-index:var(--z-raised)}.dim[data-v-7c3431cd]{color:var(--color-text-muted)}.mention-item[data-v-7c3431cd]{display:flex;align-items:center;gap:var(--menu-row-gap-icon);margin:0 calc(-1 * var(--menu-row-hug));padding:var(--menu-row-padding-block) var(--space-2);cursor:pointer;font-family:var(--font-ui);font-size:var(--text-sm);border-radius:var(--radius-menu-row)}.mention-icon[data-v-7c3431cd]{display:inline-flex;align-items:center;justify-content:center;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--muted);flex-shrink:0}.mention-icon[data-v-7c3431cd] svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block}.mention-item:hover .mention-icon[data-v-7c3431cd],.mention-item.active .mention-icon[data-v-7c3431cd]{color:var(--color-text-strong)}.mention-item[data-v-7c3431cd]:hover{background:var(--color-hover)}.mention-item:hover .mention-name[data-v-7c3431cd],.mention-item.active .mention-name[data-v-7c3431cd]{color:var(--color-text-strong)}.mention-item.active[data-v-7c3431cd]{background:var(--color-selected)}.mention-item+.mention-item[data-v-7c3431cd]{margin-top:var(--menu-rows-seam)}.mention-item[data-v-7c3431cd]{transition:opacity var(--duration-slow) var(--ease-out)}.mention-item.stale[data-v-7c3431cd]{opacity:var(--opacity-stale)}@media(hover:none){.mention-item[data-v-7c3431cd]{min-height:var(--touch-target-min);padding-top:var(--menu-row-touch-padding-block);padding-bottom:var(--menu-row-touch-padding-block)}}.mention-name[data-v-7c3431cd]{color:var(--color-text);font-weight:500;flex-shrink:0}.mention-name .mention-hit[data-v-7c3431cd]{color:var(--color-text-strong);font-weight:var(--weight-semibold)}.mention-meta .mention-hit[data-v-7c3431cd]{color:var(--color-text)}.mention-meta[data-v-7c3431cd]{color:var(--color-text-muted);font-size:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.composer[data-v-d1a137e8]{padding:7px var(--dock-inline-right, 16px) 12px var(--dock-inline-left, 16px);background:transparent;transition:background .12s}.composer.drag-over[data-v-d1a137e8]{background:var(--color-accent-soft)}.drop-overlay[data-v-d1a137e8]{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--color-bg) 72%,transparent);pointer-events:none;opacity:0;visibility:hidden;transition:opacity var(--duration-base) ease,visibility var(--duration-base)}.drop-overlay.show[data-v-d1a137e8]{opacity:1;visibility:visible}.drop-card[data-v-d1a137e8]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4) var(--space-6);border-radius:var(--radius-lg);border:.5px dashed var(--color-accent);background:var(--color-bg);color:var(--color-accent);font-size:var(--ui-font-size-lg);font-weight:var(--weight-medium);box-shadow:var(--shadow-md)}.composer-card[data-v-d1a137e8]{--composer-control-size: var(--space-8);--composer-send-size: var(--composer-control-size);--composer-control-inset: var(--space-2);--composer-valve-floor: 4em;--composer-valve-expand-margin: 3.4em;position:relative;border:.5px solid var(--color-composer-line);border-radius:var(--radius-composer);corner-shape:var(--corner-shape-composer);background:var(--color-composer-bg);box-shadow:var(--shadow-input);user-select:none;container-type:inline-size}.composer-card[data-v-d1a137e8]:after{content:"";position:absolute;inset:0;border:inherit;border-color:var(--color-composer-focus-line);border-radius:var(--radius-composer);corner-shape:var(--corner-shape-composer);opacity:0;pointer-events:none;transition:opacity var(--duration-slow) var(--ease-in-out)}.composer-card[data-v-d1a137e8]:focus-within:after{opacity:1}.file-input-hidden[data-v-d1a137e8]{display:none}.cin-wrap[data-v-d1a137e8]{position:relative;padding:14px 16px 8px}.input-row[data-v-d1a137e8]{position:relative;display:flex;align-items:flex-start;gap:var(--space-2)}.expand-btn[data-v-d1a137e8]{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:none;border-radius:6px;background:transparent;color:var(--dim);cursor:pointer;padding:0;transition:background .12s,color .12s}.expand-btn[data-v-d1a137e8]:hover{background:var(--panel2);color:var(--color-text)}.expand-btn[data-v-d1a137e8]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.ph[data-v-d1a137e8]{color:var(--faint);caret-color:var(--color-text);flex:1;border:none;outline:none;font-family:var(--font-ui);font-size:var(--content-font-size);text-autospace:normal;background:transparent;min-height:36px;max-height:calc(var(--app-height, 100dvh) / 4);overflow-y:auto;scrollbar-width:none;line-height:1.5;margin-bottom:6px;user-select:text}.ph[data-v-d1a137e8]::-webkit-scrollbar{display:none}.ph[data-v-d1a137e8]:not([data-empty=true]){color:var(--color-text)}.ph[data-v-d1a137e8] .ProseMirror{outline:none;white-space:pre-wrap;overflow-wrap:break-word;min-height:inherit}.ph[data-v-d1a137e8] .ProseMirror p{margin:0}.ph[data-v-d1a137e8] .ProseMirror-trailingBreak:not(:only-child){display:none}.ph[data-v-d1a137e8] .mention-pill.ProseMirror-selectednode{color:var(--color-text)}.ph[data-v-d1a137e8] .wm-pill{display:inline-flex;align-items:center;gap:var(--space-1);vertical-align:top;height:calc(var(--content-font-size) * 1.5);margin-left:calc(-1 * var(--space-05));margin-right:var(--space-1-5);padding:0 calc((var(--content-font-size) * 1.5 - var(--wm-x-size)) / 2) 0 var(--space-2);border:none;border-radius:var(--radius-full);background:var(--color-selected);color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:calc(var(--content-font-size) * 1.5);white-space:nowrap;user-select:none}.ph[data-v-d1a137e8] .wm-icon{display:inline-flex}.ph[data-v-d1a137e8] .wm-x{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--wm-x-size);height:var(--wm-x-size);padding:0;border:.5px solid transparent;border-radius:var(--radius-full);background:transparent;color:var(--color-text-muted);cursor:pointer;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.ph[data-v-d1a137e8] .wm-x:hover{background:var(--color-hover);color:var(--color-text)}.ph[data-v-d1a137e8] .wm-x:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ph[data-v-d1a137e8] .wm-x:before{content:"";position:absolute;inset:calc(-1 * var(--wm-x-ring))}.ph[data-wm=true][data-v-d1a137e8] .ProseMirror{padding-top:var(--space-1);padding-left:var(--space-05)}.ph[data-v-d1a137e8] .wm-placeholder{color:var(--muted);pointer-events:none;user-select:none}.ph[data-v-d1a137e8] .wm-placeholder kbd{display:inline-flex;align-items:center;justify-content:center;min-width:var(--kbd-min-width);height:var(--kbd-height);padding:0 var(--kbd-padding-x);border:var(--p-hairline) solid var(--color-line);border-radius:var(--radius-xs);background:transparent;color:inherit;font-family:var(--font-kbd);font-size:var(--kbd-font-size);line-height:var(--leading-solid)}.composer.expanded .ph[data-v-d1a137e8]{min-height:calc(var(--app-height, 100dvh) * .7);max-height:calc(var(--app-height, 100dvh) * .7)}.compact-chip[data-v-d1a137e8]{height:var(--composer-control-size);padding:0 var(--space-2);border:.5px solid transparent;border-radius:var(--radius-full);background:transparent;color:var(--color-warning);font-family:var(--mono);font-size:var(--ui-font-size);cursor:pointer;line-height:1;flex:none;transition:background var(--duration-base) var(--ease-out)}.compact-chip[data-v-d1a137e8]:hover{background:var(--color-hover)}.compact-chip.gone[data-v-d1a137e8],.model-pill.model-gone[data-v-d1a137e8]{display:none}.composer-attach[data-v-d1a137e8]{width:var(--composer-control-size);height:var(--composer-control-size);border-radius:var(--radius-full);flex:none}.add-menu[data-v-d1a137e8]{position:absolute;bottom:calc(100% + var(--space-2));left:0;right:0;z-index:var(--z-dropdown);background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);padding:var(--space-1-5) var(--space-3);display:flex;flex-direction:column;gap:var(--menu-rows-seam);font-family:var(--font-ui);transform-origin:bottom left}.am-scroll[data-v-d1a137e8]{max-height:var(--p-add-menu-h);margin:0 calc(-1 * var(--menu-row-hug));padding:0 var(--menu-row-hug);overflow-y:auto;scrollbar-width:none;display:flex;flex-direction:column;gap:var(--menu-rows-seam)}.am-scroll[data-v-d1a137e8]::-webkit-scrollbar{display:none}.scroll-thumb[data-v-d1a137e8]{position:absolute;right:var(--menu-scrollbar-edge);width:var(--menu-scrollbar-width);border-radius:var(--radius-full);background:var(--color-menu-scrollbar);transition:background var(--duration-base) var(--ease-out);pointer-events:none;z-index:var(--z-raised)}.add-menu:hover .scroll-thumb[data-v-d1a137e8]{background:var(--color-menu-scrollbar-hover)}.msheet-search[data-v-d1a137e8]{padding:0 var(--space-4) var(--space-2)}.msheet-add[data-v-d1a137e8]{display:flex;flex-direction:column;gap:var(--menu-rows-seam);padding:0 var(--menu-row-hug);font-family:var(--font-ui)}.am-row[data-v-d1a137e8]{display:flex;align-items:center;gap:var(--menu-row-gap-icon);margin:0 calc(-1 * var(--menu-row-hug));padding:var(--menu-row-padding-block) var(--menu-row-padding-inline);border:none;border-radius:var(--radius-menu-row);background:none;cursor:pointer;font-size:var(--ui-font-size);color:var(--color-text);text-align:left;transition:background var(--duration-base) var(--ease-out)}.am-row[data-v-d1a137e8]:hover{background:var(--color-hover)}.am-row[data-v-d1a137e8]:focus-visible{background:var(--color-selected);outline:none}@media(hover:none){.am-row[data-v-d1a137e8]{padding-top:var(--menu-row-touch-padding-block);padding-bottom:var(--menu-row-touch-padding-block)}}.am-row:hover .am-icon[data-v-d1a137e8],.am-row:focus-visible .am-icon[data-v-d1a137e8]{color:var(--color-text)}.am-icon[data-v-d1a137e8]{flex:none;width:var(--p-ic-sm);display:flex;justify-content:center;color:var(--color-text-muted);transition:color var(--duration-base) var(--ease-out)}.am-name[data-v-d1a137e8]{flex:none;font-weight:var(--weight-medium)}.am-desc[data-v-d1a137e8]{margin-left:var(--space-1);color:var(--color-text-muted);font-size:var(--ui-font-size-sm)}.send[data-v-d1a137e8]{width:var(--composer-send-size);height:var(--composer-send-size);border-radius:var(--radius-full);background:var(--color-send-bg);color:var(--color-send-icon);border:none;box-shadow:var(--shadow-send);padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background var(--duration-slow) var(--ease-out),transform var(--duration-fast) var(--ease-out),box-shadow var(--duration-slow) var(--ease-out);position:relative}.send[data-v-d1a137e8]:hover:not(:disabled){background:var(--color-send-bg-hover);box-shadow:var(--shadow-send-hover)}.send[data-v-d1a137e8]:active{transform:scale(.92)}.send[data-v-d1a137e8]:disabled{cursor:not-allowed;background:var(--color-send-bg-disabled);color:var(--color-send-icon-disabled);opacity:var(--opacity-send-disabled)}.send[data-v-d1a137e8]:disabled:active{transform:none}.send.is-starting[data-v-d1a137e8]:disabled{background:var(--color-send-bg);color:var(--color-send-icon)}.send.is-starting[data-v-d1a137e8] .ui-spinner{color:var(--color-send-icon)}.send.is-starting[data-v-d1a137e8] .ui-spinner__track{stroke:color-mix(in srgb,var(--color-send-icon) 32%,transparent)}.send svg[data-v-d1a137e8]{flex:none;width:var(--composer-send-icon-size);height:var(--composer-send-icon-size)}.stop[data-v-d1a137e8]{width:var(--composer-send-size);height:var(--composer-send-size);border-radius:var(--radius-full);background:var(--color-subtle);color:var(--color-stop-glyph);border:none;box-shadow:var(--shadow-xs);padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background .16s ease,color .16s ease,transform .12s ease}.stop[data-v-d1a137e8]:hover{background:var(--color-danger);color:var(--color-text-on-accent)}.stop[data-v-d1a137e8]:active{transform:scale(.92)}.stop svg[data-v-d1a137e8]{flex:none;width:var(--composer-send-icon-size);height:var(--composer-send-icon-size)}.toolbar[data-v-d1a137e8]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);padding:var(--space-1) var(--composer-control-inset) var(--composer-control-inset);position:relative}.menu-measure[data-v-d1a137e8]{position:absolute;width:max-content;height:0;overflow:hidden;visibility:hidden;pointer-events:none}.toolbar-left[data-v-d1a137e8],.toolbar-right[data-v-d1a137e8]{display:flex;align-items:center;gap:var(--space-1);min-width:0}.toolbar-left[data-v-d1a137e8]{flex:none;overflow:hidden}.toolbar-right[data-v-d1a137e8]{flex:1 1 auto;justify-content:flex-end}.perm-pill[data-v-d1a137e8],.swarm-chip[data-v-d1a137e8],.model-pill[data-v-d1a137e8]{position:relative;display:inline-flex;align-items:center;gap:var(--space-1);height:var(--composer-control-size);padding:0 var(--space-3);border:.5px solid transparent;border-radius:var(--radius-full);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size);font-weight:var(--weight-medium);line-height:1;white-space:nowrap;cursor:pointer;user-select:none;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.perm-pill[data-v-d1a137e8]{font-size:var(--ui-font-size-sm)}.perm-pill[data-v-d1a137e8]:after,.swarm-chip[data-v-d1a137e8]:after,.model-pill[data-v-d1a137e8]:after{content:"";position:absolute;inset:0;border-radius:var(--radius-full);background:var(--color-hover);opacity:0;transition:opacity var(--duration-base) var(--ease-out);pointer-events:none}.perm-pill[data-v-d1a137e8]:hover:after,.swarm-chip[data-v-d1a137e8]:hover:after,.model-pill[data-v-d1a137e8]:hover:after{opacity:1}.perm-pill.open[data-v-d1a137e8],.model-pill.open[data-v-d1a137e8]{background:var(--color-accent-soft)}.swarm-chip[data-v-d1a137e8]{cursor:default}.swarm-x[data-v-d1a137e8]{margin-right:calc(var(--composer-control-size) / 2 - var(--space-3) - var(--icon-button-sm) / 2);color:inherit;opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.swarm-chip .swarm-x[data-v-d1a137e8]{border-radius:var(--radius-full)}.swarm-chip:hover .swarm-x[data-v-d1a137e8],.swarm-x[data-v-d1a137e8]:focus-visible{opacity:1}@media(hover:none){.toolbar-left[data-v-d1a137e8]{padding-right:var(--space-2)}.swarm-chip[data-v-d1a137e8]{margin-right:calc((var(--touch-target-min) - var(--icon-button-sm)) / 2 - var(--space-1))}.swarm-x[data-v-d1a137e8]{opacity:1;position:relative}.swarm-x[data-v-d1a137e8]:before{content:"";position:absolute;inset:calc(-1 * (var(--touch-target-min) - var(--icon-button-sm)) / 2)}}.perm-pill.perm-manual[data-v-d1a137e8]{color:var(--dim)}.perm-pill.perm-yolo[data-v-d1a137e8]{color:var(--color-warning)}.perm-pill.perm-auto[data-v-d1a137e8]{color:var(--color-danger)}.perm-pill-icon[data-v-d1a137e8]{flex:none}.perm-pill[data-v-d1a137e8],.swarm-chip[data-v-d1a137e8]{flex:none;padding-left:var(--space-2)}.swarm-ic[data-v-d1a137e8],.swarm-x[data-v-d1a137e8]{flex:none}.labels-collapsed .perm-pill[data-v-d1a137e8]{width:var(--composer-control-size);height:var(--composer-control-size);padding:0;justify-content:center;flex:none}.labels-collapsed .perm-pill-label[data-v-d1a137e8]{display:none}.labels-collapsed .swarm-chip[data-v-d1a137e8]{position:relative;width:var(--composer-control-size);height:var(--composer-control-size);padding:0;justify-content:center;flex:none}.labels-collapsed .swarm-label[data-v-d1a137e8]{display:none}.labels-collapsed .swarm-ic[data-v-d1a137e8]{transition:opacity var(--duration-base) var(--ease-out)}.labels-collapsed .swarm-chip:hover .swarm-ic[data-v-d1a137e8]{opacity:0}.labels-collapsed .swarm-x[data-v-d1a137e8]{position:absolute;inset:0;width:auto;height:auto;margin-right:0}@media(hover:none){.labels-collapsed .swarm-chip[data-v-d1a137e8]{width:var(--touch-target-min);height:var(--touch-target-min)}.labels-collapsed .swarm-chip:hover .swarm-ic[data-v-d1a137e8]{opacity:1}.labels-collapsed .swarm-x[data-v-d1a137e8]{inset:0;width:auto;height:auto;opacity:1;background:transparent}.labels-collapsed .swarm-x[data-v-d1a137e8]:before{inset:0 0 auto auto;width:var(--p-ic-md);height:var(--p-ic-md);border-radius:var(--radius-full);background:var(--color-selected)}.labels-collapsed .swarm-x[data-v-d1a137e8] svg{position:absolute;top:calc(var(--space-1-5) / 2);right:calc(var(--space-1-5) / 2);width:calc(var(--p-ic-md) - var(--space-1-5));height:calc(var(--p-ic-md) - var(--space-1-5))}}.ctx-group[data-v-d1a137e8]{display:flex;align-items:center;gap:4px;flex-shrink:0;padding:2px 0;border-radius:var(--radius-xs)}.ctx-group[data-v-d1a137e8]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.model-pill[data-v-d1a137e8]{gap:var(--space-1);line-height:var(--leading-normal);overflow:hidden;flex:0 1 auto;min-width:0;max-width:320px;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.model-pill[data-v-d1a137e8]:active{transform:scale(.97)}.model-pill[data-v-d1a137e8]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.model-pill .mp-name[data-v-d1a137e8]{flex:0 8 auto;font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.model-pill .think-suffix[data-v-d1a137e8]{color:var(--color-accent);font-weight:var(--weight-medium);flex:none}.model-pill .cv[data-v-d1a137e8]{color:var(--faint);flex:none;transition:transform var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.model-pill:hover .cv[data-v-d1a137e8],.model-pill.open .cv[data-v-d1a137e8]{color:var(--dim)}.model-pill.open .cv[data-v-d1a137e8]{transform:rotate(180deg)}.model-pill.icon-only[data-v-d1a137e8]{width:var(--composer-control-size);height:var(--composer-control-size);padding:0;justify-content:center;flex:none}.model-pill.login-pill[data-v-d1a137e8],.model-pill.login-pill .mp-name[data-v-d1a137e8]{color:var(--color-accent)}.model-dropdown[data-v-d1a137e8]{position:absolute;bottom:calc(100% + var(--space-1));right:calc(var(--composer-control-inset) + var(--composer-send-size) + var(--space-1));z-index:var(--z-dropdown);min-width:200px;background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);padding:var(--space-1);display:flex;flex-direction:column;gap:1px;font-family:var(--font-ui);transform-origin:bottom right;overflow-y:auto;overscroll-behavior:contain}.model-dropdown.flip-down[data-v-d1a137e8]{top:calc(100% + var(--space-1));bottom:auto;transform-origin:top right}.composer-menu-pop-enter-active[data-v-d1a137e8]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.composer-menu-pop-leave-active[data-v-d1a137e8]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.composer-menu-pop-enter-from[data-v-d1a137e8],.composer-menu-pop-leave-to[data-v-d1a137e8]{opacity:0;transform:scale(.97) translateY(2px)}.model-dropdown.flip-down.composer-menu-pop-enter-from[data-v-d1a137e8],.model-dropdown.flip-down.composer-menu-pop-leave-to[data-v-d1a137e8]{transform:scale(.97) translateY(-2px)}.md-list[data-v-d1a137e8]{display:flex;flex-direction:column;gap:1px;max-height:min(320px,40vh);overflow-y:auto;overscroll-behavior:contain}.md-section[data-v-d1a137e8]{padding:4px 9px 2px;font-size:var(--text-xs);color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-weight:var(--weight-semibold)}.md-row[data-v-d1a137e8]{display:flex;align-items:center;gap:7px;width:100%;background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--ui-font-size);color:var(--color-text);padding:5px 9px;border-radius:var(--radius-dropdown-row);text-align:left;transition:background var(--duration-base) var(--ease-out)}.md-row[data-v-d1a137e8]:hover{background:var(--color-hover)}.md-row:hover .md-name[data-v-d1a137e8]{color:var(--color-text-strong)}.md-row[data-v-d1a137e8]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.md-row[data-v-d1a137e8]:disabled{cursor:default;opacity:.58}.md-row[data-v-d1a137e8]:disabled:hover{background:none}.md-row.is-current[data-v-d1a137e8]{background:var(--color-selected)}.md-note[data-v-d1a137e8]{margin-left:auto;color:var(--muted);font-size:var(--ui-font-size-xs)}.md-row-more .md-more-icon[data-v-d1a137e8]{color:var(--dim)}.md-row-more .md-more-arrow[data-v-d1a137e8]{color:var(--faint);flex:none;transition:color var(--duration-base) var(--ease-out)}.md-row-more:hover .md-more-arrow[data-v-d1a137e8]{color:var(--dim)}.md-check[data-v-d1a137e8]{width:14px;flex:none;color:var(--color-accent);font-weight:500;display:flex;justify-content:center}.md-name[data-v-d1a137e8]{flex:1;transition:color var(--duration-base) var(--ease-out)}.md-provider[data-v-d1a137e8]{color:var(--muted);font-size:var(--ui-font-size-xs);flex:none}.md-star[data-v-d1a137e8]{color:var(--star);flex:none;margin-left:auto}.md-divider[data-v-d1a137e8]{height:1px;background:var(--line);margin:3px 0}.md-thinking[data-v-d1a137e8]{display:flex;align-items:center;gap:8px;padding:6px 9px;border-radius:var(--radius-dropdown-row)}.md-thinking .md-name[data-v-d1a137e8]{font-family:var(--font-ui);font-size:var(--ui-font-size);color:var(--color-text);flex:none}.md-thinking .md-note[data-v-d1a137e8],.md-thinking .ui-seg[data-v-d1a137e8]{margin-left:auto}.md-cache-note[data-v-d1a137e8]{width:0;min-width:100%;padding:2px 7px 4px;color:var(--muted);font-size:var(--ui-font-size-xs);line-height:1.4}.perm-dropdown[data-v-d1a137e8]{position:absolute;bottom:calc(100% + 4px);left:var(--composer-control-inset);z-index:var(--z-dropdown);min-width:220px;width:max-content;max-width:calc(100vw - var(--space-8));background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);padding:var(--space-1);display:flex;flex-direction:column;gap:1px;transform-origin:bottom left}.pd-row[data-v-d1a137e8]{display:grid;grid-template-columns:var(--p-ic-md) var(--composer-menu-desc-width, max-content) var(--p-ic-sm);column-gap:7px;row-gap:2px;align-items:start;width:100%;background:none;border:none;cursor:pointer;padding:6px 7px;border-radius:var(--radius-dropdown-row);text-align:left}.pd-row[data-v-d1a137e8]:hover,.pd-row.is-current[data-v-d1a137e8]{background:var(--color-hover)}.pd-icon[data-v-d1a137e8]{grid-column:1;grid-row:1;width:var(--p-ic-md);min-height:1lh;display:flex;align-items:center;justify-content:center;line-height:var(--leading-tight)}.pd-check[data-v-d1a137e8]{grid-column:3;grid-row:1;width:var(--p-ic-sm);min-height:1lh;color:var(--color-accent);font-size:var(--ui-font-size);font-weight:var(--weight-medium);display:flex;align-items:center;justify-content:center;line-height:var(--leading-tight)}.pd-info[data-v-d1a137e8]{display:contents}.pd-name[data-v-d1a137e8]{grid-column:2;grid-row:1;font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight)}.pd-desc[data-v-d1a137e8]{grid-column:2;grid-row:2;width:var(--composer-menu-desc-width, auto);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-caption);color:var(--muted);line-height:var(--leading-tight)}@media(max-width:640px){.composer[data-v-d1a137e8]{padding:9px var(--dock-inline-right, max(12px, var(--safe-right))) max(24px,var(--safe-bottom)) var(--dock-inline-left, max(12px, var(--safe-left)))}.composer-card[data-v-d1a137e8]{--composer-control-size: 36px;--composer-mobile-input-size: 16px;max-width:100%}.input-row[data-v-d1a137e8]{gap:6px;min-width:0}.send[data-v-d1a137e8],.stop[data-v-d1a137e8]{width:var(--composer-send-size);height:var(--composer-send-size);min-width:var(--composer-send-size);padding:0;border-radius:var(--radius-full);font-size:0;align-self:flex-end;position:relative}.ph[data-v-d1a137e8] .wm-pill{height:calc(var(--composer-mobile-input-size) * 1.5);line-height:calc(var(--composer-mobile-input-size) * 1.5);padding-right:calc((var(--composer-mobile-input-size) * 1.5 - var(--wm-x-size)) / 2)}.model-dropdown[data-v-d1a137e8]{right:calc(var(--composer-control-inset) + var(--composer-send-size) + var(--space-1));left:auto;min-width:180px;max-width:calc(100vw - 24px)}.ph[data-v-d1a137e8]{font-size:var(--composer-mobile-input-size)}.model-pill[data-v-d1a137e8],.attach-btn[data-v-d1a137e8]{font-size:var(--ui-font-size)}.toolbar[data-v-d1a137e8]{gap:6px;min-width:0}.toolbar-left[data-v-d1a137e8],.toolbar-right[data-v-d1a137e8]{min-width:0}.model-pill[data-v-d1a137e8]{max-width:min(52vw,220px)}.model-pill .mp-name[data-v-d1a137e8]{max-width:min(40vw,170px)}.md-row[data-v-d1a137e8],.md-section[data-v-d1a137e8]{font-size:var(--ui-font-size)}.md-thinking[data-v-d1a137e8]{flex-wrap:wrap;row-gap:6px}.md-thinking .ui-seg[data-v-d1a137e8]{margin-left:0}.pd-name[data-v-d1a137e8]{font-size:var(--ui-font-size)}.pd-desc[data-v-d1a137e8]{font-size:var(--text-xs)}}@media(hover:none){.ph[data-wm=true][data-v-d1a137e8] .ProseMirror{padding-top:var(--space-3)}.ph[data-v-d1a137e8] .wm-pill{display:flex;width:max-content;margin-right:0;margin-bottom:var(--space-3);padding-right:calc((var(--touch-target-min) - var(--wm-x-size)) / 2)}.ph[data-v-d1a137e8] .wm-x:before{inset:calc((var(--wm-x-size) - var(--touch-target-min)) / 2)}.ph[data-wm=true][data-v-d1a137e8]{min-height:calc(36px + var(--space-3))}}@media(max-width:640px)and (hover:none){.send[data-v-d1a137e8],.stop[data-v-d1a137e8],.attach-btn[data-v-d1a137e8],.expand-btn[data-v-d1a137e8],.model-pill[data-v-d1a137e8]{position:relative}.send[data-v-d1a137e8]:before,.stop[data-v-d1a137e8]:before,.attach-btn[data-v-d1a137e8]:before,.expand-btn[data-v-d1a137e8]:before,.model-pill[data-v-d1a137e8]:before{content:"";position:absolute;inset:-6px}.expand-btn[data-v-d1a137e8]:before{inset:-11px}.perm-pill[data-v-d1a137e8]{height:var(--touch-target-min)}.labels-collapsed .perm-pill[data-v-d1a137e8]{width:var(--touch-target-min);height:var(--touch-target-min)}}.appr[data-v-03ef6cfa]{display:flex;flex-direction:column;max-height:calc(var(--app-height, 100dvh) - var(--dock-card-top-clearance));margin:var(--space-2) 0;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);overflow:hidden auto;animation:kimi-card-in var(--duration-base) var(--ease-out)}.appr[data-v-03ef6cfa]:before{content:"";position:sticky;top:0;flex:none;height:var(--p-scroll-seam-h);margin-bottom:calc(-1 * var(--p-scroll-seam-h));z-index:var(--z-raised);pointer-events:none;opacity:0;background:linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 2.5%,transparent),transparent 35%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.75%,transparent),transparent 65%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.25%,transparent),transparent);transition:opacity var(--duration-slow) var(--ease-out)}.appr.scrolled[data-v-03ef6cfa]:before{opacity:1}.appr>.ah[data-v-03ef6cfa],.appr>.af[data-v-03ef6cfa]{flex:none}.appr.minimized[data-v-03ef6cfa]{transition:background var(--duration-fast) var(--ease-out)}.appr.minimized[data-v-03ef6cfa]:hover{background:var(--color-hover)}.ah[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-3) var(--space-4) 0;flex-wrap:nowrap}.appr.minimized .ah[data-v-03ef6cfa]{padding-bottom:var(--space-3)}.appr.minimized .ah.clickable[data-v-03ef6cfa]{cursor:pointer}.akind[data-v-03ef6cfa]{color:var(--color-text);font-size:var(--text-lg);font-weight:var(--weight-semibold);white-space:nowrap;flex:none}.apeek[data-v-03ef6cfa]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-muted);font:var(--text-xs) var(--font-mono)}.amin[data-v-03ef6cfa],.aexpand[data-v-03ef6cfa]{margin-left:auto;flex:none}.aexpand+.amin[data-v-03ef6cfa]{margin-left:0}.ab[data-v-03ef6cfa]{display:flex;flex-direction:column;flex:1;min-height:0;padding:var(--space-3) var(--space-4) 0}.ab[data-v-03ef6cfa]>*{flex:0 1 auto;min-height:0}.ab>.plan-path[data-v-03ef6cfa]{flex:none}.ab>.body-plan-wrap[data-v-03ef6cfa]{flex:1}.plan-path[data-v-03ef6cfa]{display:block;width:100%;margin-bottom:var(--space-2);padding:0;border:none;background:transparent;color:var(--color-accent);font:var(--text-xs) var(--font-mono);text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.plan-path[data-v-03ef6cfa]:hover{text-decoration:underline}.plan-path[data-v-03ef6cfa]:focus-visible{outline:none;text-decoration:underline;border-radius:var(--radius-xs);box-shadow:var(--p-focus-ring)}.body-code[data-v-03ef6cfa]{display:flex;flex-direction:column}.body-code.expanded[data-v-03ef6cfa]{flex:1}.body-code.expanded[data-v-03ef6cfa] .hl-code{max-height:none;flex:1}.code-path[data-v-03ef6cfa]{flex:none;color:var(--color-text-muted);font:var(--text-xs) var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body-shell[data-v-03ef6cfa]{overflow-y:auto}.shell-cmd[data-v-03ef6cfa]{font:var(--text-sm) var(--font-mono);background:var(--color-surface-sunken);border:.5px solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3);white-space:pre-wrap;word-break:break-all;max-height:160px;overflow-y:auto;color:var(--color-text)}.shell-dollar[data-v-03ef6cfa]{color:var(--color-accent-hover);font-weight:var(--weight-medium);margin-right:var(--space-2)}.shell-cwd[data-v-03ef6cfa]{font:var(--text-xs) var(--font-mono);color:var(--color-text-muted);margin-top:var(--space-1)}.shell-danger[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-2);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);color:var(--color-danger);font:var(--text-sm)/var(--leading-normal) var(--font-ui);background:var(--color-danger-soft)}.shell-danger-ic[data-v-03ef6cfa]{flex:none}.body-chip[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text);overflow-y:auto}.chip-label[data-v-03ef6cfa]{background:var(--color-inline-code-bg);border-radius:var(--radius-sm);padding:2px var(--space-2);font:var(--weight-semibold) var(--text-xs) var(--font-mono);color:var(--color-text-muted);white-space:nowrap}.chip-value[data-v-03ef6cfa]{font:var(--text-sm) var(--font-mono);color:var(--color-text);word-break:break-all}.chip-detail[data-v-03ef6cfa]{font:var(--text-xs) var(--font-ui);color:var(--color-text-muted)}.body-todo[data-v-03ef6cfa]{overflow-y:auto}.todo-item[data-v-03ef6cfa]{display:flex;align-items:flex-start;gap:var(--space-2);padding:var(--space-1) 0;font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text)}.todo-glyph[data-v-03ef6cfa]{color:var(--color-accent);font-size:var(--text-sm);flex:none;width:14px}.todo-title[data-v-03ef6cfa]{color:var(--color-text)}.todo-done[data-v-03ef6cfa]{color:var(--color-text-muted);text-decoration:line-through}.body-generic[data-v-03ef6cfa]{font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text);word-break:break-word;overflow-y:auto}.body-plan-wrap[data-v-03ef6cfa]{display:flex;flex-direction:column;overflow-y:auto}.body-plan-wrap[data-v-03ef6cfa]:before{content:"";position:sticky;top:0;flex:none;height:var(--p-scroll-seam-h);margin-bottom:calc(-1 * var(--p-scroll-seam-h));z-index:var(--z-raised);pointer-events:none;opacity:0;background:linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 2.5%,transparent),transparent 35%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.75%,transparent),transparent 65%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.25%,transparent),transparent);transition:opacity var(--duration-slow) var(--ease-out)}.body-plan-wrap.scrolled[data-v-03ef6cfa]:before{opacity:1}.body-plan-wrap>.plan-opts[data-v-03ef6cfa]{flex:none}.body-plan[data-v-03ef6cfa]{max-height:50vh;overflow-y:auto;min-height:0}.body-plan.expanded[data-v-03ef6cfa]{max-height:none;flex:1}.plan-opts[data-v-03ef6cfa]{display:flex;flex-direction:column;gap:2px;margin-top:var(--space-3);padding-top:var(--space-3);border-top:.5px solid var(--color-line)}.popt[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-2) var(--space-3);border:none;border-radius:var(--radius-md);background:transparent;color:var(--color-text);font:var(--text-sm)/var(--leading-normal) var(--font-ui);text-align:left;cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}.popt[data-v-03ef6cfa]:hover:not(:disabled){background:var(--color-hover)}.popt[data-v-03ef6cfa]:focus-visible{outline:none;background:var(--color-hover);box-shadow:var(--p-focus-ring)}.popt[data-v-03ef6cfa]:disabled{cursor:default;opacity:.6}.popt-key[data-v-03ef6cfa]{width:var(--p-chip-num);height:var(--p-chip-num);border-radius:var(--radius-sm);background:var(--color-inline-code-bg);color:var(--color-text);font:var(--weight-medium) var(--text-xs)/var(--p-chip-num) var(--font-ui);text-align:center;flex:none}.popt-text[data-v-03ef6cfa]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.popt-label[data-v-03ef6cfa]{color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium)}.popt-desc[data-v-03ef6cfa]{color:var(--color-text-muted);font:var(--text-xs)/var(--leading-normal) var(--font-ui)}.popt-spin[data-v-03ef6cfa]{flex:none;color:var(--color-text-muted)}.feedback-wrap[data-v-03ef6cfa]{margin-top:var(--space-3);overflow-y:auto}.feedback-hint[data-v-03ef6cfa]{font:var(--text-xs) var(--font-ui);color:var(--color-text-muted);margin-top:var(--space-1)}.af[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-3);padding:var(--space-3) var(--space-4);border-top:.5px solid var(--color-line)}.abtns[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-1)}.knum[data-v-03ef6cfa]{min-width:16px;height:16px;padding:0 3px;border-radius:var(--radius-xs);background:var(--color-inline-code-bg);color:var(--color-text);font:var(--weight-medium) var(--text-xs)/16px var(--font-ui);text-align:center}.abtns .ui-button--primary .knum[data-v-03ef6cfa]{background:color-mix(in srgb,var(--color-text-on-accent) 28%,transparent);color:var(--color-text-on-accent)}@media(max-width:640px){.popt[data-v-03ef6cfa]{min-height:44px;padding:var(--space-3)}.af[data-v-03ef6cfa]{flex-direction:column;align-items:stretch}.abtns[data-v-03ef6cfa]{flex-direction:column;margin-left:0;gap:var(--space-2)}.abtns[data-v-03ef6cfa] .ui-button{width:100%;min-height:46px}.abtns .amain[data-v-03ef6cfa]{order:-1}}.chat-dock[data-v-a4f60a64]{--dock-inline-left: 16px;--dock-inline-right: 16px;box-sizing:border-box;width:100%;max-width:calc(var(--read-max) + var(--panes-scrollbar-width, 0px));padding-right:var(--panes-scrollbar-width, 0px);flex:none;position:absolute;inset:auto 0 0;background:transparent;z-index:var(--z-sticky)}.chat-dock.has-popup[data-v-a4f60a64]{z-index:var(--z-dropdown)}.chat-dock.align-center[data-v-a4f60a64]{margin-left:auto;margin-right:auto}.chat-dock.align-left[data-v-a4f60a64]{margin-left:0;margin-right:auto}.chat-dock.align-mobile[data-v-a4f60a64]{max-width:none}.chat-dock[data-v-a4f60a64]:before{--fade: 48px;--veil: 72px;content:"";position:absolute;top:calc(-1 * var(--fade));right:0;bottom:0;left:0;z-index:0;pointer-events:none;background:linear-gradient(to bottom,color-mix(in srgb,var(--color-bg) 0%,transparent),color-mix(in srgb,var(--color-bg) 30%,transparent) 21px,color-mix(in srgb,var(--color-bg) 70%,transparent) 45px,var(--color-bg) var(--veil))}.chat-dock[data-v-a4f60a64]>*{position:relative;z-index:1}.dock-work-panel[data-v-a4f60a64]{position:absolute;left:16px;right:calc(16px + var(--panes-scrollbar-width, 0px));bottom:100%;background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-2xl);box-shadow:var(--shadow-menu);margin-bottom:var(--space-2);max-height:min(360px,50vh);display:flex;flex-direction:column;overflow:hidden;user-select:none}.dock-work-panel.panel-todos .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-head[data-v-a4f60a64]{padding:var(--space-4) var(--space-4) 0;border-bottom:none}.dock-work-panel.panel-todos .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-body[data-v-a4f60a64]{margin-top:var(--space-3);padding:0 var(--space-4) var(--space-4)}.dock-work-panel.panel-todos .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-plan .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-head[data-v-a4f60a64]{padding:var(--space-4) var(--space-4) 0;border-bottom:none}.dock-work-panel.panel-todos .dock-work-tab[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-tab[data-v-a4f60a64],.dock-work-panel.panel-plan .dock-work-tab[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-tab[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-tab[data-v-a4f60a64]{padding:0;line-height:var(--leading-solid)}.dock-work-panel.panel-goal .gh-time[data-v-a4f60a64]{color:var(--color-text-muted)}.dock-work-panel.panel-todos .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-plan .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-body[data-v-a4f60a64]{margin-top:var(--space-3);padding:0 var(--space-4) var(--space-4)}.dock-work-panel.panel-subagent[data-v-a4f60a64],.dock-work-panel.panel-bash[data-v-a4f60a64]{height:min(var(--p-dock-panel-h),50vh)}.dock-work-tab.tab-progress[data-v-a4f60a64]{display:inline-flex;align-items:center;gap:var(--space-2)}@media(max-width:640px){.dock-work-panel.panel-subagent[data-v-a4f60a64],.dock-work-panel.panel-bash[data-v-a4f60a64]{height:auto}}.dock-work-head[data-v-a4f60a64]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:.5px solid var(--color-line);position:relative;z-index:1}.dock-work-body[data-v-a4f60a64]{padding:var(--space-2) var(--space-3);overflow-y:auto;min-height:0;display:flex;flex-direction:column}@media(max-width:480px){.dock-work-head[data-v-a4f60a64]{flex-wrap:wrap}}.dock-work-panel.body-scrolled-up .dock-work-body[data-v-a4f60a64]{mask-image:linear-gradient(to bottom,transparent,black var(--menu-scroll-fade))}.dock-work-body[data-v-a4f60a64] .taskspane{border:none;background:transparent;padding:0}.dock-work-body[data-v-a4f60a64] .taskspane .tp-head{display:none}.dock-workbar[data-v-a4f60a64]{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-1) var(--space-1-5);padding:var(--space-1) calc(var(--dock-inline-right) + var(--space-4) + var(--p-hairline)) var(--space-05) calc(var(--dock-inline-left) + var(--space-4) + var(--p-hairline))}.dock-workbar[data-v-a4f60a64] .ui-pill{position:relative;gap:var(--space-1-5);height:auto;padding:var(--space-2) calc(var(--space-3) + var(--space-05)) var(--space-2) var(--space-3);border:none;border-radius:var(--radius-lg);background:var(--color-selected);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);color:var(--color-text);font-size:var(--text-base);line-height:var(--leading-normal)}.dock-workbar[data-v-a4f60a64] .ui-pill svg{width:1.5em;height:1.5em;color:inherit}.dock-workbar[data-v-a4f60a64] .ui-pill:after{content:"";position:absolute;inset:0;border-radius:var(--radius-lg);background:var(--color-hover);opacity:0;transition:opacity var(--duration-base) var(--ease-out);pointer-events:none}.dock-workbar[data-v-a4f60a64] .ui-pill:hover:not(:disabled):after,.dock-workbar[data-v-a4f60a64] .ui-pill.is-active:after{opacity:1}.chat-dock.pills-compact .dock-workbar[data-v-a4f60a64] .ui-pill{padding:var(--space-2)}.chat-dock.pills-compact .dock-workbar[data-v-a4f60a64] .ui-pill>span{display:none}.dock-workbar .dw-count[data-v-a4f60a64]{color:var(--color-text-muted)}.dock-workbar .dw-running[data-v-a4f60a64]{display:inline-flex;align-items:center;gap:var(--space-1);color:var(--color-text-muted)}.dock-workbar .dw-goal-status[data-v-a4f60a64]{font-weight:var(--weight-medium)}.dock-workbar .dw-goal-status--active[data-v-a4f60a64]{color:var(--color-success)}.dock-workbar .dw-goal-status--paused[data-v-a4f60a64]{color:var(--color-warning)}.dock-workbar .dw-goal-status--blocked[data-v-a4f60a64]{color:var(--color-danger)}.dock-approval[data-v-a4f60a64]{margin-top:8px}.chat-dock.has-approval[data-v-a4f60a64],.chat-dock.has-question[data-v-a4f60a64]{display:flex;flex-direction:column;max-height:calc(var(--app-height, 100dvh) - var(--dock-card-top-clearance))}.chat-dock.has-approval>.dock-workbar[data-v-a4f60a64],.chat-dock.has-question>.dock-workbar[data-v-a4f60a64]{flex:none}.chat-dock.has-approval>.dock-approval[data-v-a4f60a64],.chat-dock.has-question>.dock-question[data-v-a4f60a64]{min-height:0}@media(max-width:640px){.chat-dock[data-v-a4f60a64]{--dock-inline-left: max(12px, var(--safe-left));--dock-inline-right: max(12px, var(--safe-right))}.dock-work-panel[data-v-a4f60a64]{left:10px;right:calc(10px + var(--panes-scrollbar-width, 0px))}.dock-work-head-actions[data-v-a4f60a64] .ui-seg__item{height:var(--touch-target-min)}.dock-work-head-actions[data-v-a4f60a64] .ui-icon-button{width:var(--touch-target-min);height:var(--touch-target-min)}}.chat-dock[data-v-a4f60a64]:not(.align-mobile) .composer{padding-bottom:14px}.dock-panel-enter-active[data-v-a4f60a64]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.dock-panel-leave-active[data-v-a4f60a64]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.dock-panel-enter-from[data-v-a4f60a64],.dock-panel-leave-to[data-v-a4f60a64]{opacity:0;transform:translateY(var(--motion-panel-shift)) scale(var(--motion-panel-scale))}.ws-home[data-v-33dedf8a]{flex:none;display:flex;flex-direction:column;align-items:center;gap:var(--space-1);padding:0 var(--space-4) var(--space-4);user-select:none}.ws-home-title[data-v-33dedf8a]{display:flex;align-items:center;gap:10px;color:var(--color-text);font-size:var(--ui-t1);font-weight:var(--weight-section-label)}.ws-home-folder[data-v-33dedf8a]{color:var(--color-text-muted)}.ws-home-path[data-v-33dedf8a]{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wrs[data-v-460203b8]{flex:none;display:flex;flex-direction:column;margin:var(--space-4) var(--dock-inline-right, 16px) 0 var(--dock-inline-left, 16px)}.wrs-caption[data-v-460203b8]{padding:0 var(--space-2) var(--space-1);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-section-label);text-transform:uppercase;color:var(--faint);user-select:none}.wrs-row[data-v-460203b8]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-width:0;padding:6px var(--space-2);border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);text-align:left;cursor:pointer}.wrs-row[data-v-460203b8]:hover{background:var(--color-hover)}.wrs-row[data-v-460203b8]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.wrs-ico[data-v-460203b8]{display:inline-flex;flex:none}.wrs-ico--open[data-v-460203b8]{color:var(--color-success)}.wrs-ico--done[data-v-460203b8]{color:var(--color-done)}.wrs-title[data-v-460203b8]{flex:1;min-width:0;font-size:var(--ui-font-size-sm);font-weight:var(--weight-caption);line-height:var(--leading-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wrs-time[data-v-460203b8]{flex:none;color:var(--color-text-faint);font-size:var(--text-xs);font-variant-numeric:tabular-nums}.wrs-foot[data-v-460203b8]{display:flex;justify-content:center;margin-top:var(--space-2)}.wrs-more[data-v-460203b8]{display:inline-flex;align-items:center;gap:var(--space-1);height:26px;padding:0 var(--space-2);border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.wrs-more[data-v-460203b8]:hover{background:var(--color-hover);color:var(--color-text)}.wrs-more svg[data-v-460203b8]{color:var(--color-text-faint)}.tsearch[data-v-43f7fb07]{position:absolute;top:calc(var(--panel-head-h, 48px) + var(--space-3));right:var(--space-3);z-index:var(--z-sticky);width:min(var(--p-findbar-w),calc(100% - var(--space-3) * 2));background:var(--color-surface-raised);border:var(--p-hairline) solid var(--color-line);border-radius:var(--radius-2xl);box-shadow:var(--shadow-menu);animation:kimi-card-in var(--duration-slow) var(--ease-out)}.tsearch.mobile[data-v-43f7fb07]{top:var(--space-3)}.tsearch[data-v-43f7fb07]:after{content:"";position:absolute;inset:0;border:inherit;border-color:var(--color-composer-focus-line);border-radius:var(--radius-2xl);opacity:0;pointer-events:none;transition:opacity var(--duration-slow) var(--ease-in-out)}.tsearch[data-v-43f7fb07]:focus-within:after{opacity:1}.tsearch-main[data-v-43f7fb07]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-1) var(--space-2);min-height:calc(var(--space-8) + 2 * var(--space-1))}.tsearch-icon[data-v-43f7fb07]{flex:none;margin-left:var(--space-1);color:var(--color-text-muted)}.tsearch-input[data-v-43f7fb07]{flex:1;min-width:0;height:var(--space-8);padding:0;border:none;background:transparent;font-family:var(--font-ui);font-size:var(--ui-font-size);color:var(--color-text)}.tsearch-input[data-v-43f7fb07]:focus-visible{outline:none}.tsearch-input[data-v-43f7fb07]::placeholder{color:var(--color-text-muted)}.tsearch-spin[data-v-43f7fb07]{display:inline-flex;flex:none}.tsearch-sep[data-v-43f7fb07]{flex:none;width:var(--p-hairline);height:var(--space-4);background:var(--color-line)}.tsearch .tsearch-close[data-v-43f7fb07]{border-radius:var(--radius-full)}.tsearch-foot-wrap[data-v-43f7fb07]{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--duration-slow) var(--ease-out)}.tsearch-foot-wrap.open[data-v-43f7fb07]{grid-template-rows:1fr}.tsearch-foot[data-v-43f7fb07]{overflow:hidden;min-height:0;display:flex;align-items:center;gap:var(--space-1);padding:0 var(--space-2)}.tsearch-foot-wrap.open .tsearch-foot[data-v-43f7fb07]{padding:var(--space-1) var(--space-2);border-top:var(--p-hairline) solid var(--color-line)}.tsearch-count[data-v-43f7fb07]{margin-left:auto;padding-right:var(--space-1);font-size:var(--ui-font-size-sm);color:var(--color-text-muted);white-space:nowrap;user-select:none}.tsearch-rings[data-v-43f7fb07]{position:absolute;inset:0;pointer-events:none}.tsearch-ring[data-v-43f7fb07]{position:absolute;box-sizing:content-box;border:var(--p-findring-w) solid var(--color-warning);margin:calc(-1 * var(--p-findring-w));border-radius:var(--radius-xs);pointer-events:none}.con[data-v-ac65bbbb]{--read-max: 760px;display:flex;flex-direction:column;min-width:0;height:100%;position:relative;container-type:inline-size}.empty-drag[data-v-ac65bbbb]{position:absolute;top:0;left:0;right:0;height:var(--panel-head-h, 48px)}.empty-drag.macos-desktop[data-v-ac65bbbb]{-webkit-app-region:drag}.empty-panel-btn[data-v-ac65bbbb]{position:absolute;top:var(--space-3);right:var(--space-4);z-index:var(--z-sticky);width:var(--space-6);height:var(--space-6);border-radius:var(--radius-sm);-webkit-app-region:no-drag}.empty-panel-btn[data-v-ac65bbbb] svg{width:var(--p-ic-sm);height:var(--p-ic-sm)}.panes[data-v-ac65bbbb]{flex:1;min-height:0;overflow-y:auto;overflow-anchor:auto;scrollbar-gutter:stable}.panes[data-v-ac65bbbb]::-webkit-scrollbar{width:4px}.panes[data-v-ac65bbbb]::-webkit-scrollbar-thumb{background:transparent;transition:background var(--duration-base) var(--ease-out)}.panes.scrolling[data-v-ac65bbbb]::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--color-text) 12%,transparent)}.panes.scrolling[data-v-ac65bbbb]::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}.panes.session-settling .chat[data-v-ac65bbbb]>*:not(.chat-loading){visibility:hidden}.panes.is-following[data-v-ac65bbbb],.panes.history-prepending[data-v-ac65bbbb],.panes.is-pinned[data-v-ac65bbbb]{overflow-anchor:none}.chat-layout[data-v-ac65bbbb]{display:flex;flex-direction:column;height:100%;min-height:0;position:relative}.chat-scroll[data-v-ac65bbbb]{flex:1;min-height:0;position:relative}.content-wrap[data-v-ac65bbbb]{width:100%;max-width:var(--read-max);min-height:100%;box-sizing:border-box;padding-bottom:var(--chat-dock-height, 0px);display:flex;flex-direction:column;flex-shrink:0}.content-wrap.align-center[data-v-ac65bbbb]{margin-left:auto;margin-right:auto}.content-wrap.align-left[data-v-ac65bbbb]{margin-left:0;margin-right:auto}.content-wrap.align-mobile[data-v-ac65bbbb]{max-width:none}@media(max-width:640px){.con.mobile[data-v-ac65bbbb]{min-width:0;overflow:hidden}.con.mobile .panes[data-v-ac65bbbb]{scrollbar-gutter:auto;-webkit-overflow-scrolling:touch}.content-wrap.align-mobile[data-v-ac65bbbb]{width:100%;min-width:0}}.empty-spacer[data-v-ac65bbbb]{flex:1}.empty-tail[data-v-ac65bbbb]{min-height:0;overflow-y:auto;padding-bottom:var(--space-4);box-sizing:border-box}.empty-hint[data-v-ac65bbbb]{flex:none;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:0 16px 16px;color:var(--color-text);font-family:var(--font-ui);user-select:none}.empty-hint-title[data-v-ac65bbbb]{font-size:calc(var(--ui-font-size) + 16px);font-optical-sizing:auto;font-weight:600}.empty-hint-title.is-starting[data-v-ac65bbbb]{display:inline-flex;align-items:center;gap:9px;color:var(--dim);font-weight:400}.empty-doodle[data-v-ac65bbbb]{width:min(340px,62vw)}.empty-hint-text[data-v-ac65bbbb]{display:inline-block;font-size:var(--text-base);color:var(--dim);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upgrade-banner[data-v-ac65bbbb]{flex:none;display:flex;align-items:center;gap:var(--space-3);margin:0 var(--dock-inline-right, 16px) var(--space-2) var(--dock-inline-left, 16px);padding:var(--space-2) var(--space-3);border:.5px solid var(--color-accent-bd);border-radius:var(--radius-xl);background:var(--color-accent-soft)}.upgrade-banner-icon[data-v-ac65bbbb]{flex:none;color:var(--color-accent)}.upgrade-banner-text[data-v-ac65bbbb]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text)}.upgrade-banner-cta[data-v-ac65bbbb]{flex:none;display:inline-flex;align-items:center;gap:var(--space-1);padding:var(--space-1) var(--space-2);border:none;border-radius:var(--radius-sm);background:transparent;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-accent);cursor:pointer}.upgrade-banner-cta[data-v-ac65bbbb]:hover{color:var(--color-accent-hover)}.empty-composer[data-v-ac65bbbb] .composer-card{position:relative;z-index:var(--z-sticky)}.empty-composer[data-v-ac65bbbb]:not(.expanded) .ph{min-height:3lh}.ws-bar[data-v-ac65bbbb]{margin-top:calc(-1 * var(--space-4));padding:calc(var(--space-4) + var(--space-2)) var(--space-2) var(--space-2);background:color-mix(in srgb,var(--color-hover) 60%,transparent);border-radius:0 0 var(--radius-2xl) var(--radius-2xl);font-family:var(--font-ui)}.ws-anchor[data-v-ac65bbbb]{position:relative}.ws-chip[data-v-ac65bbbb]{display:inline-flex;align-items:center;gap:var(--space-2);max-width:100%;padding:var(--space-2) var(--space-3);background:none;border:none;border-radius:var(--radius-full);color:var(--color-text-muted);font-family:inherit;font-size:var(--ui-font-size-sm);cursor:pointer;transition:background var(--duration-base) var(--ease-out)}.ws-chip[data-v-ac65bbbb]:hover,.ws-chip.open[data-v-ac65bbbb]{background:var(--color-selected);color:var(--color-text)}.ws-chip[data-v-ac65bbbb]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ws-chip>.kw-icon[data-v-ac65bbbb]{flex:none}.ws-chip-name[data-v-ac65bbbb]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-option-label)}.ws-chip-chev[data-v-ac65bbbb]{flex:none;transition:transform var(--duration-base) var(--ease-out)}.ws-chip.open .ws-chip-chev[data-v-ac65bbbb]{transform:rotate(180deg)}.ws-chip.ws-ghost[data-v-ac65bbbb]{color:var(--color-text-muted)}.ws-chip.ws-ghost[data-v-ac65bbbb]:hover{color:var(--color-text)}.ws-backdrop[data-v-ac65bbbb]{position:fixed;inset:0;z-index:var(--z-sticky)}.ws-panel[data-v-ac65bbbb]{position:absolute;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr);left:0;top:calc(100% + var(--space-1));z-index:var(--z-dropdown);width:max-content;min-width:min(calc(var(--space-8) * 8),100%);max-width:100%;max-height:calc(var(--space-8) * 10);overflow:hidden auto;background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:var(--space-1);animation:ws-pop-ac65bbbb var(--duration-base) var(--ease-out)}.ws-panel.up[data-v-ac65bbbb]{top:auto;bottom:calc(100% + var(--space-1));animation-name:ws-pop-up-ac65bbbb}@keyframes ws-pop-ac65bbbb{0%{opacity:0;transform:translateY(calc(-1 * var(--space-1))) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes ws-pop-up-ac65bbbb{0%{opacity:0;transform:translateY(var(--space-1)) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}.ws-caption[data-v-ac65bbbb]{padding:var(--space-1) var(--space-2);font-size:var(--text-xs);font-weight:var(--weight-medium);color:var(--color-text-faint);user-select:none}.ws-row[data-v-ac65bbbb]{display:flex;align-items:center;gap:var(--space-2);width:100%;text-align:left;background:none;border:none;border-radius:var(--radius-dropdown-row);padding:var(--space-1) var(--space-2);cursor:pointer;font-family:var(--font-ui)}.ws-row>.kw-icon[data-v-ac65bbbb]{flex:none;color:var(--muted)}.ws-row[data-v-ac65bbbb]:hover{background:var(--color-hover)}.ws-row.on[data-v-ac65bbbb]{background:var(--color-selected)}.ws-row[data-v-ac65bbbb]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ws-info[data-v-ac65bbbb]{flex:1;min-width:0;display:flex;flex-direction:column}.ws-name[data-v-ac65bbbb]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);font-weight:var(--weight-option-label);color:var(--color-text);line-height:var(--leading-normal)}.ws-path[data-v-ac65bbbb]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);font-weight:var(--weight-option-label);color:var(--muted);line-height:var(--leading-normal)}.ws-check[data-v-ac65bbbb]{flex:none;margin-left:var(--space-3);color:var(--color-text)}.ws-divider[data-v-ac65bbbb]{height:1px;margin:var(--space-1) var(--space-2);background:var(--line)}.ws-action[data-v-ac65bbbb]{display:flex;align-items:center;gap:var(--space-2);width:100%;text-align:left;background:none;border:none;border-radius:var(--radius-dropdown-row);padding:var(--space-2);cursor:pointer;font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--dim)}.ws-action>.kw-icon[data-v-ac65bbbb]{flex:none;color:var(--muted)}.ws-action span[data-v-ac65bbbb]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ws-action[data-v-ac65bbbb]:hover{background:var(--color-hover);color:var(--color-text)}.ws-action:hover>.kw-icon[data-v-ac65bbbb]{color:var(--dim)}.ws-action[data-v-ac65bbbb]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.chat-scroll[data-v-ac65bbbb]{display:flex;flex-direction:column}.mobile .panes[data-v-ac65bbbb]:has(>.chat-layout){overflow:hidden;scrollbar-gutter:auto}.newmsg-pill[data-v-ac65bbbb]{position:absolute;left:50%;bottom:12px;transform:translate(-50%);display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;border:.5px solid var(--line);background:var(--panel);color:var(--color-text);font-size:var(--text-xs);font-weight:var(--weight-ui-strong);cursor:pointer;box-shadow:var(--shadow-sm);z-index:var(--z-sticky)}.pill-chevron[data-v-ac65bbbb]{width:12px;height:12px}.pill-enter-active[data-v-ac65bbbb],.pill-leave-active[data-v-ac65bbbb]{transition:opacity .2s ease,transform .2s ease}.pill-enter-from[data-v-ac65bbbb],.pill-leave-to[data-v-ac65bbbb]{opacity:0;transform:translate(-50%) translateY(8px)}.undo-toast[data-v-ac65bbbb]{position:absolute;left:50%;top:60px;transform:translate(-50%);padding:8px 14px;border-radius:var(--radius-sm);background:var(--color-text);color:var(--bg);font-size:var(--ui-font-size-sm);z-index:var(--z-sticky);box-shadow:var(--shadow-sm)}.undo-toast-text[data-v-ac65bbbb]{display:flex;align-items:center;gap:8px}.undo-toast-enter-active[data-v-ac65bbbb],.undo-toast-leave-active[data-v-ac65bbbb]{transition:opacity .15s ease,transform .15s ease}.undo-toast-enter-from[data-v-ac65bbbb],.undo-toast-leave-to[data-v-ac65bbbb]{opacity:0;transform:translate(-50%) translateY(-6px)}.con[data-v-ac65bbbb]{background:var(--bg)}.newmsg-pill[data-v-ac65bbbb]{font-family:var(--sans)}.panel-tab-bar[data-v-808fd300]{position:relative;height:var(--panel-head-h);flex:none;display:flex;align-items:center;gap:var(--space-05);padding:0 var(--space-4) 0 var(--space-2);border-bottom:var(--p-hairline) solid var(--color-line)}.ptb-tabs[data-v-808fd300]{flex:1;min-width:0;height:100%;display:flex;align-items:center;gap:var(--space-05);overflow-x:auto;scrollbar-width:none}.ptb-tabs[data-v-808fd300]::-webkit-scrollbar{display:none}.ptb-tab[data-v-808fd300]{display:inline-flex;align-items:center;gap:var(--space-1-5);height:var(--panel-tab-h);padding:0 var(--space-1-5) 0 var(--panel-tab-pad-x);max-width:var(--panel-tab-max-w);min-width:0;flex:none;border-radius:var(--radius-md);background:var(--color-hover);color:var(--color-text-muted);transition:background var(--duration-fast) var(--ease-out)}.ptb-tab[data-v-808fd300]:hover{background:var(--color-selected);color:var(--color-text)}.ptb-tab.on[data-v-808fd300]{background:var(--color-selected-hover);color:var(--color-text)}.ptb-tab-main[data-v-808fd300]{display:inline-flex;align-items:center;gap:var(--space-1-5);flex:1;min-width:0;padding:0;border:none;background:none;color:inherit;font-family:var(--font-ui);font-size:var(--text-sm);white-space:nowrap;user-select:none;cursor:pointer}.ptb-tab-main[data-v-808fd300]:focus-visible{outline:none;border-radius:var(--radius-xs);box-shadow:var(--p-focus-ring)}.ptb-t[data-v-808fd300]{overflow:hidden;text-overflow:ellipsis}.ptb-x[data-v-808fd300]{width:var(--panel-tab-x-size);height:var(--panel-tab-x-size);flex:none;padding:0;border:none;border-radius:var(--radius-xs);display:inline-flex;align-items:center;justify-content:center;background:none;color:var(--color-text-faint);cursor:pointer}.ptb-x[data-v-808fd300]:hover{background:var(--color-well);color:var(--color-text)}.ptb-x[data-v-808fd300]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ptb-tail[data-v-808fd300]{flex:none;display:flex;align-items:center;gap:var(--space-05);padding-left:var(--space-1)}.panel-add-menu[data-v-808fd300]{position:absolute;top:calc(var(--panel-head-h) - var(--space-1-5));right:var(--space-4);z-index:var(--z-dropdown)}@media(hover:none),(max-width:640px){.ptb-x[data-v-808fd300],.ptb-tail[data-v-808fd300] .ui-icon-button{position:relative}.ptb-x[data-v-808fd300]:after{content:"";position:absolute;inset:calc(-1 * (var(--touch-target-min) - var(--panel-tab-x-size)) / 2)}.ptb-tail[data-v-808fd300] .ui-icon-button:after{content:"";position:absolute;inset:calc(-1 * (var(--touch-target-min) - var(--icon-button-sm)) / 2)}}.pl[data-v-445e1a28]{display:flex;flex-direction:column;justify-content:center;gap:var(--space-3);height:100%;box-sizing:border-box;width:min(var(--panel-launcher-w),100%);margin-inline:auto;padding:var(--space-2) 0}.global-preview[data-v-46c316da]{--preview-w: var(--panel-default-w);grid-column:4;grid-row:1 / -1;min-width:0;min-height:0;width:0;background:var(--bg);overflow:hidden;position:relative}.global-preview.open[data-v-46c316da]{width:var(--preview-w)}.global-preview.expanded[data-v-46c316da]{width:auto}.global-preview.mobile[data-v-46c316da]{position:fixed;inset:0;z-index:var(--z-sticky);width:auto;transition:none;border-top:var(--p-hairline) solid var(--color-text)}.panel-resize[data-v-46c316da]{position:absolute;left:var(--space-05);top:0;bottom:0}.pt-shell[data-v-46c316da]{display:flex;flex-direction:column;height:100%;box-sizing:border-box;position:relative}.global-preview:not(.mobile) .pt-shell[data-v-46c316da]{width:var(--preview-w);border-left:var(--p-hairline) solid var(--line)}.global-preview:not(.mobile).expanded .pt-shell[data-v-46c316da]{width:auto;border-left:none}.pt-body[data-v-46c316da]{flex:1;min-height:0}.pfc-host[data-v-46c316da]{position:absolute;left:0;right:0;bottom:0;z-index:var(--z-sticky);width:100%;max-width:var(--p-content-max);margin:0 auto;box-sizing:border-box;padding:0 var(--space-4) var(--space-4)}.pfc-host[data-v-46c316da]:empty{padding:0}.pt-body[data-v-46c316da]>*{height:100%;box-sizing:border-box}.session-admin[data-v-fd687e8e]{display:flex;flex-direction:column;min-width:0;height:100%;background:var(--color-bg);font-family:var(--font-ui)}.sa-scroll[data-v-fd687e8e]{flex:1;min-height:0;overflow-y:auto}.sa-page[data-v-fd687e8e]{padding:var(--space-8) var(--space-6);display:flex;flex-direction:column;box-sizing:border-box}.sa-head[data-v-fd687e8e]{flex:none;display:flex;align-items:center;gap:var(--space-2);height:48px;padding:0 var(--space-6);border-bottom:.5px solid var(--color-line);box-sizing:border-box}.sa-title[data-v-fd687e8e]{margin:0;font-size:var(--text-base);font-weight:var(--weight-semibold);line-height:var(--leading-tight);color:var(--color-text);user-select:none}.sa-subtitle[data-v-fd687e8e]{margin:0 0 var(--space-3);font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted)}.session-admin.macos-desktop .sa-head[data-v-fd687e8e]{-webkit-app-region:drag}.session-admin.macos-desktop .sa-head button[data-v-fd687e8e],.session-admin.macos-desktop .sa-head input[data-v-fd687e8e]{-webkit-app-region:no-drag}.sa-filters[data-v-fd687e8e]{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;margin-bottom:var(--space-3)}.sa-f-label[data-v-fd687e8e]{margin-left:var(--space-2);color:var(--color-text-muted);font-size:var(--text-sm);user-select:none}.sa-f-label[data-v-fd687e8e]:first-child{margin-left:0}.sa-f-actions[data-v-fd687e8e]{display:inline-flex;align-items:center;gap:var(--space-2);margin-left:var(--space-2)}.brand-logo[data-v-0904de71]{display:block;flex:none;cursor:pointer;user-select:none;touch-action:manipulation}.nb-cards[data-v-d880fe1a]{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-2) 0 var(--space-4)}.center-body[data-v-d880fe1a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);padding:var(--space-8) 0 var(--space-4);text-align:center}.center-text[data-v-d880fe1a]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.success-text[data-v-d880fe1a]{color:var(--color-success)}.err-text[data-v-d880fe1a]{color:var(--color-danger)}.warn-text[data-v-d880fe1a]{color:var(--color-warning);font-size:var(--text-base)}.center-hint[data-v-d880fe1a]{font-size:var(--text-sm);color:var(--color-text-muted)}.nb[data-v-d880fe1a]{display:flex;flex-direction:column;gap:var(--space-4);padding:var(--space-2) 0 var(--space-4)}.nb-hero[data-v-d880fe1a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);text-align:center}.nb-hero-icon[data-v-d880fe1a]{display:inline-flex;margin-bottom:var(--space-1)}.nb-hero-title[data-v-d880fe1a]{font-size:var(--text-lg);font-weight:var(--weight-medium);color:var(--color-text)}.nb-hero-hint[data-v-d880fe1a]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal);font-variant-numeric:tabular-nums}.nb-manual[data-v-d880fe1a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2)}.nb-manual-label[data-v-d880fe1a]{font-size:var(--text-xs);color:var(--color-text-faint)}.nb-copy-text[data-v-d880fe1a]{margin-left:var(--space-2)}.nb-copy-text.is-copied[data-v-d880fe1a]{color:var(--color-success);text-decoration:none}.nb-or[data-v-d880fe1a]{display:flex;align-items:center;gap:var(--space-3);color:var(--color-text-muted);font-size:var(--text-xs);letter-spacing:.06em}.nb-or[data-v-d880fe1a]:before,.nb-or[data-v-d880fe1a]:after{content:"";flex:1;height:1px;background:var(--color-line)}.nb-fallback[data-v-d880fe1a]{display:flex;flex-direction:column;gap:var(--space-2)}.nb-fb-text[data-v-d880fe1a]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal)}.nb-fb-link[data-v-d880fe1a]{color:var(--color-accent);text-decoration:none;border-bottom:var(--p-hairline) solid var(--color-accent-bd)}.nb-fb-link[data-v-d880fe1a]:hover{border-bottom-color:var(--color-accent)}.nb-code-row[data-v-d880fe1a]{display:flex;align-items:center;gap:var(--space-3);background:var(--color-surface-sunken);border:var(--p-hairline) solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3)}.nb-code[data-v-d880fe1a]{flex:1;font-family:var(--font-mono);font-size:var(--text-xl);font-weight:var(--weight-medium);color:var(--color-text);letter-spacing:.14em}.nb-copy.is-copied[data-v-d880fe1a]{color:var(--color-success);border-color:var(--color-success-bd)}.actions[data-v-d880fe1a]{display:flex;justify-content:flex-end;gap:var(--space-3);padding-top:var(--space-4)}@media(max-width:640px){.center-body[data-v-d880fe1a],.nb[data-v-d880fe1a]{overflow-y:auto;-webkit-overflow-scrolling:touch}.nb-code-row[data-v-d880fe1a],.actions[data-v-d880fe1a]{flex-wrap:wrap}.nb-code[data-v-d880fe1a]{min-width:0;overflow-wrap:anywhere;letter-spacing:.08em}.nb-copy[data-v-d880fe1a]{min-height:34px}}.sec[data-v-b460ecbf]{margin-bottom:var(--space-5)}.sec-title[data-v-b460ecbf]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);margin:0 0 var(--space-3)}.pu-group[data-v-b460ecbf]{overflow:hidden;border-radius:var(--radius-xl);background:var(--color-surface)}.pu-row[data-v-b460ecbf]{display:flex;align-items:center;gap:var(--space-3);min-height:52px;padding:var(--space-3) var(--space-4);border-top:.5px solid var(--color-line)}.pu-row[data-v-b460ecbf]:first-child{border-top:none}.pu-state[data-v-b460ecbf]{color:var(--color-text-muted);font-size:var(--text-sm)}.pu-error-text[data-v-b460ecbf]{flex:1;min-width:0}.pu-empty[data-v-b460ecbf]{color:var(--color-text-faint)}.pu-main[data-v-b460ecbf]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.pu-label[data-v-b460ecbf]{font-size:var(--text-sm);color:var(--color-text)}.pu-hint[data-v-b460ecbf]{font-size:var(--text-xs);color:var(--color-text-faint)}.pu-value[data-v-b460ecbf]{flex:none;font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);font-variant-numeric:tabular-nums;white-space:nowrap}.pu-value-sub[data-v-b460ecbf]{font-weight:var(--weight-regular);color:var(--color-text-faint)}.pu-meter[data-v-b460ecbf]{flex:none;width:120px;height:5px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden}.pu-meter i[data-v-b460ecbf]{display:block;height:100%;border-radius:var(--radius-full);background:var(--color-accent);transition:width var(--duration-base) var(--ease-out)}.pu-meter i.sev-warn[data-v-b460ecbf]{background:var(--color-warning)}.pu-meter i.sev-danger[data-v-b460ecbf]{background:var(--color-danger)}.sd[data-v-08ed3275]{display:grid;grid-template-columns:148px 1fr;grid-template-areas:"tabs region";min-height:0;height:100%;user-select:none}.sd[data-v-08ed3275] :is(input,textarea,[contenteditable=true]){user-select:text}.settings-region[data-v-08ed3275]{display:flex;min-width:0;min-height:0;flex-direction:column;grid-area:region}.settings-region-header[data-v-08ed3275],.settings-tabs-header[data-v-08ed3275]{display:flex;align-items:center;height:calc(var(--space-4) + var(--icon-button-sm) + var(--space-2));box-sizing:border-box}.settings-region-header[data-v-08ed3275]{justify-content:flex-end;padding-right:var(--space-5)}.settings-tabs-header[data-v-08ed3275]{padding-inline:var(--space-3)}.settings-dialog-title[data-v-08ed3275]{margin:0;font-family:var(--font-ui);font-size:var(--text-lg);font-weight:var(--weight-medium);line-height:var(--leading-tight);color:var(--color-text)}.settings-tabs[data-v-08ed3275]{display:flex;flex-direction:column;width:148px;padding:0 var(--space-2) var(--space-2);gap:2px;overflow-y:auto;border-right:.5px solid var(--color-line);grid-area:tabs}.settings-tab-list[data-v-08ed3275]{display:flex;flex-direction:column;gap:2px}.tab[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-2);text-align:left;padding:8px 10px;border:none;border-radius:var(--radius-md);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-ui-strong);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.tab[data-v-08ed3275]:hover{background:var(--color-hover);color:var(--color-text-strong)}.tab.on[data-v-08ed3275]{background:var(--color-hover);color:var(--color-text)}.tab[data-v-08ed3275]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.body[data-v-08ed3275]{display:flex;flex-direction:column;overflow-y:auto;padding:var(--space-2) 32px var(--space-5);flex:1;min-width:0}.body[data-v-08ed3275]::-webkit-scrollbar{width:4px}.body[data-v-08ed3275]::-webkit-scrollbar-track{background:transparent}.body[data-v-08ed3275]::-webkit-scrollbar-thumb{background:transparent;border-radius:var(--radius-full);transition:background var(--duration-base) var(--ease-out)}.body.scrolling[data-v-08ed3275]::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--color-text) 12%,transparent)}.body.scrolling[data-v-08ed3275]::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}.panel[data-v-08ed3275]{display:block}.sec[data-v-08ed3275]{padding:var(--space-4) 0}.panel>.sec[data-v-08ed3275]:first-child{padding-top:0}.sec-head[data-v-08ed3275]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-3)}.sec-title[data-v-08ed3275]{margin:0 0 var(--space-3);font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);letter-spacing:0;color:var(--color-text)}.notification-settings[data-v-08ed3275]{user-select:none}.sec-head .sec-title[data-v-08ed3275]{margin-bottom:0}.row[data-v-08ed3275]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);min-height:38px;padding:var(--space-1) 0}.settings-group[data-v-08ed3275]{overflow:hidden;border-radius:var(--radius-xl);background:var(--color-surface)}.settings-group>.row[data-v-08ed3275]{min-height:52px;padding:var(--space-4);border-top:.5px solid var(--color-line)}.settings-group>.row[data-v-08ed3275]:first-child{border-top:none}.settings-group>.empty-config[data-v-08ed3275]{padding:var(--space-3)}.account-row[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4)}.account-avatar[data-v-08ed3275]{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:none;border-radius:50%;background:var(--color-surface-sunken);color:var(--color-text-muted)}.account-avatar img[data-v-08ed3275]{width:100%;height:100%;border-radius:50%;object-fit:cover}.account-name-row[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-2);min-width:0}.account-level[data-v-08ed3275]{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis}.account-meta[data-v-08ed3275]{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px}.account-name[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-sub[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rlabel[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text);font-weight:var(--weight-option-label);display:flex;flex-direction:column;gap:0}.rvalue[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-muted);max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rvalue.mono[data-v-08ed3275]{font-family:var(--font-mono);font-size:var(--text-xs)}.rvalue-wrap[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-1);max-width:60%;min-width:0}.rvalue-wrap .rvalue[data-v-08ed3275]{max-width:none}.sd-check[data-v-08ed3275]{color:var(--color-success)}.hint[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-text-faint)}.body[data-v-08ed3275] .ui-seg,.body[data-v-08ed3275] .ui-select__trigger,.body[data-v-08ed3275] .ui-button,.archive-search[data-v-08ed3275]{border-width:.5px}.select-wrap[data-v-08ed3275]{min-width:220px;max-width:min(320px,50vw);flex:none}.empty-config[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-muted);padding:var(--space-1) 0}@media(max-width:640px){.sd[data-v-08ed3275]{grid-template-columns:1fr;grid-template-rows:auto 1fr;grid-template-areas:"tabs" "region"}.settings-tabs[data-v-08ed3275]{width:auto;padding:0;overflow-x:visible;border-right:none;border-bottom:.5px solid var(--color-line)}.settings-tabs-header[data-v-08ed3275]{padding:var(--space-3)}.settings-tab-list[data-v-08ed3275]{flex-direction:row;gap:var(--space-1);overflow-x:auto;padding:0 var(--space-3) var(--space-2)}.settings-region-header[data-v-08ed3275]{padding:var(--space-3)}.body[data-v-08ed3275]{padding-inline:var(--space-3)}.tab[data-v-08ed3275]{white-space:nowrap;flex:none}.row[data-v-08ed3275]{align-items:flex-start;flex-direction:column}.settings-group[data-v-08ed3275]{margin-inline:0}.select-wrap[data-v-08ed3275]{width:100%;max-width:none}}.setting-card[data-v-08ed3275]{border-radius:var(--radius-xl);overflow:hidden;background:var(--color-surface)}.panel-head[data-v-08ed3275]{margin-bottom:var(--space-4)}.panel-title[data-v-08ed3275]{margin:0 0 var(--space-2);font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);letter-spacing:0;color:var(--color-text)}.panel-desc[data-v-08ed3275]{margin:0;font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-normal);color:var(--color-text-muted);max-width:560px}.archive-toolbar[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-3);margin-bottom:var(--space-4);flex-wrap:wrap}.archive-search[data-v-08ed3275]{flex:1;min-width:200px;height:36px;display:flex;align-items:center;gap:var(--space-2);padding:0 var(--space-3);border-radius:var(--radius-md);border:.5px solid var(--color-line);color:var(--color-text-faint);font-size:var(--text-xs);background:var(--color-surface-overlay);transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out)}.archive-search[data-v-08ed3275]:focus-within{border-color:var(--color-accent);box-shadow:var(--p-focus-ring);color:var(--color-text-muted)}.archive-search svg[data-v-08ed3275]{width:15px;height:15px;flex:none}.archive-search input[data-v-08ed3275]{width:100%;border:none;outline:none;background:transparent;font:inherit;color:var(--color-text)}.archive-list[data-v-08ed3275]{display:flex;flex-direction:column;gap:var(--space-4)}.archive-card .setting-card[data-v-08ed3275]{margin-bottom:0}.archive-workspace[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-2);margin:0 2px var(--space-2);color:var(--color-text-muted);font-size:var(--text-xs);font-weight:var(--weight-medium)}.archive-workspace svg[data-v-08ed3275]{width:16px;height:16px;color:var(--color-text-faint);flex:none}.archive-workspace .path[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-workspace .count[data-v-08ed3275]{margin-left:auto;color:var(--color-text-faint);font-weight:var(--weight-medium);font-size:var(--text-xs);flex:none}.archive-row[data-v-08ed3275]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--space-3);align-items:center;padding:var(--space-3) var(--space-4);border-top:.5px solid var(--color-line)}.archive-row[data-v-08ed3275]:first-child{border-top:none}.archive-row[data-v-08ed3275]:hover{background:var(--color-hover)}.archive-meta[data-v-08ed3275]{min-width:0}.archive-name[data-v-08ed3275]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-time[data-v-08ed3275]{margin-top:2px;font-size:var(--text-xs);color:var(--color-text-faint);font-family:var(--font-ui)}.archive-draining[data-v-08ed3275]{margin-bottom:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);background:var(--color-accent-soft);color:var(--color-accent-hover);font-size:var(--text-xs)}.archive-empty[data-v-08ed3275]{padding:var(--space-6) var(--space-4);border-radius:var(--radius-xl);color:var(--color-text-faint);font-size:var(--text-xs);text-align:center;background:var(--color-surface)}@media(max-width:640px){.archive-toolbar[data-v-08ed3275]{flex-direction:column;align-items:stretch}.archive-search[data-v-08ed3275]{min-width:0}}[data-v-08ed3275] .ui-dialog{width:min(980px,96vw)}[data-v-08ed3275] .ui-dialog--fixed-height{height:min(780px,calc(var(--app-height, 100vh) - var(--space-8) * 2))}.actions[data-v-aaf2e643]{padding:0 var(--space-2) var(--space-2);border-bottom:.5px solid var(--color-line);margin-bottom:var(--space-1)}.newrow[data-v-aaf2e643]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:44px;padding:var(--space-2);background:none;border:none;border-radius:var(--radius-md);color:var(--color-text-muted);font-family:var(--sans);font-weight:var(--weight-regular);font-size:var(--ui-font-size);cursor:pointer;text-align:left}.newrow[data-v-aaf2e643]:hover{background:var(--color-hover)}.newrow[data-v-aaf2e643]:active{background:var(--color-surface-sunken);color:var(--color-text)}.view-tabs[data-v-aaf2e643]{padding:var(--space-1) var(--space-2) var(--space-2)}.view-tabs[data-v-aaf2e643] .ui-seg{display:flex;width:100%}.view-tabs[data-v-aaf2e643] .ui-seg__item{flex:1;justify-content:center}.mlist[data-v-aaf2e643]{--m-pad: 16px;--m-gutter: 15px;--m-gap: 8px;--m-indent: calc(var(--m-pad) + var(--m-gutter) + var(--m-gap));padding-bottom:var(--space-1)}.mempty[data-v-aaf2e643]{padding:var(--space-6) var(--space-4);text-align:center;color:var(--color-text-faint);font-size:var(--ui-font-size)}.mempty.small[data-v-aaf2e643]{padding:10px 16px 12px var(--m-indent);text-align:left;font-size:var(--ui-font-size-xs)}.mgroup[data-v-aaf2e643]{padding-top:var(--space-2)}.mgh[data-v-aaf2e643]{display:flex;align-items:center;gap:var(--m-gap);min-height:44px;margin:0 var(--space-2);padding:0 calc(var(--m-pad) - var(--space-2));border-radius:var(--radius-md);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}.mgh[data-v-aaf2e643]:hover{background:var(--color-hover)}.mgh[data-v-aaf2e643]:active{background:var(--color-surface-sunken)}.mgh-folder[data-v-aaf2e643]{flex:none;color:var(--color-text-muted)}.mgh-name[data-v-aaf2e643]{flex:none;max-width:50%;font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mgh-path[data-v-aaf2e643]{flex:1;min-width:0;font-size:var(--text-xs);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mgh-more[data-v-aaf2e643]{margin:0 calc(-1 * var(--space-2))}.mgh-add[data-v-aaf2e643]{margin:0 calc(-1 * var(--space-2)) 0 0}.mgh-add[data-v-aaf2e643]:active,.mgh-more[data-v-aaf2e643]:active{color:var(--color-text);background:var(--color-hover)}.srow[data-v-aaf2e643]{display:flex;align-items:center;gap:var(--space-2);min-height:44px;margin:1px var(--space-2);padding:0 calc(var(--m-pad) - var(--space-2)) 0 calc(var(--m-indent) - var(--space-2));border-radius:var(--radius-md);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}.srow[data-v-aaf2e643]:hover{background:var(--color-hover)}.srow[data-v-aaf2e643]:active{background:var(--color-surface-sunken)}.srow.cur[data-v-aaf2e643]{background:var(--color-accent-soft);box-shadow:inset 0 0 0 1px var(--color-accent-bd)}.srow .t[data-v-aaf2e643]{flex:1;min-width:0;font-size:var(--ui-font-size-sm);font-weight:var(--weight-caption);line-height:var(--leading-tight);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.srow.cur .t[data-v-aaf2e643]{color:var(--color-accent-hover)}.srow .t.run[data-v-aaf2e643]{position:relative}.srow .t.run[data-v-aaf2e643]:before{content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%);width:6px;height:6px;border-radius:var(--radius-full);background:var(--color-accent);animation:mRunPulse-aaf2e643 1.4s ease-in-out infinite}@keyframes mRunPulse-aaf2e643{0%,to{opacity:1}50%{opacity:.35}}.srow .t.aborted[data-v-aaf2e643]{position:relative}.srow .t.aborted[data-v-aaf2e643]:before{content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%);width:6px;height:6px;border-radius:var(--radius-full);background:var(--color-danger)}.srow .time[data-v-aaf2e643]{flex:none;font-size:var(--text-xs);font-variant-numeric:tabular-nums;color:var(--color-text-faint)}.att[data-v-aaf2e643]{flex:none;font-family:var(--font-mono);font-size:max(9px,calc(var(--ui-font-size) - 4px));color:var(--color-text-on-accent);background:var(--color-warning);border-radius:var(--radius-full);padding:1px 7px}.srow .kb[data-v-aaf2e643]{flex:none;margin:0 calc(-1 * var(--space-2)) 0 0}.srow .kb[data-v-aaf2e643]:active{color:var(--color-text);background:var(--color-hover)}.srow-flat[data-v-aaf2e643]{min-height:52px}.srow-main[data-v-aaf2e643]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.srow-main .t[data-v-aaf2e643]{flex:none}.srow-sub[data-v-aaf2e643]{font-size:var(--text-xs);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kmenu[data-v-aaf2e643]{position:absolute;right:12px;top:44px;z-index:var(--z-dropdown);min-width:96px;overflow:hidden}.wsmenu[data-v-aaf2e643]{top:calc(100% - 4px);right:var(--m-pad);min-width:132px}.mshow-more-row[data-v-aaf2e643]{display:flex;align-items:center;padding-left:calc(var(--m-indent) - var(--space-3))}.mshow-more[data-v-aaf2e643]{display:flex;align-items:center;gap:var(--space-2);min-height:44px;padding:var(--space-1) var(--space-3);background:none;border:none;border-radius:var(--radius-md);color:var(--color-text-muted);font-size:var(--ui-font-size);cursor:pointer;text-align:left}.mshow-more[data-v-aaf2e643]:active{color:var(--color-accent-hover);background:var(--color-hover)}.mshow-more-sep[data-v-aaf2e643]{margin:0 var(--space-1);color:var(--color-text-faint);user-select:none}.group-title[data-v-f46669a7]{padding:var(--space-4) max(var(--space-4),var(--safe-right)) var(--space-2) max(var(--space-4),var(--safe-left));font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.group-title[data-v-f46669a7]:first-child{padding-top:0}.card[data-v-f46669a7]{margin:0 max(var(--space-4),var(--safe-right)) 0 max(var(--space-4),var(--safe-left));background:var(--color-surface);border-radius:var(--radius-xl);overflow:hidden}.card>.srow[data-v-f46669a7]{border-radius:0}.card>.srow+.srow[data-v-f46669a7]{border-top:.5px solid var(--color-line)}.srow[data-v-f46669a7]:disabled{opacity:.5;cursor:not-allowed}.srow[data-v-f46669a7]{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:52px;padding:var(--space-3) var(--space-4);background:none;border:none;border-radius:var(--radius-md);cursor:pointer;text-align:left;color:var(--color-text)}.srow[data-v-f46669a7]:hover:not(.read-only){background:var(--color-hover)}.srow[data-v-f46669a7]:active:not(.read-only){background:var(--color-surface-sunken)}.srow.read-only[data-v-f46669a7]{cursor:default}.srow-main[data-v-f46669a7]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.srow-label[data-v-f46669a7]{font-size:var(--text-base);color:var(--color-text)}.srow-sub[data-v-f46669a7]{font-size:var(--text-base);color:var(--color-text-faint);overflow-wrap:anywhere}.srow-val[data-v-f46669a7]{flex:none;font-family:var(--font-mono);font-size:var(--ui-font-size);font-weight:500;color:var(--color-accent-hover)}.srow-val.dim[data-v-f46669a7]{font-weight:400;color:var(--color-text-muted)}.cache-note[data-v-f46669a7]{padding:var(--space-1) max(var(--space-4),var(--safe-right)) 0 max(var(--space-4),var(--safe-left));font-size:var(--text-xs);color:var(--color-text-faint);line-height:1.4}.chev[data-v-f46669a7]{flex:none;color:var(--color-text-faint);font-size:17px;line-height:1}.toggle[data-v-f46669a7]{flex:none;width:44px;height:26px;border-radius:var(--radius-full);background:var(--color-line);position:relative;transition:background .18s}.toggle.on[data-v-f46669a7]{background:var(--color-accent)}.toggle[data-v-f46669a7]:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:var(--radius-full);box-sizing:border-box;background:var(--color-bg);border:.5px solid var(--color-line);box-shadow:var(--shadow-xs);transition:left .18s}.toggle.on[data-v-f46669a7]:after{left:21px}.srow.pref[data-v-f46669a7]{flex-wrap:wrap;cursor:default}.srow.pref .srow-main[data-v-f46669a7]{flex:1 0 100%}.srow.acct.in .srow-label[data-v-f46669a7]{color:var(--color-accent-hover);font-weight:500}.srow.acct.out .srow-label[data-v-f46669a7]{color:var(--color-danger)}.acct-avatar[data-v-f46669a7]{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:none;border-radius:50%;background:var(--color-surface-sunken);color:var(--color-text-muted)}.acct-avatar img[data-v-f46669a7]{width:100%;height:100%;border-radius:50%;object-fit:cover}.acct-name-row[data-v-f46669a7]{display:flex;align-items:center;gap:var(--space-2);min-width:0}.acct-name-row .srow-label[data-v-f46669a7]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.acct-level[data-v-f46669a7]{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis}.usage[data-v-f46669a7]{margin:var(--space-4) max(var(--space-4),var(--safe-right)) 0 max(var(--space-4),var(--safe-left))}.usage[data-v-f46669a7] .sec{margin-bottom:0}.ctx-meter[data-v-f46669a7]{flex:none;width:96px;height:5px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden}.ctx-meter i[data-v-f46669a7]{display:block;height:100%;border-radius:var(--radius-full);background:var(--color-accent)}.srow[data-v-f46669a7],.srow-sub[data-v-f46669a7],.srow-val[data-v-f46669a7],.cache-note[data-v-f46669a7]{font-family:var(--sans)}.ls-cards[data-v-f2d724d4]{display:flex;flex-direction:column;gap:var(--space-3)}.ls-card-icon[data-v-f2d724d4]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;color:var(--color-text-muted)}.ls-card-text[data-v-f2d724d4]{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--space-1)}.ls-card-title[data-v-f2d724d4]{display:flex;align-items:center;gap:var(--space-2);font-size:var(--text-lg);font-weight:var(--weight-medium);color:var(--color-text)}.ls-card-hint[data-v-f2d724d4]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal)}.ls-done-card[data-v-f2d724d4]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4);background:var(--color-surface-raised);border:var(--p-hairline) solid var(--color-success-bd);border-radius:var(--radius-lg)}.ls-done-badge[data-v-f2d724d4]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--radius-full);background:var(--color-success-soft);color:var(--color-success);flex:none}.ls-flow[data-v-f2d724d4]{display:flex;flex-direction:column;gap:var(--space-4)}.ls-center[data-v-f2d724d4]{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);padding:var(--space-6) 0 var(--space-2);text-align:center}.ls-center-text[data-v-f2d724d4]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.ls-success-text[data-v-f2d724d4]{color:var(--color-success)}.ls-err-text[data-v-f2d724d4]{color:var(--color-danger)}.ls-warn-text[data-v-f2d724d4]{color:var(--color-warning)}.ls-center-hint[data-v-f2d724d4]{font-size:var(--text-sm);color:var(--color-text-muted)}.ls-device[data-v-f2d724d4]{display:flex;flex-direction:column;gap:var(--space-4)}.ls-hero[data-v-f2d724d4]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);text-align:center}.ls-hero-icon[data-v-f2d724d4]{display:inline-flex;margin-bottom:var(--space-1)}.ls-hero-title[data-v-f2d724d4]{font-size:var(--text-lg);font-weight:var(--weight-medium);color:var(--color-text)}.ls-hero-hint[data-v-f2d724d4]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal);font-variant-numeric:tabular-nums}.ls-manual[data-v-f2d724d4]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2)}.ls-manual-label[data-v-f2d724d4]{font-size:var(--text-xs);color:var(--color-text-faint)}.ls-copy-text[data-v-f2d724d4]{margin-left:var(--space-2)}.ls-copy-text.is-copied[data-v-f2d724d4]{color:var(--color-success);text-decoration:none}.ls-or[data-v-f2d724d4]{display:flex;align-items:center;gap:var(--space-3);color:var(--color-text-muted);font-size:var(--text-xs);letter-spacing:.06em}.ls-or[data-v-f2d724d4]:before,.ls-or[data-v-f2d724d4]:after{content:"";flex:1;height:1px;background:var(--color-line)}.ls-fb-text[data-v-f2d724d4]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal)}.ls-fb-link[data-v-f2d724d4]{color:var(--color-accent);text-decoration:none;border-bottom:var(--p-hairline) solid var(--color-accent-bd)}.ls-fb-link[data-v-f2d724d4]:hover{border-bottom-color:var(--color-accent)}.ls-code-row[data-v-f2d724d4]{display:flex;align-items:center;gap:var(--space-3);background:var(--color-surface-sunken);border:var(--p-hairline) solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3)}.ls-code[data-v-f2d724d4]{flex:1;font-family:var(--font-mono);font-size:var(--text-xl);font-weight:var(--weight-medium);color:var(--color-text);letter-spacing:.14em}.ls-copy.is-copied[data-v-f2d724d4]{color:var(--color-success);border-color:var(--color-success-bd)}.ls-actions[data-v-f2d724d4]{display:flex;justify-content:flex-end;gap:var(--space-3)}@media(max-width:640px){.ls-code-row[data-v-f2d724d4],.ls-actions[data-v-f2d724d4]{flex-wrap:wrap}.ls-code[data-v-f2d724d4]{min-width:0;overflow-wrap:anywhere;letter-spacing:.08em}}.wizard[data-v-555fb599]{position:fixed;inset:0;z-index:var(--z-modal);display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);overflow-y:auto;font-family:var(--font-ui)}.wiz-body[data-v-555fb599]{flex:1;display:flex;flex-direction:column;align-items:center;width:min(560px,100%);margin:0 auto;padding:max(var(--space-8),12vh) var(--space-5) var(--space-6)}.wiz-step[data-v-555fb599]{display:flex;flex-direction:column;align-items:center;width:100%;flex:1;min-height:0}.wiz-step-fill[data-v-555fb599]{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;width:100%}.wiz-title[data-v-555fb599]{margin:var(--space-4) 0 0;font-size:var(--text-2xl);font-weight:var(--weight-semibold);line-height:var(--leading-tight);color:var(--color-text);text-align:center}.wiz-sub[data-v-555fb599]{margin:var(--space-2) 0 var(--space-6);font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted);text-align:center;max-width:460px}.pref-group[data-v-555fb599]{width:100%;margin-bottom:var(--space-5)}.pref-label[data-v-555fb599]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted);margin-bottom:var(--space-2)}.opt-card[data-v-555fb599]{display:flex;align-items:center;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);font-family:var(--font-ui);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out)}.opt-card[data-v-555fb599]:hover{border-color:var(--color-line-strong)}.opt-card[data-v-555fb599]:focus-visible{outline:none;box-shadow:var(--p-focus-ring-strong)}.opt-card.selected[data-v-555fb599]{border-color:var(--color-accent);background:var(--color-accent-soft)}.opt-label[data-v-555fb599]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.lang-cards[data-v-555fb599]{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--space-3);width:100%}.lang-card[data-v-555fb599]{gap:var(--space-3);padding:var(--space-4)}.opt-radio[data-v-555fb599]{width:18px;height:18px;border-radius:var(--radius-full);border:.5px solid var(--color-line-strong);background:var(--color-surface-raised);flex:none;display:inline-flex;align-items:center;justify-content:center;transition:border-color var(--duration-fast) var(--ease-out)}.opt-radio[data-v-555fb599]:after{content:"";width:8px;height:8px;border-radius:var(--radius-full);background:transparent;transition:background var(--duration-fast) var(--ease-out)}.opt-radio.on[data-v-555fb599]{border-color:var(--color-accent)}.opt-radio.on[data-v-555fb599]:after{background:var(--color-accent)}.theme-cards[data-v-555fb599]{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-3);width:100%}.theme-card[data-v-555fb599]{flex-direction:column;gap:var(--space-3);padding:var(--space-3)}.tp[data-v-555fb599]{display:flex;width:100%;aspect-ratio:16 / 10;border:.5px solid var(--color-line);border-radius:var(--radius-md);overflow:hidden}.tp-light[data-v-555fb599]{background:#fff}.tp-dark[data-v-555fb599]{background:#0d1117}.tp-half[data-v-555fb599]{flex:1;display:flex;min-width:0}.tp-half-light[data-v-555fb599]{background:#fff}.tp-half-dark[data-v-555fb599]{background:#0d1117}.tp-side[data-v-555fb599]{width:30%;flex:none}.tp-light .tp-side[data-v-555fb599],.tp-half-light .tp-side[data-v-555fb599]{background:#0000000d}.tp-dark .tp-side[data-v-555fb599],.tp-half-dark .tp-side[data-v-555fb599]{background:#ffffff12}.tp-lines[data-v-555fb599]{flex:1;display:flex;flex-direction:column;gap:6px;padding:14% 12%}.tp-lines span[data-v-555fb599]{height:6px;border-radius:var(--radius-full)}.tp-lines span[data-v-555fb599]:nth-child(1){width:62%}.tp-lines span[data-v-555fb599]:nth-child(2){width:88%}.tp-lines span[data-v-555fb599]:nth-child(3){width:44%}.tp-light .tp-lines span[data-v-555fb599],.tp-half-light .tp-lines span[data-v-555fb599]{background:#00000024}.tp-dark .tp-lines span[data-v-555fb599],.tp-half-dark .tp-lines span[data-v-555fb599]{background:#ffffff38}.wiz-foot[data-v-555fb599]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);width:100%;margin-top:auto;padding:var(--space-8) 0 max(var(--space-8),8vh)}.wiz-foot-ghost[data-v-555fb599]{display:flex;gap:var(--space-3);min-height:32px;align-items:center}.wiz-foot-ghost[data-v-555fb599] .ui-button--ghost:not(:disabled):hover{background:transparent;color:var(--color-text)}.wiz-primary[data-v-555fb599]{min-width:140px}@media(max-width:640px){.theme-cards[data-v-555fb599]{gap:var(--space-2)}}.kap-root[data-v-2b13888e]{height:100vh;display:flex;flex-direction:column;background:var(--bg);font-family:var(--mono);font-size:calc(var(--ui-font-size) - 2.5px);color:var(--color-text)}.kap-head[data-v-2b13888e]{flex:none;display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:.5px solid var(--line);background:var(--panel)}.kap-count[data-v-2b13888e]{color:var(--muted)}.kap-head-actions[data-v-2b13888e]{margin-left:auto;display:flex;gap:6px}.kap-head-actions button[data-v-2b13888e],.kap-view-toggle button[data-v-2b13888e]{padding:3px 8px;border:.5px solid var(--line);border-radius:6px;background:var(--bg);color:var(--muted);font:inherit;cursor:pointer}.kap-head-actions button[data-v-2b13888e]:hover,.kap-view-toggle button[data-v-2b13888e]:hover{color:var(--color-text)}.kap-head-actions button.on[data-v-2b13888e],.kap-view-toggle button.on[data-v-2b13888e]{color:var(--color-accent-hover);border-color:var(--color-accent-bd);background:var(--color-accent-soft)}.kap-filters[data-v-2b13888e]{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:7px 10px;border-bottom:.5px solid var(--line)}.kap-filters select[data-v-2b13888e],.kap-filters input[type=text][data-v-2b13888e]{padding:3px 6px;border:.5px solid var(--line);border-radius:6px;background:var(--bg);color:var(--color-text);font:inherit;min-width:0}.kap-filters input[type=text][data-v-2b13888e]{flex:1;min-width:120px}.kap-check[data-v-2b13888e]{display:inline-flex;align-items:center;gap:4px;color:var(--muted);white-space:nowrap}.kap-view-toggle[data-v-2b13888e]{display:flex;gap:0}.kap-view-toggle button[data-v-2b13888e]:first-child{border-radius:6px 0 0 6px;border-right:none}.kap-view-toggle button[data-v-2b13888e]:last-child{border-radius:0 6px 6px 0}.kap-list[data-v-2b13888e]{flex:1;min-height:0;overflow-y:auto}.kap-empty[data-v-2b13888e]{padding:18px 12px;color:var(--muted);text-align:center}.kap-row[data-v-2b13888e]{display:flex;align-items:baseline;gap:7px;width:100%;padding:3px 10px;border:none;border-bottom:.5px solid var(--line);background:transparent;color:var(--color-text);font:inherit;text-align:left;cursor:pointer}.kap-row[data-v-2b13888e]:hover{background:var(--panel2)}.kap-row.expanded[data-v-2b13888e]{background:var(--color-accent-soft)}.kap-ts[data-v-2b13888e]{flex:none;color:var(--muted)}.kap-badge[data-v-2b13888e]{flex:none;padding:0 5px;border-radius:var(--radius-sm);font-size:max(9px,calc(var(--ui-font-size) - 4.5px));font-weight:500;line-height:1.7}.b-rest[data-v-2b13888e]{background:var(--color-accent-soft);color:var(--color-accent-hover)}.b-in[data-v-2b13888e]{background:var(--color-accent-soft);color:var(--color-success)}.b-out[data-v-2b13888e]{background:var(--color-accent-soft);color:var(--color-warning)}.b-life[data-v-2b13888e]{background:var(--panel2);color:var(--muted)}.b-err[data-v-2b13888e]{background:var(--color-warning);color:var(--bg)}.kap-label[data-v-2b13888e]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kap-detail[data-v-2b13888e]{border-bottom:.5px solid var(--line);background:var(--bg);padding:6px 10px 10px}.kap-detail-actions[data-v-2b13888e]{display:flex;justify-content:flex-end;margin-bottom:4px}.kap-detail-actions button[data-v-2b13888e]{padding:2px 8px;border:.5px solid var(--line);border-radius:6px;background:var(--panel);color:var(--muted);font:inherit;cursor:pointer}.kap-detail-actions button[data-v-2b13888e]:hover{color:var(--color-text)}.kap-detail pre[data-v-2b13888e]{margin:0;max-height:320px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-size:calc(var(--ui-font-size) - 3px);line-height:1.45}.kap-agg[data-v-2b13888e]{flex:1;min-height:0;overflow-y:auto;padding:8px 10px}.kap-agg h4[data-v-2b13888e]{margin:8px 0 4px;font-size:calc(var(--ui-font-size) - 2.5px);color:var(--muted)}.kap-agg table[data-v-2b13888e]{width:100%;border-collapse:collapse}.kap-agg th[data-v-2b13888e],.kap-agg td[data-v-2b13888e]{padding:3px 6px;border-bottom:.5px solid var(--line);text-align:left;vertical-align:top}.kap-agg th[data-v-2b13888e]{color:var(--muted);font-weight:500}.kap-agg .num[data-v-2b13888e]{text-align:right}.kap-agg .err[data-v-2b13888e]{color:var(--color-warning);font-weight:500}.kap-agg .mono[data-v-2b13888e]{word-break:break-all}.kap-fab[data-v-21de79fc]{position:fixed;right:10px;bottom:10px;z-index:var(--z-overlay);padding:5px 9px;border:.5px solid var(--line);border-radius:8px;background:var(--panel);color:var(--muted);font-family:var(--mono);font-size:calc(var(--ui-font-size) - 3px);font-weight:500;letter-spacing:.04em;cursor:pointer;opacity:.75}.kap-fab[data-v-21de79fc]:hover{opacity:1;color:var(--color-accent)}.server-auth-hint[data-v-05495fe9]{margin:0 0 var(--space-3);font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted)}.server-auth-hint code[data-v-05495fe9]{padding:1px 5px;font-family:var(--font-mono);font-size:var(--text-xs);background:var(--color-surface-sunken);border-radius:var(--radius-xs)}.internal-build-tag[data-v-439d3299]{flex:none;display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:999px;background:#f5a623;color:#3a2a00;font-size:11px;font-weight:700;letter-spacing:.01em;line-height:1.4;white-space:nowrap;user-select:none}.gload-fade-leave-active[data-v-db3fae69]{transition:opacity .28s ease}.gload-fade-leave-to[data-v-db3fae69]{opacity:0}.action-toast-enter-active[data-v-db3fae69],.action-toast-leave-active[data-v-db3fae69]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.action-toast-leave-active[data-v-db3fae69]{transition-duration:var(--duration-fast);pointer-events:none}.action-toast-enter-from[data-v-db3fae69],.action-toast-leave-to[data-v-db3fae69]{opacity:0;transform:translateY(-6px)}.app-shell[data-v-db3fae69]{position:fixed;top:var(--app-top, 0px);left:0;right:0;height:100vh;height:100dvh;height:var(--app-height, 100dvh);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}.app[data-v-db3fae69]{flex:1;min-height:0;position:relative;display:grid;grid-template-columns:auto 0 minmax(0,1fr) auto;background:var(--bg);color:var(--color-text);overflow:hidden;box-sizing:border-box}.app[data-v-db3fae69]>*{min-height:0;min-width:0}.app>.side[data-v-db3fae69]{grid-column:1}.side-handle[data-v-db3fae69]{grid-column:2}.app:not(.mobile)>.con[data-v-db3fae69]{grid-column:3}.app.panel-expanded[data-v-db3fae69]{grid-template-columns:auto 0 0 minmax(0,1fr)}.app.panel-expanded>.con[data-v-db3fae69]{display:none}.sidebar-toggle-btn[data-v-db3fae69]{position:absolute;top:11px;left:16px;z-index:var(--z-sticky);animation:sidebar-toggle-btn-in-db3fae69 .18s var(--ease-out) .12s backwards;-webkit-app-region:no-drag}.app.macos-desktop .sidebar-toggle-btn[data-v-db3fae69]{left:84px;animation:none}.new-chat-btn[data-v-db3fae69]{position:absolute;top:11px;left:42px;z-index:var(--z-sticky);animation:sidebar-toggle-btn-in-db3fae69 .18s var(--ease-out) .12s backwards;-webkit-app-region:no-drag}.app.macos-desktop .new-chat-btn[data-v-db3fae69]{left:110px}@keyframes sidebar-toggle-btn-in-db3fae69{0%{opacity:0}}.internal-build-fab[data-v-db3fae69]{position:absolute;right:var(--space-3);bottom:var(--space-3);z-index:var(--z-sticky);pointer-events:none}.app.mobile[data-v-db3fae69]{grid-template-columns:1fr;grid-template-rows:auto 1fr}:root{--panel-head-h: 48px;--panel-head-inset: calc((var(--panel-head-h) - var(--icon-button-sm)) / 2)}.app.panel-expanded.sidebar-collapsed .panel-tab-bar{padding-left:var(--header-collapsed-clearance)}.app.panel-expanded.sidebar-collapsed.macos-desktop .panel-tab-bar{padding-left:var(--header-collapsed-clearance-macos)}.app.sidebar-collapsed .session-admin .sa-head{padding-left:var(--header-collapsed-clearance)}.app.sidebar-collapsed.windows-desktop .session-admin .sa-head{padding-left:var(--space-6)}.app.sidebar-collapsed.macos-desktop .session-admin .sa-head{padding-left:var(--header-collapsed-clearance-macos)}.app.fullscreen.sidebar-collapsed.macos-desktop .session-admin .sa-head{padding-left:var(--header-collapsed-clearance)}.app.macos-desktop .global-preview .ui-panel-header{-webkit-app-region:drag}.app.macos-desktop .global-preview .ui-panel-header button,.app.macos-desktop .global-preview .ui-panel-header input{-webkit-app-region:no-drag}.app.macos-desktop:has(.ch-menu,.open-in-menu,.dock-work-panel,.copy-menu-open) .chat-header,.app.macos-desktop:has(.ch-menu,.open-in-menu,.dock-work-panel,.copy-menu-open) .side .ch,.app.macos-desktop:has(.ch-menu,.open-in-menu,.dock-work-panel,.copy-menu-open) .global-preview .ui-panel-header{-webkit-app-region:no-drag}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(data:font/woff2;base64,d09GMgABAAAAAAfsABQAAAAAEAwAAAeCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhwbHhwoP0hWQVJbBmA/U1RBVIFiJyYAdC9qEQgKhGSEAAsgADCGCAE2AiQDOgQgBYlMB4EUDAcbLQ4onoexrSC/2ZyLAa8p8VHB8/x3Vue+V0hVJalMJg2nx/TCrQXxBeqLjQG7FyM1WEa/X1tEXN7cFz9EJEMmMUz3RihWSSKeQCbcIou0izz/C8v+fq3VfajEa9gDD11CImXS7qL/RJFVzC1qiB6KmKeD6TZdQ6IRGv78dL6uSVVCfgni5mzu7kcgQBgAEAQTQRCoL++STTYybkJxNfQxAAIAGu8OdEB9teW2jh4BpgDqFjAeSEByW3zFP0CBBgNMsMCGEDjgggdhiEAUAeIIED7ABTDUEnkIE9Q9ahFgKttcVhApo4ACB4qobHaccgDfEjFO6aaWUhjMLt2SyIvHKoDqoA4CSUwEIYQCEjhAO9R1G6keDeDZGjNo+AhxOjCEGTr1WeIF3kYBiLAOKvkJSMiKX0VdAyQt3SDJClCkxJCHkCzfqyVTriJZLcolS32JZHUekq2TYNkYtCtjYHMQXSxGjXDz2t/yLWXzDzxz+o3zFwDEaN23F+13pyMdQAEaSKAR9vcGq4A4MTSKCElGW+M7UcY7xqkggITb28ZJhlqc9q2twYKTt0NjixBgYvO9BIihEBLYuOFXQzfIQ7dXGUEEEgFDooBfAzqiQbpJrhiWSuKJCRFKYbHCyJKI2G5GiZbNAvgAu5pc3vwx4G+g3aDkhklABiSz0BICXrYghtYhx/cdJ+44rY2oZ0aMNRFz3VZjb6W33F3gzltqtOCV8tTHSpOeXuItfvr5lCdfzFpqtEitvqdcdGGFd28ZqqC0tPbeChGXgrIlnhSWu/eUso4uKWFLugyDzQJhflY4659+WjQ++6x72WUMv9G8mw6QJl7BVxX5fe/kpUsOvnZwee9uQ0cGXYd0o89XB2748sDSnt8d2VphdOTTgceDVvOds0v9P/s7HPq15aGun/6Vllb56f1dl0t1LejqrNkpdRZsG8TOnM5vkBG5oiVyVGnS8LHps5cfNWJs6qKPfaNSxiQNBUm3cKNWROr0GSur7Za31k1vieq7LH11VF+jXdRIasRKflc7jkobm1Z9te1IyZA0pDkhLR98+H37Zf1c/8at+dB7x+7GfVyTfJMPiYztsnl59Y5l4j+0n1RXlpHnF3Tq7HecmNF/CJodEMAikruxiyJaGLvHOdAfoA+oDvpjBm2b91cHGRZMU9n25xEU0A8fgEEAdKI3Q1iDtc034sug5YVMkE2jsE+BIkwSoQ3gxXMqz9tELp48bd0cFKOKS7xYjEuXBnZP5ia7DyiO/X/YI+PQSbt2uSdqAkWL9nQbV1XB94/+uPfdZz8dnXYFBYrcTl2SIR/ybxJNJPz/Gupb0JaZeens2ekC7EKr8t+Ls/P5VJPYJdHKyqfg2nqU6bhlidzcddQV/7MmecTzJ5VPcKXkNKSEogHjYFx6QZ7rQ+FSe8njaiNuOnXS8H2ScQ619c2mC3VTtauL0rRbXd/CkSOP37FY9Zkjz8+GibYUMOEWF+RdrFS8Ecv1SHOpPUPZGEIpjPvFyU5cXKjd6OXqorTqy9GwRd++HVufPGnVsW+aO3vggKZ18jR9sXaTC1PWTEsVUaK0FkNySbTQDqlm2PfDjZcu4aalnSLKjnOoYQ0nUlqqXcGpPu/4VgV/xU2pAqW4BW3qzhQ8/hFKhV2qE3+BKAtDqBXjfgnVdH4y0wg5tbVNRenNdTWOrenWLcupQdmsbq5b+18piTe/xRdp1xbILxNPJGInm2z6hoB21Lal0i+ePTtd7B45+3XhFJ329evskXm7qurUVREotqSluSo/L29d3qDhI4YOQqWhI4YNvBNfsMHeXKemXrxQfKeuPOGRVayA3JtkJKEgbPp+dXUDluddutRYLFoXGXWX6N3WFaGLbQtRSitVYNacTNSdy7AaG/HSaUEANcBoGXNdcZvZsOqQ1icBDv21/gzAoYPHH/WDW0qNR3QTYKEAEHig6o13NXbND06CQPlRtYjGNnSktRc09k1mAMDvAlDKfQjgy6fssInlfzmNAjKkDxoxHOBLdVRAIVt9j4qo+hA1w9T1aNBNTUOTTNUHLbqokE+UAfJXCIGw/IxCSL5GRUJeR40rL/UxTm4Q08H6MbCs70ObuNyIIXrINHQYInF06UUlevTjbQzTh5upiDMzMMogUtEnjPs/Y7jAHCJeB0GBHh04tC6FiB6ZFB1oArUSIoFoqhzCeAN6lHwm0T4C3VVPWvjpSMXReuWesMEcoqrmgtNBGd2noWeV0hNAz9rFeShNJxHGsPa3HXeKTk8b55hahySYHaYKKFFLpCfN8rsoaJn01CR04Gkc+5k7KVTCmClX8Q10HCrUEkVlSX+XO33oQR9609tJ516H497WSobWs5Up6TLaS10/dessIskgJSLiDlWvHVUywpkQ7hdPZqGyiEF0uVQerVcPamT1A3eKXdyI1vG9OoflrSXihZ1qqGE3nhmAgiIbRCQgPLEPtOM3UQwTLYaYYomNlpA44opnjV6jkD6id80OOrzf6BzmMD6eEa1zKyeYG1fzfEf16V6jw9XYOaar1/b2kP/IYX8oR2mcFvv2GtBV3JXgd437AQAA) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--dim: rgba(0, 0, 0, .6);--muted: rgba(0, 0, 0, .45);--faint: rgba(0, 0, 0, .3);--line: var(--color-line);--line2: var(--color-subtle);--canvas: #f9fbfc;--sh: 0 1px 3px rgba(28, 40, 66, .05), 0 6px 18px rgba(28, 40, 66, .06);--shc: 0 1px 2px rgba(28, 40, 66, .05);--panel: #f5f5f5;--panel2: rgba(0, 0, 0, .05);--bg: #ffffff;--blue: #1783ff;--blue2: #167ff7;--soft: #e8f3ff;--bd: rgba(23, 131, 255, .25);--logo: #1783ff;--bluebg: #e8f3ff;--blueln: rgba(23, 131, 255, .25);--ok: #0e7a38;--warn: #a9610a;--star: #eab308;--err: #c0392b;--hover: var(--color-hover);--r-xs: var(--radius-sm);--r-sm: var(--radius-md);--r-md: var(--radius-lg);--r-lg: var(--radius-xl);--ui-font-size: var(--ui-b2);--ui-font-size-sm: calc(var(--ui-font-size) - 1px);--ui-font-size-xs: calc(var(--ui-font-size) - 2px);--ui-font-size-lg: calc(var(--ui-font-size) + 1px);--ui-font-size-xl: calc(var(--ui-font-size) + 2px);--content-font-size: var(--md-b1);--code-font-size: calc(var(--content-font-size) - 2px);--mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--sans: var(--font-ui);color-scheme:light dark}html[data-color-scheme=light]{color-scheme:light}html[data-color-scheme=system]{color-scheme:light dark}html[data-color-scheme=dark]{color-scheme:dark;--dim: rgba(255, 255, 255, .56);--muted: rgba(255, 255, 255, .42);--faint: rgba(255, 255, 255, .26);--panel: #1f1f1f;--panel2: #121212;--bg: #121212;--blue: #1a88ff;--blue2: #258eff;--soft: rgba(26, 136, 255, .1);--bd: rgba(26, 136, 255, .28);--logo: #1a88ff;--bluebg: #292929;--blueln: rgba(255, 255, 255, .05);--ok: #3fb950;--warn: #d29922;--star: #facc15;--err: #f85149;--hover: var(--color-hover);--canvas: #161717;--sh: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .4);--shc: 0 1px 2px rgba(0, 0, 0, .35)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--dim: rgba(255, 255, 255, .56);--muted: rgba(255, 255, 255, .42);--faint: rgba(255, 255, 255, .26);--panel: #1f1f1f;--panel2: #121212;--bg: #121212;--blue: #1a88ff;--blue2: #258eff;--soft: rgba(26, 136, 255, .1);--bd: rgba(26, 136, 255, .28);--logo: #1a88ff;--bluebg: #292929;--blueln: rgba(255, 255, 255, .05);--ok: #3fb950;--warn: #d29922;--star: #facc15;--err: #f85149;--hover: var(--color-hover);--canvas: #161717;--sh: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .4);--shc: 0 1px 2px rgba(0, 0, 0, .35)}}:root{--color-bg: #ffffff;--color-surface: #f5f5f5;--color-surface-raised: #ffffff;--color-surface-overlay: #ffffff;--color-surface-sunken: #f5f5f5;--color-inline-code-bg: rgba(0, 0, 0, .03);--color-well: #f5f5f5;--color-surface-deep: #f5f5f5;--color-media-alpha-bg-1: color-mix(in srgb, var(--color-bg) 52%, var(--color-text) 48%);--color-media-alpha-bg-2: color-mix(in srgb, var(--color-bg) 42%, var(--color-text) 58%);--media-alpha-canvas: conic-gradient( var(--color-media-alpha-bg-1) 25%, var(--color-media-alpha-bg-2) 0 50%, var(--color-media-alpha-bg-1) 0 75%, var(--color-media-alpha-bg-2) 0 ) 0 0 / 16px 16px;--color-text: rgba(0, 0, 0, .9);--color-text-strong: #000000;--color-text-muted: rgba(0, 0, 0, .6);--color-text-faint: rgba(0, 0, 0, .45);--color-text-on-accent: #ffffff;--color-line: rgba(0, 0, 0, .13);--color-subtle: rgba(0, 0, 0, .05);--color-line-strong: rgba(0, 0, 0, .15);--color-scrim: rgba(0, 0, 0, .4);--color-scrim-strong: rgba(0, 0, 0, .6);--color-text-on-scrim: #ffffff;--color-selected: rgba(0, 0, 0, .05);--color-selected-hover: rgba(0, 0, 0, .08);--color-hover: rgba(0, 0, 0, .03);--color-sidebar-bg: #f9fbfc;--color-user-bubble-bg: #f5f5f5;--color-accent: #1783ff;--color-accent-hover: #167ff7;--color-accent-soft: #e8f3ff;--color-accent-bd: rgba(23, 131, 255, .25);--color-success: #0e7a38;--color-success-soft: #e7f6ee;--color-success-bd: #bfe3cc;--color-warning: #a9610a;--color-warning-soft: #fbf1e0;--color-warning-bd: #f0d9b8;--color-danger: #c0392b;--color-danger-soft: #fbeaea;--color-danger-bd: #f0cccc;--color-diff-add-bg: rgba(22, 196, 86, .25);--color-diff-del-bg: rgba(255, 56, 73, .25);--color-done: #8250df;--color-done-soft: #f3e8ff;--color-done-bd: #e0ccff;--color-info: #1783ff;--color-term-magenta: #8250df;--color-term-cyan: #1b7c83;--color-term-black: #24292f;--space-05: 2px;--space-1: 4px;--space-1-5: 6px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-8: 32px;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 12px;--radius-xl: 16px;--radius-2xl: 20px;--radius-composer: 32px;--corner-shape-composer: superellipse(1.5);--radius-menu-row: var(--radius-sm);--corner-shape-menu: var(--corner-shape-composer);--menu-pad: 3.5px;--radius-menu-item: calc(var(--radius-lg) - var(--menu-pad) - var(--p-hairline));--radius-select-option: calc(var(--radius-md) - var(--space-1) - var(--p-hairline));--radius-dropdown-row: calc(var(--radius-lg) - var(--space-1) - var(--p-hairline));--color-menu-bg-frost: color-mix(in srgb, var(--color-bg) 70%, transparent);--color-topbar-bg-frost: color-mix(in srgb, var(--color-surface) 78%, transparent);--p-topbar-backdrop: saturate(150%) blur(12px);--color-menu-scrollbar: color-mix(in srgb, var(--color-text) 16%, transparent);--color-menu-scrollbar-hover: color-mix(in srgb, var(--color-text) 48%, transparent);--radius-full: 999px;--radius-window: 14px;--radius-window-chip: calc(var(--radius-window) - var(--space-2));--menu-scroll-fade: var(--space-5);--panel-tab-pad-x: 10px;--panel-tab-max-w: 168px;--panel-tab-x-size: 18px;--panel-tab-h: 28px;--panel-launcher-w: 288px;--panel-default-w: 460px;--menu-item-padding-block: 5px;--menu-item-padding-inline: 9px;--menu-row-hug: var(--space-1-5);--menu-rows-seam: 1px;--menu-row-gap-icon: 7px;--menu-row-padding-block: var(--space-05);--menu-row-padding-inline: calc(var(--space-4) - var(--space-3) + var(--menu-row-hug));--menu-row-touch-padding-block: 11px;--menu-scrollbar-width: 3px;--menu-scrollbar-edge: calc(var(--menu-row-hug) + var(--p-hairline) - var(--menu-scrollbar-width));--menu-scrollbar-track-inset: calc(var(--radius-lg) - var(--space-1-5));--menu-scrollbar-thumb-min: 24px;--wm-x-size: calc(var(--p-ic-sm) + var(--space-1));--wm-x-ring: var(--space-1-5);--z-base: 0;--z-raised: 1;--z-sticky: 100;--z-dropdown: 200;--z-overlay: 300;--z-modal: 400;--z-modal-dropdown: 500;--z-toast: 600;--z-tooltip: 650;--z-max: 9999;--shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);--shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);--shadow-menu: 0 6px 18px lch(0% 0 0 / .02), 0 3px 9px lch(0% 0 0 / .04), 0 1px 1px lch(0% 0 0 / .04);--color-menu-bg: rgba(255, 255, 255, .95);--p-menu-backdrop: blur(24px) saturate(1.8);--shadow-input: 0 5px 16px -4px rgba(0, 0, 0, .07);--shadow-md: 0 4px 12px rgba(16, 24, 40, .07), 0 2px 4px rgba(16, 24, 40, .05);--shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 4px 10px rgba(16, 24, 40, .08);--shadow-xl: 0 24px 64px rgba(16, 24, 40, .18), 0 8px 20px rgba(16, 24, 40, .1);--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--duration-fast: .12s;--duration-base: .16s;--duration-slow: .26s;--duration-hover-intent: .25s;--duration-tooltip: .15s;--duration-spin: .7s;--duration-flash: 1.2s;--motion-panel-shift: 2px;--motion-panel-scale: .97;--color-composer-bg: #ffffff;--color-composer-line: rgba(0, 0, 0, .13);--color-composer-focus-line: rgba(0, 0, 0, .25);--color-send-bg: rgba(0, 0, 0, .9);--color-send-bg-hover: #252525;--color-send-icon: #ffffff;--color-stop-glyph: var(--color-danger);--color-send-bg-disabled: rgba(0, 0, 0, .05);--color-send-icon-disabled: rgba(0, 0, 0, .27);--opacity-send-disabled: 1;--shadow-send: 0 7px 16px -13px rgba(0, 0, 0, .38), 0 1px 2px rgba(0, 0, 0, .07);--shadow-send-hover: 0 8px 18px -13px rgba(0, 0, 0, .42), 0 1px 3px rgba(0, 0, 0, .09);--composer-send-icon-size: 28px;--font-ui-latin: "Schibsted Grotesk Variable", "Helvetica Neue", Arial;--font-ui: var(--font-ui-latin), "Noto Sans SC Variable", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-display: var(--font-ui);--font-kbd: "Schibsted Grotesk Variable", system-ui, sans-serif;--kbd-height: 18px;--kbd-min-width: 18px;--kbd-padding-x: 5px;--kbd-font-size: 11px;--font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--text-2xs: calc(var(--ui-c1) - 1px);--text-xs: var(--ui-c1);--text-sm: calc(var(--ui-b2) - 1px);--text-base: var(--ui-b2);--text-lg: var(--ui-t2);--text-xl: var(--ui-t1);--text-2xl: var(--ui-t0);--leading-solid: 1;--leading-tight: 1.25;--leading-caption: 1.4;--leading-normal: 1.5;--leading-prose: 1.6;--leading-relaxed: 1.7;--weight-regular: 400;--weight-caption: 450;--weight-option-label: 475;--weight-medium: 500;--weight-ui-strong: 525;--weight-section-label: 600;--weight-semibold: 700;--ui-shift: calc(var(--base-font, 14px) - 14px);--md-shift: var(--ui-shift);--ui-t0: min(calc(20px + var(--ui-shift)), 24px);--ui-t1: min(calc(18px + var(--ui-shift)), 22px);--ui-t2: calc(16px + var(--ui-shift));--ui-b1: calc(15px + var(--ui-shift));--ui-b2: calc(14px + var(--ui-shift));--ui-c1: calc(12px + var(--ui-shift));--ui-c2: calc(10px + var(--ui-shift));--md-h1: calc(22px + var(--md-shift));--md-h2: calc(20px + var(--md-shift));--md-h3: calc(18px + var(--md-shift));--md-b1: calc(14px + var(--md-shift));--md-b2: calc(13px + var(--md-shift));--md-b3: calc(13px + var(--md-shift));--p-focus-ring-w: 3px;--p-focus-ring: 0 0 0 var(--p-focus-ring-w) var(--color-accent-soft);--p-focus-ring-strong: 0 0 0 var(--p-focus-ring-w) var(--color-accent-soft), 0 0 0 1px var(--color-accent);--p-selection: rgba(23, 131, 255, .2);--color-code-selection: rgba(23, 131, 255, .346);--color-code-selection-text: currentColor;--code-pad-block: calc(var(--text-sm) * (var(--leading-normal) - 1) / 2);--diff-sign-col: 14px;--p-ic-sm: 14px;--p-ic-md: 16px;--p-ring-stroke: 1.5px;--p-ic-lg: 20px;--p-empty-ico: 28px;--p-hairline: .5px;--p-findring-w: 2px;--p-pill-excerpt-max: 24em;--p-tip-quote-lines: 8.5lh;--p-tip-comment-lines: 4.5lh;--p-scroll-seam-h: 18px;--p-sidebar-seam-h: 13px;--icon-button-sm: 26px;--touch-target-min: 44px;--resize-handle-step: 16px;--resize-handle-step-lg: 48px;--p-chip-num: 20px;--p-sidebar-w: 264px;--p-content-max: 760px;--p-content-wide: 920px;--p-table-max: 1040px;--p-table-cell-max: 700px;--p-findbar-w: 340px;--p-bubble-max: 78%;--p-dock-panel-h: 320px;--p-subagent-card-min: 180px;--p-slash-menu-h: 228px;--p-mention-menu-h: 296px;--p-mention-tip-w: 320px;--p-mention-tip-media-w: 300px;--p-mention-tip-media-h: 220px;--p-mention-tip-media-min-w: 190px;--p-mention-tip-media-preview-min-h: 64px;--p-mention-tip-media-check: 12px;--p-mention-tip-media-ring: 12px;--p-mention-tip-media-spin: 10px;--p-mention-tip-media-check-bg: linear-gradient(45deg, color-mix(in srgb, var(--color-bg) 7%, transparent) 25%, transparent 25%), linear-gradient(-45deg, color-mix(in srgb, var(--color-bg) 7%, transparent) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--color-bg) 7%, transparent) 75%), linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--color-bg) 7%, transparent) 75%);--p-selection-bubble-w: 280px;--p-tip-max-w: 280px;--p-mention-tip-vmargin: var(--space-3);--p-mention-tip-spinner-lift: -.1em;--opacity-stale: .55;--p-add-menu-h: var(--p-slash-menu-h);--p-bp-sm: 640px;--p-bp-md: 980px}:root,html[data-font-scale=medium]{--base-font: 14px}html[data-font-scale=small]{--base-font: 12px}html[data-font-scale=large]{--base-font: 16px}html[data-font-scale=xlarge]{--base-font: 18px}.text-ui-t0{font-size:var(--ui-t0);line-height:round(calc(var(--ui-t0) * 1.4),1px)}.text-ui-t1{font-size:var(--ui-t1);line-height:round(calc(var(--ui-t1) * 1.44),1px)}.text-ui-t2{font-size:var(--ui-t2);line-height:round(calc(var(--ui-t2) * 1.5),1px)}.text-ui-b1{font-size:var(--ui-b1);line-height:round(calc(var(--ui-b1) * 1.47),1px)}.text-ui-b2{font-size:var(--ui-b2);line-height:round(calc(var(--ui-b2) * 1.42),1px)}.text-ui-c1{font-size:var(--ui-c1);line-height:round(calc(var(--ui-c1) * 1.5),1px)}.text-ui-c2{font-size:var(--ui-c2);line-height:round(calc(var(--ui-c2) * 1.4),1px)}.text-md-h1{font-size:var(--md-h1);line-height:round(calc(var(--md-h1) * 1.63),1px)}.text-md-h2{font-size:var(--md-h2);line-height:round(calc(var(--md-h2) * 1.6),1px)}.text-md-h3{font-size:var(--md-h3);line-height:round(calc(var(--md-h3) * 1.56),1px)}.text-md-b1{font-size:var(--md-b1);line-height:round(calc(var(--md-b1) * 1.625),1px)}.text-md-b2{font-size:var(--md-b2);line-height:round(calc(var(--md-b2) * 1.6),1px)}.text-md-b3{font-size:var(--md-b3);line-height:round(calc(var(--md-b3) * 1.57),1px)}html[data-color-scheme=dark]{--color-bg: #121212;--color-surface: #1f1f1f;--color-surface-raised: #292929;--color-surface-overlay: rgba(255, 255, 255, .1);--color-surface-sunken: #121212;--color-inline-code-bg: rgba(255, 255, 255, .1);--color-well: #1f1f1f;--color-surface-deep: #0d0d0d;--color-text: rgba(255, 255, 255, .84);--color-text-strong: #ffffff;--color-text-muted: rgba(255, 255, 255, .56);--color-text-faint: rgba(255, 255, 255, .42);--color-line: rgba(255, 255, 255, .12);--color-subtle: rgba(255, 255, 255, .05);--color-line-strong: rgba(255, 255, 255, .18);--color-scrim: rgba(0, 0, 0, .6);--color-scrim-strong: rgba(0, 0, 0, .75);--color-selected: rgba(255, 255, 255, .1);--color-selected-hover: rgba(255, 255, 255, .14);--color-hover: rgba(255, 255, 255, .05);--color-sidebar-bg: #0d0d0d;--color-user-bubble-bg: #292929;--color-accent: #1a88ff;--color-accent-hover: #258eff;--color-accent-soft: rgba(26, 136, 255, .1);--color-accent-bd: rgba(26, 136, 255, .28);--p-selection: rgba(26, 136, 255, .2);--color-code-selection: rgba(26, 136, 255, .27);--color-code-selection-text: currentColor;--color-success: #3fb950;--color-success-soft: rgba(63, 185, 80, .14);--color-success-bd: rgba(63, 185, 80, .28);--color-warning: #d29922;--color-warning-soft: rgba(210, 153, 34, .14);--color-warning-bd: rgba(210, 153, 34, .28);--color-danger: #f85149;--color-danger-soft: rgba(248, 81, 73, .14);--color-danger-bd: rgba(248, 81, 73, .28);--color-diff-add-bg: rgba(63, 185, 80, .14);--color-diff-del-bg: rgba(248, 81, 73, .14);--color-done: #a371f7;--color-done-soft: rgba(163, 113, 247, .14);--color-done-bd: rgba(163, 113, 247, .28);--color-info: #1a88ff;--color-term-magenta: #d2a8ff;--color-term-cyan: #76e3ea;--color-term-black: #484f58;--color-composer-bg: #1f1f1f;--color-composer-line: rgba(255, 255, 255, .12);--color-composer-focus-line: rgba(255, 255, 255, .25);--color-send-bg: rgba(255, 255, 255, .84);--color-send-bg-hover: rgba(255, 255, 255, .848);--color-send-icon: #1f1f1f;--color-stop-glyph: color-mix(in srgb, var(--color-danger) 72%, transparent);--color-send-bg-disabled: rgba(255, 255, 255, .1);--color-send-icon-disabled: rgba(255, 255, 255, .28);--shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .18);--shadow-menu: 0 6px 18px rgba(0, 0, 0, .2), 0 3px 9px rgba(0, 0, 0, .24), 0 1px 1px rgba(0, 0, 0, .24);--color-menu-bg: rgba(41, 41, 41, .95);--shadow-input: 0 5px 16px -4px rgba(0, 0, 0, .07);--shadow-md: 0 4px 12px rgba(0, 0, 0, .3), 0 2px 4px rgba(0, 0, 0, .24);--shadow-lg: 0 12px 32px rgba(0, 0, 0, .34), 0 4px 10px rgba(0, 0, 0, .28);--shadow-xl: 0 24px 64px rgba(0, 0, 0, .42), 0 8px 20px rgba(0, 0, 0, .32)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--color-bg: #121212;--color-surface: #1f1f1f;--color-surface-raised: #292929;--color-surface-overlay: rgba(255, 255, 255, .1);--color-surface-sunken: #121212;--color-inline-code-bg: rgba(255, 255, 255, .1);--color-well: #1f1f1f;--color-surface-deep: #0d0d0d;--color-text: rgba(255, 255, 255, .84);--color-text-strong: #ffffff;--color-text-muted: rgba(255, 255, 255, .56);--color-text-faint: rgba(255, 255, 255, .42);--color-line: rgba(255, 255, 255, .12);--color-subtle: rgba(255, 255, 255, .05);--color-line-strong: rgba(255, 255, 255, .18);--color-scrim: rgba(0, 0, 0, .6);--color-scrim-strong: rgba(0, 0, 0, .75);--color-selected: rgba(255, 255, 255, .1);--color-selected-hover: rgba(255, 255, 255, .14);--color-hover: rgba(255, 255, 255, .05);--color-sidebar-bg: #0d0d0d;--color-user-bubble-bg: #292929;--color-accent: #1a88ff;--color-accent-hover: #258eff;--color-accent-soft: rgba(26, 136, 255, .1);--color-accent-bd: rgba(26, 136, 255, .28);--p-selection: rgba(26, 136, 255, .2);--color-code-selection: rgba(26, 136, 255, .27);--color-code-selection-text: currentColor;--color-success: #3fb950;--color-success-soft: rgba(63, 185, 80, .14);--color-success-bd: rgba(63, 185, 80, .28);--color-warning: #d29922;--color-warning-soft: rgba(210, 153, 34, .14);--color-warning-bd: rgba(210, 153, 34, .28);--color-danger: #f85149;--color-danger-soft: rgba(248, 81, 73, .14);--color-danger-bd: rgba(248, 81, 73, .28);--color-diff-add-bg: rgba(63, 185, 80, .14);--color-diff-del-bg: rgba(248, 81, 73, .14);--color-done: #a371f7;--color-done-soft: rgba(163, 113, 247, .14);--color-done-bd: rgba(163, 113, 247, .28);--color-term-magenta: #d2a8ff;--color-term-cyan: #76e3ea;--color-term-black: #484f58;--color-info: #1a88ff;--color-composer-bg: #1f1f1f;--color-composer-line: rgba(255, 255, 255, .12);--color-composer-focus-line: rgba(255, 255, 255, .25);--color-send-bg: rgba(255, 255, 255, .84);--color-send-bg-hover: rgba(255, 255, 255, .848);--color-send-icon: #1f1f1f;--color-stop-glyph: color-mix(in srgb, var(--color-danger) 72%, transparent);--color-send-bg-disabled: rgba(255, 255, 255, .1);--color-send-icon-disabled: rgba(255, 255, 255, .28);--shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .18);--shadow-menu: 0 6px 18px rgba(0, 0, 0, .2), 0 3px 9px rgba(0, 0, 0, .24), 0 1px 1px rgba(0, 0, 0, .24);--color-menu-bg: rgba(41, 41, 41, .95);--shadow-input: 0 5px 16px -4px rgba(0, 0, 0, .07);--shadow-md: 0 4px 12px rgba(0, 0, 0, .3), 0 2px 4px rgba(0, 0, 0, .24);--shadow-lg: 0 12px 32px rgba(0, 0, 0, .34), 0 4px 10px rgba(0, 0, 0, .28);--shadow-xl: 0 24px 64px rgba(0, 0, 0, .42), 0 8px 20px rgba(0, 0, 0, .32)}}:root{--color-sidebar-tint: rgba(255, 255, 255, .2)}html[data-color-scheme=dark]{--color-sidebar-tint: rgba(0, 0, 0, .12)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--color-sidebar-tint: rgba(0, 0, 0, .12)}}:root{--color-search-match: #ffe066;--color-search-match-current: #ffc531}html[data-color-scheme=dark]{--color-search-match: rgba(255, 197, 49, .3);--color-search-match-current: rgba(255, 197, 49, .55)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--color-search-match: rgba(255, 197, 49, .3);--color-search-match-current: rgba(255, 197, 49, .55)}}::highlight(kimi-transcript-search){background-color:var(--color-search-match)}::highlight(kimi-transcript-search-current){background-color:var(--color-search-match-current)}.mention-pill,.attachment-pill,.quote-pill{display:inline-flex;align-items:baseline;gap:var(--space-05);color:var(--color-text-muted);font-weight:var(--weight-ui-strong);white-space:nowrap;text-decoration:none;vertical-align:baseline;padding-inline:var(--space-05);transition:color var(--duration-fast) var(--ease-out)}.mention-pill:hover,.attachment-pill:hover{color:var(--color-text)}.mention-pill:hover .mention-pill-icon,.attachment-pill:hover .attachment-pill-icon{color:inherit}.mention-pill.mention-file,.mention-pill.mention-skill,.attachment-pill[data-attachment-url]{cursor:pointer}.mention-pill.mention-file:hover,.mention-pill.mention-skill:hover,.attachment-pill[data-attachment-url]:hover{text-decoration:underline}.mention-pill:focus-visible,.attachment-pill:focus-visible,.quote-pill:focus-visible{outline:none;box-shadow:var(--p-focus-ring);border-radius:var(--radius-sm)}.ProseMirror .mention-pill,.ProseMirror .mention-pill:hover,.ProseMirror .attachment-pill,.ProseMirror .attachment-pill:hover,.ProseMirror .quote-pill,.ProseMirror .quote-pill:hover{cursor:text;text-decoration:none}a.mention-folder{cursor:default}.mention-pill.mention-skill.mention-inert,.mention-pill.mention-skill.mention-inert:hover{cursor:default;text-decoration:none}.mention-pill-name,.attachment-pill-name,.quote-pill-name{max-width:var(--p-pill-excerpt-max);min-width:0;overflow:hidden;text-overflow:ellipsis}.mention-pill-icon,.attachment-pill-icon,.quote-pill-icon{display:inline-flex;align-items:center;justify-content:center;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--muted);align-self:center;flex-shrink:0}.mention-pill-icon svg,.attachment-pill-icon svg,.quote-pill-icon svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block;stroke:currentColor;stroke-width:var(--p-hairline)}.mention-pill.pill-in-selection,.attachment-pill.pill-in-selection,.quote-pill.pill-in-selection{background:var(--p-selection);border-radius:var(--radius-sm)}.quote-pill{color:var(--color-accent)}.quote-pill-icon{color:inherit}.quote-pill:hover{color:var(--color-accent-hover)}.quote-pill:focus-visible{box-shadow:0 0 0 1px var(--color-accent),0 0 0 var(--p-focus-ring-w) var(--color-accent-soft)}.quote-pill-comment{max-width:var(--p-pill-excerpt-max);min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--color-text-muted);font-weight:var(--weight-regular)}.quote-pill-comment:before{content:"·";color:var(--color-text-faint);margin-inline:var(--space-1-5) var(--space-1)}.composer-text .q-sep{font-size:0;white-space:normal}.mention-tip{position:fixed;z-index:var(--z-tooltip);max-width:min(var(--p-mention-tip-w),calc(100vw - 2 * var(--p-mention-tip-vmargin)));padding:var(--space-1) var(--space-2);border-radius:var(--radius-sm);background:var(--color-text);color:var(--color-bg);--p-tip-line: color-mix(in srgb, currentColor 18%, transparent);--p-tip-ink: color-mix(in srgb, currentColor 80%, transparent);--p-tip-ink-weak: color-mix(in srgb, currentColor 55%, transparent);font-family:var(--font-ui);font-size:var(--text-xs);line-height:round(calc(var(--text-xs) * 1.5),1px);overflow-wrap:anywhere;opacity:0;transition:opacity var(--duration-fast) var(--ease-out)}.mention-tip:not(.positioned){pointer-events:none}.mention-tip.positioned{opacity:1}.mention-tip:before,.mention-tip:after{content:"";position:absolute;left:0;right:0;height:var(--space-1-5)}.mention-tip:before{bottom:100%}.mention-tip:after{top:100%}.mention-tip>*{max-height:calc(100vh - 2 * var(--p-mention-tip-vmargin) - 2 * var(--space-2));overflow-y:auto}.mention-tip-caret{position:absolute;left:var(--tip-caret-x, 50%);width:12px;height:6px;background:var(--color-text);transform:translate(-50%)}.mention-tip[data-side=top]>.mention-tip-caret{top:100%;clip-path:polygon(0 0,100% 0,50% 100%)}.mention-tip[data-side=bottom]>.mention-tip-caret{bottom:100%;clip-path:polygon(50% 0,0 100%,100% 100%)}.mention-tip-path{display:flex;align-items:flex-start;gap:var(--space-2)}.mention-tip-path-text{min-width:0}.mention-tip-sep{color:color-mix(in srgb,currentColor 45%,transparent)}.mention-tip-base{font-weight:var(--weight-semibold)}.mention-tip-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2)}.mention-tip-name{font-weight:var(--weight-semibold);overflow-wrap:anywhere}.mention-tip-open,.mention-tip-copy{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:var(--space-05);border:none;border-radius:var(--radius-xs);background:transparent;color:color-mix(in srgb,currentColor 65%,transparent);cursor:pointer;transition:color var(--duration-fast) var(--ease-out),background-color var(--duration-fast) var(--ease-out)}.mention-tip-open:hover,.mention-tip-copy:hover{color:var(--color-bg);background:color-mix(in srgb,var(--color-bg) 14%,transparent)}.mention-tip-open:focus-visible,.mention-tip-copy:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.mention-tip-open svg,.mention-tip-copy svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block}.mention-tip-att-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--p-ic-sm);height:1lh;color:color-mix(in srgb,currentColor 65%,transparent)}.mention-tip-att-icon svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block}.mention-tip-att-size{color:color-mix(in srgb,currentColor 65%,transparent)}.mention-tip:has(.mention-tip-quote-card){padding:var(--space-2)}.mention-tip-quote-card{min-width:0;display:flex;flex-direction:column;gap:var(--space-1-5)}.mention-tip-quote-block{min-width:0;padding:var(--space-1) var(--space-1-5);border-radius:var(--radius-xs);background:color-mix(in srgb,currentColor 6%,transparent)}.mention-tip-quote-block-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);margin-bottom:var(--space-05)}.mention-tip-quote-block-head .mention-tip-copy{margin-right:calc(-1 * var(--space-1));opacity:0;transition:opacity var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out),background-color var(--duration-fast) var(--ease-out)}.mention-tip-quote-block:hover .mention-tip-copy,.mention-tip-quote-block:focus-within .mention-tip-copy{opacity:1}@media(hover:none){.mention-tip-quote-block-head .mention-tip-copy{opacity:1}}.mention-tip-quote-block-head .mention-tip-quote-block-label{margin-bottom:0}.mention-tip-quote-block-label{margin-bottom:var(--space-05);color:var(--p-tip-ink-weak);font-size:var(--text-2xs);line-height:round(calc(var(--text-2xs) * 1.5),1px)}.mention-tip-quote-text{min-width:0;max-height:var(--p-tip-quote-lines);overflow-y:scroll;white-space:pre-wrap}.mention-tip-quote-comment{color:var(--p-tip-ink);white-space:pre-wrap;word-break:break-word;max-height:var(--p-tip-comment-lines);overflow-y:scroll}.mention-tip-quote-text,.mention-tip-quote-comment{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,currentColor 40%,transparent) transparent}.mention-tip-quote-text::-webkit-scrollbar,.mention-tip-quote-comment::-webkit-scrollbar{width:var(--space-1-5)}.mention-tip-quote-text::-webkit-scrollbar-thumb,.mention-tip-quote-comment::-webkit-scrollbar-thumb{background:color-mix(in srgb,currentColor 40%,transparent);border-radius:var(--radius-xs)}.mention-tip-quote-text::-webkit-scrollbar-track,.mention-tip-quote-comment::-webkit-scrollbar-track{background:transparent}.mention-tip-quote-source{min-width:0;color:var(--p-tip-ink-weak);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mention-tip-att-error{margin-top:var(--space-05);color:color-mix(in srgb,var(--color-danger) 70%,currentColor)}.mention-tip--media{padding:var(--space-1-5);border-radius:var(--radius-lg)}.mention-tip-media{display:flex;flex-direction:column;gap:var(--space-1-5)}.mention-tip-media-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;align-self:center;min-height:var(--p-mention-tip-media-preview-min-h);border:1px solid color-mix(in srgb,var(--color-bg) 14%,transparent);border-radius:var(--radius-sm);background-color:color-mix(in srgb,var(--color-bg) 8%,transparent);background-image:var(--p-mention-tip-media-check-bg);background-size:var(--p-mention-tip-media-check) var(--p-mention-tip-media-check);background-position:0 0,0 calc(var(--p-mention-tip-media-check) / 2),calc(var(--p-mention-tip-media-check) / 2) calc(var(--p-mention-tip-media-check) / -2),calc(var(--p-mention-tip-media-check) / -2) 0;overflow:hidden}.mention-tip-media-el{display:block;max-width:var(--p-mention-tip-media-w);max-height:var(--p-mention-tip-media-h);object-fit:contain;border-radius:var(--radius-sm)}.mention-tip-media-placeholder{display:inline-flex;align-items:center;justify-content:center;padding:var(--space-3) var(--space-3) var(--space-1);color:color-mix(in srgb,currentColor 45%,transparent)}.mention-tip-media-placeholder svg{width:var(--p-ic-lg);height:var(--p-ic-lg);display:block}.mention-tip-media-hint{padding:0 var(--space-2) var(--space-2);color:color-mix(in srgb,currentColor 60%,transparent);text-align:center}.mention-tip-media-meta{display:flex;align-items:center;gap:var(--space-1);min-width:0}.mention-tip-media-name{flex:0 1 auto;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--weight-semibold)}.mention-tip-media-error{padding:var(--space-1) var(--space-1-5);border-radius:var(--radius-sm);background:color-mix(in srgb,var(--color-bg) 8%,transparent);color:color-mix(in srgb,var(--color-danger) 70%,currentColor)}.mention-tip-media-foot{display:flex;align-items:center;gap:var(--space-2);min-width:0}.mention-tip-media-state{display:inline-flex;align-items:center;gap:var(--space-1-5);flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:color-mix(in srgb,currentColor 65%,transparent);font-weight:var(--weight-medium);padding-left:var(--space-05)}.mention-tip-media-state.is-danger{color:color-mix(in srgb,var(--color-danger) 70%,currentColor)}.mention-tip-media-ring,.mention-tip-media-ring svg{width:var(--p-mention-tip-media-ring);height:var(--p-mention-tip-media-ring);display:block;flex:none}.mention-tip-media-ring-track{stroke:color-mix(in srgb,currentColor 18%,transparent)}.mention-tip-media-ring-arc{stroke:color-mix(in srgb,currentColor 78%,transparent)}.mention-tip-media-spin{flex:none;width:var(--p-mention-tip-media-spin);height:var(--p-mention-tip-media-spin);border-radius:var(--radius-full);border:1.5px solid color-mix(in srgb,currentColor 18%,transparent);border-top-color:color-mix(in srgb,currentColor 78%,transparent);animation:mention-tip-media-rot var(--duration-slow) linear infinite}@keyframes mention-tip-media-rot{to{transform:rotate(360deg)}}.mention-tip-media-actions{display:flex;justify-content:flex-end;gap:var(--space-1-5);margin-left:auto;flex:none}.mention-tip-media-open{position:relative;display:inline-flex;align-items:center;gap:var(--space-1);padding:var(--space-05) var(--space-1-5);border:none;border-radius:var(--radius-sm);background:color-mix(in srgb,var(--color-bg) 10%,transparent);color:color-mix(in srgb,currentColor 65%,transparent);font:inherit;cursor:pointer;transition:color var(--duration-fast) var(--ease-out),background-color var(--duration-fast) var(--ease-out)}.mention-tip-media-open:hover{background:color-mix(in srgb,var(--color-bg) 18%,transparent);color:var(--color-bg)}.mention-tip-media-open:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.mention-tip-media-open svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block;color:color-mix(in srgb,currentColor 45%,transparent);transition:color var(--duration-fast) var(--ease-out)}.mention-tip-media-open:hover svg{color:var(--color-bg)}.mention-tip-copy{margin-right:calc(var(--space-05) - var(--space-2))}.mention-tip-desc{margin-top:var(--space-05);color:color-mix(in srgb,currentColor 78%,transparent);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.mention-tip-spinner{display:inline-block;width:calc(var(--space-2) + var(--space-05));height:calc(var(--space-2) + var(--space-05));margin-left:var(--space-1);vertical-align:var(--p-mention-tip-spinner-lift);border-radius:50%;border:var(--p-ring-stroke) solid color-mix(in srgb,currentColor 30%,transparent);border-top-color:currentColor;animation:mention-tip-spin var(--duration-spin) linear infinite}@keyframes mention-tip-spin{to{transform:rotate(360deg)}}.mention-pill.mention-missing,.mention-pill.mention-missing:hover{color:color-mix(in srgb,var(--color-text-muted) 55%,transparent);text-decoration:line-through}.mention-pill.mention-missing .mention-pill-icon{color:inherit}.attachment-pill.attachment-missing,.attachment-pill.attachment-missing:hover,.attachment-pill.attachment-missing .attachment-pill-icon,.attachment-pill.attachment-missing:hover .attachment-pill-icon{color:color-mix(in srgb,var(--color-text-muted) 55%,transparent);text-decoration:line-through}.attachment-pill.attachment-error,.attachment-pill.attachment-error:hover,.attachment-pill.attachment-error .attachment-pill-icon,.attachment-pill.attachment-error:hover .attachment-pill-icon{color:var(--color-danger)}@font-face{font-family:Noto Sans SC Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/NotoSansSC_wght_-BkPpiACN.woff2) format("woff2-variations")}@font-face{font-family:Schibsted Grotesk Variable;font-style:normal;font-display:swap;font-weight:400 900;src:url(/assets/SchibstedGrotesk_wght_-DIzGrWVg.woff2) format("woff2-variations")}@font-face{font-family:Schibsted Grotesk Variable;font-style:italic;font-display:swap;font-weight:400 900;src:url(/assets/SchibstedGrotesk-Italic_wght_-DjkBGo1z.woff2) format("woff2-variations")}*,*:before,*:after{box-sizing:border-box}html{-webkit-text-size-adjust:100%;tab-size:4}body{margin:0}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit;margin:0}p,blockquote,dl,dd,figure,pre{margin:0}ol,ul,menu{list-style:none;margin:0;padding:0}a{color:inherit;text-decoration:inherit}b,strong{font-weight:var(--weight-medium)}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}button,input,optgroup,select,textarea{margin:0;padding:0;font-family:inherit;font-size:100%;line-height:inherit;color:inherit}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background:transparent;background-image:none}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block}img,video{max-width:100%;height:auto}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1}table{border-collapse:collapse;border-color:inherit;text-indent:0}hr{height:0;color:inherit;border-top-width:1px}fieldset{margin:0;padding:0}legend{padding:0}dialog{padding:0}summary{display:list-item}[hidden]{display:none}@supports (interpolate-size: allow-keywords){:root{interpolate-size:allow-keywords}}:root{--safe-top: env(safe-area-inset-top, 0px);--safe-right: env(safe-area-inset-right, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px);--safe-left: env(safe-area-inset-left, 0px);--dock-card-top-clearance: 72px;--question-card-body-min-h: 120px;--header-collapsed-clearance: 78px;--header-collapsed-clearance-macos: 146px}.kw-icon{display:inline-block;flex:none;vertical-align:-.15em}code,pre,kbd,samp,tt{font-feature-settings:"liga" 0,"calt" 0,"ss01" 0;font-variant-ligatures:none}html,body,#app{height:100%;margin:0;background:var(--bg)}#app{position:fixed;inset:0}html,body{overflow:hidden}@supports not selector(::-webkit-scrollbar){*{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--color-text) 12%,transparent) transparent}}*::-webkit-scrollbar{width:6px;height:6px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--color-text) 12%,transparent);border-radius:999px}*::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}*::-webkit-scrollbar-corner{background:transparent}body{font-family:var(--sans);color:var(--color-text);background:var(--bg);font-size:var(--ui-font-size);font-weight:400;line-height:1.6;font-optical-sizing:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto;font-synthesis:none;text-size-adjust:100%;-webkit-hyphens:none;hyphens:none}@keyframes kimi-card-in{0%{opacity:0;transform:translateY(8px) scale(.995)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes kimi-check-in{0%{opacity:0;transform:scale(.4)}60%{opacity:1;transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.001ms!important;animation-delay:0ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}.ch-eyes{animation:kimi-eye-look 16s ease-in-out infinite}.ch-eye{transform-box:fill-box;transform-origin:center;animation:kimi-eye-blink 11s ease-in-out infinite}@keyframes kimi-eye-look{0%,42%{transform:translate(0)}47%,53%{transform:translate(2px)}58%,80%{transform:translate(0)}84%,90%{transform:translate(-2px)}95%,to{transform:translate(0)}}@keyframes kimi-eye-blink{0%,94%,to{transform:scaleY(1)}96.5%,98%{transform:scaleY(.12)}}@media(prefers-reduced-motion:reduce){.ch-eyes,.ch-eye{animation:none}}.blink-now .ch-eye{animation:kimi-eye-blink-once .24s ease-in-out}@keyframes kimi-eye-blink-once{0%,to{transform:scaleY(1)}50%{transform:scaleY(.1)}}.md .markdown-renderer img{min-width:0;min-height:0}.app{font-size:var(--ui-font-size)}.md,.md .markdown-renderer,.md .markdown-renderer p,.md .markdown-renderer li,.u-bub,.u-bub .u-text,.a-msg .msg,.ph{font-size:var(--content-font-size)}.md .markdown-renderer blockquote,.md .markdown-renderer td,.md .markdown-renderer th{font-size:var(--md-b2)}.md,.u-bub .u-text,.a-msg .msg{text-autospace:normal}.md .code-block-container pre,.md .markstream-pre,.md .code-block-container pre code,.md .diff-pre code,.md .markdown-renderer :not(pre)>code,.md .markdown-renderer .inline-code,.a-msg code{font-size:var(--md-b3)}.md .markdown-renderer :is(h1,h2,h3,h4) :not(pre)>code,.md .markdown-renderer :is(h1,h2,h3,h4) .inline-code{font-size:.9em}.queue-item,.queue-text,.ctx-num,.model-pill,.perm-pill,.mode-pill,.compact-chip,.qcard,.qtext,.qopt,.qbtn,.srow,.srow-val{font-size:var(--ui-font-size)}.qopt-desc,.srow-label{font-size:var(--ui-font-size-sm)}.code-block-header,.code-block-header *,.diff-lang,.queue-label,.qopt-key,.qstep,.srow-sub{font-size:var(--ui-font-size-xs)}@media(max-width:640px){:root{--content-font-size: calc(var(--md-b1) + 2px)}.md .markdown-renderer blockquote,.md .markdown-renderer td,.md .markdown-renderer th{font-size:calc(var(--md-b2) + 2px)}}:root{--anim-rive-spin: .4167s;--anim-leftbar: .5333s;--anim-leftbar-shrink: .2s}#bar-divider{transform-box:view-box;transform-origin:9.3px 12px;transition:transform var(--anim-leftbar-shrink) linear}svg:hover #bar-divider,button:hover #bar-divider{transform:translate(-1.5px) scaleY(.5)}#bar-arrow{transform-box:view-box;transform-origin:0 0;transform:translate(63.95833%,50.625%) scale(0)}svg:hover #bar-arrow,button:hover #bar-arrow{animation:leftbar-arrow var(--anim-leftbar) linear 1 forwards}@keyframes leftbar-arrow{0%{transform:translate(62.97083%,50.625%) scale(-.6);opacity:0}3.125%{transform:translate(62.97083%,50.625%) scale(-.6);opacity:1}15.625%{transform:translate(59.0125%,50.625%) scale(-1);opacity:1}37.5%{transform:translate(52.08333%,50.625%) scale(-1);opacity:1}to{transform:translate(52.08333%,50.625%) scale(-1);opacity:1}}#bar-arrow-expand{transform-box:view-box;transform-origin:0 0;transform:translate(52.08333%,50.625%) scale(0)}svg:hover #bar-arrow-expand,button:hover #bar-arrow-expand{animation:leftbar-arrow-expand var(--anim-leftbar) linear 1 forwards}@keyframes leftbar-arrow-expand{0%{transform:translate(37.02917%,50.625%) scale(.6);opacity:0}3.125%{transform:translate(37.02917%,50.625%) scale(.6);opacity:1}15.625%{transform:translate(40.9875%,50.625%) scale(1);opacity:1}37.5%{transform:translate(52.08333%,50.625%) scale(1);opacity:1}to{transform:translate(52.08333%,50.625%) scale(1);opacity:1}}#rbar-divider{transform-box:view-box;transform-origin:14.7px 12px;transition:transform var(--anim-leftbar-shrink) linear}svg:hover #rbar-divider,button:hover #rbar-divider{transform:translate(1.5px) scaleY(.5)}#rbar-arrow{transform-box:view-box;transform-origin:0 0;transform:translate(47.91667%,50.625%) scale(0)}svg:hover #rbar-arrow,button:hover #rbar-arrow{animation:rightbar-arrow var(--anim-leftbar) linear 1 forwards}@keyframes rightbar-arrow{0%{transform:translate(37.02917%,50.625%) scale(.6);opacity:0}3.125%{transform:translate(37.02917%,50.625%) scale(.6);opacity:1}15.625%{transform:translate(40.9875%,50.625%) scale(1);opacity:1}37.5%{transform:translate(47.91667%,50.625%) scale(1);opacity:1}to{transform:translate(47.91667%,50.625%) scale(1);opacity:1}}#rbar-arrow-expand{transform-box:view-box;transform-origin:0 0;transform:translate(47.91667%,50.625%) scale(0)}svg:hover #rbar-arrow-expand,button:hover #rbar-arrow-expand{animation:rightbar-arrow-expand var(--anim-leftbar) linear 1 forwards}@keyframes rightbar-arrow-expand{0%{transform:translate(62.97083%,50.625%) scale(-.6);opacity:0}3.125%{transform:translate(62.97083%,50.625%) scale(-.6);opacity:1}15.625%{transform:translate(59.0125%,50.625%) scale(-1);opacity:1}37.5%{transform:translate(47.91667%,50.625%) scale(-1);opacity:1}to{transform:translate(47.91667%,50.625%) scale(-1);opacity:1}}#p1{transform-box:view-box;transform-origin:0 0}svg:hover #p1,button:hover #p1{animation:nc-plus-spin var(--anim-rive-spin) linear 1 forwards}@keyframes nc-plus-spin{0%{transform:translate(11.5px,11.5px)}8%{transform:translate(11.501px,11.48px) rotate(1.1795deg) scale(1.02022)}12%{transform:translate(11.511px,11.46px) rotate(2.8374deg) scale(1.03026)}20%{transform:translate(11.562px,11.401px) rotate(8.8167deg) scale(1.05041)}24%{transform:translate(11.608px,11.361px) rotate(13.4726deg) scale(1.06017)}32%{transform:translate(11.751px,11.278px) rotate(25.9719deg) scale(1.08008)}48%{transform:translate(12.149px,11.222px) rotate(55.8418deg) scale(1.12025)}52%{transform:translate(12.235px,11.236px) rotate(62.0737deg) scale(1.12953)}60%{transform:translate(12.371px,11.276px) rotate(72.1167deg) scale(1.14954)}68%{transform:translate(12.446px,11.346px) rotate(79.3018deg) scale(1.12048)}76%{transform:translate(12.488px,11.403px) rotate(84.2633deg) scale(1.09046)}88%{transform:translate(12.509px,11.464px) rotate(88.52deg) scale(1.04535)}to{transform:translate(12.5px,11.5px) rotate(90deg)}}#af-p1{transform-box:view-box;transform-origin:18.4px 16.3px}svg:hover #af-p1,button:hover #af-p1{animation:folder-plus-spin var(--anim-rive-spin) linear 1 forwards}@keyframes folder-plus-spin{0%{transform:none}8%{transform:rotate(1.1795deg) scale(1.02022)}12%{transform:rotate(2.8374deg) scale(1.03026)}20%{transform:rotate(8.8167deg) scale(1.05041)}24%{transform:rotate(13.4726deg) scale(1.06017)}32%{transform:rotate(25.9719deg) scale(1.08008)}48%{transform:rotate(55.8418deg) scale(1.12025)}52%{transform:rotate(62.0737deg) scale(1.12953)}60%{transform:rotate(72.1167deg) scale(1.14954)}68%{transform:rotate(79.3018deg) scale(1.12048)}76%{transform:rotate(84.2633deg) scale(1.09046)}88%{transform:rotate(88.52deg) scale(1.04535)}to{transform:rotate(90deg)}} + */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;inset:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;inset:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.toasts[data-v-f46ca0b3]{position:fixed;right:16px;bottom:84px;display:flex;flex-direction:column;gap:var(--space-2);z-index:var(--z-toast);width:min(440px,calc(100vw - 32px));max-height:56vh;overflow-y:auto}.toasts.below-overlay[data-v-f46ca0b3]{z-index:var(--z-dropdown)}.toast-enter-active[data-v-f46ca0b3],.toast-leave-active[data-v-f46ca0b3]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.toast-enter-from[data-v-f46ca0b3],.toast-leave-to[data-v-f46ca0b3]{opacity:0;transform:translate(16px)}.toast-move[data-v-f46ca0b3]{transition:transform var(--duration-base) var(--ease-out)}.actions[data-v-f46ca0b3]{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-2)}.link[data-v-f46ca0b3]{border:0;padding:0;background:none;color:var(--color-accent);cursor:pointer;font:inherit;font-size:var(--ui-font-size-xs)}.link[data-v-f46ca0b3]:hover{text-decoration:underline}.details[data-v-f46ca0b3]{display:grid;gap:5px;margin:8px 0 0;padding:8px;border:.5px solid var(--color-line);border-radius:var(--radius-sm);background:var(--color-surface-sunken)}.detail-row[data-v-f46ca0b3]{display:grid;grid-template-columns:minmax(88px,.34fr) minmax(0,1fr);gap:8px}.detail-row dt[data-v-f46ca0b3]{color:var(--color-text-muted)}.detail-row dd[data-v-f46ca0b3]{margin:0;color:var(--color-text);overflow-wrap:anywhere;white-space:pre-wrap}@media(max-width:640px){.toasts[data-v-f46ca0b3]{left:12px;right:12px;bottom:calc(var(--dock-h, 76px) + 8px);width:auto;max-height:50vh}.detail-row[data-v-f46ca0b3]{grid-template-columns:1fr;gap:2px}}.group.dragging[data-v-643ef903]{opacity:.45}.group.pinned-drag-active[data-v-643ef903],.group.pinned-drop-hover[data-v-643ef903]{border-radius:var(--radius-sm)}.group.pinned-drag-active[data-v-643ef903]{box-shadow:inset 0 0 0 1px var(--color-accent)}.group.pinned-drop-hover[data-v-643ef903]{box-shadow:inset 0 0 0 2px var(--color-accent)}.group.pinned-drop-blocked[data-v-643ef903],.group.pinned-drop-blocked[data-v-643ef903] *{cursor:no-drop}.se-locate-flash[data-v-643ef903]{isolation:isolate}.se-locate-flash[data-v-643ef903]:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:var(--radius-sm);background:var(--color-accent-soft);pointer-events:none;animation:se-locate-fade-643ef903 var(--duration-flash) var(--ease-out) forwards}@keyframes se-locate-fade-643ef903{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.se-locate-flash[data-v-643ef903]:before{animation:none}}.group-sessions[data-v-643ef903]{height:auto;overflow:hidden;transition:height var(--duration-base) var(--ease-out)}.group-sessions.collapsed[data-v-643ef903]{height:0}.gh[data-v-643ef903]{display:flex;flex-direction:column;margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border-radius:var(--radius-sm);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text);user-select:none;position:relative;cursor:grab}.gh[data-v-643ef903]:active{cursor:grabbing}.gh[data-v-643ef903]:hover{background:var(--sb-hover, var(--color-hover))}.gh.on[data-v-643ef903]{background:var(--sb-selected, var(--color-selected))}.gh-top[data-v-643ef903]{position:relative;display:flex;align-items:center;gap:var(--sb-gap)}.gh-folder[data-v-643ef903]{flex:none;color:var(--color-text-muted)}.gh-name[data-v-643ef903]{font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);color:var(--color-text-muted);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.gh-actions[data-v-643ef903]{position:absolute;right:calc(var(--sb-action-inset) - (var(--sb-pad-x) - var(--sb-inset)));top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:var(--space-1);padding-left:var(--space-1);border-radius:var(--radius-sm);isolation:isolate;opacity:0;pointer-events:none}.gh-name[data-v-643ef903]{--sb-fade: 0px;--sb-fade-len: 16px;text-overflow:clip;-webkit-mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - var(--sb-fade) - var(--sb-fade-len)),transparent calc(100% - var(--sb-fade)));mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - var(--sb-fade) - var(--sb-fade-len)),transparent calc(100% - var(--sb-fade)))}.gh:hover .gh-name[data-v-643ef903],.gh:focus-within .gh-name[data-v-643ef903],.gh:has(.gh-actions.open) .gh-name[data-v-643ef903]{--sb-fade: 64px;--sb-fade-len: 26px}.gh-actions[data-v-643ef903]>*{position:relative;z-index:1}.gh:hover .gh-actions[data-v-643ef903],.gh:focus-within .gh-actions[data-v-643ef903],.gh-actions.open[data-v-643ef903]{opacity:1;pointer-events:auto}.gh-more.open[data-v-643ef903]{color:var(--color-text);background:var(--color-line)}.group-empty[data-v-643ef903]{padding:var(--space-1) var(--space-2) var(--space-1) calc(var(--sb-pad-x) - var(--sb-inset) + var(--sb-gutter) + var(--sb-gap));font-size:var(--text-xs);color:var(--color-text-faint);font-family:var(--font-ui);user-select:none}.show-more-row[data-v-643ef903]{display:flex;align-items:center;padding-left:calc(var(--sb-gutter) + var(--sb-gap))}.show-more[data-v-643ef903]{display:flex;align-items:center;gap:var(--sb-gap);margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));min-width:0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);text-align:left;cursor:pointer}.show-more[data-v-643ef903]:hover{background:var(--sb-hover, var(--color-hover))}.show-more[data-v-643ef903]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.show-more-sep[data-v-643ef903]{margin:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-xs);user-select:none}.show-more-label[data-v-643ef903]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gh-rename[data-v-643ef903]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-regular);color:var(--color-text);background:var(--color-bg);border:.5px solid var(--color-accent);border-radius:var(--radius-xs);padding:2px 5px;outline:none}.gh-rename[data-v-643ef903]{border-radius:var(--radius-sm);font-family:var(--sans)}.gh-add[data-v-643ef903]{color:var(--faint)}.gh-add[data-v-643ef903]:hover{color:var(--dim)}.sa-select[data-v-d0588d0e]{display:inline-flex;align-items:center;gap:var(--space-1-5);height:30px;padding:0 var(--space-3);border:.5px solid var(--color-line);border-radius:var(--radius-md);background:transparent;color:var(--color-text);font-size:var(--text-sm);font-weight:var(--weight-option-label);line-height:1;white-space:nowrap;transition:background var(--duration-fast) var(--ease-out)}.sa-select[data-v-d0588d0e]:hover,.sa-select.is-open[data-v-d0588d0e]{background:var(--color-hover)}.sa-select-chev[data-v-d0588d0e]{color:var(--color-text-faint)}.sa-menu[data-v-d0588d0e]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.sa-check[data-v-d0588d0e]{display:inline-flex;flex:none;width:14px}.sa-dot[data-v-d0588d0e]{flex:none;width:8px;height:8px;border-radius:var(--radius-full)}.sa-dot--open[data-v-d0588d0e]{background:var(--color-success)}.sa-dot--done[data-v-d0588d0e]{background:var(--color-done)}.menu-pop-enter-active[data-v-d0588d0e]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-d0588d0e]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-d0588d0e],.menu-pop-leave-to[data-v-d0588d0e]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}.sa-select[data-v-967a19b0]{display:inline-flex;align-items:center;gap:var(--space-1-5);min-height:30px;padding:0 var(--space-2);border:.5px solid var(--color-line);border-radius:var(--radius-md);background:transparent;color:var(--color-text);font-size:var(--text-sm);font-weight:var(--weight-option-label);line-height:1;white-space:nowrap;cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}.sa-select[data-v-967a19b0]:hover,.sa-select.is-open[data-v-967a19b0]{background:var(--color-hover)}.sa-select[data-v-967a19b0]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.sa-select-chev[data-v-967a19b0]{color:var(--color-text-faint)}.sa-tag[data-v-967a19b0]{display:inline-flex;align-items:center;gap:1px;height:20px;padding:0 2px 0 var(--space-1-5);border-radius:var(--radius-xs);background:var(--color-selected);font-size:var(--text-xs)}.sa-tag-name[data-v-967a19b0]{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sa-tag-x[data-v-967a19b0]{display:inline-flex;align-items:center;justify-content:center;flex:none;width:16px;height:16px;padding:0;border:none;border-radius:var(--radius-xs);background:transparent;color:var(--color-text-faint);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.sa-tag-x[data-v-967a19b0]:hover{background:var(--color-hover);color:var(--color-text)}.sa-tag-more[data-v-967a19b0]{color:var(--color-text-muted);font-size:var(--text-xs)}.sa-menu[data-v-967a19b0]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.sa-search[data-v-967a19b0]{display:flex;align-items:center;gap:7px;padding:5px 9px;color:var(--color-text-faint)}.sa-search-input[data-v-967a19b0]{flex:1;min-width:0;border:none;outline:none;background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-sm);line-height:var(--leading-tight)}.sa-search-input[data-v-967a19b0]::placeholder{color:var(--color-text-faint)}.sa-ws-name[data-v-967a19b0]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sa-opts[data-v-967a19b0]{max-height:320px;overflow-y:auto;overscroll-behavior:contain}.sa-menu-empty[data-v-967a19b0]{padding:5px 9px;color:var(--color-text-faint);font-size:var(--text-sm)}.menu-pop-enter-active[data-v-967a19b0]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-967a19b0]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-967a19b0],.menu-pop-leave-to[data-v-967a19b0]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}.sa-menu[data-v-b35c02be]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.sa-menu-head[data-v-b35c02be]{padding:var(--space-1) var(--space-2) var(--space-05);color:var(--color-text-faint);font-size:var(--text-xs);user-select:none}.menu-pop-enter-active[data-v-b35c02be]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-b35c02be]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-b35c02be],.menu-pop-leave-to[data-v-b35c02be]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}.sa-pager[data-v-d8059995]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-wrap:wrap;margin-top:var(--space-3)}.sa-total[data-v-d8059995]{color:var(--color-text-muted);font-size:var(--text-sm);font-variant-numeric:tabular-nums;user-select:none}.sa-pager-right[data-v-d8059995]{display:flex;align-items:center;gap:var(--space-3)}.sa-pages[data-v-d8059995]{display:flex;align-items:center;gap:var(--space-05)}.sa-pg[data-v-d8059995]{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;padding:0 var(--space-1-5);border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-size:var(--text-sm);font-variant-numeric:tabular-nums;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.sa-pg[data-v-d8059995]:hover{background:var(--color-hover);color:var(--color-text)}.sa-pg.cur[data-v-d8059995]{background:var(--color-selected);color:var(--color-text);font-weight:var(--weight-medium)}.sa-pg.cur[data-v-d8059995]:hover{background:var(--color-selected)}.sa-pg[data-v-d8059995]:disabled{opacity:.38;cursor:default}.sa-pg[data-v-d8059995]:disabled:hover{background:transparent;color:var(--color-text-muted)}.sa-ellipsis[data-v-d8059995]{padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-sm);user-select:none}.sa-table-card[data-v-dd5dbf42]{border:.5px solid var(--color-line);border-radius:var(--radius-lg);background:var(--color-bg);overflow-x:auto;container-type:inline-size;transition:opacity var(--duration-fast) var(--ease-out)}.sa-table-card.is-loading[data-v-dd5dbf42]{opacity:.45;pointer-events:none}table[data-v-dd5dbf42]{width:100%;min-width:640px;border-collapse:collapse;table-layout:fixed}.sa-col-cb[data-v-dd5dbf42]{width:36px}.sa-col-title[data-v-dd5dbf42]{width:max(200px,20%)}.sa-col-ws[data-v-dd5dbf42]{width:116px}.sa-col-status[data-v-dd5dbf42]{width:88px}.sa-col-time[data-v-dd5dbf42]{width:140px}.sa-col-act[data-v-dd5dbf42]{width:84px}.sa-time--compact[data-v-dd5dbf42]{display:none}@container (max-width: 1020px){.sa-col-time[data-v-dd5dbf42]{width:108px}.sa-time--full[data-v-dd5dbf42]{display:none}.sa-time--compact[data-v-dd5dbf42]{display:inline}}@container (max-width: 760px){col.sa-col-time[data-v-dd5dbf42],.sa-c-time[data-v-dd5dbf42]{display:none}.sa-col-ws[data-v-dd5dbf42]{width:96px}}thead th[data-v-dd5dbf42]{height:32px;padding:0 var(--space-3);border-bottom:.5px solid var(--color-line);color:var(--color-text-faint);font-size:var(--text-xs);font-weight:var(--weight-medium);text-align:left;white-space:nowrap;user-select:none}th.sa-col-cb[data-v-dd5dbf42],td.sa-col-cb[data-v-dd5dbf42]{padding-right:0}tbody td[data-v-dd5dbf42]{height:40px;padding:0 var(--space-3);border-bottom:.5px solid var(--color-subtle);font-size:var(--text-sm);line-height:var(--leading-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}tbody tr:last-child td[data-v-dd5dbf42]{border-bottom:none}tbody tr[data-v-dd5dbf42]{transition:background var(--duration-fast) var(--ease-out)}tbody tr[data-v-dd5dbf42]:hover{background:var(--color-hover)}.sa-cb[data-v-dd5dbf42]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border:.5px solid var(--color-line-strong);border-radius:var(--radius-xs);color:var(--color-text-on-accent);vertical-align:middle;transition:background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out)}.sa-cb[data-v-dd5dbf42]:hover{border-color:var(--color-text-faint)}.sa-cb.on[data-v-dd5dbf42],.sa-cb.ind[data-v-dd5dbf42]{background:var(--color-accent);border-color:var(--color-accent)}.sa-batch-inner[data-v-dd5dbf42]{display:flex;align-items:center;gap:var(--space-2)}.sa-batch-count[data-v-dd5dbf42]{margin-right:var(--space-1);color:var(--color-text-muted);font-size:var(--text-sm);white-space:nowrap;user-select:none}.sa-batch-link[data-v-dd5dbf42]{display:inline-flex;align-items:center;height:24px;padding:0 var(--space-1);border:none;background:transparent;color:var(--color-accent);font-size:var(--text-sm);font-weight:var(--weight-medium);white-space:nowrap}.sa-batch-link[data-v-dd5dbf42]:hover{text-decoration:underline}.sa-batch-link[data-v-dd5dbf42]:disabled{color:var(--color-text-faint);cursor:default;text-decoration:none}.sa-btn-q[data-v-dd5dbf42]{display:inline-flex;align-items:center;gap:var(--space-1-5);height:24px;padding:0 var(--space-2);border:.5px solid var(--color-line);border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-size:var(--text-xs);font-weight:var(--weight-medium);line-height:1;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.sa-btn-q[data-v-dd5dbf42]:hover{background:var(--color-hover)}.sa-btn-q[data-v-dd5dbf42]:disabled{opacity:.42;cursor:default}.sa-btn-q[data-v-dd5dbf42]:disabled:hover{background:transparent}.sa-btn-q[data-v-dd5dbf42] :first-child{color:var(--color-text-muted)}.sa-btn-q[data-v-dd5dbf42]:hover :first-child{color:var(--color-text)}.sa-btn-q--primary[data-v-dd5dbf42],.sa-btn-q--primary[data-v-dd5dbf42] :first-child{border-color:var(--color-accent);background:var(--color-accent);color:var(--color-text-on-accent)}.sa-btn-q--primary[data-v-dd5dbf42]:hover,.sa-btn-q--primary[data-v-dd5dbf42]:hover :first-child{border-color:var(--color-accent-hover);background:var(--color-accent-hover);color:var(--color-text-on-accent)}.sa-btn-q--primary[data-v-dd5dbf42]:disabled,.sa-btn-q--primary[data-v-dd5dbf42]:disabled:hover,.sa-btn-q--primary[data-v-dd5dbf42]:disabled :first-child,.sa-btn-q--primary[data-v-dd5dbf42]:disabled:hover :first-child{border-color:var(--color-accent);background:var(--color-accent);color:var(--color-text-on-accent)}.sa-st[data-v-dd5dbf42]{display:inline-flex;align-items:center;gap:var(--space-1-5)}.sa-st--open[data-v-dd5dbf42]{color:var(--color-success)}.sa-st--done[data-v-dd5dbf42]{color:var(--color-done)}.sa-title[data-v-dd5dbf42]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text);font-weight:var(--weight-option-label)}.sa-rename[data-v-dd5dbf42]{width:100%;height:26px;padding:0 var(--space-1-5);border:1px solid var(--color-accent);border-radius:var(--radius-sm);outline:none;box-shadow:0 0 0 2px var(--color-accent-bd);background:var(--color-bg);color:var(--color-text);font-family:inherit;font-size:var(--text-sm)}.sa-ws[data-v-dd5dbf42]{display:inline-flex;align-items:center;max-width:100%;color:var(--color-text-muted)}.sa-ws span[data-v-dd5dbf42]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sa-prompt[data-v-dd5dbf42]{color:var(--color-text-muted)}.sa-time[data-v-dd5dbf42]{color:var(--color-text-muted);font-family:var(--font-mono);font-size:var(--text-xs);font-variant-numeric:tabular-nums;white-space:nowrap}.sa-none[data-v-dd5dbf42]{color:var(--color-text-faint)}.sa-act[data-v-dd5dbf42]{display:flex;align-items:center;gap:var(--space-05)}.sa-state[data-v-dd5dbf42]{display:flex;align-items:center;justify-content:center;padding:calc(var(--space-8) + var(--space-6)) var(--space-4)}.sa-empty[data-v-dd5dbf42]{color:var(--color-text-faint);font-size:var(--text-sm)}.activity-notice[data-v-fd031610]{display:inline-flex;align-items:center;gap:9px;align-self:flex-start;margin:0;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text-muted)}.think[data-v-39bd75ea]{margin:0}.think-head[data-v-39bd75ea]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-1) 0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm);line-height:1;text-align:left;cursor:pointer;user-select:none;transition:color var(--duration-base) var(--ease-out)}.think-head[data-v-39bd75ea]:hover{color:var(--color-text)}.think-head[data-v-39bd75ea]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.think-bulb[data-v-39bd75ea]{flex:none}.think-title[data-v-39bd75ea]{font-weight:var(--weight-medium)}.think-time[data-v-39bd75ea]{color:var(--color-text-faint);font-weight:400;flex:none}.think.streaming .think-title[data-v-39bd75ea]{animation:think-breathe-39bd75ea 1.6s var(--ease-in-out) infinite}@keyframes think-breathe-39bd75ea{0%,to{opacity:1}50%{opacity:.45}}@media(prefers-reduced-motion:reduce){.think.streaming .think-title[data-v-39bd75ea]{animation:none}}.think-car[data-v-39bd75ea]{color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.think.open .think-car[data-v-39bd75ea]{transform:rotate(90deg)}.think-body[data-v-39bd75ea]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.think-body.instant[data-v-39bd75ea]{transition:none}.think-body.open[data-v-39bd75ea]{grid-template-rows:minmax(0,1fr)}.think-body-inner[data-v-39bd75ea]{min-height:0;overflow:hidden}.think-text[data-v-39bd75ea]{font:var(--text-base)/var(--leading-relaxed) var(--font-ui);font-weight:400;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-word;margin:0;padding:var(--space-1) 0 var(--space-2)}.mob .think-text[data-v-39bd75ea]{color:var(--color-text-faint);line-height:var(--leading-normal)}.op[data-v-ad2b6614]{font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text);background:var(--color-well);border:.5px solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3);white-space:pre-wrap;word-break:break-word;max-height:12lh;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.op-empty[data-v-ad2b6614]{color:var(--color-text-faint);font-style:italic}.agent-card[data-v-4a2d5e3d]{margin:var(--space-1) 0;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);overflow:hidden;transition:border-color var(--duration-base) var(--ease-out)}.agent-card[data-v-4a2d5e3d]:hover{border-color:var(--color-line-strong)}.agent-card.err[data-v-4a2d5e3d]{border-color:color-mix(in srgb,var(--color-danger) 45%,var(--bg))}.head[data-v-4a2d5e3d]{display:flex;align-items:center;gap:var(--space-2);width:100%;padding:var(--space-2) var(--space-3);border:none;background:transparent;color:var(--color-text);font-family:var(--font-ui);text-align:left;cursor:pointer}.head[data-v-4a2d5e3d]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.head[data-v-4a2d5e3d]:disabled{cursor:default}.head-row[data-v-4a2d5e3d]{display:flex;align-items:center}.head-row .head[data-v-4a2d5e3d]{flex:1;min-width:0}.detach[data-v-4a2d5e3d]{position:relative;flex:none;margin-right:var(--space-1)}.detach.touch[data-v-4a2d5e3d]:after{content:"";position:absolute;inset:-9px}.go-slot[data-v-4a2d5e3d]{display:inline-flex;align-items:center;padding-right:var(--space-3);cursor:pointer;flex:none}.lead[data-v-4a2d5e3d]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--radius-md);background:var(--color-surface-sunken);color:var(--color-text-muted);flex:none}.main[data-v-4a2d5e3d]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.task[data-v-4a2d5e3d]{font-size:var(--ui-font-size);line-height:var(--leading-caption);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.type[data-v-4a2d5e3d]{font-size:var(--text-xs);line-height:var(--leading-caption);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tail[data-v-4a2d5e3d]{display:flex;align-items:center;gap:var(--space-2);flex:none}.st[data-v-4a2d5e3d]{display:inline-flex;align-items:center}.st.ok[data-v-4a2d5e3d]{color:var(--color-success)}.st.error[data-v-4a2d5e3d]{color:var(--color-danger)}.st.cancelled[data-v-4a2d5e3d]{color:var(--color-text-faint)}.go[data-v-4a2d5e3d]{color:var(--color-text-faint);transition:color var(--duration-base) var(--ease-out)}.agent-card:hover .head:not(:disabled) .go[data-v-4a2d5e3d]{color:var(--color-text)}.go.car[data-v-4a2d5e3d]{transition:color var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.go.car.open[data-v-4a2d5e3d]{transform:rotate(90deg)}.saved-result[data-v-4a2d5e3d]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-2) var(--space-3);border:none;border-top:.5px solid var(--color-line);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-xs);text-align:left;cursor:pointer}.saved-result[data-v-4a2d5e3d]:hover{color:var(--color-text-muted)}.saved-result[data-v-4a2d5e3d]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.saved-result__chevron[data-v-4a2d5e3d]{transition:transform var(--duration-base) var(--ease-out)}.saved-result__chevron.open[data-v-4a2d5e3d]{transform:rotate(90deg)}.result[data-v-4a2d5e3d]{padding:var(--space-2) var(--space-3)}.result--legacy[data-v-4a2d5e3d]{border-top:.5px solid var(--color-line)}.tl-head[data-v-e445a9a3]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-1) 0;border-radius:var(--radius-sm);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-sm);line-height:1;text-align:left}.tl-head.clickable[data-v-e445a9a3]{cursor:pointer;user-select:none}.tl-ic[data-v-e445a9a3]{display:inline-flex;align-items:center;justify-content:flex-start;flex:none;color:var(--color-text-faint)}.tl-main[data-v-e445a9a3]{flex:1;min-width:0;display:flex;align-items:center;gap:var(--space-1)}.tl-tail[data-v-e445a9a3]{margin-left:auto;display:flex;align-items:center;gap:var(--space-1);flex:none}.tl-status[data-v-e445a9a3]{display:inline-flex;align-items:center;flex:none}.tl-status.ok[data-v-e445a9a3]{color:var(--color-success)}.tl-status.error[data-v-e445a9a3]{color:var(--color-danger)}.tl-car[data-v-e445a9a3]{display:inline-flex;align-items:center;justify-content:center;align-self:center;width:16px;height:16px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);cursor:pointer;flex:none}.tl-car[data-v-e445a9a3]:hover{color:var(--color-text)}.tl-car[data-v-e445a9a3]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tl-car-ic[data-v-e445a9a3]{transition:transform var(--duration-base) var(--ease-out)}.tool-line.open .tl-car-ic[data-v-e445a9a3]{transform:rotate(90deg)}.tl-body[data-v-e445a9a3]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.tl-body.open[data-v-e445a9a3]{grid-template-rows:minmax(0,1fr)}.tl-body-inner[data-v-e445a9a3]{min-height:0;overflow:hidden;padding:2px var(--space-2) var(--space-1) 0}.tl-main .tl-name[data-v-e445a9a3-s]{font-weight:var(--weight-regular);color:var(--color-text-muted);flex:none}.tl-main .tl-dim[data-v-e445a9a3-s]{color:var(--color-text-muted);line-height:var(--leading-tight);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-main .tl-faint[data-v-e445a9a3-s]{color:var(--color-text-faint);line-height:var(--leading-tight);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-main .tl-mono[data-v-e445a9a3-s]{font-family:var(--font-mono);font-size:var(--text-xs);font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text-muted);line-height:normal;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-main .tl-file[data-v-e445a9a3-s]{font-weight:var(--weight-regular);color:var(--color-text);line-height:var(--leading-tight);flex:none;max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:none;border-radius:var(--radius-xs);background:transparent;padding:0 1px;font-family:inherit;font-size:inherit;cursor:pointer}.tl-main .tl-file[data-v-e445a9a3-s]:hover{color:var(--color-accent);text-decoration:underline;text-underline-offset:3px}.tl-main .tl-file[data-v-e445a9a3-s]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tl-tail .tl-pill[data-v-e445a9a3-s]{font-size:var(--text-xs);line-height:1.5;padding:0 var(--space-2);border-radius:var(--radius-full);flex:none;white-space:nowrap}.tl-tail .tl-chip[data-v-e445a9a3-s]{color:var(--color-text-faint);font-size:var(--text-xs);flex:none;white-space:nowrap}.tl-tail .tl-add[data-v-e445a9a3-s]{color:var(--color-success);font-family:var(--font-mono);font-size:var(--text-xs);flex:none}.tl-tail .tl-del[data-v-e445a9a3-s]{color:var(--color-danger);font-family:var(--font-mono);font-size:var(--text-xs);flex:none}.ask-receipt[data-v-928d131f]{max-width:560px;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-xs);padding:var(--space-2) var(--space-3) 10px;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text)}.ask-receipt.flat[data-v-928d131f]{color:var(--color-text-faint);font-style:italic;padding-top:6px;padding-bottom:6px}.rc-head[data-v-928d131f]{display:flex;align-items:center;gap:var(--space-2);color:var(--color-text-faint);font-size:var(--text-xs);margin-bottom:6px}.rc-st[data-v-928d131f]{margin-left:auto;color:var(--color-success);display:inline-flex}.rc-q+.rc-q[data-v-928d131f]{margin-top:6px}.rc-qtext[data-v-928d131f]{display:flex;align-items:baseline;gap:var(--space-2);margin-bottom:3px;font-weight:var(--weight-medium);color:var(--color-text)}.rc-opt[data-v-928d131f]{display:flex;align-items:center;gap:var(--space-2);padding:1.5px 0;color:var(--color-text)}.rc-qskip[data-v-928d131f]{padding:1.5px 0;color:var(--color-text-faint);font-style:italic}.rc-lb[data-v-928d131f]{min-width:0}.rc-ds[data-v-928d131f]{color:var(--color-text-faint);font-size:var(--text-xs)}.rc-g[data-v-928d131f]{width:14px;height:14px;flex:none;border:.5px solid var(--color-line-strong);position:relative}.rc-g.chk[data-v-928d131f]{border-radius:var(--radius-xs)}.rc-g.rad[data-v-928d131f]{border-radius:50%}.rc-g.on[data-v-928d131f]{border-color:var(--color-accent)}.rc-g.chk.on[data-v-928d131f]{background:var(--color-accent)}.rc-g.chk.on[data-v-928d131f]:after{content:"";position:absolute;left:3.5px;top:.5px;width:4px;height:8px;border-right:1.5px solid var(--color-text-on-accent);border-bottom:1.5px solid var(--color-text-on-accent);transform:rotate(45deg)}.rc-g.rad.on[data-v-928d131f]:after{content:"";position:absolute;inset:2.5px;border-radius:50%;background:var(--color-accent)}.cmd-echo[data-v-e0f3f8fe]{font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-all;margin-bottom:var(--space-1)}.tl-detach[data-v-e0f3f8fe]{position:relative;display:inline-flex;align-items:center;justify-content:center;align-self:center;width:16px;height:16px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);cursor:pointer;flex:none}.tl-detach[data-v-e0f3f8fe]:hover{color:var(--color-text)}.tl-detach[data-v-e0f3f8fe]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tl-detach.touch[data-v-e0f3f8fe]{width:44px;height:44px;margin-left:14px}.diffbar[data-v-b25ea4cc]{display:inline-flex;width:36px;height:3px;border-radius:var(--radius-full);overflow:hidden;gap:1px;flex:none}.seg-add[data-v-b25ea4cc]{background:var(--color-success)}.seg-del[data-v-b25ea4cc]{background:var(--color-danger)}.gl[data-v-c64dda93]{display:inline-flex;align-items:center}.arg-full[data-v-c64dda93]{font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-all;margin-bottom:var(--space-1)}.file-list[data-v-ef9af25f]{display:flex;flex-direction:column;border:.5px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-well);padding:var(--space-1);max-height:calc(12 * 1.6 * var(--content-font-size));overflow-y:auto;overscroll-behavior:contain}.file-row[data-v-ef9af25f]{width:100%;border:none;border-radius:var(--radius-sm);background:transparent;padding:2px var(--space-2);font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text);text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.file-row[data-v-ef9af25f]:hover{background:var(--color-hover);color:var(--color-accent)}.file-row[data-v-ef9af25f]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tl-pill.pill-active[data-v-50602502]{color:var(--color-accent);background:var(--color-accent-soft)}.tl-pill.pill-done[data-v-50602502]{color:var(--color-success);background:var(--color-success-soft)}.tl-pill.pill-blocked[data-v-50602502]{color:var(--color-warning);background:var(--color-warning-soft)}.goal-block[data-v-50602502]{margin-bottom:var(--space-1)}.goal-text[data-v-50602502]{color:var(--color-text);font-size:calc(var(--content-font-size) - 1px);line-height:1.6;white-space:pre-wrap;word-break:break-word}.goal-criterion[data-v-50602502]{color:var(--color-text-muted);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;margin-top:2px;white-space:pre-wrap;word-break:break-word}.match-list[data-v-e5f2e791]{display:flex;flex-direction:column;border:.5px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-well);padding:var(--space-1);max-height:calc(12 * 1.6 * var(--content-font-size));overflow-y:auto;overscroll-behavior:contain}.match-row[data-v-e5f2e791]{display:flex;align-items:baseline;gap:var(--space-2);width:100%;border:none;border-radius:var(--radius-sm);background:transparent;padding:2px var(--space-2);font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--color-text);text-align:left;cursor:default}.match-row.link[data-v-e5f2e791]{cursor:pointer}.match-row.link[data-v-e5f2e791]:hover{background:var(--color-hover)}.match-row[data-v-e5f2e791]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.mref[data-v-e5f2e791]{flex:none;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-faint)}.match-row.link:hover .mref[data-v-e5f2e791]{color:var(--color-accent)}.mtext[data-v-e5f2e791]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.is-resolving[data-v-7bd83e15]{visibility:hidden}.media-tool[data-v-8ea09226]{display:inline-flex;flex-direction:column;gap:6px;max-width:320px}.media-title[data-v-8ea09226]{font-size:var(--text-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.media-image-button[data-v-8ea09226]{padding:0;border:none;background:transparent;cursor:pointer;border-radius:var(--radius-md);overflow:hidden}.media-image[data-v-8ea09226]{display:block;max-width:100%;border-radius:var(--radius-md);background:var(--media-alpha-canvas)}.media-video[data-v-8ea09226],.media-audio[data-v-8ea09226]{max-width:100%;border-radius:var(--radius-md)}.media-video[data-v-8ea09226]{display:block}.media-video-button[data-v-8ea09226]{position:relative}.media-video-tile[data-v-8ea09226]{display:block;width:320px;max-width:100%;aspect-ratio:16 / 9;background:var(--color-well)}.media-play-badge[data-v-8ea09226]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:var(--radius-full);background:var(--color-surface-raised);border:.5px solid var(--color-line);color:var(--color-text);box-shadow:var(--shadow-sm);pointer-events:none}.plan-glyph[data-v-ae3acb2d]{display:inline-flex;align-items:center}.plan-path[data-v-ae3acb2d]{display:block;max-width:100%;margin:0 0 var(--space-2);padding:0;overflow:hidden;border:none;background:transparent;color:var(--color-accent);font-family:var(--font-mono);font-size:var(--text-xs);text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.plan-path[data-v-ae3acb2d]:hover{text-decoration:underline}.plan-path[data-v-ae3acb2d]:focus-visible{outline:none;border-radius:var(--radius-xs);box-shadow:var(--p-focus-ring)}.plan-content[data-v-ae3acb2d]{padding:var(--space-3);border:1px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-well);color:var(--color-text)}.plan-review[data-v-ae3acb2d]{display:flex;flex-direction:column;gap:var(--space-1);margin-top:var(--space-2);color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);line-height:var(--leading-normal)}.plan-review>div[data-v-ae3acb2d]{display:flex;align-items:baseline;gap:var(--space-2)}.review-label[data-v-ae3acb2d]{flex:none;color:var(--color-text-faint)}.review-feedback[data-v-ae3acb2d]{white-space:pre-wrap}.path-link[data-v-a487370d]{display:block;width:100%;border:none;border-radius:var(--radius-xs);background:transparent;padding:0 0 var(--space-1);font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);color:var(--color-text-muted);text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.path-link[data-v-a487370d]:hover{color:var(--color-accent);text-decoration:underline;text-underline-offset:3px}.path-link[data-v-a487370d]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.swarm-card[data-v-a03fd23e]{margin:0;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);overflow:hidden;transition:border-color var(--duration-base) var(--ease-out)}.swarm-card.err[data-v-a03fd23e]{border-color:color-mix(in srgb,var(--color-danger) 45%,var(--bg))}.head[data-v-a03fd23e]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:34px;padding:0 var(--space-2) 0 var(--space-3);border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--ui-font-size);text-align:left;cursor:pointer;user-select:none}.head[data-v-a03fd23e]:hover{background:var(--color-hover);color:var(--color-text)}.head[data-v-a03fd23e]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.ic[data-v-a03fd23e]{color:var(--color-text-faint);flex:none}.title[data-v-a03fd23e]{font-weight:var(--weight-medium);color:var(--color-text);flex:none}.meta[data-v-a03fd23e]{color:var(--color-text-faint);flex:none}.sum-txt[data-v-a03fd23e]{color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.rt[data-v-a03fd23e]{margin-left:auto;display:flex;align-items:center;gap:var(--space-2);flex:none;color:var(--color-text-muted);font-size:var(--text-xs)}.status[data-v-a03fd23e]{display:inline-flex;align-items:center;flex:none}.status[data-v-a03fd23e]:has(>svg){color:var(--color-success)}.err .status[data-v-a03fd23e]:has(>svg){color:var(--color-danger)}.chip[data-v-a03fd23e]{color:var(--color-text-muted);font-family:var(--font-mono)}.tm[data-v-a03fd23e]{color:var(--color-text-faint);font-family:var(--font-mono)}.car[data-v-a03fd23e]{margin-left:2px;color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.swarm-card.open .car[data-v-a03fd23e]{transform:rotate(90deg)}.body[data-v-a03fd23e]{border-top:.5px solid var(--color-line)}.overview[data-v-a03fd23e]{padding:10px var(--space-3) var(--space-2);border-bottom:.5px solid var(--color-line)}.overview-line[data-v-a03fd23e]{display:flex;align-items:baseline;gap:var(--space-2)}.big[data-v-a03fd23e]{font-family:var(--font-mono);font-weight:var(--weight-medium);color:var(--color-text);font-size:15px}.lbl[data-v-a03fd23e]{color:var(--color-text-muted);font-size:var(--text-xs)}.seg[data-v-a03fd23e]{display:flex;height:5px;border-radius:var(--radius-full);overflow:hidden;margin:var(--space-2) 0 var(--space-1);gap:2px}.seg>span[data-v-a03fd23e]{height:100%;border-radius:var(--radius-full);min-width:3px}.s-ok[data-v-a03fd23e]{background:var(--color-success)}.s-run[data-v-a03fd23e]{background:var(--color-accent)}.s-warn[data-v-a03fd23e]{background:var(--color-warning)}.s-fail[data-v-a03fd23e]{background:var(--color-danger)}.s-queue[data-v-a03fd23e]{background:var(--color-line)}.legend[data-v-a03fd23e]{display:flex;flex-wrap:wrap;gap:10px}.legend span[data-v-a03fd23e]{display:inline-flex;align-items:center;gap:5px;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted)}.lg-dot[data-v-a03fd23e]{width:6px;height:6px;border-radius:var(--radius-full)}.member[data-v-a03fd23e]{border-bottom:.5px solid var(--color-line)}.member[data-v-a03fd23e]:last-child{border-bottom:none}.member-head[data-v-a03fd23e]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:30px;padding:0 var(--space-2) 0 var(--space-3);border:none;background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size);text-align:left;cursor:pointer;user-select:none}.member-head[data-v-a03fd23e]:not(:disabled):hover{background:var(--color-hover)}.member-head[data-v-a03fd23e]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.member-head[data-v-a03fd23e]:disabled{cursor:default}.row-dot[data-v-a03fd23e]{flex:none}.mname[data-v-a03fd23e]{flex:none;min-width:0;max-width:46%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-medium);color:var(--color-text)}.mact[data-v-a03fd23e]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-muted);font-size:var(--text-xs)}.mphase[data-v-a03fd23e]{flex:none;margin-left:auto;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint)}.phase-completed .mphase[data-v-a03fd23e]{color:var(--color-success)}.phase-failed .mphase[data-v-a03fd23e]{color:var(--color-danger)}.phase-working .mphase[data-v-a03fd23e]{color:var(--color-accent)}.phase-suspended .mphase[data-v-a03fd23e]{color:var(--color-warning)}.mcar[data-v-a03fd23e]{margin-left:var(--space-1);color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.member.open .mcar[data-v-a03fd23e]{transform:rotate(90deg)}.member-saved[data-v-a03fd23e]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-1) var(--space-3);border:none;border-top:.5px solid var(--color-line);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-xs);text-align:left;cursor:pointer}.member-saved[data-v-a03fd23e]:hover{color:var(--color-text-muted)}.member-saved[data-v-a03fd23e]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.member-saved-car[data-v-a03fd23e]{transition:transform var(--duration-base) var(--ease-out)}.member-saved-car.open[data-v-a03fd23e]{transform:rotate(90deg)}.member-body[data-v-a03fd23e]{padding:var(--space-1) var(--space-3) 10px 31px;color:var(--color-text-muted);font-size:calc(var(--content-font-size) - 2px);line-height:1.65;white-space:pre-wrap;word-break:break-word}.waiting[data-v-a03fd23e]{padding:6px var(--space-3) 10px;color:var(--color-text-muted);font-size:var(--text-xs)}.fallback-output[data-v-a03fd23e]{padding:10px var(--space-3);color:var(--color-text);font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;white-space:pre-wrap;word-break:break-word}.status-glyph[data-v-77ce35f9]{flex:none;width:16px;display:inline-flex;align-items:center;justify-content:center;user-select:none}.status-glyph.s-run[data-v-77ce35f9]{color:var(--color-accent)}.status-glyph.s-done[data-v-77ce35f9]{color:var(--color-success)}.status-glyph.s-fail[data-v-77ce35f9]{color:var(--color-danger)}.status-glyph.s-pending[data-v-77ce35f9]{color:var(--color-text-faint)}.todo-bar[data-v-9c43594f]{display:inline-flex;width:36px;height:3px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden;flex:none}.todo-fill[data-v-9c43594f]{background:var(--color-success);border-radius:var(--radius-full);transition:width var(--duration-slow) var(--ease-out)}.todo-list[data-v-9c43594f]{display:flex;flex-direction:column;gap:1px;border:.5px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-well);padding:var(--space-2) var(--space-3);max-height:calc(12 * 1.6 * var(--content-font-size));overflow-y:auto;overscroll-behavior:contain}.todo-row[data-v-9c43594f]{display:flex;align-items:center;gap:7px;padding:2px 0;font-size:calc(var(--content-font-size) - 1px);color:var(--color-text)}.todo-title[data-v-9c43594f]{flex:1;min-width:0;overflow-wrap:anywhere;line-height:1.4}.todo-row.s-in_progress .todo-title[data-v-9c43594f]{font-weight:var(--weight-medium)}.todo-row.s-done .todo-title[data-v-9c43594f]{color:var(--color-text-faint);text-decoration:line-through}.wf-glance[data-v-3a167d7c]{margin-bottom:var(--space-1)}.wf-main[data-v-3a167d7c]{color:var(--color-text);font-size:var(--text-sm);line-height:var(--leading-prose);white-space:pre-wrap;word-break:break-word}.wf-sub[data-v-3a167d7c]{color:var(--color-text-muted);font-size:var(--text-xs);line-height:var(--leading-prose);white-space:pre-wrap;word-break:break-word}.fetch-url[data-v-214a8617]{font-family:var(--font-mono);font-size:calc(var(--content-font-size) - 2px);line-height:1.6;color:var(--color-text-faint);white-space:pre-wrap;word-break:break-all;margin-bottom:var(--space-1)}.activity-run[data-v-0970b9ea]{display:flex;flex-direction:column;animation:kimi-card-in var(--duration-base) var(--ease-out)}.ar-head[data-v-0970b9ea]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-2) 0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm);line-height:1;text-align:left;cursor:pointer;user-select:none;transition:color var(--duration-base) var(--ease-out)}.ar-head[data-v-0970b9ea]:hover{color:var(--color-text)}.ar-head.is-static[data-v-0970b9ea],.ar-head.is-static[data-v-0970b9ea]:hover{cursor:default;color:var(--color-text-faint)}.ar-head[data-v-0970b9ea]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.ar-glyph[data-v-0970b9ea]{display:inline-flex;align-items:center;flex:none;color:var(--color-text-faint)}.ar-glyph.ok[data-v-0970b9ea]{color:var(--color-success)}.ar-glyph.err[data-v-0970b9ea]{color:var(--color-danger)}.ar-glyph.run[data-v-0970b9ea]{color:var(--color-text-muted);animation:ar-breathe-0970b9ea 1.6s var(--ease-in-out) infinite}@keyframes ar-breathe-0970b9ea{0%,to{opacity:1}50%{opacity:.45}}@media(prefers-reduced-motion:reduce){.ar-glyph.run[data-v-0970b9ea]{animation:none}}.ar-sum[data-v-0970b9ea]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-regular)}.ar-danger[data-v-0970b9ea]{color:var(--color-danger)}.ar-faint[data-v-0970b9ea],.ar-sep[data-v-0970b9ea]{color:var(--color-text-faint)}.ar-car[data-v-0970b9ea]{color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.activity-run.open .ar-car[data-v-0970b9ea]{transform:rotate(90deg)}.ar-body[data-v-0970b9ea]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.ar-body.open[data-v-0970b9ea]{grid-template-rows:minmax(0,1fr)}.ar-body-inner[data-v-0970b9ea]{min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:var(--space-2);padding-top:var(--space-1)}.msg-time[data-v-182ed7d4]{display:inline-flex;align-items:center;min-height:22px;box-sizing:border-box;padding:2px 5px;border-radius:var(--radius-sm);color:var(--muted);font-size:var(--text-xs);font-weight:var(--weight-medium);line-height:1;opacity:.7;white-space:nowrap}.ntf-list[data-v-2962a217]{display:flex;flex-direction:column;align-items:flex-end;gap:var(--space-3);margin:var(--space-2) 0}.ntn[data-v-2962a217]{margin-left:auto;max-width:var(--p-bubble-max);display:flex;flex-direction:column;align-items:flex-end}.ntn-head[data-v-2962a217]{display:flex;align-items:center;gap:var(--space-2);margin-bottom:var(--space-1);padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal);overflow-wrap:anywhere}.ntn-ico[data-v-2962a217]{flex:none}.ntn.ok .ntn-ico[data-v-2962a217]{color:var(--color-success)}.ntn.err .ntn-ico[data-v-2962a217]{color:var(--color-danger)}.ntn.warn .ntn-ico[data-v-2962a217]{color:var(--color-warning)}.ntn-bubble[data-v-2962a217]{box-sizing:border-box;max-width:100%;padding:var(--space-2) var(--space-3);background:var(--color-user-bubble-bg);border-radius:var(--radius-lg);color:var(--color-text);font-size:var(--content-font-size);line-height:var(--leading-normal);white-space:pre-wrap;overflow-wrap:anywhere}.ntn-line+.ntn-line[data-v-2962a217]{margin-top:var(--space-1)}.ntn-out[data-v-2962a217]{display:flex;align-items:center;gap:var(--space-2);background:var(--color-surface-raised);border-radius:var(--radius-md);padding:var(--space-1) var(--space-2);box-shadow:var(--shadow-xs);white-space:normal}.ntn-out-ic[data-v-2962a217]{color:var(--color-text-faint);flex:none}.ntn-out-path[data-v-2962a217]{flex:1;min-width:0;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.ntn-out-size[data-v-2962a217]{flex:none;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint)}.ntn-out-copy[data-v-2962a217]{display:inline-flex;align-items:center;height:var(--space-6);padding:0 var(--space-2);border-radius:var(--radius-full);font-size:var(--text-xs);color:var(--color-text-muted);border:.5px solid var(--color-line-strong);background:var(--color-surface-raised);flex:none;transition:color var(--duration-fast) var(--ease-out)}.ntn-out-copy[data-v-2962a217]:hover{color:var(--color-text)}.ntn-preview-cap[data-v-2962a217]{font-size:var(--text-xs);color:var(--color-text-faint);margin-bottom:var(--space-05)}.ntn-preview-text[data-v-2962a217]{margin:0;font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--leading-normal);color:var(--color-text-muted);white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:8;overflow:hidden}.ntn-meta[data-v-2962a217]{margin-top:var(--space-1);padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal)}.ntn-raw[data-v-2962a217]{max-width:100%}.ntn-raw summary[data-v-2962a217]{list-style:none;display:flex;align-items:center;gap:var(--space-1);cursor:pointer;font-size:var(--text-xs);color:var(--color-text-faint);user-select:none}.ntn-raw summary[data-v-2962a217]::-webkit-details-marker{display:none}.ntn-raw summary[data-v-2962a217]:hover{color:var(--color-text)}.ntn-raw-car[data-v-2962a217]{transition:transform var(--duration-base) var(--ease-out)}.ntn-raw[open] .ntn-raw-car[data-v-2962a217]{transform:rotate(90deg)}.ntn-raw-in[data-v-2962a217]{margin-top:var(--space-1);display:flex;flex-direction:column;gap:var(--space-2)}.ntn-raw-fields[data-v-2962a217]{display:grid;grid-template-columns:auto 1fr;gap:var(--space-1) var(--space-3)}.ntn-raw-fields .k[data-v-2962a217]{color:var(--color-text-faint);font-size:var(--text-xs)}.ntn-raw-fields .v[data-v-2962a217]{color:var(--color-text-muted);font-size:var(--text-xs);font-family:var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ntn-raw-pre[data-v-2962a217]{margin:0;padding:var(--space-2) var(--space-3);background:var(--color-surface-raised);border-radius:var(--radius-sm);box-shadow:var(--shadow-xs);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--leading-normal);color:var(--color-text-muted);white-space:pre;overflow:auto;max-width:100%;max-height:13lh}.turn-fold[data-v-d69de1b5]{display:flex;flex-direction:column}.tf-head[data-v-d69de1b5]{display:flex;align-items:center;gap:var(--space-1);width:100%;padding:var(--space-2) 0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm);line-height:1;text-align:left;cursor:pointer;user-select:none;transition:color var(--duration-base) var(--ease-out)}.tf-head[data-v-d69de1b5]:hover{color:var(--color-text)}.tf-head[data-v-d69de1b5]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--color-accent-soft)}.tf-sum[data-v-d69de1b5]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-regular)}.tf-car[data-v-d69de1b5]{color:var(--color-text-faint);flex:none;transition:transform var(--duration-base) var(--ease-out)}.turn-fold.open .tf-car[data-v-d69de1b5]{transform:rotate(90deg)}.tf-body[data-v-d69de1b5]{display:grid;grid-template-rows:minmax(0,0fr);overflow:hidden;transition:grid-template-rows var(--duration-base) var(--ease-out)}.tf-body.open[data-v-d69de1b5]{grid-template-rows:minmax(0,1fr)}.tf-body-inner[data-v-d69de1b5]{min-height:0;overflow:hidden;display:flex;flex-direction:column}.tf-body-inner>.msg[data-v-d69de1b5],.tf-body-inner[data-v-d69de1b5]>.think,.tf-body-inner[data-v-d69de1b5]>.tool-group,.tf-body-inner[data-v-d69de1b5]>.activity-run,.tf-body-inner[data-v-d69de1b5]>.agent-card,.tf-body-inner[data-v-d69de1b5]>.agent-group,.tf-body-inner[data-v-d69de1b5]>.tool-line,.tf-body-inner[data-v-d69de1b5]>.swarm-card,.tf-body-inner[data-v-d69de1b5]>.media-tool,.tf-body-inner[data-v-d69de1b5]>.ask-receipt{margin-top:var(--chat-block-gap)}.turn-fold.streaming .tf-body-inner>.msg[data-v-d69de1b5]:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.think:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.tool-group:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.activity-run:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.agent-card:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.agent-group:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.tool-line:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.swarm-card:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.media-tool:first-child,.turn-fold.streaming .tf-body-inner[data-v-d69de1b5]>.ask-receipt:first-child{margin-top:0}.tf-body-inner .msg[data-v-d69de1b5]{font-size:var(--ui-font-size);line-height:var(--leading-prose);color:var(--color-text);font-weight:var(--weight-medium)}.tf-body-inner .msg[data-v-d69de1b5] p{margin:0}.tf-body-inner .msg[data-v-d69de1b5] p+p{margin-top:var(--space-2)}@container (min-width: 760px){.tf-body-inner .msg[data-v-d69de1b5] .markstream-vue.markdown-renderer:has(.table-node-wrapper.md-table-wide){content-visibility:visible}.tf-body-inner .msg[data-v-d69de1b5] .table-node-wrapper.md-table-wide{position:relative;left:50%;width:max-content;min-width:100%;max-width:min(var(--p-table-max),calc(100cqi - var(--space-5) - var(--space-5)))!important;transform:translate(-50%)}.tf-body-inner .msg[data-v-d69de1b5] .table-node-wrapper:not(.md-table-wide){--table-cell-cap: min(var(--p-table-cell-max), 36cqi)}}.turn-files[data-v-c82a66d2]{margin-top:var(--chat-block-gap)}.turn-files[data-v-c82a66d2] .ui-card__head{font-family:var(--font-ui);font-weight:var(--weight-regular);padding:var(--space-2) var(--space-3)}.turn-files[data-v-c82a66d2] .ui-card__body{padding:var(--space-1) var(--space-3)}.turn-files[data-v-c82a66d2] .ui-card__foot{padding:0;justify-content:stretch}.tf-ic[data-v-c82a66d2]{display:inline-flex;align-items:center;color:var(--color-text-faint);flex:none}.tf-title[data-v-c82a66d2]{font-size:var(--text-sm);color:var(--color-text);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tf-stats[data-v-c82a66d2]{margin-left:auto;display:inline-flex;align-items:center;gap:var(--space-1);flex:none}.tf-add[data-v-c82a66d2],.tf-del[data-v-c82a66d2]{font-family:var(--font-mono);font-size:var(--text-xs);flex:none}.tf-add[data-v-c82a66d2]{color:var(--color-success)}.tf-del[data-v-c82a66d2]{color:var(--color-danger)}.tf-list[data-v-c82a66d2]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.tf-row[data-v-c82a66d2]{display:flex;align-items:center;gap:var(--space-1);min-width:0;padding:var(--space-1) 0;font-size:var(--text-sm);line-height:var(--leading-tight)}.tf-file[data-v-c82a66d2]{display:flex;align-items:baseline;border:none;border-radius:var(--radius-xs);background:transparent;padding:0;font-family:inherit;font-size:inherit;color:var(--color-text);flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-align:left}button.tf-file[data-v-c82a66d2]{cursor:pointer}button.tf-file[data-v-c82a66d2]:hover{text-decoration:underline;text-decoration-color:var(--color-text-faint);text-underline-offset:3px}.tf-file[data-v-c82a66d2]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tf-dir[data-v-c82a66d2]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--color-text-faint)}.tf-base[data-v-c82a66d2]{flex:none;font-weight:var(--weight-medium);color:var(--color-text)}.tf-more[data-v-c82a66d2]{width:100%;justify-content:flex-start;border-radius:0}.turn-files .tf-more[data-v-c82a66d2]:not(:disabled):active{transform:none}.tf-more-car[data-v-c82a66d2]{color:var(--color-text-faint);transition:transform var(--duration-base) var(--ease-out)}.tf-more-car.open[data-v-c82a66d2]{transform:rotate(180deg)}.diffbar[data-v-c82a66d2]{display:inline-flex;width:36px;height:3px;border-radius:var(--radius-full);overflow:hidden;flex:none}.seg-add[data-v-c82a66d2]{background:var(--color-success)}.seg-del[data-v-c82a66d2]{background:var(--color-danger)}.cn[data-v-bbd9b071]{margin:0;align-self:flex-end;max-width:78%;display:flex;flex-direction:column;align-items:flex-end}.cn-head[data-v-bbd9b071]{align-self:flex-end;display:flex;align-items:center;gap:var(--space-2);margin-bottom:var(--space-1);padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal);overflow-wrap:anywhere}.cn-head-ico[data-v-bbd9b071]{flex:none}.cn-head.error .cn-head-ico[data-v-bbd9b071]{color:var(--color-danger)}.cn-bubble[data-v-bbd9b071]{box-sizing:border-box;max-width:100%;padding:10px 12px;background:var(--color-user-bubble-bg);border-radius:var(--radius-lg);color:var(--color-text);font-size:var(--content-font-size);line-height:var(--leading-normal);white-space:pre-wrap;overflow-wrap:anywhere}.cn-meta[data-v-bbd9b071]{margin-top:var(--space-1);padding:0 var(--space-1);color:var(--color-text-faint);font-size:var(--text-base);line-height:var(--leading-normal)}/*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */.pswp{--pswp-bg: #000;--pswp-placeholder-bg: #222;--pswp-root-z-index: 100000;--pswp-preloader-color: rgba(79, 79, 79, .4);--pswp-preloader-color-secondary: rgba(255, 255, 255, .9);--pswp-icon-color: #fff;--pswp-icon-color-secondary: #4f4f4f;--pswp-icon-stroke-color: #4f4f4f;--pswp-icon-stroke-width: 2px;--pswp-error-text-color: var(--pswp-icon-color)}.pswp{position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--pswp-root-z-index);display:none;touch-action:none;outline:0;opacity:.003;contain:layout style size;-webkit-tap-highlight-color:rgba(0,0,0,0)}.pswp:focus{outline:0}.pswp *{box-sizing:border-box}.pswp img{max-width:none}.pswp--open{display:block}.pswp,.pswp__bg{transform:translateZ(0);will-change:opacity}.pswp__bg{opacity:.005;background:var(--pswp-bg)}.pswp,.pswp__scroll-wrap{overflow:hidden}.pswp__scroll-wrap,.pswp__bg,.pswp__container,.pswp__item,.pswp__content,.pswp__img,.pswp__zoom-wrap{position:absolute;top:0;left:0;width:100%;height:100%}.pswp__img,.pswp__zoom-wrap{width:auto;height:auto}.pswp--click-to-zoom.pswp--zoom-allowed .pswp__img{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,.pswp__img{cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out}.pswp__container,.pswp__img,.pswp__button,.pswp__counter{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pswp__item{z-index:1;overflow:hidden}.pswp__hidden{display:none!important}.pswp__content{pointer-events:none}.pswp__content>*{pointer-events:auto}.pswp__error-msg-container{display:grid}.pswp__error-msg{margin:auto;font-size:1em;line-height:1;color:var(--pswp-error-text-color)}.pswp .pswp__hide-on-close{opacity:.005;will-change:opacity;transition:opacity var(--pswp-transition-duration) cubic-bezier(.4,0,.22,1);z-index:10;pointer-events:none}.pswp--ui-visible .pswp__hide-on-close{opacity:1;pointer-events:auto}.pswp__button{position:relative;display:block;width:50px;height:60px;padding:0;margin:0;overflow:hidden;cursor:pointer;background:none;border:0;box-shadow:none;opacity:.85;-webkit-appearance:none;-webkit-touch-callout:none}.pswp__button:hover,.pswp__button:active,.pswp__button:focus{transition:none;padding:0;background:none;border:0;box-shadow:none;opacity:1}.pswp__button:disabled{opacity:.3;cursor:auto}.pswp__icn{fill:var(--pswp-icon-color);color:var(--pswp-icon-color-secondary)}.pswp__icn{position:absolute;top:14px;left:9px;width:32px;height:32px;overflow:hidden;pointer-events:none}.pswp__icn-shadow{stroke:var(--pswp-icon-stroke-color);stroke-width:var(--pswp-icon-stroke-width);fill:none}.pswp__icn:focus{outline:0}div.pswp__img--placeholder,.pswp__img--with-bg{background:var(--pswp-placeholder-bg)}.pswp__top-bar{position:absolute;left:0;top:0;width:100%;height:60px;display:flex;flex-direction:row;justify-content:flex-end;z-index:10;pointer-events:none!important}.pswp__top-bar>*{pointer-events:auto;will-change:opacity}.pswp__button--close{margin-right:6px}.pswp__button--arrow{position:absolute;width:75px;height:100px;top:50%;margin-top:-50px}.pswp__button--arrow:disabled{display:none;cursor:default}.pswp__button--arrow .pswp__icn{top:50%;margin-top:-30px;width:60px;height:60px;background:none;border-radius:0}.pswp--one-slide .pswp__button--arrow{display:none}.pswp--touch .pswp__button--arrow{visibility:hidden}.pswp--has_mouse .pswp__button--arrow{visibility:visible}.pswp__button--arrow--prev{right:auto;left:0}.pswp__button--arrow--next{right:0}.pswp__button--arrow--next .pswp__icn{left:auto;right:14px;transform:scaleX(-1)}.pswp__button--zoom{display:none}.pswp--zoom-allowed .pswp__button--zoom{display:block}.pswp--zoomed-in .pswp__zoom-icn-bar-v{display:none}.pswp__preloader{position:relative;overflow:hidden;width:50px;height:60px;margin-right:auto}.pswp__preloader .pswp__icn{opacity:0;transition:opacity .2s linear;animation:pswp-clockwise .6s linear infinite}.pswp__preloader--active .pswp__icn{opacity:.85}@keyframes pswp-clockwise{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.pswp__counter{height:30px;margin-top:15px;margin-inline-start:20px;font-size:14px;line-height:30px;color:var(--pswp-icon-color);text-shadow:1px 1px 3px var(--pswp-icon-color-secondary);opacity:.85}.pswp--one-slide .pswp__counter{display:none}.pswp{--pswp-root-z-index: var(--z-modal);--pswp-bg: var(--color-scrim-strong)}.media-preview-caption{position:absolute;left:0;right:0;bottom:var(--space-4);padding:0 var(--space-6);color:var(--color-text-on-scrim);font-size:var(--ui-font-size-xs);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.media-lightbox[data-v-14fb6a4a]{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;padding:var(--space-6);background:var(--color-scrim-strong)}.media-lightbox-card[data-v-14fb6a4a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);max-width:min(960px,calc(100vw - var(--space-6) * 2));max-height:calc(var(--app-height, 100vh) - var(--space-6) * 2)}.media-lightbox-frame[data-v-14fb6a4a]{max-width:100%;border-radius:var(--radius-md);overflow:hidden;background:var(--color-bg);box-shadow:var(--shadow-xl)}.media-lightbox-media[data-v-14fb6a4a]{display:block;max-width:100%;max-height:calc(var(--app-height, 100vh) - var(--space-6) * 4);object-fit:contain}.media-lightbox-name[data-v-14fb6a4a]{max-width:100%;color:var(--color-text-on-scrim);font-size:var(--ui-font-size-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.media-lightbox-close[data-v-14fb6a4a]{position:fixed;top:var(--space-4);right:var(--space-6);display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:.5px solid var(--color-line);border-radius:var(--radius-full);background:var(--color-surface-raised);color:var(--color-text);box-shadow:var(--shadow-sm);cursor:pointer;z-index:var(--z-modal-dropdown)}.media-lightbox-close[data-v-14fb6a4a]:before{content:"";position:absolute;inset:-6px}.media-lightbox-close[data-v-14fb6a4a]:hover{border-color:var(--color-line-strong);background:var(--color-surface-sunken)}.working-indicator[data-v-cd612157]{display:inline-flex;align-items:center;gap:var(--space-2);align-self:flex-start;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text-muted)}.wi-mascot[data-v-cd612157]{flex:none;width:40px}.wi-label[data-v-cd612157]{animation:wi-breathe-cd612157 1.6s var(--ease-in-out) infinite}@keyframes wi-breathe-cd612157{0%,to{opacity:1}50%{opacity:.45}}.sab[data-v-73604c69]{position:fixed;top:0;left:0;z-index:var(--z-dropdown);min-width:0;max-width:calc(100vw - 2 * var(--p-mention-tip-vmargin));max-height:calc(100vh - 2 * var(--p-mention-tip-vmargin));overflow-y:auto}.sab[data-v-73604c69] .ui-menu-item{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sab-comment[data-v-73604c69]{display:flex;align-items:center;gap:var(--space-2);width:100%;max-width:var(--p-selection-bubble-w);padding:var(--space-1)}.chat-empty[data-v-999e1e60]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px 16px;color:var(--faint);text-align:center}.chat-empty-text[data-v-999e1e60]{font-size:var(--ui-font-size-sm)}.chat-loading[data-v-999e1e60]{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:24px 16px;color:var(--muted)}.chat-loading-text[data-v-999e1e60]{font-size:var(--ui-font-size-sm)}.chat[data-v-999e1e60]{--chat-turn-gap: 16px;--chat-block-gap: 10px;--chat-section-gap: 18px;display:flex;flex-direction:column;gap:0;padding:16px 14px 20px;flex:1;min-height:0;position:relative}.chat .chat-empty[data-v-999e1e60]{align-self:stretch}.chat>.u-turn[data-v-999e1e60],.chat>.a-msg[data-v-999e1e60],.chat>.compact-divider[data-v-999e1e60],.chat>.cron-notice[data-v-999e1e60],.chat>.sending-placeholder[data-v-999e1e60],.chat[data-v-999e1e60]>.activity-notice{margin-top:var(--chat-turn-gap)}.chat>.a-msg[data-v-999e1e60]{margin-top:10px}.chat>.u-turn[data-v-999e1e60]:first-child,.chat>.a-msg[data-v-999e1e60]:first-child,.chat>.compact-divider[data-v-999e1e60]:first-child,.chat>.cron-notice[data-v-999e1e60]:first-child,.chat>.sending-placeholder[data-v-999e1e60]:first-child,.chat[data-v-999e1e60]>.activity-notice:first-child{margin-top:0}.u-turn[data-v-999e1e60]{display:flex;flex-direction:column;align-items:flex-end;align-self:flex-start;width:100%}.u-bub[data-v-999e1e60]{align-self:flex-end;max-width:78%;background:var(--color-user-bubble-bg);color:var(--color-text);border-radius:var(--radius-lg);padding:10px 12px;font-size:var(--content-font-size);line-height:var(--leading-normal)}.u-meta[data-v-999e1e60]{align-self:flex-end;display:flex;justify-content:flex-end;align-items:center;max-width:78%;margin-top:var(--space-2);margin-right:4px}.u-meta .u-edit[data-v-999e1e60]{min-height:22px;box-sizing:border-box}.u-text[data-v-999e1e60]{white-space:pre-wrap;overflow-wrap:anywhere}.u-text-wrap[data-v-999e1e60]{position:relative;display:flex;flex-direction:column}.u-text-wrap-args[data-v-999e1e60]{margin-top:var(--space-1)}.u-text-wrap.is-clamped[data-v-999e1e60]{min-width:120px}.u-text-wrap.is-clamped>.u-text[data-v-999e1e60],.u-text-wrap.is-clamped>.skill-act-args[data-v-999e1e60]{max-height:10lh;overflow:hidden;mask-image:linear-gradient(to bottom,black calc(100% - 5lh),transparent calc(100% - 1lh));-webkit-mask-image:linear-gradient(to bottom,black calc(100% - 5lh),transparent calc(100% - 1lh))}.u-text-wrap.is-clamped>.q-body[data-v-999e1e60]{max-height:3lh;overflow:hidden;mask-image:linear-gradient(to bottom,black calc(100% - 1.2lh),transparent calc(100% - .2lh));-webkit-mask-image:linear-gradient(to bottom,black calc(100% - 1.2lh),transparent calc(100% - .2lh))}.u-text-toggle[data-v-999e1e60]{display:inline-flex;align-items:center;gap:var(--space-1);align-self:center;margin-top:var(--space-2);padding:var(--space-2) var(--space-4);border:none;border-radius:var(--radius-full);background:var(--color-surface-raised);box-shadow:var(--shadow-sm);color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);line-height:1;cursor:pointer;user-select:none;transition:box-shadow var(--duration-base) var(--ease-out)}.u-text-toggle[data-v-999e1e60]:hover{box-shadow:var(--shadow-md)}.u-text-toggle[data-v-999e1e60]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.u-text-wrap.is-clamped .u-text-toggle[data-v-999e1e60]{position:absolute;bottom:0;left:50%;transform:translate(-50%);margin-top:0}.u-text-toggle-car[data-v-999e1e60]{transition:transform var(--duration-base) var(--ease-out)}.u-text-toggle[aria-expanded=true] .u-text-toggle-car[data-v-999e1e60]{transform:rotate(180deg)}.u-edit[data-v-999e1e60]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s}.u-edit svg[data-v-999e1e60]{display:block;flex:none}.u-edit[data-v-999e1e60]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.u-edit-armed[data-v-999e1e60]{--undo-hint-duration: 5s;gap:var(--space-1);opacity:1;color:var(--color-text);animation:u-edit-armed-blink-999e1e60 var(--undo-hint-duration) linear forwards}.u-edit-armed[data-v-999e1e60]:hover{color:var(--color-accent);background:var(--hover)}.u-edit-hint[data-v-999e1e60]{display:inline-flex;align-items:center;gap:var(--space-1);font-size:var(--text-xs);font-weight:var(--weight-medium);white-space:nowrap}@keyframes u-edit-armed-blink-999e1e60{0%,55%{opacity:1}62%{opacity:.45}69%{opacity:1}75%{opacity:.4}81%{opacity:.95}86%{opacity:.35}91%{opacity:.85}95%{opacity:.3}to{opacity:0}}@media(prefers-reduced-motion:reduce){.u-edit-armed[data-v-999e1e60]{animation:none}}.u-copy[data-v-999e1e60]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s;min-height:22px;box-sizing:border-box}.u-copy svg[data-v-999e1e60]{display:block;flex:none}.u-copy[data-v-999e1e60]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.u-edit-wrap[data-v-999e1e60]{display:flex;justify-content:flex-end}.chat>.u-edit-wrap[data-v-999e1e60]{margin-top:4px}.chat>.u-edit-wrap+.a-msg[data-v-999e1e60]{margin-top:8px}.compact-divider[data-v-999e1e60]{display:flex;align-items:center;gap:10px;align-self:stretch;width:100%;margin:var(--chat-section-gap) 0 0}.chat>.compact-divider[data-v-999e1e60]:first-child{margin-top:0}.cd-line[data-v-999e1e60]{flex:1;height:1px;background:var(--line)}.cd-label[data-v-999e1e60]{flex:none;display:inline-flex;align-items:center;gap:8px;max-width:80%;font-size:var(--text-base);color:var(--muted);white-space:nowrap}.cd-btn[data-v-999e1e60]{background:none;border:none;padding:0;cursor:pointer;font:inherit;font-size:var(--text-base);color:var(--muted)}.cd-view[data-v-999e1e60]{color:var(--color-accent)}.cd-btn:hover .cd-view[data-v-999e1e60]{text-decoration:underline}.chat>.turn-failed[data-v-999e1e60]{margin-top:var(--chat-turn-gap)}.chat>.turn-failed[data-v-999e1e60]:first-child{margin-top:0}.turn-failed[data-v-999e1e60]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border:var(--p-hairline) solid var(--color-danger-bd);border-radius:var(--radius-lg);background:var(--color-danger-soft);box-shadow:var(--shadow-xs);animation:kimi-card-in var(--duration-slow) var(--ease-out)}.tf-chip[data-v-999e1e60]{display:inline-flex;align-items:center;justify-content:center;width:var(--space-6);height:var(--space-6);border-radius:var(--radius-md);background:var(--color-surface-raised);box-shadow:var(--shadow-xs);flex:none;color:var(--color-danger)}.tf-main[data-v-999e1e60]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.tf-title[data-v-999e1e60]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);line-height:var(--leading-normal)}.tf-sub[data-v-999e1e60]{font-size:var(--text-xs);color:var(--color-text-muted);line-height:var(--leading-normal);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tf-meta[data-v-999e1e60]{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint);line-height:var(--leading-normal);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.goal-prov[data-v-999e1e60]{display:flex;align-items:center;gap:var(--space-1);margin-bottom:var(--space-1);color:var(--color-text-faint);font-size:var(--text-xs);line-height:var(--leading-normal);user-select:none}.a-msg[data-v-999e1e60]{align-self:flex-start;max-width:94%;width:94%}.a-msg-ft[data-v-999e1e60]{display:flex;justify-content:flex-start;align-items:center;gap:8px;height:auto;margin-top:var(--chat-block-gap);overflow:visible}.a-time[data-v-999e1e60]{display:inline-flex;align-items:center;font-size:var(--text-base);color:var(--muted);line-height:1}.a-cpbtn[data-v-999e1e60]{display:inline-flex;align-items:center;justify-content:center;padding:2px 5px;background:none;border:none;border-radius:var(--radius-sm);color:var(--muted);font:inherit;font-size:var(--text-base);line-height:1;cursor:pointer;opacity:.7;transition:opacity .12s,color .12s,background-color .12s;min-height:22px;box-sizing:border-box}.a-cpbtn[data-v-999e1e60]:hover{opacity:1;color:var(--color-accent);background:var(--hover)}.a-cpbtn svg[data-v-999e1e60]{display:block;flex:none}@media(hover:none){.a-msg-ft[data-v-999e1e60]{height:auto;margin-top:var(--chat-block-gap);opacity:1;pointer-events:auto}.a-cpbtn[data-v-999e1e60]{font-size:var(--ui-font-size-sm);padding:8px 10px;margin:-4px -6px}}.a-msg .msg[data-v-999e1e60]{font-size:var(--ui-font-size);line-height:var(--leading-prose);color:var(--color-text);font-weight:500}.a-msg .msg[data-v-999e1e60] p{margin:0}.a-msg .msg[data-v-999e1e60] p+p{margin-top:8px}.a-msg>.msg[data-v-999e1e60],.a-msg[data-v-999e1e60]>.think,.a-msg[data-v-999e1e60]>.tool-group,.a-msg[data-v-999e1e60]>.activity-run,.a-msg[data-v-999e1e60]>.agent-card,.a-msg[data-v-999e1e60]>.agent-group,.a-msg[data-v-999e1e60]>.tool-line,.a-msg[data-v-999e1e60]>.swarm-card,.a-msg[data-v-999e1e60]>.media-tool,.a-msg[data-v-999e1e60]>.ask-receipt{margin-top:var(--chat-block-gap)}.a-msg>.msg[data-v-999e1e60]:first-child,.a-msg[data-v-999e1e60]>.think:first-child,.a-msg[data-v-999e1e60]>.tool-group:first-child,.a-msg[data-v-999e1e60]>.activity-run:first-child,.a-msg[data-v-999e1e60]>.agent-card:first-child,.a-msg[data-v-999e1e60]>.agent-group:first-child,.a-msg[data-v-999e1e60]>.tool-line:first-child,.a-msg[data-v-999e1e60]>.swarm-card:first-child,.a-msg[data-v-999e1e60]>.media-tool:first-child,.a-msg[data-v-999e1e60]>.ask-receipt:first-child{margin-top:0}.a-msg>.goal-prov:first-child+.msg[data-v-999e1e60],.a-msg>.goal-prov[data-v-999e1e60]:first-child+.think,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.tool-group,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.activity-run,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.agent-card,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.agent-group,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.tool-line,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.swarm-card,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.media-tool,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.ask-receipt,.a-msg>.goal-prov[data-v-999e1e60]:first-child+.turn-fold{margin-top:0}.a-msg[data-v-999e1e60] :not(pre)>code{font:.9em var(--font-mono);background:var(--color-inline-code-bg);border:.5px solid var(--color-line);border-radius:var(--radius-sm);padding:1px 6px;color:var(--color-accent-hover)}@container (min-width: 760px){.a-msg .msg[data-v-999e1e60] .markstream-vue.markdown-renderer:has(.table-node-wrapper.md-table-wide){content-visibility:visible}.a-msg .msg[data-v-999e1e60] .table-node-wrapper.md-table-wide{position:relative;left:50%;width:max-content;min-width:100%;max-width:min(var(--p-table-max),calc(100cqi - var(--space-5) - var(--space-5)))!important;transform:translate(-50%)}.a-msg .msg[data-v-999e1e60] .table-node-wrapper:not(.md-table-wide){--table-cell-cap: min(var(--p-table-cell-max), 36cqi)}}.u-atts[data-v-999e1e60]{display:flex;flex-wrap:wrap;gap:var(--space-1-5);margin-bottom:var(--space-2)}.u-atts button.attachment-pill[data-v-999e1e60]{appearance:none;border:none;background:none;padding-block:0;font-family:inherit;font-size:inherit}.sending-placeholder[data-v-999e1e60]{align-self:flex-start;padding:10px 0}.skill-act[data-v-999e1e60]{display:flex;flex-direction:column;gap:2px}.skill-act-head[data-v-999e1e60]{font-size:var(--ui-font-size-sm);font-weight:500;color:var(--color-accent-hover);display:flex;align-items:center;gap:6px}.skill-act-arrow[data-v-999e1e60]{color:var(--color-accent);font-size:var(--text-base)}.skill-act-args[data-v-999e1e60]{font-size:var(--text-base);color:var(--muted);padding-left:17px;white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:640px){.chat[data-v-999e1e60]{box-sizing:border-box;width:100%;padding:14px max(12px,var(--safe-right)) 18px max(12px,var(--safe-left))}.u-bub[data-v-999e1e60]{max-width:min(88%,calc(100vw - 52px))}.a-msg[data-v-999e1e60]{width:100%;max-width:100%}.a-msg[data-v-999e1e60] .md,.a-msg[data-v-999e1e60] .markdown-renderer,.a-msg[data-v-999e1e60] .code-block-container,.a-msg[data-v-999e1e60] .diff-wrap,.a-msg[data-v-999e1e60] pre{max-width:100%}.a-msg[data-v-999e1e60] .code-block-container pre,.a-msg[data-v-999e1e60] .diff-pre{overflow-x:auto;-webkit-overflow-scrolling:touch}.a-msg[data-v-999e1e60] .media-tool.mob{width:min(44vw,160px)}.cd-label[data-v-999e1e60]{min-width:0;max-width:calc(100% - 48px);overflow:hidden;text-overflow:ellipsis}.u-edit-confirm[data-v-999e1e60]{flex-wrap:wrap;justify-content:flex-end;max-width:calc(100vw - 28px)}.ts[data-v-999e1e60]{font-size:var(--ui-font-size-sm)}.chat-empty-text[data-v-999e1e60],.chat-loading-text[data-v-999e1e60]{font-size:var(--ui-font-size-lg)}.cd-label[data-v-999e1e60],.cd-btn[data-v-999e1e60]{font-size:var(--ui-font-size)}}.top-sentinel[data-v-999e1e60]{display:flex;align-items:center;justify-content:center;padding:12px 0;min-height:28px;user-select:none}.top-sentinel-loading[data-v-999e1e60]{opacity:.8}.top-sentinel-btn[data-v-999e1e60]{appearance:none;border:.5px solid var(--border);background:transparent;color:var(--muted);font-size:var(--ui-font-size-sm);padding:4px 12px;border-radius:999px;cursor:pointer;transition:color .15s ease,border-color .15s ease}.top-sentinel-btn[data-v-999e1e60]:hover{color:var(--fg);border-color:var(--fg)}.top-sentinel-text[data-v-999e1e60]{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:var(--ui-font-size-sm)}.chat[data-v-999e1e60]{background:transparent}.chat[data-v-999e1e60]{gap:0;padding:22px 20px 26px}.u-bub[data-v-999e1e60]{background:var(--color-user-bubble-bg);border-radius:var(--radius-lg);padding:10px 12px}.a-msg[data-v-999e1e60]{max-width:100%;width:100%}.chat>.q-stack[data-v-999e1e60]{margin-top:var(--chat-turn-gap)}.chat>.q-stack[data-v-999e1e60]:first-child{margin-top:0}.q-stack[data-v-999e1e60]{align-self:flex-end;width:100%;display:flex;flex-direction:column;gap:8px}.q-head[data-v-999e1e60]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0 6px;color:var(--color-text-faint);font-size:var(--ui-font-size-xs)}.q-title[data-v-999e1e60]{display:inline-flex;align-items:center;gap:6px}.q-title b[data-v-999e1e60]{color:var(--color-accent-hover);font-weight:var(--weight-medium)}.q-turn[data-v-999e1e60]{position:relative;flex-direction:row;align-items:center;justify-content:flex-end;gap:var(--space-2)}.q-send[data-v-999e1e60]{flex:none;width:var(--space-6);height:var(--space-6);display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;border-radius:var(--radius-full);background:var(--color-accent);color:var(--color-text-on-accent);box-shadow:var(--shadow-xs);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.q-send[data-v-999e1e60]:hover{background:var(--color-accent-hover)}.q-send[data-v-999e1e60]:active{transform:scale(.92)}.q-send[data-v-999e1e60]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.q-send svg[data-v-999e1e60]{display:block;flex:none}.q-bub[data-v-999e1e60]{display:flex;align-items:center;gap:8px;width:fit-content;background:var(--color-user-bubble-bg);padding:8px 8px 8px 6px;transition:background var(--duration-fast) var(--ease-out)}.q-bub[data-v-999e1e60]:hover{background:var(--hover)}.q-grip[data-v-999e1e60]{flex:none;display:inline-flex;align-items:center;padding:2px;color:var(--color-text-faint);cursor:grab;opacity:.7}.q-grip[data-v-999e1e60]:hover{opacity:1}.q-grip[data-v-999e1e60]:active{cursor:grabbing}.q-clamp[data-v-999e1e60]{flex:1;min-width:0}.q-body[data-v-999e1e60]{flex:1;min-width:0;background:none;border:none;padding:0;margin:0;font:inherit;color:var(--color-text);text-align:left;cursor:pointer;opacity:.82}.q-bub:hover .q-body[data-v-999e1e60]{opacity:1}.q-body[data-v-999e1e60]:disabled{cursor:default}.q-text[data-v-999e1e60]{white-space:pre-wrap;overflow-wrap:anywhere}.q-text-placeholder[data-v-999e1e60]{display:inline-flex;align-items:center;gap:4px;color:var(--color-text-muted)}.q-imgs[data-v-999e1e60]{display:flex;gap:4px;flex:none}.q-img[data-v-999e1e60]{width:28px;height:28px;object-fit:cover;border-radius:var(--radius-sm);border:.5px solid var(--color-line)}.q-file[data-v-999e1e60]{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 6px;border-radius:var(--radius-sm);border:.5px solid var(--color-line);color:var(--color-text-muted);font-size:calc(var(--ui-font-size) - 3px);max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.q-rm[data-v-999e1e60]{flex:none;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;background:none;border:none;border-radius:var(--radius-sm);color:var(--color-text-faint);cursor:pointer;opacity:0;transition:opacity .12s ease,background .12s ease,color .12s ease}.q-bub:hover .q-rm[data-v-999e1e60],.q-bub:focus-within .q-rm[data-v-999e1e60],.q-rm[data-v-999e1e60]:focus-visible{opacity:1}.q-rm[data-v-999e1e60]:hover{background:var(--color-danger-soft);color:var(--color-danger)}.q-edit[data-v-999e1e60]{display:none;flex:none;width:22px;height:22px;align-items:center;justify-content:center;background:none;border:none;border-radius:var(--radius-sm);color:var(--color-text-faint);cursor:pointer}.q-edit[data-v-999e1e60]:hover{background:var(--color-hover);color:var(--color-text)}@media(hover:none){.q-grip[data-v-999e1e60]{display:none}.q-edit[data-v-999e1e60]{display:inline-flex}.q-rm[data-v-999e1e60],.q-edit[data-v-999e1e60]{opacity:1;position:relative}.q-rm[data-v-999e1e60]:before,.q-edit[data-v-999e1e60]:before{content:"";position:absolute;inset:-11px}}.q-turn.q-dragging .q-bub[data-v-999e1e60]{opacity:.45}.q-turn.drop-before[data-v-999e1e60]:before,.q-turn.drop-after[data-v-999e1e60]:after{content:"";position:absolute;left:0;right:0;height:2px;background:var(--color-accent);border-radius:var(--radius-full);z-index:1}.q-turn.drop-before[data-v-999e1e60]:before{top:-5px}.q-turn.drop-after[data-v-999e1e60]:after{bottom:-5px}.agent-panel[data-v-1441b1f4]{height:100%;min-height:0;display:flex;flex-direction:column;position:relative;background:var(--color-bg)}.agent-meta[data-v-1441b1f4]{flex:none;display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-3) var(--space-2);user-select:none}.agent-meta[data-v-1441b1f4]:before,.agent-meta[data-v-1441b1f4]:after{content:"";flex:1;height:.5px;background:var(--color-line)}.agent-meta-text[data-v-1441b1f4]{font-size:var(--text-xs);line-height:1;color:var(--color-text-muted);white-space:nowrap;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis}.agent-prompt[data-v-1441b1f4]{flex:none;display:flex;flex-direction:column;padding:0 var(--space-3) var(--space-2)}.agent-prompt-bubble[data-v-1441b1f4]{display:flex;flex-direction:column;align-self:flex-end;max-width:78%;padding:10px 12px;background:var(--color-user-bubble-bg);border-radius:var(--radius-lg)}.agent-prompt-wrap[data-v-1441b1f4]{position:relative;display:flex;flex-direction:column}.agent-prompt-text[data-v-1441b1f4]{white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--content-font-size);line-height:var(--leading-normal);color:var(--color-text)}.agent-prompt-text.is-command[data-v-1441b1f4]{font-family:var(--font-mono)}.agent-prompt-wrap.is-clamped>.agent-prompt-text[data-v-1441b1f4]{max-height:6lh;overflow:hidden;mask-image:linear-gradient(to bottom,black calc(100% - 2.5lh),transparent calc(100% - .5lh));-webkit-mask-image:linear-gradient(to bottom,black calc(100% - 2.5lh),transparent calc(100% - .5lh))}.agent-prompt-toggle[data-v-1441b1f4]{display:inline-flex;align-items:center;gap:var(--space-1);align-self:center;margin-top:var(--space-1);padding:var(--space-1) var(--space-3);border:none;border-radius:var(--radius-full);background:var(--color-surface-raised);box-shadow:var(--shadow-sm);color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);line-height:1;cursor:pointer;user-select:none;transition:box-shadow var(--duration-base) var(--ease-out)}.agent-prompt-toggle[data-v-1441b1f4]:hover{box-shadow:var(--shadow-md)}.agent-prompt-toggle[data-v-1441b1f4]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.agent-prompt-wrap.is-clamped .agent-prompt-toggle[data-v-1441b1f4]{position:absolute;bottom:0;left:50%;transform:translate(-50%);margin-top:0}.agent-prompt-toggle-car[data-v-1441b1f4]{transition:transform var(--duration-base) var(--ease-out)}.agent-prompt-toggle-car.open[data-v-1441b1f4]{transform:rotate(180deg)}.agent-transcript[data-v-1441b1f4]{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--pfc-host-h, 0px)}.agent-transcript-inner[data-v-1441b1f4]{display:flex;flex-direction:column;min-height:100%;width:100%;max-width:var(--p-content-max);margin-inline:auto}.agent-transcript[data-v-1441b1f4] .think-body,.agent-transcript[data-v-1441b1f4] .ar-body,.agent-transcript[data-v-1441b1f4] .tf-body,.agent-transcript[data-v-1441b1f4] .bb,.agent-transcript[data-v-1441b1f4] .tl-body{transition:none}.agent-error[data-v-1441b1f4]{color:var(--color-danger);font:var(--text-sm)/var(--leading-normal) var(--font-ui)}.agent-jump-btn[data-v-1441b1f4]{position:absolute;left:50%;bottom:var(--space-3);transform:translate(-50%);z-index:var(--z-sticky);display:inline-flex;align-items:center;gap:6px;padding:6px var(--space-3);border:.5px solid var(--color-line);border-radius:var(--radius-full);background:var(--color-surface);box-shadow:var(--shadow-sm);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-ui-strong);line-height:1.5;white-space:nowrap;cursor:pointer;user-select:none}.agent-jump-car[data-v-1441b1f4]{width:12px;height:12px}.agent-jump-btn[data-v-1441b1f4]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.agent-jump-enter-active[data-v-1441b1f4],.agent-jump-leave-active[data-v-1441b1f4]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.agent-jump-enter-from[data-v-1441b1f4],.agent-jump-leave-to[data-v-1441b1f4]{opacity:0;transform:translate(-50%) translateY(8px)}.agent-fallback[data-v-1441b1f4]{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-4)}.agent-fallback.prose[data-v-1441b1f4] .op{font-family:var(--font-ui)}.conversation-toc[data-v-9c0a5438]{position:absolute;z-index:var(--z-sticky);top:50%;transform:translateY(-50%);--toc-content-max: min( var(--p-content-max), calc(100cqi - var(--space-5) - var(--space-5)) );left:calc(50% + (var(--toc-content-max) / 2) + 14px);max-height:calc(100% - 160px);display:flex;flex-direction:column;justify-content:center;opacity:.5;transition:opacity var(--duration-base) var(--ease-out)}.conversation-toc[data-v-9c0a5438]:before{content:"";position:absolute;inset:0 -48px 0 -14px;z-index:0}.conversation-toc[data-v-9c0a5438]:hover,.conversation-toc[data-v-9c0a5438]:focus-within{opacity:1}.conversation-toc[data-v-9c0a5438]:hover:not(:focus-within){transition-delay:var(--duration-hover-intent)}.toc-scroll[data-v-9c0a5438]{position:relative;z-index:1;display:flex;flex-direction:column;gap:7px;padding:8px 0;min-height:0;overflow-y:auto;scrollbar-width:none}.toc-scroll[data-v-9c0a5438]::-webkit-scrollbar{display:none}.toc-row[data-v-9c0a5438]{display:flex;align-items:center;gap:10px;height:18px;padding:0;border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);text-align:left;cursor:pointer;white-space:nowrap}.toc-row[data-v-9c0a5438]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.toc-bar[data-v-9c0a5438]{flex:none;width:3px;height:14px;border-radius:var(--radius-full);background:var(--color-accent);opacity:.3;transition:opacity var(--duration-fast) var(--ease-out),height var(--duration-fast) var(--ease-out)}.toc-label[data-v-9c0a5438]{display:block;max-width:0;overflow:hidden;opacity:0;text-overflow:ellipsis;transition:max-width .22s var(--ease-out),opacity var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.conversation-toc:hover .toc-bar[data-v-9c0a5438],.conversation-toc:focus-within .toc-bar[data-v-9c0a5438]{height:18px;opacity:.5}.conversation-toc:hover .toc-label[data-v-9c0a5438],.conversation-toc:focus-within .toc-label[data-v-9c0a5438]{max-width:220px;opacity:1}.conversation-toc:hover:not(:focus-within) .toc-bar[data-v-9c0a5438]{transition-delay:0ms,var(--duration-hover-intent)}.conversation-toc:hover:not(:focus-within) .toc-label[data-v-9c0a5438]{transition-delay:var(--duration-hover-intent),var(--duration-hover-intent),0ms}.toc-row.active .toc-bar[data-v-9c0a5438]{opacity:1;height:18px}.toc-row.active .toc-label[data-v-9c0a5438]{color:var(--color-accent);font-weight:var(--weight-medium)}.toc-row:hover .toc-bar[data-v-9c0a5438]{opacity:1}.toc-row:hover .toc-label[data-v-9c0a5438]{color:var(--color-text)}.conversation-toc.toc-clipped[data-v-9c0a5438]{visibility:hidden;pointer-events:none}.changes-pane[data-v-2c83d74b]{display:flex;flex-direction:column;height:100%;background:var(--bg);font-family:var(--mono)}.dv-path[data-v-2c83d74b],.dv-change-count[data-v-2c83d74b]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:var(--ui-font-size-xs);color:var(--muted)}.dv-change-count[data-v-2c83d74b]{flex:1;align-self:stretch;display:inline-flex;align-items:center;font-family:var(--font-ui)}.dv-path[data-v-2c83d74b]{font-family:var(--font-ui)}.ch-head[data-v-2c83d74b]{display:flex;align-items:center;gap:8px;padding:8px var(--space-3);border-bottom:.5px solid var(--line);background:var(--panel);font-size:var(--text-base);color:var(--dim);flex:none;white-space:nowrap;overflow:hidden;font-family:var(--font-ui);user-select:none}.br-heading[data-v-2c83d74b]{display:inline-flex;align-items:center;gap:var(--space-1);flex:none}.br-icon[data-v-2c83d74b]{flex:none;color:var(--muted)}.br-label[data-v-2c83d74b]{color:var(--muted);font-size:var(--text-xs);font-weight:500}.br-name[data-v-2c83d74b]{color:var(--color-text);font-weight:500;font-size:var(--text-xs)}.sync-info[data-v-2c83d74b]{display:flex;align-items:center;gap:4px}.ahead[data-v-2c83d74b]{color:var(--color-accent);font-size:var(--text-xs)}.behind[data-v-2c83d74b]{color:var(--color-warning);font-size:var(--text-xs)}.empty-head[data-v-2c83d74b]{color:var(--muted);font-size:var(--text-base)}.ch-list[data-v-2c83d74b]{flex:1;min-height:0}.ch-list-content[data-v-2c83d74b]{min-height:100%;padding:4px 0;padding-bottom:max(4px,var(--pfc-host-h, 0px))}.ch-row[data-v-2c83d74b]{display:flex;align-items:center;gap:6px;padding:3px 8px;cursor:pointer;font-size:var(--text-xs);line-height:1.6;width:100%;background:none;border:none;text-align:left;font-family:var(--font-ui);color:inherit}.ch-row[data-v-2c83d74b]:hover{background:var(--panel2)}.ch-row[data-v-2c83d74b]:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}.ch-tree[data-v-2c83d74b]{--tree-base-indent: 14px;--tree-indent-step: 12px;font-family:var(--font-ui)}.tree-list[data-v-2c83d74b]{list-style:none;margin:0}.tree-node[data-v-2c83d74b]{overflow:hidden;interpolate-size:allow-keywords}.tree-collapse-enter-active[data-v-2c83d74b],.tree-collapse-leave-active[data-v-2c83d74b]{transition:block-size var(--duration-base) var(--ease-out),opacity var(--duration-fast) var(--ease-out),transform var(--duration-base) var(--ease-out)}.tree-collapse-enter-from[data-v-2c83d74b],.tree-collapse-leave-to[data-v-2c83d74b]{block-size:0;opacity:0;transform:translateY(-3px)}.tree-collapse-enter-to[data-v-2c83d74b],.tree-collapse-leave-from[data-v-2c83d74b]{block-size:auto;opacity:1;transform:translateY(0)}.tree-row[data-v-2c83d74b]{position:relative;display:flex;align-items:center;gap:6px;width:100%;margin-top:1px;padding:3px 8px;background:none;border:none;text-align:left;font-family:inherit;font-size:var(--text-xs);color:inherit;cursor:pointer}.tree-row[data-v-2c83d74b]:before{content:"";position:absolute;top:0;bottom:0;left:calc(var(--tree-base-indent) + 6px);width:calc(var(--tree-depth, 0) * var(--tree-indent-step));background:repeating-linear-gradient(to right,var(--color-line) 0 1px,transparent 1px var(--tree-indent-step));pointer-events:none}.tree-row[data-v-2c83d74b]:hover{background:var(--panel2)}.tree-row[data-v-2c83d74b]:focus-visible{outline:2px solid var(--color-accent);outline-offset:-2px}.tree-folder[data-v-2c83d74b]{color:var(--color-text);font-weight:500}.tree-file[data-v-2c83d74b]{color:var(--color-text);font-weight:450}.tree-icon[data-v-2c83d74b]{flex:none;color:var(--muted)}.tree-name[data-v-2c83d74b]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge[data-v-2c83d74b]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-xs);font-size:max(9px,calc(var(--ui-font-size) - 4px));font-weight:500;flex:none;user-select:none}.badge.modified[data-v-2c83d74b]{background:var(--color-warning-soft);color:var(--color-warning)}.badge.added[data-v-2c83d74b]{background:var(--color-success-soft);color:var(--color-success)}.badge.deleted[data-v-2c83d74b]{background:var(--color-danger-soft);color:var(--color-danger)}.badge.renamed[data-v-2c83d74b]{background:var(--color-done-soft);color:var(--color-done)}.badge.untracked[data-v-2c83d74b]{background:var(--color-success-soft);color:var(--color-success)}.badge.conflicted[data-v-2c83d74b]{background:color-mix(in srgb,var(--color-danger) 10%,var(--bg));color:var(--color-danger);font-size:max(9px,calc(var(--ui-font-size) - 5px))}.badge.ignored[data-v-2c83d74b]{background:var(--color-well);color:var(--faint)}.badge.clean[data-v-2c83d74b]{background:transparent;color:var(--faint)}.badge.unknown[data-v-2c83d74b]{background:var(--color-well);color:var(--muted)}.fpath[data-v-2c83d74b]{color:var(--color-text);font-size:var(--text-xs);font-weight:450;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:left;min-width:0}.fpath[data-v-2c83d74b]:before,.fpath[data-v-2c83d74b]:after{content:"‎"}.empty-state[data-v-2c83d74b]{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);padding:32px 20px;color:var(--muted);font-size:var(--ui-font-size);text-align:center;user-select:none}.empty-state-icon[data-v-2c83d74b]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--color-well);color:var(--color-text-muted)}.diff-head[data-v-2c83d74b]{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:.5px solid var(--line);background:var(--panel);flex:none;white-space:nowrap;overflow:hidden}.dv-lines-wrap[data-v-2c83d74b]{flex:1;min-height:0;overflow:auto;padding-bottom:var(--pfc-host-h, 0px)}.diff-content-enter-active[data-v-2c83d74b],.diff-content-leave-active[data-v-2c83d74b]{transition:opacity var(--duration-base) var(--ease-out)}.diff-content-enter-from[data-v-2c83d74b],.diff-content-leave-to[data-v-2c83d74b]{opacity:0}@media(max-width:640px){.ch-head[data-v-2c83d74b]{padding:10px 14px}.ch-list[data-v-2c83d74b]{padding:2px 0 12px}.ch-row[data-v-2c83d74b]{min-height:44px;padding:8px 14px;gap:12px;font-size:var(--text-xs)}.ch-row[data-v-2c83d74b]:active{background:var(--panel2)}.badge[data-v-2c83d74b]{width:18px;height:18px}.fpath[data-v-2c83d74b]{font-size:var(--text-xs)}.tree-row[data-v-2c83d74b]{min-height:40px;padding:8px 14px}.diff-head[data-v-2c83d74b]{padding:8px 12px;gap:10px}.diff-path[data-v-2c83d74b]{font-size:var(--text-base)}}.changes-pane .empty-state[data-v-2c83d74b],.br-label[data-v-2c83d74b],.empty-head[data-v-2c83d74b]{font-family:var(--sans)}.ch-row[data-v-2c83d74b],.ct-row[data-v-2c83d74b]{margin:1px 6px;width:calc(100% - 12px);border-radius:var(--radius-md)}.changes-pane .badge[data-v-2c83d74b],.changed-tree .badge[data-v-2c83d74b]{border-radius:var(--radius-sm)}.change-count[data-v-2c83d74b]{font-family:var(--sans);border-radius:999px}.qcard[data-v-645038cd]{display:flex;flex-direction:column;max-height:calc(var(--app-height, 100dvh) - var(--dock-card-top-clearance));margin:var(--space-2) 0;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);overflow:hidden auto;animation:kimi-card-in var(--duration-base) var(--ease-out)}.qcard>.qh[data-v-645038cd],.qcard>.qfoot[data-v-645038cd]{flex:none}.qcard.minimized[data-v-645038cd]{transition:background var(--duration-fast) var(--ease-out)}.qcard.minimized[data-v-645038cd]:hover{background:var(--color-hover)}.qh[data-v-645038cd]{display:flex;align-items:flex-start;gap:var(--space-2);padding:var(--space-3) var(--space-4) 0}.qcard.minimized .qh[data-v-645038cd]{padding-bottom:var(--space-3);align-items:center}.qcard.minimized .qh.clickable[data-v-645038cd]{cursor:pointer}.qh-chip[data-v-645038cd]{width:var(--p-chip-num);height:var(--p-chip-num);border-radius:var(--radius-sm);background:var(--color-inline-code-bg);color:var(--color-text);font:var(--weight-medium) var(--text-xs)/var(--p-chip-num) var(--font-ui);text-align:center;flex:none}.qtitle[data-v-645038cd]{flex:1;min-width:0;color:var(--color-text);font-size:var(--text-lg);font-weight:var(--weight-semibold);line-height:var(--leading-tight);overflow-wrap:anywhere}.qcard.minimized .qtitle[data-v-645038cd]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.qmin[data-v-645038cd],.qclose[data-v-645038cd]{flex:none;margin-top:calc((var(--text-lg) * var(--leading-tight) - var(--icon-button-sm)) / 2)}.qmin[data-v-645038cd]{margin-left:auto}.qcard.minimized .qmin[data-v-645038cd],.qcard.minimized .qclose[data-v-645038cd]{margin-top:0}.qbody[data-v-645038cd]{min-height:min(var(--question-card-body-min-h),calc(var(--app-height, 100dvh) * .25));overflow-y:auto;padding:var(--space-3) var(--space-4) 0;color:var(--color-text);font:var(--text-base)/var(--leading-normal) var(--font-ui)}.qmdbody[data-v-645038cd]{margin-bottom:var(--space-2)}.qopts[data-v-645038cd]{display:flex;flex-direction:column;gap:2px;margin-top:var(--space-2)}.qopt[data-v-645038cd]{display:flex;align-items:flex-start;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);cursor:pointer;font:var(--text-sm)/var(--leading-normal) var(--font-ui);color:var(--color-text);transition:background var(--duration-fast) var(--ease-out);user-select:none}.qopt[data-v-645038cd]:hover,.qopt.highlighted[data-v-645038cd]{background:var(--color-hover)}.qopt-key[data-v-645038cd]{width:var(--p-chip-num);height:var(--p-chip-num);margin-top:calc((var(--text-base) * var(--leading-normal) - var(--p-chip-num)) / 2);border-radius:var(--radius-sm);background:var(--color-inline-code-bg);color:var(--color-text);font:var(--weight-medium) var(--text-xs)/var(--p-chip-num) var(--font-ui);text-align:center;flex:none}.qopt-key[data-v-645038cd]:empty{background:transparent}.qopt-glyph[data-v-645038cd]{width:16px;height:16px;margin-top:calc((var(--text-base) * var(--leading-normal) - 16px) / 2);flex:none;border:.5px solid var(--color-line-strong);position:relative;transition:border-color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out)}.qopt-glyph.rad[data-v-645038cd]{border-radius:50%}.qopt-glyph.chk[data-v-645038cd]{border-radius:var(--radius-xs)}.qopt.selected .qopt-glyph[data-v-645038cd]{border-color:var(--color-accent)}.qopt.selected .qopt-glyph.rad[data-v-645038cd]:after{content:"";position:absolute;inset:3px;border-radius:50%;background:var(--color-accent)}.qopt.selected .qopt-glyph.chk[data-v-645038cd]{background:var(--color-accent)}.qopt.selected .qopt-glyph.chk[data-v-645038cd]:after{content:"";position:absolute;left:4.5px;top:1.5px;width:4px;height:8px;border-right:1.5px solid var(--color-text-on-accent);border-bottom:1.5px solid var(--color-text-on-accent);transform:rotate(45deg)}.qopt-text[data-v-645038cd]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.qopt-label[data-v-645038cd]{color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium)}.qopt-desc[data-v-645038cd]{color:var(--color-text-muted);font:var(--text-xs)/var(--leading-normal) var(--font-ui)}.qopt-text-other[data-v-645038cd]{flex:0 1 auto}.other-input[data-v-645038cd]{flex:1;font:var(--text-base) var(--font-ui);border:none;border-bottom:.5px solid var(--color-line);outline:none;padding:2px var(--space-1);color:var(--color-text);background:transparent;min-width:12ch}.other-input[data-v-645038cd]:focus-visible{border-bottom-color:var(--color-accent);box-shadow:0 1px 0 0 var(--color-accent)}.qfoot[data-v-645038cd]{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-3);padding:var(--space-3) var(--space-4);border-top:.5px solid var(--color-line)}.qbtns[data-v-645038cd]{display:flex;align-items:center;gap:var(--space-1)}.qhint[data-v-645038cd]{margin-left:auto;color:var(--color-text-faint);font:var(--text-xs) var(--font-ui);user-select:none}@media(max-width:640px){.qopt[data-v-645038cd]{min-height:44px;padding:var(--space-3)}.other-input[data-v-645038cd]{flex-basis:100%;min-height:28px}.qfoot[data-v-645038cd]{flex-direction:column;align-items:stretch}.qhint[data-v-645038cd]{display:none}.qbtns[data-v-645038cd]{flex-direction:column;gap:var(--space-2)}.qbtns[data-v-645038cd] .ui-button{width:100%;min-height:46px}}.sc[data-v-9932e21c]{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--bg);position:relative}.sc-body[data-v-9932e21c]{flex:1;min-height:0;overflow-y:auto}.sc-empty[data-v-9932e21c]{padding:24px 16px;text-align:center;color:var(--muted);font-size:var(--ui-font-size)}.sc-composer[data-v-9932e21c]{position:absolute;left:0;right:0;bottom:0;z-index:var(--z-sticky);display:flex;align-items:flex-end;gap:6px;padding:8px 10px;border-top:.5px solid var(--color-line);background:var(--color-surface-raised)}.sc-input[data-v-9932e21c]{flex:1;min-width:0;resize:none;border:.5px solid var(--color-line);border-radius:var(--r-sm);padding:7px 9px;background:var(--bg);color:var(--color-text);font:var(--ui-font-size)/1.5 var(--sans);outline:none;max-height:160px}.sc-input[data-v-9932e21c]:focus{border-color:var(--color-accent-bd)}.sc-send[data-v-9932e21c]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:var(--r-sm);background:var(--color-accent);color:var(--color-text-on-accent);cursor:pointer}.sc-send[data-v-9932e21c]:disabled{opacity:.4;cursor:default}.sc-send[data-v-9932e21c]:not(:disabled):hover{background:var(--color-accent-hover)}.sc-loading[data-v-9932e21c]{flex:none;padding:8px 12px 12px}.sc-body[data-v-9932e21c] .sending-placeholder,.sc-body[data-v-9932e21c] .sending-line{display:none}.rows[data-v-1e95fd47]{margin:0;padding:0}.row[data-v-1e95fd47]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) 0;font-size:var(--text-base)}.row dt[data-v-1e95fd47]{width:96px;flex:none;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.04em;font-size:var(--text-xs)}.row dd[data-v-1e95fd47]{margin:0;color:var(--color-text);font-weight:var(--weight-medium);display:flex;align-items:center;gap:var(--space-2);min-width:0}.row dd.plan-on[data-v-1e95fd47],.row dd.swarm-on[data-v-1e95fd47]{color:var(--color-accent)}.row dd.thinking-value[data-v-1e95fd47]{flex-direction:column;align-items:flex-start;gap:var(--space-1)}.cache-note[data-v-1e95fd47]{color:var(--color-text-faint);font-weight:var(--weight-regular);font-size:var(--text-xs)}.ctx-text[data-v-1e95fd47]{flex:none}.bar[data-v-1e95fd47]{width:80px;height:5px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden;flex:none}.bar i[data-v-1e95fd47]{display:block;height:100%;background:var(--color-accent)}@media(max-width:640px){.rows[data-v-1e95fd47]{overflow-y:auto;-webkit-overflow-scrolling:touch}.row[data-v-1e95fd47]{align-items:flex-start;flex-direction:column;gap:var(--space-1);min-height:48px}.row dt[data-v-1e95fd47]{width:auto}.row dd[data-v-1e95fd47]{max-width:100%;flex-wrap:wrap}}.tp[data-v-5ecb9355]{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--color-bg)}.tp-body[data-v-5ecb9355]{flex:1;min-height:0;overflow-y:auto;margin:0;padding:12px 14px;padding-bottom:max(12px,var(--pfc-host-h, 0px));font:var(--text-base)/var(--leading-relaxed) var(--font-ui);font-weight:400;color:var(--color-text-muted);white-space:pre-wrap;word-break:break-word}.td[data-v-6c964102]{display:flex;flex-direction:column;height:100%;min-height:0}.td-path[data-v-6c964102]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--ui-c1) var(--font-mono);color:var(--color-text-muted)}.td-body[data-v-6c964102]{flex:1;min-height:0;overflow:auto;padding-bottom:var(--pfc-host-h, 0px)}.td-empty[data-v-6c964102]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-3);height:100%;padding:var(--space-6);color:var(--color-text-muted);font-size:var(--text-sm);text-align:center}.filter-control[data-v-9d5b56c7]{display:inline-flex;min-width:0}.fc-chevron[data-v-9d5b56c7]{color:var(--color-text-faint);transition:transform var(--duration-base) var(--ease-out)}.fc-trigger[aria-expanded=true] .fc-chevron[data-v-9d5b56c7]{transform:rotate(180deg)}.fc-menu[data-v-9d5b56c7]{position:fixed;z-index:var(--z-dropdown)}.fc-menu[data-v-9d5b56c7] .ui-menu{min-width:0}.fc-label[data-v-9d5b56c7]{flex:1;white-space:nowrap}.filter-control[data-v-9d5b56c7] .ui-seg__item[data-icon=circle-check] .ui-seg__icon,.fc-menu .kw-icon[data-icon=circle-check][data-v-9d5b56c7]{transform:scale(.91)}.fc-check[data-v-9d5b56c7]{color:var(--color-accent)}.goal-panel[data-v-6dea2f18]{display:flex;flex-direction:column;gap:var(--space-2);overflow-wrap:anywhere}.goal-criterion[data-v-6dea2f18]{padding-top:var(--space-2);border-top:.5px solid var(--color-line)}.goal-criterion-label[data-v-6dea2f18]{display:flex;align-items:center;gap:var(--space-1);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-section-label);line-height:var(--leading-normal);margin-bottom:var(--space-1)}.plan-panel[data-v-69db97fc]{display:flex;flex-direction:column;gap:var(--space-2)}.plan-review-row[data-v-69db97fc]{display:flex;gap:var(--space-2);font-size:var(--text-sm)}.plan-review-label[data-v-69db97fc]{flex:none;color:var(--color-text-muted)}.plan-review-feedback[data-v-69db97fc]{color:var(--color-text-muted)}.plan-path-only[data-v-69db97fc]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-1)}.plan-path-hint[data-v-69db97fc]{color:var(--color-text-muted);font-size:var(--text-sm)}.plan-path[data-v-69db97fc]{max-width:100%;font-family:var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.plan-empty[data-v-69db97fc]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);padding:var(--space-6) var(--space-4);color:var(--color-text-faint);font-size:var(--text-sm)}.plan-empty-ico[data-v-69db97fc]{width:var(--p-empty-ico);height:var(--p-empty-ico);color:var(--color-line-strong)}.sg-empty[data-v-13735c1e]{height:100%;display:flex;align-items:center;justify-content:center;color:var(--color-text-faint);font-size:var(--text-sm);user-select:none}.sg-grid[data-v-13735c1e]{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--p-subagent-card-min),1fr));gap:var(--space-2)}.sg-card[data-v-13735c1e]{position:relative;display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-3);border-radius:var(--radius-lg);background:var(--color-selected)}.sg-card.openable[data-v-13735c1e]{cursor:pointer}.sg-card.openable[data-v-13735c1e]:hover{background:var(--color-selected-hover)}.sg-card[data-v-13735c1e]:not(.openable){cursor:not-allowed}.sg-open[data-v-13735c1e]{position:absolute;inset:0;padding:0;border:none;border-radius:var(--radius-lg);background:transparent;cursor:pointer}.sg-open[data-v-13735c1e]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.sg-top[data-v-13735c1e]{display:flex;align-items:center;gap:var(--space-2)}.sg-name[data-v-13735c1e]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text);font-weight:var(--weight-medium)}.sg-num[data-v-13735c1e]{flex:none;color:var(--color-text-muted);font-size:var(--text-sm);font-variant-numeric:tabular-nums}.sg-card:has(.sg-cancel) .sg-top[data-v-13735c1e]{padding-right:calc(var(--icon-button-sm) + var(--space-1))}@media(hover:none){.sg-card:has(.sg-cancel) .sg-top[data-v-13735c1e]{padding-right:calc(var(--touch-target-min) + var(--space-1))}}.sg-desc[data-v-13735c1e]{color:var(--color-text-muted);font-size:var(--text-sm);line-height:var(--leading-caption);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.sg-foot[data-v-13735c1e]{display:flex;flex-direction:column;gap:var(--space-1)}.sg-model[data-v-13735c1e]{display:flex;align-items:center;gap:var(--space-1);color:var(--color-text-muted);font-size:var(--text-xs)}.sg-model span[data-v-13735c1e]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sg-status[data-v-13735c1e]{display:flex;align-items:center}.sg-state[data-v-13735c1e]{display:inline-flex;align-items:center;gap:var(--space-1);color:var(--color-text-muted);font-size:var(--text-xs);text-autospace:normal}.sg-ic-done[data-v-13735c1e]{color:var(--color-success);transform:scale(.91)}.s-fail .sg-state[data-v-13735c1e]{color:var(--color-danger)}.sg-time[data-v-13735c1e]{margin-left:auto;display:inline-flex;align-items:center;gap:var(--space-1);color:var(--color-text-muted);font-size:var(--text-xs);font-variant-numeric:tabular-nums;text-autospace:normal}.sg-cancel[data-v-13735c1e]{position:absolute;top:var(--space-2);right:var(--space-2);color:var(--color-text-muted);opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.sg-card:hover .sg-cancel[data-v-13735c1e],.sg-cancel[data-v-13735c1e]:focus-visible{opacity:1}.sg-cancel[data-v-13735c1e]:hover{color:var(--color-danger)}@media(hover:none){.sg-cancel[data-v-13735c1e]{top:0;right:0;width:var(--touch-target-min);height:var(--touch-target-min);opacity:1}}.taskspane[data-v-25d6e0cb]{flex:1;min-height:0;display:flex;flex-direction:column}.tp-list[data-v-25d6e0cb]{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:var(--space-05)}.tp-row[data-v-25d6e0cb]{padding:var(--space-1) 0}.tp-row.fail .tp-name[data-v-25d6e0cb]{color:var(--color-danger)}.tp-main[data-v-25d6e0cb]{display:flex;align-items:center;gap:var(--space-2);font-size:var(--text-base)}.tp-row.expandable>.tp-main[data-v-25d6e0cb]{position:relative;border-radius:var(--radius-lg);padding:var(--space-1) var(--space-2);margin:calc(-1 * var(--space-1)) 0}.tp-row.expandable>.tp-main[data-v-25d6e0cb]:hover{background:var(--color-hover)}.tp-row[data-v-25d6e0cb]:not(.expandable){cursor:not-allowed}.tp-open[data-v-25d6e0cb]{position:absolute;inset:0;padding:0;border:none;border-radius:var(--radius-lg);background:transparent;cursor:pointer}.tp-open[data-v-25d6e0cb]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.tp-chevron[data-v-25d6e0cb]{flex:none;color:var(--muted)}.tp-name[data-v-25d6e0cb]{color:var(--color-text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-meta[data-v-25d6e0cb]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-muted)}.tp-glyph[data-v-25d6e0cb]{flex:none;width:var(--p-ic-md);height:var(--p-ic-md);display:inline-flex;align-items:center;justify-content:center}.tp-done[data-v-25d6e0cb]{color:var(--color-success);transform:scale(.91)}.tp-cancelled[data-v-25d6e0cb]{color:var(--color-text-muted)}.tp-fail[data-v-25d6e0cb]{color:var(--color-danger)}.tp-time[data-v-25d6e0cb]{flex:none;font-size:var(--text-base);color:var(--muted);font-variant-numeric:tabular-nums;text-autospace:normal}.tp-model[data-v-25d6e0cb]{flex:0 1 auto;min-width:0;font-size:var(--text-base);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-stop[data-v-25d6e0cb]{position:relative;flex:none;color:var(--color-danger)}.tp-stop[data-v-25d6e0cb]:hover{color:var(--color-danger)}@media(hover:none){.tp-stop[data-v-25d6e0cb]{width:var(--touch-target-min);height:var(--touch-target-min)}.tp-row.expandable>.tp-main[data-v-25d6e0cb]{min-height:var(--touch-target-min)}}.tp-empty[data-v-25d6e0cb]{flex:1;display:flex;align-items:center;justify-content:center;color:var(--faint);font-size:var(--ui-font-size-sm);user-select:none}@media(max-width:640px){.tp-main[data-v-25d6e0cb]{flex-wrap:wrap;row-gap:var(--space-1)}.tp-name[data-v-25d6e0cb]{font-size:var(--ui-font-size-sm)}.tp-meta[data-v-25d6e0cb]{order:10;flex:1 1 100%;padding-left:calc(var(--p-ic-md) + var(--space-2));font-size:var(--ui-font-size-xs)}}.todo-card[data-v-1b02ea7b]{display:flex;flex-direction:column;gap:var(--space-3);font-size:var(--text-base)}.tc-row[data-v-1b02ea7b]{display:flex;align-items:center;gap:var(--space-2);color:var(--color-text)}.tc-name[data-v-1b02ea7b]{flex:1;min-width:0;overflow-wrap:anywhere;line-height:var(--leading-caption)}.tc-row.s-in_progress .tc-name[data-v-1b02ea7b]{font-weight:var(--weight-medium)}.tc-row.s-pending .tc-name[data-v-1b02ea7b]{color:var(--color-text-muted)}.tc-glyph[data-v-1b02ea7b]{flex:none;width:var(--p-ic-md);height:var(--p-ic-md);display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-full)}.tc-glyph.g-done[data-v-1b02ea7b]{color:var(--color-success)}.tc-glyph.g-pending[data-v-1b02ea7b]{border:var(--p-ring-stroke) solid var(--color-line-strong)}.tc-glyph .tc-spin[data-v-1b02ea7b]{color:var(--color-text)}.tc-empty[data-v-1b02ea7b]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);padding:var(--space-6) var(--space-4);color:var(--color-text-faint);font-size:var(--text-sm)}.tc-empty-ico[data-v-1b02ea7b]{width:var(--p-empty-ico);height:var(--p-empty-ico);color:var(--color-line-strong)}@media(max-width:640px){.todo-card[data-v-1b02ea7b]{font-size:var(--text-lg)}.tc-row[data-v-1b02ea7b]{padding:var(--space-2) var(--space-3)}}.wp-head-tab[data-v-c935b92a]{display:inline-flex;align-items:center;gap:var(--space-2);padding:0;border:.5px solid transparent;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium);line-height:var(--leading-solid);white-space:nowrap;flex:none}.wp-head-tab[data-v-c935b92a] svg{width:1.5em;height:1.5em}.wp-head-meta[data-v-c935b92a]{color:var(--color-text-muted);text-autospace:normal}.wp-head-actions[data-v-c935b92a]{margin-left:auto;display:flex;align-items:center;gap:var(--space-1);flex:none}@media(max-width:480px){.wp-head-actions[data-v-c935b92a]{flex-basis:100%;margin-left:0}}@media(hover:none){.wp-head-actions[data-v-c935b92a] .ui-seg__item{min-height:var(--touch-target-min)}}@media(max-width:640px),(hover:none){.wp-head-actions[data-v-c935b92a] .ui-seg__item{height:var(--touch-target-min)}.wp-head-actions[data-v-c935b92a] .ui-icon-button{width:var(--touch-target-min);height:var(--touch-target-min)}.wp-head-actions[data-v-c935b92a] .fc-trigger{min-height:var(--touch-target-min)}}.aw[data-v-e24668bd]{padding-top:4px}.crumbbar[data-v-e24668bd]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) 22px;border-bottom:.5px solid var(--color-line)}.crumbs[data-v-e24668bd]{display:flex;align-items:center;flex-wrap:wrap;gap:1px;min-width:0;font-size:var(--text-sm)}.crumb-sep[data-v-e24668bd]{color:var(--color-text-muted)}.crumb[data-v-e24668bd]{background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-muted);padding:1px var(--space-1);border-radius:var(--radius-xs)}.crumb[data-v-e24668bd]:hover{color:var(--color-text);background:var(--color-hover)}.crumb.last[data-v-e24668bd]{color:var(--color-text);font-weight:var(--weight-medium)}.filterbar[data-v-e24668bd]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) 22px;border-bottom:.5px solid var(--color-line)}.filter-icon[data-v-e24668bd]{flex:none;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--color-text-muted)}.filter-input[data-v-e24668bd]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-base);padding:var(--space-1) 0;border:none;background:none;color:var(--color-text);outline:none}.filter-input[data-v-e24668bd]::placeholder{color:var(--color-text-muted)}.search-rel[data-v-e24668bd]{color:var(--color-text)}.folder-list[data-v-e24668bd]{height:300px;overflow-y:auto;padding:var(--space-1) var(--space-2)}.fl-loading[data-v-e24668bd],.fl-empty[data-v-e24668bd]{padding:var(--space-6) var(--space-4);text-align:center;color:var(--color-text-muted);font-size:var(--text-sm)}.folder-row[data-v-e24668bd]{display:flex;align-items:center;gap:var(--space-2);width:100%;background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--text-base);color:var(--color-text);text-align:left;padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);transition:background var(--duration-fast) var(--ease-out)}.folder-row[data-v-e24668bd]:hover{background:var(--color-hover)}.dir-icon[data-v-e24668bd]{flex:none;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--color-text-muted)}.folder-name[data-v-e24668bd]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text)}.paste-section[data-v-e24668bd]{padding:var(--space-3) 22px;border-top:.5px solid var(--color-line)}.paste-section.paste-only[data-v-e24668bd]{border-top:none}.paste-row[data-v-e24668bd]{display:flex;align-items:center;gap:var(--space-2)}.paste-input-wrap[data-v-e24668bd]{flex:1;min-width:0}.add-error[data-v-e24668bd]{margin:0 22px var(--space-2);padding:var(--space-2) var(--space-3);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-danger);background:var(--color-danger-soft);border:.5px solid var(--color-danger-bd);border-radius:var(--radius-sm)}.actions[data-v-e24668bd]{display:flex;justify-content:flex-end;gap:var(--space-2);padding:var(--space-3) 22px}.footer-hint[data-v-e24668bd]{padding:var(--space-2) var(--space-4);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint);border-top:.5px solid var(--color-line)}@media(max-width:640px){.folder-row[data-v-e24668bd]{min-height:44px}.crumbbar[data-v-e24668bd]{align-items:flex-start}.actions[data-v-e24668bd]{flex-wrap:wrap}}.sheet-root[data-v-91fc927c]{position:fixed;inset:0;z-index:var(--z-overlay);display:flex;flex-direction:column;justify-content:flex-end}.sheet-scrim[data-v-91fc927c]{position:absolute;inset:0;background:#0d111773}.sheet-panel[data-v-91fc927c]{position:relative;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-bottom:none;border-radius:var(--radius-xl) var(--radius-xl) 0 0;box-shadow:var(--shadow-xl);max-height:calc(var(--app-height, 100dvh) * .86);display:flex;flex-direction:column;min-height:0;font-family:var(--font-ui);color:var(--color-text)}.sheet-grab[data-v-91fc927c]{flex:none;align-self:center;width:56px;height:18px;padding:0;border:none;background:none;cursor:pointer;position:relative;margin-top:4px}.sheet-grab[data-v-91fc927c]:after{content:"";position:absolute;left:50%;top:7px;transform:translate(-50%);width:38px;height:5px;border-radius:var(--radius-full);background:var(--color-line)}.sheet-head[data-v-91fc927c]{flex:none;display:flex;align-items:center;justify-content:space-between;padding:6px 16px 10px}.sheet-title[data-v-91fc927c]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.sheet-body[data-v-91fc927c]{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:max(16px,var(--safe-bottom))}.sheet-enter-active[data-v-91fc927c],.sheet-leave-active[data-v-91fc927c]{transition:opacity var(--duration-slow) var(--ease-out)}.sheet-enter-active .sheet-panel[data-v-91fc927c],.sheet-leave-active .sheet-panel[data-v-91fc927c]{transition:transform var(--duration-slow) var(--ease-out)}.sheet-enter-from[data-v-91fc927c],.sheet-leave-to[data-v-91fc927c]{opacity:0}.sheet-enter-from .sheet-panel[data-v-91fc927c],.sheet-leave-to .sheet-panel[data-v-91fc927c]{transform:translateY(102%)}.confirm-dialog__message[data-v-32237722]{margin:0;font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted)}.sd-search[data-v-35cdd013]{position:relative;margin:0 22px;padding-bottom:var(--space-1)}.sd-search[data-v-35cdd013] .ui-input{padding-right:30px}.search-clear[data-v-35cdd013]{position:absolute;top:0;bottom:var(--space-1);right:var(--space-2);margin-block:auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;border-radius:var(--radius-full);background:var(--color-hover);color:var(--color-text-faint);cursor:pointer;visibility:hidden;opacity:0;transition:opacity var(--duration-fast) var(--ease-out),visibility var(--duration-fast),background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.search-clear.is-on[data-v-35cdd013]{visibility:visible;opacity:1}.search-clear[data-v-35cdd013]:hover{background:var(--color-selected);color:var(--color-text-muted)}.search-clear[data-v-35cdd013]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}@media(prefers-reduced-motion:reduce){.search-clear[data-v-35cdd013]{transition:none}}.sd-body[data-v-35cdd013]{height:100%;min-height:0;display:flex;flex-direction:column;gap:var(--space-2);padding-top:4px}.sd-list[data-v-35cdd013]{flex:1;min-height:0;overflow-y:auto;padding:var(--space-1) var(--space-2);--sd-gutter: var(--p-ic-md);--sd-gap: var(--space-2)}.sd-section[data-v-35cdd013]{display:flex;align-items:baseline;gap:var(--space-1);padding:var(--space-2) var(--space-3) var(--space-1);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-section-label);text-transform:uppercase;color:var(--color-text-faint);user-select:none}.sd-section-count[data-v-35cdd013]{font-weight:var(--weight-regular)}.sd-section[data-v-35cdd013]:first-child{padding-top:var(--space-1)}.sd-section[data-v-35cdd013]:not(:first-child){margin-top:var(--space-1);border-top:var(--p-hairline) solid var(--color-line)}.sd-row[data-v-35cdd013]{display:flex;flex-direction:column;gap:2px;width:100%;padding:var(--space-2) var(--space-3);border:none;border-radius:var(--radius-md);background:none;cursor:pointer;text-align:left;font-family:var(--font-ui);color:var(--color-text)}.sd-row[data-v-35cdd013]:hover{background:var(--color-hover)}.sd-row.on[data-v-35cdd013]{background:var(--color-selected)}.sd-row.active .sd-title[data-v-35cdd013]{color:var(--color-accent-hover)}.sd-row-ws[data-v-35cdd013]{flex-direction:row;align-items:center;gap:var(--sd-gap)}.sd-folder[data-v-35cdd013]{flex:none;width:var(--sd-gutter);color:var(--color-text-muted)}.sd-ws-name[data-v-35cdd013]{flex:none;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);color:var(--color-text)}.sd-ws-path[data-v-35cdd013]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;font-size:var(--text-xs);color:var(--color-text-faint)}.sd-line1[data-v-35cdd013],.sd-line2[data-v-35cdd013]{padding-left:calc(var(--sd-gutter) + var(--sd-gap))}.sd-line1[data-v-35cdd013]{display:flex;align-items:baseline;gap:var(--space-2);min-width:0}.sd-title[data-v-35cdd013]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);color:var(--color-text)}.sd-time[data-v-35cdd013]{flex:none;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint)}.sd-line2[data-v-35cdd013]{display:flex;align-items:center;gap:var(--space-1);min-width:0;font-size:var(--text-xs);color:var(--color-text-muted)}.sd-meta-ws[data-v-35cdd013]{flex:none;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-meta-sep[data-v-35cdd013]{color:var(--color-text-faint)}.sd-meta-snippet[data-v-35cdd013]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-title[data-v-35cdd013] mark,.sd-ws-name[data-v-35cdd013] mark{background:var(--color-accent-soft);color:inherit;font-weight:var(--weight-semibold);border-radius:var(--radius-xs);padding:0 1px}.sd-line2[data-v-35cdd013] mark,.sd-ws-path[data-v-35cdd013] mark{background:var(--color-accent-soft);color:var(--color-text);font-weight:var(--weight-medium);border-radius:var(--radius-xs);padding:0 1px}.sd-empty[data-v-35cdd013]{height:100%;display:flex;align-items:center;justify-content:center}.sd-foot[data-v-35cdd013]{flex:none;display:flex;align-items:center;gap:var(--space-1);padding:var(--space-2) var(--space-4);border-top:.5px solid var(--color-line);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint)}.sd-hint[data-v-35cdd013]{display:inline-flex;align-items:center;gap:var(--space-1)}.sd-dot[data-v-35cdd013]{margin:0 var(--space-1)}.topbar[data-v-78cbb21c]{display:flex;align-items:center;height:calc(50px + var(--safe-top));flex:none;padding:var(--safe-top) max(12px,var(--safe-right)) 0 max(12px,var(--safe-left));border-bottom:.5px solid var(--color-line);background:var(--color-topbar-bg-frost);-webkit-backdrop-filter:var(--p-topbar-backdrop);backdrop-filter:var(--p-topbar-backdrop);font-family:var(--font-ui);-webkit-user-select:none;user-select:none}.tb-main[data-v-78cbb21c]{flex:1;min-width:0;height:100%;display:flex;align-items:center;gap:8px;margin-right:4px;padding:0 6px 0 0;background:none;border:none;border-radius:var(--radius-md);font:inherit;color:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity var(--duration-fast) var(--ease-out)}.tb-main[data-v-78cbb21c]:active{opacity:.55}.st[data-v-78cbb21c]{flex:none;display:inline-flex;align-items:center}.tb-line[data-v-78cbb21c]{flex:1;min-width:0;display:flex;align-items:baseline;gap:4px;font-size:max(16px,var(--ui-font-size-xl));line-height:1.25;white-space:nowrap}.tb-line .dir[data-v-78cbb21c]{flex:none;max-width:42%;overflow:hidden;text-overflow:ellipsis;color:var(--color-text-faint)}.tb-line .dir.solo[data-v-78cbb21c]{max-width:none;min-width:0;color:var(--color-text);font-weight:var(--weight-semibold)}.tb-line .sl[data-v-78cbb21c]{flex:none;color:var(--color-text-faint)}.tb-line .tt[data-v-78cbb21c]{min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--color-text);font-weight:var(--weight-semibold)}.tb-line .cv[data-v-78cbb21c]{flex:none;align-self:center;color:var(--color-text-faint)}.unread-dot[data-v-78cbb21c]{width:7px;height:7px;border-radius:var(--radius-full);background:var(--color-accent)}.pf-form[data-v-5ad95550]{display:flex;flex-direction:column;gap:var(--space-4);padding:var(--space-4) var(--space-4) var(--space-5);border-top:.5px solid var(--color-line)}.pf-guard[data-v-5ad95550] .ui-banner__text{display:flex;align-items:center;gap:var(--space-2);width:100%}.pf-guard .msg[data-v-5ad95550]{flex:1}.pf-field[data-v-5ad95550]{display:flex;flex-direction:column;gap:6px}.pf-key-wrap[data-v-5ad95550]{position:relative}.pf-key-wrap[data-v-5ad95550] .ui-input{padding-right:calc(var(--icon-button-sm) + var(--space-2))}.pf-key-eye[data-v-5ad95550]{position:absolute;right:var(--space-1);top:50%;transform:translateY(-50%)}.pf-field-label[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted)}.req[data-v-5ad95550]{color:var(--color-danger)}.pf-models[data-v-5ad95550]{display:flex;flex-direction:column;gap:var(--space-2)}.pf-model-grid[data-v-5ad95550]{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,2fr) auto;gap:var(--space-2);align-items:center}.pf-model-head span[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint)}.pf-models-empty[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}.pf-foot[data-v-5ad95550]{display:flex;align-items:center;gap:var(--space-2);padding-top:var(--space-4);border-top:.5px solid var(--color-line)}.pf-foot .spacer[data-v-5ad95550]{flex:1}.pf-confirm-msg[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-danger)}.pf-managed-note[data-v-5ad95550]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}@media(max-width:640px){.pf-model-grid[data-v-5ad95550]{grid-template-columns:minmax(0,1fr) auto}}.af[data-v-96ec6ac0]{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-4) var(--space-4) var(--space-5);border-top:.5px solid var(--color-line)}.af-guard[data-v-96ec6ac0] .ui-banner__text{display:flex;align-items:center;gap:var(--space-2);width:100%}.af-guard .msg[data-v-96ec6ac0]{flex:1}.af-catalog[data-v-96ec6ac0]{display:flex;flex-direction:column;gap:var(--space-3)}.af-center[data-v-96ec6ac0]{display:flex;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-4) 0;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.af-error[data-v-96ec6ac0]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-2)}.af-list[data-v-96ec6ac0]{display:flex;flex-direction:column;max-height:320px;overflow-y:auto;border:.5px solid var(--color-line);border-radius:var(--radius-md)}.af-list[data-v-96ec6ac0]>*+*{border-top:.5px solid var(--color-line)}.af-entry[data-v-96ec6ac0]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:34px;padding:var(--space-1) var(--space-3);border:none;background:transparent;text-align:left;font-family:var(--font-ui);color:var(--color-text);cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}.af-entry[data-v-96ec6ac0]:hover:not(:disabled){background:var(--color-hover)}.af-entry[data-v-96ec6ac0]:disabled{cursor:not-allowed;opacity:.55}.af-entry-name[data-v-96ec6ac0]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);font-weight:var(--weight-medium)}.af-entry .grow[data-v-96ec6ac0]{flex:1;min-width:0}.af-entry-count[data-v-96ec6ac0],.af-entry-reason[data-v-96ec6ac0]{flex:none;font-size:var(--text-xs);color:var(--color-text-faint);white-space:nowrap}.af-empty[data-v-96ec6ac0]{padding:var(--space-4);text-align:center;color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm)}.af-import[data-v-96ec6ac0],.af-registry[data-v-96ec6ac0]{display:flex;flex-direction:column;gap:var(--space-4)}.af-hint[data-v-96ec6ac0]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}.af-back[data-v-96ec6ac0]{display:inline-flex;align-items:center;gap:var(--space-1);align-self:flex-start;padding:0;border:none;background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);cursor:pointer;transition:color var(--duration-fast) var(--ease-out)}.af-back[data-v-96ec6ac0]:hover{color:var(--color-text)}.af-field[data-v-96ec6ac0]{display:flex;flex-direction:column;gap:6px}.af-label[data-v-96ec6ac0]{font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted)}.req[data-v-96ec6ac0]{color:var(--color-danger)}.af-key-wrap[data-v-96ec6ac0]{position:relative}.af-key-wrap[data-v-96ec6ac0] .ui-input{padding-right:calc(var(--icon-button-sm) + var(--space-2))}.af-key-eye[data-v-96ec6ac0]{position:absolute;right:var(--space-1);top:50%;transform:translateY(-50%)}.af-note[data-v-96ec6ac0]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-faint)}.af-foot[data-v-96ec6ac0]{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-2);padding-top:var(--space-4);border-top:.5px solid var(--color-line)}.af-manual[data-v-96ec6ac0] .pf-form{padding:0;border-top:none}.mp[data-v-49f293b0]{display:flex;flex-direction:column;gap:var(--space-2);height:100%;min-height:0;padding-top:4px}.mp--sheet[data-v-49f293b0]{height:auto;padding-top:0}.mp--sheet .search-wrap[data-v-49f293b0],.mp--sheet .chip-strip[data-v-49f293b0]{margin:0 16px}.search-wrap[data-v-49f293b0]{position:relative;margin:0 22px;padding-bottom:var(--space-1)}.search-wrap[data-v-49f293b0] .ui-input{padding-right:30px}.search-clear[data-v-49f293b0]{position:absolute;top:0;bottom:var(--space-1);right:var(--space-2);margin-block:auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;border-radius:var(--radius-full);background:var(--color-hover);color:var(--color-text-faint);cursor:pointer;visibility:hidden;opacity:0;transition:opacity var(--duration-fast) var(--ease-out),visibility var(--duration-fast),background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.search-clear.is-on[data-v-49f293b0]{visibility:visible;opacity:1}.search-clear[data-v-49f293b0]:hover{background:var(--color-selected);color:var(--color-text-muted)}.search-clear[data-v-49f293b0]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.chip-strip[data-v-49f293b0]{display:flex;gap:var(--space-1);margin:0 22px;overflow-x:auto;scrollbar-width:none}.chip-strip[data-v-49f293b0]::-webkit-scrollbar{display:none}.chip[data-v-49f293b0]{flex:none;height:28px;padding:0 var(--space-3);border:none;border-radius:var(--radius-full);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base);white-space:nowrap;cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.chip[data-v-49f293b0]:hover{background:var(--color-hover);color:var(--color-text)}.chip.is-active[data-v-49f293b0]{background:var(--color-selected);color:var(--color-text);font-weight:var(--weight-medium)}.chip[data-v-49f293b0]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.model-list[data-v-49f293b0]{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;padding:var(--space-1) var(--space-2)}.model-row[data-v-49f293b0]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);cursor:pointer;color:var(--color-text);min-width:0;transition:background var(--duration-fast) var(--ease-out)}.model-row[data-v-49f293b0]:hover,.model-row.is-selected[data-v-49f293b0]{background:var(--color-hover)}.model-row.is-current[data-v-49f293b0]{background:var(--color-selected)}.model-main[data-v-49f293b0]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.model-name[data-v-49f293b0]{font-family:var(--font-ui);font-size:var(--text-base);line-height:20px;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-row.is-current .model-name[data-v-49f293b0]{font-weight:var(--weight-medium)}.model-meta[data-v-49f293b0]{font-family:var(--font-ui);font-size:var(--text-xs);line-height:18px;color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-side[data-v-49f293b0]{display:flex;align-items:center;gap:var(--space-1);flex:none}.model-check[data-v-49f293b0]{color:var(--color-text)}.model-star[data-v-49f293b0]{color:var(--color-text-faint);visibility:hidden;opacity:0;transition:opacity var(--duration-fast) var(--ease-out),visibility var(--duration-fast)}.model-row:hover .model-star[data-v-49f293b0],.model-row.is-selected .model-star[data-v-49f293b0],.model-star.is-starred[data-v-49f293b0],.model-star[data-v-49f293b0]:focus-visible{visibility:visible;opacity:1}.model-star.is-starred[data-v-49f293b0]{color:var(--star)}@media(hover:none){.model-star[data-v-49f293b0]{visibility:visible;opacity:1}}.state-row[data-v-49f293b0]{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;gap:var(--space-2);color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.state-row.unavail[data-v-49f293b0]{color:var(--color-warning)}.empty[data-v-49f293b0]{flex:1;display:flex;align-items:center;justify-content:center;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.footer-hint[data-v-49f293b0]{flex:none;display:flex;align-items:center;gap:var(--space-1);padding:var(--space-2) var(--space-4);border-top:.5px solid var(--color-line);font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-faint)}.hint-dot[data-v-49f293b0]{margin:0 var(--space-1)}@media(hover:none){.footer-hint[data-v-49f293b0]{display:none}}@media(prefers-reduced-motion:reduce){.chip[data-v-49f293b0],.model-row[data-v-49f293b0],.model-star[data-v-49f293b0],.search-clear[data-v-49f293b0]{transition:none}}.sec[data-v-3cd02b1c]{margin-bottom:var(--space-5)}.sec-title[data-v-3cd02b1c]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);margin:0 0 var(--space-3)}.pu-group[data-v-3cd02b1c]{overflow:hidden;border-radius:var(--radius-xl);background:var(--color-surface)}.pu-row[data-v-3cd02b1c]{display:flex;align-items:center;gap:var(--space-3);min-height:52px;padding:var(--space-3) var(--space-4)}.pu-main[data-v-3cd02b1c]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.pu-label[data-v-3cd02b1c]{font-size:var(--text-sm);color:var(--color-text)}.pu-hint[data-v-3cd02b1c]{font-size:var(--text-xs);color:var(--color-text-faint)}.pp[data-v-f7054f75]{display:flex;flex-direction:column}.pp-head[data-v-f7054f75]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-3)}.pp-title[data-v-f7054f75]{margin:0;font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.pp-loading[data-v-f7054f75]{display:flex;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-4) 0;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-base)}.pp-group[data-v-f7054f75]{overflow:hidden;border:.5px solid var(--color-line);border-radius:var(--radius-xl);background:var(--color-surface-raised)}.pp-group[data-v-f7054f75]>*+*{border-top:.5px solid var(--color-line)}.pp-row[data-v-f7054f75]{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:40px;padding:var(--space-2) var(--space-4);border:none;background:transparent;text-align:left;font-family:var(--font-ui);color:var(--color-text);cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}.pp-row[data-v-f7054f75]:hover{background:var(--color-hover)}.pp-item.open>.pp-row[data-v-f7054f75]{background:var(--color-surface-sunken)}.pp-row .grow[data-v-f7054f75]{flex:1;min-width:0;display:flex;align-items:center;gap:var(--space-2)}.pp-id[data-v-f7054f75]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-count[data-v-f7054f75]{flex:none;font-size:var(--text-xs);color:var(--color-text-faint);white-space:nowrap}.pp-chev[data-v-f7054f75]{display:inline-flex;flex:none;color:var(--color-text-faint);transition:transform var(--duration-base) var(--ease-out)}.pp-item.open .pp-chev[data-v-f7054f75]{transform:rotate(90deg)}.pp-add-row[data-v-f7054f75]{gap:var(--space-2);color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium)}.pp-acc[data-v-f7054f75]{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--duration-slow) var(--ease-out)}.pp-item.open>.pp-acc[data-v-f7054f75]{grid-template-rows:1fr}.pp-acc-in[data-v-f7054f75]{overflow:hidden;min-height:0}.pp-item.open .pp-acc-in[data-v-f7054f75]{overflow:visible}.pp-item.flash>.pp-row[data-v-f7054f75]{animation:pp-flash-f7054f75 1.2s var(--ease-out)}@keyframes pp-flash-f7054f75{0%{background:var(--color-accent-soft)}to{background:transparent}}.pp-empty[data-v-f7054f75]{padding:var(--space-5) var(--space-4);color:var(--color-text-faint);font-family:var(--font-ui);font-size:var(--text-sm);text-align:center}.sm-picker[data-v-ae75986f]{position:relative;width:100%;font-family:var(--font-ui)}.sm-picker__trigger[data-v-ae75986f]{display:flex;align-items:center;gap:var(--space-2);width:100%;height:38px;padding:0 var(--space-3);border:.5px solid var(--color-line-strong);border-radius:var(--radius-md);background:transparent;box-shadow:none;color:var(--color-text);font:inherit;font-size:var(--text-base);line-height:var(--leading-normal);text-align:left;cursor:pointer;transition:border-color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out),background var(--duration-base) var(--ease-out)}.sm-picker__trigger[data-v-ae75986f]:focus-visible,.sm-picker.is-open .sm-picker__trigger[data-v-ae75986f]{outline:none;border-color:var(--color-accent);box-shadow:var(--p-focus-ring)}.sm-picker__value[data-v-ae75986f]{min-width:0;flex:1;display:flex;align-items:center;overflow:hidden;white-space:nowrap}.sm-picker__value-text[data-v-ae75986f]{min-width:0;overflow:hidden;text-overflow:ellipsis}.sm-picker__value.is-placeholder[data-v-ae75986f]{color:var(--color-text-faint)}.sm-picker__chevron[data-v-ae75986f]{flex:none;color:var(--color-text-muted);transition:transform var(--duration-base) var(--ease-out)}.sm-picker.is-open .sm-picker__chevron[data-v-ae75986f]{transform:rotate(180deg)}.sm-picker__menu[data-v-ae75986f]{position:fixed;z-index:var(--z-modal-dropdown);width:252px;max-width:calc(100vw - 64px);border:.5px solid var(--color-line-strong);border-radius:var(--radius-md);background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);box-shadow:var(--shadow-lg)}.sm-picker__models[data-v-ae75986f]{max-height:280px;overflow-y:auto;padding:var(--space-1);border-radius:var(--radius-md)}.sm-picker__flyout[data-v-ae75986f]{position:absolute;width:180px;max-height:280px;overflow-y:auto;padding:var(--space-1);border:.5px solid var(--color-line-strong);border-radius:var(--radius-md);background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);box-shadow:var(--shadow-lg)}.sm-picker__flyout--right[data-v-ae75986f]{left:calc(100% + var(--space-1))}.sm-picker__flyout--left[data-v-ae75986f]{right:calc(100% + var(--space-1))}.sm-picker__group[data-v-ae75986f]{padding:var(--space-2) var(--space-2) var(--space-1);color:var(--color-text-faint);font-size:var(--text-xs);font-weight:var(--weight-medium)}.sm-picker__option[data-v-ae75986f]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:32px;padding:var(--space-1) var(--space-2);border:none;border-radius:var(--radius-select-option);background:transparent;color:var(--color-text);font:inherit;font-size:var(--text-sm);text-align:left;cursor:pointer}.sm-picker__option.is-active[data-v-ae75986f]{background:var(--color-hover);color:var(--color-text-strong)}.sm-picker__option.is-muted[data-v-ae75986f]{color:var(--color-text-muted)}.sm-picker__option-label[data-v-ae75986f]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm-picker__check[data-v-ae75986f]{flex:none;color:transparent}.sm-picker__option.is-selected .sm-picker__check[data-v-ae75986f]{color:var(--color-accent)}.sm-picker__flyout-caret[data-v-ae75986f]{flex:none;margin-left:auto;color:var(--color-text-faint)}.rc-dev[data-v-cfe04ecf]{--sb-inset: var(--space-2);--sb-pad-x: var(--space-4);--sb-gap: var(--space-2);--sb-hover: var(--color-hover);position:relative;padding:0 var(--sb-inset) var(--space-1)}.rc-dev--mobile[data-v-cfe04ecf]{padding:var(--space-1) var(--sb-inset) var(--space-2)}.rc-dev--mobile .rc-dev-trigger[data-v-cfe04ecf]{min-height:44px}.rc-dev-trigger[data-v-cfe04ecf]{display:flex;align-items:center;gap:var(--sb-gap);width:100%;min-width:0;padding:6px calc(var(--sb-pad-x) - var(--sb-inset));border:.5px solid var(--color-line);border-radius:var(--radius-md);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);cursor:pointer;text-align:left}.rc-dev-trigger[data-v-cfe04ecf]:hover,.rc-dev-trigger[aria-expanded=true][data-v-cfe04ecf]{background:var(--sb-hover)}.rc-dev-trigger[data-v-cfe04ecf]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.rc-dev-trigger svg[data-v-cfe04ecf]{flex:none}.rc-dev-name[data-v-cfe04ecf]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rc-dev-chevron[data-v-cfe04ecf]{margin-left:auto;color:var(--color-text-faint)}.rc-dev-menu[data-v-cfe04ecf]{position:fixed;top:0;left:0;z-index:var(--z-dropdown);max-height:calc(100vh - 16px);overflow-y:auto;overflow-x:hidden;user-select:none}.rc-dev-menu--mobile[data-v-cfe04ecf]{position:absolute;top:100%;left:var(--sb-inset);right:var(--sb-inset);bottom:auto;max-height:min(50vh,320px);transform-origin:top center}.rc-dev-menu--mobile .rc-dev-offline[data-v-cfe04ecf]{min-height:44px;padding:12px 14px}.menu-pop-enter-active[data-v-cfe04ecf]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-cfe04ecf]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-cfe04ecf],.menu-pop-leave-to[data-v-cfe04ecf]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, 2px))}.rc-dev-state[data-v-cfe04ecf]{display:flex;align-items:center;justify-content:center;padding:var(--space-3)}.rc-dev-failed[data-v-cfe04ecf]{color:var(--color-text-muted);font-size:var(--text-sm)}.rc-dev-caption[data-v-cfe04ecf]{padding:var(--space-2) var(--menu-item-padding-inline) 2px;color:var(--color-text-faint);font-size:var(--text-xs);font-weight:var(--weight-medium);line-height:var(--leading-tight)}.rc-dev-item-name[data-v-cfe04ecf]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rc-dev-item-status[data-v-cfe04ecf]{display:flex;align-items:center;gap:6px;flex:none;color:var(--color-text-muted)}.rc-dev-item-check[data-v-cfe04ecf]{display:flex;align-items:center;justify-content:center;width:var(--p-ic-md);height:var(--p-ic-md);flex:none}.rc-dev-offline[data-v-cfe04ecf]{padding:var(--menu-item-padding-block) var(--menu-item-padding-inline);border-radius:var(--radius-menu-item);color:var(--color-text-muted);font-size:var(--text-sm);font-weight:var(--weight-option-label);line-height:var(--leading-tight)}.rc-dev-offline.is-current[data-v-cfe04ecf]{background:var(--color-hover);color:var(--color-text)}.rc-dev-offline-row[data-v-cfe04ecf]{display:flex;align-items:center;gap:7px}.rc-dev-offline-row svg[data-v-cfe04ecf]{display:block;width:var(--p-ic-md);height:var(--p-ic-md);flex:none}.user-menu-trigger[data-v-b8060ccc]{display:flex;align-items:center;gap:var(--sb-gap);width:100%;min-width:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);cursor:pointer;text-align:left}.user-menu-trigger[data-v-b8060ccc]:hover,.user-menu-trigger[aria-expanded=true][data-v-b8060ccc]{background:var(--sb-hover)}.user-menu-trigger[data-v-b8060ccc]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}html.macos-desktop .user-menu-trigger[data-v-b8060ccc]{border-bottom-left-radius:var(--radius-window-chip)}.user-menu-trigger svg[data-v-b8060ccc]{flex:none}.user-menu-avatar[data-v-b8060ccc]{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex:none;border-radius:var(--radius-full);background:var(--color-surface-sunken);color:var(--color-text-muted);overflow:hidden}.user-menu-avatar img[data-v-b8060ccc]{width:100%;height:100%;object-fit:cover}.user-menu-name[data-v-b8060ccc]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-menu[data-v-b8060ccc]{position:fixed;top:0;left:0;z-index:var(--z-dropdown);max-height:calc(100vh - 16px);overflow-y:auto;overflow-x:hidden;user-select:none}.user-submenu[data-v-b8060ccc]{position:fixed;top:0;left:0;z-index:var(--z-dropdown);width:max-content;max-height:calc(100vh - 16px);overflow-y:auto;overflow-x:hidden;user-select:none}.menu-pop-enter-active[data-v-b8060ccc]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-b8060ccc]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-b8060ccc],.menu-pop-leave-to[data-v-b8060ccc]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, 2px))}.user-menu-usage[data-v-b8060ccc]{display:flex;flex-direction:column;gap:calc(var(--menu-item-padding-block) * 2);padding:var(--menu-item-padding-block) var(--menu-item-padding-inline)}.user-menu-usage-state[data-v-b8060ccc]{display:flex;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-1) 0;color:var(--color-text-muted);font-size:var(--text-sm)}.user-menu-usage-error[data-v-b8060ccc]{flex:1;min-width:0}.user-menu-usage-empty[data-v-b8060ccc]{color:var(--color-text-faint)}.user-menu-usage-row[data-v-b8060ccc]{display:grid;grid-template-columns:auto 1fr;column-gap:var(--space-3);row-gap:var(--space-05)}.user-menu-usage-label[data-v-b8060ccc]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-sm);line-height:var(--leading-tight);color:var(--color-text)}.user-menu-usage-hint[data-v-b8060ccc]{grid-column:1 / -1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-text-faint)}.user-menu-usage-value[data-v-b8060ccc]{justify-self:end;font-size:var(--text-sm);line-height:var(--leading-tight);font-weight:var(--weight-medium);color:var(--color-text);font-variant-numeric:tabular-nums;white-space:nowrap}.user-menu-usage-value.sev-warn[data-v-b8060ccc]{color:var(--color-warning)}.user-menu-usage-value.sev-danger[data-v-b8060ccc]{color:var(--color-danger)}.user-menu-item-label[data-v-b8060ccc]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-menu-login-label[data-v-b8060ccc]{color:var(--color-accent)}.user-menu-row-value[data-v-b8060ccc]{flex:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);color:var(--color-text-faint)}.side[data-v-a5d7cf12]{background:var(--color-sidebar-bg);display:flex;flex-direction:row;justify-content:flex-end;overflow:hidden;min-width:0;height:100%;transition:width .28s cubic-bezier(.4,0,.2,1),visibility .28s;--sb-inset: var(--space-2);--sb-pad-x: var(--space-4);--sb-gutter: 16px;--sb-gap: var(--space-2);--sb-action-inset: calc((max(var(--ui-font-size-sm) * var(--leading-tight), var(--p-ic-md)) + 2 * var(--space-2) - var(--icon-button-sm)) / 2);--sb-hover: var(--color-hover);--sb-selected: color-mix(in srgb, var(--color-selected) 75%, transparent)}.side.no-anim[data-v-a5d7cf12]{transition:none}.side.collapsed[data-v-a5d7cf12]{visibility:hidden}.col[data-v-a5d7cf12]{flex:none;min-width:0;display:flex;flex-direction:column;min-height:0;width:100%;box-sizing:border-box;border-right:.5px solid var(--line);container-type:inline-size;container-name:sidebar-col;position:relative}.ch[data-v-a5d7cf12]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:var(--space-3);min-height:calc(26px + 2 * var(--space-3));width:100%;box-sizing:border-box}.side.macos-desktop .ch[data-v-a5d7cf12]{padding-left:80px;-webkit-app-region:drag}.side.macos-desktop .ch-brand[data-v-a5d7cf12]{display:none}.ch-logo[data-v-a5d7cf12]{height:22px;width:32px;flex:none;display:block;cursor:pointer;user-select:none;touch-action:none;transition:transform .18s ease}.ch-logo[data-v-a5d7cf12]:hover{transform:scale(1.08)}.ch-brand[data-v-a5d7cf12]{display:flex;align-items:center;gap:8px;min-width:0;flex:1;user-select:none;touch-action:none}.ch-tail[data-v-a5d7cf12]{display:flex;align-items:center;gap:var(--space-2);flex:none;min-width:0;margin-left:auto}.ch-name[data-v-a5d7cf12]{font-size:var(--ui-font-size);font-weight:500;line-height:22px;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@container sidebar-col (max-width: 250px){.ch-name[data-v-a5d7cf12]{display:none}}.sidebar-actions[data-v-a5d7cf12]{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 var(--space-2);padding:0 var(--sb-inset) var(--space-1);position:relative;z-index:1;background:var(--color-sidebar-bg)}.sessions-head[data-v-a5d7cf12]{position:relative;z-index:1;padding:var(--space-3) var(--sb-inset) 0;border-bottom:.5px solid transparent;transition:border-color var(--duration-base) var(--ease-out),box-shadow var(--duration-base) var(--ease-out)}.sessions-head[data-v-a5d7cf12]:after,.side-footer[data-v-a5d7cf12]:before{content:"";position:absolute;left:0;right:0;height:var(--p-sidebar-seam-h);pointer-events:none;opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.sessions-head[data-v-a5d7cf12]:after{top:100%;background:linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.5%,transparent),transparent 35%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1%,transparent),transparent 65%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) .75%,transparent),transparent);transition-duration:var(--duration-slow)}.sessions-head--scrolled[data-v-a5d7cf12]{border-bottom-color:var(--line)}.sessions-head--scrolled[data-v-a5d7cf12]:after{opacity:1}.btn-new-chat[data-v-a5d7cf12]{grid-column:1 / -1;display:flex;align-items:center;gap:var(--sb-gap);width:100%;min-width:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);cursor:pointer;text-align:left}.sidebar-actions--has-workspace-action .btn-new-chat[data-v-a5d7cf12]{grid-column:1}.btn-new-chat[data-v-a5d7cf12]:hover{background:var(--sb-hover)}.btn-new-chat[data-v-a5d7cf12]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.btn-new-chat svg[data-v-a5d7cf12]{flex:none}.btn-new-chat span[data-v-a5d7cf12]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn-new-chat[data-v-a5d7cf12] .ui-kbd{margin-left:auto}.btn-new-chat[data-v-a5d7cf12] .ui-kbd,.search[data-v-a5d7cf12] .ui-kbd{opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.btn-new-chat[data-v-a5d7cf12]:hover .ui-kbd,.btn-new-chat[data-v-a5d7cf12]:focus-visible .ui-kbd,.search[data-v-a5d7cf12]:hover .ui-kbd,.search[data-v-a5d7cf12]:focus-visible .ui-kbd{opacity:1}.search[data-v-a5d7cf12]{grid-column:1 / -1;display:flex;align-items:center;gap:var(--sb-gap);width:100%;margin:0;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font:inherit;text-align:left;cursor:pointer}.search[data-v-a5d7cf12]:hover{background:var(--sb-hover)}.search[data-v-a5d7cf12]:focus-visible{background:var(--sb-hover);color:var(--color-text);outline:2px solid var(--color-accent-bd);outline-offset:-2px}.search-icon[data-v-a5d7cf12]{flex:none;transform:translateY(-.5px)}.search-input[data-v-a5d7cf12]{flex:1;min-width:0;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-tabs[data-v-a5d7cf12]{padding:var(--space-2) var(--sb-inset) 0}.status-seg[data-v-a5d7cf12]{width:100%;display:flex}.status-seg[data-v-a5d7cf12] .ui-seg__item{flex:1;min-width:0;justify-content:center;padding:0 var(--space-1);overflow:hidden}.ws-dir[data-v-a5d7cf12]{display:block;padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border-radius:var(--radius-sm);cursor:pointer;position:relative;user-select:none}.ws-dir[data-v-a5d7cf12]:hover{background:var(--sb-hover, var(--color-hover))}.ws-dir.on[data-v-a5d7cf12]{background:var(--sb-selected, var(--color-selected))}.ws-dir+.ws-dir[data-v-a5d7cf12]{margin-top:var(--space-05)}.ws-dir-row[data-v-a5d7cf12]{display:flex;align-items:center;gap:var(--sb-gap);min-width:0}.ws-dir-icon[data-v-a5d7cf12]{flex:none;color:var(--color-text-muted)}.ws-dir-name[data-v-a5d7cf12]{flex:1;min-width:0;font-size:var(--ui-font-size-sm);font-weight:var(--weight-caption);line-height:var(--leading-tight);color:var(--color-text);overflow:hidden;white-space:nowrap;text-overflow:clip;-webkit-mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent);mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent)}.ws-dir-act[data-v-a5d7cf12]{position:absolute;top:0;bottom:0;right:var(--sb-action-inset);display:inline-flex;align-items:center;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--ease-out),visibility 0s linear var(--duration-fast)}.ws-dir-rename[data-v-a5d7cf12]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-caption);color:var(--color-text);background:var(--color-bg);border:.5px solid var(--color-accent);border-radius:var(--radius-sm);padding:2px 5px;outline:none}.ws-dir:hover .ws-dir-act[data-v-a5d7cf12],.ws-dir:focus-within .ws-dir-act[data-v-a5d7cf12]{opacity:1;visibility:visible;transition:opacity var(--duration-fast) var(--ease-out)}.ws-dir-sub[data-v-a5d7cf12]{margin:var(--space-1) 0 0;color:var(--color-text-faint);font-size:var(--text-xs);line-height:var(--leading-tight);overflow:hidden;white-space:nowrap;text-overflow:clip;-webkit-mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent);mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent)}.ws-dir:hover .ws-dir-name[data-v-a5d7cf12],.ws-dir:focus-within .ws-dir-name[data-v-a5d7cf12],.ws-dir:hover .ws-dir-sub[data-v-a5d7cf12],.ws-dir:focus-within .ws-dir-sub[data-v-a5d7cf12]{margin-right:calc(var(--icon-button-sm) + var(--space-2))}.done-gh[data-v-a5d7cf12]{display:flex;align-items:center;gap:var(--sb-gap);padding:8px calc(var(--sb-pad-x) - var(--sb-inset));border-radius:var(--radius-sm);font-family:var(--font-ui);color:var(--color-text);user-select:none;position:relative;cursor:pointer}.done-gh[data-v-a5d7cf12]:hover{background:var(--sb-hover, var(--color-hover))}.done-gh-folder[data-v-a5d7cf12]{flex:none;color:var(--color-text-muted)}.done-gh-name[data-v-a5d7cf12]{flex:1;min-width:0;font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight);color:var(--color-text-muted);overflow:hidden;white-space:nowrap;text-overflow:clip;-webkit-mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent);mask-image:linear-gradient(to right,var(--color-text-strong) calc(100% - 16px),transparent)}.done-gh-count[data-v-a5d7cf12]{flex:none;color:var(--color-text-faint);font-size:var(--text-xs);font-variant-numeric:tabular-nums}.done-gh-act[data-v-a5d7cf12]{position:absolute;top:0;bottom:0;right:var(--sb-action-inset);display:inline-flex;align-items:center;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--ease-out),visibility 0s linear var(--duration-fast)}.done-gh:hover .done-gh-act[data-v-a5d7cf12],.done-gh:focus-within .done-gh-act[data-v-a5d7cf12]{opacity:1;visibility:visible;transition:opacity var(--duration-fast) var(--ease-out)}.done-gh:hover .done-gh-count[data-v-a5d7cf12],.done-gh:focus-within .done-gh-count[data-v-a5d7cf12]{opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--ease-out),visibility 0s linear var(--duration-fast)}.sessions[data-v-a5d7cf12]{flex:1;overflow-y:auto;padding:0 var(--sb-inset) var(--space-3);min-height:0;--overlay-scrollbar-thumb-min: var(--space-6);scrollbar-width:none}.sessions[data-v-a5d7cf12]::-webkit-scrollbar{display:none}.sessions-thumb[data-v-a5d7cf12]{position:absolute;right:0;width:var(--space-1);border-radius:var(--radius-full);background:color-mix(in srgb,var(--color-text) 12%,transparent);opacity:0;pointer-events:none;transition:opacity var(--duration-base) var(--ease-out),background var(--duration-base) var(--ease-out);z-index:var(--z-raised);touch-action:none}.sessions-thumb.visible[data-v-a5d7cf12]{opacity:1;pointer-events:auto}.sessions-thumb.visible[data-v-a5d7cf12]:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}.sessions-thumb[data-v-a5d7cf12]:before{content:"";position:absolute;top:0;bottom:0;left:calc(-1 * var(--space-2));right:0}.side-footer[data-v-a5d7cf12]{flex:none;position:relative;z-index:1;display:flex;align-items:center;gap:var(--space-1);padding:var(--space-2) var(--sb-inset);border-top:.5px solid var(--line);background:var(--color-sidebar-bg)}.side-footer-account[data-v-a5d7cf12]{flex:1 1 auto;min-width:0}.side-footer-settings[data-v-a5d7cf12]{flex:none}.side-footer[data-v-a5d7cf12]:before{bottom:100%;background:linear-gradient(to top,color-mix(in srgb,var(--color-text) 1.5%,transparent),transparent 35%),linear-gradient(to top,color-mix(in srgb,var(--color-text) 1%,transparent),transparent 65%),linear-gradient(to top,color-mix(in srgb,var(--color-text) .75%,transparent),transparent);transition-duration:var(--duration-slow)}.side-footer--shadowed[data-v-a5d7cf12]:before{opacity:1}.side-section-label[data-v-a5d7cf12]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 var(--sb-action-inset) var(--space-1) var(--space-2);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-section-label);text-transform:uppercase;color:var(--faint);user-select:none}.side-section-title[data-v-a5d7cf12]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sessions-head .pinned+.side-section-label[data-v-a5d7cf12]{margin-top:var(--space-1)}.side-section-toggle[data-v-a5d7cf12]{color:var(--faint)}.side-section-toggle[data-v-a5d7cf12]:hover{color:var(--dim)}.side-section-toggle svg[data-v-a5d7cf12]{width:13px;height:13px}.side-section-actions[data-v-a5d7cf12]{display:flex;align-items:center;gap:2px}.ws-drop-target.drop-before[data-v-a5d7cf12]{box-shadow:inset 0 2px 0 var(--color-accent)}.ws-drop-target.drop-after[data-v-a5d7cf12]{box-shadow:inset 0 -2px 0 var(--color-accent)}.ws-drop-target.ws-locate-flash[data-v-a5d7cf12] .gh{isolation:isolate}.ws-drop-target.ws-locate-flash[data-v-a5d7cf12] .gh:before{content:"";position:absolute;inset:0;z-index:-1;border-radius:var(--radius-sm);background:var(--color-accent-soft);pointer-events:none;animation:ws-locate-fade-a5d7cf12 var(--duration-flash) var(--ease-out) forwards}@keyframes ws-locate-fade-a5d7cf12{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.ws-drop-target.ws-locate-flash[data-v-a5d7cf12] .gh:before{animation:none}}.sessions.pinned-drag-active[data-v-a5d7cf12]{box-shadow:inset 0 0 0 1px var(--color-accent)}.sessions.flat-pinned-drop-hover[data-v-a5d7cf12]{box-shadow:inset 0 0 0 2px var(--color-accent)}.show-more-row[data-v-a5d7cf12]{display:flex;align-items:center;justify-content:center}.show-more[data-v-a5d7cf12]{display:flex;align-items:center;justify-content:center;gap:var(--space-1);margin:0;padding:6px var(--space-3);min-width:0;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);cursor:pointer}.show-more[data-v-a5d7cf12]:hover{background:var(--sb-hover, var(--color-hover))}.show-more[data-v-a5d7cf12]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.show-more-label[data-v-a5d7cf12]{flex:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.folder-drop-overlay[data-v-a5d7cf12]{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;padding:var(--space-3);box-sizing:border-box;background:color-mix(in srgb,var(--color-sidebar-bg) 72%,transparent);pointer-events:none;opacity:0;visibility:hidden;transition:opacity var(--duration-base) ease,visibility var(--duration-base)}.folder-drop-overlay.show[data-v-a5d7cf12]{opacity:1;visibility:visible}.folder-drop-card[data-v-a5d7cf12]{display:flex;align-items:center;gap:var(--space-3);max-width:100%;box-sizing:border-box;padding:var(--space-4);border-radius:var(--radius-lg);border:.5px dashed var(--color-accent);background:var(--color-bg);color:var(--color-accent);font-size:var(--ui-font-size-lg);font-weight:var(--weight-medium);box-shadow:var(--shadow-md)}.folder-drop-card svg[data-v-a5d7cf12]{flex:none}.folder-drop-card span[data-v-a5d7cf12]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty[data-v-a5d7cf12]{padding:var(--space-6) var(--space-3);text-align:center;color:var(--faint);font-size:calc(var(--ui-font-size) - 3px);line-height:1.6}.ws-menu[data-v-a5d7cf12],.gh-menu[data-v-a5d7cf12],.view-menu[data-v-a5d7cf12]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.view-menu-label[data-v-a5d7cf12]{padding:var(--space-1) var(--space-2) var(--space-05);font-size:var(--text-xs);color:var(--faint);user-select:none}.view-menu-check[data-v-a5d7cf12]{margin-left:auto;display:inline-flex}.menu-pop-enter-active[data-v-a5d7cf12]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-a5d7cf12]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-a5d7cf12],.menu-pop-leave-to[data-v-a5d7cf12]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}[data-v-a5d7cf12] .workspace-rename-item{font-size:var(--text-xs);font-weight:var(--weight-option-label)}.section-menu-check[data-v-a5d7cf12]{display:inline-flex;flex:none;width:14px}.chat-header[data-v-927e8637]{flex:none;display:flex;align-items:center;gap:14px;height:var(--panel-head-h, 48px);padding:0 16px;border-bottom:.5px solid var(--color-line);background:var(--color-bg);font-family:var(--font-ui);min-width:0;user-select:none;container-type:inline-size}.chat-header.macos-desktop[data-v-927e8637]{-webkit-app-region:drag}.chat-header.macos-desktop button[data-v-927e8637],.chat-header.macos-desktop input[data-v-927e8637]{-webkit-app-region:no-drag}.app:not(.mobile) .chat-header{transition:padding-left .28s cubic-bezier(.4,0,.2,1)}.app.sidebar-collapsed .chat-header{padding-left:78px}.app.sidebar-collapsed.macos-desktop .chat-header{padding-left:146px}.ch-id[data-v-927e8637]{display:flex;align-items:center;gap:6px;min-width:0;flex:none;max-width:46%}.ch-ws[data-v-927e8637]{color:var(--color-text-muted);font-size:var(--text-base);font-weight:var(--weight-medium);flex:none}.ch-sep[data-v-927e8637]{color:var(--color-text-faint);flex:none}.ch-ses[data-v-927e8637]{color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ch-rename[data-v-927e8637]{flex:1;min-width:0;font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);background:var(--color-bg);border:.5px solid var(--color-accent);border-radius:var(--radius-xs);padding:2px 5px;outline:none;user-select:text}.ch-git[data-v-927e8637]{display:flex;align-items:center;gap:4px;border:none;background:transparent;padding:0;color:var(--muted);font-family:var(--font-ui);font-size:calc(var(--ui-font-size) - 2px);flex:0 1 auto;max-width:none;min-width:0;cursor:pointer}.ch-git:hover .ch-branch[data-v-927e8637]{color:var(--color-text)}.ch-branch-icon[data-v-927e8637]{flex:none;color:var(--color-text-muted)}.ch-branch[data-v-927e8637]{color:var(--dim);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:4px}.ch-detached[data-v-927e8637]{color:var(--muted);font-style:italic}.ch-pill[data-v-927e8637]{display:inline-flex;align-items:center;gap:3px;padding:1px 5px;border-radius:999px;background:var(--panel);border:.5px solid var(--line);font-size:calc(var(--ui-font-size) - 3px)}.ch-sync-pill[data-v-927e8637]{border-color:var(--line)}.ch-diff-pill[data-v-927e8637]{border-color:color-mix(in srgb,var(--color-success) 20%,var(--line));font-variant-numeric:tabular-nums}.ch-ahead[data-v-927e8637]{color:var(--color-warning);flex:none}.ch-behind[data-v-927e8637]{color:var(--color-accent-hover);flex:none}.ch-add[data-v-927e8637]{color:var(--color-success);flex:none}.ch-del[data-v-927e8637]{color:var(--color-danger);flex:none}.ch-spacer[data-v-927e8637]{flex:1;min-width:0}@container (max-width: 720px){.ch-ws[data-v-927e8637],.ch-sep[data-v-927e8637]{display:none}.ch-id[data-v-927e8637]{flex:0 1 auto;max-width:none}}.chat-header .ch-act-more[data-v-927e8637]{width:24px;height:24px;border-radius:var(--radius-sm)}.chat-header .ch-act-more[data-v-927e8637] svg{width:14px;height:14px}.ch-act-more.open[data-v-927e8637]{background:var(--color-well);color:var(--color-text)}.chat-header .ch-panel[data-v-927e8637]{width:var(--icon-button-sm);height:var(--icon-button-sm);border-radius:var(--radius-sm)}.chat-header .ch-panel[data-v-927e8637] svg{width:var(--p-ic-md);height:var(--p-ic-md)}.ch-dev[data-v-927e8637]{display:inline-flex;align-items:center;height:22px;padding:0 9px;flex:none;border:.5px solid var(--color-warning-bd);border-radius:var(--radius-full);background:var(--color-warning-soft);color:var(--color-warning);font-size:var(--text-xs);font-weight:500}.ch-pr[data-v-927e8637]{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 9px;flex:none;border:.5px solid var(--color-line);border-radius:var(--radius-full);background:var(--color-well);color:var(--color-text-muted);font-size:var(--text-xs);font-weight:500;cursor:pointer}.ch-pr svg[data-v-927e8637]{flex:none}.ch-pr.pr-open[data-v-927e8637]{color:var(--color-success);border-color:var(--color-success-bd);background:var(--color-success-soft)}.ch-pr.pr-merged[data-v-927e8637]{color:var(--color-done);border-color:var(--color-done-bd);background:var(--color-done-soft)}.ch-pr.pr-closed[data-v-927e8637]{color:var(--color-danger);border-color:var(--color-danger-bd);background:var(--color-danger-soft)}.ch-pr.pr-draft[data-v-927e8637],.ch-pr.pr-unknown[data-v-927e8637]{color:var(--color-text-muted);border-color:var(--color-line-strong);background:var(--color-well)}.ch-pr[data-v-927e8637]:hover{border-color:var(--color-line-strong)}.ch-done-pill[data-v-927e8637]{cursor:default}.ch-done-pill[data-v-927e8637]:hover{border-color:var(--color-done-bd)}@container (max-width: 980px){.ch-sync-pill[data-v-927e8637],.ch-diff-pill[data-v-927e8637]{display:none}}@container (max-width: 860px){.ch-git[data-v-927e8637],.ch-pr[data-v-927e8637]{display:none}}.ch-menu[data-v-927e8637]{position:fixed;top:0;left:0;z-index:var(--z-dropdown)}.menu-pop-enter-active[data-v-927e8637]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.menu-pop-leave-active[data-v-927e8637]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.menu-pop-enter-from[data-v-927e8637],.menu-pop-leave-to[data-v-927e8637]{opacity:0;transform:scale(.97) translateY(var(--menu-pop-shift, -2px))}@media(max-width:980px){.ch-act-label[data-v-927e8637]{display:none}}@media(max-width:640px){.chat-header[data-v-927e8637]{display:none}}.slash-menu[data-menu-frame][data-v-62eaf4c2]{position:absolute;bottom:calc(100% + var(--space-2));left:0;right:0;padding:var(--space-1-5) var(--space-3);background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);z-index:var(--z-dropdown)}.slash-menu.is-sheet[data-menu-frame][data-v-62eaf4c2]{position:static;padding:0;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;border:none;border-radius:0;box-shadow:none;z-index:auto}.slash-menu.is-sheet .slash-scroll[data-v-62eaf4c2]{margin:0;padding:var(--space-1) var(--space-2)}.slash-menu.is-sheet .slash-item[data-v-62eaf4c2]{margin:0;padding-left:var(--space-2);padding-right:var(--space-2)}.slash-scroll[data-v-62eaf4c2]{max-height:var(--p-slash-menu-h);margin:0 calc(-1 * var(--menu-row-hug));padding:0 var(--menu-row-hug);overflow-y:auto;scrollbar-width:none}.slash-scroll[data-v-62eaf4c2]::-webkit-scrollbar{display:none}.scroll-thumb[data-v-62eaf4c2]{position:absolute;right:var(--menu-scrollbar-edge);width:var(--menu-scrollbar-width);border-radius:var(--radius-full);background:var(--color-menu-scrollbar);transition:background var(--duration-base) var(--ease-out);cursor:default;touch-action:none;z-index:var(--z-raised)}.slash-menu:hover .scroll-thumb[data-v-62eaf4c2]{background:var(--color-menu-scrollbar-hover)}.scroll-thumb[data-v-62eaf4c2]:before{content:"";position:absolute;top:0;bottom:0;left:calc(-1 * var(--space-2));right:0}.slash-item[data-v-62eaf4c2]{display:flex;align-items:baseline;gap:var(--space-2);margin:0 calc(-1 * var(--menu-row-hug));padding:var(--menu-row-padding-block) var(--menu-row-padding-inline);cursor:pointer;font-family:var(--font-ui);font-size:var(--ui-b2);border-radius:var(--radius-menu-row)}.slash-item[data-v-62eaf4c2]:hover{background:var(--color-hover)}.slash-item.active[data-v-62eaf4c2]{background:var(--color-selected)}.slash-item+.slash-item[data-v-62eaf4c2]{margin-top:var(--menu-rows-seam)}.slash-name[data-v-62eaf4c2]{flex:none;max-width:60%;color:var(--color-text);font-weight:500;min-width:0;line-height:var(--leading-normal);overflow-wrap:anywhere}.slash-match[data-v-62eaf4c2]{font-weight:var(--weight-semibold)}.slash-empty[data-v-62eaf4c2]{padding:var(--space-1-5) var(--space-1);color:var(--color-text-muted)}@media(hover:none){.slash-item[data-v-62eaf4c2]{min-height:var(--touch-target-min);padding-top:var(--menu-row-touch-padding-block);padding-bottom:var(--menu-row-touch-padding-block)}}.slash-desc[data-v-62eaf4c2]{flex:1;min-width:0;color:var(--color-text-muted);font-size:var(--ui-b2);font-weight:var(--weight-regular);line-height:var(--leading-normal);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slash-desc-match[data-v-62eaf4c2]{font-weight:var(--weight-semibold)}@media(max-width:520px){.slash-item[data-v-62eaf4c2]{flex-direction:column;align-items:stretch;gap:var(--space-05)}.slash-name[data-v-62eaf4c2]{max-width:none}}.mention-menu[data-menu-frame][data-v-7c3431cd]{position:absolute;bottom:calc(100% + var(--space-2));left:0;right:0;padding:var(--space-1-5) var(--space-3);background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);z-index:var(--z-dropdown)}.mention-menu.is-sheet[data-menu-frame][data-v-7c3431cd]{position:static;padding:0;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;border:none;border-radius:0;box-shadow:none;z-index:auto}.mention-menu.is-sheet .mention-scroll[data-v-7c3431cd]{margin:0;padding:var(--space-1) var(--space-2)}.mention-menu.is-sheet .mention-item[data-v-7c3431cd]{margin:0;padding-left:var(--space-2);padding-right:var(--space-2)}.mention-menu.is-sheet .mention-state[data-v-7c3431cd]{padding-left:var(--space-4)}.mention-scroll[data-v-7c3431cd]{max-height:var(--p-mention-menu-h);margin:0 calc(-1 * var(--menu-row-hug));padding:0 var(--menu-row-hug);overflow-y:auto;scrollbar-width:none}.mention-scroll[data-v-7c3431cd]::-webkit-scrollbar{display:none}.scroll-thumb[data-v-7c3431cd]{position:absolute;right:var(--menu-scrollbar-edge);width:var(--menu-scrollbar-width);border-radius:var(--radius-full);background:var(--color-menu-scrollbar);transition:background var(--duration-base) var(--ease-out);cursor:default;touch-action:none;z-index:var(--z-raised)}.mention-menu:hover .scroll-thumb[data-v-7c3431cd]{background:var(--color-menu-scrollbar-hover)}.scroll-thumb[data-v-7c3431cd]:before{content:"";position:absolute;top:0;bottom:0;left:calc(-1 * var(--space-2));right:0}.mention-state[data-v-7c3431cd]{padding:var(--space-2) var(--space-1);font-family:var(--font-ui);font-size:var(--ui-b2)}.mention-spin[data-v-7c3431cd]{position:absolute;top:var(--space-2);right:var(--space-3);color:var(--color-text-muted);z-index:var(--z-raised)}.dim[data-v-7c3431cd]{color:var(--color-text-muted)}.mention-item[data-v-7c3431cd]{display:flex;align-items:center;gap:var(--menu-row-gap-icon);margin:0 calc(-1 * var(--menu-row-hug));padding:var(--menu-row-padding-block) var(--space-2);cursor:pointer;font-family:var(--font-ui);font-size:var(--text-sm);border-radius:var(--radius-menu-row)}.mention-icon[data-v-7c3431cd]{display:inline-flex;align-items:center;justify-content:center;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--muted);flex-shrink:0}.mention-icon[data-v-7c3431cd] svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block}.mention-item:hover .mention-icon[data-v-7c3431cd],.mention-item.active .mention-icon[data-v-7c3431cd]{color:var(--color-text-strong)}.mention-item[data-v-7c3431cd]:hover{background:var(--color-hover)}.mention-item:hover .mention-name[data-v-7c3431cd],.mention-item.active .mention-name[data-v-7c3431cd]{color:var(--color-text-strong)}.mention-item.active[data-v-7c3431cd]{background:var(--color-selected)}.mention-item+.mention-item[data-v-7c3431cd]{margin-top:var(--menu-rows-seam)}.mention-item[data-v-7c3431cd]{transition:opacity var(--duration-slow) var(--ease-out)}.mention-item.stale[data-v-7c3431cd]{opacity:var(--opacity-stale)}@media(hover:none){.mention-item[data-v-7c3431cd]{min-height:var(--touch-target-min);padding-top:var(--menu-row-touch-padding-block);padding-bottom:var(--menu-row-touch-padding-block)}}.mention-name[data-v-7c3431cd]{color:var(--color-text);font-weight:500;flex-shrink:0}.mention-name .mention-hit[data-v-7c3431cd]{color:var(--color-text-strong);font-weight:var(--weight-semibold)}.mention-meta .mention-hit[data-v-7c3431cd]{color:var(--color-text)}.mention-meta[data-v-7c3431cd]{color:var(--color-text-muted);font-size:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.composer[data-v-f4448519]{padding:7px var(--dock-inline-right, 16px) 12px var(--dock-inline-left, 16px);background:transparent;transition:background .12s}.composer.drag-over[data-v-f4448519]{background:var(--color-accent-soft)}.drop-overlay[data-v-f4448519]{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--color-bg) 72%,transparent);pointer-events:none;opacity:0;visibility:hidden;transition:opacity var(--duration-base) ease,visibility var(--duration-base)}.drop-overlay.show[data-v-f4448519]{opacity:1;visibility:visible}.drop-card[data-v-f4448519]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4) var(--space-6);border-radius:var(--radius-lg);border:.5px dashed var(--color-accent);background:var(--color-bg);color:var(--color-accent);font-size:var(--ui-font-size-lg);font-weight:var(--weight-medium);box-shadow:var(--shadow-md)}.composer-card[data-v-f4448519]{--composer-control-size: var(--space-8);--composer-send-size: var(--composer-control-size);--composer-control-inset: var(--space-2);--composer-valve-floor: 4em;--composer-valve-expand-margin: 3.4em;position:relative;border:.5px solid var(--color-composer-line);border-radius:var(--radius-composer);corner-shape:var(--corner-shape-composer);background:var(--color-composer-bg);box-shadow:var(--shadow-input);user-select:none;container-type:inline-size}.composer-card[data-v-f4448519]:after{content:"";position:absolute;inset:0;border:inherit;border-color:var(--color-composer-focus-line);border-radius:var(--radius-composer);corner-shape:var(--corner-shape-composer);opacity:0;pointer-events:none;transition:opacity var(--duration-slow) var(--ease-in-out)}.composer-card[data-v-f4448519]:focus-within:after{opacity:1}.file-input-hidden[data-v-f4448519]{display:none}.cin-wrap[data-v-f4448519]{position:relative;padding:14px 16px 8px}.input-row[data-v-f4448519]{position:relative;display:flex;align-items:flex-start;gap:var(--space-2)}.expand-btn[data-v-f4448519]{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:none;border-radius:6px;background:transparent;color:var(--dim);cursor:pointer;padding:0;transition:background .12s,color .12s}.expand-btn[data-v-f4448519]:hover{background:var(--panel2);color:var(--color-text)}.expand-btn[data-v-f4448519]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.ph[data-v-f4448519]{color:var(--faint);caret-color:var(--color-text);flex:1;position:relative;border:none;outline:none;font-family:var(--font-ui);font-size:var(--content-font-size);text-autospace:normal;background:transparent;min-height:36px;max-height:calc(var(--app-height, 100dvh) / 4);overflow-y:auto;scrollbar-width:none;line-height:1.5;margin-bottom:6px;user-select:text}.ph[data-v-f4448519]::-webkit-scrollbar{display:none}.ph[data-v-f4448519]:not([data-empty=true]){color:var(--color-text)}.ph[data-v-f4448519] .ProseMirror{outline:none;white-space:pre-wrap;overflow-wrap:break-word;min-height:inherit}.ph[data-v-f4448519] .ProseMirror p{margin:0}.ph[data-v-f4448519] .ProseMirror-trailingBreak:not(:only-child){display:none}.ph[data-v-f4448519] .mention-pill.ProseMirror-selectednode{color:var(--color-text)}.ph[data-v-f4448519] .wm-pill{display:inline-flex;align-items:center;gap:var(--space-1);vertical-align:top;height:calc(var(--content-font-size) * 1.5);margin-left:calc(-1 * var(--space-05));margin-right:var(--space-1-5);padding:0 calc((var(--content-font-size) * 1.5 - var(--wm-x-size)) / 2) 0 var(--space-2);border:none;border-radius:var(--radius-full);background:var(--color-selected);color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:calc(var(--content-font-size) * 1.5);white-space:nowrap;user-select:none}.ph[data-v-f4448519] .wm-icon{display:inline-flex}.ph[data-v-f4448519] .wm-x{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--wm-x-size);height:var(--wm-x-size);padding:0;border:.5px solid transparent;border-radius:var(--radius-full);background:transparent;color:var(--color-text-muted);cursor:pointer;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.ph[data-v-f4448519] .wm-x:hover{background:var(--color-hover);color:var(--color-text)}.ph[data-v-f4448519] .wm-x:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ph[data-v-f4448519] .wm-x:before{content:"";position:absolute;inset:calc(-1 * var(--wm-x-ring))}.ph[data-wm=true][data-v-f4448519] .ProseMirror{padding-top:var(--space-1);padding-left:var(--space-05)}.ph[data-empty=true][data-wm=false][data-v-f4448519]:before{content:attr(data-placeholder);position:absolute;top:0;left:0;color:var(--muted);pointer-events:none;user-select:none}.composer.expanded .ph[data-v-f4448519]{min-height:calc(var(--app-height, 100dvh) * .7);max-height:calc(var(--app-height, 100dvh) * .7)}.compact-chip[data-v-f4448519]{height:var(--composer-control-size);padding:0 var(--space-2);border:.5px solid transparent;border-radius:var(--radius-full);background:transparent;color:var(--color-warning);font-family:var(--mono);font-size:var(--ui-font-size);cursor:pointer;line-height:1;flex:none;transition:background var(--duration-base) var(--ease-out)}.compact-chip[data-v-f4448519]:hover{background:var(--color-hover)}.compact-chip.gone[data-v-f4448519],.model-pill.model-gone[data-v-f4448519]{display:none}.composer-attach[data-v-f4448519]{width:var(--composer-control-size);height:var(--composer-control-size);border-radius:var(--radius-full);flex:none}.add-menu[data-v-f4448519]{position:absolute;bottom:calc(100% + var(--space-2));left:0;right:0;z-index:var(--z-dropdown);background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);padding:var(--space-1-5) var(--space-3);display:flex;flex-direction:column;gap:var(--menu-rows-seam);font-family:var(--font-ui);transform-origin:bottom left}.am-scroll[data-v-f4448519]{max-height:var(--p-add-menu-h);margin:0 calc(-1 * var(--menu-row-hug));padding:0 var(--menu-row-hug);overflow-y:auto;scrollbar-width:none;display:flex;flex-direction:column;gap:var(--menu-rows-seam)}.am-scroll[data-v-f4448519]::-webkit-scrollbar{display:none}.scroll-thumb[data-v-f4448519]{position:absolute;right:var(--menu-scrollbar-edge);width:var(--menu-scrollbar-width);border-radius:var(--radius-full);background:var(--color-menu-scrollbar);transition:background var(--duration-base) var(--ease-out);pointer-events:none;z-index:var(--z-raised)}.add-menu:hover .scroll-thumb[data-v-f4448519]{background:var(--color-menu-scrollbar-hover)}.msheet-search[data-v-f4448519]{padding:0 var(--space-4) var(--space-2)}.msheet-add[data-v-f4448519]{display:flex;flex-direction:column;gap:var(--menu-rows-seam);padding:0 var(--menu-row-hug);font-family:var(--font-ui)}.am-row[data-v-f4448519]{display:flex;align-items:center;gap:var(--menu-row-gap-icon);margin:0 calc(-1 * var(--menu-row-hug));padding:var(--menu-row-padding-block) var(--menu-row-padding-inline);border:none;border-radius:var(--radius-menu-row);background:none;cursor:pointer;font-size:var(--ui-font-size);color:var(--color-text);text-align:left;transition:background var(--duration-base) var(--ease-out)}.am-row[data-v-f4448519]:hover{background:var(--color-hover)}.am-row[data-v-f4448519]:focus-visible{background:var(--color-selected);outline:none}@media(hover:none){.am-row[data-v-f4448519]{padding-top:var(--menu-row-touch-padding-block);padding-bottom:var(--menu-row-touch-padding-block)}}.am-row:hover .am-icon[data-v-f4448519],.am-row:focus-visible .am-icon[data-v-f4448519]{color:var(--color-text)}.am-icon[data-v-f4448519]{flex:none;width:var(--p-ic-sm);display:flex;justify-content:center;color:var(--color-text-muted);transition:color var(--duration-base) var(--ease-out)}.am-name[data-v-f4448519]{flex:none;font-weight:var(--weight-medium)}.am-desc[data-v-f4448519]{margin-left:var(--space-1);color:var(--color-text-muted);font-size:var(--ui-font-size-sm)}.send[data-v-f4448519]{width:var(--composer-send-size);height:var(--composer-send-size);border-radius:var(--radius-full);background:var(--color-send-bg);color:var(--color-send-icon);border:none;box-shadow:var(--shadow-send);padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background var(--duration-slow) var(--ease-out),transform var(--duration-fast) var(--ease-out),box-shadow var(--duration-slow) var(--ease-out);position:relative}.send[data-v-f4448519]:hover:not(:disabled){background:var(--color-send-bg-hover);box-shadow:var(--shadow-send-hover)}.send[data-v-f4448519]:active{transform:scale(.92)}.send[data-v-f4448519]:disabled{cursor:not-allowed;background:var(--color-send-bg-disabled);color:var(--color-send-icon-disabled);opacity:var(--opacity-send-disabled)}.send[data-v-f4448519]:disabled:active{transform:none}.send.is-starting[data-v-f4448519]:disabled{background:var(--color-send-bg);color:var(--color-send-icon)}.send.is-starting[data-v-f4448519] .ui-spinner{color:var(--color-send-icon)}.send.is-starting[data-v-f4448519] .ui-spinner__track{stroke:color-mix(in srgb,var(--color-send-icon) 32%,transparent)}.send svg[data-v-f4448519]{flex:none;width:var(--composer-send-icon-size);height:var(--composer-send-icon-size)}.stop[data-v-f4448519]{width:var(--composer-send-size);height:var(--composer-send-size);border-radius:var(--radius-full);background:var(--color-subtle);color:var(--color-stop-glyph);border:none;box-shadow:var(--shadow-xs);padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background .16s ease,color .16s ease,transform .12s ease}.stop[data-v-f4448519]:hover{background:var(--color-danger);color:var(--color-text-on-accent)}.stop[data-v-f4448519]:active{transform:scale(.92)}.stop svg[data-v-f4448519]{flex:none;width:var(--composer-send-icon-size);height:var(--composer-send-icon-size)}.toolbar[data-v-f4448519]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);padding:var(--space-1) var(--composer-control-inset) var(--composer-control-inset);position:relative}.menu-measure[data-v-f4448519]{position:absolute;width:max-content;height:0;overflow:hidden;visibility:hidden;pointer-events:none}.toolbar-left[data-v-f4448519],.toolbar-right[data-v-f4448519]{display:flex;align-items:center;gap:var(--space-1);min-width:0}.toolbar-left[data-v-f4448519]{flex:none;overflow:hidden}.toolbar-right[data-v-f4448519]{flex:1 1 auto;justify-content:flex-end}.perm-pill[data-v-f4448519],.swarm-chip[data-v-f4448519],.model-pill[data-v-f4448519]{position:relative;display:inline-flex;align-items:center;gap:var(--space-1);height:var(--composer-control-size);padding:0 var(--space-3);border:.5px solid transparent;border-radius:var(--radius-full);background:transparent;color:var(--color-text);font-family:var(--font-ui);font-size:var(--ui-font-size);font-weight:var(--weight-medium);line-height:1;white-space:nowrap;cursor:pointer;user-select:none;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.perm-pill[data-v-f4448519]{font-size:var(--ui-font-size-sm)}.perm-pill[data-v-f4448519]:after,.swarm-chip[data-v-f4448519]:after,.model-pill[data-v-f4448519]:after{content:"";position:absolute;inset:0;border-radius:var(--radius-full);background:var(--color-hover);opacity:0;transition:opacity var(--duration-base) var(--ease-out);pointer-events:none}.perm-pill[data-v-f4448519]:hover:after,.swarm-chip[data-v-f4448519]:hover:after,.model-pill[data-v-f4448519]:hover:after{opacity:1}.perm-pill.open[data-v-f4448519],.model-pill.open[data-v-f4448519]{background:var(--color-accent-soft)}.swarm-chip[data-v-f4448519]{cursor:default}.swarm-x[data-v-f4448519]{margin-right:calc(var(--composer-control-size) / 2 - var(--space-3) - var(--icon-button-sm) / 2);color:inherit;opacity:0;transition:opacity var(--duration-base) var(--ease-out)}.swarm-chip .swarm-x[data-v-f4448519]{border-radius:var(--radius-full)}.swarm-chip:hover .swarm-x[data-v-f4448519],.swarm-x[data-v-f4448519]:focus-visible{opacity:1}@media(hover:none){.toolbar-left[data-v-f4448519]{padding-right:var(--space-2)}.swarm-chip[data-v-f4448519]{margin-right:calc((var(--touch-target-min) - var(--icon-button-sm)) / 2 - var(--space-1))}.swarm-x[data-v-f4448519]{opacity:1;position:relative}.swarm-x[data-v-f4448519]:before{content:"";position:absolute;inset:calc(-1 * (var(--touch-target-min) - var(--icon-button-sm)) / 2)}}.perm-pill.perm-manual[data-v-f4448519]{color:var(--dim)}.perm-pill.perm-yolo[data-v-f4448519]{color:var(--color-warning)}.perm-pill.perm-auto[data-v-f4448519]{color:var(--color-danger)}.perm-pill-icon[data-v-f4448519]{flex:none}.perm-pill[data-v-f4448519],.swarm-chip[data-v-f4448519]{flex:none;padding-left:var(--space-2)}.swarm-ic[data-v-f4448519],.swarm-x[data-v-f4448519]{flex:none}.labels-collapsed .perm-pill[data-v-f4448519]{width:var(--composer-control-size);height:var(--composer-control-size);padding:0;justify-content:center;flex:none}.labels-collapsed .perm-pill-label[data-v-f4448519]{display:none}.labels-collapsed .swarm-chip[data-v-f4448519]{position:relative;width:var(--composer-control-size);height:var(--composer-control-size);padding:0;justify-content:center;flex:none}.labels-collapsed .swarm-label[data-v-f4448519]{display:none}.labels-collapsed .swarm-ic[data-v-f4448519]{transition:opacity var(--duration-base) var(--ease-out)}.labels-collapsed .swarm-chip:hover .swarm-ic[data-v-f4448519]{opacity:0}.labels-collapsed .swarm-x[data-v-f4448519]{position:absolute;inset:0;width:auto;height:auto;margin-right:0}@media(hover:none){.labels-collapsed .swarm-chip[data-v-f4448519]{width:var(--touch-target-min);height:var(--touch-target-min)}.labels-collapsed .swarm-chip:hover .swarm-ic[data-v-f4448519]{opacity:1}.labels-collapsed .swarm-x[data-v-f4448519]{inset:0;width:auto;height:auto;opacity:1;background:transparent}.labels-collapsed .swarm-x[data-v-f4448519]:before{inset:0 0 auto auto;width:var(--p-ic-md);height:var(--p-ic-md);border-radius:var(--radius-full);background:var(--color-selected)}.labels-collapsed .swarm-x[data-v-f4448519] svg{position:absolute;top:calc(var(--space-1-5) / 2);right:calc(var(--space-1-5) / 2);width:calc(var(--p-ic-md) - var(--space-1-5));height:calc(var(--p-ic-md) - var(--space-1-5))}}.ctx-group[data-v-f4448519]{display:flex;align-items:center;gap:4px;flex-shrink:0;padding:2px 0;border-radius:var(--radius-xs)}.ctx-group[data-v-f4448519]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.model-pill[data-v-f4448519]{gap:var(--space-1);line-height:var(--leading-normal);overflow:hidden;flex:0 1 auto;min-width:0;max-width:320px;transition:background var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.model-pill[data-v-f4448519]:active{transform:scale(.97)}.model-pill[data-v-f4448519]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.model-pill .mp-name[data-v-f4448519]{flex:0 8 auto;font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.model-pill .think-suffix[data-v-f4448519]{color:var(--color-accent);font-weight:var(--weight-medium);flex:none}.model-pill .cv[data-v-f4448519]{color:var(--faint);flex:none;transition:transform var(--duration-base) var(--ease-out),color var(--duration-base) var(--ease-out)}.model-pill:hover .cv[data-v-f4448519],.model-pill.open .cv[data-v-f4448519]{color:var(--dim)}.model-pill.open .cv[data-v-f4448519]{transform:rotate(180deg)}.model-pill.icon-only[data-v-f4448519]{width:var(--composer-control-size);height:var(--composer-control-size);padding:0;justify-content:center;flex:none}.model-pill.login-pill[data-v-f4448519],.model-pill.login-pill .mp-name[data-v-f4448519]{color:var(--color-accent)}.model-dropdown[data-v-f4448519]{position:absolute;bottom:calc(100% + var(--space-1));right:calc(var(--composer-control-inset) + var(--composer-send-size) + var(--space-1));z-index:var(--z-dropdown);min-width:200px;background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);padding:var(--space-1);display:flex;flex-direction:column;gap:1px;font-family:var(--font-ui);transform-origin:bottom right;overflow-y:auto;overscroll-behavior:contain}.model-dropdown.flip-down[data-v-f4448519]{top:calc(100% + var(--space-1));bottom:auto;transform-origin:top right}.composer-menu-pop-enter-active[data-v-f4448519]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.composer-menu-pop-leave-active[data-v-f4448519]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);pointer-events:none}.composer-menu-pop-enter-from[data-v-f4448519],.composer-menu-pop-leave-to[data-v-f4448519]{opacity:0;transform:scale(.97) translateY(2px)}.model-dropdown.flip-down.composer-menu-pop-enter-from[data-v-f4448519],.model-dropdown.flip-down.composer-menu-pop-leave-to[data-v-f4448519]{transform:scale(.97) translateY(-2px)}.md-list[data-v-f4448519]{display:flex;flex-direction:column;gap:1px;max-height:min(320px,40vh);overflow-y:auto;overscroll-behavior:contain}.md-section[data-v-f4448519]{padding:4px 9px 2px;font-size:var(--text-xs);color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-weight:var(--weight-semibold)}.md-row[data-v-f4448519]{display:flex;align-items:center;gap:7px;width:100%;background:none;border:none;cursor:pointer;font-family:var(--font-ui);font-size:var(--ui-font-size);color:var(--color-text);padding:5px 9px;border-radius:var(--radius-dropdown-row);text-align:left;transition:background var(--duration-base) var(--ease-out)}.md-row[data-v-f4448519]:hover{background:var(--color-hover)}.md-row:hover .md-name[data-v-f4448519]{color:var(--color-text-strong)}.md-row[data-v-f4448519]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.md-row[data-v-f4448519]:disabled{cursor:default;opacity:.58}.md-row[data-v-f4448519]:disabled:hover{background:none}.md-row.is-current[data-v-f4448519]{background:var(--color-selected)}.md-note[data-v-f4448519]{margin-left:auto;color:var(--muted);font-size:var(--ui-font-size-xs)}.md-row-more .md-more-icon[data-v-f4448519]{color:var(--dim)}.md-row-more .md-more-arrow[data-v-f4448519]{color:var(--faint);flex:none;transition:color var(--duration-base) var(--ease-out)}.md-row-more:hover .md-more-arrow[data-v-f4448519]{color:var(--dim)}.md-check[data-v-f4448519]{width:14px;flex:none;color:var(--color-accent);font-weight:500;display:flex;justify-content:center}.md-name[data-v-f4448519]{flex:1;transition:color var(--duration-base) var(--ease-out)}.md-provider[data-v-f4448519]{color:var(--muted);font-size:var(--ui-font-size-xs);flex:none}.md-star[data-v-f4448519]{color:var(--star);flex:none;margin-left:auto}.md-divider[data-v-f4448519]{height:1px;background:var(--line);margin:3px 0}.md-thinking[data-v-f4448519]{display:flex;align-items:center;gap:8px;padding:6px 9px;border-radius:var(--radius-dropdown-row)}.md-thinking .md-name[data-v-f4448519]{font-family:var(--font-ui);font-size:var(--ui-font-size);color:var(--color-text);flex:none}.md-thinking .md-note[data-v-f4448519],.md-thinking .ui-seg[data-v-f4448519]{margin-left:auto}.md-cache-note[data-v-f4448519]{width:0;min-width:100%;padding:2px 7px 4px;color:var(--muted);font-size:var(--ui-font-size-xs);line-height:1.4}.perm-dropdown[data-v-f4448519]{position:absolute;bottom:calc(100% + 4px);left:var(--composer-control-inset);z-index:var(--z-dropdown);min-width:220px;width:max-content;max-width:calc(100vw - var(--space-8));background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);padding:var(--space-1);display:flex;flex-direction:column;gap:1px;transform-origin:bottom left}.pd-row[data-v-f4448519]{display:grid;grid-template-columns:var(--p-ic-md) var(--composer-menu-desc-width, max-content) var(--p-ic-sm);column-gap:7px;row-gap:2px;align-items:start;width:100%;background:none;border:none;cursor:pointer;padding:6px 7px;border-radius:var(--radius-dropdown-row);text-align:left}.pd-row[data-v-f4448519]:hover,.pd-row.is-current[data-v-f4448519]{background:var(--color-hover)}.pd-icon[data-v-f4448519]{grid-column:1;grid-row:1;width:var(--p-ic-md);min-height:1lh;display:flex;align-items:center;justify-content:center;line-height:var(--leading-tight)}.pd-check[data-v-f4448519]{grid-column:3;grid-row:1;width:var(--p-ic-sm);min-height:1lh;color:var(--color-accent);font-size:var(--ui-font-size);font-weight:var(--weight-medium);display:flex;align-items:center;justify-content:center;line-height:var(--leading-tight)}.pd-info[data-v-f4448519]{display:contents}.pd-name[data-v-f4448519]{grid-column:2;grid-row:1;font-family:var(--font-ui);font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-tight)}.pd-desc[data-v-f4448519]{grid-column:2;grid-row:2;width:var(--composer-menu-desc-width, auto);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-caption);color:var(--muted);line-height:var(--leading-tight)}@media(max-width:640px){.composer[data-v-f4448519]{padding:9px var(--dock-inline-right, max(12px, var(--safe-right))) max(24px,var(--safe-bottom)) var(--dock-inline-left, max(12px, var(--safe-left)))}.composer-card[data-v-f4448519]{--composer-control-size: 36px;--composer-mobile-input-size: 16px;max-width:100%}.input-row[data-v-f4448519]{gap:6px;min-width:0}.send[data-v-f4448519],.stop[data-v-f4448519]{width:var(--composer-send-size);height:var(--composer-send-size);min-width:var(--composer-send-size);padding:0;border-radius:var(--radius-full);font-size:0;align-self:flex-end;position:relative}.ph[data-v-f4448519] .wm-pill{height:calc(var(--composer-mobile-input-size) * 1.5);line-height:calc(var(--composer-mobile-input-size) * 1.5);padding-right:calc((var(--composer-mobile-input-size) * 1.5 - var(--wm-x-size)) / 2)}.model-dropdown[data-v-f4448519]{right:calc(var(--composer-control-inset) + var(--composer-send-size) + var(--space-1));left:auto;min-width:180px;max-width:calc(100vw - 24px)}.ph[data-v-f4448519]{font-size:var(--composer-mobile-input-size)}.model-pill[data-v-f4448519],.attach-btn[data-v-f4448519]{font-size:var(--ui-font-size)}.toolbar[data-v-f4448519]{gap:6px;min-width:0}.toolbar-left[data-v-f4448519],.toolbar-right[data-v-f4448519]{min-width:0}.model-pill[data-v-f4448519]{max-width:min(52vw,220px)}.model-pill .mp-name[data-v-f4448519]{max-width:min(40vw,170px)}.md-row[data-v-f4448519],.md-section[data-v-f4448519]{font-size:var(--ui-font-size)}.md-thinking[data-v-f4448519]{flex-wrap:wrap;row-gap:6px}.md-thinking .ui-seg[data-v-f4448519]{margin-left:0}.pd-name[data-v-f4448519]{font-size:var(--ui-font-size)}.pd-desc[data-v-f4448519]{font-size:var(--text-xs)}}@media(hover:none){.ph[data-wm=true][data-v-f4448519] .ProseMirror{padding-top:var(--space-3)}.ph[data-v-f4448519] .wm-pill{display:flex;width:max-content;margin-right:0;margin-bottom:var(--space-3);padding-right:calc((var(--touch-target-min) - var(--wm-x-size)) / 2)}.ph[data-v-f4448519] .wm-x:before{inset:calc((var(--wm-x-size) - var(--touch-target-min)) / 2)}.ph[data-wm=true][data-v-f4448519]{min-height:calc(36px + var(--space-3))}}@media(max-width:640px)and (hover:none){.send[data-v-f4448519],.stop[data-v-f4448519],.attach-btn[data-v-f4448519],.expand-btn[data-v-f4448519],.model-pill[data-v-f4448519]{position:relative}.send[data-v-f4448519]:before,.stop[data-v-f4448519]:before,.attach-btn[data-v-f4448519]:before,.expand-btn[data-v-f4448519]:before,.model-pill[data-v-f4448519]:before{content:"";position:absolute;inset:-6px}.expand-btn[data-v-f4448519]:before{inset:-11px}.perm-pill[data-v-f4448519]{height:var(--touch-target-min)}.labels-collapsed .perm-pill[data-v-f4448519]{width:var(--touch-target-min);height:var(--touch-target-min)}}.appr[data-v-03ef6cfa]{display:flex;flex-direction:column;max-height:calc(var(--app-height, 100dvh) - var(--dock-card-top-clearance));margin:var(--space-2) 0;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-menu);overflow:hidden auto;animation:kimi-card-in var(--duration-base) var(--ease-out)}.appr[data-v-03ef6cfa]:before{content:"";position:sticky;top:0;flex:none;height:var(--p-scroll-seam-h);margin-bottom:calc(-1 * var(--p-scroll-seam-h));z-index:var(--z-raised);pointer-events:none;opacity:0;background:linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 2.5%,transparent),transparent 35%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.75%,transparent),transparent 65%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.25%,transparent),transparent);transition:opacity var(--duration-slow) var(--ease-out)}.appr.scrolled[data-v-03ef6cfa]:before{opacity:1}.appr>.ah[data-v-03ef6cfa],.appr>.af[data-v-03ef6cfa]{flex:none}.appr.minimized[data-v-03ef6cfa]{transition:background var(--duration-fast) var(--ease-out)}.appr.minimized[data-v-03ef6cfa]:hover{background:var(--color-hover)}.ah[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-3) var(--space-4) 0;flex-wrap:nowrap}.appr.minimized .ah[data-v-03ef6cfa]{padding-bottom:var(--space-3)}.appr.minimized .ah.clickable[data-v-03ef6cfa]{cursor:pointer}.akind[data-v-03ef6cfa]{color:var(--color-text);font-size:var(--text-lg);font-weight:var(--weight-semibold);white-space:nowrap;flex:none}.apeek[data-v-03ef6cfa]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-muted);font:var(--text-xs) var(--font-mono)}.amin[data-v-03ef6cfa],.aexpand[data-v-03ef6cfa]{margin-left:auto;flex:none}.aexpand+.amin[data-v-03ef6cfa]{margin-left:0}.ab[data-v-03ef6cfa]{display:flex;flex-direction:column;flex:1;min-height:0;padding:var(--space-3) var(--space-4) 0}.ab[data-v-03ef6cfa]>*{flex:0 1 auto;min-height:0}.ab>.plan-path[data-v-03ef6cfa]{flex:none}.ab>.body-plan-wrap[data-v-03ef6cfa]{flex:1}.plan-path[data-v-03ef6cfa]{display:block;width:100%;margin-bottom:var(--space-2);padding:0;border:none;background:transparent;color:var(--color-accent);font:var(--text-xs) var(--font-mono);text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.plan-path[data-v-03ef6cfa]:hover{text-decoration:underline}.plan-path[data-v-03ef6cfa]:focus-visible{outline:none;text-decoration:underline;border-radius:var(--radius-xs);box-shadow:var(--p-focus-ring)}.body-code[data-v-03ef6cfa]{display:flex;flex-direction:column}.body-code.expanded[data-v-03ef6cfa]{flex:1}.body-code.expanded[data-v-03ef6cfa] .hl-code{max-height:none;flex:1}.code-path[data-v-03ef6cfa]{flex:none;color:var(--color-text-muted);font:var(--text-xs) var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body-shell[data-v-03ef6cfa]{overflow-y:auto}.shell-cmd[data-v-03ef6cfa]{font:var(--text-sm) var(--font-mono);background:var(--color-surface-sunken);border:.5px solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3);white-space:pre-wrap;word-break:break-all;max-height:160px;overflow-y:auto;color:var(--color-text)}.shell-dollar[data-v-03ef6cfa]{color:var(--color-accent-hover);font-weight:var(--weight-medium);margin-right:var(--space-2)}.shell-cwd[data-v-03ef6cfa]{font:var(--text-xs) var(--font-mono);color:var(--color-text-muted);margin-top:var(--space-1)}.shell-danger[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-2);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);color:var(--color-danger);font:var(--text-sm)/var(--leading-normal) var(--font-ui);background:var(--color-danger-soft)}.shell-danger-ic[data-v-03ef6cfa]{flex:none}.body-chip[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text);overflow-y:auto}.chip-label[data-v-03ef6cfa]{background:var(--color-inline-code-bg);border-radius:var(--radius-sm);padding:2px var(--space-2);font:var(--weight-semibold) var(--text-xs) var(--font-mono);color:var(--color-text-muted);white-space:nowrap}.chip-value[data-v-03ef6cfa]{font:var(--text-sm) var(--font-mono);color:var(--color-text);word-break:break-all}.chip-detail[data-v-03ef6cfa]{font:var(--text-xs) var(--font-ui);color:var(--color-text-muted)}.body-todo[data-v-03ef6cfa]{overflow-y:auto}.todo-item[data-v-03ef6cfa]{display:flex;align-items:flex-start;gap:var(--space-2);padding:var(--space-1) 0;font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text)}.todo-glyph[data-v-03ef6cfa]{color:var(--color-accent);font-size:var(--text-sm);flex:none;width:14px}.todo-title[data-v-03ef6cfa]{color:var(--color-text)}.todo-done[data-v-03ef6cfa]{color:var(--color-text-muted);text-decoration:line-through}.body-generic[data-v-03ef6cfa]{font:var(--text-base)/var(--leading-normal) var(--font-ui);color:var(--color-text);word-break:break-word;overflow-y:auto}.body-plan-wrap[data-v-03ef6cfa]{display:flex;flex-direction:column;overflow-y:auto}.body-plan-wrap[data-v-03ef6cfa]:before{content:"";position:sticky;top:0;flex:none;height:var(--p-scroll-seam-h);margin-bottom:calc(-1 * var(--p-scroll-seam-h));z-index:var(--z-raised);pointer-events:none;opacity:0;background:linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 2.5%,transparent),transparent 35%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.75%,transparent),transparent 65%),linear-gradient(to bottom,color-mix(in srgb,var(--color-text) 1.25%,transparent),transparent);transition:opacity var(--duration-slow) var(--ease-out)}.body-plan-wrap.scrolled[data-v-03ef6cfa]:before{opacity:1}.body-plan-wrap>.plan-opts[data-v-03ef6cfa]{flex:none}.body-plan[data-v-03ef6cfa]{max-height:50vh;overflow-y:auto;min-height:0}.body-plan.expanded[data-v-03ef6cfa]{max-height:none;flex:1}.plan-opts[data-v-03ef6cfa]{display:flex;flex-direction:column;gap:2px;margin-top:var(--space-3);padding-top:var(--space-3);border-top:.5px solid var(--color-line)}.popt[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-2) var(--space-3);border:none;border-radius:var(--radius-md);background:transparent;color:var(--color-text);font:var(--text-sm)/var(--leading-normal) var(--font-ui);text-align:left;cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}.popt[data-v-03ef6cfa]:hover:not(:disabled){background:var(--color-hover)}.popt[data-v-03ef6cfa]:focus-visible{outline:none;background:var(--color-hover);box-shadow:var(--p-focus-ring)}.popt[data-v-03ef6cfa]:disabled{cursor:default;opacity:.6}.popt-key[data-v-03ef6cfa]{width:var(--p-chip-num);height:var(--p-chip-num);border-radius:var(--radius-sm);background:var(--color-inline-code-bg);color:var(--color-text);font:var(--weight-medium) var(--text-xs)/var(--p-chip-num) var(--font-ui);text-align:center;flex:none}.popt-text[data-v-03ef6cfa]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.popt-label[data-v-03ef6cfa]{color:var(--color-text);font-size:var(--text-base);font-weight:var(--weight-medium)}.popt-desc[data-v-03ef6cfa]{color:var(--color-text-muted);font:var(--text-xs)/var(--leading-normal) var(--font-ui)}.popt-spin[data-v-03ef6cfa]{flex:none;color:var(--color-text-muted)}.feedback-wrap[data-v-03ef6cfa]{margin-top:var(--space-3);overflow-y:auto}.feedback-hint[data-v-03ef6cfa]{font:var(--text-xs) var(--font-ui);color:var(--color-text-muted);margin-top:var(--space-1)}.af[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-3);padding:var(--space-3) var(--space-4);border-top:.5px solid var(--color-line)}.abtns[data-v-03ef6cfa]{display:flex;align-items:center;gap:var(--space-1)}.knum[data-v-03ef6cfa]{min-width:16px;height:16px;padding:0 3px;border-radius:var(--radius-xs);background:var(--color-inline-code-bg);color:var(--color-text);font:var(--weight-medium) var(--text-xs)/16px var(--font-ui);text-align:center}.abtns .ui-button--primary .knum[data-v-03ef6cfa]{background:color-mix(in srgb,var(--color-text-on-accent) 28%,transparent);color:var(--color-text-on-accent)}@media(max-width:640px){.popt[data-v-03ef6cfa]{min-height:44px;padding:var(--space-3)}.af[data-v-03ef6cfa]{flex-direction:column;align-items:stretch}.abtns[data-v-03ef6cfa]{flex-direction:column;margin-left:0;gap:var(--space-2)}.abtns[data-v-03ef6cfa] .ui-button{width:100%;min-height:46px}.abtns .amain[data-v-03ef6cfa]{order:-1}}.chat-dock[data-v-a4f60a64]{--dock-inline-left: 16px;--dock-inline-right: 16px;box-sizing:border-box;width:100%;max-width:calc(var(--read-max) + var(--panes-scrollbar-width, 0px));padding-right:var(--panes-scrollbar-width, 0px);flex:none;position:absolute;inset:auto 0 0;background:transparent;z-index:var(--z-sticky)}.chat-dock.has-popup[data-v-a4f60a64]{z-index:var(--z-dropdown)}.chat-dock.align-center[data-v-a4f60a64]{margin-left:auto;margin-right:auto}.chat-dock.align-left[data-v-a4f60a64]{margin-left:0;margin-right:auto}.chat-dock.align-mobile[data-v-a4f60a64]{max-width:none}.chat-dock[data-v-a4f60a64]:before{--fade: 48px;--veil: 72px;content:"";position:absolute;top:calc(-1 * var(--fade));right:0;bottom:0;left:0;z-index:0;pointer-events:none;background:linear-gradient(to bottom,color-mix(in srgb,var(--color-bg) 0%,transparent),color-mix(in srgb,var(--color-bg) 30%,transparent) 21px,color-mix(in srgb,var(--color-bg) 70%,transparent) 45px,var(--color-bg) var(--veil))}.chat-dock[data-v-a4f60a64]>*{position:relative;z-index:1}.dock-work-panel[data-v-a4f60a64]{position:absolute;left:16px;right:calc(16px + var(--panes-scrollbar-width, 0px));bottom:100%;background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-2xl);box-shadow:var(--shadow-menu);margin-bottom:var(--space-2);max-height:min(360px,50vh);display:flex;flex-direction:column;overflow:hidden;user-select:none}.dock-work-panel.panel-todos .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-head[data-v-a4f60a64]{padding:var(--space-4) var(--space-4) 0;border-bottom:none}.dock-work-panel.panel-todos .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-body[data-v-a4f60a64]{margin-top:var(--space-3);padding:0 var(--space-4) var(--space-4)}.dock-work-panel.panel-todos .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-plan .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-head[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-head[data-v-a4f60a64]{padding:var(--space-4) var(--space-4) 0;border-bottom:none}.dock-work-panel.panel-todos .dock-work-tab[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-tab[data-v-a4f60a64],.dock-work-panel.panel-plan .dock-work-tab[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-tab[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-tab[data-v-a4f60a64]{padding:0;line-height:var(--leading-solid)}.dock-work-panel.panel-goal .gh-time[data-v-a4f60a64]{color:var(--color-text-muted)}.dock-work-panel.panel-todos .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-goal .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-plan .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-subagent .dock-work-body[data-v-a4f60a64],.dock-work-panel.panel-bash .dock-work-body[data-v-a4f60a64]{margin-top:var(--space-3);padding:0 var(--space-4) var(--space-4)}.dock-work-panel.panel-subagent[data-v-a4f60a64],.dock-work-panel.panel-bash[data-v-a4f60a64]{height:min(var(--p-dock-panel-h),50vh)}.dock-work-tab.tab-progress[data-v-a4f60a64]{display:inline-flex;align-items:center;gap:var(--space-2)}@media(max-width:640px){.dock-work-panel.panel-subagent[data-v-a4f60a64],.dock-work-panel.panel-bash[data-v-a4f60a64]{height:auto}}.dock-work-head[data-v-a4f60a64]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);border-bottom:.5px solid var(--color-line);position:relative;z-index:1}.dock-work-body[data-v-a4f60a64]{padding:var(--space-2) var(--space-3);overflow-y:auto;min-height:0;display:flex;flex-direction:column}@media(max-width:480px){.dock-work-head[data-v-a4f60a64]{flex-wrap:wrap}}.dock-work-panel.body-scrolled-up .dock-work-body[data-v-a4f60a64]{mask-image:linear-gradient(to bottom,transparent,black var(--menu-scroll-fade))}.dock-work-body[data-v-a4f60a64] .taskspane{border:none;background:transparent;padding:0}.dock-work-body[data-v-a4f60a64] .taskspane .tp-head{display:none}.dock-workbar[data-v-a4f60a64]{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-1) var(--space-1-5);padding:var(--space-1) calc(var(--dock-inline-right) + var(--space-4) + var(--p-hairline)) var(--space-05) calc(var(--dock-inline-left) + var(--space-4) + var(--p-hairline))}.dock-workbar[data-v-a4f60a64] .ui-pill{position:relative;gap:var(--space-1-5);height:auto;padding:var(--space-2) calc(var(--space-3) + var(--space-05)) var(--space-2) var(--space-3);border:none;border-radius:var(--radius-lg);background:var(--color-selected);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);color:var(--color-text);font-size:var(--text-base);line-height:var(--leading-normal)}.dock-workbar[data-v-a4f60a64] .ui-pill svg{width:1.5em;height:1.5em;color:inherit}.dock-workbar[data-v-a4f60a64] .ui-pill:after{content:"";position:absolute;inset:0;border-radius:var(--radius-lg);background:var(--color-hover);opacity:0;transition:opacity var(--duration-base) var(--ease-out);pointer-events:none}.dock-workbar[data-v-a4f60a64] .ui-pill:hover:not(:disabled):after,.dock-workbar[data-v-a4f60a64] .ui-pill.is-active:after{opacity:1}.chat-dock.pills-compact .dock-workbar[data-v-a4f60a64] .ui-pill{padding:var(--space-2)}.chat-dock.pills-compact .dock-workbar[data-v-a4f60a64] .ui-pill>span{display:none}.dock-workbar .dw-count[data-v-a4f60a64]{color:var(--color-text-muted)}.dock-workbar .dw-running[data-v-a4f60a64]{display:inline-flex;align-items:center;gap:var(--space-1);color:var(--color-text-muted)}.dock-workbar .dw-goal-status[data-v-a4f60a64]{font-weight:var(--weight-medium)}.dock-workbar .dw-goal-status--active[data-v-a4f60a64]{color:var(--color-success)}.dock-workbar .dw-goal-status--paused[data-v-a4f60a64]{color:var(--color-warning)}.dock-workbar .dw-goal-status--blocked[data-v-a4f60a64]{color:var(--color-danger)}.dock-approval[data-v-a4f60a64]{margin-top:8px}.chat-dock.has-approval[data-v-a4f60a64],.chat-dock.has-question[data-v-a4f60a64]{display:flex;flex-direction:column;max-height:calc(var(--app-height, 100dvh) - var(--dock-card-top-clearance))}.chat-dock.has-approval>.dock-workbar[data-v-a4f60a64],.chat-dock.has-question>.dock-workbar[data-v-a4f60a64]{flex:none}.chat-dock.has-approval>.dock-approval[data-v-a4f60a64],.chat-dock.has-question>.dock-question[data-v-a4f60a64]{min-height:0}@media(max-width:640px){.chat-dock[data-v-a4f60a64]{--dock-inline-left: max(12px, var(--safe-left));--dock-inline-right: max(12px, var(--safe-right))}.dock-work-panel[data-v-a4f60a64]{left:10px;right:calc(10px + var(--panes-scrollbar-width, 0px))}.dock-work-head-actions[data-v-a4f60a64] .ui-seg__item{height:var(--touch-target-min)}.dock-work-head-actions[data-v-a4f60a64] .ui-icon-button{width:var(--touch-target-min);height:var(--touch-target-min)}}.chat-dock[data-v-a4f60a64]:not(.align-mobile) .composer{padding-bottom:14px}.dock-panel-enter-active[data-v-a4f60a64]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.dock-panel-leave-active[data-v-a4f60a64]{transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.dock-panel-enter-from[data-v-a4f60a64],.dock-panel-leave-to[data-v-a4f60a64]{opacity:0;transform:translateY(var(--motion-panel-shift)) scale(var(--motion-panel-scale))}.ws-home[data-v-33dedf8a]{flex:none;display:flex;flex-direction:column;align-items:center;gap:var(--space-1);padding:0 var(--space-4) var(--space-4);user-select:none}.ws-home-title[data-v-33dedf8a]{display:flex;align-items:center;gap:10px;color:var(--color-text);font-size:var(--ui-t1);font-weight:var(--weight-section-label)}.ws-home-folder[data-v-33dedf8a]{color:var(--color-text-muted)}.ws-home-path[data-v-33dedf8a]{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-faint);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wrs[data-v-460203b8]{flex:none;display:flex;flex-direction:column;margin:var(--space-4) var(--dock-inline-right, 16px) 0 var(--dock-inline-left, 16px)}.wrs-caption[data-v-460203b8]{padding:0 var(--space-2) var(--space-1);font-family:var(--font-ui);font-size:var(--text-xs);font-weight:var(--weight-section-label);text-transform:uppercase;color:var(--faint);user-select:none}.wrs-row[data-v-460203b8]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-width:0;padding:6px var(--space-2);border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-family:var(--font-ui);text-align:left;cursor:pointer}.wrs-row[data-v-460203b8]:hover{background:var(--color-hover)}.wrs-row[data-v-460203b8]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.wrs-ico[data-v-460203b8]{display:inline-flex;flex:none}.wrs-ico--open[data-v-460203b8]{color:var(--color-success)}.wrs-ico--done[data-v-460203b8]{color:var(--color-done)}.wrs-title[data-v-460203b8]{flex:1;min-width:0;font-size:var(--ui-font-size-sm);font-weight:var(--weight-caption);line-height:var(--leading-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wrs-time[data-v-460203b8]{flex:none;color:var(--color-text-faint);font-size:var(--text-xs);font-variant-numeric:tabular-nums}.wrs-foot[data-v-460203b8]{display:flex;justify-content:center;margin-top:var(--space-2)}.wrs-more[data-v-460203b8]{display:inline-flex;align-items:center;gap:var(--space-1);height:26px;padding:0 var(--space-2);border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.wrs-more[data-v-460203b8]:hover{background:var(--color-hover);color:var(--color-text)}.wrs-more svg[data-v-460203b8]{color:var(--color-text-faint)}.tsearch[data-v-43f7fb07]{position:absolute;top:calc(var(--panel-head-h, 48px) + var(--space-3));right:var(--space-3);z-index:var(--z-sticky);width:min(var(--p-findbar-w),calc(100% - var(--space-3) * 2));background:var(--color-surface-raised);border:var(--p-hairline) solid var(--color-line);border-radius:var(--radius-2xl);box-shadow:var(--shadow-menu);animation:kimi-card-in var(--duration-slow) var(--ease-out)}.tsearch.mobile[data-v-43f7fb07]{top:var(--space-3)}.tsearch[data-v-43f7fb07]:after{content:"";position:absolute;inset:0;border:inherit;border-color:var(--color-composer-focus-line);border-radius:var(--radius-2xl);opacity:0;pointer-events:none;transition:opacity var(--duration-slow) var(--ease-in-out)}.tsearch[data-v-43f7fb07]:focus-within:after{opacity:1}.tsearch-main[data-v-43f7fb07]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-1) var(--space-2);min-height:calc(var(--space-8) + 2 * var(--space-1))}.tsearch-icon[data-v-43f7fb07]{flex:none;margin-left:var(--space-1);color:var(--color-text-muted)}.tsearch-input[data-v-43f7fb07]{flex:1;min-width:0;height:var(--space-8);padding:0;border:none;background:transparent;font-family:var(--font-ui);font-size:var(--ui-font-size);color:var(--color-text)}.tsearch-input[data-v-43f7fb07]:focus-visible{outline:none}.tsearch-input[data-v-43f7fb07]::placeholder{color:var(--color-text-muted)}.tsearch-spin[data-v-43f7fb07]{display:inline-flex;flex:none}.tsearch-sep[data-v-43f7fb07]{flex:none;width:var(--p-hairline);height:var(--space-4);background:var(--color-line)}.tsearch .tsearch-close[data-v-43f7fb07]{border-radius:var(--radius-full)}.tsearch-foot-wrap[data-v-43f7fb07]{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--duration-slow) var(--ease-out)}.tsearch-foot-wrap.open[data-v-43f7fb07]{grid-template-rows:1fr}.tsearch-foot[data-v-43f7fb07]{overflow:hidden;min-height:0;display:flex;align-items:center;gap:var(--space-1);padding:0 var(--space-2)}.tsearch-foot-wrap.open .tsearch-foot[data-v-43f7fb07]{padding:var(--space-1) var(--space-2);border-top:var(--p-hairline) solid var(--color-line)}.tsearch-count[data-v-43f7fb07]{margin-left:auto;padding-right:var(--space-1);font-size:var(--ui-font-size-sm);color:var(--color-text-muted);white-space:nowrap;user-select:none}.tsearch-rings[data-v-43f7fb07]{position:absolute;inset:0;pointer-events:none}.tsearch-ring[data-v-43f7fb07]{position:absolute;box-sizing:content-box;border:var(--p-findring-w) solid var(--color-warning);margin:calc(-1 * var(--p-findring-w));border-radius:var(--radius-xs);pointer-events:none}.con[data-v-ac65bbbb]{--read-max: 760px;display:flex;flex-direction:column;min-width:0;height:100%;position:relative;container-type:inline-size}.empty-drag[data-v-ac65bbbb]{position:absolute;top:0;left:0;right:0;height:var(--panel-head-h, 48px)}.empty-drag.macos-desktop[data-v-ac65bbbb]{-webkit-app-region:drag}.empty-panel-btn[data-v-ac65bbbb]{position:absolute;top:var(--space-3);right:var(--space-4);z-index:var(--z-sticky);width:var(--space-6);height:var(--space-6);border-radius:var(--radius-sm);-webkit-app-region:no-drag}.empty-panel-btn[data-v-ac65bbbb] svg{width:var(--p-ic-sm);height:var(--p-ic-sm)}.panes[data-v-ac65bbbb]{flex:1;min-height:0;overflow-y:auto;overflow-anchor:auto;scrollbar-gutter:stable}.panes[data-v-ac65bbbb]::-webkit-scrollbar{width:4px}.panes[data-v-ac65bbbb]::-webkit-scrollbar-thumb{background:transparent;transition:background var(--duration-base) var(--ease-out)}.panes.scrolling[data-v-ac65bbbb]::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--color-text) 12%,transparent)}.panes.scrolling[data-v-ac65bbbb]::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}.panes.session-settling .chat[data-v-ac65bbbb]>*:not(.chat-loading){visibility:hidden}.panes.is-following[data-v-ac65bbbb],.panes.history-prepending[data-v-ac65bbbb],.panes.is-pinned[data-v-ac65bbbb]{overflow-anchor:none}.chat-layout[data-v-ac65bbbb]{display:flex;flex-direction:column;height:100%;min-height:0;position:relative}.chat-scroll[data-v-ac65bbbb]{flex:1;min-height:0;position:relative}.content-wrap[data-v-ac65bbbb]{width:100%;max-width:var(--read-max);min-height:100%;box-sizing:border-box;padding-bottom:var(--chat-dock-height, 0px);display:flex;flex-direction:column;flex-shrink:0}.content-wrap.align-center[data-v-ac65bbbb]{margin-left:auto;margin-right:auto}.content-wrap.align-left[data-v-ac65bbbb]{margin-left:0;margin-right:auto}.content-wrap.align-mobile[data-v-ac65bbbb]{max-width:none}@media(max-width:640px){.con.mobile[data-v-ac65bbbb]{min-width:0;overflow:hidden}.con.mobile .panes[data-v-ac65bbbb]{scrollbar-gutter:auto;-webkit-overflow-scrolling:touch}.content-wrap.align-mobile[data-v-ac65bbbb]{width:100%;min-width:0}}.empty-spacer[data-v-ac65bbbb]{flex:1}.empty-tail[data-v-ac65bbbb]{min-height:0;overflow-y:auto;padding-bottom:var(--space-4);box-sizing:border-box}.empty-hint[data-v-ac65bbbb]{flex:none;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:0 16px 16px;color:var(--color-text);font-family:var(--font-ui);user-select:none}.empty-hint-title[data-v-ac65bbbb]{font-size:calc(var(--ui-font-size) + 16px);font-optical-sizing:auto;font-weight:600}.empty-hint-title.is-starting[data-v-ac65bbbb]{display:inline-flex;align-items:center;gap:9px;color:var(--dim);font-weight:400}.empty-doodle[data-v-ac65bbbb]{width:min(340px,62vw)}.empty-hint-text[data-v-ac65bbbb]{display:inline-block;font-size:var(--text-base);color:var(--dim);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upgrade-banner[data-v-ac65bbbb]{flex:none;display:flex;align-items:center;gap:var(--space-3);margin:0 var(--dock-inline-right, 16px) var(--space-2) var(--dock-inline-left, 16px);padding:var(--space-2) var(--space-3);border:.5px solid var(--color-accent-bd);border-radius:var(--radius-xl);background:var(--color-accent-soft)}.upgrade-banner-icon[data-v-ac65bbbb]{flex:none;color:var(--color-accent)}.upgrade-banner-text[data-v-ac65bbbb]{flex:1;min-width:0;font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text)}.upgrade-banner-cta[data-v-ac65bbbb]{flex:none;display:inline-flex;align-items:center;gap:var(--space-1);padding:var(--space-1) var(--space-2);border:none;border-radius:var(--radius-sm);background:transparent;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-accent);cursor:pointer}.upgrade-banner-cta[data-v-ac65bbbb]:hover{color:var(--color-accent-hover)}.empty-composer[data-v-ac65bbbb] .composer-card{position:relative;z-index:var(--z-sticky)}.empty-composer[data-v-ac65bbbb]:not(.expanded) .ph{min-height:3lh}.ws-bar[data-v-ac65bbbb]{margin-top:calc(-1 * var(--space-4));padding:calc(var(--space-4) + var(--space-2)) var(--space-2) var(--space-2);background:color-mix(in srgb,var(--color-hover) 60%,transparent);border-radius:0 0 var(--radius-2xl) var(--radius-2xl);font-family:var(--font-ui)}.ws-anchor[data-v-ac65bbbb]{position:relative}.ws-chip[data-v-ac65bbbb]{display:inline-flex;align-items:center;gap:var(--space-2);max-width:100%;padding:var(--space-2) var(--space-3);background:none;border:none;border-radius:var(--radius-full);color:var(--color-text-muted);font-family:inherit;font-size:var(--ui-font-size-sm);cursor:pointer;transition:background var(--duration-base) var(--ease-out)}.ws-chip[data-v-ac65bbbb]:hover,.ws-chip.open[data-v-ac65bbbb]{background:var(--color-selected);color:var(--color-text)}.ws-chip[data-v-ac65bbbb]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ws-chip>.kw-icon[data-v-ac65bbbb]{flex:none}.ws-chip-name[data-v-ac65bbbb]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-option-label)}.ws-chip-chev[data-v-ac65bbbb]{flex:none;transition:transform var(--duration-base) var(--ease-out)}.ws-chip.open .ws-chip-chev[data-v-ac65bbbb]{transform:rotate(180deg)}.ws-chip.ws-ghost[data-v-ac65bbbb]{color:var(--color-text-muted)}.ws-chip.ws-ghost[data-v-ac65bbbb]:hover{color:var(--color-text)}.ws-backdrop[data-v-ac65bbbb]{position:fixed;inset:0;z-index:var(--z-sticky)}.ws-panel[data-v-ac65bbbb]{position:absolute;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr);left:0;top:calc(100% + var(--space-1));z-index:var(--z-dropdown);width:max-content;min-width:min(calc(var(--space-8) * 8),100%);max-width:100%;max-height:calc(var(--space-8) * 10);overflow:hidden auto;background:var(--color-menu-bg);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--color-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:var(--space-1);animation:ws-pop-ac65bbbb var(--duration-base) var(--ease-out)}.ws-panel.up[data-v-ac65bbbb]{top:auto;bottom:calc(100% + var(--space-1));animation-name:ws-pop-up-ac65bbbb}@keyframes ws-pop-ac65bbbb{0%{opacity:0;transform:translateY(calc(-1 * var(--space-1))) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes ws-pop-up-ac65bbbb{0%{opacity:0;transform:translateY(var(--space-1)) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}.ws-caption[data-v-ac65bbbb]{padding:var(--space-1) var(--space-2);font-size:var(--text-xs);font-weight:var(--weight-medium);color:var(--color-text-faint);user-select:none}.ws-row[data-v-ac65bbbb]{display:flex;align-items:center;gap:var(--space-2);width:100%;text-align:left;background:none;border:none;border-radius:var(--radius-dropdown-row);padding:var(--space-1) var(--space-2);cursor:pointer;font-family:var(--font-ui)}.ws-row>.kw-icon[data-v-ac65bbbb]{flex:none;color:var(--muted)}.ws-row[data-v-ac65bbbb]:hover{background:var(--color-hover)}.ws-row.on[data-v-ac65bbbb]{background:var(--color-selected)}.ws-row[data-v-ac65bbbb]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ws-info[data-v-ac65bbbb]{flex:1;min-width:0;display:flex;flex-direction:column}.ws-name[data-v-ac65bbbb]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-base);font-weight:var(--weight-option-label);color:var(--color-text);line-height:var(--leading-normal)}.ws-path[data-v-ac65bbbb]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs);font-weight:var(--weight-option-label);color:var(--muted);line-height:var(--leading-normal)}.ws-check[data-v-ac65bbbb]{flex:none;margin-left:var(--space-3);color:var(--color-text)}.ws-divider[data-v-ac65bbbb]{height:1px;margin:var(--space-1) var(--space-2);background:var(--line)}.ws-action[data-v-ac65bbbb]{display:flex;align-items:center;gap:var(--space-2);width:100%;text-align:left;background:none;border:none;border-radius:var(--radius-dropdown-row);padding:var(--space-2);cursor:pointer;font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--dim)}.ws-action>.kw-icon[data-v-ac65bbbb]{flex:none;color:var(--muted)}.ws-action span[data-v-ac65bbbb]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ws-action[data-v-ac65bbbb]:hover{background:var(--color-hover);color:var(--color-text)}.ws-action:hover>.kw-icon[data-v-ac65bbbb]{color:var(--dim)}.ws-action[data-v-ac65bbbb]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.chat-scroll[data-v-ac65bbbb]{display:flex;flex-direction:column}.mobile .panes[data-v-ac65bbbb]:has(>.chat-layout){overflow:hidden;scrollbar-gutter:auto}.newmsg-pill[data-v-ac65bbbb]{position:absolute;left:50%;bottom:12px;transform:translate(-50%);display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;border:.5px solid var(--line);background:var(--panel);color:var(--color-text);font-size:var(--text-xs);font-weight:var(--weight-ui-strong);cursor:pointer;box-shadow:var(--shadow-sm);z-index:var(--z-sticky)}.pill-chevron[data-v-ac65bbbb]{width:12px;height:12px}.pill-enter-active[data-v-ac65bbbb],.pill-leave-active[data-v-ac65bbbb]{transition:opacity .2s ease,transform .2s ease}.pill-enter-from[data-v-ac65bbbb],.pill-leave-to[data-v-ac65bbbb]{opacity:0;transform:translate(-50%) translateY(8px)}.undo-toast[data-v-ac65bbbb]{position:absolute;left:50%;top:60px;transform:translate(-50%);padding:8px 14px;border-radius:var(--radius-sm);background:var(--color-text);color:var(--bg);font-size:var(--ui-font-size-sm);z-index:var(--z-sticky);box-shadow:var(--shadow-sm)}.undo-toast-text[data-v-ac65bbbb]{display:flex;align-items:center;gap:8px}.undo-toast-enter-active[data-v-ac65bbbb],.undo-toast-leave-active[data-v-ac65bbbb]{transition:opacity .15s ease,transform .15s ease}.undo-toast-enter-from[data-v-ac65bbbb],.undo-toast-leave-to[data-v-ac65bbbb]{opacity:0;transform:translate(-50%) translateY(-6px)}.con[data-v-ac65bbbb]{background:var(--bg)}.newmsg-pill[data-v-ac65bbbb]{font-family:var(--sans)}.panel-tab-bar[data-v-808fd300]{position:relative;height:var(--panel-head-h);flex:none;display:flex;align-items:center;gap:var(--space-05);padding:0 var(--space-4) 0 var(--space-2);border-bottom:var(--p-hairline) solid var(--color-line)}.ptb-tabs[data-v-808fd300]{flex:1;min-width:0;height:100%;display:flex;align-items:center;gap:var(--space-05);overflow-x:auto;scrollbar-width:none}.ptb-tabs[data-v-808fd300]::-webkit-scrollbar{display:none}.ptb-tab[data-v-808fd300]{display:inline-flex;align-items:center;gap:var(--space-1-5);height:var(--panel-tab-h);padding:0 var(--space-1-5) 0 var(--panel-tab-pad-x);max-width:var(--panel-tab-max-w);min-width:0;flex:none;border-radius:var(--radius-md);background:var(--color-hover);color:var(--color-text-muted);transition:background var(--duration-fast) var(--ease-out)}.ptb-tab[data-v-808fd300]:hover{background:var(--color-selected);color:var(--color-text)}.ptb-tab.on[data-v-808fd300]{background:var(--color-selected-hover);color:var(--color-text)}.ptb-tab-main[data-v-808fd300]{display:inline-flex;align-items:center;gap:var(--space-1-5);flex:1;min-width:0;padding:0;border:none;background:none;color:inherit;font-family:var(--font-ui);font-size:var(--text-sm);white-space:nowrap;user-select:none;cursor:pointer}.ptb-tab-main[data-v-808fd300]:focus-visible{outline:none;border-radius:var(--radius-xs);box-shadow:var(--p-focus-ring)}.ptb-t[data-v-808fd300]{overflow:hidden;text-overflow:ellipsis}.ptb-x[data-v-808fd300]{width:var(--panel-tab-x-size);height:var(--panel-tab-x-size);flex:none;padding:0;border:none;border-radius:var(--radius-xs);display:inline-flex;align-items:center;justify-content:center;background:none;color:var(--color-text-faint);cursor:pointer}.ptb-x[data-v-808fd300]:hover{background:var(--color-well);color:var(--color-text)}.ptb-x[data-v-808fd300]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.ptb-tail[data-v-808fd300]{flex:none;display:flex;align-items:center;gap:var(--space-05);padding-left:var(--space-1)}.panel-add-menu[data-v-808fd300]{position:absolute;top:calc(var(--panel-head-h) - var(--space-1-5));right:var(--space-4);z-index:var(--z-dropdown)}@media(hover:none),(max-width:640px){.ptb-x[data-v-808fd300],.ptb-tail[data-v-808fd300] .ui-icon-button{position:relative}.ptb-x[data-v-808fd300]:after{content:"";position:absolute;inset:calc(-1 * (var(--touch-target-min) - var(--panel-tab-x-size)) / 2)}.ptb-tail[data-v-808fd300] .ui-icon-button:after{content:"";position:absolute;inset:calc(-1 * (var(--touch-target-min) - var(--icon-button-sm)) / 2)}}.pl[data-v-445e1a28]{display:flex;flex-direction:column;justify-content:center;gap:var(--space-3);height:100%;box-sizing:border-box;width:min(var(--panel-launcher-w),100%);margin-inline:auto;padding:var(--space-2) 0}.global-preview[data-v-46c316da]{--preview-w: var(--panel-default-w);grid-column:4;grid-row:1 / -1;min-width:0;min-height:0;width:0;background:var(--bg);overflow:hidden;position:relative}.global-preview.open[data-v-46c316da]{width:var(--preview-w)}.global-preview.expanded[data-v-46c316da]{width:auto}.global-preview.mobile[data-v-46c316da]{position:fixed;inset:0;z-index:var(--z-sticky);width:auto;transition:none;border-top:var(--p-hairline) solid var(--color-text)}.panel-resize[data-v-46c316da]{position:absolute;left:var(--space-05);top:0;bottom:0}.pt-shell[data-v-46c316da]{display:flex;flex-direction:column;height:100%;box-sizing:border-box;position:relative}.global-preview:not(.mobile) .pt-shell[data-v-46c316da]{width:var(--preview-w);border-left:var(--p-hairline) solid var(--line)}.global-preview:not(.mobile).expanded .pt-shell[data-v-46c316da]{width:auto;border-left:none}.pt-body[data-v-46c316da]{flex:1;min-height:0}.pfc-host[data-v-46c316da]{position:absolute;left:0;right:0;bottom:0;z-index:var(--z-sticky);width:100%;max-width:var(--p-content-max);margin:0 auto;box-sizing:border-box;padding:0 var(--space-4) var(--space-4)}.pfc-host[data-v-46c316da]:empty{padding:0}.pt-body[data-v-46c316da]>*{height:100%;box-sizing:border-box}.session-admin[data-v-fd687e8e]{display:flex;flex-direction:column;min-width:0;height:100%;background:var(--color-bg);font-family:var(--font-ui)}.sa-scroll[data-v-fd687e8e]{flex:1;min-height:0;overflow-y:auto}.sa-page[data-v-fd687e8e]{padding:var(--space-8) var(--space-6);display:flex;flex-direction:column;box-sizing:border-box}.sa-head[data-v-fd687e8e]{flex:none;display:flex;align-items:center;gap:var(--space-2);height:48px;padding:0 var(--space-6);border-bottom:.5px solid var(--color-line);box-sizing:border-box}.sa-title[data-v-fd687e8e]{margin:0;font-size:var(--text-base);font-weight:var(--weight-semibold);line-height:var(--leading-tight);color:var(--color-text);user-select:none}.sa-subtitle[data-v-fd687e8e]{margin:0 0 var(--space-3);font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted)}.session-admin.macos-desktop .sa-head[data-v-fd687e8e]{-webkit-app-region:drag}.session-admin.macos-desktop .sa-head button[data-v-fd687e8e],.session-admin.macos-desktop .sa-head input[data-v-fd687e8e]{-webkit-app-region:no-drag}.sa-filters[data-v-fd687e8e]{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;margin-bottom:var(--space-3)}.sa-f-label[data-v-fd687e8e]{margin-left:var(--space-2);color:var(--color-text-muted);font-size:var(--text-sm);user-select:none}.sa-f-label[data-v-fd687e8e]:first-child{margin-left:0}.sa-f-actions[data-v-fd687e8e]{display:inline-flex;align-items:center;gap:var(--space-2);margin-left:var(--space-2)}.brand-logo[data-v-0904de71]{display:block;flex:none;cursor:pointer;user-select:none;touch-action:manipulation}.nb-cards[data-v-d880fe1a]{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-2) 0 var(--space-4)}.center-body[data-v-d880fe1a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);padding:var(--space-8) 0 var(--space-4);text-align:center}.center-text[data-v-d880fe1a]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.success-text[data-v-d880fe1a]{color:var(--color-success)}.err-text[data-v-d880fe1a]{color:var(--color-danger)}.warn-text[data-v-d880fe1a]{color:var(--color-warning);font-size:var(--text-base)}.center-hint[data-v-d880fe1a]{font-size:var(--text-sm);color:var(--color-text-muted)}.nb[data-v-d880fe1a]{display:flex;flex-direction:column;gap:var(--space-4);padding:var(--space-2) 0 var(--space-4)}.nb-hero[data-v-d880fe1a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);text-align:center}.nb-hero-icon[data-v-d880fe1a]{display:inline-flex;margin-bottom:var(--space-1)}.nb-hero-title[data-v-d880fe1a]{font-size:var(--text-lg);font-weight:var(--weight-medium);color:var(--color-text)}.nb-hero-hint[data-v-d880fe1a]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal);font-variant-numeric:tabular-nums}.nb-manual[data-v-d880fe1a]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2)}.nb-manual-label[data-v-d880fe1a]{font-size:var(--text-xs);color:var(--color-text-faint)}.nb-copy-text[data-v-d880fe1a]{margin-left:var(--space-2)}.nb-copy-text.is-copied[data-v-d880fe1a]{color:var(--color-success);text-decoration:none}.nb-or[data-v-d880fe1a]{display:flex;align-items:center;gap:var(--space-3);color:var(--color-text-muted);font-size:var(--text-xs);letter-spacing:.06em}.nb-or[data-v-d880fe1a]:before,.nb-or[data-v-d880fe1a]:after{content:"";flex:1;height:1px;background:var(--color-line)}.nb-fallback[data-v-d880fe1a]{display:flex;flex-direction:column;gap:var(--space-2)}.nb-fb-text[data-v-d880fe1a]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal)}.nb-fb-link[data-v-d880fe1a]{color:var(--color-accent);text-decoration:none;border-bottom:var(--p-hairline) solid var(--color-accent-bd)}.nb-fb-link[data-v-d880fe1a]:hover{border-bottom-color:var(--color-accent)}.nb-code-row[data-v-d880fe1a]{display:flex;align-items:center;gap:var(--space-3);background:var(--color-surface-sunken);border:var(--p-hairline) solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3)}.nb-code[data-v-d880fe1a]{flex:1;font-family:var(--font-mono);font-size:var(--text-xl);font-weight:var(--weight-medium);color:var(--color-text);letter-spacing:.14em}.nb-copy.is-copied[data-v-d880fe1a]{color:var(--color-success);border-color:var(--color-success-bd)}.actions[data-v-d880fe1a]{display:flex;justify-content:flex-end;gap:var(--space-3);padding-top:var(--space-4)}@media(max-width:640px){.center-body[data-v-d880fe1a],.nb[data-v-d880fe1a]{overflow-y:auto;-webkit-overflow-scrolling:touch}.nb-code-row[data-v-d880fe1a],.actions[data-v-d880fe1a]{flex-wrap:wrap}.nb-code[data-v-d880fe1a]{min-width:0;overflow-wrap:anywhere;letter-spacing:.08em}.nb-copy[data-v-d880fe1a]{min-height:34px}}.sec[data-v-b460ecbf]{margin-bottom:var(--space-5)}.sec-title[data-v-b460ecbf]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text);margin:0 0 var(--space-3)}.pu-group[data-v-b460ecbf]{overflow:hidden;border-radius:var(--radius-xl);background:var(--color-surface)}.pu-row[data-v-b460ecbf]{display:flex;align-items:center;gap:var(--space-3);min-height:52px;padding:var(--space-3) var(--space-4);border-top:.5px solid var(--color-line)}.pu-row[data-v-b460ecbf]:first-child{border-top:none}.pu-state[data-v-b460ecbf]{color:var(--color-text-muted);font-size:var(--text-sm)}.pu-error-text[data-v-b460ecbf]{flex:1;min-width:0}.pu-empty[data-v-b460ecbf]{color:var(--color-text-faint)}.pu-main[data-v-b460ecbf]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.pu-label[data-v-b460ecbf]{font-size:var(--text-sm);color:var(--color-text)}.pu-hint[data-v-b460ecbf]{font-size:var(--text-xs);color:var(--color-text-faint)}.pu-value[data-v-b460ecbf]{flex:none;font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);font-variant-numeric:tabular-nums;white-space:nowrap}.pu-value-sub[data-v-b460ecbf]{font-weight:var(--weight-regular);color:var(--color-text-faint)}.pu-meter[data-v-b460ecbf]{flex:none;width:120px;height:5px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden}.pu-meter i[data-v-b460ecbf]{display:block;height:100%;border-radius:var(--radius-full);background:var(--color-accent);transition:width var(--duration-base) var(--ease-out)}.pu-meter i.sev-warn[data-v-b460ecbf]{background:var(--color-warning)}.pu-meter i.sev-danger[data-v-b460ecbf]{background:var(--color-danger)}.sd[data-v-08ed3275]{display:grid;grid-template-columns:148px 1fr;grid-template-areas:"tabs region";min-height:0;height:100%;user-select:none}.sd[data-v-08ed3275] :is(input,textarea,[contenteditable=true]){user-select:text}.settings-region[data-v-08ed3275]{display:flex;min-width:0;min-height:0;flex-direction:column;grid-area:region}.settings-region-header[data-v-08ed3275],.settings-tabs-header[data-v-08ed3275]{display:flex;align-items:center;height:calc(var(--space-4) + var(--icon-button-sm) + var(--space-2));box-sizing:border-box}.settings-region-header[data-v-08ed3275]{justify-content:flex-end;padding-right:var(--space-5)}.settings-tabs-header[data-v-08ed3275]{padding-inline:var(--space-3)}.settings-dialog-title[data-v-08ed3275]{margin:0;font-family:var(--font-ui);font-size:var(--text-lg);font-weight:var(--weight-medium);line-height:var(--leading-tight);color:var(--color-text)}.settings-tabs[data-v-08ed3275]{display:flex;flex-direction:column;width:148px;padding:0 var(--space-2) var(--space-2);gap:2px;overflow-y:auto;border-right:.5px solid var(--color-line);grid-area:tabs}.settings-tab-list[data-v-08ed3275]{display:flex;flex-direction:column;gap:2px}.tab[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-2);text-align:left;padding:8px 10px;border:none;border-radius:var(--radius-md);background:transparent;color:var(--color-text-muted);font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-ui-strong);cursor:pointer;transition:background var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out)}.tab[data-v-08ed3275]:hover{background:var(--color-hover);color:var(--color-text-strong)}.tab.on[data-v-08ed3275]{background:var(--color-hover);color:var(--color-text)}.tab[data-v-08ed3275]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.body[data-v-08ed3275]{display:flex;flex-direction:column;overflow-y:auto;padding:var(--space-2) 32px var(--space-5);flex:1;min-width:0}.body[data-v-08ed3275]::-webkit-scrollbar{width:4px}.body[data-v-08ed3275]::-webkit-scrollbar-track{background:transparent}.body[data-v-08ed3275]::-webkit-scrollbar-thumb{background:transparent;border-radius:var(--radius-full);transition:background var(--duration-base) var(--ease-out)}.body.scrolling[data-v-08ed3275]::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--color-text) 12%,transparent)}.body.scrolling[data-v-08ed3275]::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}.panel[data-v-08ed3275]{display:block}.sec[data-v-08ed3275]{padding:var(--space-4) 0}.panel>.sec[data-v-08ed3275]:first-child{padding-top:0}.sec-head[data-v-08ed3275]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-3)}.sec-title[data-v-08ed3275]{margin:0 0 var(--space-3);font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);letter-spacing:0;color:var(--color-text)}.notification-settings[data-v-08ed3275]{user-select:none}.sec-head .sec-title[data-v-08ed3275]{margin-bottom:0}.row[data-v-08ed3275]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);min-height:38px;padding:var(--space-1) 0}.settings-group[data-v-08ed3275]{overflow:hidden;border-radius:var(--radius-xl);background:var(--color-surface)}.settings-group>.row[data-v-08ed3275]{min-height:52px;padding:var(--space-4);border-top:.5px solid var(--color-line)}.settings-group>.row[data-v-08ed3275]:first-child{border-top:none}.settings-group>.empty-config[data-v-08ed3275]{padding:var(--space-3)}.account-row[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4)}.account-avatar[data-v-08ed3275]{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:none;border-radius:50%;background:var(--color-surface-sunken);color:var(--color-text-muted)}.account-avatar img[data-v-08ed3275]{width:100%;height:100%;border-radius:50%;object-fit:cover}.account-name-row[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-2);min-width:0}.account-level[data-v-08ed3275]{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis}.account-meta[data-v-08ed3275]{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px}.account-name[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-sub[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rlabel[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text);font-weight:var(--weight-option-label);display:flex;flex-direction:column;gap:0}.rvalue[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-xs);color:var(--color-text-muted);max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rvalue.mono[data-v-08ed3275]{font-family:var(--font-mono);font-size:var(--text-xs)}.rvalue-wrap[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-1);max-width:60%;min-width:0}.rvalue-wrap .rvalue[data-v-08ed3275]{max-width:none}.sd-check[data-v-08ed3275]{color:var(--color-success)}.hint[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-text-faint)}.body[data-v-08ed3275] .ui-seg,.body[data-v-08ed3275] .ui-select__trigger,.body[data-v-08ed3275] .ui-button,.archive-search[data-v-08ed3275]{border-width:.5px}.select-wrap[data-v-08ed3275]{min-width:220px;max-width:min(320px,50vw);flex:none}.empty-config[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text-muted);padding:var(--space-1) 0}@media(max-width:640px){.sd[data-v-08ed3275]{grid-template-columns:1fr;grid-template-rows:auto 1fr;grid-template-areas:"tabs" "region"}.settings-tabs[data-v-08ed3275]{width:auto;padding:0;overflow-x:visible;border-right:none;border-bottom:.5px solid var(--color-line)}.settings-tabs-header[data-v-08ed3275]{padding:var(--space-3)}.settings-tab-list[data-v-08ed3275]{flex-direction:row;gap:var(--space-1);overflow-x:auto;padding:0 var(--space-3) var(--space-2)}.settings-region-header[data-v-08ed3275]{padding:var(--space-3)}.body[data-v-08ed3275]{padding-inline:var(--space-3)}.tab[data-v-08ed3275]{white-space:nowrap;flex:none}.row[data-v-08ed3275]{align-items:flex-start;flex-direction:column}.settings-group[data-v-08ed3275]{margin-inline:0}.select-wrap[data-v-08ed3275]{width:100%;max-width:none}}.setting-card[data-v-08ed3275]{border-radius:var(--radius-xl);overflow:hidden;background:var(--color-surface)}.panel-head[data-v-08ed3275]{margin-bottom:var(--space-4)}.panel-title[data-v-08ed3275]{margin:0 0 var(--space-2);font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);letter-spacing:0;color:var(--color-text)}.panel-desc[data-v-08ed3275]{margin:0;font-family:var(--font-ui);font-size:var(--text-xs);line-height:var(--leading-normal);color:var(--color-text-muted);max-width:560px}.archive-toolbar[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-3);margin-bottom:var(--space-4);flex-wrap:wrap}.archive-search[data-v-08ed3275]{flex:1;min-width:200px;height:36px;display:flex;align-items:center;gap:var(--space-2);padding:0 var(--space-3);border-radius:var(--radius-md);border:.5px solid var(--color-line);color:var(--color-text-faint);font-size:var(--text-xs);background:var(--color-surface-overlay);transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out)}.archive-search[data-v-08ed3275]:focus-within{border-color:var(--color-accent);box-shadow:var(--p-focus-ring);color:var(--color-text-muted)}.archive-search svg[data-v-08ed3275]{width:15px;height:15px;flex:none}.archive-search input[data-v-08ed3275]{width:100%;border:none;outline:none;background:transparent;font:inherit;color:var(--color-text)}.archive-list[data-v-08ed3275]{display:flex;flex-direction:column;gap:var(--space-4)}.archive-card .setting-card[data-v-08ed3275]{margin-bottom:0}.archive-workspace[data-v-08ed3275]{display:flex;align-items:center;gap:var(--space-2);margin:0 2px var(--space-2);color:var(--color-text-muted);font-size:var(--text-xs);font-weight:var(--weight-medium)}.archive-workspace svg[data-v-08ed3275]{width:16px;height:16px;color:var(--color-text-faint);flex:none}.archive-workspace .path[data-v-08ed3275]{font-family:var(--font-ui);font-size:var(--text-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-workspace .count[data-v-08ed3275]{margin-left:auto;color:var(--color-text-faint);font-weight:var(--weight-medium);font-size:var(--text-xs);flex:none}.archive-row[data-v-08ed3275]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--space-3);align-items:center;padding:var(--space-3) var(--space-4);border-top:.5px solid var(--color-line)}.archive-row[data-v-08ed3275]:first-child{border-top:none}.archive-row[data-v-08ed3275]:hover{background:var(--color-hover)}.archive-meta[data-v-08ed3275]{min-width:0}.archive-name[data-v-08ed3275]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-time[data-v-08ed3275]{margin-top:2px;font-size:var(--text-xs);color:var(--color-text-faint);font-family:var(--font-ui)}.archive-draining[data-v-08ed3275]{margin-bottom:var(--space-3);padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);background:var(--color-accent-soft);color:var(--color-accent-hover);font-size:var(--text-xs)}.archive-empty[data-v-08ed3275]{padding:var(--space-6) var(--space-4);border-radius:var(--radius-xl);color:var(--color-text-faint);font-size:var(--text-xs);text-align:center;background:var(--color-surface)}@media(max-width:640px){.archive-toolbar[data-v-08ed3275]{flex-direction:column;align-items:stretch}.archive-search[data-v-08ed3275]{min-width:0}}[data-v-08ed3275] .ui-dialog{width:min(980px,96vw)}[data-v-08ed3275] .ui-dialog--fixed-height{height:min(780px,calc(var(--app-height, 100vh) - var(--space-8) * 2))}.actions[data-v-aaf2e643]{padding:0 var(--space-2) var(--space-2);border-bottom:.5px solid var(--color-line);margin-bottom:var(--space-1)}.newrow[data-v-aaf2e643]{display:flex;align-items:center;gap:var(--space-2);width:100%;min-height:44px;padding:var(--space-2);background:none;border:none;border-radius:var(--radius-md);color:var(--color-text-muted);font-family:var(--sans);font-weight:var(--weight-regular);font-size:var(--ui-font-size);cursor:pointer;text-align:left}.newrow[data-v-aaf2e643]:hover{background:var(--color-hover)}.newrow[data-v-aaf2e643]:active{background:var(--color-surface-sunken);color:var(--color-text)}.view-tabs[data-v-aaf2e643]{padding:var(--space-1) var(--space-2) var(--space-2)}.view-tabs[data-v-aaf2e643] .ui-seg{display:flex;width:100%}.view-tabs[data-v-aaf2e643] .ui-seg__item{flex:1;justify-content:center}.mlist[data-v-aaf2e643]{--m-pad: 16px;--m-gutter: 15px;--m-gap: 8px;--m-indent: calc(var(--m-pad) + var(--m-gutter) + var(--m-gap));padding-bottom:var(--space-1)}.mempty[data-v-aaf2e643]{padding:var(--space-6) var(--space-4);text-align:center;color:var(--color-text-faint);font-size:var(--ui-font-size)}.mempty.small[data-v-aaf2e643]{padding:10px 16px 12px var(--m-indent);text-align:left;font-size:var(--ui-font-size-xs)}.mgroup[data-v-aaf2e643]{padding-top:var(--space-2)}.mgh[data-v-aaf2e643]{display:flex;align-items:center;gap:var(--m-gap);min-height:44px;margin:0 var(--space-2);padding:0 calc(var(--m-pad) - var(--space-2));border-radius:var(--radius-md);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}.mgh[data-v-aaf2e643]:hover{background:var(--color-hover)}.mgh[data-v-aaf2e643]:active{background:var(--color-surface-sunken)}.mgh-folder[data-v-aaf2e643]{flex:none;color:var(--color-text-muted)}.mgh-name[data-v-aaf2e643]{flex:none;max-width:50%;font-size:var(--ui-font-size-sm);font-weight:var(--weight-medium);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mgh-path[data-v-aaf2e643]{flex:1;min-width:0;font-size:var(--text-xs);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mgh-more[data-v-aaf2e643]{margin:0 calc(-1 * var(--space-2))}.mgh-add[data-v-aaf2e643]{margin:0 calc(-1 * var(--space-2)) 0 0}.mgh-add[data-v-aaf2e643]:active,.mgh-more[data-v-aaf2e643]:active{color:var(--color-text);background:var(--color-hover)}.srow[data-v-aaf2e643]{display:flex;align-items:center;gap:var(--space-2);min-height:44px;margin:1px var(--space-2);padding:0 calc(var(--m-pad) - var(--space-2)) 0 calc(var(--m-indent) - var(--space-2));border-radius:var(--radius-md);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}.srow[data-v-aaf2e643]:hover{background:var(--color-hover)}.srow[data-v-aaf2e643]:active{background:var(--color-surface-sunken)}.srow.cur[data-v-aaf2e643]{background:var(--color-accent-soft);box-shadow:inset 0 0 0 1px var(--color-accent-bd)}.srow .t[data-v-aaf2e643]{flex:1;min-width:0;font-size:var(--ui-font-size-sm);font-weight:var(--weight-caption);line-height:var(--leading-tight);color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.srow.cur .t[data-v-aaf2e643]{color:var(--color-accent-hover)}.srow .t.run[data-v-aaf2e643]{position:relative}.srow .t.run[data-v-aaf2e643]:before{content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%);width:6px;height:6px;border-radius:var(--radius-full);background:var(--color-accent);animation:mRunPulse-aaf2e643 1.4s ease-in-out infinite}@keyframes mRunPulse-aaf2e643{0%,to{opacity:1}50%{opacity:.35}}.srow .t.aborted[data-v-aaf2e643]{position:relative}.srow .t.aborted[data-v-aaf2e643]:before{content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%);width:6px;height:6px;border-radius:var(--radius-full);background:var(--color-danger)}.srow .time[data-v-aaf2e643]{flex:none;font-size:var(--text-xs);font-variant-numeric:tabular-nums;color:var(--color-text-faint)}.att[data-v-aaf2e643]{flex:none;font-family:var(--font-mono);font-size:max(9px,calc(var(--ui-font-size) - 4px));color:var(--color-text-on-accent);background:var(--color-warning);border-radius:var(--radius-full);padding:1px 7px}.srow .kb[data-v-aaf2e643]{flex:none;margin:0 calc(-1 * var(--space-2)) 0 0}.srow .kb[data-v-aaf2e643]:active{color:var(--color-text);background:var(--color-hover)}.srow-flat[data-v-aaf2e643]{min-height:52px}.srow-main[data-v-aaf2e643]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.srow-main .t[data-v-aaf2e643]{flex:none}.srow-sub[data-v-aaf2e643]{font-size:var(--text-xs);color:var(--color-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kmenu[data-v-aaf2e643]{position:absolute;right:12px;top:44px;z-index:var(--z-dropdown);min-width:96px;overflow:hidden}.wsmenu[data-v-aaf2e643]{top:calc(100% - 4px);right:var(--m-pad);min-width:132px}.mshow-more-row[data-v-aaf2e643]{display:flex;align-items:center;padding-left:calc(var(--m-indent) - var(--space-3))}.mshow-more[data-v-aaf2e643]{display:flex;align-items:center;gap:var(--space-2);min-height:44px;padding:var(--space-1) var(--space-3);background:none;border:none;border-radius:var(--radius-md);color:var(--color-text-muted);font-size:var(--ui-font-size);cursor:pointer;text-align:left}.mshow-more[data-v-aaf2e643]:active{color:var(--color-accent-hover);background:var(--color-hover)}.mshow-more-sep[data-v-aaf2e643]{margin:0 var(--space-1);color:var(--color-text-faint);user-select:none}.group-title[data-v-f46669a7]{padding:var(--space-4) max(var(--space-4),var(--safe-right)) var(--space-2) max(var(--space-4),var(--safe-left));font-family:var(--font-ui);font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.group-title[data-v-f46669a7]:first-child{padding-top:0}.card[data-v-f46669a7]{margin:0 max(var(--space-4),var(--safe-right)) 0 max(var(--space-4),var(--safe-left));background:var(--color-surface);border-radius:var(--radius-xl);overflow:hidden}.card>.srow[data-v-f46669a7]{border-radius:0}.card>.srow+.srow[data-v-f46669a7]{border-top:.5px solid var(--color-line)}.srow[data-v-f46669a7]:disabled{opacity:.5;cursor:not-allowed}.srow[data-v-f46669a7]{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:52px;padding:var(--space-3) var(--space-4);background:none;border:none;border-radius:var(--radius-md);cursor:pointer;text-align:left;color:var(--color-text)}.srow[data-v-f46669a7]:hover:not(.read-only){background:var(--color-hover)}.srow[data-v-f46669a7]:active:not(.read-only){background:var(--color-surface-sunken)}.srow.read-only[data-v-f46669a7]{cursor:default}.srow-main[data-v-f46669a7]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.srow-label[data-v-f46669a7]{font-size:var(--text-base);color:var(--color-text)}.srow-sub[data-v-f46669a7]{font-size:var(--text-base);color:var(--color-text-faint);overflow-wrap:anywhere}.srow-val[data-v-f46669a7]{flex:none;font-family:var(--font-mono);font-size:var(--ui-font-size);font-weight:500;color:var(--color-accent-hover)}.srow-val.dim[data-v-f46669a7]{font-weight:400;color:var(--color-text-muted)}.cache-note[data-v-f46669a7]{padding:var(--space-1) max(var(--space-4),var(--safe-right)) 0 max(var(--space-4),var(--safe-left));font-size:var(--text-xs);color:var(--color-text-faint);line-height:1.4}.chev[data-v-f46669a7]{flex:none;color:var(--color-text-faint);font-size:17px;line-height:1}.toggle[data-v-f46669a7]{flex:none;width:44px;height:26px;border-radius:var(--radius-full);background:var(--color-line);position:relative;transition:background .18s}.toggle.on[data-v-f46669a7]{background:var(--color-accent)}.toggle[data-v-f46669a7]:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:var(--radius-full);box-sizing:border-box;background:var(--color-bg);border:.5px solid var(--color-line);box-shadow:var(--shadow-xs);transition:left .18s}.toggle.on[data-v-f46669a7]:after{left:21px}.srow.pref[data-v-f46669a7]{flex-wrap:wrap;cursor:default}.srow.pref .srow-main[data-v-f46669a7]{flex:1 0 100%}.srow.acct.in .srow-label[data-v-f46669a7]{color:var(--color-accent-hover);font-weight:500}.srow.acct.out .srow-label[data-v-f46669a7]{color:var(--color-danger)}.acct-avatar[data-v-f46669a7]{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:none;border-radius:50%;background:var(--color-surface-sunken);color:var(--color-text-muted)}.acct-avatar img[data-v-f46669a7]{width:100%;height:100%;border-radius:50%;object-fit:cover}.acct-name-row[data-v-f46669a7]{display:flex;align-items:center;gap:var(--space-2);min-width:0}.acct-name-row .srow-label[data-v-f46669a7]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.acct-level[data-v-f46669a7]{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis}.usage[data-v-f46669a7]{margin:var(--space-4) max(var(--space-4),var(--safe-right)) 0 max(var(--space-4),var(--safe-left))}.usage[data-v-f46669a7] .sec{margin-bottom:0}.ctx-meter[data-v-f46669a7]{flex:none;width:96px;height:5px;border-radius:var(--radius-full);background:var(--color-line);overflow:hidden}.ctx-meter i[data-v-f46669a7]{display:block;height:100%;border-radius:var(--radius-full);background:var(--color-accent)}.srow[data-v-f46669a7],.srow-sub[data-v-f46669a7],.srow-val[data-v-f46669a7],.cache-note[data-v-f46669a7]{font-family:var(--sans)}.ls-cards[data-v-f2d724d4]{display:flex;flex-direction:column;gap:var(--space-3)}.ls-card-icon[data-v-f2d724d4]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;color:var(--color-text-muted)}.ls-card-text[data-v-f2d724d4]{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--space-1)}.ls-card-title[data-v-f2d724d4]{display:flex;align-items:center;gap:var(--space-2);font-size:var(--text-lg);font-weight:var(--weight-medium);color:var(--color-text)}.ls-card-hint[data-v-f2d724d4]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal)}.ls-done-card[data-v-f2d724d4]{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4);background:var(--color-surface-raised);border:var(--p-hairline) solid var(--color-success-bd);border-radius:var(--radius-lg)}.ls-done-badge[data-v-f2d724d4]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--radius-full);background:var(--color-success-soft);color:var(--color-success);flex:none}.ls-flow[data-v-f2d724d4]{display:flex;flex-direction:column;gap:var(--space-4)}.ls-center[data-v-f2d724d4]{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);padding:var(--space-6) 0 var(--space-2);text-align:center}.ls-center-text[data-v-f2d724d4]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.ls-success-text[data-v-f2d724d4]{color:var(--color-success)}.ls-err-text[data-v-f2d724d4]{color:var(--color-danger)}.ls-warn-text[data-v-f2d724d4]{color:var(--color-warning)}.ls-center-hint[data-v-f2d724d4]{font-size:var(--text-sm);color:var(--color-text-muted)}.ls-device[data-v-f2d724d4]{display:flex;flex-direction:column;gap:var(--space-4)}.ls-hero[data-v-f2d724d4]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);text-align:center}.ls-hero-icon[data-v-f2d724d4]{display:inline-flex;margin-bottom:var(--space-1)}.ls-hero-title[data-v-f2d724d4]{font-size:var(--text-lg);font-weight:var(--weight-medium);color:var(--color-text)}.ls-hero-hint[data-v-f2d724d4]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal);font-variant-numeric:tabular-nums}.ls-manual[data-v-f2d724d4]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2)}.ls-manual-label[data-v-f2d724d4]{font-size:var(--text-xs);color:var(--color-text-faint)}.ls-copy-text[data-v-f2d724d4]{margin-left:var(--space-2)}.ls-copy-text.is-copied[data-v-f2d724d4]{color:var(--color-success);text-decoration:none}.ls-or[data-v-f2d724d4]{display:flex;align-items:center;gap:var(--space-3);color:var(--color-text-muted);font-size:var(--text-xs);letter-spacing:.06em}.ls-or[data-v-f2d724d4]:before,.ls-or[data-v-f2d724d4]:after{content:"";flex:1;height:1px;background:var(--color-line)}.ls-fb-text[data-v-f2d724d4]{font-size:var(--text-sm);color:var(--color-text-muted);line-height:var(--leading-normal)}.ls-fb-link[data-v-f2d724d4]{color:var(--color-accent);text-decoration:none;border-bottom:var(--p-hairline) solid var(--color-accent-bd)}.ls-fb-link[data-v-f2d724d4]:hover{border-bottom-color:var(--color-accent)}.ls-code-row[data-v-f2d724d4]{display:flex;align-items:center;gap:var(--space-3);background:var(--color-surface-sunken);border:var(--p-hairline) solid var(--color-line);border-radius:var(--radius-md);padding:var(--space-2) var(--space-3)}.ls-code[data-v-f2d724d4]{flex:1;font-family:var(--font-mono);font-size:var(--text-xl);font-weight:var(--weight-medium);color:var(--color-text);letter-spacing:.14em}.ls-copy.is-copied[data-v-f2d724d4]{color:var(--color-success);border-color:var(--color-success-bd)}.ls-actions[data-v-f2d724d4]{display:flex;justify-content:flex-end;gap:var(--space-3)}@media(max-width:640px){.ls-code-row[data-v-f2d724d4],.ls-actions[data-v-f2d724d4]{flex-wrap:wrap}.ls-code[data-v-f2d724d4]{min-width:0;overflow-wrap:anywhere;letter-spacing:.08em}}.wizard[data-v-555fb599]{position:fixed;inset:0;z-index:var(--z-modal);display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);overflow-y:auto;font-family:var(--font-ui)}.wiz-body[data-v-555fb599]{flex:1;display:flex;flex-direction:column;align-items:center;width:min(560px,100%);margin:0 auto;padding:max(var(--space-8),12vh) var(--space-5) var(--space-6)}.wiz-step[data-v-555fb599]{display:flex;flex-direction:column;align-items:center;width:100%;flex:1;min-height:0}.wiz-step-fill[data-v-555fb599]{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;width:100%}.wiz-title[data-v-555fb599]{margin:var(--space-4) 0 0;font-size:var(--text-2xl);font-weight:var(--weight-semibold);line-height:var(--leading-tight);color:var(--color-text);text-align:center}.wiz-sub[data-v-555fb599]{margin:var(--space-2) 0 var(--space-6);font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted);text-align:center;max-width:460px}.pref-group[data-v-555fb599]{width:100%;margin-bottom:var(--space-5)}.pref-label[data-v-555fb599]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted);margin-bottom:var(--space-2)}.opt-card[data-v-555fb599]{display:flex;align-items:center;background:var(--color-surface-raised);border:.5px solid var(--color-line);border-radius:var(--radius-lg);font-family:var(--font-ui);cursor:pointer;transition:border-color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out)}.opt-card[data-v-555fb599]:hover{border-color:var(--color-line-strong)}.opt-card[data-v-555fb599]:focus-visible{outline:none;box-shadow:var(--p-focus-ring-strong)}.opt-card.selected[data-v-555fb599]{border-color:var(--color-accent);background:var(--color-accent-soft)}.opt-label[data-v-555fb599]{font-size:var(--text-base);font-weight:var(--weight-medium);color:var(--color-text)}.lang-cards[data-v-555fb599]{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--space-3);width:100%}.lang-card[data-v-555fb599]{gap:var(--space-3);padding:var(--space-4)}.opt-radio[data-v-555fb599]{width:18px;height:18px;border-radius:var(--radius-full);border:.5px solid var(--color-line-strong);background:var(--color-surface-raised);flex:none;display:inline-flex;align-items:center;justify-content:center;transition:border-color var(--duration-fast) var(--ease-out)}.opt-radio[data-v-555fb599]:after{content:"";width:8px;height:8px;border-radius:var(--radius-full);background:transparent;transition:background var(--duration-fast) var(--ease-out)}.opt-radio.on[data-v-555fb599]{border-color:var(--color-accent)}.opt-radio.on[data-v-555fb599]:after{background:var(--color-accent)}.theme-cards[data-v-555fb599]{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-3);width:100%}.theme-card[data-v-555fb599]{flex-direction:column;gap:var(--space-3);padding:var(--space-3)}.tp[data-v-555fb599]{display:flex;width:100%;aspect-ratio:16 / 10;border:.5px solid var(--color-line);border-radius:var(--radius-md);overflow:hidden}.tp-light[data-v-555fb599]{background:#fff}.tp-dark[data-v-555fb599]{background:#0d1117}.tp-half[data-v-555fb599]{flex:1;display:flex;min-width:0}.tp-half-light[data-v-555fb599]{background:#fff}.tp-half-dark[data-v-555fb599]{background:#0d1117}.tp-side[data-v-555fb599]{width:30%;flex:none}.tp-light .tp-side[data-v-555fb599],.tp-half-light .tp-side[data-v-555fb599]{background:#0000000d}.tp-dark .tp-side[data-v-555fb599],.tp-half-dark .tp-side[data-v-555fb599]{background:#ffffff12}.tp-lines[data-v-555fb599]{flex:1;display:flex;flex-direction:column;gap:6px;padding:14% 12%}.tp-lines span[data-v-555fb599]{height:6px;border-radius:var(--radius-full)}.tp-lines span[data-v-555fb599]:nth-child(1){width:62%}.tp-lines span[data-v-555fb599]:nth-child(2){width:88%}.tp-lines span[data-v-555fb599]:nth-child(3){width:44%}.tp-light .tp-lines span[data-v-555fb599],.tp-half-light .tp-lines span[data-v-555fb599]{background:#00000024}.tp-dark .tp-lines span[data-v-555fb599],.tp-half-dark .tp-lines span[data-v-555fb599]{background:#ffffff38}.wiz-foot[data-v-555fb599]{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);width:100%;margin-top:auto;padding:var(--space-8) 0 max(var(--space-8),8vh)}.wiz-foot-ghost[data-v-555fb599]{display:flex;gap:var(--space-3);min-height:32px;align-items:center}.wiz-foot-ghost[data-v-555fb599] .ui-button--ghost:not(:disabled):hover{background:transparent;color:var(--color-text)}.wiz-primary[data-v-555fb599]{min-width:140px}@media(max-width:640px){.theme-cards[data-v-555fb599]{gap:var(--space-2)}}.kap-root[data-v-2b13888e]{height:100vh;display:flex;flex-direction:column;background:var(--bg);font-family:var(--mono);font-size:calc(var(--ui-font-size) - 2.5px);color:var(--color-text)}.kap-head[data-v-2b13888e]{flex:none;display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:.5px solid var(--line);background:var(--panel)}.kap-count[data-v-2b13888e]{color:var(--muted)}.kap-head-actions[data-v-2b13888e]{margin-left:auto;display:flex;gap:6px}.kap-head-actions button[data-v-2b13888e],.kap-view-toggle button[data-v-2b13888e]{padding:3px 8px;border:.5px solid var(--line);border-radius:6px;background:var(--bg);color:var(--muted);font:inherit;cursor:pointer}.kap-head-actions button[data-v-2b13888e]:hover,.kap-view-toggle button[data-v-2b13888e]:hover{color:var(--color-text)}.kap-head-actions button.on[data-v-2b13888e],.kap-view-toggle button.on[data-v-2b13888e]{color:var(--color-accent-hover);border-color:var(--color-accent-bd);background:var(--color-accent-soft)}.kap-filters[data-v-2b13888e]{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:7px 10px;border-bottom:.5px solid var(--line)}.kap-filters select[data-v-2b13888e],.kap-filters input[type=text][data-v-2b13888e]{padding:3px 6px;border:.5px solid var(--line);border-radius:6px;background:var(--bg);color:var(--color-text);font:inherit;min-width:0}.kap-filters input[type=text][data-v-2b13888e]{flex:1;min-width:120px}.kap-check[data-v-2b13888e]{display:inline-flex;align-items:center;gap:4px;color:var(--muted);white-space:nowrap}.kap-view-toggle[data-v-2b13888e]{display:flex;gap:0}.kap-view-toggle button[data-v-2b13888e]:first-child{border-radius:6px 0 0 6px;border-right:none}.kap-view-toggle button[data-v-2b13888e]:last-child{border-radius:0 6px 6px 0}.kap-list[data-v-2b13888e]{flex:1;min-height:0;overflow-y:auto}.kap-empty[data-v-2b13888e]{padding:18px 12px;color:var(--muted);text-align:center}.kap-row[data-v-2b13888e]{display:flex;align-items:baseline;gap:7px;width:100%;padding:3px 10px;border:none;border-bottom:.5px solid var(--line);background:transparent;color:var(--color-text);font:inherit;text-align:left;cursor:pointer}.kap-row[data-v-2b13888e]:hover{background:var(--panel2)}.kap-row.expanded[data-v-2b13888e]{background:var(--color-accent-soft)}.kap-ts[data-v-2b13888e]{flex:none;color:var(--muted)}.kap-badge[data-v-2b13888e]{flex:none;padding:0 5px;border-radius:var(--radius-sm);font-size:max(9px,calc(var(--ui-font-size) - 4.5px));font-weight:500;line-height:1.7}.b-rest[data-v-2b13888e]{background:var(--color-accent-soft);color:var(--color-accent-hover)}.b-in[data-v-2b13888e]{background:var(--color-accent-soft);color:var(--color-success)}.b-out[data-v-2b13888e]{background:var(--color-accent-soft);color:var(--color-warning)}.b-life[data-v-2b13888e]{background:var(--panel2);color:var(--muted)}.b-err[data-v-2b13888e]{background:var(--color-warning);color:var(--bg)}.kap-label[data-v-2b13888e]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kap-detail[data-v-2b13888e]{border-bottom:.5px solid var(--line);background:var(--bg);padding:6px 10px 10px}.kap-detail-actions[data-v-2b13888e]{display:flex;justify-content:flex-end;margin-bottom:4px}.kap-detail-actions button[data-v-2b13888e]{padding:2px 8px;border:.5px solid var(--line);border-radius:6px;background:var(--panel);color:var(--muted);font:inherit;cursor:pointer}.kap-detail-actions button[data-v-2b13888e]:hover{color:var(--color-text)}.kap-detail pre[data-v-2b13888e]{margin:0;max-height:320px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-size:calc(var(--ui-font-size) - 3px);line-height:1.45}.kap-agg[data-v-2b13888e]{flex:1;min-height:0;overflow-y:auto;padding:8px 10px}.kap-agg h4[data-v-2b13888e]{margin:8px 0 4px;font-size:calc(var(--ui-font-size) - 2.5px);color:var(--muted)}.kap-agg table[data-v-2b13888e]{width:100%;border-collapse:collapse}.kap-agg th[data-v-2b13888e],.kap-agg td[data-v-2b13888e]{padding:3px 6px;border-bottom:.5px solid var(--line);text-align:left;vertical-align:top}.kap-agg th[data-v-2b13888e]{color:var(--muted);font-weight:500}.kap-agg .num[data-v-2b13888e]{text-align:right}.kap-agg .err[data-v-2b13888e]{color:var(--color-warning);font-weight:500}.kap-agg .mono[data-v-2b13888e]{word-break:break-all}.kap-fab[data-v-21de79fc]{position:fixed;right:10px;bottom:10px;z-index:var(--z-overlay);padding:5px 9px;border:.5px solid var(--line);border-radius:8px;background:var(--panel);color:var(--muted);font-family:var(--mono);font-size:calc(var(--ui-font-size) - 3px);font-weight:500;letter-spacing:.04em;cursor:pointer;opacity:.75}.kap-fab[data-v-21de79fc]:hover{opacity:1;color:var(--color-accent)}.server-auth-hint[data-v-05495fe9]{margin:0 0 var(--space-3);font-size:var(--text-base);line-height:var(--leading-normal);color:var(--color-text-muted)}.server-auth-hint code[data-v-05495fe9]{padding:1px 5px;font-family:var(--font-mono);font-size:var(--text-xs);background:var(--color-surface-sunken);border-radius:var(--radius-xs)}.internal-build-tag[data-v-439d3299]{flex:none;display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:999px;background:#f5a623;color:#3a2a00;font-size:11px;font-weight:700;letter-spacing:.01em;line-height:1.4;white-space:nowrap;user-select:none}.gload-fade-leave-active[data-v-db3fae69]{transition:opacity .28s ease}.gload-fade-leave-to[data-v-db3fae69]{opacity:0}.action-toast-enter-active[data-v-db3fae69],.action-toast-leave-active[data-v-db3fae69]{transition:opacity var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out)}.action-toast-leave-active[data-v-db3fae69]{transition-duration:var(--duration-fast);pointer-events:none}.action-toast-enter-from[data-v-db3fae69],.action-toast-leave-to[data-v-db3fae69]{opacity:0;transform:translateY(-6px)}.app-shell[data-v-db3fae69]{position:fixed;top:var(--app-top, 0px);left:0;right:0;height:100vh;height:100dvh;height:var(--app-height, 100dvh);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}.app[data-v-db3fae69]{flex:1;min-height:0;position:relative;display:grid;grid-template-columns:auto 0 minmax(0,1fr) auto;background:var(--bg);color:var(--color-text);overflow:hidden;box-sizing:border-box}.app[data-v-db3fae69]>*{min-height:0;min-width:0}.app>.side[data-v-db3fae69]{grid-column:1}.side-handle[data-v-db3fae69]{grid-column:2}.app:not(.mobile)>.con[data-v-db3fae69]{grid-column:3}.app.panel-expanded[data-v-db3fae69]{grid-template-columns:auto 0 0 minmax(0,1fr)}.app.panel-expanded>.con[data-v-db3fae69]{display:none}.sidebar-toggle-btn[data-v-db3fae69]{position:absolute;top:11px;left:16px;z-index:var(--z-sticky);animation:sidebar-toggle-btn-in-db3fae69 .18s var(--ease-out) .12s backwards;-webkit-app-region:no-drag}.app.macos-desktop .sidebar-toggle-btn[data-v-db3fae69]{left:84px;animation:none}.new-chat-btn[data-v-db3fae69]{position:absolute;top:11px;left:42px;z-index:var(--z-sticky);animation:sidebar-toggle-btn-in-db3fae69 .18s var(--ease-out) .12s backwards;-webkit-app-region:no-drag}.app.macos-desktop .new-chat-btn[data-v-db3fae69]{left:110px}@keyframes sidebar-toggle-btn-in-db3fae69{0%{opacity:0}}.internal-build-fab[data-v-db3fae69]{position:absolute;right:var(--space-3);bottom:var(--space-3);z-index:var(--z-sticky);pointer-events:none}.app.mobile[data-v-db3fae69]{grid-template-columns:1fr;grid-template-rows:auto 1fr}:root{--panel-head-h: 48px;--panel-head-inset: calc((var(--panel-head-h) - var(--icon-button-sm)) / 2)}.app.panel-expanded.sidebar-collapsed .panel-tab-bar{padding-left:var(--header-collapsed-clearance)}.app.panel-expanded.sidebar-collapsed.macos-desktop .panel-tab-bar{padding-left:var(--header-collapsed-clearance-macos)}.app.sidebar-collapsed .session-admin .sa-head{padding-left:var(--header-collapsed-clearance)}.app.sidebar-collapsed.windows-desktop .session-admin .sa-head{padding-left:var(--space-6)}.app.sidebar-collapsed.macos-desktop .session-admin .sa-head{padding-left:var(--header-collapsed-clearance-macos)}.app.fullscreen.sidebar-collapsed.macos-desktop .session-admin .sa-head{padding-left:var(--header-collapsed-clearance)}.app.macos-desktop .global-preview .ui-panel-header{-webkit-app-region:drag}.app.macos-desktop .global-preview .ui-panel-header button,.app.macos-desktop .global-preview .ui-panel-header input{-webkit-app-region:no-drag}.app.macos-desktop:has(.ch-menu,.open-in-menu,.dock-work-panel,.copy-menu-open) .chat-header,.app.macos-desktop:has(.ch-menu,.open-in-menu,.dock-work-panel,.copy-menu-open) .side .ch,.app.macos-desktop:has(.ch-menu,.open-in-menu,.dock-work-panel,.copy-menu-open) .global-preview .ui-panel-header{-webkit-app-region:no-drag}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(data:font/woff2;base64,d09GMgABAAAAAAfsABQAAAAAEAwAAAeCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhwbHhwoP0hWQVJbBmA/U1RBVIFiJyYAdC9qEQgKhGSEAAsgADCGCAE2AiQDOgQgBYlMB4EUDAcbLQ4onoexrSC/2ZyLAa8p8VHB8/x3Vue+V0hVJalMJg2nx/TCrQXxBeqLjQG7FyM1WEa/X1tEXN7cFz9EJEMmMUz3RihWSSKeQCbcIou0izz/C8v+fq3VfajEa9gDD11CImXS7qL/RJFVzC1qiB6KmKeD6TZdQ6IRGv78dL6uSVVCfgni5mzu7kcgQBgAEAQTQRCoL++STTYybkJxNfQxAAIAGu8OdEB9teW2jh4BpgDqFjAeSEByW3zFP0CBBgNMsMCGEDjgggdhiEAUAeIIED7ABTDUEnkIE9Q9ahFgKttcVhApo4ACB4qobHaccgDfEjFO6aaWUhjMLt2SyIvHKoDqoA4CSUwEIYQCEjhAO9R1G6keDeDZGjNo+AhxOjCEGTr1WeIF3kYBiLAOKvkJSMiKX0VdAyQt3SDJClCkxJCHkCzfqyVTriJZLcolS32JZHUekq2TYNkYtCtjYHMQXSxGjXDz2t/yLWXzDzxz+o3zFwDEaN23F+13pyMdQAEaSKAR9vcGq4A4MTSKCElGW+M7UcY7xqkggITb28ZJhlqc9q2twYKTt0NjixBgYvO9BIihEBLYuOFXQzfIQ7dXGUEEEgFDooBfAzqiQbpJrhiWSuKJCRFKYbHCyJKI2G5GiZbNAvgAu5pc3vwx4G+g3aDkhklABiSz0BICXrYghtYhx/cdJ+44rY2oZ0aMNRFz3VZjb6W33F3gzltqtOCV8tTHSpOeXuItfvr5lCdfzFpqtEitvqdcdGGFd28ZqqC0tPbeChGXgrIlnhSWu/eUso4uKWFLugyDzQJhflY4659+WjQ++6x72WUMv9G8mw6QJl7BVxX5fe/kpUsOvnZwee9uQ0cGXYd0o89XB2748sDSnt8d2VphdOTTgceDVvOds0v9P/s7HPq15aGun/6Vllb56f1dl0t1LejqrNkpdRZsG8TOnM5vkBG5oiVyVGnS8LHps5cfNWJs6qKPfaNSxiQNBUm3cKNWROr0GSur7Za31k1vieq7LH11VF+jXdRIasRKflc7jkobm1Z9te1IyZA0pDkhLR98+H37Zf1c/8at+dB7x+7GfVyTfJMPiYztsnl59Y5l4j+0n1RXlpHnF3Tq7HecmNF/CJodEMAikruxiyJaGLvHOdAfoA+oDvpjBm2b91cHGRZMU9n25xEU0A8fgEEAdKI3Q1iDtc034sug5YVMkE2jsE+BIkwSoQ3gxXMqz9tELp48bd0cFKOKS7xYjEuXBnZP5ia7DyiO/X/YI+PQSbt2uSdqAkWL9nQbV1XB94/+uPfdZz8dnXYFBYrcTl2SIR/ybxJNJPz/Gupb0JaZeens2ekC7EKr8t+Ls/P5VJPYJdHKyqfg2nqU6bhlidzcddQV/7MmecTzJ5VPcKXkNKSEogHjYFx6QZ7rQ+FSe8njaiNuOnXS8H2ScQ619c2mC3VTtauL0rRbXd/CkSOP37FY9Zkjz8+GibYUMOEWF+RdrFS8Ecv1SHOpPUPZGEIpjPvFyU5cXKjd6OXqorTqy9GwRd++HVufPGnVsW+aO3vggKZ18jR9sXaTC1PWTEsVUaK0FkNySbTQDqlm2PfDjZcu4aalnSLKjnOoYQ0nUlqqXcGpPu/4VgV/xU2pAqW4BW3qzhQ8/hFKhV2qE3+BKAtDqBXjfgnVdH4y0wg5tbVNRenNdTWOrenWLcupQdmsbq5b+18piTe/xRdp1xbILxNPJGInm2z6hoB21Lal0i+ePTtd7B45+3XhFJ329evskXm7qurUVREotqSluSo/L29d3qDhI4YOQqWhI4YNvBNfsMHeXKemXrxQfKeuPOGRVayA3JtkJKEgbPp+dXUDluddutRYLFoXGXWX6N3WFaGLbQtRSitVYNacTNSdy7AaG/HSaUEANcBoGXNdcZvZsOqQ1icBDv21/gzAoYPHH/WDW0qNR3QTYKEAEHig6o13NXbND06CQPlRtYjGNnSktRc09k1mAMDvAlDKfQjgy6fssInlfzmNAjKkDxoxHOBLdVRAIVt9j4qo+hA1w9T1aNBNTUOTTNUHLbqokE+UAfJXCIGw/IxCSL5GRUJeR40rL/UxTm4Q08H6MbCs70ObuNyIIXrINHQYInF06UUlevTjbQzTh5upiDMzMMogUtEnjPs/Y7jAHCJeB0GBHh04tC6FiB6ZFB1oArUSIoFoqhzCeAN6lHwm0T4C3VVPWvjpSMXReuWesMEcoqrmgtNBGd2noWeV0hNAz9rFeShNJxHGsPa3HXeKTk8b55hahySYHaYKKFFLpCfN8rsoaJn01CR04Gkc+5k7KVTCmClX8Q10HCrUEkVlSX+XO33oQR9609tJ516H497WSobWs5Up6TLaS10/dessIskgJSLiDlWvHVUywpkQ7hdPZqGyiEF0uVQerVcPamT1A3eKXdyI1vG9OoflrSXihZ1qqGE3nhmAgiIbRCQgPLEPtOM3UQwTLYaYYomNlpA44opnjV6jkD6id80OOrzf6BzmMD6eEa1zKyeYG1fzfEf16V6jw9XYOaar1/b2kP/IYX8oR2mcFvv2GtBV3JXgd437AQAA) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--dim: rgba(0, 0, 0, .6);--muted: rgba(0, 0, 0, .45);--faint: rgba(0, 0, 0, .3);--line: var(--color-line);--line2: var(--color-subtle);--canvas: #f9fbfc;--sh: 0 1px 3px rgba(28, 40, 66, .05), 0 6px 18px rgba(28, 40, 66, .06);--shc: 0 1px 2px rgba(28, 40, 66, .05);--panel: #f5f5f5;--panel2: rgba(0, 0, 0, .05);--bg: #ffffff;--blue: #1783ff;--blue2: #167ff7;--soft: #e8f3ff;--bd: rgba(23, 131, 255, .25);--logo: #1783ff;--bluebg: #e8f3ff;--blueln: rgba(23, 131, 255, .25);--ok: #0e7a38;--warn: #a9610a;--star: #eab308;--err: #c0392b;--hover: var(--color-hover);--r-xs: var(--radius-sm);--r-sm: var(--radius-md);--r-md: var(--radius-lg);--r-lg: var(--radius-xl);--ui-font-size: var(--ui-b2);--ui-font-size-sm: calc(var(--ui-font-size) - 1px);--ui-font-size-xs: calc(var(--ui-font-size) - 2px);--ui-font-size-lg: calc(var(--ui-font-size) + 1px);--ui-font-size-xl: calc(var(--ui-font-size) + 2px);--content-font-size: var(--md-b1);--code-font-size: calc(var(--content-font-size) - 2px);--mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--sans: var(--font-ui);color-scheme:light dark}html[data-color-scheme=light]{color-scheme:light}html[data-color-scheme=system]{color-scheme:light dark}html[data-color-scheme=dark]{color-scheme:dark;--dim: rgba(255, 255, 255, .56);--muted: rgba(255, 255, 255, .42);--faint: rgba(255, 255, 255, .26);--panel: #1f1f1f;--panel2: #121212;--bg: #121212;--blue: #1a88ff;--blue2: #258eff;--soft: rgba(26, 136, 255, .1);--bd: rgba(26, 136, 255, .28);--logo: #1a88ff;--bluebg: #292929;--blueln: rgba(255, 255, 255, .05);--ok: #3fb950;--warn: #d29922;--star: #facc15;--err: #f85149;--hover: var(--color-hover);--canvas: #161717;--sh: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .4);--shc: 0 1px 2px rgba(0, 0, 0, .35)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--dim: rgba(255, 255, 255, .56);--muted: rgba(255, 255, 255, .42);--faint: rgba(255, 255, 255, .26);--panel: #1f1f1f;--panel2: #121212;--bg: #121212;--blue: #1a88ff;--blue2: #258eff;--soft: rgba(26, 136, 255, .1);--bd: rgba(26, 136, 255, .28);--logo: #1a88ff;--bluebg: #292929;--blueln: rgba(255, 255, 255, .05);--ok: #3fb950;--warn: #d29922;--star: #facc15;--err: #f85149;--hover: var(--color-hover);--canvas: #161717;--sh: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .4);--shc: 0 1px 2px rgba(0, 0, 0, .35)}}:root{--color-bg: #ffffff;--color-surface: #f5f5f5;--color-surface-raised: #ffffff;--color-surface-overlay: #ffffff;--color-surface-sunken: #f5f5f5;--color-inline-code-bg: rgba(0, 0, 0, .03);--color-well: #f5f5f5;--color-surface-deep: #f5f5f5;--color-media-alpha-bg-1: color-mix(in srgb, var(--color-bg) 52%, var(--color-text) 48%);--color-media-alpha-bg-2: color-mix(in srgb, var(--color-bg) 42%, var(--color-text) 58%);--media-alpha-canvas: conic-gradient( var(--color-media-alpha-bg-1) 25%, var(--color-media-alpha-bg-2) 0 50%, var(--color-media-alpha-bg-1) 0 75%, var(--color-media-alpha-bg-2) 0 ) 0 0 / 16px 16px;--color-text: rgba(0, 0, 0, .9);--color-text-strong: #000000;--color-text-muted: rgba(0, 0, 0, .6);--color-text-faint: rgba(0, 0, 0, .45);--color-text-on-accent: #ffffff;--color-line: rgba(0, 0, 0, .13);--color-subtle: rgba(0, 0, 0, .05);--color-line-strong: rgba(0, 0, 0, .15);--color-scrim: rgba(0, 0, 0, .4);--color-scrim-strong: rgba(0, 0, 0, .6);--color-text-on-scrim: #ffffff;--color-selected: rgba(0, 0, 0, .05);--color-selected-hover: rgba(0, 0, 0, .08);--color-hover: rgba(0, 0, 0, .03);--color-sidebar-bg: #f9fbfc;--color-user-bubble-bg: #f5f5f5;--color-accent: #1783ff;--color-accent-hover: #167ff7;--color-accent-soft: #e8f3ff;--color-accent-bd: rgba(23, 131, 255, .25);--color-success: #0e7a38;--color-success-soft: #e7f6ee;--color-success-bd: #bfe3cc;--color-warning: #a9610a;--color-warning-soft: #fbf1e0;--color-warning-bd: #f0d9b8;--color-danger: #c0392b;--color-danger-soft: #fbeaea;--color-danger-bd: #f0cccc;--color-diff-add-bg: rgba(22, 196, 86, .25);--color-diff-del-bg: rgba(255, 56, 73, .25);--color-done: #8250df;--color-done-soft: #f3e8ff;--color-done-bd: #e0ccff;--color-info: #1783ff;--color-term-magenta: #8250df;--color-term-cyan: #1b7c83;--color-term-black: #24292f;--space-05: 2px;--space-1: 4px;--space-1-5: 6px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-8: 32px;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 12px;--radius-xl: 16px;--radius-2xl: 20px;--radius-composer: 32px;--corner-shape-composer: superellipse(1.5);--radius-menu-row: var(--radius-sm);--corner-shape-menu: var(--corner-shape-composer);--menu-pad: 3.5px;--radius-menu-item: calc(var(--radius-lg) - var(--menu-pad) - var(--p-hairline));--radius-select-option: calc(var(--radius-md) - var(--space-1) - var(--p-hairline));--radius-dropdown-row: calc(var(--radius-lg) - var(--space-1) - var(--p-hairline));--color-menu-bg-frost: color-mix(in srgb, var(--color-bg) 70%, transparent);--color-topbar-bg-frost: color-mix(in srgb, var(--color-surface) 78%, transparent);--p-topbar-backdrop: saturate(150%) blur(12px);--color-menu-scrollbar: color-mix(in srgb, var(--color-text) 16%, transparent);--color-menu-scrollbar-hover: color-mix(in srgb, var(--color-text) 48%, transparent);--radius-full: 999px;--radius-window: 14px;--radius-window-chip: calc(var(--radius-window) - var(--space-2));--menu-scroll-fade: var(--space-5);--panel-tab-pad-x: 10px;--panel-tab-max-w: 168px;--panel-tab-x-size: 18px;--panel-tab-h: 28px;--panel-launcher-w: 288px;--panel-default-w: 460px;--menu-item-padding-block: 5px;--menu-item-padding-inline: 9px;--menu-row-hug: var(--space-1-5);--menu-rows-seam: 1px;--menu-row-gap-icon: 7px;--menu-row-padding-block: var(--space-05);--menu-row-padding-inline: calc(var(--space-4) - var(--space-3) + var(--menu-row-hug));--menu-row-touch-padding-block: 11px;--menu-scrollbar-width: 3px;--menu-scrollbar-edge: calc(var(--menu-row-hug) + var(--p-hairline) - var(--menu-scrollbar-width));--menu-scrollbar-track-inset: calc(var(--radius-lg) - var(--space-1-5));--menu-scrollbar-thumb-min: 24px;--wm-x-size: calc(var(--p-ic-sm) + var(--space-1));--wm-x-ring: var(--space-1-5);--z-base: 0;--z-raised: 1;--z-sticky: 100;--z-dropdown: 200;--z-overlay: 300;--z-modal: 400;--z-modal-dropdown: 500;--z-toast: 600;--z-tooltip: 650;--z-max: 9999;--shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);--shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);--shadow-menu: 0 6px 18px lch(0% 0 0 / .02), 0 3px 9px lch(0% 0 0 / .04), 0 1px 1px lch(0% 0 0 / .04);--color-menu-bg: rgba(255, 255, 255, .95);--p-menu-backdrop: blur(24px) saturate(1.8);--shadow-input: 0 5px 16px -4px rgba(0, 0, 0, .07);--shadow-md: 0 4px 12px rgba(16, 24, 40, .07), 0 2px 4px rgba(16, 24, 40, .05);--shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 4px 10px rgba(16, 24, 40, .08);--shadow-xl: 0 24px 64px rgba(16, 24, 40, .18), 0 8px 20px rgba(16, 24, 40, .1);--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--duration-fast: .12s;--duration-base: .16s;--duration-slow: .26s;--duration-hover-intent: .25s;--duration-tooltip: .15s;--duration-spin: .7s;--duration-flash: 1.2s;--motion-panel-shift: 2px;--motion-panel-scale: .97;--color-composer-bg: #ffffff;--color-composer-line: rgba(0, 0, 0, .13);--color-composer-focus-line: rgba(0, 0, 0, .25);--color-send-bg: rgba(0, 0, 0, .9);--color-send-bg-hover: #252525;--color-send-icon: #ffffff;--color-stop-glyph: var(--color-danger);--color-send-bg-disabled: rgba(0, 0, 0, .05);--color-send-icon-disabled: rgba(0, 0, 0, .27);--opacity-send-disabled: 1;--shadow-send: 0 7px 16px -13px rgba(0, 0, 0, .38), 0 1px 2px rgba(0, 0, 0, .07);--shadow-send-hover: 0 8px 18px -13px rgba(0, 0, 0, .42), 0 1px 3px rgba(0, 0, 0, .09);--composer-send-icon-size: 28px;--font-ui-latin: "Schibsted Grotesk Variable", "Helvetica Neue", Arial;--font-ui: var(--font-ui-latin), "Noto Sans SC Variable", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-display: var(--font-ui);--font-kbd: "Schibsted Grotesk Variable", system-ui, sans-serif;--kbd-height: 18px;--kbd-min-width: 18px;--kbd-padding-x: 5px;--kbd-font-size: 11px;--font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--text-2xs: calc(var(--ui-c1) - 1px);--text-xs: var(--ui-c1);--text-sm: calc(var(--ui-b2) - 1px);--text-base: var(--ui-b2);--text-lg: var(--ui-t2);--text-xl: var(--ui-t1);--text-2xl: var(--ui-t0);--leading-solid: 1;--leading-tight: 1.25;--leading-caption: 1.4;--leading-normal: 1.5;--leading-prose: 1.6;--leading-relaxed: 1.7;--weight-regular: 400;--weight-caption: 450;--weight-option-label: 475;--weight-medium: 500;--weight-ui-strong: 525;--weight-section-label: 600;--weight-semibold: 700;--ui-shift: calc(var(--base-font, 14px) - 14px);--md-shift: var(--ui-shift);--ui-t0: min(calc(20px + var(--ui-shift)), 24px);--ui-t1: min(calc(18px + var(--ui-shift)), 22px);--ui-t2: calc(16px + var(--ui-shift));--ui-b1: calc(15px + var(--ui-shift));--ui-b2: calc(14px + var(--ui-shift));--ui-c1: calc(12px + var(--ui-shift));--ui-c2: calc(10px + var(--ui-shift));--md-h1: calc(22px + var(--md-shift));--md-h2: calc(20px + var(--md-shift));--md-h3: calc(18px + var(--md-shift));--md-b1: calc(14px + var(--md-shift));--md-b2: calc(13px + var(--md-shift));--md-b3: calc(13px + var(--md-shift));--p-focus-ring-w: 3px;--p-focus-ring: 0 0 0 var(--p-focus-ring-w) var(--color-accent-soft);--p-focus-ring-strong: 0 0 0 var(--p-focus-ring-w) var(--color-accent-soft), 0 0 0 1px var(--color-accent);--p-selection: rgba(23, 131, 255, .2);--color-code-selection: rgba(23, 131, 255, .346);--color-code-selection-text: currentColor;--code-pad-block: calc(var(--text-sm) * (var(--leading-normal) - 1) / 2);--diff-sign-col: 14px;--p-ic-sm: 14px;--p-ic-md: 16px;--p-ring-stroke: 1.5px;--p-ic-lg: 20px;--p-empty-ico: 28px;--p-hairline: .5px;--p-findring-w: 2px;--p-pill-excerpt-max: 24em;--p-tip-quote-lines: 8.5lh;--p-tip-comment-lines: 4.5lh;--p-scroll-seam-h: 18px;--p-sidebar-seam-h: 13px;--icon-button-sm: 26px;--touch-target-min: 44px;--resize-handle-step: 16px;--resize-handle-step-lg: 48px;--p-chip-num: 20px;--p-sidebar-w: 264px;--p-content-max: 760px;--p-content-wide: 920px;--p-table-max: 1040px;--p-table-cell-max: 700px;--p-findbar-w: 340px;--p-bubble-max: 78%;--p-dock-panel-h: 320px;--p-subagent-card-min: 180px;--p-slash-menu-h: 228px;--p-mention-menu-h: 296px;--p-mention-tip-w: 320px;--p-mention-tip-media-w: 300px;--p-mention-tip-media-h: 220px;--p-mention-tip-media-min-w: 190px;--p-mention-tip-media-preview-min-h: 64px;--p-mention-tip-media-check: 12px;--p-mention-tip-media-ring: 12px;--p-mention-tip-media-spin: 10px;--p-mention-tip-media-check-bg: linear-gradient(45deg, color-mix(in srgb, var(--color-bg) 7%, transparent) 25%, transparent 25%), linear-gradient(-45deg, color-mix(in srgb, var(--color-bg) 7%, transparent) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--color-bg) 7%, transparent) 75%), linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--color-bg) 7%, transparent) 75%);--p-selection-bubble-w: 280px;--p-tip-max-w: 280px;--p-mention-tip-vmargin: var(--space-3);--p-mention-tip-spinner-lift: -.1em;--opacity-stale: .55;--p-add-menu-h: var(--p-slash-menu-h);--p-bp-sm: 640px;--p-bp-md: 980px}:root,html[data-font-scale=medium]{--base-font: 14px}html[data-font-scale=small]{--base-font: 12px}html[data-font-scale=large]{--base-font: 16px}html[data-font-scale=xlarge]{--base-font: 18px}.text-ui-t0{font-size:var(--ui-t0);line-height:round(calc(var(--ui-t0) * 1.4),1px)}.text-ui-t1{font-size:var(--ui-t1);line-height:round(calc(var(--ui-t1) * 1.44),1px)}.text-ui-t2{font-size:var(--ui-t2);line-height:round(calc(var(--ui-t2) * 1.5),1px)}.text-ui-b1{font-size:var(--ui-b1);line-height:round(calc(var(--ui-b1) * 1.47),1px)}.text-ui-b2{font-size:var(--ui-b2);line-height:round(calc(var(--ui-b2) * 1.42),1px)}.text-ui-c1{font-size:var(--ui-c1);line-height:round(calc(var(--ui-c1) * 1.5),1px)}.text-ui-c2{font-size:var(--ui-c2);line-height:round(calc(var(--ui-c2) * 1.4),1px)}.text-md-h1{font-size:var(--md-h1);line-height:round(calc(var(--md-h1) * 1.63),1px)}.text-md-h2{font-size:var(--md-h2);line-height:round(calc(var(--md-h2) * 1.6),1px)}.text-md-h3{font-size:var(--md-h3);line-height:round(calc(var(--md-h3) * 1.56),1px)}.text-md-b1{font-size:var(--md-b1);line-height:round(calc(var(--md-b1) * 1.625),1px)}.text-md-b2{font-size:var(--md-b2);line-height:round(calc(var(--md-b2) * 1.6),1px)}.text-md-b3{font-size:var(--md-b3);line-height:round(calc(var(--md-b3) * 1.57),1px)}html[data-color-scheme=dark]{--color-bg: #121212;--color-surface: #1f1f1f;--color-surface-raised: #292929;--color-surface-overlay: rgba(255, 255, 255, .1);--color-surface-sunken: #121212;--color-inline-code-bg: rgba(255, 255, 255, .1);--color-well: #1f1f1f;--color-surface-deep: #0d0d0d;--color-text: rgba(255, 255, 255, .84);--color-text-strong: #ffffff;--color-text-muted: rgba(255, 255, 255, .56);--color-text-faint: rgba(255, 255, 255, .42);--color-line: rgba(255, 255, 255, .12);--color-subtle: rgba(255, 255, 255, .05);--color-line-strong: rgba(255, 255, 255, .18);--color-scrim: rgba(0, 0, 0, .6);--color-scrim-strong: rgba(0, 0, 0, .75);--color-selected: rgba(255, 255, 255, .1);--color-selected-hover: rgba(255, 255, 255, .14);--color-hover: rgba(255, 255, 255, .05);--color-sidebar-bg: #0d0d0d;--color-user-bubble-bg: #292929;--color-accent: #1a88ff;--color-accent-hover: #258eff;--color-accent-soft: rgba(26, 136, 255, .1);--color-accent-bd: rgba(26, 136, 255, .28);--p-selection: rgba(26, 136, 255, .2);--color-code-selection: rgba(26, 136, 255, .27);--color-code-selection-text: currentColor;--color-success: #3fb950;--color-success-soft: rgba(63, 185, 80, .14);--color-success-bd: rgba(63, 185, 80, .28);--color-warning: #d29922;--color-warning-soft: rgba(210, 153, 34, .14);--color-warning-bd: rgba(210, 153, 34, .28);--color-danger: #f85149;--color-danger-soft: rgba(248, 81, 73, .14);--color-danger-bd: rgba(248, 81, 73, .28);--color-diff-add-bg: rgba(63, 185, 80, .14);--color-diff-del-bg: rgba(248, 81, 73, .14);--color-done: #a371f7;--color-done-soft: rgba(163, 113, 247, .14);--color-done-bd: rgba(163, 113, 247, .28);--color-info: #1a88ff;--color-term-magenta: #d2a8ff;--color-term-cyan: #76e3ea;--color-term-black: #484f58;--color-composer-bg: #1f1f1f;--color-composer-line: rgba(255, 255, 255, .12);--color-composer-focus-line: rgba(255, 255, 255, .25);--color-send-bg: rgba(255, 255, 255, .84);--color-send-bg-hover: rgba(255, 255, 255, .848);--color-send-icon: #1f1f1f;--color-stop-glyph: color-mix(in srgb, var(--color-danger) 72%, transparent);--color-send-bg-disabled: rgba(255, 255, 255, .1);--color-send-icon-disabled: rgba(255, 255, 255, .28);--shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .18);--shadow-menu: 0 6px 18px rgba(0, 0, 0, .2), 0 3px 9px rgba(0, 0, 0, .24), 0 1px 1px rgba(0, 0, 0, .24);--color-menu-bg: rgba(41, 41, 41, .95);--shadow-input: 0 5px 16px -4px rgba(0, 0, 0, .07);--shadow-md: 0 4px 12px rgba(0, 0, 0, .3), 0 2px 4px rgba(0, 0, 0, .24);--shadow-lg: 0 12px 32px rgba(0, 0, 0, .34), 0 4px 10px rgba(0, 0, 0, .28);--shadow-xl: 0 24px 64px rgba(0, 0, 0, .42), 0 8px 20px rgba(0, 0, 0, .32)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--color-bg: #121212;--color-surface: #1f1f1f;--color-surface-raised: #292929;--color-surface-overlay: rgba(255, 255, 255, .1);--color-surface-sunken: #121212;--color-inline-code-bg: rgba(255, 255, 255, .1);--color-well: #1f1f1f;--color-surface-deep: #0d0d0d;--color-text: rgba(255, 255, 255, .84);--color-text-strong: #ffffff;--color-text-muted: rgba(255, 255, 255, .56);--color-text-faint: rgba(255, 255, 255, .42);--color-line: rgba(255, 255, 255, .12);--color-subtle: rgba(255, 255, 255, .05);--color-line-strong: rgba(255, 255, 255, .18);--color-scrim: rgba(0, 0, 0, .6);--color-scrim-strong: rgba(0, 0, 0, .75);--color-selected: rgba(255, 255, 255, .1);--color-selected-hover: rgba(255, 255, 255, .14);--color-hover: rgba(255, 255, 255, .05);--color-sidebar-bg: #0d0d0d;--color-user-bubble-bg: #292929;--color-accent: #1a88ff;--color-accent-hover: #258eff;--color-accent-soft: rgba(26, 136, 255, .1);--color-accent-bd: rgba(26, 136, 255, .28);--p-selection: rgba(26, 136, 255, .2);--color-code-selection: rgba(26, 136, 255, .27);--color-code-selection-text: currentColor;--color-success: #3fb950;--color-success-soft: rgba(63, 185, 80, .14);--color-success-bd: rgba(63, 185, 80, .28);--color-warning: #d29922;--color-warning-soft: rgba(210, 153, 34, .14);--color-warning-bd: rgba(210, 153, 34, .28);--color-danger: #f85149;--color-danger-soft: rgba(248, 81, 73, .14);--color-danger-bd: rgba(248, 81, 73, .28);--color-diff-add-bg: rgba(63, 185, 80, .14);--color-diff-del-bg: rgba(248, 81, 73, .14);--color-done: #a371f7;--color-done-soft: rgba(163, 113, 247, .14);--color-done-bd: rgba(163, 113, 247, .28);--color-term-magenta: #d2a8ff;--color-term-cyan: #76e3ea;--color-term-black: #484f58;--color-info: #1a88ff;--color-composer-bg: #1f1f1f;--color-composer-line: rgba(255, 255, 255, .12);--color-composer-focus-line: rgba(255, 255, 255, .25);--color-send-bg: rgba(255, 255, 255, .84);--color-send-bg-hover: rgba(255, 255, 255, .848);--color-send-icon: #1f1f1f;--color-stop-glyph: color-mix(in srgb, var(--color-danger) 72%, transparent);--color-send-bg-disabled: rgba(255, 255, 255, .1);--color-send-icon-disabled: rgba(255, 255, 255, .28);--shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .18);--shadow-menu: 0 6px 18px rgba(0, 0, 0, .2), 0 3px 9px rgba(0, 0, 0, .24), 0 1px 1px rgba(0, 0, 0, .24);--color-menu-bg: rgba(41, 41, 41, .95);--shadow-input: 0 5px 16px -4px rgba(0, 0, 0, .07);--shadow-md: 0 4px 12px rgba(0, 0, 0, .3), 0 2px 4px rgba(0, 0, 0, .24);--shadow-lg: 0 12px 32px rgba(0, 0, 0, .34), 0 4px 10px rgba(0, 0, 0, .28);--shadow-xl: 0 24px 64px rgba(0, 0, 0, .42), 0 8px 20px rgba(0, 0, 0, .32)}}:root{--color-sidebar-tint: rgba(255, 255, 255, .2)}html[data-color-scheme=dark]{--color-sidebar-tint: rgba(0, 0, 0, .12)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--color-sidebar-tint: rgba(0, 0, 0, .12)}}:root{--color-search-match: #ffe066;--color-search-match-current: #ffc531}html[data-color-scheme=dark]{--color-search-match: rgba(255, 197, 49, .3);--color-search-match-current: rgba(255, 197, 49, .55)}@media(prefers-color-scheme:dark){html[data-color-scheme=system]{--color-search-match: rgba(255, 197, 49, .3);--color-search-match-current: rgba(255, 197, 49, .55)}}::highlight(kimi-transcript-search){background-color:var(--color-search-match)}::highlight(kimi-transcript-search-current){background-color:var(--color-search-match-current)}.mention-pill,.attachment-pill,.quote-pill{display:inline-flex;align-items:baseline;gap:var(--space-05);color:var(--color-text-muted);font-weight:var(--weight-ui-strong);white-space:nowrap;text-decoration:none;vertical-align:baseline;padding-inline:var(--space-05);transition:color var(--duration-fast) var(--ease-out)}.mention-pill:hover,.attachment-pill:hover{color:var(--color-text)}.mention-pill:hover .mention-pill-icon,.attachment-pill:hover .attachment-pill-icon{color:inherit}.mention-pill.mention-file,.mention-pill.mention-skill,.attachment-pill[data-attachment-url]{cursor:pointer}.mention-pill.mention-file:hover,.mention-pill.mention-skill:hover,.attachment-pill[data-attachment-url]:hover{text-decoration:underline}.mention-pill:focus-visible,.attachment-pill:focus-visible,.quote-pill:focus-visible{outline:none;box-shadow:var(--p-focus-ring);border-radius:var(--radius-sm)}.ProseMirror .mention-pill,.ProseMirror .mention-pill:hover,.ProseMirror .attachment-pill,.ProseMirror .attachment-pill:hover,.ProseMirror .quote-pill,.ProseMirror .quote-pill:hover{cursor:text;text-decoration:none}a.mention-folder{cursor:default}.mention-pill.mention-skill.mention-inert,.mention-pill.mention-skill.mention-inert:hover{cursor:default;text-decoration:none}.mention-pill-name,.attachment-pill-name,.quote-pill-name{max-width:var(--p-pill-excerpt-max);min-width:0;overflow:hidden;text-overflow:ellipsis}.mention-pill-icon,.attachment-pill-icon,.quote-pill-icon{display:inline-flex;align-items:center;justify-content:center;width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--muted);align-self:center;flex-shrink:0}.mention-pill-icon svg,.attachment-pill-icon svg,.quote-pill-icon svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block;stroke:currentColor;stroke-width:var(--p-hairline)}.mention-pill.pill-in-selection,.attachment-pill.pill-in-selection,.quote-pill.pill-in-selection{background:var(--p-selection);border-radius:var(--radius-sm)}.quote-pill{color:var(--color-accent)}.quote-pill-icon{color:inherit}.quote-pill:hover{color:var(--color-accent-hover)}.quote-pill:focus-visible{box-shadow:0 0 0 1px var(--color-accent),0 0 0 var(--p-focus-ring-w) var(--color-accent-soft)}.quote-pill-comment{max-width:var(--p-pill-excerpt-max);min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--color-text-muted);font-weight:var(--weight-regular)}.quote-pill-comment:before{content:"·";color:var(--color-text-faint);margin-inline:var(--space-1-5) var(--space-1)}.composer-text .q-sep{font-size:0;white-space:normal}.mention-tip{position:fixed;z-index:var(--z-tooltip);max-width:min(var(--p-mention-tip-w),calc(100vw - 2 * var(--p-mention-tip-vmargin)));padding:var(--space-1) var(--space-2);border-radius:var(--radius-sm);background:var(--color-text);color:var(--color-bg);--p-tip-line: color-mix(in srgb, currentColor 18%, transparent);--p-tip-ink: color-mix(in srgb, currentColor 80%, transparent);--p-tip-ink-weak: color-mix(in srgb, currentColor 55%, transparent);font-family:var(--font-ui);font-size:var(--text-xs);line-height:round(calc(var(--text-xs) * 1.5),1px);overflow-wrap:anywhere;opacity:0;transition:opacity var(--duration-fast) var(--ease-out)}.mention-tip:not(.positioned){pointer-events:none}.mention-tip.positioned{opacity:1}.mention-tip:before,.mention-tip:after{content:"";position:absolute;left:0;right:0;height:var(--space-1-5)}.mention-tip:before{bottom:100%}.mention-tip:after{top:100%}.mention-tip>*{max-height:calc(100vh - 2 * var(--p-mention-tip-vmargin) - 2 * var(--space-2));overflow-y:auto}.mention-tip-caret{position:absolute;left:var(--tip-caret-x, 50%);width:12px;height:6px;background:var(--color-text);transform:translate(-50%)}.mention-tip[data-side=top]>.mention-tip-caret{top:100%;clip-path:polygon(0 0,100% 0,50% 100%)}.mention-tip[data-side=bottom]>.mention-tip-caret{bottom:100%;clip-path:polygon(50% 0,0 100%,100% 100%)}.mention-tip-path{display:flex;align-items:flex-start;gap:var(--space-2)}.mention-tip-path-text{min-width:0}.mention-tip-sep{color:color-mix(in srgb,currentColor 45%,transparent)}.mention-tip-base{font-weight:var(--weight-semibold)}.mention-tip-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2)}.mention-tip-name{font-weight:var(--weight-semibold);overflow-wrap:anywhere}.mention-tip-open,.mention-tip-copy{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:var(--space-05);border:none;border-radius:var(--radius-xs);background:transparent;color:color-mix(in srgb,currentColor 65%,transparent);cursor:pointer;transition:color var(--duration-fast) var(--ease-out),background-color var(--duration-fast) var(--ease-out)}.mention-tip-open:hover,.mention-tip-copy:hover{color:var(--color-bg);background:color-mix(in srgb,var(--color-bg) 14%,transparent)}.mention-tip-open:focus-visible,.mention-tip-copy:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.mention-tip-open svg,.mention-tip-copy svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block}.mention-tip-att-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--p-ic-sm);height:1lh;color:color-mix(in srgb,currentColor 65%,transparent)}.mention-tip-att-icon svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block}.mention-tip-att-size{color:color-mix(in srgb,currentColor 65%,transparent)}.mention-tip:has(.mention-tip-quote-card){padding:var(--space-2)}.mention-tip-quote-card{min-width:0;display:flex;flex-direction:column;gap:var(--space-1-5)}.mention-tip-quote-block{min-width:0;padding:var(--space-1) var(--space-1-5);border-radius:var(--radius-xs);background:color-mix(in srgb,currentColor 6%,transparent)}.mention-tip-quote-block-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);margin-bottom:var(--space-05)}.mention-tip-quote-block-head .mention-tip-copy{margin-right:calc(-1 * var(--space-1));opacity:0;transition:opacity var(--duration-fast) var(--ease-out),color var(--duration-fast) var(--ease-out),background-color var(--duration-fast) var(--ease-out)}.mention-tip-quote-block:hover .mention-tip-copy,.mention-tip-quote-block:focus-within .mention-tip-copy{opacity:1}@media(hover:none){.mention-tip-quote-block-head .mention-tip-copy{opacity:1}}.mention-tip-quote-block-head .mention-tip-quote-block-label{margin-bottom:0}.mention-tip-quote-block-label{margin-bottom:var(--space-05);color:var(--p-tip-ink-weak);font-size:var(--text-2xs);line-height:round(calc(var(--text-2xs) * 1.5),1px)}.mention-tip-quote-text{min-width:0;max-height:var(--p-tip-quote-lines);overflow-y:scroll;white-space:pre-wrap}.mention-tip-quote-comment{color:var(--p-tip-ink);white-space:pre-wrap;word-break:break-word;max-height:var(--p-tip-comment-lines);overflow-y:scroll}.mention-tip-quote-text,.mention-tip-quote-comment{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,currentColor 40%,transparent) transparent}.mention-tip-quote-text::-webkit-scrollbar,.mention-tip-quote-comment::-webkit-scrollbar{width:var(--space-1-5)}.mention-tip-quote-text::-webkit-scrollbar-thumb,.mention-tip-quote-comment::-webkit-scrollbar-thumb{background:color-mix(in srgb,currentColor 40%,transparent);border-radius:var(--radius-xs)}.mention-tip-quote-text::-webkit-scrollbar-track,.mention-tip-quote-comment::-webkit-scrollbar-track{background:transparent}.mention-tip-quote-source{min-width:0;color:var(--p-tip-ink-weak);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mention-tip-att-error{margin-top:var(--space-05);color:color-mix(in srgb,var(--color-danger) 70%,currentColor)}.mention-tip--media{padding:var(--space-1-5);border-radius:var(--radius-lg)}.mention-tip-media{display:flex;flex-direction:column;gap:var(--space-1-5)}.mention-tip-media-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;align-self:center;min-height:var(--p-mention-tip-media-preview-min-h);border:1px solid color-mix(in srgb,var(--color-bg) 14%,transparent);border-radius:var(--radius-sm);background-color:color-mix(in srgb,var(--color-bg) 8%,transparent);background-image:var(--p-mention-tip-media-check-bg);background-size:var(--p-mention-tip-media-check) var(--p-mention-tip-media-check);background-position:0 0,0 calc(var(--p-mention-tip-media-check) / 2),calc(var(--p-mention-tip-media-check) / 2) calc(var(--p-mention-tip-media-check) / -2),calc(var(--p-mention-tip-media-check) / -2) 0;overflow:hidden}.mention-tip-media-el{display:block;max-width:var(--p-mention-tip-media-w);max-height:var(--p-mention-tip-media-h);object-fit:contain;border-radius:var(--radius-sm)}.mention-tip-media-placeholder{display:inline-flex;align-items:center;justify-content:center;padding:var(--space-3) var(--space-3) var(--space-1);color:color-mix(in srgb,currentColor 45%,transparent)}.mention-tip-media-placeholder svg{width:var(--p-ic-lg);height:var(--p-ic-lg);display:block}.mention-tip-media-hint{padding:0 var(--space-2) var(--space-2);color:color-mix(in srgb,currentColor 60%,transparent);text-align:center}.mention-tip-media-meta{display:flex;align-items:center;gap:var(--space-1);min-width:0}.mention-tip-media-name{flex:0 1 auto;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--weight-semibold)}.mention-tip-media-error{padding:var(--space-1) var(--space-1-5);border-radius:var(--radius-sm);background:color-mix(in srgb,var(--color-bg) 8%,transparent);color:color-mix(in srgb,var(--color-danger) 70%,currentColor)}.mention-tip-media-foot{display:flex;align-items:center;gap:var(--space-2);min-width:0}.mention-tip-media-state{display:inline-flex;align-items:center;gap:var(--space-1-5);flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:color-mix(in srgb,currentColor 65%,transparent);font-weight:var(--weight-medium);padding-left:var(--space-05)}.mention-tip-media-state.is-danger{color:color-mix(in srgb,var(--color-danger) 70%,currentColor)}.mention-tip-media-ring,.mention-tip-media-ring svg{width:var(--p-mention-tip-media-ring);height:var(--p-mention-tip-media-ring);display:block;flex:none}.mention-tip-media-ring-track{stroke:color-mix(in srgb,currentColor 18%,transparent)}.mention-tip-media-ring-arc{stroke:color-mix(in srgb,currentColor 78%,transparent)}.mention-tip-media-spin{flex:none;width:var(--p-mention-tip-media-spin);height:var(--p-mention-tip-media-spin);border-radius:var(--radius-full);border:1.5px solid color-mix(in srgb,currentColor 18%,transparent);border-top-color:color-mix(in srgb,currentColor 78%,transparent);animation:mention-tip-media-rot var(--duration-slow) linear infinite}@keyframes mention-tip-media-rot{to{transform:rotate(360deg)}}.mention-tip-media-actions{display:flex;justify-content:flex-end;gap:var(--space-1-5);margin-left:auto;flex:none}.mention-tip-media-open{position:relative;display:inline-flex;align-items:center;gap:var(--space-1);padding:var(--space-05) var(--space-1-5);border:none;border-radius:var(--radius-sm);background:color-mix(in srgb,var(--color-bg) 10%,transparent);color:color-mix(in srgb,currentColor 65%,transparent);font:inherit;cursor:pointer;transition:color var(--duration-fast) var(--ease-out),background-color var(--duration-fast) var(--ease-out)}.mention-tip-media-open:hover{background:color-mix(in srgb,var(--color-bg) 18%,transparent);color:var(--color-bg)}.mention-tip-media-open:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.mention-tip-media-open svg{width:var(--p-ic-sm);height:var(--p-ic-sm);display:block;color:color-mix(in srgb,currentColor 45%,transparent);transition:color var(--duration-fast) var(--ease-out)}.mention-tip-media-open:hover svg{color:var(--color-bg)}.mention-tip-copy{margin-right:calc(var(--space-05) - var(--space-2))}.mention-tip-desc{margin-top:var(--space-05);color:color-mix(in srgb,currentColor 78%,transparent);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.mention-tip-spinner{display:inline-block;width:calc(var(--space-2) + var(--space-05));height:calc(var(--space-2) + var(--space-05));margin-left:var(--space-1);vertical-align:var(--p-mention-tip-spinner-lift);border-radius:50%;border:var(--p-ring-stroke) solid color-mix(in srgb,currentColor 30%,transparent);border-top-color:currentColor;animation:mention-tip-spin var(--duration-spin) linear infinite}@keyframes mention-tip-spin{to{transform:rotate(360deg)}}.mention-pill.mention-missing,.mention-pill.mention-missing:hover{color:color-mix(in srgb,var(--color-text-muted) 55%,transparent);text-decoration:line-through}.mention-pill.mention-missing .mention-pill-icon{color:inherit}.attachment-pill.attachment-missing,.attachment-pill.attachment-missing:hover,.attachment-pill.attachment-missing .attachment-pill-icon,.attachment-pill.attachment-missing:hover .attachment-pill-icon{color:color-mix(in srgb,var(--color-text-muted) 55%,transparent);text-decoration:line-through}.attachment-pill.attachment-error,.attachment-pill.attachment-error:hover,.attachment-pill.attachment-error .attachment-pill-icon,.attachment-pill.attachment-error:hover .attachment-pill-icon{color:var(--color-danger)}@font-face{font-family:Noto Sans SC Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/NotoSansSC_wght_-BkPpiACN.woff2) format("woff2-variations")}@font-face{font-family:Schibsted Grotesk Variable;font-style:normal;font-display:swap;font-weight:400 900;src:url(/assets/SchibstedGrotesk_wght_-DIzGrWVg.woff2) format("woff2-variations")}@font-face{font-family:Schibsted Grotesk Variable;font-style:italic;font-display:swap;font-weight:400 900;src:url(/assets/SchibstedGrotesk-Italic_wght_-DjkBGo1z.woff2) format("woff2-variations")}*,*:before,*:after{box-sizing:border-box}html{-webkit-text-size-adjust:100%;tab-size:4}body{margin:0}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit;margin:0}p,blockquote,dl,dd,figure,pre{margin:0}ol,ul,menu{list-style:none;margin:0;padding:0}a{color:inherit;text-decoration:inherit}b,strong{font-weight:var(--weight-medium)}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}button,input,optgroup,select,textarea{margin:0;padding:0;font-family:inherit;font-size:100%;line-height:inherit;color:inherit}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background:transparent;background-image:none}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block}img,video{max-width:100%;height:auto}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1}table{border-collapse:collapse;border-color:inherit;text-indent:0}hr{height:0;color:inherit;border-top-width:1px}fieldset{margin:0;padding:0}legend{padding:0}dialog{padding:0}summary{display:list-item}[hidden]{display:none}@supports (interpolate-size: allow-keywords){:root{interpolate-size:allow-keywords}}:root{--safe-top: env(safe-area-inset-top, 0px);--safe-right: env(safe-area-inset-right, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px);--safe-left: env(safe-area-inset-left, 0px);--dock-card-top-clearance: 72px;--question-card-body-min-h: 120px;--header-collapsed-clearance: 78px;--header-collapsed-clearance-macos: 146px}.kw-icon{display:inline-block;flex:none;vertical-align:-.15em}code,pre,kbd,samp,tt{font-feature-settings:"liga" 0,"calt" 0,"ss01" 0;font-variant-ligatures:none}html,body,#app{height:100%;margin:0;background:var(--bg)}#app{position:fixed;inset:0}html,body{overflow:hidden}@supports not selector(::-webkit-scrollbar){*{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--color-text) 12%,transparent) transparent}}*::-webkit-scrollbar{width:6px;height:6px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--color-text) 12%,transparent);border-radius:999px}*::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--color-text) 25%,transparent)}*::-webkit-scrollbar-corner{background:transparent}body{font-family:var(--sans);color:var(--color-text);background:var(--bg);font-size:var(--ui-font-size);font-weight:400;line-height:1.6;font-optical-sizing:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto;font-synthesis:none;text-size-adjust:100%;-webkit-hyphens:none;hyphens:none}@keyframes kimi-card-in{0%{opacity:0;transform:translateY(8px) scale(.995)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes kimi-check-in{0%{opacity:0;transform:scale(.4)}60%{opacity:1;transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.001ms!important;animation-delay:0ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}.ch-eyes{animation:kimi-eye-look 16s ease-in-out infinite}.ch-eye{transform-box:fill-box;transform-origin:center;animation:kimi-eye-blink 11s ease-in-out infinite}@keyframes kimi-eye-look{0%,42%{transform:translate(0)}47%,53%{transform:translate(2px)}58%,80%{transform:translate(0)}84%,90%{transform:translate(-2px)}95%,to{transform:translate(0)}}@keyframes kimi-eye-blink{0%,94%,to{transform:scaleY(1)}96.5%,98%{transform:scaleY(.12)}}@media(prefers-reduced-motion:reduce){.ch-eyes,.ch-eye{animation:none}}.blink-now .ch-eye{animation:kimi-eye-blink-once .24s ease-in-out}@keyframes kimi-eye-blink-once{0%,to{transform:scaleY(1)}50%{transform:scaleY(.1)}}.md .markdown-renderer img{min-width:0;min-height:0}.app{font-size:var(--ui-font-size)}.md,.md .markdown-renderer,.md .markdown-renderer p,.md .markdown-renderer li,.u-bub,.u-bub .u-text,.a-msg .msg,.ph{font-size:var(--content-font-size)}.md .markdown-renderer blockquote,.md .markdown-renderer td,.md .markdown-renderer th{font-size:var(--md-b2)}.md,.u-bub .u-text,.a-msg .msg{text-autospace:normal}.md .code-block-container pre,.md .markstream-pre,.md .code-block-container pre code,.md .diff-pre code,.md .markdown-renderer :not(pre)>code,.md .markdown-renderer .inline-code,.a-msg code{font-size:var(--md-b3)}.md .markdown-renderer :is(h1,h2,h3,h4) :not(pre)>code,.md .markdown-renderer :is(h1,h2,h3,h4) .inline-code{font-size:.9em}.queue-item,.queue-text,.ctx-num,.model-pill,.perm-pill,.mode-pill,.compact-chip,.qcard,.qtext,.qopt,.qbtn,.srow,.srow-val{font-size:var(--ui-font-size)}.qopt-desc,.srow-label{font-size:var(--ui-font-size-sm)}.code-block-header,.code-block-header *,.diff-lang,.queue-label,.qopt-key,.qstep,.srow-sub{font-size:var(--ui-font-size-xs)}@media(max-width:640px){:root{--content-font-size: calc(var(--md-b1) + 2px)}.md .markdown-renderer blockquote,.md .markdown-renderer td,.md .markdown-renderer th{font-size:calc(var(--md-b2) + 2px)}}:root{--anim-rive-spin: .4167s;--anim-leftbar: .5333s;--anim-leftbar-shrink: .2s}#bar-divider{transform-box:view-box;transform-origin:9.3px 12px;transition:transform var(--anim-leftbar-shrink) linear}svg:hover #bar-divider,button:hover #bar-divider{transform:translate(-1.5px) scaleY(.5)}#bar-arrow{transform-box:view-box;transform-origin:0 0;transform:translate(63.95833%,50.625%) scale(0)}svg:hover #bar-arrow,button:hover #bar-arrow{animation:leftbar-arrow var(--anim-leftbar) linear 1 forwards}@keyframes leftbar-arrow{0%{transform:translate(62.97083%,50.625%) scale(-.6);opacity:0}3.125%{transform:translate(62.97083%,50.625%) scale(-.6);opacity:1}15.625%{transform:translate(59.0125%,50.625%) scale(-1);opacity:1}37.5%{transform:translate(52.08333%,50.625%) scale(-1);opacity:1}to{transform:translate(52.08333%,50.625%) scale(-1);opacity:1}}#bar-arrow-expand{transform-box:view-box;transform-origin:0 0;transform:translate(52.08333%,50.625%) scale(0)}svg:hover #bar-arrow-expand,button:hover #bar-arrow-expand{animation:leftbar-arrow-expand var(--anim-leftbar) linear 1 forwards}@keyframes leftbar-arrow-expand{0%{transform:translate(37.02917%,50.625%) scale(.6);opacity:0}3.125%{transform:translate(37.02917%,50.625%) scale(.6);opacity:1}15.625%{transform:translate(40.9875%,50.625%) scale(1);opacity:1}37.5%{transform:translate(52.08333%,50.625%) scale(1);opacity:1}to{transform:translate(52.08333%,50.625%) scale(1);opacity:1}}#rbar-divider{transform-box:view-box;transform-origin:14.7px 12px;transition:transform var(--anim-leftbar-shrink) linear}svg:hover #rbar-divider,button:hover #rbar-divider{transform:translate(1.5px) scaleY(.5)}#rbar-arrow{transform-box:view-box;transform-origin:0 0;transform:translate(47.91667%,50.625%) scale(0)}svg:hover #rbar-arrow,button:hover #rbar-arrow{animation:rightbar-arrow var(--anim-leftbar) linear 1 forwards}@keyframes rightbar-arrow{0%{transform:translate(37.02917%,50.625%) scale(.6);opacity:0}3.125%{transform:translate(37.02917%,50.625%) scale(.6);opacity:1}15.625%{transform:translate(40.9875%,50.625%) scale(1);opacity:1}37.5%{transform:translate(47.91667%,50.625%) scale(1);opacity:1}to{transform:translate(47.91667%,50.625%) scale(1);opacity:1}}#rbar-arrow-expand{transform-box:view-box;transform-origin:0 0;transform:translate(47.91667%,50.625%) scale(0)}svg:hover #rbar-arrow-expand,button:hover #rbar-arrow-expand{animation:rightbar-arrow-expand var(--anim-leftbar) linear 1 forwards}@keyframes rightbar-arrow-expand{0%{transform:translate(62.97083%,50.625%) scale(-.6);opacity:0}3.125%{transform:translate(62.97083%,50.625%) scale(-.6);opacity:1}15.625%{transform:translate(59.0125%,50.625%) scale(-1);opacity:1}37.5%{transform:translate(47.91667%,50.625%) scale(-1);opacity:1}to{transform:translate(47.91667%,50.625%) scale(-1);opacity:1}}#p1{transform-box:view-box;transform-origin:0 0}svg:hover #p1,button:hover #p1{animation:nc-plus-spin var(--anim-rive-spin) linear 1 forwards}@keyframes nc-plus-spin{0%{transform:translate(11.5px,11.5px)}8%{transform:translate(11.501px,11.48px) rotate(1.1795deg) scale(1.02022)}12%{transform:translate(11.511px,11.46px) rotate(2.8374deg) scale(1.03026)}20%{transform:translate(11.562px,11.401px) rotate(8.8167deg) scale(1.05041)}24%{transform:translate(11.608px,11.361px) rotate(13.4726deg) scale(1.06017)}32%{transform:translate(11.751px,11.278px) rotate(25.9719deg) scale(1.08008)}48%{transform:translate(12.149px,11.222px) rotate(55.8418deg) scale(1.12025)}52%{transform:translate(12.235px,11.236px) rotate(62.0737deg) scale(1.12953)}60%{transform:translate(12.371px,11.276px) rotate(72.1167deg) scale(1.14954)}68%{transform:translate(12.446px,11.346px) rotate(79.3018deg) scale(1.12048)}76%{transform:translate(12.488px,11.403px) rotate(84.2633deg) scale(1.09046)}88%{transform:translate(12.509px,11.464px) rotate(88.52deg) scale(1.04535)}to{transform:translate(12.5px,11.5px) rotate(90deg)}}#af-p1{transform-box:view-box;transform-origin:18.4px 16.3px}svg:hover #af-p1,button:hover #af-p1{animation:folder-plus-spin var(--anim-rive-spin) linear 1 forwards}@keyframes folder-plus-spin{0%{transform:none}8%{transform:rotate(1.1795deg) scale(1.02022)}12%{transform:rotate(2.8374deg) scale(1.03026)}20%{transform:rotate(8.8167deg) scale(1.05041)}24%{transform:rotate(13.4726deg) scale(1.06017)}32%{transform:rotate(25.9719deg) scale(1.08008)}48%{transform:rotate(55.8418deg) scale(1.12025)}52%{transform:rotate(62.0737deg) scale(1.12953)}60%{transform:rotate(72.1167deg) scale(1.14954)}68%{transform:rotate(79.3018deg) scale(1.12048)}76%{transform:rotate(84.2633deg) scale(1.09046)}88%{transform:rotate(88.52deg) scale(1.04535)}to{transform:rotate(90deg)}} diff --git a/apps/kimi-code/dist-web/assets/index-Dq61ZbBp.js b/apps/kimi-code/dist-web/assets/index-V9jHT2Qw.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index-Dq61ZbBp.js rename to apps/kimi-code/dist-web/assets/index-V9jHT2Qw.js index 316b1b1e890..cc8c53fdbb4 100644 --- a/apps/kimi-code/dist-web/assets/index-Dq61ZbBp.js +++ b/apps/kimi-code/dist-web/assets/index-V9jHT2Qw.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BlRksujk.js","assets/index-DuIqvsra.js","assets/index-CvgiEu-R.js","assets/index-BxiMZi52.css"])))=>i.map(i=>d[i]); -import{bR as Q}from"./index-CvgiEu-R.js";var Y=class{chunks=[];cached="";dirty=!1;length=0;append(e){e&&(this.chunks.push(e),this.length+=e.length,this.dirty=!0,this.chunks.length>256&&this.compact())}clear(e=""){this.chunks=e?[e]:[],this.cached=e,this.dirty=!1,this.length=e.length}toString(){return this.dirty&&(this.cached=this.chunks.join(""),this.dirty=!1),this.cached}compact(){this.chunks=[this.chunks.join("")]}};function $(e,i){e.replaceChildren();const t=document.createElement("div");t.className="stream-diffs-shell",t.style.overflow="auto",t.style.maxHeight=typeof i=="number"?`${i}px`:i??"none";const n=document.createElement("div");return n.className="stream-diffs-surface",t.appendChild(n),e.appendChild(t),{shell:t,surface:n}}function E(e,i,t){return{name:e,contents:i,lang:t}}var Z=class{input;container;surface;instance;diff;selectedLines=null;disposed=!1;renderListeners=new Set;visualRevision=0;visualReadyPromise=Promise.resolve(!1);resolveVisualReady;constructor(e){this.input=e}async mount(e){this.disposed=!1,this.container=e,this.surface=$(e).surface,await this.render()}async update(e){this.input=e,this.surface&&await this.render(!0)}updateFile(e,i){return this.update({kind:"file",file:e,annotations:i,options:this.input.kind==="file"?this.input.options:void 0,workerManager:this.input.kind==="file"?this.input.workerManager:void 0})}updateDiff(e,i,t){return this.update({kind:"diff",oldFile:e,newFile:i,annotations:t,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updateParsedDiff(e,i){return this.update({kind:"diff",fileDiff:e,annotations:i,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updatePatch(e,i=0,t,n=0){return this.update({kind:"patch",patch:e,patchIndex:n,fileIndex:i,annotations:t,options:this.input.kind==="patch"?this.input.options:void 0,workerManager:this.input.kind==="patch"?this.input.workerManager:void 0})}updateMergeConflict(e,i){return this.update({kind:"merge-conflict",file:e,annotations:i,options:this.input.kind==="merge-conflict"?this.input.options:void 0,workerManager:this.input.kind==="merge-conflict"?this.input.workerManager:void 0})}setSelectedLines(e){this.selectedLines=e,this.instance?.setSelectedLines(e)}setAnnotations(e){this.instance&&(this.input.kind==="file"?(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)):(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)),this.emitRender())}setThemeType(e){this.input.options?this.input.options={...this.input.options,themeType:e}:this.input.options={themeType:e},this.instance?.setThemeType(e)}async setTheme(e){this.input.options?this.input.options={...this.input.options,theme:e}:this.input.options={theme:e},this.surface&&await this.render(!1)}async setOptions(e){this.input.options=e,this.surface&&await this.render(!1)}acceptReject(e,i){if(!z(this.input)||!this.diff)throw new Error("acceptReject() requires a diff view");const{diffAcceptRejectHunk:t}=this.module;return this.diff=t(this.diff,e,i),this.instance.render({fileDiff:this.diff,containerWrapper:this.surface,lineAnnotations:this.input.annotations}),this.diff}resolveConflict(e,i){if(this.input.kind!=="merge-conflict")throw new Error("resolveConflict() requires a merge-conflict view");const t=this.instance.resolveConflict(e,i);return t&&(this.input.file=t.file,this.diff=t.fileDiff),t?.file}getResolvedFile(){if(!z(this.input)||!this.diff||this.diff.isPartial)return;const e="newFile"in this.input?this.input.newFile:void 0;return{name:e?.name??this.diff.name,contents:this.diff.additionLines.join(""),lang:e?.lang??this.diff.lang}}getDiff(){return this.diff}getInput(){return this.input}getNativeInstance(){return this.instance}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}async whenVisualReady(){let e=this.visualReadyPromise;for(;;){const i=await e;if(e===this.visualReadyPromise)return i;e=this.visualReadyPromise}}dispose(){this.disposed=!0,this.invalidateVisualReady(),this.instance?.cleanUp(),this.instance=void 0,this.surface=void 0,this.container?.replaceChildren(),this.container=void 0,this.renderListeners.clear()}module;async render(e=!0){const i=this.surface;if(!i||this.disposed)return;const t=this.beginVisualRender(),n=this.module??=await Q(()=>import("./index-BlRksujk.js"),__vite__mapDeps([0,1,2,3]));if(this.disposed||i!==this.surface)return;if(this.instance?.cleanUp(),i.replaceChildren(),this.input.kind==="file"){const o=new n.File(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines),this.diff=void 0;return}if(z(this.input)){if(e||!this.diff)if(this.input.kind==="patch"){const a=n.parsePatchFiles(this.input.patch)[this.input.patchIndex??0];if(!a)throw new Error(`Patch does not contain patch index ${this.input.patchIndex??0}`);const d=a.files[this.input.fileIndex??0];if(!d)throw new Error(`Patch does not contain file index ${this.input.fileIndex??0}`);this.diff=d}else"fileDiff"in this.input?this.diff=this.input.fileDiff:this.diff=n.parseDiffFromFile(this.input.oldFile,this.input.newFile,this.input.options?.parseDiffOptions);const o=new n.FileDiff(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({fileDiff:this.diff,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines);return}const r=new n.UnresolvedFile(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);r.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=r,r.setSelectedLines(this.selectedLines),this.diff=r.fileDiff}emitRender(){for(const e of this.renderListeners)e()}beginVisualRender(){this.resolveVisualReady?.(!1);const e=++this.visualRevision;return this.visualReadyPromise=new Promise(i=>{this.resolveVisualReady=i}),e}markVisualReady(e){this.disposed||e!==this.visualRevision||(this.resolveVisualReady?.(!0),this.resolveVisualReady=void 0,this.emitRender())}invalidateVisualReady(){this.visualRevision++,this.resolveVisualReady?.(!1),this.resolveVisualReady=void 0}};function x(e){return new Z(e)}function ee(e){return!e||e.useTokenTransformer===!0||!e.onTokenClick&&!e.onTokenEnter&&!e.onTokenLeave?e:{...e,useTokenTransformer:!0}}function b(e,i){const t=ee(e),n=t?.onPostRender;return{...t,onPostRender(...r){n?.(...r),i()}}}function z(e){return e.kind==="diff"||e.kind==="patch"}var K=class{options;state="idle";stats={characters:0,lines:0,writes:0,resets:0,renderMode:"plain-text",overflowed:!1};text=new Y;pending=[];scheduled;generation=0;container;shell;surface;finalizedSurface;plainText;finalizePromise;renderListeners=new Set;finalizedRenderSubscription;constructor(e={}){this.options=e}async mount(e){if(this.state==="disposed")throw new Error("Cannot mount a disposed code stream. Create a new controller instead.");++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.setState("mounting"),this.container=e;const{shell:i,surface:t}=$(e,this.options.maxHeight);this.shell=i,this.surface=t,this.mountPlainText(t),this.stats.startedAt??=performance.now(),this.setState("streaming")}append(e){if(e){if(this.state==="finalized"||this.state==="finalizing"||this.state==="disposed")throw new Error(`Cannot append while stream is ${this.state}`);this.text.append(e),this.stats.characters=this.text.length,this.stats.lines+=ie(e)+(this.stats.lines===0?1:0),this.pending.push(e),this.scheduleFlush()}}updateSnapshot(e){const i=this.text.toString();if(e.startsWith(i)){this.append(e.slice(i.length));return}const t=this.options.nonAppendBehavior??"reset";if(t!=="ignore"){if(t==="throw")throw new Error("Snapshot violates the append-only stream contract");return this.reset(e)}}async consume(e){try{if(Symbol.asyncIterator in e)for await(const i of e)this.append(i);else{const i=e.getReader();try{for(;;){const{done:t,value:n}=await i.read();if(t)break;this.append(n)}}finally{i.releaseLock()}}}catch(i){throw this.fail(i),i}}async flush(){if(this.cancelScheduledFlush(),!this.pending.length)return;const e=this.shouldFollowViewport(),i=this.pending.join("");this.pending.length=0,this.plainText?.append(i),this.stats.writes++,this.followViewport(e),this.emitRender()}finalize(e={view:"stream"}){if(this.state==="finalized")return Promise.resolve();if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed code stream");const i=this.generation;if(this.setState("finalizing"),await this.flush(),i!==this.generation)return;if(this.stats.finalizedAt=performance.now(),!e.view||e.view==="stream"){this.setState("finalized");return}const t=this.surface;if(!t)throw new Error("Mount the stream before finalizing to a file or diff view");const n=this.options.fileName??`code.${this.options.language??"txt"}`,r=E(n,this.getText(),this.options.language);let o;if(e.view==="file"){const{annotations:c,workerManager:g,view:S,...T}=e;o=x({kind:"file",file:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...T},workerManager:g??this.options.workerManager})}else{const{annotations:c,original:g,workerManager:S,view:T,...L}=e;o=x({kind:"diff",oldFile:E(n,g,this.options.language),newFile:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...L},workerManager:S??this.options.workerManager})}const a=document.createElement("div");if(a.className="stream-diffs-finalized",await o.mount(a),i!==this.generation){o.dispose();return}const d=this.shell,p=d?.scrollTop??0,h=d?d.scrollHeight-d.scrollTop-d.clientHeight:0;t.replaceWith(a),this.surface=a,this.plainText=void 0,this.finalizedSurface=o,this.finalizedRenderSubscription=o.onDidRender(()=>this.emitRender()),d&&(this.options.autoScroll==="always"||this.options.autoScroll!=="never"&&h<=(this.options.autoScrollThresholdPx??32)?d.scrollTop=d.scrollHeight:d.scrollTop=p),this.setState("finalized"),this.emitRender()}async reset(e=""){const i=this.container;++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.finalizePromise=void 0,this.text.clear(),this.stats.resets++,this.stats.characters=0,this.stats.lines=0,this.stats.renderMode="plain-text",this.stats.overflowed=!1,this.setState("idle"),e&&this.append(e),i&&await this.mount(i)}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e===this.options.language||(this.options.language=e,!this.finalizedSurface))return;const i=this.finalizedSurface.getInput();i.kind==="file"?await this.finalizedSurface.updateFile({...i.file,lang:e},i.annotations):i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations)}getText(){return this.text.toString()}getState(){return this.state}getStats(){return{...this.stats}}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.plainText=void 0,this.container=void 0,this.surface=void 0,this.shell=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}scheduleFlush(){if(this.scheduled!=null||!this.plainText)return;const e=this.options.flushStrategy??"raf";e==="raf"&&typeof requestAnimationFrame=="function"?this.scheduled=requestAnimationFrame(()=>void this.flush()):this.scheduled=globalThis.setTimeout(()=>void this.flush(),e==="raf"?0:e.intervalMs)}cancelScheduledFlush(){this.scheduled!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.scheduled),clearTimeout(this.scheduled),this.scheduled=void 0)}shouldFollowViewport(){const e=this.shell;return!e||this.options.autoScroll==="never"?!1:this.options.autoScroll==="always"?!0:e.scrollHeight-e.scrollTop-e.clientHeight<=(this.options.autoScrollThresholdPx??32)}followViewport(e=this.shouldFollowViewport()){this.shell&&e&&(this.shell.scrollTop=this.shell.scrollHeight)}mountPlainText(e){const i=document.createElement("pre");i.className="stream-diffs-plain-text",i.dataset.streamDiffsState="streaming",i.style.margin="0",i.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",i.style.overflowWrap=this.options.wrap?"anywhere":"normal",i.textContent=this.getText(),e.replaceChildren(i),this.plainText=i}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}fail(e){this.state!=="disposed"&&(this.setState("error"),this.options.onError?.(e))}};function ie(e){let i=0;for(let t=0;t{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed diff stream");const i=this.surface;if(!i)throw new Error("Mount the diff stream before finalizing it");const t=this.generation;this.setState("finalizing");const n=x({kind:"diff",oldFile:this.asFile(this.original),newFile:this.asFile(this.modified),annotations:e,options:{...this.options,diffStyle:this.options.diffStyle??"unified"},workerManager:this.options.workerManager}),r=document.createElement("div");if(r.className="stream-diffs-finalized",await n.mount(r),t!==this.generation){n.dispose();return}const o=this.shell,a=o?.scrollTop??0;return i.replaceWith(r),this.surface=r,this.finalizedSurface=n,this.finalizedRenderSubscription=n.onDidRender(()=>this.emitRender()),o&&(o.scrollTop=a),this.setState("finalized"),this.emitRender(),n}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e!==this.options.language){if(this.options.language=e,this.finalizedSurface){const i=this.finalizedSurface.getInput();i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations);return}this.renderPre()}}getOriginal(){return this.original}getModified(){return this.modified}getState(){return this.state}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.container=void 0,this.shell=void 0,this.surface=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}renderPre(){const e=this.surface;if(!e||this.finalizedSurface)return;const i=document.createElement("div");i.className=`stream-diffs-diff-pre stream-diffs-diff-pre--${this.options.diffStyle??"unified"}`,i.dataset.streamDiffsState="streaming",i.style.minWidth="max-content",(this.options.diffStyle??"unified")==="split"?(i.style.display="grid",i.style.gridTemplateColumns="minmax(0, 1fr) minmax(0, 1fr)",i.append(this.createPre(this.original,"deletions"),this.createPre(this.modified,"additions"))):i.append(this.createPre(te(this.original,this.modified),"unified")),e.replaceChildren(i)}createPre(e,i){const t=document.createElement("pre");return t.className=`stream-diffs-diff-pre__pane stream-diffs-diff-pre__pane--${i}`,t.dataset.side=i,t.style.margin="0",t.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",t.style.overflowWrap=this.options.wrap?"anywhere":"normal",t.textContent=e,t}asFile(e){return E(this.options.fileName??`code.${this.options.language??"txt"}`,e,this.options.language)}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}};function te(e,i){const t=e.split(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CLyK-bJw.js","assets/index-DzigsE_1.js","assets/index-ChnXJINq.js","assets/index-QkzZp0Kk.css"])))=>i.map(i=>d[i]); +import{bR as Q}from"./index-ChnXJINq.js";var Y=class{chunks=[];cached="";dirty=!1;length=0;append(e){e&&(this.chunks.push(e),this.length+=e.length,this.dirty=!0,this.chunks.length>256&&this.compact())}clear(e=""){this.chunks=e?[e]:[],this.cached=e,this.dirty=!1,this.length=e.length}toString(){return this.dirty&&(this.cached=this.chunks.join(""),this.dirty=!1),this.cached}compact(){this.chunks=[this.chunks.join("")]}};function $(e,i){e.replaceChildren();const t=document.createElement("div");t.className="stream-diffs-shell",t.style.overflow="auto",t.style.maxHeight=typeof i=="number"?`${i}px`:i??"none";const n=document.createElement("div");return n.className="stream-diffs-surface",t.appendChild(n),e.appendChild(t),{shell:t,surface:n}}function E(e,i,t){return{name:e,contents:i,lang:t}}var Z=class{input;container;surface;instance;diff;selectedLines=null;disposed=!1;renderListeners=new Set;visualRevision=0;visualReadyPromise=Promise.resolve(!1);resolveVisualReady;constructor(e){this.input=e}async mount(e){this.disposed=!1,this.container=e,this.surface=$(e).surface,await this.render()}async update(e){this.input=e,this.surface&&await this.render(!0)}updateFile(e,i){return this.update({kind:"file",file:e,annotations:i,options:this.input.kind==="file"?this.input.options:void 0,workerManager:this.input.kind==="file"?this.input.workerManager:void 0})}updateDiff(e,i,t){return this.update({kind:"diff",oldFile:e,newFile:i,annotations:t,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updateParsedDiff(e,i){return this.update({kind:"diff",fileDiff:e,annotations:i,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updatePatch(e,i=0,t,n=0){return this.update({kind:"patch",patch:e,patchIndex:n,fileIndex:i,annotations:t,options:this.input.kind==="patch"?this.input.options:void 0,workerManager:this.input.kind==="patch"?this.input.workerManager:void 0})}updateMergeConflict(e,i){return this.update({kind:"merge-conflict",file:e,annotations:i,options:this.input.kind==="merge-conflict"?this.input.options:void 0,workerManager:this.input.kind==="merge-conflict"?this.input.workerManager:void 0})}setSelectedLines(e){this.selectedLines=e,this.instance?.setSelectedLines(e)}setAnnotations(e){this.instance&&(this.input.kind==="file"?(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)):(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)),this.emitRender())}setThemeType(e){this.input.options?this.input.options={...this.input.options,themeType:e}:this.input.options={themeType:e},this.instance?.setThemeType(e)}async setTheme(e){this.input.options?this.input.options={...this.input.options,theme:e}:this.input.options={theme:e},this.surface&&await this.render(!1)}async setOptions(e){this.input.options=e,this.surface&&await this.render(!1)}acceptReject(e,i){if(!z(this.input)||!this.diff)throw new Error("acceptReject() requires a diff view");const{diffAcceptRejectHunk:t}=this.module;return this.diff=t(this.diff,e,i),this.instance.render({fileDiff:this.diff,containerWrapper:this.surface,lineAnnotations:this.input.annotations}),this.diff}resolveConflict(e,i){if(this.input.kind!=="merge-conflict")throw new Error("resolveConflict() requires a merge-conflict view");const t=this.instance.resolveConflict(e,i);return t&&(this.input.file=t.file,this.diff=t.fileDiff),t?.file}getResolvedFile(){if(!z(this.input)||!this.diff||this.diff.isPartial)return;const e="newFile"in this.input?this.input.newFile:void 0;return{name:e?.name??this.diff.name,contents:this.diff.additionLines.join(""),lang:e?.lang??this.diff.lang}}getDiff(){return this.diff}getInput(){return this.input}getNativeInstance(){return this.instance}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}async whenVisualReady(){let e=this.visualReadyPromise;for(;;){const i=await e;if(e===this.visualReadyPromise)return i;e=this.visualReadyPromise}}dispose(){this.disposed=!0,this.invalidateVisualReady(),this.instance?.cleanUp(),this.instance=void 0,this.surface=void 0,this.container?.replaceChildren(),this.container=void 0,this.renderListeners.clear()}module;async render(e=!0){const i=this.surface;if(!i||this.disposed)return;const t=this.beginVisualRender(),n=this.module??=await Q(()=>import("./index-CLyK-bJw.js"),__vite__mapDeps([0,1,2,3]));if(this.disposed||i!==this.surface)return;if(this.instance?.cleanUp(),i.replaceChildren(),this.input.kind==="file"){const o=new n.File(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines),this.diff=void 0;return}if(z(this.input)){if(e||!this.diff)if(this.input.kind==="patch"){const a=n.parsePatchFiles(this.input.patch)[this.input.patchIndex??0];if(!a)throw new Error(`Patch does not contain patch index ${this.input.patchIndex??0}`);const d=a.files[this.input.fileIndex??0];if(!d)throw new Error(`Patch does not contain file index ${this.input.fileIndex??0}`);this.diff=d}else"fileDiff"in this.input?this.diff=this.input.fileDiff:this.diff=n.parseDiffFromFile(this.input.oldFile,this.input.newFile,this.input.options?.parseDiffOptions);const o=new n.FileDiff(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({fileDiff:this.diff,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines);return}const r=new n.UnresolvedFile(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);r.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=r,r.setSelectedLines(this.selectedLines),this.diff=r.fileDiff}emitRender(){for(const e of this.renderListeners)e()}beginVisualRender(){this.resolveVisualReady?.(!1);const e=++this.visualRevision;return this.visualReadyPromise=new Promise(i=>{this.resolveVisualReady=i}),e}markVisualReady(e){this.disposed||e!==this.visualRevision||(this.resolveVisualReady?.(!0),this.resolveVisualReady=void 0,this.emitRender())}invalidateVisualReady(){this.visualRevision++,this.resolveVisualReady?.(!1),this.resolveVisualReady=void 0}};function x(e){return new Z(e)}function ee(e){return!e||e.useTokenTransformer===!0||!e.onTokenClick&&!e.onTokenEnter&&!e.onTokenLeave?e:{...e,useTokenTransformer:!0}}function b(e,i){const t=ee(e),n=t?.onPostRender;return{...t,onPostRender(...r){n?.(...r),i()}}}function z(e){return e.kind==="diff"||e.kind==="patch"}var K=class{options;state="idle";stats={characters:0,lines:0,writes:0,resets:0,renderMode:"plain-text",overflowed:!1};text=new Y;pending=[];scheduled;generation=0;container;shell;surface;finalizedSurface;plainText;finalizePromise;renderListeners=new Set;finalizedRenderSubscription;constructor(e={}){this.options=e}async mount(e){if(this.state==="disposed")throw new Error("Cannot mount a disposed code stream. Create a new controller instead.");++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.setState("mounting"),this.container=e;const{shell:i,surface:t}=$(e,this.options.maxHeight);this.shell=i,this.surface=t,this.mountPlainText(t),this.stats.startedAt??=performance.now(),this.setState("streaming")}append(e){if(e){if(this.state==="finalized"||this.state==="finalizing"||this.state==="disposed")throw new Error(`Cannot append while stream is ${this.state}`);this.text.append(e),this.stats.characters=this.text.length,this.stats.lines+=ie(e)+(this.stats.lines===0?1:0),this.pending.push(e),this.scheduleFlush()}}updateSnapshot(e){const i=this.text.toString();if(e.startsWith(i)){this.append(e.slice(i.length));return}const t=this.options.nonAppendBehavior??"reset";if(t!=="ignore"){if(t==="throw")throw new Error("Snapshot violates the append-only stream contract");return this.reset(e)}}async consume(e){try{if(Symbol.asyncIterator in e)for await(const i of e)this.append(i);else{const i=e.getReader();try{for(;;){const{done:t,value:n}=await i.read();if(t)break;this.append(n)}}finally{i.releaseLock()}}}catch(i){throw this.fail(i),i}}async flush(){if(this.cancelScheduledFlush(),!this.pending.length)return;const e=this.shouldFollowViewport(),i=this.pending.join("");this.pending.length=0,this.plainText?.append(i),this.stats.writes++,this.followViewport(e),this.emitRender()}finalize(e={view:"stream"}){if(this.state==="finalized")return Promise.resolve();if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed code stream");const i=this.generation;if(this.setState("finalizing"),await this.flush(),i!==this.generation)return;if(this.stats.finalizedAt=performance.now(),!e.view||e.view==="stream"){this.setState("finalized");return}const t=this.surface;if(!t)throw new Error("Mount the stream before finalizing to a file or diff view");const n=this.options.fileName??`code.${this.options.language??"txt"}`,r=E(n,this.getText(),this.options.language);let o;if(e.view==="file"){const{annotations:c,workerManager:g,view:S,...T}=e;o=x({kind:"file",file:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...T},workerManager:g??this.options.workerManager})}else{const{annotations:c,original:g,workerManager:S,view:T,...L}=e;o=x({kind:"diff",oldFile:E(n,g,this.options.language),newFile:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...L},workerManager:S??this.options.workerManager})}const a=document.createElement("div");if(a.className="stream-diffs-finalized",await o.mount(a),i!==this.generation){o.dispose();return}const d=this.shell,p=d?.scrollTop??0,h=d?d.scrollHeight-d.scrollTop-d.clientHeight:0;t.replaceWith(a),this.surface=a,this.plainText=void 0,this.finalizedSurface=o,this.finalizedRenderSubscription=o.onDidRender(()=>this.emitRender()),d&&(this.options.autoScroll==="always"||this.options.autoScroll!=="never"&&h<=(this.options.autoScrollThresholdPx??32)?d.scrollTop=d.scrollHeight:d.scrollTop=p),this.setState("finalized"),this.emitRender()}async reset(e=""){const i=this.container;++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.finalizePromise=void 0,this.text.clear(),this.stats.resets++,this.stats.characters=0,this.stats.lines=0,this.stats.renderMode="plain-text",this.stats.overflowed=!1,this.setState("idle"),e&&this.append(e),i&&await this.mount(i)}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e===this.options.language||(this.options.language=e,!this.finalizedSurface))return;const i=this.finalizedSurface.getInput();i.kind==="file"?await this.finalizedSurface.updateFile({...i.file,lang:e},i.annotations):i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations)}getText(){return this.text.toString()}getState(){return this.state}getStats(){return{...this.stats}}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.plainText=void 0,this.container=void 0,this.surface=void 0,this.shell=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}scheduleFlush(){if(this.scheduled!=null||!this.plainText)return;const e=this.options.flushStrategy??"raf";e==="raf"&&typeof requestAnimationFrame=="function"?this.scheduled=requestAnimationFrame(()=>void this.flush()):this.scheduled=globalThis.setTimeout(()=>void this.flush(),e==="raf"?0:e.intervalMs)}cancelScheduledFlush(){this.scheduled!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.scheduled),clearTimeout(this.scheduled),this.scheduled=void 0)}shouldFollowViewport(){const e=this.shell;return!e||this.options.autoScroll==="never"?!1:this.options.autoScroll==="always"?!0:e.scrollHeight-e.scrollTop-e.clientHeight<=(this.options.autoScrollThresholdPx??32)}followViewport(e=this.shouldFollowViewport()){this.shell&&e&&(this.shell.scrollTop=this.shell.scrollHeight)}mountPlainText(e){const i=document.createElement("pre");i.className="stream-diffs-plain-text",i.dataset.streamDiffsState="streaming",i.style.margin="0",i.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",i.style.overflowWrap=this.options.wrap?"anywhere":"normal",i.textContent=this.getText(),e.replaceChildren(i),this.plainText=i}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}fail(e){this.state!=="disposed"&&(this.setState("error"),this.options.onError?.(e))}};function ie(e){let i=0;for(let t=0;t{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed diff stream");const i=this.surface;if(!i)throw new Error("Mount the diff stream before finalizing it");const t=this.generation;this.setState("finalizing");const n=x({kind:"diff",oldFile:this.asFile(this.original),newFile:this.asFile(this.modified),annotations:e,options:{...this.options,diffStyle:this.options.diffStyle??"unified"},workerManager:this.options.workerManager}),r=document.createElement("div");if(r.className="stream-diffs-finalized",await n.mount(r),t!==this.generation){n.dispose();return}const o=this.shell,a=o?.scrollTop??0;return i.replaceWith(r),this.surface=r,this.finalizedSurface=n,this.finalizedRenderSubscription=n.onDidRender(()=>this.emitRender()),o&&(o.scrollTop=a),this.setState("finalized"),this.emitRender(),n}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e!==this.options.language){if(this.options.language=e,this.finalizedSurface){const i=this.finalizedSurface.getInput();i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations);return}this.renderPre()}}getOriginal(){return this.original}getModified(){return this.modified}getState(){return this.state}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.container=void 0,this.shell=void 0,this.surface=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}renderPre(){const e=this.surface;if(!e||this.finalizedSurface)return;const i=document.createElement("div");i.className=`stream-diffs-diff-pre stream-diffs-diff-pre--${this.options.diffStyle??"unified"}`,i.dataset.streamDiffsState="streaming",i.style.minWidth="max-content",(this.options.diffStyle??"unified")==="split"?(i.style.display="grid",i.style.gridTemplateColumns="minmax(0, 1fr) minmax(0, 1fr)",i.append(this.createPre(this.original,"deletions"),this.createPre(this.modified,"additions"))):i.append(this.createPre(te(this.original,this.modified),"unified")),e.replaceChildren(i)}createPre(e,i){const t=document.createElement("pre");return t.className=`stream-diffs-diff-pre__pane stream-diffs-diff-pre__pane--${i}`,t.dataset.side=i,t.style.margin="0",t.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",t.style.overflowWrap=this.options.wrap?"anywhere":"normal",t.textContent=e,t}asFile(e){return E(this.options.fileName??`code.${this.options.language??"txt"}`,e,this.options.language)}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}};function te(e,i){const t=e.split(` `),n=i.split(` `);let r=0;for(;r` ${a}`),...t.slice(r,t.length-o).map(a=>`- ${a}`),...n.slice(r,n.length-o).map(a=>`+ ${a}`),...t.slice(t.length-o).map(a=>` ${a}`)].join(` `)}function he(e){return new G(e)}function ue(e={}){let i,t,n,r,o,a="text",d="",p="",h,c=0,g="system",S=U(e),T=q(e);const L={disableLineNumbers:e.lineNumbers===!1,overflow:e.wordWrap==="on"?"wrap":"scroll",enableLineSelection:e.enableLineSelection},M=()=>({...L,theme:S,themeType:g});async function H(s,l,u){k();const w=c;if(N(s,e),h=s,a=R(u),_(l))return V(s,l,a);if(e.stream===!1)return O(s,l,a);const f=new K({...M(),...F(e),fileName:`code.${a}`,language:a,maxHeight:e.MAX_HEIGHT,autoScroll:e.autoScrollOnUpdate===!1?"never":"near-bottom",autoScrollThresholdPx:e.autoScrollThresholdPx,workerManager:e.workerManager});if(i=f,f.append(l),await f.mount(s),w!==c||i!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>f.getText(),s,()=>f.getFinalizedSurface(),m=>f.onDidRender(m)),r}async function I(s,l,u,w){k();const f=c;N(s,e),h=s,a=R(w),d=l,p=u;let m,v;if(e.stream===!1){if(m=x({kind:"diff",oldFile:y(l),newFile:y(u),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),diffStyle:e.diffStyle??(e.renderSideBySide===!1?"unified":"split"),...F(e)}}),n=m,await m.mount(s),f!==c||n!==m||h!==s)throw m.dispose(),new Error("Editor creation was cancelled");e.onController?.(m)}else{if(v=new G({...M(),...F(e),fileName:`code.${a}`,language:a,diffStyle:e.diffStyle??(e.renderSideBySide===!1?"unified":"split"),maxHeight:e.MAX_HEIGHT,wrap:e.wordWrap==="on",workerManager:e.workerManager}),t=v,await v.mount(s,l,u),f!==c||t!==v||h!==s)throw v.dispose(),new Error("Editor creation was cancelled");e.onController?.(v)}return o=oe(()=>d,()=>p,s,()=>m??v?.getFinalizedSurface()),o}async function X(s,l=a){const u=R(l);if(_(s)){n?.getInput().kind==="merge-conflict"?(a=u,await n.updateMergeConflict(y(s),e.lineAnnotations)):h&&await V(h,s,u);return}if(e.stream===!1){n?.getInput().kind==="file"?(a=u,await n.updateFile(y(s),e.lineAnnotations)):h&&await O(h,s,u);return}if(!i){h&&await H(h,s,u);return}if(i.getState()==="finalized"){s!==i.getText()&&await i.reset(s);return}if(u!==a){a=u,await i.setLanguage(u),s!==i.getText()&&await i.reset(s);return}const w=i.getText();s.startsWith(w)?i.append(s.slice(w.length)):await i.reset(s)}async function P(s,l,u=a){if(d=s,p=l,a=R(u),t){await t.update(s,l);return}if(!n){h&&await I(h,s,l,u);return}await n.updateDiff(y(s),y(l))}function k(){c++,i?.dispose(),t?.dispose(),t||n?.dispose(),i=void 0,t=void 0,n=void 0,r=void 0,o=void 0,h=void 0}async function O(s,l,u){k();const w=c;h=s,a=u;const f=x({kind:"file",file:y(l),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),...F(e)}});if(n=f,await f.mount(s),w!==c||n!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>B(f)??l,s,()=>f,m=>f.onDidRender(m)),r}async function V(s,l,u){k();const w=c;h=s,a=u;const f=x({kind:"merge-conflict",file:y(l),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),...F(e)}});if(n=f,await f.mount(s),w!==c||n!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>B(f)??l,s,()=>f,m=>f.onDidRender(m)),r}function _(s){return e.mergeConflict===!1?!1:/^<<<<<<< .+$/m.test(s)&&/^=======$/m.test(s)&&/^>>>>>>> .+$/m.test(s)}async function J(s){if(s){if(typeof s=="string"){const l=e.themes;if(l?.[0]===s){await W(),g="dark",i?.setThemeType("dark"),t?.setThemeType("dark"),n?.setThemeType("dark");return}if(l?.[1]===s){await W(),g="light",i?.setThemeType("light"),t?.setThemeType("light"),n?.setThemeType("light");return}}T=void 0,S=s,await j(s)}}async function W(){const s=q(e);!s||s===T||(T=s,S=U(e),await j(S))}async function j(s){await i?.setTheme(s),await t?.setTheme(s),await n?.setTheme(s)}function y(s){return E(`code.${a||"txt"}`,s,a)}return{runtimeKind:"stream-diffs",createEditor:H,createDiffEditor:I,updateCode:X,appendCode(s){i?.append(s)},async finalizeCode(){if(!i||i.getState()==="finalized")return i?.getFinalizedSurface();const s=F(e);return delete s.lineAnnotations,await i.finalize({view:"file",...s,theme:S,themeType:g,annotations:e.lineAnnotations,workerManager:e.workerManager}),i.getFinalizedSurface()},async finalizeDiff(){return t&&(n=await t.finalize(e.lineAnnotations)),n},updateDiff:P,updateOriginal(s,l=a){return P(s,p,l)},updateModified(s,l=a){return P(d,s,l)},appendOriginal(s,l=a){return P(d+s,p,l)},appendModified(s,l=a){return P(d,p+s,l)},cleanupEditor:k,safeClean:k,setTheme:J,async setLanguage(s){if(a=R(s),await i?.setLanguage(a),await t?.setLanguage(a),n&&!t){const l=n.getInput();l.kind==="file"||l.kind==="merge-conflict"?await n.update({...l,file:{...l.file,lang:a}}):l.kind==="diff"&&"oldFile"in l&&await n.update({...l,oldFile:{...l.oldFile,lang:a},newFile:{...l.newFile,lang:a}})}},getCurrentTheme:()=>S,getEditor:()=>le,getEditorView:()=>r??null,getDiffEditorView:()=>o??null,getDiffModels:()=>({original:D(()=>d),modified:D(()=>n?.getResolvedFile()?.contents??t?.getModified()??p)}),getCode:()=>{const s=n?.getInput();return s?.kind==="diff"||s?.kind==="patch"?{original:d,modified:n?.getResolvedFile()?.contents??p}:s?.kind==="file"||s?.kind==="merge-conflict"?s.file.contents:t?{original:t.getOriginal(),modified:t.getModified()}:i?.getText()??null},refreshDiffPresentation:()=>n?.update(n.getInput()),whenVisualReady:async()=>{const s=h,l=c,u=n??i?.getFinalizedSurface()??t?.getFinalizedSurface();return!u||!await u.whenVisualReady()?!1:ne(s,()=>l===c&&s===h&&u===(n??i?.getFinalizedSurface()??t?.getFinalizedSurface()),()=>se(n??i?.getFinalizedSurface()??t?.getFinalizedSurface()))}}}async function ne(e,i,t){if(!e||typeof window>"u")return!1;let n="",r,o=0;for(let a=0;a<120;a+=1){if(!i())return!1;const d=e.querySelector(".stream-diffs-shell"),p=d?.querySelector("diffs-container")?.shadowRoot?.querySelector("pre"),h=d?.getBoundingClientRect(),c=p?.textContent??"";if(h&&h.width>0&&h.height>0&&p&&t()){const g=`${Math.round(h.width)}:${Math.round(h.height)}:${p.scrollWidth}:${p.scrollHeight}:${c.length}`;if(o=p===r&&g===n?o+1:1,r=p,n=g,o>=2)return!0}else n="",r=void 0,o=0;await ae()}return!1}function se(e){if(!e)return!0;const i=e.getNativeInstance(),t=i?.fileRenderer??i?.hunksRenderer;if(!t)return!0;const n=t.renderCache;if(!n?.result)return!1;if(n.highlighted===!0)return!0;const r=e.getInput();if(R(r.kind==="file"||r.kind==="merge-conflict"?r.file.lang:"oldFile"in r?r.oldFile.lang??r.newFile.lang:e.getDiff()?.lang)==="text")return!0;const o=Number(t.getTokenizeMaxLength?.()??1e5);if(r.kind==="file"||r.kind==="merge-conflict")return re(r.file.contents)>o;const a=e.getDiff();return!!a&&Math.max(a.additionLines.length,a.deletionLines.length)>o}function R(e){return!e||/^(?:text|txt|plain|plaintext)$/i.test(e)?"text":e}function re(e){if(!e)return 0;let i=1;for(let t=0;t{let i=!1;const t=()=>{i||(i=!0,window.clearTimeout(r),window.cancelAnimationFrame(n),e())},n=window.requestAnimationFrame(t),r=window.setTimeout(t,50)})}function U(e){return e.themes?.length&&typeof e.themes[0]=="string"&&typeof e.themes[1]=="string"?{dark:e.themes[0],light:e.themes[1]}:e.theme??void 0}function q(e){if(!(typeof e.themes?.[0]!="string"||typeof e.themes?.[1]!="string"))return`${e.themes[0]} diff --git a/apps/kimi-code/dist-web/assets/index10-C0TQjdWb.js b/apps/kimi-code/dist-web/assets/index10-DGuREUB3.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index10-C0TQjdWb.js rename to apps/kimi-code/dist-web/assets/index10-DGuREUB3.js index a133effd045..63bb25bb4cf 100644 --- a/apps/kimi-code/dist-web/assets/index10-C0TQjdWb.js +++ b/apps/kimi-code/dist-web/assets/index10-DGuREUB3.js @@ -1,2 +1,2 @@ -import{bQ as Re,M as Ae,b$ as qe,c0 as Ge,c1 as Je,c2 as Qe,aU as d,bl as Ke,af as We,bY as e1,bE as B,as as U,aD as n1,c3 as Ze,az as o1,aL as r,u,aY as ge,v as t,bk as s,bb as X,au as b,t as F,aw as Ce,bL as t1,bB as l1,s as a1,I as i1,bJ as r1,bO as s1,g as u1,T as c1,q as T,c4 as Ve,c5 as ie,c6 as d1,c7 as De,c8 as v1,c9 as m1,b_ as h1}from"./index-CvgiEu-R.js";var re=(R,xe,l)=>new Promise((a,J)=>{var V=c=>{try{H(l.next(c))}catch($){J($)}},Q=c=>{try{H(l.throw(c))}catch($){J($)}},H=c=>c.done?a(c.value):Promise.resolve(c.value).then(V,Q);H((l=l.apply(R,xe)).next())});const p1=["data-markstream-mode"],f1={key:0,class:"infographic-block-header flex justify-between items-center border-b"},w1={key:0},g1={key:1,class:"flex items-center gap-x-2 overflow-hidden"},C1=["innerHTML"],k1={key:2},x1={key:3,class:"infographic-mode-toggle flex items-center gap-0.5"},y1=["disabled"],b1={class:"flex items-center gap-x-1"},M1={class:"flex items-center gap-x-1"},B1={key:4},F1={key:5,class:"infographic-header-actions flex items-center"},T1=["aria-pressed"],H1={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},$1={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},j1=["disabled"],L1=["disabled"],P1={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},E1={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},z1={key:0,class:"infographic-source"},S1={class:"infographic-source-code text-sm font-mono whitespace-pre-wrap"},Z1={key:1,class:"relative"},V1={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},D1={class:"flex items-center gap-2 backdrop-blur rounded-lg"},N1={key:0,class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap"},Y1={class:"dialog-panel infographic-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},_1={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},se="infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",ke=Re(Ae({__name:"InfographicBlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal"],setup(R,{emit:xe}){const l=R,{t:a}=qe(),J=Ge(),V=Je(),Q=Qe(),H=d(!1),c=d(!1),$=d(),p=d(),k=d(!0),ye=d(!1),j=d(!1),D=d(),K=d(null),L=d(!1),S=d(!1),A=d(null),P=d(typeof window>"u"||!Q.value),Ne=Ke(),x=We(e1,null);let E="";const be=T(()=>h1(l,Ne));typeof window<"u"&&B([()=>$.value,Q],([n,e])=>{var o,i,C;if((o=A.value)==null||o.destroy(),A.value=null,!e||P.value)return void(P.value=!0);if(!n)return void(P.value=!1);const f=(C=(i=V?.value.heavyBlockMargin)!=null?i:V?.value.rootMargin)!=null?C:"160px",w=J(n,{rootMargin:f,allowIdle:!1});A.value=w,P.value=w.isVisible.value,w.whenVisible.then(()=>{P.value=!0})},{immediate:!0});const z=T(()=>l.node.code),ue=T(()=>{var n;return(function(e){if(l.maxHeight==="none")return Ve(e,void 0,null);const o=ie(l.maxHeight);return Ve(e,void 0,o)})((n=ie(l.estimatedPreviewHeightPx))!=null?n:d1(z.value))}),ce=d(`${ue.value}px`),Ye=T(()=>ie(l.estimatedPreviewHeightPx)!=null);function Me(){var n;if(!p.value||Ye.value)return;const e=p.value.scrollHeight;if(e>0){const o=(n=ie((function(i){if(l.maxHeight==="none")return`${i}px`;if(l.maxHeight!=null){const f=Number.parseFloat(String(l.maxHeight));if(Number.isFinite(f))return`${Math.min(i,f)}px`}const C=p.value;if(C){const f=getComputedStyle(C).getPropertyValue("--ms-size-code-max-height").trim(),w=Number.parseFloat(f);if(Number.isFinite(w))return`${Math.min(i,w)}px`}return`${Math.min(i,500)}px`})(e)))!=null?n:e;ce.value=`${Math.max(o,ue.value)}px`}}const M=d(1),N=d(0),Y=d(0),_=d(!1),W=d({x:0,y:0}),Be=T(()=>z.value);function Fe(n){return!n||n.disabled}function h(n,e,o="top"){if(Fe(n.currentTarget))return;const i=n,C=i?.clientX!=null&&i?.clientY!=null?{x:i.clientX,y:i.clientY}:void 0;De(n.currentTarget,e,o,!1,C,l.isDark)}function v(){v1()}function Te(n){if(Fe(n.currentTarget))return;const e=H.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=n,i=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;De(n.currentTarget,e,"top",!1,i,l.isDark)}function _e(){return re(this,null,function*(){try{const n=z.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n)),H.value=!0,setTimeout(()=>{H.value=!1},1e3)}catch(n){console.error("Failed to copy:",n)}})}function He(n){(n!=="preview"||Ze())&&(ye.value=!0,k.value=n==="source")}function Ie(){var n;const e=(n=p.value)==null?void 0:n.querySelector("svg");e?(function(o){re(this,null,function*(){try{const i=new XMLSerializer().serializeToString(o),C=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),f=URL.createObjectURL(C);if(typeof document<"u"){const w=document.createElement("a");w.href=f,w.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(w),w.click(),document.body.removeChild(w)}catch{}URL.revokeObjectURL(f)}}catch(i){console.error("Failed to export SVG:",i)}})})(e):console.error("SVG element not found")}function de(n){n.key==="Escape"&&j.value&&ve()}function ve(){if(j.value=!1,D.value&&(D.value.innerHTML=""),K.value=null,typeof document<"u")try{document.body.style.overflow=""}catch{}if(typeof window<"u")try{window.removeEventListener("keydown",de)}catch{}}function Oe(){(function(){if(j.value=!0,typeof document<"u")try{document.body.style.overflow="hidden"}catch{}if(typeof window<"u")try{window.addEventListener("keydown",de)}catch{}U(()=>{if(p.value&&D.value){D.value.innerHTML="";const n=document.createElement("div");n.style.transition="transform 0.1s ease",n.style.transformOrigin="center center",n.style.width="100%",n.style.height="100%",n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="center";const e=p.value.cloneNode(!0);e.classList.add("fullscreen"),e.style.height="auto",n.appendChild(e),D.value.appendChild(n),K.value=n,n.style.transform=`translate(${N.value}px, ${Y.value}px) scale(${M.value})`}})})()}function $e(){M.value<3&&(M.value+=.1)}function je(){M.value>.5&&(M.value-=.1)}function Le(){M.value=1,N.value=0,Y.value=0}function ee(n){_.value=!0,n instanceof MouseEvent?W.value={x:n.clientX-N.value,y:n.clientY-Y.value}:W.value={x:n.touches[0].clientX-N.value,y:n.touches[0].clientY-Y.value}}function ne(n){if(!_.value)return;let e,o;n instanceof MouseEvent?(e=n.clientX,o=n.clientY):(e=n.touches[0].clientX,o=n.touches[0].clientY),N.value=e-W.value.x,Y.value=o-W.value.y}function I(){_.value=!1}let g=null,me=!1,oe=!1,q=!1,te="",G=!1,he=0;function le(n){return!G&&n===he}function Pe(n=!1){return re(this,null,function*(){var e,o;if(G||!P.value||!p.value)return;if(me)return oe=!0,void(q=q||n);const i=Be.value;if(!n&&i===te&&L.value)return;const C=l.loading===!1,f=++he;me=!0,(function(){const m=be.value;m&&E!==m&&(E&&x?.markSettled(E),E=m,x?.markPending(m))})();const w=p.value.innerHTML,pe=L.value,Xe=S.value;S.value=!1;try{const m=yield m1();if(!le(f))return;if(!m)return void console.warn("Infographic library failed to load.");const Z=p.value;if(!Z)return;g&&((e=g.destroy)==null||e.call(g),g=null),Z.innerHTML="",g=new m({container:Z,width:"100%",height:"100%"});let fe="";if((o=g.on)==null||o.call(g,"error",we=>{fe=(Array.isArray(we)?we:[we]).map(y=>{var Se;return y instanceof Error?y.message:typeof y=="string"?y:String(y&&typeof y=="object"&&"message"in y?(Se=y.message)!=null?Se:"":y??"")}).filter(Boolean).join("; ")}),g.render(z.value),fe)throw new Error(fe);if(!Z.childNodes.length)throw new Error("Infographic render returned empty output.");L.value=!0,S.value=!1,te=i,U(()=>{le(f)&&Me()})}catch(m){if(!le(f))return;C&&l.loading===!1&&i===Be.value?(console.error("Failed to render infographic:",m),L.value=!1,S.value=!0,te="",p.value&&(p.value.innerHTML=`
      Failed to render infographic: ${m instanceof Error?m.message:"Unknown error"}
      `)):(L.value=pe,S.value=Xe,pe&&p.value&&(p.value.innerHTML=w))}finally{if(me=!1,le(f))if(oe){const m=q;oe=!1,q=!1,U(()=>{Pe(m)})}else(function(){re(this,null,function*(){const m=E;m&&(E="",yield U(),(function(Z=be.value){Z&&$.value&&x?.reportHeight(Z,$.value.offsetHeight)})(m),x?.markSettled(m))})})()}})}function O(n=!1){G||!P.value||k.value||c.value||U(()=>{G||Pe(n)})}B(()=>z.value,()=>{O(!0)}),B(()=>l.loading,(n,e)=>{e&&!n&&O(!0)}),B(()=>k.value,n=>{n||O(!0)}),B(()=>c.value,n=>{n||O()}),B(()=>l.maxHeight,()=>{U(()=>{Me()})}),B([()=>l.estimatedPreviewHeightPx,()=>z.value],()=>{L.value||k.value||(ce.value=`${ue.value}px`)}),B(()=>P.value,n=>{!n||k.value||c.value||O()}),n1(()=>{!ye.value&&Ze(),O()}),o1(()=>{var n,e;if(G=!0,he+=1,oe=!1,q=!1,(n=A.value)==null||n.destroy(),A.value=null,(function(){const o=E;o&&(E="",x?.markSettled(o))})(),g&&((e=g.destroy)==null||e.call(g),g=null),te="",typeof window<"u")try{window.removeEventListener("keydown",de)}catch{}});const Ee=T(()=>!0),ae=T(()=>k.value||c.value),Ue=T(()=>k.value?"fallback":S.value?"error":L.value?"preview":"pending"),ze=T(()=>({transform:`translate(${N.value}px, ${Y.value}px) scale(${M.value})`}));return B(ze,n=>{j.value&&K.value&&(K.value.style.transform=n.transform)}),(n,e)=>(r(),u("div",{ref_key:"viewportTarget",ref:$,class:b(["infographic-block-container rounded-lg border overflow-hidden",[{"is-rendering":l.loading,dark:l.isDark}]]),"data-markstream-infographic":"1","data-markstream-mode":Ue.value},[l.showHeader?(r(),u("div",f1,[n.$slots["header-left"]?(r(),u("div",w1,[ge(n.$slots,"header-left",{},void 0,!0)])):(r(),u("div",g1,[t("span",{class:"icon-slot action-icon shrink-0",innerHTML:s(` +import{bQ as Re,M as Ae,b$ as qe,c0 as Ge,c1 as Je,c2 as Qe,aU as d,bl as Ke,af as We,bY as e1,bE as B,as as U,aD as n1,c3 as Ze,az as o1,aL as r,u,aY as ge,v as t,bk as s,bb as X,au as b,t as F,aw as Ce,bL as t1,bB as l1,s as a1,I as i1,bJ as r1,bO as s1,g as u1,T as c1,q as T,c4 as Ve,c5 as ie,c6 as d1,c7 as De,c8 as v1,c9 as m1,b_ as h1}from"./index-ChnXJINq.js";var re=(R,xe,l)=>new Promise((a,J)=>{var V=c=>{try{H(l.next(c))}catch($){J($)}},Q=c=>{try{H(l.throw(c))}catch($){J($)}},H=c=>c.done?a(c.value):Promise.resolve(c.value).then(V,Q);H((l=l.apply(R,xe)).next())});const p1=["data-markstream-mode"],f1={key:0,class:"infographic-block-header flex justify-between items-center border-b"},w1={key:0},g1={key:1,class:"flex items-center gap-x-2 overflow-hidden"},C1=["innerHTML"],k1={key:2},x1={key:3,class:"infographic-mode-toggle flex items-center gap-0.5"},y1=["disabled"],b1={class:"flex items-center gap-x-1"},M1={class:"flex items-center gap-x-1"},B1={key:4},F1={key:5,class:"infographic-header-actions flex items-center"},T1=["aria-pressed"],H1={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},$1={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},j1=["disabled"],L1=["disabled"],P1={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},E1={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},z1={key:0,class:"infographic-source"},S1={class:"infographic-source-code text-sm font-mono whitespace-pre-wrap"},Z1={key:1,class:"relative"},V1={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},D1={class:"flex items-center gap-2 backdrop-blur rounded-lg"},N1={key:0,class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap"},Y1={class:"dialog-panel infographic-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},_1={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},se="infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",ke=Re(Ae({__name:"InfographicBlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal"],setup(R,{emit:xe}){const l=R,{t:a}=qe(),J=Ge(),V=Je(),Q=Qe(),H=d(!1),c=d(!1),$=d(),p=d(),k=d(!0),ye=d(!1),j=d(!1),D=d(),K=d(null),L=d(!1),S=d(!1),A=d(null),P=d(typeof window>"u"||!Q.value),Ne=Ke(),x=We(e1,null);let E="";const be=T(()=>h1(l,Ne));typeof window<"u"&&B([()=>$.value,Q],([n,e])=>{var o,i,C;if((o=A.value)==null||o.destroy(),A.value=null,!e||P.value)return void(P.value=!0);if(!n)return void(P.value=!1);const f=(C=(i=V?.value.heavyBlockMargin)!=null?i:V?.value.rootMargin)!=null?C:"160px",w=J(n,{rootMargin:f,allowIdle:!1});A.value=w,P.value=w.isVisible.value,w.whenVisible.then(()=>{P.value=!0})},{immediate:!0});const z=T(()=>l.node.code),ue=T(()=>{var n;return(function(e){if(l.maxHeight==="none")return Ve(e,void 0,null);const o=ie(l.maxHeight);return Ve(e,void 0,o)})((n=ie(l.estimatedPreviewHeightPx))!=null?n:d1(z.value))}),ce=d(`${ue.value}px`),Ye=T(()=>ie(l.estimatedPreviewHeightPx)!=null);function Me(){var n;if(!p.value||Ye.value)return;const e=p.value.scrollHeight;if(e>0){const o=(n=ie((function(i){if(l.maxHeight==="none")return`${i}px`;if(l.maxHeight!=null){const f=Number.parseFloat(String(l.maxHeight));if(Number.isFinite(f))return`${Math.min(i,f)}px`}const C=p.value;if(C){const f=getComputedStyle(C).getPropertyValue("--ms-size-code-max-height").trim(),w=Number.parseFloat(f);if(Number.isFinite(w))return`${Math.min(i,w)}px`}return`${Math.min(i,500)}px`})(e)))!=null?n:e;ce.value=`${Math.max(o,ue.value)}px`}}const M=d(1),N=d(0),Y=d(0),_=d(!1),W=d({x:0,y:0}),Be=T(()=>z.value);function Fe(n){return!n||n.disabled}function h(n,e,o="top"){if(Fe(n.currentTarget))return;const i=n,C=i?.clientX!=null&&i?.clientY!=null?{x:i.clientX,y:i.clientY}:void 0;De(n.currentTarget,e,o,!1,C,l.isDark)}function v(){v1()}function Te(n){if(Fe(n.currentTarget))return;const e=H.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=n,i=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;De(n.currentTarget,e,"top",!1,i,l.isDark)}function _e(){return re(this,null,function*(){try{const n=z.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n)),H.value=!0,setTimeout(()=>{H.value=!1},1e3)}catch(n){console.error("Failed to copy:",n)}})}function He(n){(n!=="preview"||Ze())&&(ye.value=!0,k.value=n==="source")}function Ie(){var n;const e=(n=p.value)==null?void 0:n.querySelector("svg");e?(function(o){re(this,null,function*(){try{const i=new XMLSerializer().serializeToString(o),C=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),f=URL.createObjectURL(C);if(typeof document<"u"){const w=document.createElement("a");w.href=f,w.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(w),w.click(),document.body.removeChild(w)}catch{}URL.revokeObjectURL(f)}}catch(i){console.error("Failed to export SVG:",i)}})})(e):console.error("SVG element not found")}function de(n){n.key==="Escape"&&j.value&&ve()}function ve(){if(j.value=!1,D.value&&(D.value.innerHTML=""),K.value=null,typeof document<"u")try{document.body.style.overflow=""}catch{}if(typeof window<"u")try{window.removeEventListener("keydown",de)}catch{}}function Oe(){(function(){if(j.value=!0,typeof document<"u")try{document.body.style.overflow="hidden"}catch{}if(typeof window<"u")try{window.addEventListener("keydown",de)}catch{}U(()=>{if(p.value&&D.value){D.value.innerHTML="";const n=document.createElement("div");n.style.transition="transform 0.1s ease",n.style.transformOrigin="center center",n.style.width="100%",n.style.height="100%",n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="center";const e=p.value.cloneNode(!0);e.classList.add("fullscreen"),e.style.height="auto",n.appendChild(e),D.value.appendChild(n),K.value=n,n.style.transform=`translate(${N.value}px, ${Y.value}px) scale(${M.value})`}})})()}function $e(){M.value<3&&(M.value+=.1)}function je(){M.value>.5&&(M.value-=.1)}function Le(){M.value=1,N.value=0,Y.value=0}function ee(n){_.value=!0,n instanceof MouseEvent?W.value={x:n.clientX-N.value,y:n.clientY-Y.value}:W.value={x:n.touches[0].clientX-N.value,y:n.touches[0].clientY-Y.value}}function ne(n){if(!_.value)return;let e,o;n instanceof MouseEvent?(e=n.clientX,o=n.clientY):(e=n.touches[0].clientX,o=n.touches[0].clientY),N.value=e-W.value.x,Y.value=o-W.value.y}function I(){_.value=!1}let g=null,me=!1,oe=!1,q=!1,te="",G=!1,he=0;function le(n){return!G&&n===he}function Pe(n=!1){return re(this,null,function*(){var e,o;if(G||!P.value||!p.value)return;if(me)return oe=!0,void(q=q||n);const i=Be.value;if(!n&&i===te&&L.value)return;const C=l.loading===!1,f=++he;me=!0,(function(){const m=be.value;m&&E!==m&&(E&&x?.markSettled(E),E=m,x?.markPending(m))})();const w=p.value.innerHTML,pe=L.value,Xe=S.value;S.value=!1;try{const m=yield m1();if(!le(f))return;if(!m)return void console.warn("Infographic library failed to load.");const Z=p.value;if(!Z)return;g&&((e=g.destroy)==null||e.call(g),g=null),Z.innerHTML="",g=new m({container:Z,width:"100%",height:"100%"});let fe="";if((o=g.on)==null||o.call(g,"error",we=>{fe=(Array.isArray(we)?we:[we]).map(y=>{var Se;return y instanceof Error?y.message:typeof y=="string"?y:String(y&&typeof y=="object"&&"message"in y?(Se=y.message)!=null?Se:"":y??"")}).filter(Boolean).join("; ")}),g.render(z.value),fe)throw new Error(fe);if(!Z.childNodes.length)throw new Error("Infographic render returned empty output.");L.value=!0,S.value=!1,te=i,U(()=>{le(f)&&Me()})}catch(m){if(!le(f))return;C&&l.loading===!1&&i===Be.value?(console.error("Failed to render infographic:",m),L.value=!1,S.value=!0,te="",p.value&&(p.value.innerHTML=`
      Failed to render infographic: ${m instanceof Error?m.message:"Unknown error"}
      `)):(L.value=pe,S.value=Xe,pe&&p.value&&(p.value.innerHTML=w))}finally{if(me=!1,le(f))if(oe){const m=q;oe=!1,q=!1,U(()=>{Pe(m)})}else(function(){re(this,null,function*(){const m=E;m&&(E="",yield U(),(function(Z=be.value){Z&&$.value&&x?.reportHeight(Z,$.value.offsetHeight)})(m),x?.markSettled(m))})})()}})}function O(n=!1){G||!P.value||k.value||c.value||U(()=>{G||Pe(n)})}B(()=>z.value,()=>{O(!0)}),B(()=>l.loading,(n,e)=>{e&&!n&&O(!0)}),B(()=>k.value,n=>{n||O(!0)}),B(()=>c.value,n=>{n||O()}),B(()=>l.maxHeight,()=>{U(()=>{Me()})}),B([()=>l.estimatedPreviewHeightPx,()=>z.value],()=>{L.value||k.value||(ce.value=`${ue.value}px`)}),B(()=>P.value,n=>{!n||k.value||c.value||O()}),n1(()=>{!ye.value&&Ze(),O()}),o1(()=>{var n,e;if(G=!0,he+=1,oe=!1,q=!1,(n=A.value)==null||n.destroy(),A.value=null,(function(){const o=E;o&&(E="",x?.markSettled(o))})(),g&&((e=g.destroy)==null||e.call(g),g=null),te="",typeof window<"u")try{window.removeEventListener("keydown",de)}catch{}});const Ee=T(()=>!0),ae=T(()=>k.value||c.value),Ue=T(()=>k.value?"fallback":S.value?"error":L.value?"preview":"pending"),ze=T(()=>({transform:`translate(${N.value}px, ${Y.value}px) scale(${M.value})`}));return B(ze,n=>{j.value&&K.value&&(K.value.style.transform=n.transform)}),(n,e)=>(r(),u("div",{ref_key:"viewportTarget",ref:$,class:b(["infographic-block-container rounded-lg border overflow-hidden",[{"is-rendering":l.loading,dark:l.isDark}]]),"data-markstream-infographic":"1","data-markstream-mode":Ue.value},[l.showHeader?(r(),u("div",f1,[n.$slots["header-left"]?(r(),u("div",w1,[ge(n.$slots,"header-left",{},void 0,!0)])):(r(),u("div",g1,[t("span",{class:"icon-slot action-icon shrink-0",innerHTML:s(` `)},null,8,C1),e[21]||(e[21]=t("span",{class:"infographic-label font-medium font-mono truncate"},"Infographic",-1))])),n.$slots["header-center"]?(r(),u("div",k1,[ge(n.$slots,"header-center",{},void 0,!0)])):l.showModeToggle?(r(),u("div",x1,[t("button",{class:b(["infographic-mode-btn px-2 py-0.5 rounded transition-colors",[k.value?"":"is-active",Ee.value?"opacity-50 cursor-not-allowed":""]]),disabled:Ee.value,onClick:e[0]||(e[0]=()=>He("preview")),onMouseenter:e[1]||(e[1]=o=>h(o,s(a)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=o=>h(o,s(a)("common.preview")||"Preview")),onMouseleave:v,onBlur:v},[t("div",b1,[e[22]||(e[22]=t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),t("circle",{cx:"12",cy:"12",r:"3"})])],-1)),t("span",null,X(s(a)("common.preview")||"Preview"),1)])],42,y1),t("button",{class:b(["infographic-mode-btn px-2 py-0.5 rounded transition-colors",[k.value?"is-active":""]]),onClick:e[3]||(e[3]=()=>He("source")),onMouseenter:e[4]||(e[4]=o=>h(o,s(a)("common.source")||"Source")),onFocus:e[5]||(e[5]=o=>h(o,s(a)("common.source")||"Source")),onMouseleave:v,onBlur:v},[t("div",M1,[e[23]||(e[23]=t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})],-1)),t("span",null,X(s(a)("common.source")||"Source"),1)])],34)])):F("",!0),n.$slots["header-right"]?(r(),u("div",B1,[ge(n.$slots,"header-right",{},void 0,!0)])):(r(),u("div",F1,[l.showCollapseButton?(r(),u("button",{key:0,class:b(se),"aria-pressed":c.value,onClick:e[6]||(e[6]=o=>c.value=!c.value),onMouseenter:e[7]||(e[7]=o=>h(o,c.value?s(a)("common.expand")||"Expand":s(a)("common.collapse")||"Collapse")),onFocus:e[8]||(e[8]=o=>h(o,c.value?s(a)("common.expand")||"Expand":s(a)("common.collapse")||"Collapse")),onMouseleave:v,onBlur:v},[(r(),u("svg",{style:Ce({rotate:c.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[24]||(e[24]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,T1)):F("",!0),l.showCopyButton?(r(),u("button",{key:1,class:b(se),onClick:_e,onMouseenter:e[9]||(e[9]=o=>Te(o)),onFocus:e[10]||(e[10]=o=>Te(o)),onMouseleave:v,onBlur:v},[H.value?(r(),u("svg",$1,[...e[26]||(e[26]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(r(),u("svg",H1,[...e[25]||(e[25]=[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),t("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],32)):F("",!0),l.showExportButton?(r(),u("button",{key:2,class:b(`${se} ${ae.value?"opacity-50 cursor-not-allowed":""}`),disabled:ae.value,onClick:Ie,onMouseenter:e[11]||(e[11]=o=>h(o,s(a)("common.export")||"Export")),onFocus:e[12]||(e[12]=o=>h(o,s(a)("common.export")||"Export")),onMouseleave:v,onBlur:v},[...e[27]||(e[27]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,j1)):F("",!0),l.showFullscreenButton?(r(),u("button",{key:3,class:b(`${se} ${ae.value?"opacity-50 cursor-not-allowed":""}`),disabled:ae.value,onClick:Oe,onMouseenter:e[13]||(e[13]=o=>h(o,j.value?s(a)("common.minimize")||"Minimize":s(a)("common.open")||"Open")),onFocus:e[14]||(e[14]=o=>h(o,j.value?s(a)("common.minimize")||"Minimize":s(a)("common.open")||"Open")),onMouseleave:v,onBlur:v},[j.value?(r(),u("svg",E1,[...e[29]||(e[29]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(r(),u("svg",P1,[...e[28]||(e[28]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])]))],42,L1)):F("",!0)]))])):F("",!0),t1(t("div",null,[k.value?(r(),u("div",z1,[t("pre",S1,X(z.value),1)])):(r(),u("div",Z1,[l.showZoomControls?(r(),u("div",V1,[t("div",D1,[t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:$e,onMouseenter:e[15]||(e[15]=o=>h(o,s(a)("common.zoomIn")||"Zoom in")),onFocus:e[16]||(e[16]=o=>h(o,s(a)("common.zoomIn")||"Zoom in")),onMouseleave:v,onBlur:v},[...e[30]||(e[30]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],32),t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:je,onMouseenter:e[17]||(e[17]=o=>h(o,s(a)("common.zoomOut")||"Zoom out")),onFocus:e[18]||(e[18]=o=>h(o,s(a)("common.zoomOut")||"Zoom out")),onMouseleave:v,onBlur:v},[...e[31]||(e[31]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],32),t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:Le,onMouseenter:e[19]||(e[19]=o=>h(o,s(a)("common.resetZoom")||"Reset zoom")),onFocus:e[20]||(e[20]=o=>h(o,s(a)("common.resetZoom")||"Reset zoom")),onMouseleave:v,onBlur:v},X(Math.round(100*M.value))+"% ",33)])])):F("",!0),t("div",{class:"infographic-preview relative transition-all overflow-hidden block",style:Ce({height:ce.value}),onMousedown:ee,onMousemove:ne,onMouseup:I,onMouseleave:I,onTouchstartPassive:ee,onTouchmovePassive:ne,onTouchendPassive:I},[L.value||S.value?F("",!0):(r(),u("pre",N1,X(z.value),1)),t("div",{class:b(["absolute inset-0 cursor-grab",{"cursor-grabbing":_.value}]),style:Ce(ze.value)},[t("div",{ref_key:"infographicContainer",ref:p,class:"w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],36)]))],512),[[l1,!c.value]]),(r(),a1(c1,{to:"body"},[t("div",{class:b(["markstream-vue",{dark:l.isDark}])},[i1(u1,{name:"infographic-dialog",appear:""},{default:r1(()=>[j.value?(r(),u("div",{key:0,class:"infographic-modal-overlay fixed inset-0 z-50 flex items-center justify-center p-4",onClick:s1(ve,["self"])},[t("div",Y1,[t("div",_1,[t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:$e},[...e[32]||(e[32]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])]),t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:je},[...e[33]||(e[33]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])]),t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:Le},X(Math.round(100*M.value))+"% ",1),t("button",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",onClick:ve},[...e[34]||(e[34]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])])]),t("div",{ref_key:"modalContent",ref:D,class:b(["w-full h-full flex items-center justify-center p-4 overflow-hidden",{"cursor-grab":!_.value,"cursor-grabbing":_.value}]),onMousedown:ee,onMousemove:ne,onMouseup:I,onMouseleave:I,onTouchstartPassive:ee,onTouchmovePassive:ne,onTouchendPassive:I},null,34)])])):F("",!0)]),_:1})],2)]))],10,p1))}}),[["__scopeId","data-v-de34ec4b"]]);ke.install=R=>{R.component(ke.__name,ke)};export{ke as default}; diff --git a/apps/kimi-code/dist-web/assets/index11-DNt97Omj.js b/apps/kimi-code/dist-web/assets/index11-ChlZyGAH.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index11-DNt97Omj.js rename to apps/kimi-code/dist-web/assets/index11-ChlZyGAH.js index 7906711e7d9..fb7cfc05198 100644 --- a/apps/kimi-code/dist-web/assets/index11-DNt97Omj.js +++ b/apps/kimi-code/dist-web/assets/index11-ChlZyGAH.js @@ -1,4 +1,4 @@ -import{cq as _t,bQ as _n,M as Hn,c2 as Nn,c1 as In,b$ as Yn,c0 as qn,aU as m,bl as Wn,af as Xn,bY as Vn,bE as Y,az as Un,c8 as wn,aD as Zn,as as q,aI as Kn,aL as M,u as B,aY as Rt,v as u,bk as w,bb as Ze,au as ae,t as pe,aw as Ft,bL as Gn,bB as Jn,ar as yn,bd as kn,s as Qn,I as el,bJ as tl,bO as nl,g as ll,T as rl,q as F,c7 as xn,c5 as zt,cr as ol,cs as al,ct as il,cu as ul,cv as sl,b_ as cl,cw as dl}from"./index-CvgiEu-R.js";import{i as Lt}from"./safeRaf-DGuzXxDK.js";function vl(d,f){return/(?:&#\d+|#\d+|&[a-z]+)$/i.test(d.slice(Math.max(0,f-12),f))}function Cn(d){return d.includes("->")||d.includes("-->")||d.includes("->>")||d.includes("-->>")||d.includes("-x")||d.includes("--x")||d.includes("-)")||d.includes("--)")||d.includes("-+")||d.includes("--+")}function ml(d){const f=d.trimStart();return/^(?:accDescr|accTitle|activate|actor|and|alt|autonumber|box|break|critical|create\s+(?:actor|participant)|deactivate|destroy|else|end|link|links|loop|Note|opt|option|par|participant|properties|rect)\b/i.test(f)||(function(y){const z=y.split(";",1)[0],a=z.indexOf(":");return a>0&&Cn(z.slice(0,a))})(f)}function fl(d){if(!d.includes(";"))return d;const f=d.indexOf(":");if(f===-1||!(function($,Q){const k=$.slice(0,Q);return/^\s*Note\b/i.test(k)||Cn(k)})(d,f))return d;const y=d.slice(0,f+1),z=d.slice(f+1),a=(function($){let Q="",k=!1;for(let P=0;P<$.length;P++){const ee=$[P];ee!==";"||vl($,P)||ml($.slice(P+1))?Q+=ee:(Q+="#59;",k=!0)}return k?Q:$})(z);return a===z?d:`${y}${a}`}function At(d){if(_t(d)!=="sequencediagram")return d;const f=d.split(/(\r\n|\n|\r)/);let y=!1;for(let z=0;zf in d?hl(d,f,{enumerable:!0,configurable:!0,writable:!0,value:y}):d[f]=y,Tn=(d,f)=>{for(var y in f||(f={}))wl.call(f,y)&&Mn(d,y,f[y]);if(bn)for(var y of bn(f))yl.call(f,y)&&Mn(d,y,f[y]);return d},T=(d,f,y)=>new Promise((z,a)=>{var $=P=>{try{k(y.next(P))}catch(ee){a(ee)}},Q=P=>{try{k(y.throw(P))}catch(ee){a(ee)}},k=P=>P.done?z(P.value):Promise.resolve(P.value).then($,Q);k((y=y.apply(d,f)).next())});const xl=["data-markstream-mode","data-markstream-pending"],bl={key:0,class:"mermaid-block-header flex items-center justify-between border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]"},Ml={key:0},Tl={key:1,class:"flex items-center gap-x-2 overflow-hidden"},Cl=["innerHTML"],Bl={key:2},El={key:3,class:"mermaid-mode-toggle-group flex items-center gap-0.5"},Ol={class:"flex items-center gap-x-1"},Sl={class:"flex items-center gap-x-1"},$l={key:4},Pl={key:5,class:"mermaid-header-actions flex items-center"},Dl=["aria-pressed"],Rl={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Fl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},zl=["aria-label","disabled"],Ll=["aria-label","disabled"],Al={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},jl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},_l={key:0,class:"mermaid-source-panel"},Hl={class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap"},Nl={key:1,class:"relative"},Il={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Yl={class:"flex items-center gap-2 backdrop-blur rounded-lg"},ql={class:"dialog-panel mermaid-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},Wl={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},pt="mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded",jt=_n(Hn({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!0},enableMermaidInteractions:{type:Boolean,default:!1},showTooltips:{type:Boolean,default:!0},onRenderError:{}},emits:["copy","export","openModal","toggleMode"],setup(d,{emit:f}){var y,z;const a=d,$=f,Q={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style","br"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},k=m(!1),P=m(typeof window>"u"),ee=Nn(),Ht=In(),Ee=F(()=>a.isStrict?"strict":"loose"),Bn=F(()=>({startOnLoad:!1,securityLevel:Ee.value,dompurifyConfig:Ee.value==="strict"?Q:void 0,htmlLabels:Ee.value!=="strict"&&void 0,flowchart:Ee.value==="strict"?{htmlLabels:!1}:void 0}));function we(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=""}}function Oe(e,t,n={}){if(!e)return null;const l=(function(r,o){if(!r)return null;const c=sl(o);if(!c)return null;const h=(function(i,s){const p=Array.from(i.childNodes),E=document.createElement("div");return E.dataset.mermaidSvgLayer="1",E.style.zIndex="1",E.appendChild(s),i.insertBefore(E,i.firstChild),p.length>0&&(function(W){const j=()=>{var U;for(const J of W)(U=J.parentNode)==null||U.removeChild(J)};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>{requestAnimationFrame(j)}):setTimeout(j,32)})(p),E})(r,c);return{svg:c.outerHTML,bindTarget:h}})(e,t);return l||n.keepPreviousOnFailure||we(e),l}let ie=null;function ye(e){if(a.enableMermaidInteractions&&e?.querySelector("svg"))try{ie?.(e)}catch{}}const{t:g}=Yn();let ue=!1,ke=0;function Ke(){return T(this,null,function*(){try{const e=yield il();return ue?null:(k.value=!!e,e)}catch(e){throw ue||(k.value=!1),e}finally{ue||(P.value=!0)}})}const Ge=m(!1),X=m(!1),Je=m(),Z=m(),v=m(),se=m(),Qe=m(null),En=qn(),je=m(null),xe=m(typeof window>"u"||!ee.value),On=Wn(),te=Xn(Vn,null);let ce="",be=0,et=0;const Nt=F(()=>cl(a,On));function wt(){const e=Nt.value;e&&(ce&&ce!==e&&(te?.markSettled(ce),be=0),ce=e,be+=1,et+=1,be===1&&te?.markPending(e))}function yt(){return T(this,null,function*(){const e=ce;if(!e||(be=Math.max(0,be-1),be>0))return;ce="";const t=++et;yield q(),t===et&&((function(n=Nt.value){n&&Je.value&&te?.reportHeight(n,Je.value.offsetHeight)})(e),te?.markSettled(e))})}function It(){const e=ce;e&&(ce="",be=0,et+=1,te?.markSettled(e))}const Yt=m(),D=F(()=>a.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function Sn(e,t=D.value){const n=t,l={theme:e==="dark"?"dark":"default"};Ee.value==="strict"&&(l.htmlLabels=!1,l.flowchart={htmlLabels:!1});const r=`%%{init: ${JSON.stringify(l)}}%% +import{cq as _t,bQ as _n,M as Hn,c2 as Nn,c1 as In,b$ as Yn,c0 as qn,aU as m,bl as Wn,af as Xn,bY as Vn,bE as Y,az as Un,c8 as wn,aD as Zn,as as q,aI as Kn,aL as M,u as B,aY as Rt,v as u,bk as w,bb as Ze,au as ae,t as pe,aw as Ft,bL as Gn,bB as Jn,ar as yn,bd as kn,s as Qn,I as el,bJ as tl,bO as nl,g as ll,T as rl,q as F,c7 as xn,c5 as zt,cr as ol,cs as al,ct as il,cu as ul,cv as sl,b_ as cl,cw as dl}from"./index-ChnXJINq.js";import{i as Lt}from"./safeRaf-DGuzXxDK.js";function vl(d,f){return/(?:&#\d+|#\d+|&[a-z]+)$/i.test(d.slice(Math.max(0,f-12),f))}function Cn(d){return d.includes("->")||d.includes("-->")||d.includes("->>")||d.includes("-->>")||d.includes("-x")||d.includes("--x")||d.includes("-)")||d.includes("--)")||d.includes("-+")||d.includes("--+")}function ml(d){const f=d.trimStart();return/^(?:accDescr|accTitle|activate|actor|and|alt|autonumber|box|break|critical|create\s+(?:actor|participant)|deactivate|destroy|else|end|link|links|loop|Note|opt|option|par|participant|properties|rect)\b/i.test(f)||(function(y){const z=y.split(";",1)[0],a=z.indexOf(":");return a>0&&Cn(z.slice(0,a))})(f)}function fl(d){if(!d.includes(";"))return d;const f=d.indexOf(":");if(f===-1||!(function($,Q){const k=$.slice(0,Q);return/^\s*Note\b/i.test(k)||Cn(k)})(d,f))return d;const y=d.slice(0,f+1),z=d.slice(f+1),a=(function($){let Q="",k=!1;for(let P=0;P<$.length;P++){const ee=$[P];ee!==";"||vl($,P)||ml($.slice(P+1))?Q+=ee:(Q+="#59;",k=!0)}return k?Q:$})(z);return a===z?d:`${y}${a}`}function At(d){if(_t(d)!=="sequencediagram")return d;const f=d.split(/(\r\n|\n|\r)/);let y=!1;for(let z=0;zf in d?hl(d,f,{enumerable:!0,configurable:!0,writable:!0,value:y}):d[f]=y,Tn=(d,f)=>{for(var y in f||(f={}))wl.call(f,y)&&Mn(d,y,f[y]);if(bn)for(var y of bn(f))yl.call(f,y)&&Mn(d,y,f[y]);return d},T=(d,f,y)=>new Promise((z,a)=>{var $=P=>{try{k(y.next(P))}catch(ee){a(ee)}},Q=P=>{try{k(y.throw(P))}catch(ee){a(ee)}},k=P=>P.done?z(P.value):Promise.resolve(P.value).then($,Q);k((y=y.apply(d,f)).next())});const xl=["data-markstream-mode","data-markstream-pending"],bl={key:0,class:"mermaid-block-header flex items-center justify-between border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]"},Ml={key:0},Tl={key:1,class:"flex items-center gap-x-2 overflow-hidden"},Cl=["innerHTML"],Bl={key:2},El={key:3,class:"mermaid-mode-toggle-group flex items-center gap-0.5"},Ol={class:"flex items-center gap-x-1"},Sl={class:"flex items-center gap-x-1"},$l={key:4},Pl={key:5,class:"mermaid-header-actions flex items-center"},Dl=["aria-pressed"],Rl={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Fl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},zl=["aria-label","disabled"],Ll=["aria-label","disabled"],Al={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},jl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},_l={key:0,class:"mermaid-source-panel"},Hl={class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap"},Nl={key:1,class:"relative"},Il={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Yl={class:"flex items-center gap-2 backdrop-blur rounded-lg"},ql={class:"dialog-panel mermaid-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},Wl={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},pt="mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded",jt=_n(Hn({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!0},enableMermaidInteractions:{type:Boolean,default:!1},showTooltips:{type:Boolean,default:!0},onRenderError:{}},emits:["copy","export","openModal","toggleMode"],setup(d,{emit:f}){var y,z;const a=d,$=f,Q={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style","br"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},k=m(!1),P=m(typeof window>"u"),ee=Nn(),Ht=In(),Ee=F(()=>a.isStrict?"strict":"loose"),Bn=F(()=>({startOnLoad:!1,securityLevel:Ee.value,dompurifyConfig:Ee.value==="strict"?Q:void 0,htmlLabels:Ee.value!=="strict"&&void 0,flowchart:Ee.value==="strict"?{htmlLabels:!1}:void 0}));function we(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=""}}function Oe(e,t,n={}){if(!e)return null;const l=(function(r,o){if(!r)return null;const c=sl(o);if(!c)return null;const h=(function(i,s){const p=Array.from(i.childNodes),E=document.createElement("div");return E.dataset.mermaidSvgLayer="1",E.style.zIndex="1",E.appendChild(s),i.insertBefore(E,i.firstChild),p.length>0&&(function(W){const j=()=>{var U;for(const J of W)(U=J.parentNode)==null||U.removeChild(J)};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>{requestAnimationFrame(j)}):setTimeout(j,32)})(p),E})(r,c);return{svg:c.outerHTML,bindTarget:h}})(e,t);return l||n.keepPreviousOnFailure||we(e),l}let ie=null;function ye(e){if(a.enableMermaidInteractions&&e?.querySelector("svg"))try{ie?.(e)}catch{}}const{t:g}=Yn();let ue=!1,ke=0;function Ke(){return T(this,null,function*(){try{const e=yield il();return ue?null:(k.value=!!e,e)}catch(e){throw ue||(k.value=!1),e}finally{ue||(P.value=!0)}})}const Ge=m(!1),X=m(!1),Je=m(),Z=m(),v=m(),se=m(),Qe=m(null),En=qn(),je=m(null),xe=m(typeof window>"u"||!ee.value),On=Wn(),te=Xn(Vn,null);let ce="",be=0,et=0;const Nt=F(()=>cl(a,On));function wt(){const e=Nt.value;e&&(ce&&ce!==e&&(te?.markSettled(ce),be=0),ce=e,be+=1,et+=1,be===1&&te?.markPending(e))}function yt(){return T(this,null,function*(){const e=ce;if(!e||(be=Math.max(0,be-1),be>0))return;ce="";const t=++et;yield q(),t===et&&((function(n=Nt.value){n&&Je.value&&te?.reportHeight(n,Je.value.offsetHeight)})(e),te?.markSettled(e))})}function It(){const e=ce;e&&(ce="",be=0,et+=1,te?.markSettled(e))}const Yt=m(),D=F(()=>a.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function Sn(e,t=D.value){const n=t,l={theme:e==="dark"?"dark":"default"};Ee.value==="strict"&&(l.htmlLabels=!1,l.flowchart={htmlLabels:!1});const r=`%%{init: ${JSON.stringify(l)}}%% `;return n.trim().startsWith("%%{")?n:r+n}function qt(){var e;return(function(t){const n=(function(){var r;const o=Z.value?getComputedStyle(Z.value).getPropertyValue("--ms-size-diagram-min-height").trim():"";return(r=zt(o))!=null?r:360})(),l=un();return ol(t,n,l)})((e=zt(a.estimatedPreviewHeightPx))!=null?e:al(D.value))}function Wt(){return`${qt()}px`}const _e=m(null);function kt(){var e;return!!((e=v.value)!=null&&e.querySelector("svg"))}function Xt(){return a.loading!==!1&&(kt()||!!_e.value)}const C=m(1),_=m(0),H=m(0),tt=m(!1),nt=m({x:0,y:0}),x=m(!0),lt=m(!1),re=m(!1),de=m(null);let xt="",bt=!1,ve="";const rt=m(0),Mt=m(!1),$n=F(()=>{var e;return Math.max(0,(e=a.renderDebounceMs)!=null?e:300)}),Pn=F(()=>{var e;return Math.max(0,(e=a.contentStableDelayMs)!=null?e:500)}),He=F(()=>{var e;return Math.max(120,(e=a.previewPollDelayMs)!=null?e:800)}),Dn=F(()=>{var e;return Math.max(He.value,(e=a.previewPollMaxDelayMs)!=null?e:4e3)}),Vt=F(()=>{var e;return Math.max(1,Math.trunc((e=a.previewPollMaxAttempts)!=null?e:12))}),me=F(()=>a.loading!==!1);let Ne=null,Ie=null,Se=null,$e=null,Ye=0;const Ut=(y=globalThis.requestIdleCallback)!=null?y:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16),Zt=(z=globalThis.cancelIdleCallback)!=null?z:e=>clearTimeout(e);function b(e=ke){return!ue&&e===ke}function L(){return b()&&xe.value&&!X.value}function Tt(){Se!=null&&(globalThis.clearTimeout(Se),Se=null),$e!=null&&(Zt($e),$e=null)}function qe(){ue||Se==null&&$e==null&&(Se=globalThis.setTimeout(()=>{Se=null,L()&&($e=Ut(()=>{$e=null,L()&&gn()},{timeout:500}))},$n.value))}function We(){Ie!=null&&(globalThis.clearTimeout(Ie),Ie=null)}function Kt(e=600){if(typeof globalThis>"u"||ue)return;const t=Math.max(0,e);We(),Ie=globalThis.setTimeout(()=>{if(Ie=null,!ue){if(a.loading||re.value||!L())return void Kt(Math.min(1200,Math.max(300,1.2*t)));qe()}},t)}const N=m(Wt()),ot=m(N.value);let Pe=null;const O=m(!1),K=m(!1),fe=m({}),he=m(0);let V=null,De=null;const I=m(!1),Rn=F(()=>{var e,t;return!(X.value||x.value||P.value&&!re.value&&!de.value&&(O.value||I.value&&((t=(e=v.value)==null?void 0:e.textContent)!=null&&t.trim())))}),Me=m({zoom:1,translateX:0,translateY:0,containerHeight:N.value}),Gt=F(()=>a.enableWheelZoom?{wheel:Fn}:{}),G=F(()=>{var e,t,n,l;return{worker:(e=a.workerTimeoutMs)!=null?e:1400,parse:(t=a.parseTimeoutMs)!=null?t:1800,render:(n=a.renderTimeoutMs)!=null?n:2500,fullRender:(l=a.fullRenderTimeoutMs)!=null?l:4e3}});let Re=null,at=null,Fe=!1,Te=He.value,ne=null,it=0,Ct=!0,ut=0;function Ce(e,t){const n=t?.timeoutMs,l=t?.signal;if(l?.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let r=null,o=!1,c=null;return new Promise((h,i)=>{const s=()=>{r!=null&&clearTimeout(r),c&&l&&l.removeEventListener("abort",c)};n&&n>0&&(r=globalThis.setTimeout(()=>{o||(o=!0,s(),i(new Error("Operation timed out")))},n)),l&&(c=()=>{o||(o=!0,s(),i(new DOMException("Aborted","AbortError")))},l.addEventListener("abort",c)),e().then(p=>{o||(o=!0,s(),h(p))}).catch(p=>{o||(o=!0,s(),i(p))})})}function Jt(e){if(typeof document>"u"||!v.value)return;if(typeof a.onRenderError=="function"&&a.onRenderError(e,D.value,v.value)===!0)return I.value=!0,void A();const t=document.createElement("div");t.style.padding="var(--ms-inset-panel-body)",t.style.color="hsl(var(--ms-destructive))",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),we(v.value),v.value.appendChild(t);const l=v.value?getComputedStyle(v.value).getPropertyValue("--ms-size-diagram-min-height").trim():"";N.value=l||"360px",ot.value=N.value,I.value=!0,A()}function Qt(e){const t=typeof e=="string"?e:typeof e?.message=="string"?e.message:"";return typeof t=="string"&&/timed out/i.test(t)}function en(e){return e?.name==="AbortError"}function Bt(e){return!Qt(e)&&!en(e)}typeof window<"u"&&Y([()=>Je.value,ee],([e,t])=>{var n;if((n=je.value)==null||n.destroy(),je.value=null,!t||xe.value)return void(xe.value=!0);if(!e)return void(xe.value=!1);const l=En(e,{rootMargin:Ht?.value.heavyBlockMargin,allowIdle:!1});je.value=l,xe.value=l.isVisible.value,l.whenVisible.then(()=>{xe.value=!0})},{immediate:!0}),Un(()=>{var e;ue=!0,ke+=1,he.value+=1,(e=je.value)==null||e.destroy(),je.value=null,It(),Tt()});const st=F(()=>a.showTooltips!==!1);function tn(e){return!e||e.disabled}function R(e,t,n="top"){if(!st.value||tn(e.currentTarget))return;const l=e,r=l?.clientX!=null&&l?.clientY!=null?{x:l.clientX,y:l.clientY}:void 0;xn(e.currentTarget,t,n,!1,r,a.isDark)}function S(){st.value&&wn()}function nn(e){if(!st.value||tn(e.currentTarget))return;const t=Ge.value?g("common.copied")||"Copied":g("common.copy")||"Copy",n=e,l=n?.clientX!=null&&n?.clientY!=null?{x:n.clientX,y:n.clientY}:void 0;xn(e.currentTarget,t,"top",!1,l,a.isDark)}function ln(e,t){const n={theme:t==="dark"?"dark":"default"};Ee.value==="strict"&&(n.htmlLabels=!1,n.flowchart={htmlLabels:!1});const l=`%%{init: ${JSON.stringify(n)}}%% `;return e.trimStart().startsWith("%%{")?e:l+e}function ct(){return Ct&&!x.value&&!O.value&&!I.value}function rn(e){const t=e.trim();return!(!t||t.startsWith("%%"))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)&&t.includes(":")}function Et(e){if(_t(e)==="gantt")return(function(n){var l;const r=n.split(/\r?\n/);for(!/\r?\n$/.test(n)&&r.length>0&&r.pop();r.length>0;){const o=(l=r[r.length-1])==null?void 0:l.trim();if(o&&!o.startsWith("%%")){if(rn(o))break;r.pop()}else r.pop()}return r.some(rn)?r.join(` `):""})(e);const t=e.split(/\r?\n/);for(;t.length>0;){const n=t[t.length-1].trimEnd();if(n!==""){if(!(/^[-=~>|<\s]+$/.test(n.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(n)||/[-|><]$/.test(n)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(n)))break;t.pop()}else t.pop()}return t.join(` diff --git a/apps/kimi-code/dist-web/assets/index5-DPyXoDa2.js b/apps/kimi-code/dist-web/assets/index5-CfzaNIoE.js similarity index 95% rename from apps/kimi-code/dist-web/assets/index5-DPyXoDa2.js rename to apps/kimi-code/dist-web/assets/index5-CfzaNIoE.js index 0b90cf52693..cac8bbcea9c 100644 --- a/apps/kimi-code/dist-web/assets/index5-DPyXoDa2.js +++ b/apps/kimi-code/dist-web/assets/index5-CfzaNIoE.js @@ -1 +1 @@ -import c from"./CodeBlockNode-TQKPIcUp.js";import{M as v,bl as g,aL as P,s as C,A as b,bJ as i,aY as d,av as k,a4 as x,ar as S,bk as T,q as O}from"./index-CvgiEu-R.js";import"./safeRaf-DGuzXxDK.js";var H=Object.defineProperty,z=Object.defineProperties,j=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,m=(o,s,e)=>s in o?H(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;const h=v({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},autoScrollOnUpdate:{type:Boolean},autoScrollInitial:{type:Boolean},estimatedHeightPx:{},estimatedContentHeightPx:{},themes:{},langs:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(o,{emit:s}){const e=o,p=s,w=c,f=g(),y=O(()=>{return t=((a,n)=>{for(var r in n||(n={}))F.call(n,r)&&m(a,r,n[r]);if(u)for(var r of u(n))W.call(n,r)&&m(a,r,n[r]);return a})({},f),l={node:e.node,loading:e.loading,stream:e.stream,darkTheme:e.darkTheme,lightTheme:e.lightTheme,isDark:e.isDark,isShowPreview:e.isShowPreview,enableFontSizeControl:e.enableFontSizeControl,minWidth:e.minWidth,maxWidth:e.maxWidth,themes:e.themes,showHeader:e.showHeader,showCopyButton:e.showCopyButton,showExpandButton:e.showExpandButton,showPreviewButton:e.showPreviewButton,showCollapseButton:e.showCollapseButton,showFontSizeButtons:e.showFontSizeButtons,showTooltips:e.showTooltips,estimatedHeightPx:e.estimatedHeightPx,estimatedContentHeightPx:e.estimatedContentHeightPx},z(t,j(l));var t,l});function B(t){p("previewCode",{type:t.artifactType,content:e.node.code,title:t.artifactTitle})}return(t,l)=>(P(),C(T(w),S(y.value,{onPreviewCode:B,onCopy:l[0]||(l[0]=a=>p("copy",a))}),b({_:2},[t.$slots["header-left"]?{name:"header-left",fn:i(()=>[d(t.$slots,"header-left")]),key:"0"}:void 0,t.$slots["header-right"]?{name:"header-right",fn:i(()=>[d(t.$slots,"header-right")]),key:"1"}:void 0,t.$slots.loading?{name:"loading",fn:i(a=>[d(t.$slots,"loading",k(x(a)))]),key:"2"}:void 0]),1040))}});h.install=o=>{o.component(h.__name,h)};export{h as default}; +import c from"./CodeBlockNode-DiXk8vTC.js";import{M as v,bl as g,aL as P,s as C,A as b,bJ as i,aY as d,av as k,a4 as x,ar as S,bk as T,q as O}from"./index-ChnXJINq.js";import"./safeRaf-DGuzXxDK.js";var H=Object.defineProperty,z=Object.defineProperties,j=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,m=(o,s,e)=>s in o?H(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;const h=v({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},autoScrollOnUpdate:{type:Boolean},autoScrollInitial:{type:Boolean},estimatedHeightPx:{},estimatedContentHeightPx:{},themes:{},langs:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(o,{emit:s}){const e=o,p=s,w=c,f=g(),y=O(()=>{return t=((a,n)=>{for(var r in n||(n={}))F.call(n,r)&&m(a,r,n[r]);if(u)for(var r of u(n))W.call(n,r)&&m(a,r,n[r]);return a})({},f),l={node:e.node,loading:e.loading,stream:e.stream,darkTheme:e.darkTheme,lightTheme:e.lightTheme,isDark:e.isDark,isShowPreview:e.isShowPreview,enableFontSizeControl:e.enableFontSizeControl,minWidth:e.minWidth,maxWidth:e.maxWidth,themes:e.themes,showHeader:e.showHeader,showCopyButton:e.showCopyButton,showExpandButton:e.showExpandButton,showPreviewButton:e.showPreviewButton,showCollapseButton:e.showCollapseButton,showFontSizeButtons:e.showFontSizeButtons,showTooltips:e.showTooltips,estimatedHeightPx:e.estimatedHeightPx,estimatedContentHeightPx:e.estimatedContentHeightPx},z(t,j(l));var t,l});function B(t){p("previewCode",{type:t.artifactType,content:e.node.code,title:t.artifactTitle})}return(t,l)=>(P(),C(T(w),S(y.value,{onPreviewCode:B,onCopy:l[0]||(l[0]=a=>p("copy",a))}),b({_:2},[t.$slots["header-left"]?{name:"header-left",fn:i(()=>[d(t.$slots,"header-left")]),key:"0"}:void 0,t.$slots["header-right"]?{name:"header-right",fn:i(()=>[d(t.$slots,"header-right")]),key:"1"}:void 0,t.$slots.loading?{name:"loading",fn:i(a=>[d(t.$slots,"loading",k(x(a)))]),key:"2"}:void 0]),1040))}});h.install=o=>{o.component(h.__name,h)};export{h as default}; diff --git a/apps/kimi-code/dist-web/assets/index6-RUyA_B9p.js b/apps/kimi-code/dist-web/assets/index6-CPKEqG-u.js similarity index 98% rename from apps/kimi-code/dist-web/assets/index6-RUyA_B9p.js rename to apps/kimi-code/dist-web/assets/index6-CPKEqG-u.js index be7c4a1253f..ce24c4db751 100644 --- a/apps/kimi-code/dist-web/assets/index6-RUyA_B9p.js +++ b/apps/kimi-code/dist-web/assets/index6-CPKEqG-u.js @@ -1 +1 @@ -import{bQ as Q,M as Y,af as Z,bY as G,a0 as ee,bS as ne,bT as A,aU as _,bZ as te,bE as P,aD as ae,az as le,aL as I,u as O,I as oe,bJ as re,t as ie,v as ue,g as se,au as F,bb as ce,aw as de,q as X,bU as ve,as as j,bV as fe,bW as me,bX as he,b_ as ge}from"./index-CvgiEu-R.js";var q=(S,B,b)=>new Promise((t,s)=>{var i=c=>{try{T(b.next(c))}catch(d){s(d)}},k=c=>{try{T(b.throw(c))}catch(d){s(d)}},T=c=>c.done?t(c.value):Promise.resolve(c.value).then(i,k);T((b=b.apply(S,B)).next())});const pe=["data-markstream-mode","data-markstream-pending"],ye={key:0,class:"math-loading-overlay"},be=["innerHTML"],ke={key:1,class:"math-block__fallback text-left"},N=Q(Y({__name:"MathBlockNode",props:{node:{},indexKey:{},cacheScope:{}},setup(S){var B,b;const t=S,s=_(null),i=Z(G,null),k=X(()=>ve(t.node.content)),T=((b=(B=ee())==null?void 0:B.vnode.el)==null?void 0:b.nodeType)===1,c=X(()=>ge(t,{})),d=(function(){if(!t.node.content)return{html:"",text:t.node.raw,loading:!1};if(t.node.loading)return{html:"",text:"",loading:!0};const e=ne();if(!e){const n=typeof window>"u"||T;return{html:"",text:n?t.node.raw:"",loading:!n}}try{const n=e.renderToString(k.value,{throwOnError:!1,displayMode:!0});return A(k.value,!0,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:t.node.loading?"":t.node.raw,loading:t.node.loading}}})(),u=_(d.html),f=_(d.text);let E=!1,x=0,v=!1,$=null;const m=te();let R=null,h="";const g=_(d.loading),K=_(!1),p=_(D());function H(e){e!=null&&e!==x||(K.value=!1)}function W(){var e;if(t.indexKey==null)return"";const n=(e=t.cacheScope)!=null?e:m?.scope;return`${n!=null&&String(n).length>0?`${String(n)}:`:""}math-block:${String(t.indexKey)}`}function D(){var e;const n=W();return n&&(e=m?.cache.get(n))!=null?e:0}function M(){if(p.value===0)return;p.value=0;const e=W();e&&m?.cache.set(e,0)}function L(e){if(u.value)return void M();if(!Number.isFinite(e)||e<=0)return;const n=Math.max(p.value,e);if(n===p.value)return;p.value=n;const a=W();a&&m?.cache.set(a,n)}function w(){j(()=>{var e,n;L((n=(e=s.value)==null?void 0:e.offsetHeight)!=null?n:0)})}function z(){const e=h;i&&e&&(h="",i.markSettled(e))}function U(){return q(this,null,function*(){if(v)return z(),void H();$&&($.abort(),$=null);const e=++x;if(!t.node.content)return z(),H(),g.value=!1,u.value="",f.value=t.node.raw,E=!1,void w();const n=new AbortController;$=n,K.value=!0,v||e!==x||n.signal.aborted?v||H(e):((function(){const a=c.value;i&&a&&h!==a&&(h&&i.markSettled(h),h=a,i.markPending(a))})(),fe(k.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:8,signal:n.signal}).then(a=>{v||e!==x||(u.value=a,f.value="",E=!0,g.value=!1,M(),w())}).catch(a=>q(null,null,function*(){if(v||e!==x)return;const r=a?.code||a?.name,l=r==="KATEX_DISABLED";if(r==="WORKER_INIT_ERROR"||a?.fallbackToRenderer||(r===me||r==="WORKER_TIMEOUT")&&!t.node.loading){const o=yield he();if(v||e!==x)return;if(o){try{const y=o.renderToString(k.value,{throwOnError:t.node.loading,displayMode:!0});u.value=y,f.value="",E=!0,g.value=!1,M(),w(),A(k.value,!0,y)}catch{}return}}if(l||!t.node.loading)return g.value=!1,u.value="",f.value=t.node.raw,void w();E||(g.value=!0)})).finally(()=>{v||e!==x||(H(e),(function(){const a=h;i&&a&&(h="",j(()=>{var r,l;if(!v){const o=(l=(r=s.value)==null?void 0:r.offsetHeight)!=null?l:0;o>0&&i.reportHeight(a,o)}i.markSettled(a)}))})())}))})}d.html&&(E=!0),d.html&&M();const J=[{family:"$$",open:"$$",close:"$$"},{family:"\\[]",open:"\\[",close:"\\]"},{family:"\\[]",open:"\\[",close:"]"},{family:"[]",open:"[",close:"\\]"},{family:"[]",open:"[",close:"]"},{family:"\\()",open:"\\(",close:"\\)"},{family:"$",open:"$",close:"$"}];function V(e,n){return(function(r){const l=String(r??"");for(const{family:o,open:y,close:C}of J)if((y!=="$"||!l.startsWith("$$")&&!l.endsWith("$$"))&&l.length>=y.length+C.length&&l.startsWith(y)&&l.endsWith(C))return{family:o,inner:l.slice(y.length,l.length-C.length),trusted:!0};return null})(e)||{family:"content",inner:String(n??""),trusted:!1}}return P(()=>[t.node.content,t.node.loading,t.node.raw],([e,,n],[a,,r])=>{var l,o;l=V(r,a),o=V(n,e),l.inner===""||l.family===o.family&&(l.trusted&&o.trusted?o.inner.startsWith(l.inner):o.inner===l.inner)||M(),U()},{flush:"post"}),P([()=>t.indexKey,()=>t.cacheScope],()=>{p.value=D(),w()}),ae(()=>{typeof ResizeObserver<"u"&&s.value&&(R=new ResizeObserver(()=>{var e,n;L((n=(e=s.value)==null?void 0:e.offsetHeight)!=null?n:0)}),R.observe(s.value)),w(),u.value||U()}),le(()=>{v=!0,z(),$&&($.abort(),$=null),R?.disconnect(),R=null}),(e,n)=>(I(),O("div",{ref_key:"containerEl",ref:s,class:"math-block text-center overflow-x-auto relative","data-markstream-math":"block","data-markstream-mode":u.value?"katex":f.value?"fallback":"loading","data-markstream-pending":K.value?"true":void 0,style:de(p.value?{minHeight:`${p.value}px`}:void 0)},[oe(se,{name:"math-fade"},{default:re(()=>[!g.value||u.value||f.value?ie("",!0):(I(),O("div",ye,[...n[0]||(n[0]=[ue("div",{class:"math-loading-spinner"},null,-1)])]))]),_:1}),u.value?(I(),O("div",{key:0,class:F(["math-block__content",{"math-rendering":g.value}]),innerHTML:u.value},null,10,be)):f.value?(I(),O("pre",ke,ce(f.value),1)):(I(),O("div",{key:2,class:F(["math-block__content",{"math-rendering":g.value}])},null,2))],12,pe))}}),[["__scopeId","data-v-939191ad"]]);N.install=S=>{S.component(N.__name,N)};export{N as default}; +import{bQ as Q,M as Y,af as Z,bY as G,a0 as ee,bS as ne,bT as A,aU as _,bZ as te,bE as P,aD as ae,az as le,aL as I,u as O,I as oe,bJ as re,t as ie,v as ue,g as se,au as F,bb as ce,aw as de,q as X,bU as ve,as as j,bV as fe,bW as me,bX as he,b_ as ge}from"./index-ChnXJINq.js";var q=(S,B,b)=>new Promise((t,s)=>{var i=c=>{try{T(b.next(c))}catch(d){s(d)}},k=c=>{try{T(b.throw(c))}catch(d){s(d)}},T=c=>c.done?t(c.value):Promise.resolve(c.value).then(i,k);T((b=b.apply(S,B)).next())});const pe=["data-markstream-mode","data-markstream-pending"],ye={key:0,class:"math-loading-overlay"},be=["innerHTML"],ke={key:1,class:"math-block__fallback text-left"},N=Q(Y({__name:"MathBlockNode",props:{node:{},indexKey:{},cacheScope:{}},setup(S){var B,b;const t=S,s=_(null),i=Z(G,null),k=X(()=>ve(t.node.content)),T=((b=(B=ee())==null?void 0:B.vnode.el)==null?void 0:b.nodeType)===1,c=X(()=>ge(t,{})),d=(function(){if(!t.node.content)return{html:"",text:t.node.raw,loading:!1};if(t.node.loading)return{html:"",text:"",loading:!0};const e=ne();if(!e){const n=typeof window>"u"||T;return{html:"",text:n?t.node.raw:"",loading:!n}}try{const n=e.renderToString(k.value,{throwOnError:!1,displayMode:!0});return A(k.value,!0,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:t.node.loading?"":t.node.raw,loading:t.node.loading}}})(),u=_(d.html),f=_(d.text);let E=!1,x=0,v=!1,$=null;const m=te();let R=null,h="";const g=_(d.loading),K=_(!1),p=_(D());function H(e){e!=null&&e!==x||(K.value=!1)}function W(){var e;if(t.indexKey==null)return"";const n=(e=t.cacheScope)!=null?e:m?.scope;return`${n!=null&&String(n).length>0?`${String(n)}:`:""}math-block:${String(t.indexKey)}`}function D(){var e;const n=W();return n&&(e=m?.cache.get(n))!=null?e:0}function M(){if(p.value===0)return;p.value=0;const e=W();e&&m?.cache.set(e,0)}function L(e){if(u.value)return void M();if(!Number.isFinite(e)||e<=0)return;const n=Math.max(p.value,e);if(n===p.value)return;p.value=n;const a=W();a&&m?.cache.set(a,n)}function w(){j(()=>{var e,n;L((n=(e=s.value)==null?void 0:e.offsetHeight)!=null?n:0)})}function z(){const e=h;i&&e&&(h="",i.markSettled(e))}function U(){return q(this,null,function*(){if(v)return z(),void H();$&&($.abort(),$=null);const e=++x;if(!t.node.content)return z(),H(),g.value=!1,u.value="",f.value=t.node.raw,E=!1,void w();const n=new AbortController;$=n,K.value=!0,v||e!==x||n.signal.aborted?v||H(e):((function(){const a=c.value;i&&a&&h!==a&&(h&&i.markSettled(h),h=a,i.markPending(a))})(),fe(k.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:8,signal:n.signal}).then(a=>{v||e!==x||(u.value=a,f.value="",E=!0,g.value=!1,M(),w())}).catch(a=>q(null,null,function*(){if(v||e!==x)return;const r=a?.code||a?.name,l=r==="KATEX_DISABLED";if(r==="WORKER_INIT_ERROR"||a?.fallbackToRenderer||(r===me||r==="WORKER_TIMEOUT")&&!t.node.loading){const o=yield he();if(v||e!==x)return;if(o){try{const y=o.renderToString(k.value,{throwOnError:t.node.loading,displayMode:!0});u.value=y,f.value="",E=!0,g.value=!1,M(),w(),A(k.value,!0,y)}catch{}return}}if(l||!t.node.loading)return g.value=!1,u.value="",f.value=t.node.raw,void w();E||(g.value=!0)})).finally(()=>{v||e!==x||(H(e),(function(){const a=h;i&&a&&(h="",j(()=>{var r,l;if(!v){const o=(l=(r=s.value)==null?void 0:r.offsetHeight)!=null?l:0;o>0&&i.reportHeight(a,o)}i.markSettled(a)}))})())}))})}d.html&&(E=!0),d.html&&M();const J=[{family:"$$",open:"$$",close:"$$"},{family:"\\[]",open:"\\[",close:"\\]"},{family:"\\[]",open:"\\[",close:"]"},{family:"[]",open:"[",close:"\\]"},{family:"[]",open:"[",close:"]"},{family:"\\()",open:"\\(",close:"\\)"},{family:"$",open:"$",close:"$"}];function V(e,n){return(function(r){const l=String(r??"");for(const{family:o,open:y,close:C}of J)if((y!=="$"||!l.startsWith("$$")&&!l.endsWith("$$"))&&l.length>=y.length+C.length&&l.startsWith(y)&&l.endsWith(C))return{family:o,inner:l.slice(y.length,l.length-C.length),trusted:!0};return null})(e)||{family:"content",inner:String(n??""),trusted:!1}}return P(()=>[t.node.content,t.node.loading,t.node.raw],([e,,n],[a,,r])=>{var l,o;l=V(r,a),o=V(n,e),l.inner===""||l.family===o.family&&(l.trusted&&o.trusted?o.inner.startsWith(l.inner):o.inner===l.inner)||M(),U()},{flush:"post"}),P([()=>t.indexKey,()=>t.cacheScope],()=>{p.value=D(),w()}),ae(()=>{typeof ResizeObserver<"u"&&s.value&&(R=new ResizeObserver(()=>{var e,n;L((n=(e=s.value)==null?void 0:e.offsetHeight)!=null?n:0)}),R.observe(s.value)),w(),u.value||U()}),le(()=>{v=!0,z(),$&&($.abort(),$=null),R?.disconnect(),R=null}),(e,n)=>(I(),O("div",{ref_key:"containerEl",ref:s,class:"math-block text-center overflow-x-auto relative","data-markstream-math":"block","data-markstream-mode":u.value?"katex":f.value?"fallback":"loading","data-markstream-pending":K.value?"true":void 0,style:de(p.value?{minHeight:`${p.value}px`}:void 0)},[oe(se,{name:"math-fade"},{default:re(()=>[!g.value||u.value||f.value?ie("",!0):(I(),O("div",ye,[...n[0]||(n[0]=[ue("div",{class:"math-loading-spinner"},null,-1)])]))]),_:1}),u.value?(I(),O("div",{key:0,class:F(["math-block__content",{"math-rendering":g.value}]),innerHTML:u.value},null,10,be)):f.value?(I(),O("pre",ke,ce(f.value),1)):(I(),O("div",{key:2,class:F(["math-block__content",{"math-rendering":g.value}])},null,2))],12,pe))}}),[["__scopeId","data-v-939191ad"]]);N.install=S=>{S.component(N.__name,N)};export{N as default}; diff --git a/apps/kimi-code/dist-web/assets/index7-ClRJOaWc.js b/apps/kimi-code/dist-web/assets/index7-Dw6CHuX-.js similarity index 98% rename from apps/kimi-code/dist-web/assets/index7-ClRJOaWc.js rename to apps/kimi-code/dist-web/assets/index7-Dw6CHuX-.js index 7c5df6c97f2..bcd223e5cdd 100644 --- a/apps/kimi-code/dist-web/assets/index7-ClRJOaWc.js +++ b/apps/kimi-code/dist-web/assets/index7-Dw6CHuX-.js @@ -1 +1 @@ -import{bQ as C,M as D,a0 as N,bS as U,bT as L,aU as h,bE as A,aD as K,az as W,aL as y,u as x,bb as z,s as H,bJ as P,v as M,aY as V,g as X,t as j,q as O,bU as q,bV as F,bW as J,bX as Q}from"./index-CvgiEu-R.js";var S=(f,b,r)=>new Promise((e,k)=>{var i=l=>{try{p(r.next(l))}catch(t){k(t)}},d=l=>{try{p(r.throw(l))}catch(t){k(t)}},p=l=>l.done?e(l.value):Promise.resolve(l.value).then(i,d);p((r=r.apply(f,b)).next())});const Y=["data-markstream-mode","data-markstream-pending"],G=["innerHTML"],Z={key:1,class:"math-inline math-inline--fallback"},ee={class:"math-inline__loading",role:"status","aria-live":"polite"},R=C(D({__name:"MathInlineNode",props:{node:{}},setup(f){var b,r;const e=f,k=h(null),i=O(()=>e.node.markup==="$$"),d=O(()=>q(e.node.content)),p=((r=(b=N())==null?void 0:b.vnode.el)==null?void 0:r.nodeType)===1,l=(function(){if(!e.node.content)return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading};if(e.node.loading)return{html:"",text:"",loading:!0};const a=U();if(!a){const n=typeof window>"u"||p;return{html:"",text:n?e.node.raw:"",loading:!n}}try{const n=a.renderToString(d.value,{throwOnError:!1,displayMode:i.value});return L(d.value,i.value,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading}}})(),t=h(l.html),u=h(l.text);let g=!1,m=0,s=!1,c=null;const v=h(l.loading),_=h(!1);function T(a){a!=null&&a!==m||(_.value=!1)}function B(){return S(this,null,function*(){if(s)return;c&&(c.abort(),c=null);const a=++m;if(!e.node.content)return T(),t.value="",u.value=e.node.loading?"":e.node.raw,v.value=e.node.loading,void(g=!1);const n=new AbortController;c=n,_.value=!0,s||a!==m||n.signal.aborted?T(a):F(d.value,i.value,{timeout:1500,waitTimeout:1500,maxRetries:8,signal:n.signal}).then(o=>{s||a!==m||(t.value=o,u.value="",v.value=!1,g=!0)}).catch(o=>S(null,null,function*(){if(s||a!==m)return;const w=o?.code||o?.name,$=w==="KATEX_DISABLED";if(w==="WORKER_INIT_ERROR"||o?.fallbackToRenderer||(w===J||w==="WORKER_TIMEOUT")&&!e.node.loading){const I=yield Q();if(s||a!==m)return;if(I){try{const E=I.renderToString(d.value,{throwOnError:e.node.loading,displayMode:i.value});t.value=E,u.value="",v.value=!1,g=!0,L(d.value,i.value,E)}catch{}return}}if($||!e.node.loading)return v.value=!1,t.value="",void(u.value=e.node.raw);g||(v.value=!0)})).finally(()=>{s||T(a)})})}return l.html&&(g=!0),A(()=>[e.node.content,e.node.loading,e.node.raw,e.node.markup],()=>{B()}),K(()=>{t.value||B()}),W(()=>{s=!0,c&&(c.abort(),c=null)}),(a,n)=>(y(),x("span",{ref_key:"containerEl",ref:k,class:"math-inline-wrapper","data-markstream-math":"inline","data-markstream-mode":t.value?"katex":u.value?"fallback":"loading","data-markstream-pending":_.value?"true":void 0},[t.value?(y(),x("span",{key:0,class:"math-inline",innerHTML:t.value},null,8,G)):u.value?(y(),x("span",Z,z(u.value),1)):v.value?(y(),H(X,{key:2,name:"table-node-fade"},{default:P(()=>[M("span",ee,[V(a.$slots,"loading",{isLoading:v.value},()=>[n[0]||(n[0]=M("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),n[1]||(n[1]=M("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):j("",!0)],8,Y))}}),[["__scopeId","data-v-6c556261"]]);R.install=f=>{f.component(R.__name,R)};export{R as default}; +import{bQ as C,M as D,a0 as N,bS as U,bT as L,aU as h,bE as A,aD as K,az as W,aL as y,u as x,bb as z,s as H,bJ as P,v as M,aY as V,g as X,t as j,q as O,bU as q,bV as F,bW as J,bX as Q}from"./index-ChnXJINq.js";var S=(f,b,r)=>new Promise((e,k)=>{var i=l=>{try{p(r.next(l))}catch(t){k(t)}},d=l=>{try{p(r.throw(l))}catch(t){k(t)}},p=l=>l.done?e(l.value):Promise.resolve(l.value).then(i,d);p((r=r.apply(f,b)).next())});const Y=["data-markstream-mode","data-markstream-pending"],G=["innerHTML"],Z={key:1,class:"math-inline math-inline--fallback"},ee={class:"math-inline__loading",role:"status","aria-live":"polite"},R=C(D({__name:"MathInlineNode",props:{node:{}},setup(f){var b,r;const e=f,k=h(null),i=O(()=>e.node.markup==="$$"),d=O(()=>q(e.node.content)),p=((r=(b=N())==null?void 0:b.vnode.el)==null?void 0:r.nodeType)===1,l=(function(){if(!e.node.content)return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading};if(e.node.loading)return{html:"",text:"",loading:!0};const a=U();if(!a){const n=typeof window>"u"||p;return{html:"",text:n?e.node.raw:"",loading:!n}}try{const n=a.renderToString(d.value,{throwOnError:!1,displayMode:i.value});return L(d.value,i.value,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading}}})(),t=h(l.html),u=h(l.text);let g=!1,m=0,s=!1,c=null;const v=h(l.loading),_=h(!1);function T(a){a!=null&&a!==m||(_.value=!1)}function B(){return S(this,null,function*(){if(s)return;c&&(c.abort(),c=null);const a=++m;if(!e.node.content)return T(),t.value="",u.value=e.node.loading?"":e.node.raw,v.value=e.node.loading,void(g=!1);const n=new AbortController;c=n,_.value=!0,s||a!==m||n.signal.aborted?T(a):F(d.value,i.value,{timeout:1500,waitTimeout:1500,maxRetries:8,signal:n.signal}).then(o=>{s||a!==m||(t.value=o,u.value="",v.value=!1,g=!0)}).catch(o=>S(null,null,function*(){if(s||a!==m)return;const w=o?.code||o?.name,$=w==="KATEX_DISABLED";if(w==="WORKER_INIT_ERROR"||o?.fallbackToRenderer||(w===J||w==="WORKER_TIMEOUT")&&!e.node.loading){const I=yield Q();if(s||a!==m)return;if(I){try{const E=I.renderToString(d.value,{throwOnError:e.node.loading,displayMode:i.value});t.value=E,u.value="",v.value=!1,g=!0,L(d.value,i.value,E)}catch{}return}}if($||!e.node.loading)return v.value=!1,t.value="",void(u.value=e.node.raw);g||(v.value=!0)})).finally(()=>{s||T(a)})})}return l.html&&(g=!0),A(()=>[e.node.content,e.node.loading,e.node.raw,e.node.markup],()=>{B()}),K(()=>{t.value||B()}),W(()=>{s=!0,c&&(c.abort(),c=null)}),(a,n)=>(y(),x("span",{ref_key:"containerEl",ref:k,class:"math-inline-wrapper","data-markstream-math":"inline","data-markstream-mode":t.value?"katex":u.value?"fallback":"loading","data-markstream-pending":_.value?"true":void 0},[t.value?(y(),x("span",{key:0,class:"math-inline",innerHTML:t.value},null,8,G)):u.value?(y(),x("span",Z,z(u.value),1)):v.value?(y(),H(X,{key:2,name:"table-node-fade"},{default:P(()=>[M("span",ee,[V(a.$slots,"loading",{isLoading:v.value},()=>[n[0]||(n[0]=M("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),n[1]||(n[1]=M("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):j("",!0)],8,Y))}}),[["__scopeId","data-v-6c556261"]]);R.install=f=>{f.component(R.__name,R)};export{R as default}; diff --git a/apps/kimi-code/dist-web/assets/index8-Dx-vzK_w.js b/apps/kimi-code/dist-web/assets/index8-6GF_RzW4.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index8-Dx-vzK_w.js rename to apps/kimi-code/dist-web/assets/index8-6GF_RzW4.js index 8db1770c57e..cab3c24d848 100644 --- a/apps/kimi-code/dist-web/assets/index8-Dx-vzK_w.js +++ b/apps/kimi-code/dist-web/assets/index8-6GF_RzW4.js @@ -1 +1 @@ -import{bQ as ot,M as lt,bl as at,af as rt,bY as ut,b$ as it,c0 as st,c1 as ct,c2 as dt,aU as d,bE as Z,as as fe,aD as vt,az as mt,aL as v,u as m,v as u,bk as f,au as pe,bb as N,t as T,aw as ge,bL as ft,bB as pt,q as D,c7 as Se,c8 as gt,ca as ht,b_ as yt}from"./index-CvgiEu-R.js";var wt=Object.defineProperty,Le=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,Ne=(p,n,i)=>n in p?wt(p,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):p[n]=i,he=(p,n)=>{for(var i in n||(n={}))bt.call(n,i)&&Ne(p,i,n[i]);if(Le)for(var i of Le(n))kt.call(n,i)&&Ne(p,i,n[i]);return p},ye=(p,n,i)=>new Promise((w,a)=>{var A=h=>{try{g(i.next(h))}catch(s){a(s)}},k=h=>{try{g(i.throw(h))}catch(s){a(s)}},g=h=>h.done?w(h.value):Promise.resolve(h.value).then(A,k);g((i=i.apply(p,n)).next())});const xt=["data-markstream-mode","data-markstream-pending"],Bt={key:0,class:"d2-block-header flex justify-between items-center border-b"},Dt={class:"d2-header-actions flex items-center"},Ct={key:0,class:"d2-mode-toggle flex items-center gap-0.5"},Mt=["aria-label"],Et={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Tt={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},At=["aria-label"],jt=["aria-pressed"],Ot={key:0,class:"d2-source"},It={class:"d2-code"},Ft={key:0,class:"d2-error mt-2 text-xs"},Ht={key:1},St={key:0,class:"d2-source"},Lt={class:"d2-code"},Nt={key:0,class:"d2-error mt-2 text-xs"},Pt=["innerHTML"],Rt={key:0,class:"d2-error px-4 pb-3 text-xs"},we=ot(lt({__name:"D2BlockNode",props:{node:{},maxHeight:{default:void 0},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:{},darkThemeId:{},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(p){const n=p,i=at(),w=rt(ut,null),{t:a}=it(),A=d(!1),k=d(!1),g=d(!1),h=d(!1),s=d(null),W=d(!1),j=d(""),ae=d(""),re=d(0),P=d(""),R=d(""),ee=d(null),ue=d(null),ie=d(null),Pe=st(),te=ct(),be=dt(),Y=d(null),ke=typeof window<"u",xe=d(!1),O=d(typeof window>"u"||!be.value),I=D(()=>{var t;return(t=n.node.code)!=null?t:""}),Re=D(()=>yt(n,i)),se=D(()=>{var t,e;return[n.isDark?"dark":"light",(t=n.themeId)!=null?t:"auto",(e=n.darkThemeId)!=null?e:"auto",I.value].join(":")}),ne=D(()=>!!j.value&&ae.value===se.value),Be=D(()=>{if(!xe.value||!I.value||g.value)return!1;const t=se.value;return!!W.value||P.value!==t&&(!s.value||R.value!==t)}),De=D(()=>ne.value||!!j.value&&Be.value),oe=D(()=>g.value||!h.value||!De.value),_e=D(()=>{if(oe.value&&ue.value)return{minHeight:`${ue.value}px`}}),Ue=D(()=>n.maxHeight==="none"?{maxHeight:"none"}:n.maxHeight!=null?{maxHeight:typeof n.maxHeight=="number"?`${n.maxHeight}px`:String(n.maxHeight)}:void 0);let x=null,ce=!1,_=!1,Ce=0,U=null,F=!1,$=null,C="";typeof window<"u"&&Z([()=>ie.value,be],([t,e])=>{var o,c,H;if((o=Y.value)==null||o.destroy(),Y.value=null,!e||O.value)return void(O.value=!0);if(!t)return void(O.value=!1);const S=(H=(c=te?.value.heavyBlockMargin)!=null?c:te?.value.rootMargin)!=null?H:"160px",V=Pe(t,{rootMargin:S,allowIdle:!1});Y.value=V,O.value=V.isVisible.value,V.whenVisible.then(()=>{O.value=!0})},{immediate:!0});const Ve={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function Me(t){return!t||t.disabled}function M(t,e,o="top"){if(Me(t.currentTarget))return;const c=t,H=c?.clientX!=null&&c?.clientY!=null?{x:c.clientX,y:c.clientY}:void 0;Se(t.currentTarget,e,o,!1,H,n.isDark)}function b(){gt()}function Ee(t){if(Me(t.currentTarget))return;const e=A.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=t,c=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;Se(t.currentTarget,e,"top",!1,c,n.isDark)}function ze(){return ye(this,null,function*(){try{const t=I.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(t)),A.value=!0,setTimeout(()=>{A.value=!1},1e3)}catch(t){console.error("Copy failed:",t)}})}function Ye(){k.value=!k.value}function Te(t){g.value=t==="source"}const $e=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],qe=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function Xe(t){if(!t)return"";const e=t.trim();return qe.test(e)?e:""}function Ae(){j.value="",ae.value=""}function q(t){return _||t!==re.value}function Ge(){return ye(this,null,function*(){var t,e,o,c,H;if(!ke||_||!O.value||n.loading&&!n.progressiveRender)return;const S=se.value;if(S===P.value&&!s.value&&ne.value)return h.value=!0,void(n.loading&&(g.value=!1));const V=I.value;if(!V)return Ae(),s.value=null,P.value="",void(R.value="");const G=++re.value;W.value=!0,s.value=null,R.value="",(function(){const r=Re.value;w&&r&&C!==r&&(C&&w.markSettled(C),C=r,w.markPending(r))})();try{const r=yield(function(){return ye(this,null,function*(){if(x)return x;const l=yield ht();if(_||!l)return null;if(typeof l=="function"){const Q=new l;return Q&&typeof Q.compile=="function"?x=Q:typeof l.compile=="function"&&(x=l),x}return l?.D2&&typeof l.D2=="function"?(x=new l.D2,x):(typeof l.compile=="function"&&(x=l),x)})})();if(q(G))return;if(!r)return h.value=!1,g.value=!0,Ae(),s.value="D2 is not available.",void(R.value=S);if(typeof r.compile!="function"||typeof r.render!="function")throw new TypeError("D2 instance is missing compile/render methods.");h.value=!0;const y=yield r.compile(V);if(q(G))return;const le=(t=y?.diagram)!=null?t:y,B=(o=(e=y?.renderOptions)!=null?e:y?.options)!=null?o:{},Qe=(c=n.themeId)!=null?c:B.themeID,je=(H=n.darkThemeId)!=null?H:B.darkThemeID,J=he({},B);if(J.themeID=n.isDark&&je!=null?je:Qe,J.darkThemeID=null,J.darkThemeOverrides=null,n.isDark){const l=B.themeOverrides&&typeof B.themeOverrides=="object"?B.themeOverrides:null;J.themeOverrides=he(he({},Ve),l||{})}const Ke=yield r.render(le,J);if(q(G))return;const Oe=(function(l){return l?typeof l=="string"?l:typeof l.svg=="string"?l.svg:typeof l.data=="string"?l.data:"":""})(Ke);if(!Oe)throw new Error("D2 render returned empty output.");(function(l,Q){const Ie=(function(Fe){if(typeof window>"u"||typeof DOMParser>"u"||!Fe)return"";const Ze=Fe.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),ve=new DOMParser().parseFromString(Ze,"image/svg+xml").documentElement;if(!ve||ve.nodeName.toLowerCase()!=="svg")return"";const me=ve;return(function(He){const We=new Set(["script"]),et=[He,...Array.from(He.querySelectorAll("*"))];for(const L of et){if(We.has(L.tagName.toLowerCase())){L.remove();continue}const tt=Array.from(L.attributes);for(const z of tt){const E=z.name;if(/^on/i.test(E))L.removeAttribute(E);else{if(E==="style"&&z.value){const K=z.value;if($e.some(nt=>nt.test(K))){L.removeAttribute(E);continue}}if((E==="href"||E==="xlink:href")&&z.value){const K=Xe(z.value);if(!K){L.removeAttribute(E);continue}K!==z.value&&L.setAttribute(E,K)}}}}})(me),me.classList.add("markstream-d2-root-svg"),me.outerHTML})(l);j.value=Ie||"",ae.value=Ie?Q:""})(Oe,S),P.value=S,R.value="",n.loading&&(g.value=!1),s.value=null}catch(r){if(q(G))return;const y=r?.message?String(r.message):"D2 render failed.";n.loading||(s.value=y,R.value=S),P.value="",y.includes("@terrastruct/d2")&&(h.value=!1,g.value=!0)}finally{q(G)||(W.value=!1,F?(F=!1,X()):(function(){const r=C;w&&r&&(C="",fe(()=>{var y,le;if(!_){const B=(le=(y=ie.value)==null?void 0:y.offsetHeight)!=null?le:0;B>0&&w.reportHeight(r,B)}w.markSettled(r)}))})())}})}function X(t=!1){if(ce||!ke||_)return;if(W.value)return void(F=!0);const e=Math.max(120,Number(n.progressiveIntervalMs)||0),o=Date.now()-Ce;if(!t&&o{U=null,F&&(F=!1,X(!0))},Math.max(0,e-o))));ce=!0;const c=()=>{ce=!1,Ce=Date.now(),Ge()};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(c):setTimeout(c,0)}function Je(){if(ne.value)try{const t=new Blob([j.value],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t);if(typeof document<"u"){const o=document.createElement("a");o.href=e,o.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(o),o.click(),document.body.removeChild(o)}URL.revokeObjectURL(e)}catch(t){console.error("Failed to export SVG:",t)}}function de(){const t=ee.value;if(!t)return;const e=t.getBoundingClientRect().height;e>0&&(ue.value=e)}return Z(()=>[n.node.code,n.loading,n.isDark,n.themeId,n.darkThemeId],()=>{X()},{immediate:!0}),Z(()=>n.loading,(t,e)=>{e&&!t&&X(!0)}),Z(()=>O.value,t=>{t&&X(!0)}),Z(()=>[oe.value,j.value,I.value],()=>{fe(()=>{de()})}),vt(()=>{xe.value=!0,fe(()=>{de()}),typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{de()}),ee.value&&$.observe(ee.value))}),mt(()=>{var t;_=!0,re.value+=1,F=!1,(function(){const e=C;w&&e&&(C="",w.markSettled(e))})(),P.value="",(t=Y.value)==null||t.destroy(),Y.value=null,U!=null&&(clearTimeout(U),U=null),$?.disconnect(),$=null}),(t,e)=>(v(),m("div",{ref_key:"viewportTarget",ref:ie,class:pe(["d2-block-container rounded-lg border overflow-hidden",{dark:n.isDark}]),"data-markstream-d2":"1","data-markstream-mode":oe.value?"fallback":"preview","data-markstream-pending":Be.value?"true":void 0},[n.showHeader?(v(),m("div",Bt,[e[16]||(e[16]=u("div",{class:"flex items-center gap-x-2"},[u("span",{class:"d2-label font-medium font-mono"},"D2")],-1)),u("div",Dt,[n.showModeToggle?(v(),m("div",Ct,[u("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",g.value?"":"is-active"]),onClick:e[0]||(e[0]=o=>Te("preview")),onMouseenter:e[1]||(e[1]=o=>M(o,f(a)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=o=>M(o,f(a)("common.preview")||"Preview")),onMouseleave:b,onBlur:b},N(f(a)("common.preview")||"Preview"),35),u("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",g.value?"is-active":""]),onClick:e[3]||(e[3]=o=>Te("source")),onMouseenter:e[4]||(e[4]=o=>M(o,f(a)("common.source")||"Source")),onFocus:e[5]||(e[5]=o=>M(o,f(a)("common.source")||"Source")),onMouseleave:b,onBlur:b},N(f(a)("common.source")||"Source"),35)])):T("",!0),n.showCopyButton?(v(),m("button",{key:1,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":A.value?f(a)("common.copied")||"Copied":f(a)("common.copy")||"Copy",onClick:ze,onMouseenter:e[6]||(e[6]=o=>Ee(o)),onFocus:e[7]||(e[7]=o=>Ee(o)),onMouseleave:b,onBlur:b},[A.value?(v(),m("svg",Tt,[...e[13]||(e[13]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),m("svg",Et,[...e[12]||(e[12]=[u("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[u("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),u("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Mt)):T("",!0),n.showExportButton&&ne.value?(v(),m("button",{key:2,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":f(a)("common.export")||"Export",onClick:Je,onMouseenter:e[8]||(e[8]=o=>M(o,f(a)("common.export")||"Export")),onFocus:e[9]||(e[9]=o=>M(o,f(a)("common.export")||"Export")),onMouseleave:b,onBlur:b},[...e[14]||(e[14]=[u("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"})],-1)])],40,At)):T("",!0),n.showCollapseButton?(v(),m("button",{key:3,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-pressed":k.value,onClick:Ye,onMouseenter:e[10]||(e[10]=o=>M(o,k.value?f(a)("common.expand")||"Expand":f(a)("common.collapse")||"Collapse")),onFocus:e[11]||(e[11]=o=>M(o,k.value?f(a)("common.expand")||"Expand":f(a)("common.collapse")||"Collapse")),onMouseleave:b,onBlur:b},[(v(),m("svg",{style:ge({rotate:k.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,jt)):T("",!0)])])):T("",!0),ft(u("div",{ref_key:"bodyRef",ref:ee,class:"d2-block-body",style:ge(_e.value)},[n.loading&&!De.value?(v(),m("div",Ot,[u("pre",It,[u("code",null,N(I.value),1)]),s.value?(v(),m("p",Ft,N(s.value),1)):T("",!0)])):(v(),m("div",Ht,[oe.value?(v(),m("div",St,[u("pre",Lt,[u("code",null,N(I.value),1)]),s.value?(v(),m("p",Nt,N(s.value),1)):T("",!0)])):(v(),m("div",{key:1,class:"d2-render",style:ge(Ue.value)},[u("div",{class:"d2-svg",innerHTML:j.value},null,8,Pt),s.value?(v(),m("p",Rt,N(s.value),1)):T("",!0)],4))]))],4),[[pt,!k.value]])],10,xt))}}),[["__scopeId","data-v-3b434cf5"]]);we.install=p=>{p.component(we.__name,we)};export{we as default}; +import{bQ as ot,M as lt,bl as at,af as rt,bY as ut,b$ as it,c0 as st,c1 as ct,c2 as dt,aU as d,bE as Z,as as fe,aD as vt,az as mt,aL as v,u as m,v as u,bk as f,au as pe,bb as N,t as T,aw as ge,bL as ft,bB as pt,q as D,c7 as Se,c8 as gt,ca as ht,b_ as yt}from"./index-ChnXJINq.js";var wt=Object.defineProperty,Le=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,Ne=(p,n,i)=>n in p?wt(p,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):p[n]=i,he=(p,n)=>{for(var i in n||(n={}))bt.call(n,i)&&Ne(p,i,n[i]);if(Le)for(var i of Le(n))kt.call(n,i)&&Ne(p,i,n[i]);return p},ye=(p,n,i)=>new Promise((w,a)=>{var A=h=>{try{g(i.next(h))}catch(s){a(s)}},k=h=>{try{g(i.throw(h))}catch(s){a(s)}},g=h=>h.done?w(h.value):Promise.resolve(h.value).then(A,k);g((i=i.apply(p,n)).next())});const xt=["data-markstream-mode","data-markstream-pending"],Bt={key:0,class:"d2-block-header flex justify-between items-center border-b"},Dt={class:"d2-header-actions flex items-center"},Ct={key:0,class:"d2-mode-toggle flex items-center gap-0.5"},Mt=["aria-label"],Et={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Tt={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},At=["aria-label"],jt=["aria-pressed"],Ot={key:0,class:"d2-source"},It={class:"d2-code"},Ft={key:0,class:"d2-error mt-2 text-xs"},Ht={key:1},St={key:0,class:"d2-source"},Lt={class:"d2-code"},Nt={key:0,class:"d2-error mt-2 text-xs"},Pt=["innerHTML"],Rt={key:0,class:"d2-error px-4 pb-3 text-xs"},we=ot(lt({__name:"D2BlockNode",props:{node:{},maxHeight:{default:void 0},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:{},darkThemeId:{},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(p){const n=p,i=at(),w=rt(ut,null),{t:a}=it(),A=d(!1),k=d(!1),g=d(!1),h=d(!1),s=d(null),W=d(!1),j=d(""),ae=d(""),re=d(0),P=d(""),R=d(""),ee=d(null),ue=d(null),ie=d(null),Pe=st(),te=ct(),be=dt(),Y=d(null),ke=typeof window<"u",xe=d(!1),O=d(typeof window>"u"||!be.value),I=D(()=>{var t;return(t=n.node.code)!=null?t:""}),Re=D(()=>yt(n,i)),se=D(()=>{var t,e;return[n.isDark?"dark":"light",(t=n.themeId)!=null?t:"auto",(e=n.darkThemeId)!=null?e:"auto",I.value].join(":")}),ne=D(()=>!!j.value&&ae.value===se.value),Be=D(()=>{if(!xe.value||!I.value||g.value)return!1;const t=se.value;return!!W.value||P.value!==t&&(!s.value||R.value!==t)}),De=D(()=>ne.value||!!j.value&&Be.value),oe=D(()=>g.value||!h.value||!De.value),_e=D(()=>{if(oe.value&&ue.value)return{minHeight:`${ue.value}px`}}),Ue=D(()=>n.maxHeight==="none"?{maxHeight:"none"}:n.maxHeight!=null?{maxHeight:typeof n.maxHeight=="number"?`${n.maxHeight}px`:String(n.maxHeight)}:void 0);let x=null,ce=!1,_=!1,Ce=0,U=null,F=!1,$=null,C="";typeof window<"u"&&Z([()=>ie.value,be],([t,e])=>{var o,c,H;if((o=Y.value)==null||o.destroy(),Y.value=null,!e||O.value)return void(O.value=!0);if(!t)return void(O.value=!1);const S=(H=(c=te?.value.heavyBlockMargin)!=null?c:te?.value.rootMargin)!=null?H:"160px",V=Pe(t,{rootMargin:S,allowIdle:!1});Y.value=V,O.value=V.isVisible.value,V.whenVisible.then(()=>{O.value=!0})},{immediate:!0});const Ve={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function Me(t){return!t||t.disabled}function M(t,e,o="top"){if(Me(t.currentTarget))return;const c=t,H=c?.clientX!=null&&c?.clientY!=null?{x:c.clientX,y:c.clientY}:void 0;Se(t.currentTarget,e,o,!1,H,n.isDark)}function b(){gt()}function Ee(t){if(Me(t.currentTarget))return;const e=A.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=t,c=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;Se(t.currentTarget,e,"top",!1,c,n.isDark)}function ze(){return ye(this,null,function*(){try{const t=I.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(t)),A.value=!0,setTimeout(()=>{A.value=!1},1e3)}catch(t){console.error("Copy failed:",t)}})}function Ye(){k.value=!k.value}function Te(t){g.value=t==="source"}const $e=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],qe=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function Xe(t){if(!t)return"";const e=t.trim();return qe.test(e)?e:""}function Ae(){j.value="",ae.value=""}function q(t){return _||t!==re.value}function Ge(){return ye(this,null,function*(){var t,e,o,c,H;if(!ke||_||!O.value||n.loading&&!n.progressiveRender)return;const S=se.value;if(S===P.value&&!s.value&&ne.value)return h.value=!0,void(n.loading&&(g.value=!1));const V=I.value;if(!V)return Ae(),s.value=null,P.value="",void(R.value="");const G=++re.value;W.value=!0,s.value=null,R.value="",(function(){const r=Re.value;w&&r&&C!==r&&(C&&w.markSettled(C),C=r,w.markPending(r))})();try{const r=yield(function(){return ye(this,null,function*(){if(x)return x;const l=yield ht();if(_||!l)return null;if(typeof l=="function"){const Q=new l;return Q&&typeof Q.compile=="function"?x=Q:typeof l.compile=="function"&&(x=l),x}return l?.D2&&typeof l.D2=="function"?(x=new l.D2,x):(typeof l.compile=="function"&&(x=l),x)})})();if(q(G))return;if(!r)return h.value=!1,g.value=!0,Ae(),s.value="D2 is not available.",void(R.value=S);if(typeof r.compile!="function"||typeof r.render!="function")throw new TypeError("D2 instance is missing compile/render methods.");h.value=!0;const y=yield r.compile(V);if(q(G))return;const le=(t=y?.diagram)!=null?t:y,B=(o=(e=y?.renderOptions)!=null?e:y?.options)!=null?o:{},Qe=(c=n.themeId)!=null?c:B.themeID,je=(H=n.darkThemeId)!=null?H:B.darkThemeID,J=he({},B);if(J.themeID=n.isDark&&je!=null?je:Qe,J.darkThemeID=null,J.darkThemeOverrides=null,n.isDark){const l=B.themeOverrides&&typeof B.themeOverrides=="object"?B.themeOverrides:null;J.themeOverrides=he(he({},Ve),l||{})}const Ke=yield r.render(le,J);if(q(G))return;const Oe=(function(l){return l?typeof l=="string"?l:typeof l.svg=="string"?l.svg:typeof l.data=="string"?l.data:"":""})(Ke);if(!Oe)throw new Error("D2 render returned empty output.");(function(l,Q){const Ie=(function(Fe){if(typeof window>"u"||typeof DOMParser>"u"||!Fe)return"";const Ze=Fe.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),ve=new DOMParser().parseFromString(Ze,"image/svg+xml").documentElement;if(!ve||ve.nodeName.toLowerCase()!=="svg")return"";const me=ve;return(function(He){const We=new Set(["script"]),et=[He,...Array.from(He.querySelectorAll("*"))];for(const L of et){if(We.has(L.tagName.toLowerCase())){L.remove();continue}const tt=Array.from(L.attributes);for(const z of tt){const E=z.name;if(/^on/i.test(E))L.removeAttribute(E);else{if(E==="style"&&z.value){const K=z.value;if($e.some(nt=>nt.test(K))){L.removeAttribute(E);continue}}if((E==="href"||E==="xlink:href")&&z.value){const K=Xe(z.value);if(!K){L.removeAttribute(E);continue}K!==z.value&&L.setAttribute(E,K)}}}}})(me),me.classList.add("markstream-d2-root-svg"),me.outerHTML})(l);j.value=Ie||"",ae.value=Ie?Q:""})(Oe,S),P.value=S,R.value="",n.loading&&(g.value=!1),s.value=null}catch(r){if(q(G))return;const y=r?.message?String(r.message):"D2 render failed.";n.loading||(s.value=y,R.value=S),P.value="",y.includes("@terrastruct/d2")&&(h.value=!1,g.value=!0)}finally{q(G)||(W.value=!1,F?(F=!1,X()):(function(){const r=C;w&&r&&(C="",fe(()=>{var y,le;if(!_){const B=(le=(y=ie.value)==null?void 0:y.offsetHeight)!=null?le:0;B>0&&w.reportHeight(r,B)}w.markSettled(r)}))})())}})}function X(t=!1){if(ce||!ke||_)return;if(W.value)return void(F=!0);const e=Math.max(120,Number(n.progressiveIntervalMs)||0),o=Date.now()-Ce;if(!t&&o{U=null,F&&(F=!1,X(!0))},Math.max(0,e-o))));ce=!0;const c=()=>{ce=!1,Ce=Date.now(),Ge()};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(c):setTimeout(c,0)}function Je(){if(ne.value)try{const t=new Blob([j.value],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t);if(typeof document<"u"){const o=document.createElement("a");o.href=e,o.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(o),o.click(),document.body.removeChild(o)}URL.revokeObjectURL(e)}catch(t){console.error("Failed to export SVG:",t)}}function de(){const t=ee.value;if(!t)return;const e=t.getBoundingClientRect().height;e>0&&(ue.value=e)}return Z(()=>[n.node.code,n.loading,n.isDark,n.themeId,n.darkThemeId],()=>{X()},{immediate:!0}),Z(()=>n.loading,(t,e)=>{e&&!t&&X(!0)}),Z(()=>O.value,t=>{t&&X(!0)}),Z(()=>[oe.value,j.value,I.value],()=>{fe(()=>{de()})}),vt(()=>{xe.value=!0,fe(()=>{de()}),typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{de()}),ee.value&&$.observe(ee.value))}),mt(()=>{var t;_=!0,re.value+=1,F=!1,(function(){const e=C;w&&e&&(C="",w.markSettled(e))})(),P.value="",(t=Y.value)==null||t.destroy(),Y.value=null,U!=null&&(clearTimeout(U),U=null),$?.disconnect(),$=null}),(t,e)=>(v(),m("div",{ref_key:"viewportTarget",ref:ie,class:pe(["d2-block-container rounded-lg border overflow-hidden",{dark:n.isDark}]),"data-markstream-d2":"1","data-markstream-mode":oe.value?"fallback":"preview","data-markstream-pending":Be.value?"true":void 0},[n.showHeader?(v(),m("div",Bt,[e[16]||(e[16]=u("div",{class:"flex items-center gap-x-2"},[u("span",{class:"d2-label font-medium font-mono"},"D2")],-1)),u("div",Dt,[n.showModeToggle?(v(),m("div",Ct,[u("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",g.value?"":"is-active"]),onClick:e[0]||(e[0]=o=>Te("preview")),onMouseenter:e[1]||(e[1]=o=>M(o,f(a)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=o=>M(o,f(a)("common.preview")||"Preview")),onMouseleave:b,onBlur:b},N(f(a)("common.preview")||"Preview"),35),u("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",g.value?"is-active":""]),onClick:e[3]||(e[3]=o=>Te("source")),onMouseenter:e[4]||(e[4]=o=>M(o,f(a)("common.source")||"Source")),onFocus:e[5]||(e[5]=o=>M(o,f(a)("common.source")||"Source")),onMouseleave:b,onBlur:b},N(f(a)("common.source")||"Source"),35)])):T("",!0),n.showCopyButton?(v(),m("button",{key:1,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":A.value?f(a)("common.copied")||"Copied":f(a)("common.copy")||"Copy",onClick:ze,onMouseenter:e[6]||(e[6]=o=>Ee(o)),onFocus:e[7]||(e[7]=o=>Ee(o)),onMouseleave:b,onBlur:b},[A.value?(v(),m("svg",Tt,[...e[13]||(e[13]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),m("svg",Et,[...e[12]||(e[12]=[u("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[u("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),u("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Mt)):T("",!0),n.showExportButton&&ne.value?(v(),m("button",{key:2,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":f(a)("common.export")||"Export",onClick:Je,onMouseenter:e[8]||(e[8]=o=>M(o,f(a)("common.export")||"Export")),onFocus:e[9]||(e[9]=o=>M(o,f(a)("common.export")||"Export")),onMouseleave:b,onBlur:b},[...e[14]||(e[14]=[u("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"})],-1)])],40,At)):T("",!0),n.showCollapseButton?(v(),m("button",{key:3,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-pressed":k.value,onClick:Ye,onMouseenter:e[10]||(e[10]=o=>M(o,k.value?f(a)("common.expand")||"Expand":f(a)("common.collapse")||"Collapse")),onFocus:e[11]||(e[11]=o=>M(o,k.value?f(a)("common.expand")||"Expand":f(a)("common.collapse")||"Collapse")),onMouseleave:b,onBlur:b},[(v(),m("svg",{style:ge({rotate:k.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,jt)):T("",!0)])])):T("",!0),ft(u("div",{ref_key:"bodyRef",ref:ee,class:"d2-block-body",style:ge(_e.value)},[n.loading&&!De.value?(v(),m("div",Ot,[u("pre",It,[u("code",null,N(I.value),1)]),s.value?(v(),m("p",Ft,N(s.value),1)):T("",!0)])):(v(),m("div",Ht,[oe.value?(v(),m("div",St,[u("pre",Lt,[u("code",null,N(I.value),1)]),s.value?(v(),m("p",Nt,N(s.value),1)):T("",!0)])):(v(),m("div",{key:1,class:"d2-render",style:ge(Ue.value)},[u("div",{class:"d2-svg",innerHTML:j.value},null,8,Pt),s.value?(v(),m("p",Rt,N(s.value),1)):T("",!0)],4))]))],4),[[pt,!k.value]])],10,xt))}}),[["__scopeId","data-v-3b434cf5"]]);we.install=p=>{p.component(we.__name,we)};export{we as default}; diff --git a/apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-Bge59IZG.js b/apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-CUw0bC3y.js similarity index 69% rename from apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-Bge59IZG.js rename to apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-CUw0bC3y.js index 596821b10f7..4dc2cc231f4 100644 --- a/apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-Bge59IZG.js +++ b/apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-CUw0bC3y.js @@ -1,2 +1,2 @@ -import{_ as a,l as s,D as n,e as i}from"./mermaid.core-CGrLstUA.js";import{p}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.16.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram +import{_ as a,l as s,D as n,e as i}from"./mermaid.core-XMN3hSDH.js";import{p}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.16.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram `+r);const t=n(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},w={parser:g,db:m,renderer:l};export{w as diagram}; diff --git a/apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-y8Y7SwAW.js b/apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-BQLkKOjp.js similarity index 99% rename from apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-y8Y7SwAW.js rename to apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-BQLkKOjp.js index fb2116febc1..69fff47eae7 100644 --- a/apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-y8Y7SwAW.js +++ b/apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-BQLkKOjp.js @@ -1,4 +1,4 @@ -import{_ as l,c as lt,K as ct,D as ut,al as dt,p as yt,k as ft,n as et,a as pt,b as gt,g as kt,s as mt,o as wt,e as _t}from"./mermaid.core-CGrLstUA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var Q=(function(){var t=l(function(T,e,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=e);return s},"o"),d=[1,4],n=[1,14],a=[1,12],o=[1,13],y=[6,7,8],p=[1,20],u=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:l(function(e,s,i,h,f,r,v){var w=r.length-1;switch(f){case 6:case 7:return h;case 15:h.addNode(r[w-1].length,r[w].trim());break;case 16:h.addNode(0,r[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:n,7:[1,10],9:9,12:11,13:a,14:o},t(y,[2,3]),{1:[2,2]},t(y,[2,4]),t(y,[2,5]),{1:[2,6],6:n,12:15,13:a,14:o},{6:n,9:16,12:11,13:a,14:o},{6:p,7:u,10:17,11:m},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:p,7:u,10:22,11:m},{1:[2,7],6:n,12:15,13:a,14:o},t(k,[2,14],{7:g,11:_}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(c,[2,15]),t(k,[2,13],{7:g,11:_}),t(x,[2,11]),t(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(e,s){if(s.recoverable)this.trace(e);else{var i=new Error(e);throw i.hash=s,i}},"parseError"),parse:l(function(e){var s=this,i=[0],h=[],f=[null],r=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=r.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(e,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;r.push(R);var H=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function K(B){i.length=i.length-2*B,f.length=f.length-B,r.length=r.length-B}l(K,"popStack");function J(){var B;return B=h.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(h=B,B=h.pop()),B=s.symbols_[B]||B),B}l(J,"lex");for(var M,W,N,X,F={},G,V,tt,U;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=J()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var Y="";U=[];for(G in v[W])this.terminals_[G]&&G>L&&U.push("'"+this.terminals_[G]+"'");b.showPosition?Y="Parse error on line "+(I+1)+`: +import{_ as l,c as lt,K as ct,D as ut,al as dt,p as yt,k as ft,n as et,a as pt,b as gt,g as kt,s as mt,o as wt,e as _t}from"./mermaid.core-XMN3hSDH.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var Q=(function(){var t=l(function(T,e,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=e);return s},"o"),d=[1,4],n=[1,14],a=[1,12],o=[1,13],y=[6,7,8],p=[1,20],u=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:l(function(e,s,i,h,f,r,v){var w=r.length-1;switch(f){case 6:case 7:return h;case 15:h.addNode(r[w-1].length,r[w].trim());break;case 16:h.addNode(0,r[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:n,7:[1,10],9:9,12:11,13:a,14:o},t(y,[2,3]),{1:[2,2]},t(y,[2,4]),t(y,[2,5]),{1:[2,6],6:n,12:15,13:a,14:o},{6:n,9:16,12:11,13:a,14:o},{6:p,7:u,10:17,11:m},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:p,7:u,10:22,11:m},{1:[2,7],6:n,12:15,13:a,14:o},t(k,[2,14],{7:g,11:_}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(c,[2,15]),t(k,[2,13],{7:g,11:_}),t(x,[2,11]),t(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(e,s){if(s.recoverable)this.trace(e);else{var i=new Error(e);throw i.hash=s,i}},"parseError"),parse:l(function(e){var s=this,i=[0],h=[],f=[null],r=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=r.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(e,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;r.push(R);var H=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function K(B){i.length=i.length-2*B,f.length=f.length-B,r.length=r.length-B}l(K,"popStack");function J(){var B;return B=h.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(h=B,B=h.pop()),B=s.symbols_[B]||B),B}l(J,"lex");for(var M,W,N,X,F={},G,V,tt,U;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=J()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var Y="";U=[];for(G in v[W])this.terminals_[G]&&G>L&&U.push("'"+this.terminals_[G]+"'");b.showPosition?Y="Parse error on line "+(I+1)+`: `+b.showPosition()+` Expecting `+U.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Y,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:U})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),f.push(b.yytext),r.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[N[1]][1],F.$=f[f.length-V],F._$={first_line:r[r.length-(V||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(V||1)].first_column,last_column:r[r.length-1].last_column},H&&(F._$.range=[r[r.length-(V||1)].range[0],r[r.length-1].range[1]]),X=this.performAction.apply(F,[w,$,I,S.yy,N[1],f,r].concat(C)),typeof X<"u")return X;V&&(i=i.slice(0,-1*V*2),f=f.slice(0,-1*V),r=r.slice(0,-1*V)),i.push(this.productions_[N[1]][0]),f.push(F.$),r.push(F._$),tt=v[i[i.length-2]][i[i.length-1]],i.push(tt);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:l(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:l(function(e,s){return this.yy=s||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var s=e.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:l(function(e){var s=e.length,i=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===h.length?this.yylloc.first_column:0)+h[h.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(e){this.unput(this.match.slice(e))},"less"),pastInput:l(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var e=this.pastInput(),s=new Array(e.length+1).join("-");return e+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-B1mQtsyC.js b/apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-D9J7zYIT.js similarity index 98% rename from apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-B1mQtsyC.js rename to apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-D9J7zYIT.js index 066dc575524..e841d808315 100644 --- a/apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-B1mQtsyC.js +++ b/apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-D9J7zYIT.js @@ -1,4 +1,4 @@ -import{g as gt}from"./chunk-5VM5RSS4-K_NNkrmw.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-32BRIVSS-0ImWpiFu.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,d as X,e as $t,p as Mt}from"./mermaid.core-CGrLstUA.js";import{d as it}from"./arc-C525Mmp6.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`: +import{g as gt}from"./chunk-5VM5RSS4-BV4ucc4y.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-32BRIVSS-BXcVdJ-W.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,d as X,e as $t,p as Mt}from"./mermaid.core-XMN3hSDH.js";import{d as it}from"./arc-x24dd6EE.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`: `+_.showPosition()+` Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-Bpgk0PjP.js b/apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-BFENhRSJ.js similarity index 99% rename from apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-Bpgk0PjP.js rename to apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-BFENhRSJ.js index 046a69cab66..2824f7f1f0d 100644 --- a/apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-Bpgk0PjP.js +++ b/apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-BFENhRSJ.js @@ -1,4 +1,4 @@ -import{_ as o,l as te,c as H,D as fe,af as ye,ag as be,ah as me,ad as _e,B as K,i as j,G as ke,J as Ee,aa as Se,ab as ce,ac as le}from"./mermaid.core-CGrLstUA.js";import{g as Ne}from"./chunk-5VM5RSS4-K_NNkrmw.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],F=[1,31],N=[6,7,11,24],B=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,u,t,U){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:F}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(B,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:F}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(B,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(i,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;t.push(q);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,Q,G={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`: +import{_ as o,l as te,c as H,D as fe,af as ye,ag as be,ah as me,ad as _e,B as K,i as j,G as ke,J as Ee,aa as Se,ab as ce,ac as le}from"./mermaid.core-XMN3hSDH.js";import{g as Ne}from"./chunk-5VM5RSS4-BV4ucc4y.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],F=[1,31],N=[6,7,11,24],B=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,u,t,U){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:F}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(B,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:F}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(B,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(i,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;t.push(q);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,Q,G={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`: `+b.showPosition()+` Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[E]||E,line:b.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),E=null,se=b.yyleng,c=b.yytext,W=b.yylineno,q=b.yylloc;break;case 2:if(C=this.productions_[x[1]][1],G.$=u[u.length-C],G._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(G._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(G,[c,se,W,R.yy,x[1],u,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(G.$),t.push(G._$),oe=U[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},Y=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/linear-Cu3jckud.js b/apps/kimi-code/dist-web/assets/linear-DZwFWlPa.js similarity index 98% rename from apps/kimi-code/dist-web/assets/linear-Cu3jckud.js rename to apps/kimi-code/dist-web/assets/linear-DZwFWlPa.js index 4c1c1c94e65..82f4e9ae824 100644 --- a/apps/kimi-code/dist-web/assets/linear-Cu3jckud.js +++ b/apps/kimi-code/dist-web/assets/linear-DZwFWlPa.js @@ -1 +1 @@ -import{b9 as j,ba as p,bb as w,bc as k,bd as q}from"./mermaid.core-CGrLstUA.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:nr?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i>>1;t(o[l],c)<0?i=l+1:h=l}while(i>>1;t(o[l],c)<=0?i=l+1:h=l}while(ii&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/ir&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*ir&&--c),c0))return[];if(n===r)return[n];const e=r=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;ir&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t}; +import{b9 as j,ba as p,bb as w,bc as k,bd as q}from"./mermaid.core-XMN3hSDH.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:nr?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i>>1;t(o[l],c)<0?i=l+1:h=l}while(i>>1;t(o[l],c)<=0?i=l+1:h=l}while(ii&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/ir&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*ir&&--c),c0))return[];if(n===r)return[n];const e=r=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;ir&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t}; diff --git a/apps/kimi-code/dist-web/assets/mermaid.core-CGrLstUA.js b/apps/kimi-code/dist-web/assets/mermaid.core-XMN3hSDH.js similarity index 99% rename from apps/kimi-code/dist-web/assets/mermaid.core-CGrLstUA.js rename to apps/kimi-code/dist-web/assets/mermaid.core-XMN3hSDH.js index 255df8bf38f..f6e785ee304 100644 --- a/apps/kimi-code/dist-web/assets/mermaid.core-CGrLstUA.js +++ b/apps/kimi-code/dist-web/assets/mermaid.core-XMN3hSDH.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-VKFMJZFB-BuaL-XNK.js","assets/chunk-RYQCIY6F-Bg4GHN0V.js","assets/graph-DOmOIIwC.js","assets/map-DxJ2ADlA.js","assets/layout-D-LzfAck.js","assets/index-CvgiEu-R.js","assets/index-BxiMZi52.css","assets/_commonjsHelpers-CqkleIqs.js","assets/swimlanes-5IMT3BWC-48M2vHyU.js","assets/cose-bilkent-JH36ORCC-CyvFRDuS.js","assets/cytoscape.esm-OyMbaexL.js","assets/c4Diagram-LMCZKHZV-BRKLxvwh.js","assets/chunk-32BRIVSS-0ImWpiFu.js","assets/flowDiagram-23GEKE2U-CSk8qFwd.js","assets/chunk-5VM5RSS4-K_NNkrmw.js","assets/chunk-XXDRQBXY-BwEKpC0s.js","assets/chunk-VR4S4FIN-Cp8JVohH.js","assets/channel-5_2atmZK.js","assets/swimlanesDiagram-G3AALYLV-gPkWeD2t.js","assets/erDiagram-Q63AITRT-q8LwmVdA.js","assets/gitGraphDiagram-IHSO6WYX-DbTFMBma.js","assets/chunk-2Q5K7J3B-CldwFnN4.js","assets/chunk-JWPE2WC7-CnsTQcA8.js","assets/cynefin-VYW2F7L2-Ct8il_Gb.js","assets/ganttDiagram-NO4QXBWP-BliHEJI2.js","assets/linear-Cu3jckud.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-FWYZ7A6U-Bge59IZG.js","assets/pieDiagram-ENE6RG2P-h3KzynJ8.js","assets/arc-C525Mmp6.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-ABIIQ3AL-DFm-eCQb.js","assets/xychartDiagram-FW5EYKEG-DfHxJPKU.js","assets/requirementDiagram-TGXJPOKE-CSxNTrK4.js","assets/sequenceDiagram-DBY2YBRQ-Cr-Sj8Pb.js","assets/classDiagram-OUVF2IWQ-CNk36E8O.js","assets/chunk-V7JOEXUC-5w7loxVR.js","assets/classDiagram-v2-EOCWNBFH-CNk36E8O.js","assets/stateDiagram-2N3HPSRC-BYfWdLSL.js","assets/chunk-EX3LRPZG-Du5tJK2w.js","assets/stateDiagram-v2-6OUMAXLB-D2Op2fy3.js","assets/journeyDiagram-5HDEW3XC-B1mQtsyC.js","assets/timeline-definition-FHXFAJF6-CsGFMDtB.js","assets/mindmap-definition-LN4V7U3C-jRWZCKa4.js","assets/kanban-definition-HUTT4EX6-Bpgk0PjP.js","assets/sankeyDiagram-HTMAVEWB-Dd9T4UrJ.js","assets/diagram-NH7WQ7WH-l2Pip_5t.js","assets/diagram-WEI45ONY-tJhlXXXb.js","assets/blockDiagram-677ZJIJ3-DHUznNgz.js","assets/diagram-OA4YK3LP-DO8otT0J.js","assets/architectureDiagram-ZJ3FMSHR-DsZ4TpMi.js","assets/diagram-FQU43EPY-BXKGXolr.js","assets/ishikawaDiagram-FXEZZL3T-y8Y7SwAW.js","assets/vennDiagram-L72KCM5P-B5PLrg4a.js","assets/diagram-G47NLZAW-DsoHq3g9.js","assets/wardleyDiagram-EHGQE667-B6OLyL9l.js","assets/cynefinDiagram-TSTJHNR4-BP26cYtj.js","assets/railroadDiagram-RFXS5EU6-Buc-7xRH.js","assets/chunk-MOJQB5TN-BWiH3s-c.js","assets/ebnfDiagram-CCIWWBDH-DuVJXtzP.js","assets/abnfDiagram-VRR7QNED-DZ5l2NNF.js","assets/pegDiagram-2B236MQR-BBHHexxE.js"])))=>i.map(i=>d[i]); -import{bR as nt}from"./index-CvgiEu-R.js";import{g as gy}from"./_commonjsHelpers-CqkleIqs.js";var _c=Object.defineProperty,p=(e,t)=>_c(e,"name",{value:t,configurable:!0}),my=(e,t)=>{for(var r in t)_c(e,r,{get:t[r],enumerable:!0})},So={exports:{}},yy=So.exports,zl;function Cy(){return zl||(zl=1,(function(e,t){(function(r,i){e.exports=i()})(yy,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var A=["th","st","nd","rd"],F=$%100;return"["+$+(A[(F-20)%10]||A[F]||A[0])+"]"}},k=function($,A,F){var D=String($);return!D||D.length>=A?$:""+Array(A+1-D.length).join(F)+$},T={s:k,z:function($){var A=-$.utcOffset(),F=Math.abs(A),D=Math.floor(F/60),M=F%60;return(A<=0?"+":"-")+k(D,2,"0")+":"+k(M,2,"0")},m:function $(A,F){if(A.date()1)return $(Y[0])}else{var G=A.name;_[G]=A,M=G}return!D&&M&&(S=M),M||!D&&S},R=function($,A){if(v($))return $.clone();var F=typeof A=="object"?A:{};return F.date=$,F.args=arguments,new z(F)},P=T;P.l=N,P.i=v,P.w=function($,A){return R($,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var z=(function(){function $(F){this.$L=N(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[L]=!0}var A=$.prototype;return A.parse=function(F){this.$d=(function(D){var M=D.date,H=D.utc;if(M===null)return new Date(NaN);if(P.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var Y=M.match(y);if(Y){var G=Y[2]-1||0,lt=(Y[7]||"0").substring(0,3);return H?new Date(Date.UTC(Y[1],G,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,lt)):new Date(Y[1],G,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,lt)}}return new Date(M)})(F),this.init()},A.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},A.$utils=function(){return P},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(F,D){var M=R(F);return this.startOf(D)<=M&&M<=this.endOf(D)},A.isAfter=function(F,D){return R(F){},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},Cn=p(function(e="fatal"){let t=Ne.fatal;typeof e=="string"?e.toLowerCase()in Ne&&(t=Ne[e]):typeof e=="number"&&(t=e),q.trace=()=>{},q.debug=()=>{},q.info=()=>{},q.warn=()=>{},q.error=()=>{},q.fatal=()=>{},t<=Ne.fatal&&(q.fatal=console.error?console.error.bind(console,he("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",he("FATAL"))),t<=Ne.error&&(q.error=console.error?console.error.bind(console,he("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",he("ERROR"))),t<=Ne.warn&&(q.warn=console.warn?console.warn.bind(console,he("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",he("WARN"))),t<=Ne.info&&(q.info=console.info?console.info.bind(console,he("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",he("INFO"))),t<=Ne.debug&&(q.debug=console.debug?console.debug.bind(console,he("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",he("DEBUG"))),t<=Ne.trace&&(q.trace=console.debug?console.debug.bind(console,he("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",he("TRACE")))},"setLogLevel"),he=p(e=>`%c${by().format("ss.SSS")} : ${e} : `,"format");const _o={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return _o.hue2rgb(s,o,e+1/3)*255;case"g":return _o.hue2rgb(s,o,e)*255;case"b":return _o.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},wy={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},at={channel:_o,lang:ky,unit:wy},Je={};for(let e=0;e<=255;e++)Je[e]=at.unit.dec2hex(e);const Gt={ALL:0,RGB:1,HSL:2};class Ty{constructor(){this.type=Gt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Gt.ALL}is(t){return this.type===t}}class Sy{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Ty}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Gt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=at.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=at.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=at.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=at.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=at.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=at.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Gt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Gt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Gt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Gt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Gt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Gt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Gt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Gt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Gt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Gt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Gt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Gt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const gs=new Sy({r:0,g:0,b:0,a:0},"transparent"),Xr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Xr.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return gs.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${Je[Math.round(t)]}${Je[Math.round(r)]}${Je[Math.round(i)]}${Je[Math.round(o*255)]}`:`#${Je[Math.round(t)]}${Je[Math.round(r)]}${Je[Math.round(i)]}`}},Cr={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Cr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return at.channel.clamp.h(parseFloat(r)*.9);case"rad":return at.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return at.channel.clamp.h(parseFloat(r)*360)}}return at.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Cr.re);if(!r)return;const[,i,o,s,a,n]=r;return gs.set({h:Cr._hue2deg(i),s:at.channel.clamp.s(parseFloat(o)),l:at.channel.clamp.l(parseFloat(s)),a:a?at.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%, ${o})`:`hsl(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%)`}},Ei={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Ei.colors[e];if(t)return Xr.parse(t)},stringify:e=>{const t=Xr.stringify(e);for(const r in Ei.colors)if(Ei.colors[r]===t)return r}},wi={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(wi.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return gs.set({r:at.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:at.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:at.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?at.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)}, ${at.lang.round(o)})`:`rgb(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)})`}},Ee={format:{keyword:Ei,hex:Xr,rgb:wi,rgba:wi,hsl:Cr,hsla:Cr},parse:e=>{if(typeof e!="string")return e;const t=Xr.parse(e)||wi.parse(e)||Cr.parse(e)||Ei.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Gt.HSL)||e.data.r===void 0?Cr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?wi.stringify(e):Xr.stringify(e)},Bc=(e,t)=>{const r=Ee.parse(e);for(const i in t)r[i]=at.channel.clamp[i](t[i]);return Ee.stringify(r)},or=(e,t,r=0,i=1)=>{if(typeof e!="number")return Bc(e,{a:t});const o=gs.set({r:at.channel.clamp.r(e),g:at.channel.clamp.g(t),b:at.channel.clamp.b(r),a:at.channel.clamp.a(i)});return Ee.stringify(o)},_y=e=>{const{r:t,g:r,b:i}=Ee.parse(e),o=.2126*at.channel.toLinear(t)+.7152*at.channel.toLinear(r)+.0722*at.channel.toLinear(i);return at.lang.round(o)},By=e=>_y(e)>=.5,ke=e=>!By(e),vc=(e,t,r)=>{const i=Ee.parse(e),o=i[t],s=at.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Ee.stringify(i)},O=(e,t)=>vc(e,"l",t),I=(e,t)=>vc(e,"l",-t),x=(e,t)=>{const r=Ee.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return Bc(e,i)},vy=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Ee.parse(e),{r:n,g:l,b:c,a:h}=Ee.parse(t),d=r/100,f=d*2-1,u=a-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,C=i*m+n*y,b=o*m+l*y,k=s*m+c*y,T=a*d+h*(1-d);return or(C,b,k,T)},B=(e,t=100)=>{const r=Ee.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,vy(r,e,t)};/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */function Hl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);ri.map(i=>d[i]); +import{bR as nt}from"./index-ChnXJINq.js";import{g as gy}from"./_commonjsHelpers-CqkleIqs.js";var _c=Object.defineProperty,p=(e,t)=>_c(e,"name",{value:t,configurable:!0}),my=(e,t)=>{for(var r in t)_c(e,r,{get:t[r],enumerable:!0})},So={exports:{}},yy=So.exports,zl;function Cy(){return zl||(zl=1,(function(e,t){(function(r,i){e.exports=i()})(yy,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var A=["th","st","nd","rd"],F=$%100;return"["+$+(A[(F-20)%10]||A[F]||A[0])+"]"}},k=function($,A,F){var D=String($);return!D||D.length>=A?$:""+Array(A+1-D.length).join(F)+$},T={s:k,z:function($){var A=-$.utcOffset(),F=Math.abs(A),D=Math.floor(F/60),M=F%60;return(A<=0?"+":"-")+k(D,2,"0")+":"+k(M,2,"0")},m:function $(A,F){if(A.date()1)return $(Y[0])}else{var G=A.name;_[G]=A,M=G}return!D&&M&&(S=M),M||!D&&S},R=function($,A){if(v($))return $.clone();var F=typeof A=="object"?A:{};return F.date=$,F.args=arguments,new z(F)},P=T;P.l=N,P.i=v,P.w=function($,A){return R($,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var z=(function(){function $(F){this.$L=N(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[L]=!0}var A=$.prototype;return A.parse=function(F){this.$d=(function(D){var M=D.date,H=D.utc;if(M===null)return new Date(NaN);if(P.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var Y=M.match(y);if(Y){var G=Y[2]-1||0,lt=(Y[7]||"0").substring(0,3);return H?new Date(Date.UTC(Y[1],G,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,lt)):new Date(Y[1],G,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,lt)}}return new Date(M)})(F),this.init()},A.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},A.$utils=function(){return P},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(F,D){var M=R(F);return this.startOf(D)<=M&&M<=this.endOf(D)},A.isAfter=function(F,D){return R(F){},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},Cn=p(function(e="fatal"){let t=Ne.fatal;typeof e=="string"?e.toLowerCase()in Ne&&(t=Ne[e]):typeof e=="number"&&(t=e),q.trace=()=>{},q.debug=()=>{},q.info=()=>{},q.warn=()=>{},q.error=()=>{},q.fatal=()=>{},t<=Ne.fatal&&(q.fatal=console.error?console.error.bind(console,he("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",he("FATAL"))),t<=Ne.error&&(q.error=console.error?console.error.bind(console,he("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",he("ERROR"))),t<=Ne.warn&&(q.warn=console.warn?console.warn.bind(console,he("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",he("WARN"))),t<=Ne.info&&(q.info=console.info?console.info.bind(console,he("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",he("INFO"))),t<=Ne.debug&&(q.debug=console.debug?console.debug.bind(console,he("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",he("DEBUG"))),t<=Ne.trace&&(q.trace=console.debug?console.debug.bind(console,he("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",he("TRACE")))},"setLogLevel"),he=p(e=>`%c${by().format("ss.SSS")} : ${e} : `,"format");const _o={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return _o.hue2rgb(s,o,e+1/3)*255;case"g":return _o.hue2rgb(s,o,e)*255;case"b":return _o.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},wy={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},at={channel:_o,lang:ky,unit:wy},Je={};for(let e=0;e<=255;e++)Je[e]=at.unit.dec2hex(e);const Gt={ALL:0,RGB:1,HSL:2};class Ty{constructor(){this.type=Gt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Gt.ALL}is(t){return this.type===t}}class Sy{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Ty}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Gt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=at.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=at.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=at.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=at.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=at.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=at.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Gt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Gt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Gt.HSL)&&r!==void 0?r:(this._ensureHSL(),at.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Gt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Gt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Gt.RGB)&&r!==void 0?r:(this._ensureRGB(),at.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Gt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Gt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Gt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Gt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Gt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Gt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const gs=new Sy({r:0,g:0,b:0,a:0},"transparent"),Xr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Xr.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return gs.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${Je[Math.round(t)]}${Je[Math.round(r)]}${Je[Math.round(i)]}${Je[Math.round(o*255)]}`:`#${Je[Math.round(t)]}${Je[Math.round(r)]}${Je[Math.round(i)]}`}},Cr={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Cr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return at.channel.clamp.h(parseFloat(r)*.9);case"rad":return at.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return at.channel.clamp.h(parseFloat(r)*360)}}return at.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Cr.re);if(!r)return;const[,i,o,s,a,n]=r;return gs.set({h:Cr._hue2deg(i),s:at.channel.clamp.s(parseFloat(o)),l:at.channel.clamp.l(parseFloat(s)),a:a?at.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%, ${o})`:`hsl(${at.lang.round(t)}, ${at.lang.round(r)}%, ${at.lang.round(i)}%)`}},Ei={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Ei.colors[e];if(t)return Xr.parse(t)},stringify:e=>{const t=Xr.stringify(e);for(const r in Ei.colors)if(Ei.colors[r]===t)return r}},wi={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(wi.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return gs.set({r:at.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:at.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:at.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?at.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)}, ${at.lang.round(o)})`:`rgb(${at.lang.round(t)}, ${at.lang.round(r)}, ${at.lang.round(i)})`}},Ee={format:{keyword:Ei,hex:Xr,rgb:wi,rgba:wi,hsl:Cr,hsla:Cr},parse:e=>{if(typeof e!="string")return e;const t=Xr.parse(e)||wi.parse(e)||Cr.parse(e)||Ei.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Gt.HSL)||e.data.r===void 0?Cr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?wi.stringify(e):Xr.stringify(e)},Bc=(e,t)=>{const r=Ee.parse(e);for(const i in t)r[i]=at.channel.clamp[i](t[i]);return Ee.stringify(r)},or=(e,t,r=0,i=1)=>{if(typeof e!="number")return Bc(e,{a:t});const o=gs.set({r:at.channel.clamp.r(e),g:at.channel.clamp.g(t),b:at.channel.clamp.b(r),a:at.channel.clamp.a(i)});return Ee.stringify(o)},_y=e=>{const{r:t,g:r,b:i}=Ee.parse(e),o=.2126*at.channel.toLinear(t)+.7152*at.channel.toLinear(r)+.0722*at.channel.toLinear(i);return at.lang.round(o)},By=e=>_y(e)>=.5,ke=e=>!By(e),vc=(e,t,r)=>{const i=Ee.parse(e),o=i[t],s=at.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Ee.stringify(i)},O=(e,t)=>vc(e,"l",t),I=(e,t)=>vc(e,"l",-t),x=(e,t)=>{const r=Ee.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return Bc(e,i)},vy=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Ee.parse(e),{r:n,g:l,b:c,a:h}=Ee.parse(t),d=r/100,f=d*2-1,u=a-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,C=i*m+n*y,b=o*m+l*y,k=s*m+c*y,T=a*d+h*(1-d);return or(C,b,k,T)},B=(e,t=100)=>{const r=Ee.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,vy(r,e,t)};/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */function Hl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r2?i-2:0),s=2;s1?r-1:0),o=1;o"u"?null:Ot(BigInt.prototype.toString),Vl=typeof Symbol>"u"?null:Ot(Symbol.prototype.toString),Nt=Ot(Object.prototype.hasOwnProperty),pi=Ot(Object.prototype.toString),zt=Ot(RegExp.prototype.test),fr=Wy(TypeError);function Ot(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:Ti;if(Yl&&Yl(e,null),!er(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){const s=r(o);s!==o&&($y(t)||(t[i]=s),o=s)}e[o]=!0}return e}function zy(e){for(let t=0;t/g),Vy=jt(/\${[\w\W]*/g),Zy=jt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ky=jt(/^aria-[\-\w]+$/),th=jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qy=jt(/^(?:\w+script|data):/i),Jy=jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),t0=jt(/^html$/i),e0=jt(/^[a-z][.\w]*(-[.\w]+)+$/i),eh=jt(/<[/\w!]/g),r0=jt(/<[/\w]/g),i0=jt(/<\/no(script|embed|frames)/i),o0=jt(/\/>/i),_e={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},s0=function(){return typeof window>"u"?null:window},a0=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(i=r.getAttribute(o));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},rh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Qe=function(t,r,i,o){return Nt(t,r)&&er(t[r])?mt(o.base?Qt(o.base):{},t[r],o.transform):i};function Ac(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s0();const t=j=>Ac(j);if(t.version="3.4.11",t.removed=[],!e||!e.document||e.document.nodeType!==_e.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const i=r,o=i.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,n=e.Element,l=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const h=e.DOMParser,d=e.trustedTypes,f=n.prototype,u=Be(f,"cloneNode"),g=Be(f,"remove"),m=Be(f,"nextSibling"),y=Be(f,"childNodes"),C=Be(f,"parentNode"),b=Be(f,"shadowRoot"),k=Be(f,"attributes"),T=a&&a.prototype?Be(a.prototype,"nodeType"):null,S=a&&a.prototype?Be(a.prototype,"nodeName"):null;if(typeof s=="function"){const j=r.createElement("template");j.content&&j.content.ownerDocument&&(r=j.content.ownerDocument)}let _,L="",v,N=!1,R=0;const P=function(){if(R>0)throw fr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(w){P(),R++;try{return _.createHTML(w)}finally{R--}},W=function(w){P(),R++;try{return _.createScriptURL(w)}finally{R--}},$=function(){return N||(v=a0(d,o),N=!0),v},A=r,F=A.implementation,D=A.createNodeIterator,M=A.createDocumentFragment,H=A.getElementsByTagName,Y=i.importNode;let G=rh();t.isSupported=typeof Lc=="function"&&typeof C=="function"&&F&&F.createHTMLDocument!==void 0;const lt=Gy,ht=Xy,dt=Vy,bt=Zy,et=Ky,ft=Qy,kt=Jy,Bt=e0;let St=th,ut=null;const de=mt({},[...Zl,...Qs,...Js,...ta,...Kl]);let Tt=null;const Mr=mt({},[...Ql,...ea,...Jl,...uo]);let Lt=Object.seal(zr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),li=null,bl=null;const Ve=Object.seal(zr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let kl=!0,Os=!0,wl=!1,Tl=!0,Ze=!1,hi=!0,dr=!1,Is=!1,Ds=null,Ps=null,Rs=!1,$r=!1,oo=!1,so=!1,Sl=!0,_l=!1;const Bl="user-content-";let Ns=!0,qs=!1,Or={},Te=null;const Ws=mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let vl=null;const Ll=mt({},["audio","video","img","source","image","track"]);let zs=null;const Fl=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ao="http://www.w3.org/1998/Math/MathML",no="http://www.w3.org/2000/svg",Se="http://www.w3.org/1999/xhtml";let Ir=Se,Hs=!1,Ys=null;const Jm=mt({},[ao,no,Se],Ks),Al=Ut(["mi","mo","mn","ms","mtext"]);let Us=mt({},Al);const El=Ut(["annotation-xml"]);let js=mt({},El);const ty=mt({},["title","style","font","a","script"]);let ci=null;const ey=["application/xhtml+xml","text/html"],ry="text/html";let Ft=null,Dr=null;const iy=r.createElement("form"),Ml=function(w){return w instanceof RegExp||w instanceof Function},Gs=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Dr&&Dr===w)return;(!w||typeof w!="object")&&(w={}),w=Qt(w),ci=ey.indexOf(w.PARSER_MEDIA_TYPE)===-1?ry:w.PARSER_MEDIA_TYPE,Ft=ci==="application/xhtml+xml"?Ks:Ti,ut=Qe(w,"ALLOWED_TAGS",de,{transform:Ft}),Tt=Qe(w,"ALLOWED_ATTR",Mr,{transform:Ft}),Ys=Qe(w,"ALLOWED_NAMESPACES",Jm,{transform:Ks}),zs=Qe(w,"ADD_URI_SAFE_ATTR",Fl,{transform:Ft,base:Fl}),vl=Qe(w,"ADD_DATA_URI_TAGS",Ll,{transform:Ft,base:Ll}),Te=Qe(w,"FORBID_CONTENTS",Ws,{transform:Ft}),li=Qe(w,"FORBID_TAGS",Qt({}),{transform:Ft}),bl=Qe(w,"FORBID_ATTR",Qt({}),{transform:Ft}),Or=Nt(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?Qt(w.USE_PROFILES):w.USE_PROFILES:!1,kl=w.ALLOW_ARIA_ATTR!==!1,Os=w.ALLOW_DATA_ATTR!==!1,wl=w.ALLOW_UNKNOWN_PROTOCOLS||!1,Tl=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ze=w.SAFE_FOR_TEMPLATES||!1,hi=w.SAFE_FOR_XML!==!1,dr=w.WHOLE_DOCUMENT||!1,$r=w.RETURN_DOM||!1,oo=w.RETURN_DOM_FRAGMENT||!1,so=w.RETURN_TRUSTED_TYPE||!1,Rs=w.FORCE_BODY||!1,Sl=w.SANITIZE_DOM!==!1,_l=w.SANITIZE_NAMED_PROPS||!1,Ns=w.KEEP_CONTENT!==!1,qs=w.IN_PLACE||!1,St=Yy(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:th,Ir=typeof w.NAMESPACE=="string"?w.NAMESPACE:Se,Us=Nt(w,"MATHML_TEXT_INTEGRATION_POINTS")&&w.MATHML_TEXT_INTEGRATION_POINTS&&typeof w.MATHML_TEXT_INTEGRATION_POINTS=="object"?Qt(w.MATHML_TEXT_INTEGRATION_POINTS):mt({},Al),js=Nt(w,"HTML_INTEGRATION_POINTS")&&w.HTML_INTEGRATION_POINTS&&typeof w.HTML_INTEGRATION_POINTS=="object"?Qt(w.HTML_INTEGRATION_POINTS):mt({},El);const E=Nt(w,"CUSTOM_ELEMENT_HANDLING")&&w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING=="object"?Qt(w.CUSTOM_ELEMENT_HANDLING):zr(null);if(Lt=zr(null),Nt(E,"tagNameCheck")&&Ml(E.tagNameCheck)&&(Lt.tagNameCheck=E.tagNameCheck),Nt(E,"attributeNameCheck")&&Ml(E.attributeNameCheck)&&(Lt.attributeNameCheck=E.attributeNameCheck),Nt(E,"allowCustomizedBuiltInElements")&&typeof E.allowCustomizedBuiltInElements=="boolean"&&(Lt.allowCustomizedBuiltInElements=E.allowCustomizedBuiltInElements),jt(Lt),Ze&&(Os=!1),oo&&($r=!0),Or&&(ut=mt({},Kl),Tt=zr(null),Or.html===!0&&(mt(ut,Zl),mt(Tt,Ql)),Or.svg===!0&&(mt(ut,Qs),mt(Tt,ea),mt(Tt,uo)),Or.svgFilters===!0&&(mt(ut,Js),mt(Tt,ea),mt(Tt,uo)),Or.mathMl===!0&&(mt(ut,ta),mt(Tt,Jl),mt(Tt,uo))),Ve.tagCheck=null,Ve.attributeCheck=null,Nt(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?Ve.tagCheck=w.ADD_TAGS:er(w.ADD_TAGS)&&(ut===de&&(ut=Qt(ut)),mt(ut,w.ADD_TAGS,Ft))),Nt(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?Ve.attributeCheck=w.ADD_ATTR:er(w.ADD_ATTR)&&(Tt===Mr&&(Tt=Qt(Tt)),mt(Tt,w.ADD_ATTR,Ft))),Nt(w,"ADD_URI_SAFE_ATTR")&&er(w.ADD_URI_SAFE_ATTR)&&mt(zs,w.ADD_URI_SAFE_ATTR,Ft),Nt(w,"FORBID_CONTENTS")&&er(w.FORBID_CONTENTS)&&(Te===Ws&&(Te=Qt(Te)),mt(Te,w.FORBID_CONTENTS,Ft)),Nt(w,"ADD_FORBID_CONTENTS")&&er(w.ADD_FORBID_CONTENTS)&&(Te===Ws&&(Te=Qt(Te)),mt(Te,w.ADD_FORBID_CONTENTS,Ft)),Ns&&(ut["#text"]=!0),dr&&mt(ut,["html","head","body"]),ut.table&&(mt(ut,["tbody"]),delete li.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw fr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw fr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const U=_;_=w.TRUSTED_TYPES_POLICY;try{L=z("")}catch(J){throw _=U,J}}else w.TRUSTED_TYPES_POLICY===null?(_=void 0,L=""):(_===void 0&&(_=$()),_&&typeof L=="string"&&(L=z("")));Ut&&Ut(w),Dr=w},$l=mt({},[...Qs,...Js,...Uy]),Ol=mt({},[...ta,...jy]),oy=function(w,E,U){return E.namespaceURI===Se?w==="svg":E.namespaceURI===ao?w==="svg"&&(U==="annotation-xml"||Us[U]):!!$l[w]},sy=function(w,E,U){return E.namespaceURI===Se?w==="math":E.namespaceURI===no?w==="math"&&js[U]:!!Ol[w]},ay=function(w,E,U){return E.namespaceURI===no&&!js[U]||E.namespaceURI===ao&&!Us[U]?!1:!Ol[w]&&(ty[w]||!$l[w])},ny=function(w){let E=C(w);(!E||!E.tagName)&&(E={namespaceURI:Ir,tagName:"template"});const U=Ti(w.tagName),J=Ti(E.tagName);return Ys[w.namespaceURI]?w.namespaceURI===no?oy(U,E,J):w.namespaceURI===ao?sy(U,E,J):w.namespaceURI===Se?ay(U,E,J):!!(ci==="application/xhtml+xml"&&Ys[w.namespaceURI]):!1},Ke=function(w){Rr(t.removed,{element:w});try{C(w).removeChild(w)}catch{if(g(w),!C(w))throw fr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Il=function(w){const E=y(w);if(E){const J=[];ui(E,pt=>{Rr(J,pt)}),ui(J,pt=>{try{g(pt)}catch{}})}const U=k(w);if(U)for(let J=U.length-1;J>=0;--J){const pt=U[J],yt=pt&&pt.name;if(typeof yt=="string")try{w.removeAttribute(yt)}catch{}}},ur=function(w,E){try{Rr(t.removed,{attribute:E.getAttributeNode(w),from:E})}catch{Rr(t.removed,{attribute:null,from:E})}if(E.removeAttribute(w),w==="is")if($r||oo)try{Ke(E)}catch{}else try{E.setAttribute(w,"")}catch{}},ly=function(w){const E=k(w);if(E)for(let U=E.length-1;U>=0;--U){const J=E[U],pt=J&&J.name;if(!(typeof pt!="string"||Tt[Ft(pt)]))try{w.removeAttribute(pt)}catch{}}},hy=function(w){const E=[w];for(;E.length>0;){const U=E.pop();(T?T(U):U.nodeType)===_e.element&&ly(U);const pt=y(U);if(pt)for(let yt=pt.length-1;yt>=0;--yt)E.push(pt[yt])}},Dl=function(w){let E=null,U=null;if(Rs)w=""+w;else{const yt=jl(w,/^[\r\n\t ]+/);U=yt&&yt[0]}ci==="application/xhtml+xml"&&Ir===Se&&(w=''+w+"");const J=_?z(w):w;if(Ir===Se)try{E=new h().parseFromString(J,ci)}catch{}if(!E||!E.documentElement){E=F.createDocument(Ir,"template",null);try{E.documentElement.innerHTML=Hs?L:J}catch{}}const pt=E.body||E.documentElement;return w&&U&&pt.insertBefore(r.createTextNode(U),pt.childNodes[0]||null),Ir===Se?H.call(E,dr?"html":"body")[0]:dr?E.documentElement:pt},Pl=function(w){return D.call(w.ownerDocument||w,w,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},lo=function(w){return w=fi(w,lt," "),w=fi(w,ht," "),w=fi(w,dt," "),w},Xs=function(w){var E;w.normalize();const U=D.call(w.ownerDocument||w,w,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let J=U.nextNode();for(;J;)J.data=lo(J.data),J=U.nextNode();const pt=(E=w.querySelectorAll)===null||E===void 0?void 0:E.call(w,"template");pt&&ui(pt,yt=>{Pr(yt.content)&&Xs(yt.content)})},ho=function(w){const E=S?S(w):null;return typeof E!="string"||Ft(E)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==k(w)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==T(w)||w.childNodes!==y(w)},Pr=function(w){if(!T||typeof w!="object"||w===null)return!1;try{return T(w)===_e.documentFragment}catch{return!1}},di=function(w){if(!T||typeof w!="object"||w===null)return!1;try{return typeof T(w)=="number"}catch{return!1}};function Re(j,w,E){j.length!==0&&ui(j,U=>{U.call(t,w,E,Dr)})}const cy=function(w,E){return!!(hi&&w.hasChildNodes()&&!di(w.firstElementChild)&&zt(eh,w.textContent)&&zt(eh,w.innerHTML)||hi&&w.namespaceURI===Se&&E==="style"&&di(w.firstElementChild)||w.nodeType===_e.processingInstruction||hi&&w.nodeType===_e.comment&&zt(r0,w.data))},dy=function(w,E){if(!li[E]&&ql(E)&&(Lt.tagNameCheck instanceof RegExp&&zt(Lt.tagNameCheck,E)||Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(E)))return!1;if(Ns&&!Te[E]){const U=C(w),J=y(w);if(J&&U){const pt=J.length;for(let yt=pt-1;yt>=0;--yt){const Rt=qs?J[yt]:u(J[yt],!0);U.insertBefore(Rt,m(w))}}}return Ke(w),!0},Rl=function(w){if(Re(G.beforeSanitizeElements,w,null),ho(w))return Ke(w),!0;const E=Ft(S?S(w):w.nodeName);if(Re(G.uponSanitizeElement,w,{tagName:E,allowedTags:ut}),cy(w,E))return Ke(w),!0;if(li[E]||!(Ve.tagCheck instanceof Function&&Ve.tagCheck(E))&&!ut[E])return dy(w,E);if((T?T(w):w.nodeType)===_e.element&&!ny(w)||(E==="noscript"||E==="noembed"||E==="noframes")&&zt(i0,w.innerHTML))return Ke(w),!0;if(Ze&&w.nodeType===_e.text){const J=lo(w.textContent);w.textContent!==J&&(Rr(t.removed,{element:w.cloneNode()}),w.textContent=J)}return Re(G.afterSanitizeElements,w,null),!1},Nl=function(w,E,U){if(bl[E]||Sl&&(E==="id"||E==="name")&&(U in r||U in iy))return!1;const J=Tt[E]||Ve.attributeCheck instanceof Function&&Ve.attributeCheck(E,w);if(!(Os&&zt(bt,E))){if(!(kl&&zt(et,E))){if(J){if(!zs[E]){if(!zt(St,fi(U,kt,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&w!=="script"&&Gl(U,"data:")===0&&vl[w])){if(!(wl&&!zt(ft,fi(U,kt,"")))){if(U)return!1}}}}}else if(!(ql(w)&&(Lt.tagNameCheck instanceof RegExp&&zt(Lt.tagNameCheck,w)||Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(w))&&(Lt.attributeNameCheck instanceof RegExp&&zt(Lt.attributeNameCheck,E)||Lt.attributeNameCheck instanceof Function&&Lt.attributeNameCheck(E,w))||E==="is"&&Lt.allowCustomizedBuiltInElements&&(Lt.tagNameCheck instanceof RegExp&&zt(Lt.tagNameCheck,U)||Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(U))))return!1}}return!0},uy=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ql=function(w){return!uy[Ti(w)]&&zt(Bt,w)},fy=function(w,E,U,J){if(_&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!U)switch(d.getAttributeType(w,E)){case"TrustedHTML":return z(J);case"TrustedScriptURL":return W(J)}return J},py=function(w,E,U,J){try{U?w.setAttributeNS(U,E,J):w.setAttribute(E,J),ho(w)?Ke(w):Ul(t.removed)}catch{ur(E,w)}},Wl=function(w){Re(G.beforeSanitizeAttributes,w,null);const E=w.attributes;if(!E||ho(w))return;const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Tt,forceKeepAttr:void 0};let J=E.length;const pt=Ft(w.nodeName);for(;J--;){const yt=E[J],Rt=yt.name,Mt=yt.namespaceURI,le=yt.value,ue=Ft(Rt),Zs=le;let Kt=Rt==="value"?Zs:Ry(Zs);if(U.attrName=ue,U.attrValue=Kt,U.keepAttr=!0,U.forceKeepAttr=void 0,Re(G.uponSanitizeAttribute,w,U),Kt=U.attrValue,_l&&(ue==="id"||ue==="name")&&Gl(Kt,Bl)!==0&&(ur(Rt,w),Kt=Bl+Kt),hi&&zt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Kt)){ur(Rt,w);continue}if(ue==="attributename"&&jl(Kt,"href")){ur(Rt,w);continue}if(!U.forceKeepAttr){if(!U.keepAttr){ur(Rt,w);continue}if(!Tl&&zt(o0,Kt)){ur(Rt,w);continue}if(Ze&&(Kt=lo(Kt)),!Nl(pt,ue,Kt)){ur(Rt,w);continue}Kt=fy(pt,ue,Mt,Kt),Kt!==Zs&&py(w,Rt,Mt,Kt)}}Re(G.afterSanitizeAttributes,w,null)},co=function(w){let E=null;const U=Pl(w);for(Re(G.beforeSanitizeShadowDOM,w,null);E=U.nextNode();)if(Re(G.uponSanitizeShadowNode,E,null),Rl(E),Wl(E),Pr(E.content)&&co(E.content),(T?T(E):E.nodeType)===_e.element){const pt=b(E);Pr(pt)&&(Vs(pt),co(pt))}Re(G.afterSanitizeShadowDOM,w,null)},Vs=function(w){const E=[{node:w,shadow:null}];for(;E.length>0;){const U=E.pop();if(U.shadow){co(U.shadow);continue}const J=U.node,yt=(T?T(J):J.nodeType)===_e.element,Rt=y(J);if(Rt)for(let Mt=Rt.length-1;Mt>=0;--Mt)E.push({node:Rt[Mt],shadow:null});if(yt){const Mt=S?S(J):null;if(typeof Mt=="string"&&Ft(Mt)==="template"){const le=J.content;Pr(le)&&E.push({node:le,shadow:null})}}if(yt){const Mt=b(J);Pr(Mt)&&E.push({node:null,shadow:Mt},{node:Mt,shadow:null})}}};return t.sanitize=function(j){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,U=null,J=null,pt=null;if(Hs=!j,Hs&&(j=""),typeof j!="string"&&!di(j)&&(j=Hy(j),typeof j!="string"))throw fr("dirty is not a string, aborting");if(!t.isSupported)return j;Is?(ut=Ds,Tt=Ps):Gs(w),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(ut=Qt(ut)),G.uponSanitizeAttribute.length>0&&(Tt=Qt(Tt)),t.removed=[];const yt=qs&&typeof j!="string"&&di(j);if(yt){const le=S?S(j):j.nodeName;if(typeof le=="string"){const ue=Ft(le);if(!ut[ue]||li[ue])throw fr("root node is forbidden and cannot be sanitized in-place")}if(ho(j))throw fr("root node is clobbered and cannot be sanitized in-place");try{Vs(j)}catch(ue){throw Il(j),ue}}else if(di(j))E=Dl(""),U=E.ownerDocument.importNode(j,!0),U.nodeType===_e.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?E=U:E.appendChild(U),Vs(U);else{if(!$r&&!Ze&&!dr&&j.indexOf("<")===-1)return _&&so?z(j):j;if(E=Dl(j),!E)return $r?null:so?L:""}E&&Rs&&Ke(E.firstChild);const Rt=Pl(yt?j:E);try{for(;J=Rt.nextNode();)Rl(J),Wl(J),Pr(J.content)&&co(J.content)}catch(le){throw yt&&Il(j),le}if(yt)return ui(t.removed,le=>{le.element&&hy(le.element)}),Ze&&Xs(j),j;if($r){if(Ze&&Xs(E),oo)for(pt=M.call(E.ownerDocument);E.firstChild;)pt.appendChild(E.firstChild);else pt=E;return(Tt.shadowroot||Tt.shadowrootmode)&&(pt=Y.call(i,pt,!0)),pt}let Mt=dr?E.outerHTML:E.innerHTML;return dr&&ut["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&zt(t0,E.ownerDocument.doctype.name)&&(Mt=" `+Mt),Ze&&(Mt=lo(Mt)),_&&so?z(Mt):Mt},t.setConfig=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gs(j),Is=!0,Ds=ut,Ps=Tt},t.clearConfig=function(){Dr=null,Is=!1,Ds=null,Ps=null,_=v,L=""},t.isValidAttribute=function(j,w,E){Dr||Gs({});const U=Ft(j),J=Ft(w);return Nl(U,J,E)},t.addHook=function(j,w){typeof w=="function"&&Nt(G,j)&&Rr(G[j],w)},t.removeHook=function(j,w){if(Nt(G,j)){if(w!==void 0){const E=Dy(G[j],w);return E===-1?void 0:Py(G[j],E,1)[0]}return Ul(G[j])}},t.removeHooks=function(j){Nt(G,j)&&(G[j]=[])},t.removeAllHooks=function(){G=rh()},t}var Kr=Ac(),xa=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>xa(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=xa(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),Dt=xa,$e="#ffffff",Oe="#f2f2f2",st=p((e,t)=>t?x(e,{s:-40,l:10}):x(e,{s:-40,l:-10}),"mkBorder"),n0=class{static{p(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||st(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||st(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||st(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||I(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||I(this.mainBkg,10)):(this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||O(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},l0=p(e=>{const t=new n0;return t.calculate(e),t},"getThemeVariables"),h0=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=st(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(B("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=or(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=I("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=I(this.sectionBkgColor,10),this.taskBorderColor=or(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=or(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||O(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||I(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=O(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=O(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=O(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=B(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=x(this.primaryColor,{h:64}),this.fillType3=x(this.secondaryColor,{h:64}),this.fillType4=x(this.primaryColor,{h:-64}),this.fillType5=x(this.secondaryColor,{h:-64}),this.fillType6=x(this.primaryColor,{h:128}),this.fillType7=x(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330});for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},c0=p(e=>{const t=new h0;return t.calculate(e),t},"getThemeVariables"),d0=class{static{p(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=x(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=st(this.primaryColor,this.darkMode),this.secondaryBorderColor=st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=st(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=st(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=or(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||I(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||I(this.tertiaryColor,40);for(let e=0;e{this[r]==="calculated"&&(this[r]=void 0)}),typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},u0=p(e=>{const t=new d0;return t.calculate(e),t},"getThemeVariables"),f0=class{static{p(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=O("#cde498",10),this.primaryBorderColor=st(this.primaryColor,this.darkMode),this.secondaryBorderColor=st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=st(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.primaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=I(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||I(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||I(this.tertiaryColor,40);for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},p0=p(e=>{const t=new f0;return t.calculate(e),t},"getThemeVariables"),g0=class{static{p(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=O(this.contrast,55),this.background="#ffffff",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=st(this.primaryColor,this.darkMode),this.secondaryBorderColor=st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=st(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=O(this.contrast,55),this.border2=this.contrast,this.actorBorder=O(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},m0=p(e=>{const t=new g0;return t.calculate(e),t},"getThemeVariables"),y0=class{static{p(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=st(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||st(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||st(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||st(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=x(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||t,this.cScale2=this.cScale2||r,this.cScale3=this.cScale3||x(e,{h:30}),this.cScale4=this.cScale4||x(e,{h:60}),this.cScale5=this.cScale5||x(e,{h:90}),this.cScale6=this.cScale6||x(e,{h:120}),this.cScale7=this.cScale7||x(e,{h:150}),this.cScale8=this.cScale8||x(e,{h:210,l:150}),this.cScale9=this.cScale9||x(e,{h:270}),this.cScale10=this.cScale10||x(e,{h:300}),this.cScale11=this.cScale11||x(e,{h:330}),this.darkMode)for(let o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},C0=p(e=>{const t=new y0;return t.calculate(e),t},"getThemeVariables"),x0=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=st(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(B("#323D47"),10),this.border1="#ccc",this.border2=or(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||st(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||st(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||st(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},b0=p(e=>{const t=new x0;return t.calculate(e),t},"getThemeVariables"),k0=class{static{p(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=st("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||st(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||st(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||st(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=x(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},w0=p(e=>{const t=new k0;return t.calculate(e),t},"getThemeVariables"),T0=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=st(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(B("#323D47"),10),this.border1="#ccc",this.border2=or(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||st(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||st(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||st(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},S0=p(e=>{const t=new T0;return t.calculate(e),t},"getThemeVariables"),_0=class{static{p(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=st(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||st(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||st(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||st(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=x(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let o=0;o{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},B0=p(e=>{const t=new _0;return t.calculate(e),t},"getThemeVariables"),v0=class{static{p(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=st(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(B("#323D47"),10),this.border1="#ccc",this.border2=or(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||st(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||st(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||st(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||st(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?I(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||I(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},L0=p(e=>{const t=new v0;return t.calculate(e),t},"getThemeVariables"),He={base:{getThemeVariables:l0},dark:{getThemeVariables:c0},default:{getThemeVariables:u0},forest:{getThemeVariables:p0},neutral:{getThemeVariables:m0},neo:{getThemeVariables:C0},"neo-dark":{getThemeVariables:b0},redux:{getThemeVariables:w0},"redux-dark":{getThemeVariables:S0},"redux-color":{getThemeVariables:B0},"redux-dark-color":{getThemeVariables:L0}},Wt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Ec={...Wt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:He.default.getThemeVariables(),sequence:{...Wt.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Wt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Wt.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Wt.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Wt.pie,useWidth:984},xyChart:{...Wt.xyChart,useWidth:void 0},requirement:{...Wt.requirement,useWidth:void 0},packet:{...Wt.packet},eventmodeling:{...Wt.eventmodeling},treeView:{...Wt.treeView,useWidth:void 0},radar:{...Wt.radar},railroad:{...Wt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Wt.ishikawa},sankey:{...Wt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Wt.venn},cynefin:{...Wt.cynefin}},Mc=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Mc(e[i],"")]:[...r,t+i],[]),"keyify"),F0=new Set(Mc(Ec,"")),$c=Ec,A0={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},E0=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(q.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),Ro=p(e=>{if(q.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Ro(t));return}for(const t of Object.keys(e)){if(q.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!F0.has(t)||e[t]==null){q.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=A0[t];i?E0(e[t],i):(q.debug("sanitizing object",t),Ro(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(q.debug("sanitizing css option",t),e[t]=Oc(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}q.debug("After sanitization",e)}},"sanitizeDirective"),Oc=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ie=Dt({},Qr),No,Tr=[],Mi=Dt({},Qr),ms=p((e,t)=>{let r=Dt({},e),i={};for(const o of t)Pc(o),i=Dt(i,o);if(r=Dt(r,i),i.theme&&i.theme in He){const o=Dt({},No),s=Dt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in He&&(r.themeVariables=He[r.theme].getThemeVariables(s))}return Mi=r,Nc(Mi),Mi},"updateCurrentConfig"),M0=p(e=>(ie=Dt({},Qr),ie=Dt(ie,e),e.theme&&He[e.theme]&&(ie.themeVariables=He[e.theme].getThemeVariables(e.themeVariables)),ms(ie,Tr),ie),"setSiteConfig"),$0=p(e=>{No=Dt({},e)},"saveConfigFromInitialize"),O0=p(e=>(ie=Dt(ie,e),ms(ie,Tr),ie),"updateSiteConfig"),Ic=p(()=>Dt({},ie),"getSiteConfig"),Dc=p(e=>(Nc(e),Dt(Mi,e),vt()),"setConfig"),vt=p(()=>Dt({},Mi),"getConfig"),Pc=p(e=>{e&&(["secure",...ie.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(q.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Pc(e[t])}))},"sanitize"),I0=p(e=>{Ro(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Tr.push(e),ms(ie,Tr)},"addDirective"),qo=p((e=ie)=>{Tr=[],ms(e,Tr)},"reset"),D0={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},ih={},Rc=p(e=>{ih[e]||(q.warn(D0[e]),ih[e]=!0)},"issueWarning"),Nc=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Rc("LAZY_LOAD_DEPRECATED")},"checkConfig"),kL=p(()=>{let e={};No&&(e=Dt(e,No));for(const t of Tr)e=Dt(e,t);return e},"getUserDefinedConfig"),ee=p(e=>(e.flowchart?.htmlLabels!=null&&Rc("FLOWCHART_HTML_LABELS_DEPRECATED"),Ie(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),qc=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,$i=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,P0=/\s*%%.*\n/gm,Wc=class extends Error{static{p(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},Sr={},xn=p(function(e,t){e=e.replace(qc,"").replace($i,"").replace(P0,` `);for(const[r,{detector:i}]of Object.entries(Sr))if(i(e,t))return r;throw new Wc(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),ba=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)zc(t,r,i)},"registerLazyLoadedDiagrams"),zc=p((e,t,r)=>{Sr[e]&&q.warn(`Detector with key ${e} already exists. Overwriting.`),Sr[e]={detector:t,loader:r},q.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),R0=p(e=>Sr[e].loader,"getDiagramLoader"),Vi=//gi,N0=p(e=>e?Uc(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),q0=(()=>{let e=!1;return()=>{e||(Hc(),e=!0)}})();function Hc(){const e="data-temp-href-target";Kr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Kr.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(Hc,"setupDompurifyHooks");var Yc=p(e=>(q0(),Kr.sanitize(e)),"removeScript"),oh=p((e,t)=>{if(ee(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Yc(e):r!=="loose"&&(e=Uc(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=Y0(e))}return e},"sanitizeMore"),be=p((e,t)=>e&&(t.dompurifyConfig?e=Kr.sanitize(oh(e,t),t.dompurifyConfig).toString():e=Kr.sanitize(oh(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),W0=p((e,t)=>typeof e=="string"?be(e,t):e.flat().map(r=>be(r,t)),"sanitizeTextOrArray"),z0=p(e=>Vi.test(e),"hasBreaks"),H0=p(e=>e.split(Vi),"splitBreaks"),Y0=p(e=>e.replace(/#br#/g,"
      "),"placeholderToBreak"),Uc=p(e=>e.replace(Vi,"#br#"),"breakToPlaceholder"),U0=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),j0=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),G0=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),sh=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),X0=p((e,t)=>{const r=ka(e,"~"),i=ka(t,"~");return r===1&&i===1},"shouldCombineSets"),V0=p(e=>{const t=ka(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),ah=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),wa=/\$\$(.*?)\$\$/g,Pi=p(e=>(e.match(wa)?.length??0)>0,"hasKatex"),wL=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await jc(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),Z0=p(async(e,t)=>{if(!Pi(e))return e;if(!(ah()||t.legacyMathML||t.forceLegacyMathML))return e.replace(wa,"MathML is unsupported in this environment.");{const{default:r}=await nt(async()=>{const{default:o}=await import("./katex-HP8lGamR.js");return{default:o}},[]),i=t.forceLegacyMathML||!ah()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Vi).map(o=>Pi(o)?`
      ${o}
      `:`
      ${o}
      `).join("").replace(wa,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),jc=p(async(e,t)=>be(await Z0(e,t),t),"renderKatexSanitized"),Zi={getRows:N0,sanitizeText:be,sanitizeTextOrArray:W0,hasBreaks:z0,splitBreaks:H0,lineBreakRegex:Vi,removeScript:Yc,getUrl:U0,evaluate:Ie,getMax:j0,getMin:G0},K0=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Q0=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Gc=p(function(e,t,r,i){const o=Q0(t,r,i);K0(e,o)},"configureSvgSize"),J0=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;q.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;q.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,q.info(`Calculated bounds: ${n}x${l}`),Gc(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Bo={};function Ta(e){return[...e.cssRules].map(t=>t.cssText).join(` @@ -300,8 +300,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="

      An error L0,20`)},"requirement_arrow"),LS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),FS=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),AS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),ES={extension:hS,composition:cS,aggregation:dS,dependency:uS,lollipop:fS,point:pS,circle:gS,cross:mS,barb:yS,barbNeo:CS,only_one:xS,zero_or_one:bS,one_or_more:kS,zero_or_more:wS,only_one_neo:TS,zero_or_one_neo:SS,one_or_more_neo:_S,zero_or_more_neo:BS,requirement_arrow:vS,requirement_contains:FS,requirement_arrow_neo:LS,requirement_contains_neo:AS},MS=lS,$S={common:Zi,getConfig:vt,insertCluster:LT,insertEdge:nS,insertEdgeLabel:tS,insertMarkers:MS,insertNode:Hg,interpolateToCurve:Vn,labelHelper:it,log:q,positionEdgeLabel:eS},Gi={},Gg=p(e=>{for(const t of e)Gi[t.name]=t},"registerLayoutLoaders"),OS=p(()=>{Gg([{name:"dagre",loader:p(async()=>await nt(()=>import("./dagre-VKFMJZFB-BuaL-XNK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await nt(()=>import("./swimlanes-5IMT3BWC-48M2vHyU.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await nt(()=>import("./cose-bilkent-JH36ORCC-CyvFRDuS.js"),__vite__mapDeps([9,10,7,5,6])),"loader")}])},"registerDefaultLayoutLoaders");OS();var GL=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Gi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}const i=Gi[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,$S,{algorithm:i.algorithm},r)},"render"),XL=p((e="",{fallback:t="dagre"}={})=>{if(e in Gi)return e;if(t in Gi)return q.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),ml="comm",Xg="rule",Vg="decl",IS="@media",DS="@import",PS="@supports",RS="@namespace",un="@keyframes",Zg="@layer",NS="@scope",qS=Math.abs,Di=String.fromCharCode;function Kg(e){return e.trim()}function fn(e,t,r){return e.replace(t,r)}function Zr(e,t){return e.charCodeAt(t)|0}function ii(e,t,r){return e.slice(t,r)}function Fe(e){return e.length}function Qg(e){return e.length}function To(e,t){return t.push(e),e}var Es=1,oi=1,Jg=0,ce=0,$t=0,ni="";function yl(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Es,column:oi,length:a,return:"",siblings:n}}function WS(){return $t}function zS(){return $t=ce>0?Zr(ni,--ce):0,oi--,$t===10&&(oi=1,Es--),$t}function xe(){return $t=ce2||Xi($t)>3?"":" "}function jS(e,t){for(;--t&&xe()&&!($t<48||$t>102||$t>57&&$t<65||$t>70&&$t<97););return Ms(e,Do()+(t<6&&ir()==32&&xe()==32))}function pn(e){for(;xe();)switch($t){case e:return ce;case 34:case 39:e!==34&&e!==39&&pn($t);break;case 40:e===41&&pn(e);break;case 92:xe();break}return ce}function GS(e,t){for(;xe()&&e+$t!==57;)if(e+$t===84&&ir()===47)break;return"/*"+Ms(t,ce-1)+"*"+Di(e===47?e:xe())}function XS(e){for(;!Xi(ir());)xe();return Ms(e,ce)}function VS(e){return YS(Po("",null,null,null,[""],e=HS(e),0,[0],e))}function Po(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,C=1,b=0,k=0,T="",S=o,_=s,L=i,v=T;y;)switch(g=k,k=xe()){case 40:g!=108&&Zr(v,d-1)==58?(b++,v+="("):v+=ga(k);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=ga(k);break;case 9:case 10:case 13:case 32:if(b>0){v+=Di(k);break}v+=US(g);break;case 92:v+=jS(Do()-1,7);continue;case 47:switch(ir()){case 42:case 47:To(ZS(GS(xe(),Do()),t,r,l),l),(Xi(g||1)==5||Xi(ir()||1)==5)&&Fe(v)&&ii(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*m:n[c++]=Fe(v)*C;case 125*m:case 59:case 0:if(b>0&&k){v+=Di(k);break}switch(k){case 0:case 125:y=0;case 59+h:C==-1&&(v=fn(v,/\f/g,"")),u>0&&(Fe(v)-d||m===0)&&To(u>32?bc(v+";",i,r,d-1,l):bc(fn(v," ","")+";",i,r,d-2,l),l);break;case 59:v+=";";default:if(To(L=xc(v,t,r,c,h,o,n,T,S=[],_=[],d,s),s),k===123)if(h===0)Po(v,t,L,L,S,s,d,n,_);else{switch(f){case 99:if(Zr(v,3)===110)break;case 108:if(Zr(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Po(e,L,L,i&&To(xc(e,L,L,0,0,o,n,T,o,S=[],d,_),_),o,_,d,n,i?S:_):Po(v,L,L,L,[""],_,0,n,_)}}c=h=u=0,m=C=1,T=v="",d=a;break;case 58:d=1+Fe(v),u=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&zS()==125)continue}switch(v+=Di(k),k*m){case 38:C=h>0?1:(v+="\f",-1);break;case 44:if(b>0)break;n[c++]=(Fe(v)-1)*C,C=1;break;case 64:ir()===45&&(v+=ga(xe())),f=ir(),h=d=Fe(T=v+=XS(Do())),k++;break;case 45:g===45&&Fe(v)==2&&(m=0)}}return s}function xc(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=Qg(u),m=0,y=0,C=0;m0?u[b]+" "+k:fn(k,/&\f/g,u[b])))&&(l[C++]=T);return yl(e,t,r,o===0?Xg:n,l,c,h,d)}function ZS(e,t,r,i){return yl(e,t,r,ml,Di(WS()),ii(e,2,-2),0,i)}function bc(e,t,r,i,o){return yl(e,t,r,Vg,ii(e,0,i),ii(e,i+1,-1),i,o)}function gn(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),t_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./c4Diagram-LMCZKHZV-BRKLxvwh.js");return{diagram:t}},__vite__mapDeps([11,12,5,6,7]));return{id:tm,diagram:e}},"loader"),e_={id:tm,detector:JS,loader:t_},r_=e_,em="flowchart",i_=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),o_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-CSk8qFwd.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:em,diagram:e}},"loader"),s_={id:em,detector:i_,loader:o_},a_=s_,rm="flowchart-v2",n_=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),l_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-CSk8qFwd.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:rm,diagram:e}},"loader"),h_={id:rm,detector:n_,loader:l_},c_=h_,im="swimlane",d_=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),u_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./swimlanesDiagram-G3AALYLV-gPkWeD2t.js");return{diagram:t}},__vite__mapDeps([18,13,14,15,16,12,17,5,6,7]));return{id:im,diagram:e}},"loader"),f_={id:im,detector:d_,loader:u_},p_=f_,om="er",g_=p(e=>/^\s*erDiagram/.test(e),"detector"),m_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./erDiagram-Q63AITRT-q8LwmVdA.js");return{diagram:t}},__vite__mapDeps([19,15,16,17,5,6,7]));return{id:om,diagram:e}},"loader"),y_={id:om,detector:g_,loader:m_},C_=y_,sm="gitGraph",x_=p(e=>/^\s*gitGraph/.test(e),"detector"),b_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-IHSO6WYX-DbTFMBma.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,5,6,7]));return{id:sm,diagram:e}},"loader"),k_={id:sm,detector:x_,loader:b_},w_=k_,am="gantt",T_=p(e=>/^\s*gantt/.test(e),"detector"),S_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ganttDiagram-NO4QXBWP-BliHEJI2.js");return{diagram:t}},__vite__mapDeps([24,7,25,26,27,5,6]));return{id:am,diagram:e}},"loader"),__={id:am,detector:T_,loader:S_},B_=__,nm="info",v_=p(e=>/^\s*info/.test(e),"detector"),L_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./infoDiagram-FWYZ7A6U-Bge59IZG.js");return{diagram:t}},__vite__mapDeps([28,23,5,6,7]));return{id:nm,diagram:e}},"loader"),F_={id:nm,detector:v_,loader:L_},lm="pie",A_=p(e=>/^\s*pie/.test(e),"detector"),E_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./pieDiagram-ENE6RG2P-h3KzynJ8.js");return{diagram:t}},__vite__mapDeps([29,22,23,5,6,30,31,26,7]));return{id:lm,diagram:e}},"loader"),M_={id:lm,detector:A_,loader:E_},hm="quadrantChart",$_=p(e=>/^\s*quadrantChart/.test(e),"detector"),O_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./quadrantDiagram-ABIIQ3AL-DFm-eCQb.js");return{diagram:t}},__vite__mapDeps([32,25,26,27,5,6,7]));return{id:hm,diagram:e}},"loader"),I_={id:hm,detector:$_,loader:O_},D_=I_,cm="xychart",P_=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),R_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./xychartDiagram-FW5EYKEG-DfHxJPKU.js");return{diagram:t}},__vite__mapDeps([33,26,31,25,27,5,6,7]));return{id:cm,diagram:e}},"loader"),N_={id:cm,detector:P_,loader:R_},q_=N_,dm="requirement",W_=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),z_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./requirementDiagram-TGXJPOKE-CSxNTrK4.js");return{diagram:t}},__vite__mapDeps([34,15,16,5,6,7]));return{id:dm,diagram:e}},"loader"),H_={id:dm,detector:W_,loader:z_},Y_=H_,um="sequence",U_=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),j_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./sequenceDiagram-DBY2YBRQ-Cr-Sj8Pb.js");return{diagram:t}},__vite__mapDeps([35,21,12,5,6,7]));return{id:um,diagram:e}},"loader"),G_={id:um,detector:U_,loader:j_},X_=G_,fm="class",V_=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),Z_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./classDiagram-OUVF2IWQ-CNk36E8O.js");return{diagram:t}},__vite__mapDeps([36,37,14,15,16,12,5,6,7]));return{id:fm,diagram:e}},"loader"),K_={id:fm,detector:V_,loader:Z_},Q_=K_,pm="classDiagram",J_=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),tB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./classDiagram-v2-EOCWNBFH-CNk36E8O.js");return{diagram:t}},__vite__mapDeps([38,37,14,15,16,12,5,6,7]));return{id:pm,diagram:e}},"loader"),eB={id:pm,detector:J_,loader:tB},rB=eB,gm="state",iB=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),oB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./stateDiagram-2N3HPSRC-BYfWdLSL.js");return{diagram:t}},__vite__mapDeps([39,40,15,16,12,2,4,3,5,6,7]));return{id:gm,diagram:e}},"loader"),sB={id:gm,detector:iB,loader:oB},aB=sB,mm="stateDiagram",nB=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),lB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-6OUMAXLB-D2Op2fy3.js");return{diagram:t}},__vite__mapDeps([41,40,15,16,12,5,6,7]));return{id:mm,diagram:e}},"loader"),hB={id:mm,detector:nB,loader:lB},cB=hB,ym="journey",dB=p(e=>/^\s*journey/.test(e),"detector"),uB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./journeyDiagram-5HDEW3XC-B1mQtsyC.js");return{diagram:t}},__vite__mapDeps([42,14,12,30,5,6,7]));return{id:ym,diagram:e}},"loader"),fB={id:ym,detector:dB,loader:uB},pB=fB,gB=p((e,t,r)=>{q.debug(`rendering svg for syntax error -`);const i=Yk(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Gc(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Cm={draw:gB},mB=Cm,yB={db:{},renderer:Cm,parser:{parse:p(()=>{},"parse")}},CB=yB,xm="flowchart-elk",xB=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),bB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-CSk8qFwd.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:xm,diagram:e}},"loader"),kB={id:xm,detector:xB,loader:bB},wB=kB,bm="timeline",TB=p(e=>/^\s*timeline/.test(e),"detector"),SB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./timeline-definition-FHXFAJF6-CsGFMDtB.js");return{diagram:t}},__vite__mapDeps([43,30,5,6,7]));return{id:bm,diagram:e}},"loader"),_B={id:bm,detector:TB,loader:SB},BB=_B,km="mindmap",vB=p(e=>/^\s*mindmap/.test(e),"detector"),LB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./mindmap-definition-LN4V7U3C-jRWZCKa4.js");return{diagram:t}},__vite__mapDeps([44,15,16,5,6,7]));return{id:km,diagram:e}},"loader"),FB={id:km,detector:vB,loader:LB},AB=FB,wm="kanban",EB=p(e=>/^\s*kanban/.test(e),"detector"),MB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./kanban-definition-HUTT4EX6-Bpgk0PjP.js");return{diagram:t}},__vite__mapDeps([45,14,5,6,7]));return{id:wm,diagram:e}},"loader"),$B={id:wm,detector:EB,loader:MB},OB=$B,Tm="sankey",IB=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),DB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./sankeyDiagram-HTMAVEWB-Dd9T4UrJ.js");return{diagram:t}},__vite__mapDeps([46,31,26,5,6,7]));return{id:Tm,diagram:e}},"loader"),PB={id:Tm,detector:IB,loader:DB},RB=PB,Sm="packet",NB=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),qB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-NH7WQ7WH-l2Pip_5t.js");return{diagram:t}},__vite__mapDeps([47,22,23,5,6,7]));return{id:Sm,diagram:e}},"loader"),WB={id:Sm,detector:NB,loader:qB},_m="radar",zB=p(e=>/^\s*radar-beta/.test(e),"detector"),HB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-WEI45ONY-tJhlXXXb.js");return{diagram:t}},__vite__mapDeps([48,22,23,5,6,7]));return{id:_m,diagram:e}},"loader"),YB={id:_m,detector:zB,loader:HB},Bm="block",UB=p(e=>/^\s*block(-beta)?/.test(e),"detector"),jB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./blockDiagram-677ZJIJ3-DHUznNgz.js");return{diagram:t}},__vite__mapDeps([49,14,2,17,5,6,7]));return{id:Bm,diagram:e}},"loader"),GB={id:Bm,detector:UB,loader:jB},XB=GB,vm="treeView",VB=p(e=>/^\s*treeView-beta/.test(e),"detector"),ZB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-OA4YK3LP-DO8otT0J.js");return{diagram:t}},__vite__mapDeps([50,21,22,23,5,6,7]));return{id:vm,diagram:e}},"loader"),KB={id:vm,detector:VB,loader:ZB},QB=KB,Lm="architecture",JB=p(e=>/^\s*architecture/.test(e),"detector"),tv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./architectureDiagram-ZJ3FMSHR-DsZ4TpMi.js");return{diagram:t}},__vite__mapDeps([51,22,23,5,6,10,7]));return{id:Lm,diagram:e}},"loader"),ev={id:Lm,detector:JB,loader:tv},rv=ev,Fm="eventmodeling",iv=p(e=>/^\s*eventmodeling/.test(e),"detector"),ov=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-FQU43EPY-BXKGXolr.js");return{diagram:t}},__vite__mapDeps([52,22,23,5,6,7]));return{id:Fm,diagram:e}},"loader"),sv={id:Fm,detector:iv,loader:ov},av=sv,Am="ishikawa",nv=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),lv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ishikawaDiagram-FXEZZL3T-y8Y7SwAW.js");return{diagram:t}},__vite__mapDeps([53,5,6,7]));return{id:Am,diagram:e}},"loader"),hv={id:Am,detector:nv,loader:lv},Em="venn",cv=p(e=>/^\s*venn-beta/.test(e),"detector"),dv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./vennDiagram-L72KCM5P-B5PLrg4a.js");return{diagram:t}},__vite__mapDeps([54,5,6,7]));return{id:Em,diagram:e}},"loader"),uv={id:Em,detector:cv,loader:dv},fv=uv,Mm="treemap",pv=p(e=>/^\s*treemap/.test(e),"detector"),gv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-G47NLZAW-DsoHq3g9.js");return{diagram:t}},__vite__mapDeps([55,22,16,23,5,6,27,31,26,7]));return{id:Mm,diagram:e}},"loader"),mv={id:Mm,detector:pv,loader:gv},$m="wardley",yv=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Cv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./wardleyDiagram-EHGQE667-B6OLyL9l.js");return{diagram:t}},__vite__mapDeps([56,22,23,5,6,7]));return{id:$m,diagram:e}},"loader"),xv={id:$m,detector:yv,loader:Cv},bv=xv,Om="cynefin",kv=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),wv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./cynefinDiagram-TSTJHNR4-BP26cYtj.js");return{diagram:t}},__vite__mapDeps([57,22,23,5,6,7]));return{id:Om,diagram:e}},"loader"),Tv={id:Om,detector:kv,loader:wv},Im="railroad",Sv=p(e=>/^\s*railroad-beta/i.test(e),"detector"),_v=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./railroadDiagram-RFXS5EU6-Buc-7xRH.js");return{diagram:t}},__vite__mapDeps([58,59,22,23,5,6,7]));return{id:Im,diagram:e}},"loader"),Bv={id:Im,detector:Sv,loader:_v},Dm="railroadEbnf",vv=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Lv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ebnfDiagram-CCIWWBDH-DuVJXtzP.js");return{diagram:t}},__vite__mapDeps([60,59,22,23,5,6,7]));return{id:Dm,diagram:e}},"loader"),Fv={id:Dm,detector:vv,loader:Lv},Pm="railroadAbnf",Av=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),Ev=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./abnfDiagram-VRR7QNED-DZ5l2NNF.js");return{diagram:t}},__vite__mapDeps([61,59,22,23,5,6,7]));return{id:Pm,diagram:e}},"loader"),Mv={id:Pm,detector:Av,loader:Ev},Rm="railroadPeg",$v=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Ov=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./pegDiagram-2B236MQR-BBHHexxE.js");return{diagram:t}},__vite__mapDeps([62,59,22,23,5,6,7]));return{id:Rm,diagram:e}},"loader"),Iv={id:Rm,detector:$v,loader:Ov},kc=!1,$s=p(()=>{kc||(kc=!0,zo("error",CB,e=>e.toLowerCase().trim()==="error"),zo("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),ba(wB,AB,rv),ba(r_,OB,rB,Q_,C_,B_,F_,M_,Y_,X_,p_,c_,a_,BB,w_,cB,aB,pB,D_,RB,WB,q_,XB,av,QB,YB,hv,mv,Bv,Fv,Mv,Iv,fv,bv,Tv))},"addDiagrams"),Dv=p(async()=>{q.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Sr).map(async([r,{detector:i,loader:o}])=>{if(o)try{Sa(r)}catch{try{const{diagram:s,id:a}=await o();zo(a,s,i)}catch(s){throw q.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Sr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){q.error(`Failed to load ${t.length} external diagrams`);for(const r of t)q.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Pv="graphics-document document";function Nm(e,t){e.attr("role",Pv),t!==""&&e.attr("aria-roledescription",t)}p(Nm,"setA11yDiagramInfo");function qm(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(qm,"addSVGa11yTitleDescription");var mn=class Wm{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static{p(this,"Diagram")}static async fromText(t,r={}){const i=vt(),o=xn(t,i);t=Z2(t)+` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),FS=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),AS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),ES={extension:hS,composition:cS,aggregation:dS,dependency:uS,lollipop:fS,point:pS,circle:gS,cross:mS,barb:yS,barbNeo:CS,only_one:xS,zero_or_one:bS,one_or_more:kS,zero_or_more:wS,only_one_neo:TS,zero_or_one_neo:SS,one_or_more_neo:_S,zero_or_more_neo:BS,requirement_arrow:vS,requirement_contains:FS,requirement_arrow_neo:LS,requirement_contains_neo:AS},MS=lS,$S={common:Zi,getConfig:vt,insertCluster:LT,insertEdge:nS,insertEdgeLabel:tS,insertMarkers:MS,insertNode:Hg,interpolateToCurve:Vn,labelHelper:it,log:q,positionEdgeLabel:eS},Gi={},Gg=p(e=>{for(const t of e)Gi[t.name]=t},"registerLayoutLoaders"),OS=p(()=>{Gg([{name:"dagre",loader:p(async()=>await nt(()=>import("./dagre-VKFMJZFB-BPvIVMQX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await nt(()=>import("./swimlanes-5IMT3BWC-e4qfs0uW.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await nt(()=>import("./cose-bilkent-JH36ORCC-bJETd0G9.js"),__vite__mapDeps([9,10,7,5,6])),"loader")}])},"registerDefaultLayoutLoaders");OS();var GL=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Gi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}const i=Gi[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,$S,{algorithm:i.algorithm},r)},"render"),XL=p((e="",{fallback:t="dagre"}={})=>{if(e in Gi)return e;if(t in Gi)return q.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),ml="comm",Xg="rule",Vg="decl",IS="@media",DS="@import",PS="@supports",RS="@namespace",un="@keyframes",Zg="@layer",NS="@scope",qS=Math.abs,Di=String.fromCharCode;function Kg(e){return e.trim()}function fn(e,t,r){return e.replace(t,r)}function Zr(e,t){return e.charCodeAt(t)|0}function ii(e,t,r){return e.slice(t,r)}function Fe(e){return e.length}function Qg(e){return e.length}function To(e,t){return t.push(e),e}var Es=1,oi=1,Jg=0,ce=0,$t=0,ni="";function yl(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Es,column:oi,length:a,return:"",siblings:n}}function WS(){return $t}function zS(){return $t=ce>0?Zr(ni,--ce):0,oi--,$t===10&&(oi=1,Es--),$t}function xe(){return $t=ce2||Xi($t)>3?"":" "}function jS(e,t){for(;--t&&xe()&&!($t<48||$t>102||$t>57&&$t<65||$t>70&&$t<97););return Ms(e,Do()+(t<6&&ir()==32&&xe()==32))}function pn(e){for(;xe();)switch($t){case e:return ce;case 34:case 39:e!==34&&e!==39&&pn($t);break;case 40:e===41&&pn(e);break;case 92:xe();break}return ce}function GS(e,t){for(;xe()&&e+$t!==57;)if(e+$t===84&&ir()===47)break;return"/*"+Ms(t,ce-1)+"*"+Di(e===47?e:xe())}function XS(e){for(;!Xi(ir());)xe();return Ms(e,ce)}function VS(e){return YS(Po("",null,null,null,[""],e=HS(e),0,[0],e))}function Po(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,C=1,b=0,k=0,T="",S=o,_=s,L=i,v=T;y;)switch(g=k,k=xe()){case 40:g!=108&&Zr(v,d-1)==58?(b++,v+="("):v+=ga(k);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=ga(k);break;case 9:case 10:case 13:case 32:if(b>0){v+=Di(k);break}v+=US(g);break;case 92:v+=jS(Do()-1,7);continue;case 47:switch(ir()){case 42:case 47:To(ZS(GS(xe(),Do()),t,r,l),l),(Xi(g||1)==5||Xi(ir()||1)==5)&&Fe(v)&&ii(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*m:n[c++]=Fe(v)*C;case 125*m:case 59:case 0:if(b>0&&k){v+=Di(k);break}switch(k){case 0:case 125:y=0;case 59+h:C==-1&&(v=fn(v,/\f/g,"")),u>0&&(Fe(v)-d||m===0)&&To(u>32?bc(v+";",i,r,d-1,l):bc(fn(v," ","")+";",i,r,d-2,l),l);break;case 59:v+=";";default:if(To(L=xc(v,t,r,c,h,o,n,T,S=[],_=[],d,s),s),k===123)if(h===0)Po(v,t,L,L,S,s,d,n,_);else{switch(f){case 99:if(Zr(v,3)===110)break;case 108:if(Zr(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Po(e,L,L,i&&To(xc(e,L,L,0,0,o,n,T,o,S=[],d,_),_),o,_,d,n,i?S:_):Po(v,L,L,L,[""],_,0,n,_)}}c=h=u=0,m=C=1,T=v="",d=a;break;case 58:d=1+Fe(v),u=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&zS()==125)continue}switch(v+=Di(k),k*m){case 38:C=h>0?1:(v+="\f",-1);break;case 44:if(b>0)break;n[c++]=(Fe(v)-1)*C,C=1;break;case 64:ir()===45&&(v+=ga(xe())),f=ir(),h=d=Fe(T=v+=XS(Do())),k++;break;case 45:g===45&&Fe(v)==2&&(m=0)}}return s}function xc(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=Qg(u),m=0,y=0,C=0;m0?u[b]+" "+k:fn(k,/&\f/g,u[b])))&&(l[C++]=T);return yl(e,t,r,o===0?Xg:n,l,c,h,d)}function ZS(e,t,r,i){return yl(e,t,r,ml,Di(WS()),ii(e,2,-2),0,i)}function bc(e,t,r,i,o){return yl(e,t,r,Vg,ii(e,0,i),ii(e,i+1,-1),i,o)}function gn(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),t_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./c4Diagram-LMCZKHZV-DqXL2ZOL.js");return{diagram:t}},__vite__mapDeps([11,12,5,6,7]));return{id:tm,diagram:e}},"loader"),e_={id:tm,detector:JS,loader:t_},r_=e_,em="flowchart",i_=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),o_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-CAiKF6Zk.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:em,diagram:e}},"loader"),s_={id:em,detector:i_,loader:o_},a_=s_,rm="flowchart-v2",n_=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),l_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-CAiKF6Zk.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:rm,diagram:e}},"loader"),h_={id:rm,detector:n_,loader:l_},c_=h_,im="swimlane",d_=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),u_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./swimlanesDiagram-G3AALYLV-Ou5HSK_e.js");return{diagram:t}},__vite__mapDeps([18,13,14,15,16,12,17,5,6,7]));return{id:im,diagram:e}},"loader"),f_={id:im,detector:d_,loader:u_},p_=f_,om="er",g_=p(e=>/^\s*erDiagram/.test(e),"detector"),m_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./erDiagram-Q63AITRT-CythxxSO.js");return{diagram:t}},__vite__mapDeps([19,15,16,17,5,6,7]));return{id:om,diagram:e}},"loader"),y_={id:om,detector:g_,loader:m_},C_=y_,sm="gitGraph",x_=p(e=>/^\s*gitGraph/.test(e),"detector"),b_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,5,6,7]));return{id:sm,diagram:e}},"loader"),k_={id:sm,detector:x_,loader:b_},w_=k_,am="gantt",T_=p(e=>/^\s*gantt/.test(e),"detector"),S_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ganttDiagram-NO4QXBWP-BZuybaxa.js");return{diagram:t}},__vite__mapDeps([24,7,25,26,27,5,6]));return{id:am,diagram:e}},"loader"),__={id:am,detector:T_,loader:S_},B_=__,nm="info",v_=p(e=>/^\s*info/.test(e),"detector"),L_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./infoDiagram-FWYZ7A6U-CUw0bC3y.js");return{diagram:t}},__vite__mapDeps([28,23,5,6,7]));return{id:nm,diagram:e}},"loader"),F_={id:nm,detector:v_,loader:L_},lm="pie",A_=p(e=>/^\s*pie/.test(e),"detector"),E_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./pieDiagram-ENE6RG2P-hsSQniWq.js");return{diagram:t}},__vite__mapDeps([29,22,23,5,6,30,31,26,7]));return{id:lm,diagram:e}},"loader"),M_={id:lm,detector:A_,loader:E_},hm="quadrantChart",$_=p(e=>/^\s*quadrantChart/.test(e),"detector"),O_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./quadrantDiagram-ABIIQ3AL-DczKOfwA.js");return{diagram:t}},__vite__mapDeps([32,25,26,27,5,6,7]));return{id:hm,diagram:e}},"loader"),I_={id:hm,detector:$_,loader:O_},D_=I_,cm="xychart",P_=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),R_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./xychartDiagram-FW5EYKEG-OovywL2x.js");return{diagram:t}},__vite__mapDeps([33,26,31,25,27,5,6,7]));return{id:cm,diagram:e}},"loader"),N_={id:cm,detector:P_,loader:R_},q_=N_,dm="requirement",W_=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),z_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./requirementDiagram-TGXJPOKE-BTUv_Oh8.js");return{diagram:t}},__vite__mapDeps([34,15,16,5,6,7]));return{id:dm,diagram:e}},"loader"),H_={id:dm,detector:W_,loader:z_},Y_=H_,um="sequence",U_=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),j_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./sequenceDiagram-DBY2YBRQ-td3c-NEP.js");return{diagram:t}},__vite__mapDeps([35,21,12,5,6,7]));return{id:um,diagram:e}},"loader"),G_={id:um,detector:U_,loader:j_},X_=G_,fm="class",V_=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),Z_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./classDiagram-OUVF2IWQ-C0VBUqk7.js");return{diagram:t}},__vite__mapDeps([36,37,14,15,16,12,5,6,7]));return{id:fm,diagram:e}},"loader"),K_={id:fm,detector:V_,loader:Z_},Q_=K_,pm="classDiagram",J_=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),tB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./classDiagram-v2-EOCWNBFH-C0VBUqk7.js");return{diagram:t}},__vite__mapDeps([38,37,14,15,16,12,5,6,7]));return{id:pm,diagram:e}},"loader"),eB={id:pm,detector:J_,loader:tB},rB=eB,gm="state",iB=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),oB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./stateDiagram-2N3HPSRC-A7OvRFce.js");return{diagram:t}},__vite__mapDeps([39,40,15,16,12,2,4,3,5,6,7]));return{id:gm,diagram:e}},"loader"),sB={id:gm,detector:iB,loader:oB},aB=sB,mm="stateDiagram",nB=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),lB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-6OUMAXLB-DA4wVJGo.js");return{diagram:t}},__vite__mapDeps([41,40,15,16,12,5,6,7]));return{id:mm,diagram:e}},"loader"),hB={id:mm,detector:nB,loader:lB},cB=hB,ym="journey",dB=p(e=>/^\s*journey/.test(e),"detector"),uB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./journeyDiagram-5HDEW3XC-D9J7zYIT.js");return{diagram:t}},__vite__mapDeps([42,14,12,30,5,6,7]));return{id:ym,diagram:e}},"loader"),fB={id:ym,detector:dB,loader:uB},pB=fB,gB=p((e,t,r)=>{q.debug(`rendering svg for syntax error +`);const i=Yk(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Gc(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Cm={draw:gB},mB=Cm,yB={db:{},renderer:Cm,parser:{parse:p(()=>{},"parse")}},CB=yB,xm="flowchart-elk",xB=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),bB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-CAiKF6Zk.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:xm,diagram:e}},"loader"),kB={id:xm,detector:xB,loader:bB},wB=kB,bm="timeline",TB=p(e=>/^\s*timeline/.test(e),"detector"),SB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./timeline-definition-FHXFAJF6-DTRr-LYc.js");return{diagram:t}},__vite__mapDeps([43,30,5,6,7]));return{id:bm,diagram:e}},"loader"),_B={id:bm,detector:TB,loader:SB},BB=_B,km="mindmap",vB=p(e=>/^\s*mindmap/.test(e),"detector"),LB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./mindmap-definition-LN4V7U3C-DVXXLA72.js");return{diagram:t}},__vite__mapDeps([44,15,16,5,6,7]));return{id:km,diagram:e}},"loader"),FB={id:km,detector:vB,loader:LB},AB=FB,wm="kanban",EB=p(e=>/^\s*kanban/.test(e),"detector"),MB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./kanban-definition-HUTT4EX6-BFENhRSJ.js");return{diagram:t}},__vite__mapDeps([45,14,5,6,7]));return{id:wm,diagram:e}},"loader"),$B={id:wm,detector:EB,loader:MB},OB=$B,Tm="sankey",IB=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),DB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./sankeyDiagram-HTMAVEWB-lACUqAhA.js");return{diagram:t}},__vite__mapDeps([46,31,26,5,6,7]));return{id:Tm,diagram:e}},"loader"),PB={id:Tm,detector:IB,loader:DB},RB=PB,Sm="packet",NB=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),qB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-NH7WQ7WH-DSv1qX00.js");return{diagram:t}},__vite__mapDeps([47,22,23,5,6,7]));return{id:Sm,diagram:e}},"loader"),WB={id:Sm,detector:NB,loader:qB},_m="radar",zB=p(e=>/^\s*radar-beta/.test(e),"detector"),HB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-WEI45ONY-H-MqZGXv.js");return{diagram:t}},__vite__mapDeps([48,22,23,5,6,7]));return{id:_m,diagram:e}},"loader"),YB={id:_m,detector:zB,loader:HB},Bm="block",UB=p(e=>/^\s*block(-beta)?/.test(e),"detector"),jB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./blockDiagram-677ZJIJ3-CSXzh0NB.js");return{diagram:t}},__vite__mapDeps([49,14,2,17,5,6,7]));return{id:Bm,diagram:e}},"loader"),GB={id:Bm,detector:UB,loader:jB},XB=GB,vm="treeView",VB=p(e=>/^\s*treeView-beta/.test(e),"detector"),ZB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-OA4YK3LP-CBHxgtCp.js");return{diagram:t}},__vite__mapDeps([50,21,22,23,5,6,7]));return{id:vm,diagram:e}},"loader"),KB={id:vm,detector:VB,loader:ZB},QB=KB,Lm="architecture",JB=p(e=>/^\s*architecture/.test(e),"detector"),tv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./architectureDiagram-ZJ3FMSHR-DU8Ns-cR.js");return{diagram:t}},__vite__mapDeps([51,22,23,5,6,10,7]));return{id:Lm,diagram:e}},"loader"),ev={id:Lm,detector:JB,loader:tv},rv=ev,Fm="eventmodeling",iv=p(e=>/^\s*eventmodeling/.test(e),"detector"),ov=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-FQU43EPY-D74w020-.js");return{diagram:t}},__vite__mapDeps([52,22,23,5,6,7]));return{id:Fm,diagram:e}},"loader"),sv={id:Fm,detector:iv,loader:ov},av=sv,Am="ishikawa",nv=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),lv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ishikawaDiagram-FXEZZL3T-BQLkKOjp.js");return{diagram:t}},__vite__mapDeps([53,5,6,7]));return{id:Am,diagram:e}},"loader"),hv={id:Am,detector:nv,loader:lv},Em="venn",cv=p(e=>/^\s*venn-beta/.test(e),"detector"),dv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./vennDiagram-L72KCM5P-CF_UwcSA.js");return{diagram:t}},__vite__mapDeps([54,5,6,7]));return{id:Em,diagram:e}},"loader"),uv={id:Em,detector:cv,loader:dv},fv=uv,Mm="treemap",pv=p(e=>/^\s*treemap/.test(e),"detector"),gv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-G47NLZAW-BNySynrU.js");return{diagram:t}},__vite__mapDeps([55,22,16,23,5,6,27,31,26,7]));return{id:Mm,diagram:e}},"loader"),mv={id:Mm,detector:pv,loader:gv},$m="wardley",yv=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Cv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./wardleyDiagram-EHGQE667-Dlkrf9qY.js");return{diagram:t}},__vite__mapDeps([56,22,23,5,6,7]));return{id:$m,diagram:e}},"loader"),xv={id:$m,detector:yv,loader:Cv},bv=xv,Om="cynefin",kv=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),wv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./cynefinDiagram-TSTJHNR4-CMTHGHjI.js");return{diagram:t}},__vite__mapDeps([57,22,23,5,6,7]));return{id:Om,diagram:e}},"loader"),Tv={id:Om,detector:kv,loader:wv},Im="railroad",Sv=p(e=>/^\s*railroad-beta/i.test(e),"detector"),_v=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./railroadDiagram-RFXS5EU6-Bo3Qjwvx.js");return{diagram:t}},__vite__mapDeps([58,59,22,23,5,6,7]));return{id:Im,diagram:e}},"loader"),Bv={id:Im,detector:Sv,loader:_v},Dm="railroadEbnf",vv=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Lv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ebnfDiagram-CCIWWBDH-CEJoe0UD.js");return{diagram:t}},__vite__mapDeps([60,59,22,23,5,6,7]));return{id:Dm,diagram:e}},"loader"),Fv={id:Dm,detector:vv,loader:Lv},Pm="railroadAbnf",Av=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),Ev=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./abnfDiagram-VRR7QNED-4qTui6G_.js");return{diagram:t}},__vite__mapDeps([61,59,22,23,5,6,7]));return{id:Pm,diagram:e}},"loader"),Mv={id:Pm,detector:Av,loader:Ev},Rm="railroadPeg",$v=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Ov=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./pegDiagram-2B236MQR-C6WedOo8.js");return{diagram:t}},__vite__mapDeps([62,59,22,23,5,6,7]));return{id:Rm,diagram:e}},"loader"),Iv={id:Rm,detector:$v,loader:Ov},kc=!1,$s=p(()=>{kc||(kc=!0,zo("error",CB,e=>e.toLowerCase().trim()==="error"),zo("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),ba(wB,AB,rv),ba(r_,OB,rB,Q_,C_,B_,F_,M_,Y_,X_,p_,c_,a_,BB,w_,cB,aB,pB,D_,RB,WB,q_,XB,av,QB,YB,hv,mv,Bv,Fv,Mv,Iv,fv,bv,Tv))},"addDiagrams"),Dv=p(async()=>{q.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Sr).map(async([r,{detector:i,loader:o}])=>{if(o)try{Sa(r)}catch{try{const{diagram:s,id:a}=await o();zo(a,s,i)}catch(s){throw q.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Sr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){q.error(`Failed to load ${t.length} external diagrams`);for(const r of t)q.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Pv="graphics-document document";function Nm(e,t){e.attr("role",Pv),t!==""&&e.attr("aria-roledescription",t)}p(Nm,"setA11yDiagramInfo");function qm(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(qm,"addSVGa11yTitleDescription");var mn=class Wm{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static{p(this,"Diagram")}static async fromText(t,r={}){const i=vt(),o=xn(t,i);t=Z2(t)+` `;try{Sa(o)}catch{const c=R0(o);if(!c)throw new Wc(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();zo(h,d)}const{db:s,parser:a,renderer:n,init:l}=Sa(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new Wm(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},wc=[],Rv=p(()=>{wc.forEach(e=>{e()}),wc=[]},"attachFunctions"),Nv=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function zm(e){const t=e.match(qc);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(` `).map(a=>a.startsWith(r)?a.slice(r.length):a).join(` `):t[2];let o=K1(i,{schema:Z1})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}p(zm,"extractFrontMatter");var qv=p(e=>e.replace(/\r\n?/g,` diff --git a/apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-jRWZCKa4.js b/apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-DVXXLA72.js similarity index 98% rename from apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-jRWZCKa4.js rename to apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-DVXXLA72.js index 0b452e653de..2d5bd1c1d56 100644 --- a/apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-jRWZCKa4.js +++ b/apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-DVXXLA72.js @@ -1,4 +1,4 @@ -import{g as oe}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as ae}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as l,l as C,u as ce,v as le,y as he,B as G,c as B,i as F,b6 as de,aa as ge,ab as ue,ac as pe}from"./mermaid.core-CGrLstUA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function fe(e,n=0){return(E[e[n+0]]+E[e[n+1]]+E[e[n+2]]+E[e[n+3]]+"-"+E[e[n+4]]+E[e[n+5]]+"-"+E[e[n+6]]+E[e[n+7]]+"-"+E[e[n+8]]+E[e[n+9]]+"-"+E[e[n+10]]+E[e[n+11]]+E[e[n+12]]+E[e[n+13]]+E[e[n+14]]+E[e[n+15]]).toLowerCase()}const me=new Uint8Array(16);function ye(){return crypto.getRandomValues(me)}function Ee(e,n,g){return crypto.randomUUID?crypto.randomUUID():_e(e)}function _e(e,n,g){e=e||{};const a=e.random??e.rng?.()??ye();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,fe(a)}var Y=(function(){var e=l(function(D,s,i,o){for(i=i||{},o=D.length;o--;i[D[o]]=s);return i},"o"),n=[1,4],g=[1,13],a=[1,12],t=[1,15],h=[1,16],f=[1,20],m=[1,19],_=[6,7,8],T=[1,26],I=[1,24],w=[1,25],d=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,p,r,$){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:g,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(_,[2,3]),{1:[2,2]},e(_,[2,4]),e(_,[2,5]),{1:[2,6],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:g,9:22,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:T,7:I,10:23,11:w},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:T,7:I,10:32,11:w},{1:[2,7],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(R,[2,14],{7:q,11:J}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(R,[2,13],{7:q,11:J}),e(A,[2,11]),e(A,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],p=[null],r=[],$=this.table,u="",M=0,K=0,ne=2,Q=1,ie=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var se=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(k){o.length=o.length-2*k,p.length=p.length-k,r.length=r.length-k}l(re,"popStack");function Z(){var k;return k=c.pop()||y.lex()||Q,typeof k!="number"&&(k instanceof Array&&(c=k,k=c.pop()),k=i.symbols_[k]||k),k}l(Z,"lex");for(var b,v,S,z,O={},U,x,ee,V;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=Z()),S=$[v]&&$[v][b]),typeof S>"u"||!S.length||!S[0]){var X="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?X="Parse error on line "+(M+1)+`: +import{g as oe}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as ae}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as l,l as C,u as ce,v as le,y as he,B as G,c as B,i as F,b6 as de,aa as ge,ab as ue,ac as pe}from"./mermaid.core-XMN3hSDH.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function fe(e,n=0){return(E[e[n+0]]+E[e[n+1]]+E[e[n+2]]+E[e[n+3]]+"-"+E[e[n+4]]+E[e[n+5]]+"-"+E[e[n+6]]+E[e[n+7]]+"-"+E[e[n+8]]+E[e[n+9]]+"-"+E[e[n+10]]+E[e[n+11]]+E[e[n+12]]+E[e[n+13]]+E[e[n+14]]+E[e[n+15]]).toLowerCase()}const me=new Uint8Array(16);function ye(){return crypto.getRandomValues(me)}function Ee(e,n,g){return crypto.randomUUID?crypto.randomUUID():_e(e)}function _e(e,n,g){e=e||{};const a=e.random??e.rng?.()??ye();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,fe(a)}var Y=(function(){var e=l(function(D,s,i,o){for(i=i||{},o=D.length;o--;i[D[o]]=s);return i},"o"),n=[1,4],g=[1,13],a=[1,12],t=[1,15],h=[1,16],f=[1,20],m=[1,19],_=[6,7,8],T=[1,26],I=[1,24],w=[1,25],d=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,p,r,$){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:g,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(_,[2,3]),{1:[2,2]},e(_,[2,4]),e(_,[2,5]),{1:[2,6],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:g,9:22,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:T,7:I,10:23,11:w},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:T,7:I,10:32,11:w},{1:[2,7],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(R,[2,14],{7:q,11:J}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(R,[2,13],{7:q,11:J}),e(A,[2,11]),e(A,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],p=[null],r=[],$=this.table,u="",M=0,K=0,ne=2,Q=1,ie=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var se=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(k){o.length=o.length-2*k,p.length=p.length-k,r.length=r.length-k}l(re,"popStack");function Z(){var k;return k=c.pop()||y.lex()||Q,typeof k!="number"&&(k instanceof Array&&(c=k,k=c.pop()),k=i.symbols_[k]||k),k}l(Z,"lex");for(var b,v,S,z,O={},U,x,ee,V;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=Z()),S=$[v]&&$[v][b]),typeof S>"u"||!S.length||!S[0]){var X="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?X="Parse error on line "+(M+1)+`: `+y.showPosition()+` Expecting `+V.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(M+1)+": Unexpected "+(b==Q?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:W,expected:V})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+b);switch(S[0]){case 1:o.push(b),p.push(y.yytext),r.push(y.yylloc),o.push(S[1]),b=null,K=y.yyleng,u=y.yytext,M=y.yylineno,W=y.yylloc;break;case 2:if(x=this.productions_[S[1]][1],O.$=p[p.length-x],O._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},se&&(O._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),z=this.performAction.apply(O,[u,K,M,L.yy,S[1],p,r].concat(ie)),typeof z<"u")return z;x&&(o=o.slice(0,-1*x*2),p=p.slice(0,-1*x),r=r.slice(0,-1*x)),o.push(this.productions_[S[1]][0]),p.push(O.$),r.push(O._$),ee=$[o[o.length-2]][o[o.length-1]],o.push(ee);break;case 3:return!0}}return!0},"parse")},te=(function(){var D={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-BBHHexxE.js b/apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-C6WedOo8.js similarity index 87% rename from apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-BBHHexxE.js rename to apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-C6WedOo8.js index d4f0c815661..b9d07bc06a5 100644 --- a/apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-BBHHexxE.js +++ b/apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-C6WedOo8.js @@ -1 +1 @@ -import{g as l,r as m,d as a}from"./chunk-MOJQB5TN-BWiH3s-c.js";import{p}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{_ as t,l as o}from"./mermaid.core-CGrLstUA.js";import{M as u,d as c}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; +import{g as l,r as m,d as a}from"./chunk-MOJQB5TN-DfjF6X7a.js";import{p}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as t,l as o}from"./mermaid.core-XMN3hSDH.js";import{M as u,d as c}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; diff --git a/apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-h3KzynJ8.js b/apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-hsSQniWq.js similarity index 95% rename from apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-h3KzynJ8.js rename to apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-hsSQniWq.js index c1eae97d05f..57d22dff10e 100644 --- a/apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-h3KzynJ8.js +++ b/apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-hsSQniWq.js @@ -1,4 +1,4 @@ -import{p as at}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{T,X as B,b5 as rt,g as nt,s as it,a as ot,b as st,o as lt,n as ct,_ as g,l as G,c as ut,A as dt,D as gt,K as pt,e as ht,p as ft,B as mt}from"./mermaid.core-CGrLstUA.js";import{p as vt}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import{d as Z}from"./arc-C525Mmp6.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function St(t,n){return nt?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,L=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=L*(E<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:L};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{F=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>F,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),q={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);G.debug(n),Et(n,q)},"parse")},Rt=g(t=>` +import{p as at}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{T,X as B,b5 as rt,g as nt,s as it,a as ot,b as st,o as lt,n as ct,_ as g,l as G,c as ut,A as dt,D as gt,K as pt,e as ht,p as ft,B as mt}from"./mermaid.core-XMN3hSDH.js";import{p as vt}from"./cynefin-VYW2F7L2-CjWbot6H.js";import{d as Z}from"./arc-x24dd6EE.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function St(t,n){return nt?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,L=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=L*(E<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:L};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{F=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>F,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),q={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);G.debug(n),Et(n,q)},"parse")},Rt=g(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; diff --git a/apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-DFm-eCQb.js b/apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-DczKOfwA.js similarity index 99% rename from apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-DFm-eCQb.js rename to apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-DczKOfwA.js index 7687948944d..4d50979b7da 100644 --- a/apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-DFm-eCQb.js +++ b/apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-DczKOfwA.js @@ -1,4 +1,4 @@ -import{s as Se,g as _e,o as ee,n as Ae,a as ke,b as Fe,_ as r,c as Et,l as mt,d as vt,e as Pe,p as ve,B as z,i as Ce,E as Le}from"./mermaid.core-CGrLstUA.js";import{l as te}from"./linear-Cu3jckud.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Ct=(function(){var t=r(function(Y,s,l,u){for(l=l||{},u=Y.length;u--;l[Y[u]]=s);return l},"o"),a=[1,3],p=[1,4],f=[1,5],o=[1,6],x=[1,7],_=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],h=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],S=[2,36],q=[1,37],b=[1,36],y=[1,38],T=[1,35],m=[1,43],g=[1,41],k=[1,45],ct=[1,14],dt=[1,23],ut=[1,18],xt=[1,19],ot=[1,20],bt=[1,21],lt=[1,22],i=[1,24],Dt=[1,25],zt=[1,26],Vt=[1,27],It=[1,28],wt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Bt=[1,66],Rt=[1,67],Nt=[1,68],Wt=[1,69],Ut=[1,70],Qt=[1,71],Ot=[1,72],Ht=[1,73],Xt=[1,74],Mt=[1,75],Yt=[1,76],jt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],St=[1,103],Gt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],_t={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:r(function(s,l,u,d,A,e,ht){var n=e.length-1;switch(A){case 23:this.$=e[n];break;case 24:this.$=e[n-1]+""+e[n];break;case 26:this.$=e[n-1]+e[n];break;case 27:this.$=[e[n].trim()];break;case 28:e[n-2].push(e[n].trim()),this.$=e[n-2];break;case 29:this.$=e[n-4],d.addClass(e[n-2],e[n]);break;case 37:this.$=[];break;case 42:this.$=e[n].trim(),d.setDiagramTitle(this.$);break;case 43:this.$=e[n].trim(),d.setAccTitle(this.$);break;case 44:case 45:this.$=e[n].trim(),d.setAccDescription(this.$);break;case 46:d.addSection(e[n].substr(8)),this.$=e[n].substr(8);break;case 47:d.addPoint(e[n-3],"",e[n-1],e[n],[]);break;case 48:d.addPoint(e[n-4],e[n-3],e[n-1],e[n],[]);break;case 49:d.addPoint(e[n-4],"",e[n-2],e[n-1],e[n]);break;case 50:d.addPoint(e[n-5],e[n-4],e[n-2],e[n-1],e[n]);break;case 51:d.setXAxisLeftText(e[n-2]),d.setXAxisRightText(e[n]);break;case 52:e[n-1].text+=" ⟶ ",d.setXAxisLeftText(e[n-1]);break;case 53:d.setXAxisLeftText(e[n]);break;case 54:d.setYAxisBottomText(e[n-2]),d.setYAxisTopText(e[n]);break;case 55:e[n-1].text+=" ⟶ ",d.setYAxisBottomText(e[n-1]);break;case 56:d.setYAxisBottomText(e[n]);break;case 57:d.setQuadrant1Text(e[n]);break;case 58:d.setQuadrant2Text(e[n]);break;case 59:d.setQuadrant3Text(e[n]);break;case 60:d.setQuadrant4Text(e[n]);break;case 64:this.$={text:e[n],type:"text"};break;case 65:this.$={text:e[n-1].text+""+e[n],type:e[n-1].type};break;case 66:this.$={text:e[n],type:"text"};break;case 67:this.$={text:e[n],type:"markdown"};break;case 68:this.$=e[n];break;case 69:this.$=e[n-1]+""+e[n];break}},"anonymous"),table:[{18:a,26:1,27:2,28:p,55:f,56:o,57:x},{1:[3]},{18:a,26:8,27:2,28:p,55:f,56:o,57:x},{18:a,26:9,27:2,28:p,55:f,56:o,57:x},t(_,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(c,S,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:q,5:b,10:y,12:T,13:m,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(_,[2,34]),{27:46,55:f,56:o,57:x},t(c,[2,37]),t(c,S,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:q,5:b,10:y,12:T,13:m,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(c,[2,45]),t(c,[2,46]),{18:[1,51]},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(_,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:65,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Ht,12:Xt,13:Mt,14:Yt,15:jt,21:64},t(c,[2,53],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(c,[2,56],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(c,[2,57],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Ht,12:Xt,13:Mt,14:Yt,15:jt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(c,[2,52],{58:31,43:84,4:q,5:b,10:y,12:T,13:m,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,55],{58:31,43:85,4:q,5:b,10:y,12:T,13:m,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(c,[2,51],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(c,[2,29],{10:St}),t(Gt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(c,[2,49],{10:St}),t(c,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(c,[2,50],{10:St}),t(Gt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:r(function(s,l){if(l.recoverable)this.trace(s);else{var u=new Error(s);throw u.hash=l,u}},"parseError"),parse:r(function(s){var l=this,u=[0],d=[],A=[null],e=[],ht=this.table,n="",gt=0,Kt=0,Te=2,Zt=1,me=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(j.yy[At]=this.yy[At]);D.setInput(s,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var kt=D.yylloc;e.push(kt);var qe=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(R){u.length=u.length-2*R,A.length=A.length-R,e.length=e.length-R}r(be,"popStack");function Jt(){var R;return R=d.pop()||D.lex()||Zt,typeof R!="number"&&(R instanceof Array&&(d=R,R=d.pop()),R=l.symbols_[R]||R),R}r(Jt,"lex");for(var B,G,W,Ft,rt={},pt,M,$t,yt;;){if(G=u[u.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=Jt()),W=ht[G]&&ht[G][B]),typeof W>"u"||!W.length||!W[0]){var Pt="";yt=[];for(pt in ht[G])this.terminals_[pt]&&pt>Te&&yt.push("'"+this.terminals_[pt]+"'");D.showPosition?Pt="Parse error on line "+(gt+1)+`: +import{s as Se,g as _e,o as ee,n as Ae,a as ke,b as Fe,_ as r,c as Et,l as mt,d as vt,e as Pe,p as ve,B as z,i as Ce,E as Le}from"./mermaid.core-XMN3hSDH.js";import{l as te}from"./linear-DZwFWlPa.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Ct=(function(){var t=r(function(Y,s,l,u){for(l=l||{},u=Y.length;u--;l[Y[u]]=s);return l},"o"),a=[1,3],p=[1,4],f=[1,5],o=[1,6],x=[1,7],_=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],h=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],S=[2,36],q=[1,37],b=[1,36],y=[1,38],T=[1,35],m=[1,43],g=[1,41],k=[1,45],ct=[1,14],dt=[1,23],ut=[1,18],xt=[1,19],ot=[1,20],bt=[1,21],lt=[1,22],i=[1,24],Dt=[1,25],zt=[1,26],Vt=[1,27],It=[1,28],wt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Bt=[1,66],Rt=[1,67],Nt=[1,68],Wt=[1,69],Ut=[1,70],Qt=[1,71],Ot=[1,72],Ht=[1,73],Xt=[1,74],Mt=[1,75],Yt=[1,76],jt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],St=[1,103],Gt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],_t={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:r(function(s,l,u,d,A,e,ht){var n=e.length-1;switch(A){case 23:this.$=e[n];break;case 24:this.$=e[n-1]+""+e[n];break;case 26:this.$=e[n-1]+e[n];break;case 27:this.$=[e[n].trim()];break;case 28:e[n-2].push(e[n].trim()),this.$=e[n-2];break;case 29:this.$=e[n-4],d.addClass(e[n-2],e[n]);break;case 37:this.$=[];break;case 42:this.$=e[n].trim(),d.setDiagramTitle(this.$);break;case 43:this.$=e[n].trim(),d.setAccTitle(this.$);break;case 44:case 45:this.$=e[n].trim(),d.setAccDescription(this.$);break;case 46:d.addSection(e[n].substr(8)),this.$=e[n].substr(8);break;case 47:d.addPoint(e[n-3],"",e[n-1],e[n],[]);break;case 48:d.addPoint(e[n-4],e[n-3],e[n-1],e[n],[]);break;case 49:d.addPoint(e[n-4],"",e[n-2],e[n-1],e[n]);break;case 50:d.addPoint(e[n-5],e[n-4],e[n-2],e[n-1],e[n]);break;case 51:d.setXAxisLeftText(e[n-2]),d.setXAxisRightText(e[n]);break;case 52:e[n-1].text+=" ⟶ ",d.setXAxisLeftText(e[n-1]);break;case 53:d.setXAxisLeftText(e[n]);break;case 54:d.setYAxisBottomText(e[n-2]),d.setYAxisTopText(e[n]);break;case 55:e[n-1].text+=" ⟶ ",d.setYAxisBottomText(e[n-1]);break;case 56:d.setYAxisBottomText(e[n]);break;case 57:d.setQuadrant1Text(e[n]);break;case 58:d.setQuadrant2Text(e[n]);break;case 59:d.setQuadrant3Text(e[n]);break;case 60:d.setQuadrant4Text(e[n]);break;case 64:this.$={text:e[n],type:"text"};break;case 65:this.$={text:e[n-1].text+""+e[n],type:e[n-1].type};break;case 66:this.$={text:e[n],type:"text"};break;case 67:this.$={text:e[n],type:"markdown"};break;case 68:this.$=e[n];break;case 69:this.$=e[n-1]+""+e[n];break}},"anonymous"),table:[{18:a,26:1,27:2,28:p,55:f,56:o,57:x},{1:[3]},{18:a,26:8,27:2,28:p,55:f,56:o,57:x},{18:a,26:9,27:2,28:p,55:f,56:o,57:x},t(_,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(c,S,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:q,5:b,10:y,12:T,13:m,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(_,[2,34]),{27:46,55:f,56:o,57:x},t(c,[2,37]),t(c,S,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:q,5:b,10:y,12:T,13:m,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(c,[2,45]),t(c,[2,46]),{18:[1,51]},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(_,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:65,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Ht,12:Xt,13:Mt,14:Yt,15:jt,21:64},t(c,[2,53],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(c,[2,56],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(c,[2,57],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Ht,12:Xt,13:Mt,14:Yt,15:jt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(c,[2,52],{58:31,43:84,4:q,5:b,10:y,12:T,13:m,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,55],{58:31,43:85,4:q,5:b,10:y,12:T,13:m,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(c,[2,51],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(c,[2,29],{10:St}),t(Gt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(c,[2,49],{10:St}),t(c,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(c,[2,50],{10:St}),t(Gt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:r(function(s,l){if(l.recoverable)this.trace(s);else{var u=new Error(s);throw u.hash=l,u}},"parseError"),parse:r(function(s){var l=this,u=[0],d=[],A=[null],e=[],ht=this.table,n="",gt=0,Kt=0,Te=2,Zt=1,me=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(j.yy[At]=this.yy[At]);D.setInput(s,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var kt=D.yylloc;e.push(kt);var qe=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(R){u.length=u.length-2*R,A.length=A.length-R,e.length=e.length-R}r(be,"popStack");function Jt(){var R;return R=d.pop()||D.lex()||Zt,typeof R!="number"&&(R instanceof Array&&(d=R,R=d.pop()),R=l.symbols_[R]||R),R}r(Jt,"lex");for(var B,G,W,Ft,rt={},pt,M,$t,yt;;){if(G=u[u.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=Jt()),W=ht[G]&&ht[G][B]),typeof W>"u"||!W.length||!W[0]){var Pt="";yt=[];for(pt in ht[G])this.terminals_[pt]&&pt>Te&&yt.push("'"+this.terminals_[pt]+"'");D.showPosition?Pt="Parse error on line "+(gt+1)+`: `+D.showPosition()+` Expecting `+yt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Pt="Parse error on line "+(gt+1)+": Unexpected "+(B==Zt?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Pt,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:kt,expected:yt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:u.push(B),A.push(D.yytext),e.push(D.yylloc),u.push(W[1]),B=null,Kt=D.yyleng,n=D.yytext,gt=D.yylineno,kt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=A[A.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},qe&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Ft=this.performAction.apply(rt,[n,Kt,gt,j.yy,W[1],A,e].concat(me)),typeof Ft<"u")return Ft;M&&(u=u.slice(0,-1*M*2),A=A.slice(0,-1*M),e=e.slice(0,-1*M)),u.push(this.productions_[W[1]][0]),A.push(rt.$),e.push(rt._$),$t=ht[u[u.length-2]][u[u.length-1]],u.push($t);break;case 3:return!0}}return!0},"parse")},ye=(function(){var Y={EOF:1,parseError:r(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:r(function(s,l){return this.yy=l||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var l=s.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:r(function(s){var l=s.length,u=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===d.length?this.yylloc.first_column:0)+d[d.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:r(function(s){this.unput(this.match.slice(s))},"less"),pastInput:r(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var s=this.pastInput(),l=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-Buc-7xRH.js b/apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-Bo3Qjwvx.js similarity index 84% rename from apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-Buc-7xRH.js rename to apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-Bo3Qjwvx.js index 0f5eb67d4b7..08d02da9df6 100644 --- a/apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-Buc-7xRH.js +++ b/apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-Bo3Qjwvx.js @@ -1 +1 @@ -import{g as s,r as l,d as t}from"./chunk-MOJQB5TN-BWiH3s-c.js";import{p as m}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{_ as n,l as i}from"./mermaid.core-CGrLstUA.js";import{M as p,c as u}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; +import{g as s,r as l,d as t}from"./chunk-MOJQB5TN-DfjF6X7a.js";import{p as m}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as n,l as i}from"./mermaid.core-XMN3hSDH.js";import{M as p,c as u}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; diff --git a/apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-CSxNTrK4.js b/apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-BTUv_Oh8.js similarity index 99% rename from apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-CSxNTrK4.js rename to apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-BTUv_Oh8.js index f931b258c12..9ad7ebe44a1 100644 --- a/apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-CSxNTrK4.js +++ b/apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-BTUv_Oh8.js @@ -1,4 +1,4 @@ -import{g as Ge}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as ze}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as h,y as Ye,b as Xe,a as Je,s as Ze,g as et,n as tt,o as st,c as Te,l as Ne,p as it,t as rt,u as nt,v as at,x as lt}from"./mermaid.core-CGrLstUA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var qe=(function(){var e=h(function($,r,a,c){for(a=a||{},c=$.length;c--;a[$[c]]=r);return a},"o"),u=[1,3],o=[1,4],n=[1,5],i=[1,6],f=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,22],E=[2,7],g=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],p=[1,39],R=[1,40],d=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ce=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],de=[27,29],Ae=[1,70],Ve=[1,71],ve=[1,72],Le=[1,73],xe=[1,74],Oe=[1,75],we=[1,76],Z=[1,83],U=[1,80],ee=[1,84],te=[1,85],se=[1,86],ie=[1,87],re=[1,88],ne=[1,89],ae=[1,90],le=[1,91],ce=[1,92],Ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],De=[1,101],Me=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],oe=[1,116],he=[1,117],ue=[1,114],fe=[1,115],_e={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:h(function(r,a,c,s,m,t,me){var l=t.length-1;switch(m){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[l-3]);break;case 43:s.addElement(t[l-5]),s.setClass([t[l-5]],t[l-3]);break;case 44:s.setNewElementType(t[l-2]);break;case 45:s.setNewElementDocRef(t[l-2]);break;case 48:s.addRelationship(t[l-2],t[l],t[l-4]);break;case 49:s.addRelationship(t[l-2],t[l-4],t[l]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[l-2],s.defineClass(t[l-1],t[l]);break;case 58:s.setClass(t[l-1],t[l]);break;case 59:s.setClass([t[l-2]],t[l]);break;case 60:case 62:this.$=[t[l]];break;case 61:case 63:this.$=t[l-2].concat([t[l]]);break;case 64:this.$=t[l-2],s.setCssStyle(t[l-1],t[l]);break;case 65:this.$=[t[l]];break;case 66:t[l-2].push(t[l]),this.$=t[l-2];break;case 68:this.$=t[l-1]+t[l];break}},"anonymous"),table:[{3:1,4:2,6:u,9:o,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:u,9:o,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(f,[2,6]),{3:12,4:2,6:u,9:o,11:n,13:i},{1:[2,2]},{4:17,5:_,7:13,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},e(f,[2,4]),e(f,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:_,7:42,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:43,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:44,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:45,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:46,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:47,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:48,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:49,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:50,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),{30:60,33:62,75:P,89:p,90:R},{30:63,33:62,75:P,89:p,90:R},{30:64,33:62,75:P,89:p,90:R},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(de,[2,79]),e(de,[2,80]),{27:[1,67],29:[1,68]},e(de,[2,85]),e(de,[2,86]),{62:69,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{62:77,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{30:78,33:62,75:P,89:p,90:R},{73:79,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,60]),e(Ee,[2,62]),{73:93,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},{30:94,33:62,75:P,76:U,89:p,90:R},{5:[1,95]},{30:96,33:62,75:P,89:p,90:R},{5:[1,97]},{30:98,33:62,75:P,89:p,90:R},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(d,[2,59],{76:U}),e(d,[2,64],{76:De}),{33:103,75:[1,102],89:p,90:R},e(Me,[2,65],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(d,[2,57],{76:De}),e(d,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:oe,40:he,56:113,57:ue,59:fe},{27:[1,118],76:U},{33:119,89:p,90:R},{33:120,89:p,90:R},{75:Z,78:121,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,61]),e(Ee,[2,63]),e(T,[2,68]),e(d,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(d,[2,28]),{5:[1,127]},e(d,[2,42]),{32:[1,128]},{32:[1,129]},{5:oe,40:he,56:130,57:ue,59:fe},e(d,[2,47]),{5:[1,131]},e(d,[2,48]),e(d,[2,49]),e(Me,[2,66],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),{33:132,89:p,90:R},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(d,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(d,[2,46]),{5:oe,40:he,56:152,57:ue,59:fe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(d,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(d,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:oe,40:he,56:163,57:ue,59:fe},{5:oe,40:he,56:164,57:ue,59:fe},e(d,[2,23]),e(d,[2,24]),e(d,[2,25]),e(d,[2,26]),e(d,[2,44]),e(d,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:h(function(r,a){if(a.recoverable)this.trace(r);else{var c=new Error(r);throw c.hash=a,c}},"parseError"),parse:h(function(r){var a=this,c=[0],s=[],m=[null],t=[],me=this.table,l="",Re=0,Fe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),y=Object.create(this.lexer),G={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(G.yy[Se]=this.yy[Se]);y.setInput(r,G.yy),G.yy.lexer=y,G.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var be=y.yylloc;t.push(be);var We=y.options&&y.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(I){c.length=c.length-2*I,m.length=m.length-I,t.length=t.length-I}h(je,"popStack");function Pe(){var I;return I=s.pop()||y.lex()||$e,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=a.symbols_[I]||I),I}h(Pe,"lex");for(var b,z,N,Ie,J={},ge,F,Ue,ye;;){if(z=c[c.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((b===null||typeof b>"u")&&(b=Pe()),N=me[z]&&me[z][b]),typeof N>"u"||!N.length||!N[0]){var ke="";ye=[];for(ge in me[z])this.terminals_[ge]&&ge>He&&ye.push("'"+this.terminals_[ge]+"'");y.showPosition?ke="Parse error on line "+(Re+1)+`: +import{g as Ge}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as ze}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as h,y as Ye,b as Xe,a as Je,s as Ze,g as et,n as tt,o as st,c as Te,l as Ne,p as it,t as rt,u as nt,v as at,x as lt}from"./mermaid.core-XMN3hSDH.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var qe=(function(){var e=h(function($,r,a,c){for(a=a||{},c=$.length;c--;a[$[c]]=r);return a},"o"),u=[1,3],o=[1,4],n=[1,5],i=[1,6],f=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,22],E=[2,7],g=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],p=[1,39],R=[1,40],d=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ce=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],de=[27,29],Ae=[1,70],Ve=[1,71],ve=[1,72],Le=[1,73],xe=[1,74],Oe=[1,75],we=[1,76],Z=[1,83],U=[1,80],ee=[1,84],te=[1,85],se=[1,86],ie=[1,87],re=[1,88],ne=[1,89],ae=[1,90],le=[1,91],ce=[1,92],Ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],De=[1,101],Me=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],oe=[1,116],he=[1,117],ue=[1,114],fe=[1,115],_e={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:h(function(r,a,c,s,m,t,me){var l=t.length-1;switch(m){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[l-3]);break;case 43:s.addElement(t[l-5]),s.setClass([t[l-5]],t[l-3]);break;case 44:s.setNewElementType(t[l-2]);break;case 45:s.setNewElementDocRef(t[l-2]);break;case 48:s.addRelationship(t[l-2],t[l],t[l-4]);break;case 49:s.addRelationship(t[l-2],t[l-4],t[l]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[l-2],s.defineClass(t[l-1],t[l]);break;case 58:s.setClass(t[l-1],t[l]);break;case 59:s.setClass([t[l-2]],t[l]);break;case 60:case 62:this.$=[t[l]];break;case 61:case 63:this.$=t[l-2].concat([t[l]]);break;case 64:this.$=t[l-2],s.setCssStyle(t[l-1],t[l]);break;case 65:this.$=[t[l]];break;case 66:t[l-2].push(t[l]),this.$=t[l-2];break;case 68:this.$=t[l-1]+t[l];break}},"anonymous"),table:[{3:1,4:2,6:u,9:o,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:u,9:o,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(f,[2,6]),{3:12,4:2,6:u,9:o,11:n,13:i},{1:[2,2]},{4:17,5:_,7:13,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},e(f,[2,4]),e(f,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:_,7:42,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:43,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:44,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:45,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:46,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:47,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:48,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:49,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:50,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),{30:60,33:62,75:P,89:p,90:R},{30:63,33:62,75:P,89:p,90:R},{30:64,33:62,75:P,89:p,90:R},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(de,[2,79]),e(de,[2,80]),{27:[1,67],29:[1,68]},e(de,[2,85]),e(de,[2,86]),{62:69,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{62:77,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{30:78,33:62,75:P,89:p,90:R},{73:79,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,60]),e(Ee,[2,62]),{73:93,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},{30:94,33:62,75:P,76:U,89:p,90:R},{5:[1,95]},{30:96,33:62,75:P,89:p,90:R},{5:[1,97]},{30:98,33:62,75:P,89:p,90:R},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(d,[2,59],{76:U}),e(d,[2,64],{76:De}),{33:103,75:[1,102],89:p,90:R},e(Me,[2,65],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(d,[2,57],{76:De}),e(d,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:oe,40:he,56:113,57:ue,59:fe},{27:[1,118],76:U},{33:119,89:p,90:R},{33:120,89:p,90:R},{75:Z,78:121,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,61]),e(Ee,[2,63]),e(T,[2,68]),e(d,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(d,[2,28]),{5:[1,127]},e(d,[2,42]),{32:[1,128]},{32:[1,129]},{5:oe,40:he,56:130,57:ue,59:fe},e(d,[2,47]),{5:[1,131]},e(d,[2,48]),e(d,[2,49]),e(Me,[2,66],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),{33:132,89:p,90:R},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(d,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(d,[2,46]),{5:oe,40:he,56:152,57:ue,59:fe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(d,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(d,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:oe,40:he,56:163,57:ue,59:fe},{5:oe,40:he,56:164,57:ue,59:fe},e(d,[2,23]),e(d,[2,24]),e(d,[2,25]),e(d,[2,26]),e(d,[2,44]),e(d,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:h(function(r,a){if(a.recoverable)this.trace(r);else{var c=new Error(r);throw c.hash=a,c}},"parseError"),parse:h(function(r){var a=this,c=[0],s=[],m=[null],t=[],me=this.table,l="",Re=0,Fe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),y=Object.create(this.lexer),G={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(G.yy[Se]=this.yy[Se]);y.setInput(r,G.yy),G.yy.lexer=y,G.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var be=y.yylloc;t.push(be);var We=y.options&&y.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(I){c.length=c.length-2*I,m.length=m.length-I,t.length=t.length-I}h(je,"popStack");function Pe(){var I;return I=s.pop()||y.lex()||$e,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=a.symbols_[I]||I),I}h(Pe,"lex");for(var b,z,N,Ie,J={},ge,F,Ue,ye;;){if(z=c[c.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((b===null||typeof b>"u")&&(b=Pe()),N=me[z]&&me[z][b]),typeof N>"u"||!N.length||!N[0]){var ke="";ye=[];for(ge in me[z])this.terminals_[ge]&&ge>He&&ye.push("'"+this.terminals_[ge]+"'");y.showPosition?ke="Parse error on line "+(Re+1)+`: `+y.showPosition()+` Expecting `+ye.join(", ")+", got '"+(this.terminals_[b]||b)+"'":ke="Parse error on line "+(Re+1)+": Unexpected "+(b==$e?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(ke,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:be,expected:ye})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+b);switch(N[0]){case 1:c.push(b),m.push(y.yytext),t.push(y.yylloc),c.push(N[1]),b=null,Fe=y.yyleng,l=y.yytext,Re=y.yylineno,be=y.yylloc;break;case 2:if(F=this.productions_[N[1]][1],J.$=m[m.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},We&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Ie=this.performAction.apply(J,[l,Fe,Re,G.yy,N[1],m,t].concat(Ke)),typeof Ie<"u")return Ie;F&&(c=c.slice(0,-1*F*2),m=m.slice(0,-1*F),t=t.slice(0,-1*F)),c.push(this.productions_[N[1]][0]),m.push(J.$),t.push(J._$),Ue=me[c[c.length-2]][c[c.length-1]],c.push(Ue);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var $={EOF:1,parseError:h(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:h(function(r,a){return this.yy=a||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:h(function(r){var a=r.length,c=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var m=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===s.length?this.yylloc.first_column:0)+s[s.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(r){this.unput(this.match.slice(r))},"less"),pastInput:h(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-Dd9T4UrJ.js b/apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-lACUqAhA.js similarity index 99% rename from apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-Dd9T4UrJ.js rename to apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-lACUqAhA.js index 0f3a45a8f68..1247ecaa71d 100644 --- a/apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-Dd9T4UrJ.js +++ b/apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-lACUqAhA.js @@ -1,4 +1,4 @@ -import{n as kt,o as mt,s as xt,g as _t,b as vt,a as bt,_ as y,c as ot,b8 as St,d as G,ad as wt,p as Lt,k as Et}from"./mermaid.core-CGrLstUA.js";import{o as At}from"./ordinal-Cboi1Yqb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Tt(t){for(var i=t.length/6|0,s=new Array(i),l=0;l=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s=u)&&(s=u)}return s}function dt(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s>l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function J(t,i){let s=0;if(i===void 0)for(let l of t)(l=+l)&&(s+=l);else{let l=-1;for(let u of t)(u=+i(u,++l,t))&&(s+=u)}return s}function Nt(t){return t.target.depth}function Ct(t){return t.depth}function Pt(t,i){return i-1-t.height}function gt(t,i){return t.sourceLinks.length?t.depth:i-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dt(t.sourceLinks,Nt)-1:0}function Y(t){return function(){return t}}function lt(t,i){return H(t.source,i.source)||t.index-i.index}function ct(t,i){return H(t.target,i.target)||t.index-i.index}function H(t,i){return t.y0-i.y0}function tt(t){return t.value}function Ot(t){return t.index}function $t(t){return t.nodes}function Dt(t){return t.links}function ut(t,i){const s=t.get(i);if(!s)throw new Error("missing: "+i);return s}function ht({nodes:t}){for(const i of t){let s=i.y0,l=s;for(const u of i.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of i.targetLinks)u.y1=l+u.width/2,l+=u.width}}function jt(){let t=0,i=0,s=1,l=1,u=24,x=8,g,k=Ot,o=gt,a,h,m=$t,_=Dt,d=6;function v(){const n={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(n),A(n),M(n),I(n),S(n),ht(n),n}v.update=function(n){return ht(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:Y(n),v):k},v.nodeAlign=function(n){return arguments.length?(o=typeof n=="function"?n:Y(n),v):o},v.nodeSort=function(n){return arguments.length?(a=n,v):a},v.nodeWidth=function(n){return arguments.length?(u=+n,v):u},v.nodePadding=function(n){return arguments.length?(x=g=+n,v):x},v.nodes=function(n){return arguments.length?(m=typeof n=="function"?n:Y(n),v):m},v.links=function(n){return arguments.length?(_=typeof n=="function"?n:Y(n),v):_},v.linkSort=function(n){return arguments.length?(h=n,v):h},v.size=function(n){return arguments.length?(t=i=0,s=+n[0],l=+n[1],v):[s-t,l-i]},v.extent=function(n){return arguments.length?(t=+n[0][0],s=+n[1][0],i=+n[0][1],l=+n[1][1],v):[[t,i],[s,l]]},v.iterations=function(n){return arguments.length?(d=+n,v):d};function T({nodes:n,links:f}){for(const[e,r]of n.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(n.map((e,r)=>[k(e,r,n),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ut(c,p)),typeof b!="object"&&(b=r.target=ut(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of n)e.sort(h),r.sort(h)}function A({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(J(f.sourceLinks,tt),J(f.targetLinks,tt)):f.fixedValue}function M({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:n}){const f=at(n,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of n){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(a)for(const r of e)r.sort(a);return e}function $(n){const f=dt(n,c=>(l-i-(c.length-1)*g)/J(c,tt));for(const c of n){let e=i;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(l-e+g)/(c.length+1);for(let r=0;rc.length)-1)),$(f);for(let c=0;c0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,j(b)}a===void 0&&p.sort(H),D(p,c)}}function F(n,f,c){for(let e=n.length,r=e-2;r>=0;--r){const p=n[r];for(const b of p){let L=0,z=0;for(const{target:W,value:Z}of b.sourceLinks){let U=Z*(W.layer-b.layer);L+=E(b,W)*U,z+=U}if(!(z>0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,j(b)}a===void 0&&p.sort(H),D(p,c)}}function D(n,f){const c=n.length>>1,e=n[c];O(n,e.y0-g,c-1,f),R(n,e.y1+g,c+1,f),O(n,l,n.length-1,f),R(n,i,0,f)}function R(n,f,c,e){for(;c1e-6&&(r.y0+=p,r.y1+=p),f=r.y1+g}}function O(n,f,c,e){for(;c>=0;--c){const r=n[c],p=(r.y1-f)*e;p>1e-6&&(r.y0-=p,r.y1-=p),f=r.y0-g}}function j({sourceLinks:n,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ct);for(const{target:{targetLinks:c}}of n)c.sort(lt)}}function w(n){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of n)f.sort(ct),c.sort(lt)}function P(n,f){let c=n.y0-(n.sourceLinks.length-1)*g/2;for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c+=r+g}for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c-=r}return c}function E(n,f){let c=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c+=r+g}for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c-=r}return c}return v}var et=Math.PI,nt=2*et,B=1e-6,zt=nt-B;function it(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pt(){return new it}it.prototype=pt.prototype={constructor:it,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+l)},bezierCurveTo:function(t,i,s,l,u,x){this._+="C"+ +t+","+ +i+","+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+x)},arcTo:function(t,i,s,l,u){t=+t,i=+i,s=+s,l=+l,u=+u;var x=this._x1,g=this._y1,k=s-t,o=l-i,a=x-t,h=g-i,m=a*a+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(m>B)if(!(Math.abs(h*k-o*a)>B)||!u)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var _=s-x,d=l-g,v=k*k+o*o,T=_*_+d*d,A=Math.sqrt(v),M=Math.sqrt(m),I=u*Math.tan((et-Math.acos((v+m-T)/(2*A*M)))/2),N=I/M,$=I/A;Math.abs(N-1)>B&&(this._+="L"+(t+N*a)+","+(i+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>a*d)+","+(this._x1=t+$*k)+","+(this._y1=i+$*o)}},arc:function(t,i,s,l,u,x){t=+t,i=+i,s=+s,x=!!x;var g=s*Math.cos(l),k=s*Math.sin(l),o=t+g,a=i+k,h=1^x,m=x?l-u:u-l;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+a:(Math.abs(this._x1-o)>B||Math.abs(this._y1-a)>B)&&(this._+="L"+o+","+a),s&&(m<0&&(m=m%nt+nt),m>zt?this._+="A"+s+","+s+",0,1,"+h+","+(t-g)+","+(i-k)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=a):m>B&&(this._+="A"+s+","+s+",0,"+ +(m>=et)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=i+s*Math.sin(u))))},rect:function(t,i,s,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +l+"h"+-s+"Z"},toString:function(){return this._}};function ft(t){return function(){return t}}function Bt(t){return t[0]}function Ft(t){return t[1]}var Rt=Array.prototype.slice;function Vt(t){return t.source}function Wt(t){return t.target}function Ut(t){var i=Vt,s=Wt,l=Bt,u=Ft,x=null;function g(){var k,o=Rt.call(arguments),a=i.apply(this,o),h=s.apply(this,o);if(x||(x=k=pt()),t(x,+l.apply(this,(o[0]=a,o)),+u.apply(this,o),+l.apply(this,(o[0]=h,o)),+u.apply(this,o)),k)return x=null,k+""||null}return g.source=function(k){return arguments.length?(i=k,g):i},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(l=typeof k=="function"?k:ft(+k),g):l},g.y=function(k){return arguments.length?(u=typeof k=="function"?k:ft(+k),g):u},g.context=function(k){return arguments.length?(x=k??null,g):x},g}function Gt(t,i,s,l,u){t.moveTo(i,s),t.bezierCurveTo(i=(i+l)/2,s,i,u,l,u)}function Yt(){return Ut(Gt)}function Ht(t){return[t.source.x1,t.y0]}function Xt(t){return[t.target.x0,t.y1]}function qt(){return Yt().source(Ht).target(Xt)}var rt=(function(){var t=y(function(k,o,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=o);return a},"o"),i=[1,9],s=[1,10],l=[1,5,10,12],u={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:y(function(o,a,h,m,_,d,v){var T=d.length-1;switch(_){case 7:const A=m.findOrCreateNode(d[T-4].trim().replaceAll('""','"')),M=m.findOrCreateNode(d[T-2].trim().replaceAll('""','"')),I=parseFloat(d[T].trim());m.addLink(A,M,I);break;case 8:case 9:case 11:this.$=d[T];break;case 10:this.$=d[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:i,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:s},{15:18,16:7,17:8,18:i,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:y(function(o,a){if(a.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=a,h}},"parseError"),parse:y(function(o){var a=this,h=[0],m=[],_=[null],d=[],v=this.table,T="",A=0,M=0,I=2,N=1,$=d.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var D=S.yylloc;d.push(D);var R=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,d.length=d.length-L}y(O,"popStack");function j(){var L;return L=m.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(m=L,L=m.pop()),L=a.symbols_[L]||L),L}y(j,"lex");for(var w,P,E,n,f={},c,e,r,p;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=j()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";p=[];for(c in v[P])this.terminals_[c]&&c>I&&p.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: +import{n as kt,o as mt,s as xt,g as _t,b as vt,a as bt,_ as y,c as ot,b8 as St,d as G,ad as wt,p as Lt,k as Et}from"./mermaid.core-XMN3hSDH.js";import{o as At}from"./ordinal-Cboi1Yqb.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Tt(t){for(var i=t.length/6|0,s=new Array(i),l=0;l=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s=u)&&(s=u)}return s}function dt(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s>l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function J(t,i){let s=0;if(i===void 0)for(let l of t)(l=+l)&&(s+=l);else{let l=-1;for(let u of t)(u=+i(u,++l,t))&&(s+=u)}return s}function Nt(t){return t.target.depth}function Ct(t){return t.depth}function Pt(t,i){return i-1-t.height}function gt(t,i){return t.sourceLinks.length?t.depth:i-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dt(t.sourceLinks,Nt)-1:0}function Y(t){return function(){return t}}function lt(t,i){return H(t.source,i.source)||t.index-i.index}function ct(t,i){return H(t.target,i.target)||t.index-i.index}function H(t,i){return t.y0-i.y0}function tt(t){return t.value}function Ot(t){return t.index}function $t(t){return t.nodes}function Dt(t){return t.links}function ut(t,i){const s=t.get(i);if(!s)throw new Error("missing: "+i);return s}function ht({nodes:t}){for(const i of t){let s=i.y0,l=s;for(const u of i.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of i.targetLinks)u.y1=l+u.width/2,l+=u.width}}function jt(){let t=0,i=0,s=1,l=1,u=24,x=8,g,k=Ot,o=gt,a,h,m=$t,_=Dt,d=6;function v(){const n={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(n),A(n),M(n),I(n),S(n),ht(n),n}v.update=function(n){return ht(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:Y(n),v):k},v.nodeAlign=function(n){return arguments.length?(o=typeof n=="function"?n:Y(n),v):o},v.nodeSort=function(n){return arguments.length?(a=n,v):a},v.nodeWidth=function(n){return arguments.length?(u=+n,v):u},v.nodePadding=function(n){return arguments.length?(x=g=+n,v):x},v.nodes=function(n){return arguments.length?(m=typeof n=="function"?n:Y(n),v):m},v.links=function(n){return arguments.length?(_=typeof n=="function"?n:Y(n),v):_},v.linkSort=function(n){return arguments.length?(h=n,v):h},v.size=function(n){return arguments.length?(t=i=0,s=+n[0],l=+n[1],v):[s-t,l-i]},v.extent=function(n){return arguments.length?(t=+n[0][0],s=+n[1][0],i=+n[0][1],l=+n[1][1],v):[[t,i],[s,l]]},v.iterations=function(n){return arguments.length?(d=+n,v):d};function T({nodes:n,links:f}){for(const[e,r]of n.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(n.map((e,r)=>[k(e,r,n),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ut(c,p)),typeof b!="object"&&(b=r.target=ut(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of n)e.sort(h),r.sort(h)}function A({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(J(f.sourceLinks,tt),J(f.targetLinks,tt)):f.fixedValue}function M({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:n}){const f=at(n,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of n){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(a)for(const r of e)r.sort(a);return e}function $(n){const f=dt(n,c=>(l-i-(c.length-1)*g)/J(c,tt));for(const c of n){let e=i;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(l-e+g)/(c.length+1);for(let r=0;rc.length)-1)),$(f);for(let c=0;c0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,j(b)}a===void 0&&p.sort(H),D(p,c)}}function F(n,f,c){for(let e=n.length,r=e-2;r>=0;--r){const p=n[r];for(const b of p){let L=0,z=0;for(const{target:W,value:Z}of b.sourceLinks){let U=Z*(W.layer-b.layer);L+=E(b,W)*U,z+=U}if(!(z>0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,j(b)}a===void 0&&p.sort(H),D(p,c)}}function D(n,f){const c=n.length>>1,e=n[c];O(n,e.y0-g,c-1,f),R(n,e.y1+g,c+1,f),O(n,l,n.length-1,f),R(n,i,0,f)}function R(n,f,c,e){for(;c1e-6&&(r.y0+=p,r.y1+=p),f=r.y1+g}}function O(n,f,c,e){for(;c>=0;--c){const r=n[c],p=(r.y1-f)*e;p>1e-6&&(r.y0-=p,r.y1-=p),f=r.y0-g}}function j({sourceLinks:n,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ct);for(const{target:{targetLinks:c}}of n)c.sort(lt)}}function w(n){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of n)f.sort(ct),c.sort(lt)}function P(n,f){let c=n.y0-(n.sourceLinks.length-1)*g/2;for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c+=r+g}for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c-=r}return c}function E(n,f){let c=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c+=r+g}for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c-=r}return c}return v}var et=Math.PI,nt=2*et,B=1e-6,zt=nt-B;function it(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pt(){return new it}it.prototype=pt.prototype={constructor:it,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+l)},bezierCurveTo:function(t,i,s,l,u,x){this._+="C"+ +t+","+ +i+","+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+x)},arcTo:function(t,i,s,l,u){t=+t,i=+i,s=+s,l=+l,u=+u;var x=this._x1,g=this._y1,k=s-t,o=l-i,a=x-t,h=g-i,m=a*a+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(m>B)if(!(Math.abs(h*k-o*a)>B)||!u)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var _=s-x,d=l-g,v=k*k+o*o,T=_*_+d*d,A=Math.sqrt(v),M=Math.sqrt(m),I=u*Math.tan((et-Math.acos((v+m-T)/(2*A*M)))/2),N=I/M,$=I/A;Math.abs(N-1)>B&&(this._+="L"+(t+N*a)+","+(i+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>a*d)+","+(this._x1=t+$*k)+","+(this._y1=i+$*o)}},arc:function(t,i,s,l,u,x){t=+t,i=+i,s=+s,x=!!x;var g=s*Math.cos(l),k=s*Math.sin(l),o=t+g,a=i+k,h=1^x,m=x?l-u:u-l;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+a:(Math.abs(this._x1-o)>B||Math.abs(this._y1-a)>B)&&(this._+="L"+o+","+a),s&&(m<0&&(m=m%nt+nt),m>zt?this._+="A"+s+","+s+",0,1,"+h+","+(t-g)+","+(i-k)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=a):m>B&&(this._+="A"+s+","+s+",0,"+ +(m>=et)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=i+s*Math.sin(u))))},rect:function(t,i,s,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +l+"h"+-s+"Z"},toString:function(){return this._}};function ft(t){return function(){return t}}function Bt(t){return t[0]}function Ft(t){return t[1]}var Rt=Array.prototype.slice;function Vt(t){return t.source}function Wt(t){return t.target}function Ut(t){var i=Vt,s=Wt,l=Bt,u=Ft,x=null;function g(){var k,o=Rt.call(arguments),a=i.apply(this,o),h=s.apply(this,o);if(x||(x=k=pt()),t(x,+l.apply(this,(o[0]=a,o)),+u.apply(this,o),+l.apply(this,(o[0]=h,o)),+u.apply(this,o)),k)return x=null,k+""||null}return g.source=function(k){return arguments.length?(i=k,g):i},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(l=typeof k=="function"?k:ft(+k),g):l},g.y=function(k){return arguments.length?(u=typeof k=="function"?k:ft(+k),g):u},g.context=function(k){return arguments.length?(x=k??null,g):x},g}function Gt(t,i,s,l,u){t.moveTo(i,s),t.bezierCurveTo(i=(i+l)/2,s,i,u,l,u)}function Yt(){return Ut(Gt)}function Ht(t){return[t.source.x1,t.y0]}function Xt(t){return[t.target.x0,t.y1]}function qt(){return Yt().source(Ht).target(Xt)}var rt=(function(){var t=y(function(k,o,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=o);return a},"o"),i=[1,9],s=[1,10],l=[1,5,10,12],u={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:y(function(o,a,h,m,_,d,v){var T=d.length-1;switch(_){case 7:const A=m.findOrCreateNode(d[T-4].trim().replaceAll('""','"')),M=m.findOrCreateNode(d[T-2].trim().replaceAll('""','"')),I=parseFloat(d[T].trim());m.addLink(A,M,I);break;case 8:case 9:case 11:this.$=d[T];break;case 10:this.$=d[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:i,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:s},{15:18,16:7,17:8,18:i,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:y(function(o,a){if(a.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=a,h}},"parseError"),parse:y(function(o){var a=this,h=[0],m=[],_=[null],d=[],v=this.table,T="",A=0,M=0,I=2,N=1,$=d.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var D=S.yylloc;d.push(D);var R=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,d.length=d.length-L}y(O,"popStack");function j(){var L;return L=m.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(m=L,L=m.pop()),L=a.symbols_[L]||L),L}y(j,"lex");for(var w,P,E,n,f={},c,e,r,p;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=j()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";p=[];for(c in v[P])this.terminals_[c]&&c>I&&p.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: `+S.showPosition()+` Expecting `+p.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:D,expected:p})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),d.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,D=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:d[d.length-(e||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(e||1)].first_column,last_column:d[d.length-1].last_column},R&&(f._$.range=[d[d.length-(e||1)].range[0],d[d.length-1].range[1]]),n=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,d].concat($)),typeof n<"u")return n;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),d=d.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),d.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:y(function(a,h){if(this.yy.parser)this.yy.parser.parseError(a,h);else throw new Error(a)},"parseError"),setInput:y(function(o,a){return this.yy=a||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var a=o.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:y(function(o){var a=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(o){this.unput(this.match.slice(o))},"less"),pastInput:y(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var o=this.pastInput(),a=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-Cr-Sj8Pb.js b/apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-td3c-NEP.js similarity index 99% rename from apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-Cr-Sj8Pb.js rename to apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-td3c-NEP.js index 85a6f053474..3a8cf6db2a5 100644 --- a/apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-Cr-Sj8Pb.js +++ b/apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-td3c-NEP.js @@ -1,4 +1,4 @@ -import{I as tr}from"./chunk-2Q5K7J3B-CldwFnN4.js";import{_ as x,F as er,c as $,d as Vt,l as at,j as Ce,e as rr,f as ar,k as N,b as ke,s as sr,n as ir,a as nr,g as or,o as cr,G as lr,J as hr,p as dr,i as Yt,x as Z,H as Q,I as Pt,K as Me,Z as Tr,y as Kt,L as pr,M as Be}from"./mermaid.core-CGrLstUA.js";import{a as Er,b as ae,g as dt,d as ur,c as se,e as ie}from"./chunk-32BRIVSS-0ImWpiFu.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var te=(function(){var e=x(function(ut,S,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=S);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],u=[1,14],d=[1,15],p=[1,17],_=[1,18],E=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],w=[1,32],A=[1,33],D=[1,34],M=[1,35],V=[1,36],W=[1,37],U=[1,38],G=[1,39],X=[1,40],nt=[1,42],j=[1,43],q=[1,44],st=[1,45],tt=[1,46],Y=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],At=[1,74],kt=[1,80],m=[1,81],k=[1,82],lt=[1,83],et=[1,84],K=[1,85],Ot=[1,86],ne=[1,87],oe=[1,88],ce=[1,89],le=[1,90],he=[1,91],de=[1,92],Te=[1,93],pe=[1,94],Ee=[1,95],ue=[1,96],fe=[1,97],_e=[1,98],ge=[1,99],xe=[1,100],Ie=[1,101],ye=[1,102],Re=[1,103],Oe=[1,104],Le=[1,105],be=[2,78],St=[4,5,17,51,53,54],Dt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],me=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Ut=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Gt=[5,52],F=[70,71,72,73],ot=[1,151],Xt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(S,v,P,y,z,c,wt){var h=c.length-1;switch(z){case 3:return y.apply(c[h]),c[h];case 4:case 10:this.$=[];break;case 5:case 11:c[h-1].push(c[h]),this.$=c[h-1];break;case 6:case 7:case 12:case 13:this.$=c[h];break;case 8:case 9:case 14:this.$=[];break;case 16:c[h].type="createParticipant",this.$=c[h];break;case 17:c[h-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[h-2])}),c[h-1].push({type:"boxEnd",boxText:c[h-2]}),this.$=c[h-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-2]),sequenceIndexStep:Number(c[h-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-1].actor};break;case 30:y.setDiagramTitle(c[h].substring(6)),this.$=c[h].substring(6);break;case 31:y.setDiagramTitle(c[h].substring(7)),this.$=c[h].substring(7);break;case 32:this.$=c[h].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[h].trim(),y.setAccDescription(this.$);break;case 35:c[h-1].unshift({type:"loopStart",loopText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.LOOP_START}),c[h-1].push({type:"loopEnd",loopText:c[h-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[h-1];break;case 36:c[h-1].unshift({type:"rectStart",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_START}),c[h-1].push({type:"rectEnd",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[h-1];break;case 37:c[h-1].unshift({type:"optStart",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_START}),c[h-1].push({type:"optEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[h-1];break;case 38:c[h-1].unshift({type:"altStart",altText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.ALT_START}),c[h-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[h-1];break;case 39:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 40:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 41:c[h-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.CRITICAL_START}),c[h-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[h-1];break;case 42:c[h-1].unshift({type:"breakStart",breakText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_START}),c[h-1].push({type:"breakEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[h-1];break;case 44:this.$=c[h-3].concat([{type:"option",optionText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[h]]);break;case 46:this.$=c[h-3].concat([{type:"and",parText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.PAR_AND},c[h]]);break;case 48:this.$=c[h-3].concat([{type:"else",altText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.ALT_ELSE},c[h]]);break;case 49:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 50:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 51:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 52:case 57:c[h-1].draw="actor",c[h-1].type="addParticipant",this.$=c[h-1];break;case 53:c[h-1].type="destroyParticipant",this.$=c[h-1];break;case 54:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 55:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 56:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 58:this.$=[c[h-1],{type:"addNote",placement:c[h-2],actor:c[h-1].actor,text:c[h]}];break;case 59:c[h-2]=[].concat(c[h-1],c[h-1]).slice(0,2),c[h-2][0]=c[h-2][0].actor,c[h-2][1]=c[h-2][1].actor,this.$=[c[h-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[h-2].slice(0,2),text:c[h]}];break;case 60:this.$=[c[h-1],{type:"addLinks",actor:c[h-1].actor,text:c[h]}];break;case 61:this.$=[c[h-1],{type:"addALink",actor:c[h-1].actor,text:c[h]}];break;case 62:this.$=[c[h-1],{type:"addProperties",actor:c[h-1].actor,text:c[h]}];break;case 63:this.$=[c[h-1],{type:"addDetails",actor:c[h-1].actor,text:c[h]}];break;case 66:this.$=[c[h-2],c[h]];break;case 67:this.$=c[h];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor}];break;case 71:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-4].actor}];break;case 72:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor}];break;case 73:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-4].actor}];break;case 74:this.$=[c[h-5],c[h-1],{type:"addMessage",from:c[h-5].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-5].actor}];break;case 75:this.$=[c[h-3],c[h-1],{type:"addMessage",from:c[h-3].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h]}];break;case 76:this.$={type:"addParticipant",actor:c[h-1],config:c[h]};break;case 77:this.$=c[h-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[h]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[h].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},e(C,[2,5]),{9:48,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:U,53:G,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:Y},{23:56,73:Y},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:At},{23:75,55:76,73:At},{23:77,73:Y},{69:78,72:[1,79],78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:Y},{23:111,73:Y},{23:112,73:Y},{23:113,73:Y},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],be),e(C,[2,6]),e(C,[2,16]),e(St,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(Dt,i,{7:120}),e(Dt,i,{7:121}),e(Dt,i,{7:122}),e(me,i,{41:123,7:124}),e(Ut,i,{43:125,7:126}),e(Ut,i,{7:126,43:127}),e(Ae,i,{46:128,7:129}),e(Dt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Gt,be,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:Y},{69:146,78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},e(F,[2,79]),e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),{23:147,73:Y},{23:149,60:148,73:Y},{73:[2,68]},{73:[2,69]},{58:150,104:ot},{58:152,104:ot},{58:153,104:ot},{58:154,104:ot},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:G,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,161],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,162],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,163],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,47],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,50:[1,165],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,45],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,49:[1,167],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,43],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,48:[1,170],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,171],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Gt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:Y},{23:178,73:Y},{23:179,73:Y},{58:180,104:ot},{23:181,72:[1,182],73:Y},{58:183,104:ot},{58:184,104:ot},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(St,[2,11]),{13:186,51:U,53:G,54:X},e(St,[2,13]),e(St,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ot},{58:196,104:ot},{58:197,104:ot},{5:[2,75]},{58:198,104:ot},{23:199,73:Y},{5:[2,58]},{5:[2,59]},{23:200,73:Y},e(St,[2,12]),e(me,i,{7:124,41:201}),e(Ut,i,{7:126,43:202}),e(Ae,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Gt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ot},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(S,v){if(v.recoverable)this.trace(S);else{var P=new Error(S);throw P.hash=v,P}},"parseError"),parse:x(function(S){var v=this,P=[0],y=[],z=[null],c=[],wt=this.table,h="",Ct=0,Se=0,Ze=2,we=1,Qe=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Jt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Jt)&&(gt.yy[Jt]=this.yy[Jt]);J.setInput(S,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Zt=J.yylloc;c.push(Zt);var $e=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(it){P.length=P.length-2*it,z.length=z.length-it,c.length=c.length-it}x(je,"popStack");function Ne(){var it;return it=y.pop()||J.lex()||we,typeof it!="number"&&(it instanceof Array&&(y=it,it=y.pop()),it=v.symbols_[it]||it),it}x(Ne,"lex");for(var rt,xt,ct,Qt,Lt={},Mt,Tt,Pe,Bt;;){if(xt=P[P.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((rt===null||typeof rt>"u")&&(rt=Ne()),ct=wt[xt]&&wt[xt][rt]),typeof ct>"u"||!ct.length||!ct[0]){var $t="";Bt=[];for(Mt in wt[xt])this.terminals_[Mt]&&Mt>Ze&&Bt.push("'"+this.terminals_[Mt]+"'");J.showPosition?$t="Parse error on line "+(Ct+1)+`: +import{I as tr}from"./chunk-2Q5K7J3B-DoBgLSx1.js";import{_ as x,F as er,c as $,d as Vt,l as at,j as Ce,e as rr,f as ar,k as N,b as ke,s as sr,n as ir,a as nr,g as or,o as cr,G as lr,J as hr,p as dr,i as Yt,x as Z,H as Q,I as Pt,K as Me,Z as Tr,y as Kt,L as pr,M as Be}from"./mermaid.core-XMN3hSDH.js";import{a as Er,b as ae,g as dt,d as ur,c as se,e as ie}from"./chunk-32BRIVSS-BXcVdJ-W.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var te=(function(){var e=x(function(ut,S,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=S);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],u=[1,14],d=[1,15],p=[1,17],_=[1,18],E=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],w=[1,32],A=[1,33],D=[1,34],M=[1,35],V=[1,36],W=[1,37],U=[1,38],G=[1,39],X=[1,40],nt=[1,42],j=[1,43],q=[1,44],st=[1,45],tt=[1,46],Y=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],At=[1,74],kt=[1,80],m=[1,81],k=[1,82],lt=[1,83],et=[1,84],K=[1,85],Ot=[1,86],ne=[1,87],oe=[1,88],ce=[1,89],le=[1,90],he=[1,91],de=[1,92],Te=[1,93],pe=[1,94],Ee=[1,95],ue=[1,96],fe=[1,97],_e=[1,98],ge=[1,99],xe=[1,100],Ie=[1,101],ye=[1,102],Re=[1,103],Oe=[1,104],Le=[1,105],be=[2,78],St=[4,5,17,51,53,54],Dt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],me=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Ut=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Gt=[5,52],F=[70,71,72,73],ot=[1,151],Xt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(S,v,P,y,z,c,wt){var h=c.length-1;switch(z){case 3:return y.apply(c[h]),c[h];case 4:case 10:this.$=[];break;case 5:case 11:c[h-1].push(c[h]),this.$=c[h-1];break;case 6:case 7:case 12:case 13:this.$=c[h];break;case 8:case 9:case 14:this.$=[];break;case 16:c[h].type="createParticipant",this.$=c[h];break;case 17:c[h-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[h-2])}),c[h-1].push({type:"boxEnd",boxText:c[h-2]}),this.$=c[h-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-2]),sequenceIndexStep:Number(c[h-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-1].actor};break;case 30:y.setDiagramTitle(c[h].substring(6)),this.$=c[h].substring(6);break;case 31:y.setDiagramTitle(c[h].substring(7)),this.$=c[h].substring(7);break;case 32:this.$=c[h].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[h].trim(),y.setAccDescription(this.$);break;case 35:c[h-1].unshift({type:"loopStart",loopText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.LOOP_START}),c[h-1].push({type:"loopEnd",loopText:c[h-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[h-1];break;case 36:c[h-1].unshift({type:"rectStart",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_START}),c[h-1].push({type:"rectEnd",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[h-1];break;case 37:c[h-1].unshift({type:"optStart",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_START}),c[h-1].push({type:"optEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[h-1];break;case 38:c[h-1].unshift({type:"altStart",altText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.ALT_START}),c[h-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[h-1];break;case 39:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 40:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 41:c[h-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.CRITICAL_START}),c[h-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[h-1];break;case 42:c[h-1].unshift({type:"breakStart",breakText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_START}),c[h-1].push({type:"breakEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[h-1];break;case 44:this.$=c[h-3].concat([{type:"option",optionText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[h]]);break;case 46:this.$=c[h-3].concat([{type:"and",parText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.PAR_AND},c[h]]);break;case 48:this.$=c[h-3].concat([{type:"else",altText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.ALT_ELSE},c[h]]);break;case 49:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 50:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 51:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 52:case 57:c[h-1].draw="actor",c[h-1].type="addParticipant",this.$=c[h-1];break;case 53:c[h-1].type="destroyParticipant",this.$=c[h-1];break;case 54:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 55:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 56:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 58:this.$=[c[h-1],{type:"addNote",placement:c[h-2],actor:c[h-1].actor,text:c[h]}];break;case 59:c[h-2]=[].concat(c[h-1],c[h-1]).slice(0,2),c[h-2][0]=c[h-2][0].actor,c[h-2][1]=c[h-2][1].actor,this.$=[c[h-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[h-2].slice(0,2),text:c[h]}];break;case 60:this.$=[c[h-1],{type:"addLinks",actor:c[h-1].actor,text:c[h]}];break;case 61:this.$=[c[h-1],{type:"addALink",actor:c[h-1].actor,text:c[h]}];break;case 62:this.$=[c[h-1],{type:"addProperties",actor:c[h-1].actor,text:c[h]}];break;case 63:this.$=[c[h-1],{type:"addDetails",actor:c[h-1].actor,text:c[h]}];break;case 66:this.$=[c[h-2],c[h]];break;case 67:this.$=c[h];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor}];break;case 71:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-4].actor}];break;case 72:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor}];break;case 73:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-4].actor}];break;case 74:this.$=[c[h-5],c[h-1],{type:"addMessage",from:c[h-5].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-5].actor}];break;case 75:this.$=[c[h-3],c[h-1],{type:"addMessage",from:c[h-3].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h]}];break;case 76:this.$={type:"addParticipant",actor:c[h-1],config:c[h]};break;case 77:this.$=c[h-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[h]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[h].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},e(C,[2,5]),{9:48,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:U,53:G,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:Y},{23:56,73:Y},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:At},{23:75,55:76,73:At},{23:77,73:Y},{69:78,72:[1,79],78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:Y},{23:111,73:Y},{23:112,73:Y},{23:113,73:Y},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],be),e(C,[2,6]),e(C,[2,16]),e(St,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(Dt,i,{7:120}),e(Dt,i,{7:121}),e(Dt,i,{7:122}),e(me,i,{41:123,7:124}),e(Ut,i,{43:125,7:126}),e(Ut,i,{7:126,43:127}),e(Ae,i,{46:128,7:129}),e(Dt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Gt,be,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:Y},{69:146,78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},e(F,[2,79]),e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),{23:147,73:Y},{23:149,60:148,73:Y},{73:[2,68]},{73:[2,69]},{58:150,104:ot},{58:152,104:ot},{58:153,104:ot},{58:154,104:ot},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:G,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,161],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,162],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,163],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,47],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,50:[1,165],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,45],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,49:[1,167],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,43],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,48:[1,170],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,171],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Gt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:Y},{23:178,73:Y},{23:179,73:Y},{58:180,104:ot},{23:181,72:[1,182],73:Y},{58:183,104:ot},{58:184,104:ot},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(St,[2,11]),{13:186,51:U,53:G,54:X},e(St,[2,13]),e(St,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ot},{58:196,104:ot},{58:197,104:ot},{5:[2,75]},{58:198,104:ot},{23:199,73:Y},{5:[2,58]},{5:[2,59]},{23:200,73:Y},e(St,[2,12]),e(me,i,{7:124,41:201}),e(Ut,i,{7:126,43:202}),e(Ae,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Gt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ot},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(S,v){if(v.recoverable)this.trace(S);else{var P=new Error(S);throw P.hash=v,P}},"parseError"),parse:x(function(S){var v=this,P=[0],y=[],z=[null],c=[],wt=this.table,h="",Ct=0,Se=0,Ze=2,we=1,Qe=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Jt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Jt)&&(gt.yy[Jt]=this.yy[Jt]);J.setInput(S,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Zt=J.yylloc;c.push(Zt);var $e=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(it){P.length=P.length-2*it,z.length=z.length-it,c.length=c.length-it}x(je,"popStack");function Ne(){var it;return it=y.pop()||J.lex()||we,typeof it!="number"&&(it instanceof Array&&(y=it,it=y.pop()),it=v.symbols_[it]||it),it}x(Ne,"lex");for(var rt,xt,ct,Qt,Lt={},Mt,Tt,Pe,Bt;;){if(xt=P[P.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((rt===null||typeof rt>"u")&&(rt=Ne()),ct=wt[xt]&&wt[xt][rt]),typeof ct>"u"||!ct.length||!ct[0]){var $t="";Bt=[];for(Mt in wt[xt])this.terminals_[Mt]&&Mt>Ze&&Bt.push("'"+this.terminals_[Mt]+"'");J.showPosition?$t="Parse error on line "+(Ct+1)+`: `+J.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":$t="Parse error on line "+(Ct+1)+": Unexpected "+(rt==we?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError($t,{text:J.match,token:this.terminals_[rt]||rt,line:J.yylineno,loc:Zt,expected:Bt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+rt);switch(ct[0]){case 1:P.push(rt),z.push(J.yytext),c.push(J.yylloc),P.push(ct[1]),rt=null,Se=J.yyleng,h=J.yytext,Ct=J.yylineno,Zt=J.yylloc;break;case 2:if(Tt=this.productions_[ct[1]][1],Lt.$=z[z.length-Tt],Lt._$={first_line:c[c.length-(Tt||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Tt||1)].first_column,last_column:c[c.length-1].last_column},$e&&(Lt._$.range=[c[c.length-(Tt||1)].range[0],c[c.length-1].range[1]]),Qt=this.performAction.apply(Lt,[h,Se,Ct,gt.yy,ct[1],z,c].concat(Qe)),typeof Qt<"u")return Qt;Tt&&(P=P.slice(0,-1*Tt*2),z=z.slice(0,-1*Tt),c=c.slice(0,-1*Tt)),P.push(this.productions_[ct[1]][0]),z.push(Lt.$),c.push(Lt._$),Pe=wt[P[P.length-2]][P[P.length-1]],P.push(Pe);break;case 3:return!0}}return!0},"parse")},Je=(function(){var ut={EOF:1,parseError:x(function(v,P){if(this.yy.parser)this.yy.parser.parseError(v,P);else throw new Error(v)},"parseError"),setInput:x(function(S,v){return this.yy=v||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var v=S.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:x(function(S){var v=S.length,P=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),P.length-1&&(this.yylineno-=P.length-1);var z=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:P?(P.length===y.length?this.yylloc.first_column:0)+y[y.length-P.length].length-P[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),v=new Array(S.length+1).join("-");return S+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-Cl-kJspZ.js b/apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-C2SuSg-g.js similarity index 86% rename from apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-Cl-kJspZ.js rename to apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-C2SuSg-g.js index 92cb68685a0..eb833fa602c 100644 --- a/apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-Cl-kJspZ.js +++ b/apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-C2SuSg-g.js @@ -1 +1 @@ -import{_ as o}from"./mermaid.core-CGrLstUA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var p=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function c(){return!!i()?.mermaidCaptureSizes}o(c,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:p,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,c as shouldCaptureSizes}; +import{_ as o}from"./mermaid.core-XMN3hSDH.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var p=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function c(){return!!i()?.mermaidCaptureSizes}o(c,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:p,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,c as shouldCaptureSizes}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-BYfWdLSL.js b/apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-A7OvRFce.js similarity index 96% rename from apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-BYfWdLSL.js rename to apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-A7OvRFce.js index 711d9176b6e..58c182e75d1 100644 --- a/apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-BYfWdLSL.js +++ b/apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-A7OvRFce.js @@ -1 +1 @@ -import{s as R,a as W,S as N}from"./chunk-EX3LRPZG-Du5tJK2w.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,a7 as _,a8 as U,L as C,x as F}from"./mermaid.core-CGrLstUA.js";import{G as O}from"./graph-DOmOIIwC.js";import{l as J}from"./layout-D-LzfAck.js";import"./chunk-XXDRQBXY-BwEKpC0s.js";import"./chunk-VR4S4FIN-Cp8JVohH.js";import"./chunk-32BRIVSS-0ImWpiFu.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";import"./map-DxJ2ADlA.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
      ");p=p.replace(/\n/g,"
      ");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram}; +import{s as R,a as W,S as N}from"./chunk-EX3LRPZG-DyuxL3R0.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,a7 as _,a8 as U,L as C,x as F}from"./mermaid.core-XMN3hSDH.js";import{G as O}from"./graph-DOmOIIwC.js";import{l as J}from"./layout-D-LzfAck.js";import"./chunk-XXDRQBXY-BLb3KbCy.js";import"./chunk-VR4S4FIN-DXOr7Xkl.js";import"./chunk-32BRIVSS-BXcVdJ-W.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";import"./map-DxJ2ADlA.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
      ");p=p.replace(/\n/g,"
      ");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-D2Op2fy3.js b/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-D2Op2fy3.js deleted file mode 100644 index 75e01a65f86..00000000000 --- a/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-D2Op2fy3.js +++ /dev/null @@ -1 +0,0 @@ -import{s as r,b as e,a,S as s}from"./chunk-EX3LRPZG-Du5tJK2w.js";import{_ as i}from"./mermaid.core-CGrLstUA.js";import"./chunk-XXDRQBXY-BwEKpC0s.js";import"./chunk-VR4S4FIN-Cp8JVohH.js";import"./chunk-32BRIVSS-0ImWpiFu.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-DA4wVJGo.js b/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-DA4wVJGo.js new file mode 100644 index 00000000000..360699e5328 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-DA4wVJGo.js @@ -0,0 +1 @@ +import{s as r,b as e,a,S as s}from"./chunk-EX3LRPZG-DyuxL3R0.js";import{_ as i}from"./mermaid.core-XMN3hSDH.js";import"./chunk-XXDRQBXY-BLb3KbCy.js";import"./chunk-VR4S4FIN-DXOr7Xkl.js";import"./chunk-32BRIVSS-BXcVdJ-W.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-48M2vHyU.js b/apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-e4qfs0uW.js similarity index 99% rename from apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-48M2vHyU.js rename to apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-e4qfs0uW.js index 43ab4c32cbb..6161d0ed548 100644 --- a/apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-48M2vHyU.js +++ b/apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-e4qfs0uW.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-X5ZJPWSS-Cl-kJspZ.js","assets/mermaid.core-CGrLstUA.js","assets/index-CvgiEu-R.js","assets/index-BxiMZi52.css","assets/_commonjsHelpers-CqkleIqs.js"])))=>i.map(i=>d[i]); -import{bR as Er}from"./index-CvgiEu-R.js";import{c as Tr}from"./chunk-RYQCIY6F-Bg4GHN0V.js";import{am as wr,an as Ar,ao as Rr,ap as Nr,l as Ke,c as Or,ag as Pr,af as Br,ah as kr,at as _r,av as Fr,y as Dr,as as Hr,aw as Xr,x as Oe,ax as Ye,_ as d,ay as Ao}from"./mermaid.core-CGrLstUA.js";import{G as Yr}from"./graph-DOmOIIwC.js";import"./map-DxJ2ADlA.js";import"./_commonjsHelpers-CqkleIqs.js";async function _o(t,e){const n=new Yr({multigraph:!0,compound:!0}),o=[...e.edges],s=Or(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),c=r.insert("g").attr("class","edges edgePath"),a=r.insert("g").attr("class","edgeLabels"),l=r.insert("g").attr("class","nodes"),g=new Map,x=t.node()!=null;await Promise.all(e.nodes.map(async I=>{if(I.isGroup)n.setNode(I.id,{...I});else{if(x){const u=await Pr(l,I,{config:s,dir:I.dir}),p=u.node()?.getBBox()??{width:0,height:0};g.set(I.id,u),I.width=p.width,I.height=p.height}n.setNode(I.id,{...I})}}));for(const I of o)n.setEdge(I.start,I.end,{...I},I.id),e.edges.some(p=>p.id===I.id)||e.edges.push(I);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:I}=await Er(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS-Cl-kJspZ.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2,3,4]));I(t,e)}return{graph:n,groups:{clusters:i,edgePaths:c,edgeLabels:a,nodes:l,rootGroups:r},nodeElements:g}}d(_o,"createGraphWithElements");var Ro=5,Ge=1e-5,$e=1e-6;function qe(t){const e=[];for(let n=0;n=1-$e||I<=$e||I>=1-$e?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:I}}d(Fo,"segmentIntersection");function vn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(vn,"isHorizontalSeg");function Do(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Ho,"getArcSweepFlag");var Gr=.001;function Xo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Ao[e.arrowTypeStart];if(o){const r=t[0],i=t[1],c=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(c),n[0].y=r.y+o*Math.sin(c)}const s=e.arrowTypeEnd&&Ao[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],c=t[r-1],a=Math.atan2(c.y-i.y,c.x-i.x);n[r-1].x=c.x-s*Math.cos(a),n[r-1].y=c.y-s*Math.sin(a)}return n}d(Xo,"applyMarkerOffsets");function Yo(t,e,n,o,s){const r=t.point.x,i=t.point.y,c={x:r-e*t.r,y:i-n*t.r},a={x:r+e*t.r,y:i+n*t.r},l=[`L${we(c)}`];return s==="arc"?l.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${we(a)}`):l.push(`M${we(a)}`),l}d(Yo,"emitJump");function Ln(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,c=n.y-e.y,a=Math.hypot(s,r),l=Math.hypot(i,c);if(a0){const E=Ln(s[l-1],s[l],s[l+1]??s[l],Ro);E&&(f=E.cutLen)}let y=x,v=null;r&&lE.t-T.t);for(const E of M)E.r=Math.min(E.r,E.d-f,y-E.d);for(let E=0;ET){const m=T/2;M[E].r=Math.min(M[E].r,m),M[E+1].r=Math.min(M[E+1].r,m)}}for(const E of M)E.r=2?o:null}catch{return null}}d(Vo,"decodeDataPoints");function jo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const l of e)s.set(l.id,l);const r=[],i=new Map;for(const l of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(l.id):l.id,x=o.querySelector(`path[data-id="${g}"]`);if(!x)continue;i.set(l.id,x);const u=Vo(x.getAttribute("data-points"))??l.points;r.push({...l,points:u})}const c=Do(r);if(c.length===0)return;const a=new Map;for(const l of c){const g=a.get(l.jumpEdgeId)??[];g.push(l),a.set(l.jumpEdgeId,g)}for(const l of r){const g=a.get(l.id);if(!g||g.length===0)continue;const I=s.get(l.id)?.curve;if(I!==void 0&&!zo(I))continue;const u=i.get(l.id);if(!u)continue;if(I===void 0){const E=u.getAttribute("d")??"";if(!$o(E))continue}const p=u.getAttribute("style")??"",f=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(p),y=f?Number.parseFloat(f[1]):null,v=f?Number.parseFloat(f[2]):null,M=Go(l,g,n);if(u.setAttribute("d",M),y!==null&&v!==null&&typeof u.getTotalLength=="function"){const E=u.getTotalLength(),T=Math.max(0,E-y-v),m=`0 ${y} ${T} ${v}`,S=p.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${m};`).replace(/;\s*;+/g,";");u.setAttribute("style",S)}}}d(jo,"applyLineJumpsToSvg");async function Uo(t,e){for(const s of t.nodes)s.isGroup?await Br(e.clusters,s):kr(s);const n=new Map;for(const s of t.nodes)s?.id&&n.set(s.id,s);for(const s of t.edges){const r=s.start?n.get(s.start)??{}:{},i=s.end?n.get(s.end)??{}:{},c=_r(e.edgePaths,{...s},{},t.type,r,i,t.diagramId);s.label&&await Fr(e.rootGroups,s),s.label&&Wo(s,c)}const o=t.config?.swimlane?.lineHops;if(o!==!1){const s=o==="gap"?"gap":"arc",r=t.edges.filter(i=>Array.isArray(i.points)&&i.points.length>=2).map(i=>({id:i.id,points:i.points,curve:i.curve,arrowTypeStart:i.arrowTypeStart,arrowTypeEnd:i.arrowTypeEnd}));jo(e.edgePaths,r,{enabled:!0,jumpRadius:6,jumpStyle:s})}}d(Uo,"adjustLayout");function Wo(t,e){const n=e?.updatedPath??e?.originalPath,o=Dr(),{subGraphTitleTotalMargin:s}=Hr({flowchart:o.flowchart??{}});if(t.label){const r=Xr.get(t.id);let i=t.x,c=t.y;if(n){const a=Oe.calcLabelPosition(n);Ke.debug("Moving label "+t.label+" from (",i,",",c,") to (",a.x,",",a.y,") abc88"),e&&(i=a.x,c=a.y)}r.attr("transform",`translate(${i}, ${c+s/2})`)}if(t?.startLabelLeft){const r=Ye.get(t.id).startLeft;let i=t?.x,c=t?.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.startLabelRight){const r=Ye.get(t.id).startRight;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.endLabelLeft){const r=Ye.get(t.id).endLeft;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.endLabelRight){const r=Ye.get(t.id).endRight;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}}d(Wo,"positionEdgeLabel");var Mn="__swimlane_default__",$r=21,No=20;function En(t){return Math.max(t.padding??No,No)}d(En,"topLaneHorizontalPadding");function Ko(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const i=n-s/2,c=Math.min(r,n+s/2),a=Math.min($r,Math.max(0,c-i)),l=i+a;if(l<=i){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:l}}d(Ko,"assignTopLaneTitleRect");function qo(t){const e=t.direction,n=t.nodes??=[];for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===Mn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:Mn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=Mn}d(qo,"prepareLayoutForSwimlanes");function Jo(t){const e=new Map;for(const a of t.nodes??[])e.set(a.id,a);const n=[];for(const a of t.edges??[]){const l=typeof a.start=="string"?a.start:void 0,g=typeof a.end=="string"?a.end:void 0;!l||!g||a.labelNodeId||n.push({id:a.id,src:l,dst:g,ref:a})}const o=t.nodes??[],s=o.filter(a=>a.isGroup),r=o.filter(a=>!a.isGroup);return{nodes:[...[...s].reverse(),...r].map(a=>a.id),edges:n,layout:t,nodeById:e}}d(Jo,"toGraphView");function Zo(t,e,n,o){const{layout:s}=t,r=t.nodeById,i=o?.layerGap??100,c=o?.nodeGap??40;let a=0;for(const I of e.layers){let u=0;for(const p of I){const f=r.get(p);if(!f){u++;continue}f.layer=a,f.order=u;const y=n.x[p]??u*c,v=n.y[p]??a*i;f.x=y,f.y=v,u++}a++}const l=s.nodes??[],g=new Map,x=[];for(const I of l){if(!I?.isGroup)continue;I.parentId||x.push(I);const u=l.filter(M=>M.parentId===I.id);let p=1/0,f=-1/0,y=1/0,v=-1/0;for(const M of u){const E=M.x??n.x[M.id],T=M.y??n.y[M.id],m=M.width??0,S=M.height??0;E!=null&&T!=null&&(p=Math.min(p,E-m/2),f=Math.max(f,E+m/2),y=Math.min(y,T-S/2),v=Math.max(v,T+S/2))}if(p===1/0||y===1/0)I.x=I.x??0,I.y=I.y??0,I.width=I.width??0,I.height=I.height??0;else{const M=I.padding??20,E=I.parentId?M:2*En(I),T=M,m=Math.max(0,f-p)+E,S=Math.max(0,v-y)+T,A=(p+f)/2,R=(y+v)/2;I.x=A,I.y=R,I.width=m,I.height=S,g.set(I.id,{minX:p,maxX:f,minY:y,maxY:v})}}if(x.length>0&&g.size>0){let I=1/0,u=-1/0,p=0;for(const f of x){const y=f.padding??20;y>p&&(p=y);const v=g.get(f.id);v&&(I=Math.min(I,v.minY),u=Math.max(u,v.maxY))}if(I!==1/0&&u!==-1/0){const f=Math.max(0,u-I),v=Math.max(p,36),M=f+2*v,E=(I+u)/2;for(const k of x)k.y=E,k.height=M,k.swimlaneContentTop=I;const T=[...x].sort((k,O)=>{const _=k.x??0,H=O.x??0;return _-H}),m=[],S=[],A=[];for(const k of T){const O=g.get(k.id);if(!O)continue;const _=Math.max(0,O.maxX-O.minX)+2*En(k),H=(O.minX+O.maxX)/2;m.push(k.id),S.push(H),A.push(_)}const R=m.length;if(R>0){const k=new Map;if(R===1)k.set(m[0],A[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:Ae(e,n,o,s)}:void 0}d(oo,"measuredNodeRect");function so(t){if(t.isGroup)return;const e=oo(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(so,"nodeBoundsInfoFor");function oe(t,e,n=Ft){return Math.abs(t.x-e.x)n}d(Tt,"isHorizontalSegment");function wt(t,e,n=Ft){return ft(t,e,n)&&Math.abs(t.y-e.y)>n}d(wt,"isVerticalSegment");function zt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(zt,"overlapLength");function ce(t,e,n=Ft){return t.horizontal&&e.horizontal&&ht(t.a,e.a,n)?zt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&ft(t.a,e.a,n)?zt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(ce,"sameAxisSegmentOverlapLength");function Re(t,e=Ft){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!oe(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(pt,"dedupeConsecutivePoints");function ro(t,e=Ft){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Tt(n,o,e)&&wt(o,s,e)&&Tt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:wt(n,o,e)&&Tt(o,s,e)&&wt(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(ro,"classifyThreeSegmentRoute");function cn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),c=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ie.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ts,"rectContainsRect");function Je(t,e){return t.lefte.left&&t.tope.top}d(Je,"rectsOverlap");function Tn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Tn,"inflateRect");function Ae(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Ae,"rectFromCenterSize");function qt(t){return oo(t)?.rect}d(qt,"rectOfNodeBounds");function Ie(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Ie,"portForRectSide");function co(t,e,n,o,s,r=Ft){const i=e==="left"||e==="right",c=o==="left"||o==="right";if(i&&c){if(e==="right"&&o==="left"&&t.xn.x){if(ht(t,n,r))return[t,n];const x=(t.x+n.x)/2;return[t,{x,y:t.y},{x,y:n.y},n]}if(e===o){if(ht(t,n,r))return;const x=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x,y:t.y},{x,y:n.y},n]}return}if(!i&&!c){if(e===o){if(ft(t,n,r))return;const I=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:I},{x:n.x,y:I},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(ft(t,n,r))return[t,n];const x=(t.y+n.y)/2;return[t,{x:t.x,y:x},{x:n.x,y:x},n]}if(i&&!c){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&x?[t,{x:n.x,y:t.y},n]:void 0}const a=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return a&&l?[t,{x:t.x,y:n.y},n]:void 0}d(co,"buildOrthogonalPortPath");function ao(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(ao,"buildSameSideTrackPath");function an(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=so(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(an,"collectRealNodeBounds");function me(t){const e=[],n=[];for(const o of t){const s=so(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(me,"collectNodeRectEntries");function es(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,i=o.width??0,c=o.height??0;n.push({nodeId:o.id,...Ae(s,r,i,c)})}return n}d(es,"collectLayoutNodeRects");function lo(t,e,n=Ft){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),i=e.get(s);if(!(!r||!i))return{srcId:o,dstId:s,srcInfo:r,dstInfo:i,collinearX:Math.abs(r.cx-i.cx)p||Iv)return!1;const M=Math.abs(f-g.a.x)s:r&&c&&ht(t,n,s)?zt(t.x,e.x,n.x,o.x)>s:!1}d(ns,"sameAxisSegmentsOverlap");function Ze(t,e,n,o,{epsilon:s=Ft,skipDegenerateOther:r=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const c=i.points;if(!(!c||c.length<2))for(let a=0;aI+s&&pf+s&&xo+Ft&&t=2?e[e.length-2]:void 0,a=(i?ft(i,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(a)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!oe(s,o))&&n.push(o)}return n}d(Qe,"orthogonalizePolyline");function ae(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=ss(e);if(e=o.points,!o.changed)break}return e}d(ae,"simplifyPolyline");var nt=.001,Vr=.5,Oo=4;function uo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const i=rs(t[s],t[r],e);return n?[i,...t.slice(s)]:[...t.slice(0,s+1),i]}d(An,"clipEndpoint");function is(t,e){for(const n of t){const o=uo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=An(s,o.srcRect,!0)),o.dstRect&&(s=An(s,o.dstRect,!1)),s=ae(Qe(s)),s=ho(s,o.srcRect,o.dstRect),o.edge.points=ae(Qe(s))}}d(is,"clipEdgeEndpointsToNodeBoundaries");function Rn(t,e,n,o=!1){if(ht(t,e,nt)){if(e.yn.bottom+nt)return e;if(o){if(t.xn.right+nt)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(ft(t,e,nt)){if(e.xn.right+nt)return e;if(o){if(t.yn.bottom+nt)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(Rn,"snapEndpointToBoundary");function tn(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(cs,"intersectRanges");function On(t,e){return e==="left"||e==="right"?en(t.top,t.bottom):en(t.left,t.right)}d(On,"clearanceRangeForSide");function nn(t,e,n){const o=t.y>=n.top-nt&&t.y<=n.bottom+nt,s=t.x>=n.left-nt&&t.x<=n.right+nt;if(ht(t,e,nt)&&o){if(Math.abs(t.x-n.left)0?cs(r):void 0}d(as,"straightClearanceRange");function Pn(t,e,n,o,s){const r=as(t,e,n,o,s);if(!r)return;const i=s?t.y:t.x,c=Math.min(r.hi,Math.max(r.lo,i));if(!(Math.abs(c-i)({...c}));for(let c=e;c>=0&&c=n.left-nt&&Math.max(t.x,e.x)<=n.right+nt,s=Math.min(t.y,e.y)>=n.top-nt&&Math.max(t.y,e.y)<=n.bottom+nt;if(Math.abs(t.y-n.top)o.bottom+nt;case"left":return ht(e,n,nt)&&n.xo.right+nt}}d(_n,"leavesOutward");function Fn(t,e,n){if(t.length<3)return t;if(n){const r=kn(t[0],t[1],e);return r&&_n(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=kn(t[o-1],t[o],e);return s&&_n(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Fn,"collapseOwnBorderStub");function ds(t,e,n){let o=t;if(e){const r=tn(o,0,1);if(r){const i=Rn(r,o[0],e);i!==o[0]&&(o=[i,...o.slice(1)])}o=Fn(o,e,!0)}if(n){const r=o.length-1,i=tn(o,r,-1);if(i){const c=Rn(i,o[r],n,!0);c!==o[r]&&(o=[...o.slice(0,r),c])}o=Fn(o,n,!1)}const s=ho(o,e,n);return s!==o||o.length===2?s:(e&&(o=Bn(o,e,!0)),n&&(o=Bn(o,n,!1)),o)}d(ds,"snapAndCollapseEndpoints");function Dn(t,e){for(const n of t){const o=uo(n,e,2);if(!o)continue;const s=pt(o.points,nt),r=ds(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=i}}d(Dn,"prepareEdgeEndpointsForRenderer");function go(t){return new Map(t.map(e=>[e.id,e]))}d(go,"buildNodeMap");function us(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!s?.isGroup)break;o=s.id,n=s.parentId}return o}d(us,"resolveTopLevelGroupId");function Hn(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!s?.isGroup)break;n++,o=s.parentId}return n}d(Hn,"groupDepth");function po(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const i=r.x,c=r.y;if(typeof i!="number"||typeof c!="number")continue;const a=r.width??0,l=r.height??0;e=Math.min(e,i-a/2),n=Math.max(n,i+a/2),o=Math.min(o,c-l/2),s=Math.max(s,c+l/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(po,"boundsForChildren");function hs(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(hs,"applyGroupBounds");function gs(t){const e=go(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>Hn(s,e)-Hn(o,e));for(const o of n){const s=t.filter(i=>i.parentId===o.id),r=po(s);r&&hs(o,r)}}d(gs,"recomputeNestedGroupBounds");function on(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);let r=1/0,i=-1/0;for(const a of s){const l=a[e];typeof l=="number"&&(r=Math.min(r,l),i=Math.max(i,l))}if(!Number.isFinite(r)||!Number.isFinite(i))return!1;const c=d(a=>r+i-a,"mirror");for(const a of n){const l=a[e];typeof l=="number"&&(a[e]=c(l));const g=a.groupTitleRect;g&&(a.groupTitleRect=e==="x"?{...g,left:c(g.right),right:c(g.left)}:{...g,top:c(g.bottom),bottom:c(g.top)})}for(const a of o)for(const l of a.points??[])l[e]=c(l[e]);return!0}d(on,"mirrorAxis");function ps(t){return(t.nodes??[]).some(n=>!n.isGroup)?on(t,"y"):!0}d(ps,"applyBtDirectionTransform");function ms(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,i=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/x):1;for(const P of s){const G=P.x??0,J=((P.y??0)-i)*I+c,dt=G-r;P.x=J,P.y=dt}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,dt=(G.y-i)*I+c,mt=j-r;G.x=dt,G.y=mt}gs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&on(t,"x"),!0;const p=go(n),f=new Map;for(const P of n){if(P.isGroup)continue;const G=us(P,p);if(!G)continue;const j=f.get(G)??[];j.push(P),f.set(G,j)}let y=0;for(const P of u){const G=P.padding??0;G>y&&(y=G)}const v=[];let M=1/0,E=-1/0;for(const P of u){const G=f.get(P.id)??[],j=po(G);j&&(M=Math.min(M,j.minX),E=Math.max(E,j.maxX),v.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(M===1/0||E===-1/0)return!0;const T=Math.max(0,E-M),m=Math.max(y,10),S=T+2*m,A=c+S,O=(M+E)/2-S/2-c,_=O+A/2,H=Math.max(y,c);v.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PI.cy?v.bottom:v.top,H=I.cx+M;if(H<=v.left+se||H>=v.right-se)continue;E={x:H,y:_},T={x:H,y:c.y},m={x:c.x,y:c.y}}else{const _=u.cx>I.cx?v.right:v.left,H=I.cy+M;if(H<=v.top+se||H>=v.bottom-se)continue;E={x:_,y:H},T={x:c.x,y:H},m={x:c.x,y:c.y}}const S=oe(E,T,se),A=oe(T,m,se);if(S&&A||!S&&At(E,T,o,[g],1)||!A&&At(T,m,o,[x],1))continue;const R=!S&&Ze(E,T,t,s,{epsilon:se,skipDegenerateOther:!0}),k=!A&&Ze(T,m,t,s,{epsilon:se,skipDegenerateOther:!0});if(!(R||k)){S?y=[T,m]:A?y=[E,T]:y=[E,T,m];break}}y&&(s.points=y)}}d(ys,"portSwapToLShape");function xs(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values());for(const c of t){if(c.isLayoutOnly)continue;const a=c.points;if(!a||a.length<4)continue;const l=pt(a,.001);if(l.length<4)continue;const g=l.length-1,x=l[g],I=l[g-1],u=l[g-2],p=x.x-I.x,f=x.y-I.y,y=Math.hypot(p,f);if(y>=10||y<.001)continue;const v=I.x-u.x,M=I.y-u.y;if(Math.hypot(v,M)<.001)continue;const T=Tt(I,x,.001),m=wt(I,x,.001),S=Tt(u,I,.001),A=wt(u,I,.001);if(!(T&&A||m&&S))continue;const R=c.end,k=c.start,O=R?e.get(R):void 0;if(!O)continue;const _=O.x??0,H=O.y??0,P=qt(O);if(!P)continue;let G,j;if(A){const W=M<0;G={x:_,y:u.y},j={x:_,y:W?P.bottom:P.top}}else{const W=v>0;G={x:u.x,y:H},j={x:W?P.right:P.left,y:H}}if(At(G,j,r,R?[R]:[],-2)||At(G,j,i,[],-2))continue;if(k){const W=e.get(k),et=W?qt(W):void 0;if(et&&io(G,et,2))continue}const J=d((W,et)=>`${W.x.toFixed(3)},${W.y.toFixed(3)}|${et.x.toFixed(3)},${et.y.toFixed(3)}`,"ownSegmentKey"),dt=new Set;for(let W=0;W{for(const at of t){if(at===c||at.isLayoutOnly)continue;const gt=at.points;if(!(!gt||gt.length<2))for(let xt=0;xt=0){const W=l[g-3],et=[k,R].filter(at=>!!at);if(At(W,G,r,et,-2)||mt(W,G))continue}const Pt=[...l.slice(0,g-2),G,j];c.points=Pt;const Q=c.labelNodeId;if(Q){const W=e.get(Q);if(W){const et=W.width??0,at=W.height??0;if(et>0&&at>0){let gt,xt,vt=-1;for(let Vt=0;Vt=et+2||de&&te>=at+2)&&te>vt&&(vt=te,gt=(jt.x+Ut.x)/2,xt=(jt.y+Ut.y)/2)}gt!==void 0&&xt!==void 0&&(W.x=gt,W.y=xt)}}}}}d(xs,"collapseShortTerminalStub");var Z=.001,_t=8,it=Re,In=d((t,e)=>ft(t,e,Z)||ht(t,e,Z),"orthogonallyAligned");function bs(t,e){const s=d((u,p)=>{const f=u.x??0,y=u.y??0,v=p.x-f,M=p.y-y;let E=(u.width??0)/2,T=(u.height??0)/2;return Math.abs(M)*E>Math.abs(v)*T?(M<0&&(T=-T),{x:f+(M===0?0:T*v/M),y:y+T}):(v<0&&(E=-E),{x:f+E,y:y+(v===0?0:E*M/v)})},"rectIntersect"),r=d((u,p)=>{const f=pt(u.points??[]);if(f.length<2)return;const y=p?u.start:u.end,v=y?e.get(y):void 0,M=v?qt(v):void 0;if(!v||!y||!M)return;const E=p?f[0]:f[f.length-1],T=p?f[1]:f[f.length-2],m=s(v,E);let S=E;if(In(T,m)&&(S=T),ft(m,S,Z))return{edge:u,edgeId:String(u.id??""),nodeId:y,atStart:p,orientation:"V",coord:m.x,min:Math.min(m.y,S.y),max:Math.max(m.y,S.y),boundary:m,railEnd:S,rect:M};if(ht(m,S,Z))return{edge:u,edgeId:String(u.id??""),nodeId:y,atStart:p,orientation:"H",coord:m.y,min:Math.min(m.x,S.x),max:Math.max(m.x,S.x),boundary:m,railEnd:S,rect:M}},"terminalLaneFor"),i=d((u,p)=>Math.max(0,Math.min(u.max,p.max)-Math.max(u.min,p.min)),"projectedOverlapLength"),c=d((u,p)=>u.nodeId!==p.nodeId||u.orientation!==p.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&&ft(u.boundary,p.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&ht(u.boundary,p.boundary,1),"sameTerminalFace"),a=d((u,p)=>u.nodeId!==p.nodeId||u.orientation!==p.orientation?!1:i(u,p)>=_t&&Math.abs(u.coord-p.coord)<.5,"exactTerminalLaneConflict"),l=d((u,p)=>{if(u.nodeId!==p.nodeId||u.orientation!==p.orientation||u.orientation!=="H"||u.atStart===p.atStart)return!1;const f=i(u,p);if(f<_t)return!1;const y=u.rect.bottom-u.rect.top;return f2*y?!1:c(u,p)&&Math.abs(u.coord-p.coord)<16},"nearTerminalLaneConflict"),g=d((u,p)=>{const f=pt(u.edge.points??[]);if(f.length<2)return;const y=u.orientation==="V"?{x:u.boundary.x+p,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+p},v=u.orientation==="V"?{x:u.railEnd.x+p,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+p};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?ht(y,u.boundary,Z)&&y.x>=u.rect.left+1&&y.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?ft(y,u.boundary,Z)&&y.y>=u.rect.top+1&&y.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const S=f.length>1&&oe(f[1],u.railEnd,Z),A=f.slice(S?2:1),R=A[0];return R&&!In(R,v)?void 0:[y,v,...A]}const E=f.length>1&&oe(f[f.length-2],u.railEnd,Z),T=f.slice(0,E?-2:-1),m=T[T.length-1];if(!(m&&!In(m,v)))return[...T,v,y]},"shiftedCandidate"),x=d(u=>{const p=u.edge,f=pt(p.points??[]);if(f.length!==2)return!1;const y=p.start,v=p.end,M=y?e.get(y):void 0,E=v?e.get(v):void 0;if(!M||!E)return!1;const T=M.x??0,m=M.y??0,S=E.x??0,A=E.y??0,[R,k]=f;return ht(R,k,Z)&&Math.abs(m-A)<1&&Math.abs(T-S)>1||ft(R,k,Z)&&Math.abs(T-S)<1&&Math.abs(m-A)>1},"laneIsStraightCollinearConnector"),I=[-7,7,-14,14,-21,21];for(let u=0;u<8;u++){const p=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[r(y,!0),r(y,!1)]).filter(y=>!!y);let f=!1;for(let y=0;y{const R=x(S),k=x(A);return R!==k?Number(R)-Number(k):+!A.atStart-+!S.atStart});for(const S of m){for(const A of I){const R=g(S,A);if(!R)continue;const k=r({...S.edge,points:R},S.atStart);if(!(!k||p.some(O=>O.edge!==S.edge&&(a(k,O)||T&&l(k,O))))){S.edge.points=R,f=!0;break}}if(f)break}}if(!f)return}}d(bs,"separateSharedRenderedTerminalLanes");function Ms(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=d((c,a)=>{const l=c.start,g=c.end,x=it(a);if(x.length!==a.length-1)return!1;const I=[l,g].filter(u=>!!u);for(const u of x)if(At(u.a,u.b,o,I,-2)||At(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===c||u.isLayoutOnly)continue;const p=u.points;if(!(!p||p.length<2)){for(const f of x)for(const y of it(pt(p)))if(ce(f,y,.5)>=_t||le(f.a,f.b,y.a,y.b,Z))return!1}}return!0},"candidateIsSafe"),i=d((c,a)=>{if(a+4>=c.length)return;const l=c[a],g=c[a+1],x=c[a+2],I=c[a+3],u=c[a+4],p=Tt(l,g)&&wt(g,x)&&Tt(x,I)&&wt(I,u)&&ft(l,I,Z)&&ft(l,u,Z)&&ft(g,x,Z)&&(g.x-l.x)*(I.x-x.x)<0,f=wt(l,g)&&Tt(g,x)&&wt(x,I)&&Tt(I,u)&&ht(l,I,Z)&&ht(l,u,Z)&&ht(g,x,Z)&&(g.y-l.y)*(I.y-x.y)<0;if(p||f)return pt([...c.slice(0,a+1),u,...c.slice(a+5)]);if(a+5>=c.length)return;const y=c[a+5],v=wt(l,g)&&Tt(g,x)&&wt(x,I)&&Tt(I,u)&&wt(u,y)&&ft(l,u,Z)&&ft(l,y,Z)&&ft(x,I,Z)&&(x.x-g.x)*(u.x-I.x)<0,M=Tt(l,g)&&wt(g,x)&&Tt(x,I)&&wt(I,u)&&Tt(u,y)&&ht(l,u,Z)&&ht(l,y,Z)&&ht(x,I,Z)&&(x.y-g.y)*(u.y-I.y)<0;if(!(!v&&!M))return pt([...c.slice(0,a+1),y,...c.slice(a+6)])},"withoutDogleg");for(let c=0;c<8;c++){let a=!1;for(const l of t){if(l.isLayoutOnly)continue;const g=pt(l.points??[]);for(let x=0;x<=g.length-5;x++){const I=i(g,x);if(!(!I||!r(l,I))){l.points=I,a=!0;break}}if(a)break}if(!a)return}}d(Ms,"collapseRedundantRectangularDoglegs");function Xn(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values()),c=t.filter(p=>!p.isLayoutOnly),a=d((p,f,y)=>pt(p===f?y??[]:p.points??[]),"pointsFor"),l=d((p,f)=>{let y=0;for(let v=0;v{const f=it(p);if(f.length!==3)return;const y=f[1];if(!(f[0].horizontal===y.horizontal||f[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),x=d((p,f)=>{const y=[p.start,p.end].filter(v=>!!v);return r.filter(v=>{if(y.includes(v.id))return!1;const M=v.rect;return f.horizontal?zt(f.a.x,f.b.x,M.left,M.right)>=_t&&f.a.y>=M.top-2&&f.a.y<=M.bottom+2:zt(f.a.y,f.b.y,M.top,M.bottom)>=_t&&f.a.x>=M.left-2&&f.a.x<=M.right+2})},"blockingRectsFor"),I=d((p,f,y)=>{const v=p.map(E=>({...E}));if(f.horizontal)v[f.index].y=y,v[f.index+1].y=y;else if(f.vertical)v[f.index].x=y,v[f.index+1].x=y;else return;const M=ae(pt(v));return it(M).length===M.length-1?M:void 0},"candidateByMovingRail"),u=d((p,f,y)=>{const v=[p.start,p.end].filter(E=>!!E),M=it(f);if(M.length!==f.length-1)return!1;for(const E of M)if(At(E.a,E.b,r,v,-2)||At(E.a,E.b,i,[],-2))return!1;for(const E of c)if(E!==p){for(const T of M)for(const m of it(a(E)))if(ce(T,m,.5)>=_t)return!1}return l(p,f)<=y},"candidateIsSafe");for(let p=0;p<8;p++){const f=l();let y=!1;for(const v of c){const M=a(v),E=g(M);if(!E)continue;const T=x(v,E.segment);if(T.length===0)continue;const m=E.horizontal?[Math.min(...T.map(S=>S.rect.top))-20,Math.max(...T.map(S=>S.rect.bottom))+20]:[Math.min(...T.map(S=>S.rect.left))-20,Math.max(...T.map(S=>S.rect.right))+20];for(const S of m){const A=I(M,E.segment,S);if(!(!A||!u(v,A,f))){v.points=A,y=!0;break}}if(y)break}if(!y)return}}d(Xn,"liftObstacleHuggingSameSideRails");function Yn(t,e){const o=d(a=>{const l=a.groupTitleRect;if(!(!l||typeof l.left!="number"||typeof l.right!="number"||typeof l.top!="number"||typeof l.bottom!="number"||!Number.isFinite(l.left)||!Number.isFinite(l.right)||!Number.isFinite(l.top)||!Number.isFinite(l.bottom)||l.right<=l.left||l.bottom<=l.top))return{left:l.left,right:l.right,top:l.top,bottom:l.bottom}},"validTitleRect"),s=d(a=>{if(!a.isGroup||a.parentId)return;const l=a.direction,g=typeof l=="string"?l.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const x=o(a),I=a.y,u=a.height;if(!x||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const p=x.right-x.left,f=x.bottom-x.top;if(!(f<=0||p{if(!a.horizontal)return!1;const g=a.a.y;return g<=l.top+Z||g>=l.bottom-Z?!1:zt(a.a.x,a.b.x,l.left,l.right)>=_t},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(s).filter(a=>!!a);if(i.length===0)return;let c=0;for(const a of t){if(a.isLayoutOnly)continue;const l=pt(a.points??[]);for(const g of it(l))for(const x of i)r(g,x.rect)&&(c=Math.max(c,x.rect.bottom-g.a.y+4))}if(!(c<=Z))for(const a of i){const l=a.node.y,g=a.node.height;typeof l!="number"||typeof g!="number"||!Number.isFinite(l)||!Number.isFinite(g)||g<=0||(a.node.y=l-c/2,a.node.height=g+c,a.node.groupTitleRect={...a.rect,top:a.rect.top-c,bottom:a.rect.bottom-c})}}d(Yn,"liftTopLaneTitleBandsAboveRails");function Gn(t,e){const o=d(l=>{const g=l.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(l=>{if(!l.isGroup||l.parentId||l.direction!=="LR")return;const x=o(l),I=l.x,u=l.width;if(!x||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const p=x.right-x.left,f=x.bottom-x.top;if(!(p<=0||f{if(!l.vertical)return!1;const x=l.a.x;return x<=g.left+Z||x>=g.right-Z?!1:zt(l.a.y,l.b.y,g.top,g.bottom)>=_t},"verticalSegmentIntersectsTitle"),i=d((l,g)=>{if(!l.horizontal)return!1;const x=l.a.y;return x<=g.top+Z||x>=g.bottom-Z?!1:zt(l.a.x,l.b.x,g.left,g.right)>=_t},"horizontalSegmentIntersectsTitle"),c=[...e.values()].map(s).filter(l=>!!l);if(c.length===0)return;let a=0;for(const l of t){if(l.isLayoutOnly)continue;const g=pt(l.points??[]);for(const x of it(g))for(const I of c)if(r(x,I.rect))a=Math.max(a,I.rect.right-x.a.x+4);else if(i(x,I.rect)){const u=Math.min(x.a.x,x.b.x);a=Math.max(a,I.rect.right-u+4)}}if(!(a<=Z))for(const l of c){const g=l.node.x,x=l.node.width;typeof g!="number"||typeof x!="number"||!Number.isFinite(g)||!Number.isFinite(x)||x<=0||(l.node.x=g-a/2,l.node.width=x+a,l.node.groupTitleRect={...l.rect,left:l.rect.left-a,right:l.rect.right-a})}}d(Gn,"shiftLeftLaneTitleBandsLeftOfRails");function Is(t,e){const{realNodeRects:o}=me(e.values()),s=t.filter(p=>!p.isLayoutOnly),r=d((p,f=new Map)=>pt(f.get(p)??p.points??[]),"replacementPointsFor"),i=d((p=new Map)=>{let f=0;for(let y=0;ys.reduce((f,y)=>f+Qt(r(y,p)),0),"totalBends"),a=d(p=>{const f=r(p);if(f.length<4)return;const y=f[f.length-2],v=f[f.length-1];if(!(!Tt(y,v,Z)&&!wt(y,v,Z)))return{tailStart:y,terminal:v}},"terminalTailFor"),l=d((p,f)=>{const y=r(p);if(y.length<3)return;const v=y[0],M=y[1];let E;if(Tt(v,M,Z))E={x:M.x,y:f.tailStart.y};else if(wt(v,M,Z))E={x:f.tailStart.x,y:M.y};else return;const T=ae(pt([v,M,E,f.tailStart,f.terminal]));return it(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),g=d((p,f)=>{const y=[p.start,p.end].filter(v=>!!v);for(const v of it(f))if(At(v.a,v.b,o,y,-2))return!0;return!1},"pathHasNodeHit"),x=d((p,f,y)=>{for(const v of s)if(v!==p){for(const M of it(f))for(const E of it(r(v,y)))if(ce(M,E,.5)>=_t)return!0}return!1},"pathHasSharedTrack"),I=d((p,f,y)=>!g(p,f)&&!x(p,f,y),"candidateIsSafe"),u=d(()=>{const p=new Map;for(const f of s){const y=f.end;if(!y||!e.has(y)||r(f).length<4)continue;const M=p.get(y)??[];M.push(f),p.set(y,M)}return p},"edgesByDestination");for(let p=0;p<4;p++){const f=i();if(f===0)return;const y=c();let v,M=f,E=y;for(const T of u().values())for(let m=0;m=f||G>M||G===M&&j>=E||(v=P,M=G,E=j)}if(!v)return;for(const[T,m]of v)T.points=m}}d(Is,"swapDestinationTerminalTailsToReduceCrossings");function Ss(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values()),c=t.filter(T=>!T.isLayoutOnly),a=d((T,m=new Map)=>pt(m.get(T)??T.points??[]),"replacementPointsFor"),l=d((T=new Map)=>{let m=0;for(let S=0;Sc.reduce((m,S)=>m+Qt(a(S,T)),0),"totalBends"),x=d(T=>{const m=T.start,S=T.end,A=m?e.get(m):void 0,R=S?e.get(S):void 0,k=A?qt(A):void 0,O=R?qt(R):void 0;return k&&O?{src:k,dst:O}:void 0},"endpointRectsFor"),I=d((T,m,S)=>{if(S.index<=0||S.index+1>=m.length-1)return;const A=x(T);if(A){if(S.vertical){const R=S.a.x,k=Math.min(A.src.left,A.dst.left),O=Math.max(A.src.right,A.dst.right),_=RO+Z?"right":void 0;return _?{edge:T,points:m,segmentIndex:S.index,axis:"vertical",side:_,coord:R,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const R=S.a.y,k=Math.min(A.src.top,A.dst.top),O=Math.max(A.src.bottom,A.dst.bottom),_=RO+Z?"bottom":void 0;return _?{edge:T,points:m,segmentIndex:S.index,axis:"horizontal",side:_,coord:R,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const T=[];for(const m of c){const S=a(m);for(const A of it(S)){const R=I(m,S,A);R&&T.push(R)}}return T},"collectExternalRails"),p=d((T,m)=>T.edge!==m.edge&&T.axis===m.axis&&T.side===m.side&&zt(T.min,T.max,m.min,m.max)>=_t,"railsInteract"),f=d(T=>{const m=[],S=new Set;for(const A of T){if(S.has(A))continue;const R=[A],k=[];for(S.add(A);R.length>0;){const O=R.pop();k.push(O);for(const _ of T)!S.has(_)&&p(O,_)&&(S.add(_),R.push(_))}k.length>1&&m.push(k)}return m},"connectedComponents"),y=d(T=>{const m=[];for(const S of T)m.some(A=>Math.abs(A-S.coord){const m=T.map(R=>R.coord),S=y(T),A=[];if(T.length<=6){const R=new Array(S.length).fill(!1),k=[],O=d(()=>{if(k.length===T.length){k.some((_,H)=>Math.abs(_-m[H])>=Z)&&A.push([...k]);return}for(const[_,H]of S.entries())R[_]||(R[_]=!0,k.push(H),O(),k.pop(),R[_]=!1)},"visit");return O(),A}for(let R=0;R{const S=new Map;for(const[R,k]of T.entries()){const O=m[R],_=S.get(k.edge)??k.points.map(H=>({x:H.x,y:H.y}));k.axis==="vertical"?(_[k.segmentIndex].x=O,_[k.segmentIndex+1].x=O):(_[k.segmentIndex].y=O,_[k.segmentIndex+1].y=O),S.set(k.edge,_)}const A=new Map;for(const[R,k]of S){const O=ae(pt(k));if(it(O).length!==O.length-1)return;A.set(R,O)}return A},"replacementsForAssignment"),E=d(T=>{for(const[m,S]of T){const A=[m.start,m.end].filter(R=>!!R);for(const R of it(S))if(At(R.a,R.b,r,A,-2)||At(R.a,R.b,i,[],-2))return!1}for(let m=0;m=_t)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const m=l();if(m===0)return;let S,A=m,R=g(),k=Number.POSITIVE_INFINITY;for(const O of f(u()))for(const _ of v(O)){const H=M(O,_);if(!H||!E(H))continue;const P=l(H);if(P>=m)continue;const G=g(H),j=O.reduce((J,dt,mt)=>J+Math.abs(_[mt]-dt.coord),0);P>A||P===A&&(G>R||G===R&&j>=k)||(S=H,A=P,R=G,k=j)}if(!S)return;for(const[O,_]of S)O.points=_}}d(Ss,"reassignCrossingExternalRailChannels");function Cs(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=t.filter(u=>!u.isLayoutOnly),i=d((u,p,f)=>pt(u===p?f??[]:u.points??[]),"pointsFor"),c=d(u=>it(u).reduce((p,f)=>{const y=f.a.x-f.b.x,v=f.a.y-f.b.y;return p+Math.hypot(y,v)},0),"pathLength"),a=d((u,p)=>{let f=0;for(let y=0;y{if(u.horizontal){const f=u.a.y;return(Math.abs(f-p.top)<1||Math.abs(f-p.bottom)<1)&&zt(u.a.x,u.b.x,p.left,p.right)>=_t}if(u.vertical){const f=u.a.x;return(Math.abs(f-p.left)<1||Math.abs(f-p.right)<1)&&zt(u.a.y,u.b.y,p.top,p.bottom)>=_t}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const p=[u.start,u.end].filter(y=>!!y),f=[];for(const y of p){const v=e.get(y),M=v?qt(v):void 0;M&&f.push(M)}return f},"endpointRectsFor"),x=d((u,p)=>{if(p+3>=u.length)return[];const f=u[p],y=u[p+1],v=u[p+2],M=u[p+3],E=Tt(f,y,Z)&&wt(y,v,Z)&&Tt(v,M,Z),T=wt(f,y,Z)&&Tt(y,v,Z)&&wt(v,M,Z);if(!E&&!T)return[];if(!(E?Math.sign(y.x-f.x)!==Math.sign(M.x-v.x):Math.sign(y.y-f.y)!==Math.sign(M.y-v.y)))return[];const S=ft(f,M,Z)||ht(f,M,Z)?[]:[{x:f.x,y:M.y},{x:M.x,y:f.y}],A=S.length===0?[[...u.slice(0,p+1),...u.slice(p+3)]]:S.map(k=>[...u.slice(0,p+1),k,...u.slice(p+3)]),R=new Set;return A.map(k=>ae(pt(k))).filter(k=>{if(it(k).length!==k.length-1||!k.some(_=>oe(_,M,Z)))return!1;const O=k.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return R.has(O)?!1:(R.add(O),!0)})},"shortcutCandidatesAt"),I=d((u,p,f)=>{const y=[u.start,u.end].filter(M=>!!M),v=g(u);for(const M of it(p))if(At(M.a,M.b,o,y,-2)||At(M.a,M.b,s,[],-2)||v.some(E=>l(M,E)))return!1;for(const M of r)if(M!==u){for(const E of it(p))for(const T of it(i(M)))if(ce(E,T,.5)>=_t)return!1}return a(u,p)<=f},"candidateIsSafe");for(let u=0;u<8;u++){const p=a();let f,y,v=p,M=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(const T of r){const m=i(T),S=Qt(m,Z),A=c(m);for(let R=0;R<=m.length-4;R++)for(const k of x(m,R)){const O=Qt(k,Z),_=c(k);if(!(Ov||P===v&&(O>M||O===M&&_>=E)||(f=T,y=k,v=P,M=O,E=_)}}if(!f||!y)return;f.points=y}}d(Cs,"shortcutRedundantOrthogonalJogs");function vs(t,e){const i=[];for(const N of e.values()){if(N.isGroup||N.isEdgeLabel)continue;const F=N.x??0,D=N.y??0,V=qt(N);V&&i.push({id:String(N.id??""),cx:F,cy:D,rect:V})}if(i.length===0)return;const c=new Map(i.map(N=>[N.id,N])),a=i.map(N=>({id:N.id,rect:N.rect})),l=["top","bottom","left","right"],g={top:Math.min(...i.map(N=>N.rect.top))-20,bottom:Math.max(...i.map(N=>N.rect.bottom))+20,left:Math.min(...i.map(N=>N.rect.left))-20,right:Math.max(...i.map(N=>N.rect.right))+20},x=t.filter(N=>!N.isLayoutOnly),I=new Map(x.map((N,F)=>[N,F])),u=d(N=>{const F=N==="left"||N==="top"?-1:1,D=[];for(let V=0;V<=2;V++)D.push(g[N]+F*20*V);return D},"outwardTracksForSide"),p=d((N,F=new Map)=>pt(F.get(N)??N.points??[]),"replacementPointsFor"),f=d((N,F)=>{let D=0;for(const V of N)for(const h of F)le(V.a,V.b,h.a,h.b,Z)&&D++;return D},"crossingCountBetweenSegments"),y=d((N,F)=>f(it(N),it(F)),"crossingCountBetweenPaths"),v=d((N=new Map)=>{let F=0;const D=[],V=new Set,h=[],b=d(C=>{V.has(C)||(V.add(C),h.push(C))},"addEdge");for(let C=0;C0&&(F+=q,D.push({first:L,second:U,count:q}),b(L),b(U))}}return h.sort((C,L)=>(I.get(C)??0)-(I.get(L)??0)),{count:F,pairs:D,edgeSet:V,edges:h}},"crossingSnapshot"),M=d((N,F)=>{const D=new Set(F.keys());if(D.size===0)return N.count;let V=0;for(const b of N.pairs)(D.has(b.first)||D.has(b.second))&&(V+=b.count);let h=0;for(let b=0;b{const F=new Map;for(const h of N.pairs){const b=F.get(h.first)??new Set;b.add(h.second),F.set(h.first,b);const C=F.get(h.second)??new Set;C.add(h.first),F.set(h.second,C)}const D=[],V=new Set;for(const h of N.edges){if(V.has(h))continue;const b=[h],C=[];for(V.add(h);b.length>0;){const L=b.pop();C.push(L);for(const w of F.get(L)??[])V.has(w)||(V.add(w),b.push(w))}C.sort((L,w)=>(I.get(L)??0)-(I.get(w)??0)),C.length>1&&D.push(C)}return D},"crossingComponents"),T=d(N=>[N.start,N.end].filter(F=>!!F),"endpointIdsFor"),m=d(N=>{const F=[];for(const D of E(N)){const V=new Set(D),h=new Set(D.flatMap(C=>T(C))),b=[...D];for(const C of x)V.has(C)||T(C).some(L=>h.has(L))&&b.push(C);b.sort((C,L)=>(I.get(C)??0)-(I.get(L)??0)),F.push(b)}return F},"pairSearchGroups"),S=d((N,F,D)=>M(N,new Map([[F,D]])),"crossingCountWithSingleReplacement"),A=d(N=>{const F=new Map;for(const D of N.pairs)F.set(D.first,(F.get(D.first)??0)+D.count),F.set(D.second,(F.get(D.second)??0)+D.count);return F},"currentCrossingsByEdge"),R=d(N=>N.slice(1).reduce((F,D,V)=>{const h=N[V];return F+Math.abs(D.x-h.x)+Math.abs(D.y-h.y)},0),"pathLength"),k=d((N=new Map)=>x.reduce((F,D)=>F+Qt(p(D,N)),0),"totalBends"),O=d((N=new Map)=>x.reduce((F,D)=>F+R(p(D,N)),0),"totalLength"),_=d((N,F,D=new Map)=>{const V=it(F);for(const h of x)if(h!==N){for(const b of V)for(const C of it(p(h,D)))if(ce(b,C,.5)>=_t)return!0}return!1},"pathHasSegmentConflict"),H=d((N,F)=>{const D=[N.start,N.end].filter(V=>!!V);for(const V of it(F))if(At(V.a,V.b,a,D,-2))return!0;return!1},"pathHitsNode"),P=d((N,F)=>{const D=ae(pt(F));it(D).length===D.length-1&&N.push(D)},"pushOrthogonalCandidate"),G=d(N=>N==="left"||N==="right","sideIsHorizontal"),j=d((N,F,D)=>{switch(F){case"left":return Math.min(N.x,D.x)-20;case"right":return Math.max(N.x,D.x)+20;case"top":return Math.min(N.y,D.y)-20;case"bottom":return Math.max(N.y,D.y)+20}},"localTrackForSameSide"),J=d((N,F,D,V)=>{const h=D==="left"||D==="top"?-1:1,b=[j(F,D,V),g[D]];for(const C of b)for(let L=0;L<=2;L++)P(N,ao(F,D,V,C+h*20*L))},"addSameSideCandidates"),dt=d((N,F,D,V,h)=>{for(const b of u(D))for(const C of u(h))P(N,[F,{x:b,y:F.y},{x:b,y:C},{x:V.x,y:C},V])},"addHorizontalToVerticalCandidates"),mt=d((N,F,D,V,h)=>{for(const b of u(D))for(const C of u(h))P(N,[F,{x:F.x,y:b},{x:C,y:b},{x:C,y:V.y},V])},"addVerticalToHorizontalCandidates"),kt=d((N,F,D,V,h)=>{const b=[...u("top"),...u("bottom")];for(const C of u(D))for(const L of u(h))for(const w of b)P(N,[F,{x:C,y:F.y},{x:C,y:w},{x:L,y:w},{x:L,y:V.y},V])},"addHorizontalPairCandidates"),Pt=d((N,F,D,V,h)=>{const b=[...u("left"),...u("right")];for(const C of u(D))for(const L of u(h))for(const w of b)P(N,[F,{x:F.x,y:C},{x:w,y:C},{x:w,y:L},{x:V.x,y:L},V])},"addVerticalPairCandidates"),Q=d(N=>{const F=new Set;return N.map(D=>pt(D)).filter(D=>{const V=D.map(h=>`${h.x.toFixed(3)},${h.y.toFixed(3)}`).join("|");return F.has(V)||D.length<2?!1:(F.add(V),!0)})},"dedupeCandidatePaths"),W=d((N,F,D,V)=>{const h=[],b=co(N,F,D,V,20,Z);b&&P(h,b),F===V&&J(h,N,F,D);const C=G(F),L=G(V);return C&&!L?dt(h,N,F,D,V):!C&&L?mt(h,N,F,D,V):C?kt(h,N,F,D,V):Pt(h,N,F,D,V),Q(h)},"buildCandidatesForSides"),et=d((N,F,D,V)=>{const h=[...u("left"),...u("right")],b=[...u("top"),...u("bottom")];for(const C of l){const L=Ie(V,C),w=C==="top"||C==="bottom"?u(C):b;for(const B of h){P(N,[F,D,{x:B,y:D.y},{x:B,y:L.y},L]);for(const U of w)P(N,[F,D,{x:B,y:D.y},{x:B,y:U},{x:L.x,y:U},L])}}},"addVerticalDepartureOuterTrackCandidates"),at=d((N,F,D,V)=>{const h=[...u("left"),...u("right")],b=[...u("top"),...u("bottom")];for(const C of l){const L=Ie(V,C),w=C==="left"||C==="right"?u(C):h;for(const B of b){P(N,[F,D,{x:D.x,y:B},{x:L.x,y:B},L]);for(const U of w)P(N,[F,D,{x:D.x,y:B},{x:U,y:B},{x:U,y:L.y},L])}}},"addHorizontalDepartureOuterTrackCandidates"),gt=d(N=>{const F=N.start,D=N.end,V=D?c.get(D):void 0;if(!F||!V)return[];const h=pt(N.points??[]);if(h.length<4)return[];const b=h[0],C=h[1],L=[];return wt(b,C,Z)?et(L,b,C,V):Tt(b,C,Z)&&at(L,b,C,V),L},"terminalPreservingOuterTrackCandidates"),xt=d(N=>{const F=N.start,D=N.end,V=F?c.get(F):void 0,h=D?c.get(D):void 0;if(!V||!h)return[];const b=[];for(const C of l){const L=Ie(V,C);for(const w of l)b.push(...W(L,C,Ie(h,w),w))}return b.push(...gt(N)),b},"candidatePathsFor"),vt=d(()=>new Map(x.map(N=>[N,it(p(N))])),"currentSegmentsByEdge"),Vt=d((N,F,D)=>{const V=new Set;for(const h of x){if(h===N)continue;const b=D.get(h)??it(p(h));F.some(C=>b.some(L=>ce(C,L,.5)>=_t))&&V.add(h)}return V},"sharedTrackConflictsFor"),jt=d((N,F,D,V)=>{const h=new Set;return xt(N).map(C=>ae(pt(C))).filter(C=>{if(H(N,C))return!1;const L=C.map(w=>`${w.x.toFixed(3)},${w.y.toFixed(3)}`).join("|");return h.has(L)||C.length<2?!1:(h.add(L),!0)}).map(C=>{const L=it(C);let w=0;for(const B of x)B!==N&&(w+=f(L,D.get(B)??it(p(B))));return{candidate:C,candidateSegments:L,crossings:F.count-(V.get(N)??0)+w,bends:Qt(C,Z),totalBends:Qt(C),length:R(C)}}).filter(({crossings:C})=>C<=F.count).sort((C,L)=>C.crossings-L.crossings||C.bends-L.bends||C.length-L.length).slice(0,48).map(C=>({path:C.candidate,segments:C.candidateSegments,sharedTrackConflicts:Vt(N,C.candidateSegments,D),totalBends:C.totalBends,length:C.length}))},"pairCandidatesFor"),Ut=d((N,F,D,V,h,b)=>{let C=0;for(const w of N.pairs)(w.first===F||w.second===F||w.first===V||w.second===V)&&(C+=w.count);let L=f(D.segments,h.segments);for(const w of x){if(w===F||w===V)continue;const B=b.get(w)??it(p(w));L+=f(D.segments,B)+f(h.segments,B)}return N.count-C+L},"pairCrossingCount"),te=d((N,F)=>{for(const D of N.sharedTrackConflicts)if(D!==F)return!1;return!0},"conflictsOnlyWith"),Se=d((N,F)=>N.segments.some(D=>F.segments.some(V=>ce(D,V,.5)>=_t)),"candidatesShareTrack"),de=d((N,F,D,V)=>te(F,D.edge)&&te(V,N.edge)&&!Se(F,V),"pairCandidatesAreCompatible"),Ce=d((N,F,D,V,h)=>{const b=Ut(N.current,F.edge,D,V.edge,h,N.baseSegments);if(!(b>=N.current.count))return{replacements:new Map([[F.edge,D.path],[V.edge,h.path]]),crossings:b,bends:N.currentBends-(N.baseBendsByEdge.get(F.edge)??0)-(N.baseBendsByEdge.get(V.edge)??0)+D.totalBends+h.totalBends,length:N.currentLength-(N.baseLengthByEdge.get(F.edge)??0)-(N.baseLengthByEdge.get(V.edge)??0)+D.length+h.length}},"scorePairReplacement"),dn=d((N,F)=>N.crossings{let h=V;for(const b of F.candidates)for(const C of D.candidates){if(!de(F,b,D,C))continue;const L=Ce(N,F,b,D,C);L&&dn(L,h)&&(h=L)}return h},"bestScoreForOptionPair"),hn=d(N=>{const F=k(),D=O(),V=vt(),h=A(N),b=new Map(x.map(q=>[q,Qt(p(q))])),C=new Map(x.map(q=>[q,R(p(q))])),L=new Map,w=m(N);for(const q of w)for(const z of q){if(L.has(z))continue;const Y=jt(z,N,V,h);Y.length>0&&L.set(z,{edge:z,candidates:Y})}let B={replacements:new Map,crossings:N.count,bends:F,length:D};const U={current:N,currentBends:F,currentLength:D,baseBendsByEdge:b,baseLengthByEdge:C,baseSegments:V};for(const q of w){const z=new Set(q.filter(ot=>N.edgeSet.has(ot))),Y=q.map(ot=>L.get(ot)).filter(ot=>!!ot);for(let ot=0;ot0?B.replacements:void 0},"bestPairedReplacement");for(let N=0;N<4;N++){const F=v(),D=F.count;if(D===0)return;let V,h,b=D,C=Number.POSITIVE_INFINITY;for(const w of F.edges){const B=Qt(p(w),Z);for(const U of xt(w)){const q=H(w,U),z=!q&&_(w,U),Y=S(F,w,U),ot=Qt(U,Z);q||z||!(Yb||Y===b&&ot>=C||(V=w,h=U,b=Y,C=ot)}}if(V&&h){V.points=h;continue}const L=hn(F);if(!L)return;for(const[w,B]of L)w.points=B}}d(vs,"resolveRenderedOrthogonalCrossings");var pe=.001,Wr=8;function Ls(t,e){const{nodeInfoById:n,realNodeRects:o}=an(e),s=["top","bottom","left","right"],r=20,i={top:Math.min(...o.map(f=>f.rect.top))-r,bottom:Math.max(...o.map(f=>f.rect.bottom))+r,left:Math.min(...o.map(f=>f.rect.left))-r,right:Math.max(...o.map(f=>f.rect.right))+r},c=d((f,y,v,M)=>{const E=[],T=co(f,y,v,M,r,pe);return T&&E.push(T),y===M&&E.push(ao(f,y,v,i[y])),E},"buildOrthogonalPathCandidates"),a=d((f,y)=>{for(let v=0;v{let M=0;const E=Re(f,pe),T=y.start,m=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const A=S.start,R=S.end;if(!v&&T&&m&&(A===T||A===m||R===T||R===m))continue;const k=S.points;if(!(!k||k.length<2))for(const O of E)for(const _ of Re(k,pe)){if(fo(O.a,O.b,_.a,_.b,pe,pe)){M++;continue}ce(O,_,pe)>=Wr&&M++}}return M},"pathConflictCount"),g=4,x=d((f,y)=>{const v=Math.abs(f.y-y.rect.top),M=Math.abs(f.y-y.rect.bottom),E=Math.abs(f.x-y.rect.left),T=Math.abs(f.x-y.rect.right);let m="top",S=v;return M{const M=I.get(f)??[];M.push({side:y,edgeId:v}),I.set(f,M)},"addFaceClaim");for(const f of t){if(f.isLayoutOnly)continue;const y=f.points??[];if(y.length<1)continue;const v=f.id??"",M=f.start,E=f.end;if(M){const T=n.get(M);T&&u(M,x(y[0],T),v)}if(E){const T=n.get(E);T&&u(E,x(y[y.length-1],T),v)}}const p=d((f,y,v)=>I.get(f)?.some(M=>M.edgeId!==v&&M.side===y)??!1,"faceIsClaimed");for(const f of t){if(f.isLayoutOnly)continue;const y=f.points;if(!y||y.length<2)continue;const v=Qt(y,pe);if(v0){const mt=l(J,f,!0);if(mt>O||mt===O&&dt>=_)continue;O=mt,_=dt,k=J;continue}l(J,f)>R||dt<_&&(_=dt,k=J)}}}if(k){f.points=k;const H=I.get(M);H&&I.set(M,H.filter(G=>G.edgeId!==S));const P=I.get(E);P&&I.set(E,P.filter(G=>G.edgeId!==S)),u(M,x(k[0],T),S),u(E,x(k[k.length-1],m),S)}}}d(Ls,"simplifyDetouredEdges");var Kt=.001,Po=10,Ve=7;function $n(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const i=r.x-s.x,c=r.y-s.y;if(!(Math.abs(i)+Math.abs(c)r&&Je(t,Es(r)))}d(zn,"labelOverlapsOwnMarker");function Ue(t,e){const n=[];for(const p of t){if(p.isLayoutOnly)continue;const f=p.points;if(!(!f||f.length<2))for(let y=0;y{const y=Tn(f,r);for(const{nodeId:v,rect:M}of o)if(v!==p&&Je(y,M))return!0;return!1},"labelOverlapsForeignNode"),l=d((p,f)=>{const y=Tn(f,r);for(const v of n)if(v.edgeId!==p&&cn(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),g=d((p,f,y)=>a(p,y)||l(f,y),"labelOverlapsAnything"),x=[],I=d(p=>{for(const{id:f,rect:y}of s)if(ts(y,p))return f},"findContainingLane"),u=d((p,f)=>x.some(y=>y.labelId!==p&&Je(f,y.rect)),"overlapsPlacedLabel");for(const p of t){if(p.isLayoutOnly)continue;const f=p.labelNodeId;if(!f)continue;const y=e.get(f);if(!y)continue;const v=p.points;if(!v||v.length<2)continue;const M=y.width??0,E=y.height??0;if(M<=0||E<=0)continue;const T=[];for(let Q=0;Q=Kt&>>=Kt||T.push({idx:Q,length:at+gt,orientation:at>=Kt?"horizontal":"vertical",midX:(W.x+et.x)/2,midY:(W.y+et.y)/2})}if(T.length===0)continue;const m=T.length>=3?T.filter(Q=>Q.idx>0&&Q.idx0?m:T,A=M>=E?"horizontal":"vertical",R=d(Q=>[...Q].sort((W,et)=>{const at=W.orientation===A,gt=et.orientation===A;if(at!==gt)return at?-1:1;const xt=W.length>=(W.orientation==="horizontal"?M:E)+2,vt=et.length>=(et.orientation==="horizontal"?M:E)+2;return xt!==vt?xt?-1:1:et.length-W.length}),"rankSegments"),k=T[0],O=T[T.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((Q,W)=>{const et=v[Q.idx],at=v[Q.idx+1];return{midX:et.x+(at.x-et.x)*W,midY:et.y+(at.y-et.y)*W}},"anchorAtT"),P=d((Q,W,et)=>Math.min(et,Math.max(W,Q)),"clamp"),G=d((Q,W)=>Q.midX>=W.left-Kt&&Q.midX<=W.right+Kt&&Q.midY>=W.top-Kt&&Q.midY<=W.bottom+Kt,"pointInsideRectInclusive"),j=d(Q=>{const W=Ae(Q.midX,Q.midY,M,E),et=I(W);if(et)return{laneId:et,anchor:Q,rect:W};const at=s.find(({rect:te})=>G(Q,te));if(!at)return;const gt=at.rect.left+M/2+i,xt=at.rect.right-M/2-i,vt=at.rect.top+E/2+i,Vt=at.rect.bottom-E/2-i;if(gt>xt||vt>Vt)return;const jt={midX:P(Q.midX,gt,xt),midY:P(Q.midY,vt,Vt)},Ut=Ae(jt.midX,jt.midY,M,E);return G(Q,Ut)?{laneId:at.id,anchor:jt,rect:Ut}:void 0},"placementForAnchor"),J=d((Q,W,et)=>Q.orientation==="horizontal"?Math.abs(W.midX-et.x):Math.abs(W.midY-et.y),"distanceAlongSegment"),dt=d((Q,W)=>{const at=(Q.orientation==="horizontal"?M/2:E/2)+c;if(Q===k){const gt=v[Q.idx];if(J(Q,W,gt)+Kt{const W=R(Q);for(const et of W)for(const at of _){const gt=H(et,at);if(!dt(et,gt))continue;const xt=j(gt);if(xt&&!zn(xt.rect,v)&&!u(f,xt.rect)&&!g(f,p.id,xt.rect))return{laneId:xt.laneId,anchor:xt.anchor}}},"tryPool"),kt=d((Q,W,et=!1)=>{const at=R(Q);for(const gt of at){const xt={midX:gt.midX,midY:gt.midY};if(W&&!dt(gt,xt))continue;const vt=j(xt);if(vt&&!zn(vt.rect,v)&&!u(f,vt.rect)&&!a(f,vt.rect)&&(et||!l(p.id,vt.rect)))return{laneId:vt.laneId,anchor:vt.anchor}}},"findLaneContainingFallback"),Pt=mt(S)??(S.lengthet.labelId===f);W>=0?x[W]={labelId:f,rect:Q}:x.push({labelId:f,rect:Q})}}}d(Ue,"anchorLabelsToPolyline");var Sn=1e-6,Kr=8,Bo=Kr/2,qr=3;function Vn(t,e){return t{const g=Vn(c,a);let x=0;const I=d(u=>{if(!u)return;const p=s.get(u);if(!p)return;const f=l==="x"?p.w/2:p.h/2;f>x&&(x=f)},"consider");I(i.labelNodeId);for(const u of t){if(u===i||u.isLayoutOnly)continue;const p=u.start,f=u.end;!p||!f||Vn(p,f)===g&&I(u.labelNodeId)}return x>0?x+qr:0},"labelClearanceFor");for(const i of t){if(i.isLayoutOnly)continue;const c=i.points;if(!ro(c,Sn))continue;const a=lo(i,n,Sn);if(!a)continue;const{srcId:l,dstId:g,srcInfo:x,dstInfo:I,collinearX:u,collinearY:p}=a;if(u===p)continue;let f,y;if(u){const m=I.cy>x.cy;f={x:x.cx,y:m?x.rect.bottom:x.rect.top},y={x:I.cx,y:m?I.rect.top:I.rect.bottom}}else{const m=I.cx>x.cx;f={x:m?x.rect.right:x.rect.left,y:x.cy},y={x:m?I.rect.left:I.rect.right,y:I.cy}}if(At(f,y,o,[l,g],1))continue;const M=r(i,l,g,u?"x":"y"),E=M>Bo?M:Bo,T=[0,E,-E];for(const m of T){const S={...f},A={...y};if(u){if(S.x+=m,A.x+=m,S.x<=x.rect.left||S.x>=x.rect.right||A.x<=I.rect.left||A.x>=I.rect.right)continue}else if(S.y+=m,A.y+=m,S.y<=x.rect.top||S.y>=x.rect.bottom||A.y<=I.rect.top||A.y>=I.rect.bottom)continue;if(!At(S,A,o,[l,g],1)&&!Ze(S,A,t,i,{epsilon:Sn})){i.points=[S,A];break}}}}d(Ts,"straightenCollinearSiblingDetours");function jn(t,e){const{realNodeRects:a,labelNodeRects:l}=me(e.values()),g=d((m,S)=>Re(S,.001).map(A=>({...A,edge:m,interior:A.index>=1&&A.index<=S.length-3})),"segmentsFor"),x=d(()=>{const m=[];for(const S of t){if(S.isLayoutOnly)continue;const A=S.points;!A||A.length<2||m.push(...g(S,pt(A)))}return m},"allSegments"),I=d((m,S)=>m.horizontal&&S.horizontal?zt(m.a.x,m.b.x,S.a.x,S.b.x)>=8&&Math.abs(m.a.y-S.a.y)<7:m.vertical&&S.vertical?zt(m.a.y,m.b.y,S.a.y,S.b.y)>=8&&Math.abs(m.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((m,S)=>{const A=m.start,R=m.end,k=g(m,S);if(k.length!==S.length-1)return!1;const O=[A,R].filter(H=>!!H),_=m.labelNodeId?[m.labelNodeId]:[];for(const H of k)if(At(H.a,H.b,a,O,-2)||At(H.a,H.b,l,_,-2))return!1;for(const H of t){if(H===m||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of k)for(const j of g(H,pt(P)))if(I(G,j)||le(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),p=d((m,S)=>{const A=pt(m.edge.points??[]);if(A.length<4||m.index>=A.length-1)return;const R=A.map(k=>({...k}));if(m.horizontal)R[m.index].y+=S,R[m.index+1].y+=S;else if(m.vertical)R[m.index].x+=S,R[m.index+1].x+=S;else return;return g(m.edge,R).length===R.length-1?R:void 0},"shiftedCandidate"),f=d((m,S)=>({x:m.x??(S.left+S.right)/2,y:m.y??(S.top+S.bottom)/2}),"nodeCenter"),y=d(m=>{const S=m.edge,A=pt(S.points??[]);if(A.length!==4||m.index!==1)return;const R=S.start?e.get(S.start):void 0,k=S.end?e.get(S.end):void 0,O=R?qt(R):void 0,_=k?qt(k):void 0,H=A.slice(m.index+2);if(!(!R||!k||!O||!_||H.length===0))return{sourceCenter:f(R,O),targetCenter:f(k,_),sourceRect:O,tail:H}},"sourceDetourContextFor"),v=d((m,S,A,R,k,O)=>{const _=R.y>=A.y,H=_?k.bottom:k.top,P=H+(_?20:-20);if(_&&m.b.y<=P+.001||!_&&m.b.y>=P-.001)return;const G=m.a.x+S;return pt([{x:A.x,y:H},{x:A.x,y:P},{x:G,y:P},{x:G,y:m.b.y},...O],.001)},"verticalSourceDetour"),M=d((m,S,A,R,k,O)=>{const _=R.x>=A.x,H=_?k.right:k.left,P=H+(_?20:-20);if(_&&m.b.x<=P+.001||!_&&m.b.x>=P-.001)return;const G=m.a.y+S;return pt([{x:H,y:A.y},{x:P,y:A.y},{x:P,y:G},{x:m.b.x,y:G},...O],.001)},"horizontalSourceDetour"),E=d((m,S)=>{const A=y(m);if(A){if(m.vertical)return v(m,S,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail);if(m.horizontal)return M(m,S,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let m=0;m<12;m++){const S=x();let A=!1;for(let R=0;RP.interior);for(const P of H){for(const G of T){const j=p(P,G);if(j&&u(P.edge,j)){P.edge.points=j,A=!0;break}const J=E(P,G);if(J&&u(P.edge,J)){P.edge.points=J,A=!0;break}}if(A)break}}if(!A)return}}d(jn,"nudgeSharedInteriorSubpaths");function ws(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,c=o.y-n.y,a=s*c-r*i;if(Math.abs(a)<1e-10)return!1;const l=n.x-t.x,g=n.y-t.y,x=(l*c-g*i)/a,I=(l*r-g*s)/a,u=.01;return x>u&&x<1-u&&I>u&&I<1-u}d(ws,"segmentsIntersect");function As(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=es(e),r=[];for(const c of n){if(c.isLayoutOnly)continue;const a=c.points;if(!a||a.length<2)continue;const l=c.start,g=c.end,x=c.labelNodeId,I=c.id??`${l}->${g}`;for(const u of s)if(!(u.nodeId===l||u.nodeId===g)&&!(x&&u.nodeId===x)){for(let p=0;p0){const c=o.filter(l=>l.type==="edge-node-overlap").length,a=o.filter(l=>l.type==="edge-edge-crossing").length;Ke.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${c} edge-node overlap(s), ${a} edge crossing(s)`);for(const l of o)Ke.warn(`[SWIMLANE_VALIDATE] ${l.type}: ${l.detail}`)}return o}d(As,"validateSwimlanesLayout");function Rs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!ms(t,e)||e==="BT"&&s.length>0&&!ps(t))return;for(const c of o){if(c.isLayoutOnly)continue;const a=c.points;!a||a.length<2||(c.points=ae(Qe(a)))}Ls(o,n),Ts(o,n),ys(o,n);const r=new Map;for(const c of n)r.set(String(c.id),c);Ue(o,r),is(o,r),xs(o,r),jn(o,r),bs(o,r),Ms(o,r),Xn(o,r),Is(o,r);const i=d(()=>{vs(o,r),Ss(o,r),Cs(o,r),Ue(o,r),Dn(o,r),Xn(o,r),Ue(o,r),Dn(o,r)},"finalizeRenderedEdges");i(),jn(o,r),i(),Yn(o,r),Gn(o,r),Yn(o,r),Gn(o,r)}d(Rs,"postProcessSwimlaneLayout");function ye(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const i=`${r.id}:${r.src}->${r.dst}`;n.has(i)||(n.add(i),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(ye,"normalizeGraph");function mo(t,e){return t.edges.filter(n=>n.dst===e)}d(mo,"incoming");function Ns(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(Ns,"buildSuccessorMap");function yo(t){const e=Ns(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(yo,"buildSortedSuccessorMap");function xo(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(xo,"buildInDegreeMap");function bo(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(bo,"sortedZeroInDegreeNodes");function ln(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(ln,"buildPredecessorSuccessorMaps");function Mo(t,e,n,o){let s=0;for(const i of t.nodes)o?.skipGroups&&t.nodeById.get(i)?.isGroup||(s=Math.max(s,n[i]??0));const r=Array.from({length:s+1},()=>[]);for(const i of e)o?.skipGroups&&t.nodeById.get(i)?.isGroup||r[Math.max(0,n[i]??0)].push(i);return r}d(Mo,"buildLayersFromRanks");function Be(t){const e=xo(t),n=bo(e),o=[],s=yo(t);for(;n.length;){const r=n.shift();o.push(r);for(const i of s.get(r)??[])if(e.set(i,(e.get(i)??0)-1),(e.get(i)??0)===0){let c=0;for(;c{if(s-o<=1)return 0;const r=o+s>>1;let i=n(o,r)+n(r,s),c=o,a=r,l=o;for(;c=s||cx.dst===I.dst?x.id.localeCompare(I.id):x.dst.localeCompare(I.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const x of n.get(g)??[]){const I=x.dst;o[I]===0?r(I):o[I]===1&&s.push(x)}o[g]=2},"dfs"),i=[...e.nodes].sort((g,x)=>g.localeCompare(x));for(const g of i)o[g]===0&&r(g);const c=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),a=e.edges.map(g=>c.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:a,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(Os,"removeCycles_DFS");function Ps(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const c=n(r)??r;return e.set(o,c),c},"resolve");for(const o of t.nodes)n(o);return e}d(Ps,"buildTopLaneMap");function fe(t){const e=Ps(t);return n=>e.get(n)??null}d(fe,"createTopLaneResolver");function fn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(fn,"buildTopLaneOrder");function So(t,e){const n=fn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const i of e)!o.has(i)||s.has(i)||(s.add(i),r.push(i));for(const i of n)s.has(i)||r.push(i);return r}d(So,"resolveTopLaneOrder");var Jr={EPSILON:1e-6},sn={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},ko={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Bs(t,e){const n=ye(t),o=e?.laneOf??(()=>null),s=e?.rankHint,{preds:r}=ln(n);for(const m of r.values())m.sort((S,A)=>S.localeCompare(A));const i=Be(n)??[...n.nodes].sort((m,S)=>m.localeCompare(S)),c=new Map;for(const[m,S]of i.entries())c.set(S,m);const a=new Map,l=new Map;for(const m of n.nodes)l.set(m,[]);for(const m of i){const S=(r.get(m)??[]).filter(A=>a.has(A));if(S.length>0){const A=ks(m,S,{laneOf:o,rankHint:s,topoIndex:c});a.set(m,A),l.get(A).push(m)}else a.has(m)||a.set(m,null)}for(const m of n.nodes)a.has(m)||a.set(m,null);const g=new Set;for(const m of n.nodes)(a.get(m)??null)===null&&g.add(m);const x=[...g].sort((m,S)=>{const A=c.get(m)??0,R=c.get(S)??0;return A===R?m.localeCompare(S):A-R}),I=_s(n),u=new Map;for(const[m,S]of I.entries())u.set(m,[...S].sort((A,R)=>A.localeCompare(R)));const p=Fs(u),f=Ds(u),y=new Map;for(const m of n.nodes)y.set(m,[]);for(const m of f)for(const S of m.nodes){const A=y.get(S);A?A.push(m.id):y.set(S,[m.id])}const v=[],M=[],E=new Set,T=d(m=>{if(!E.has(m)){E.add(m),v.push(m);for(const S of l.get(m)??[])T(S);M.push(m)}},"walk");for(const m of x)T(m);for(const m of i)T(m);return{parent:a,children:l,roots:x,componentOf:p,blocks:f,nodeBlocks:y,adjacency:u,preorder:v,postorder:M,topologicalOrder:i}}d(Bs,"buildDrivingTree");function ks(t,e,n){const o=n.laneOf(t);return[...e].sort((r,i)=>{const c=n.laneOf(r),a=n.laneOf(i),l=c!=null&&c===o,g=a!=null&&a===o;if(l!==g)return l?-1:1;const x=n.rankHint?.[r],I=n.rankHint?.[i];if(x!=null&&I!=null&&x!==I)return I-x;const u=n.topoIndex.get(r)??0,p=n.topoIndex.get(i)??0;return u!==p?u-p:r.localeCompare(i)})[0]}d(ks,"chooseParent");function _s(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(_s,"buildAdjacency");function Fs(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const i of t.get(r)??[])e.has(i)||s.push(i)}}n++}return e}d(Fs,"assignComponents");function Ds(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const i=d((c,a)=>{e.set(c,++r),n.set(c,r);for(const l of t.get(c)??[])l!==a&&(e.has(l)?(e.get(l)??0)<(e.get(c)??0)&&(o.push([c,l]),n.set(c,Math.min(n.get(c)??r,e.get(l)??r))):(o.push([c,l]),i(l,c),n.set(c,Math.min(n.get(c)??r,n.get(l)??r)),(n.get(l)??0)>=(e.get(c)??0)&&s.push(Hs(c,l,o,s.length))))},"visit");for(const c of t.keys())e.has(c)||i(c,null);return s}d(Ds,"computeBlocks");function Hs(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const i=n.pop();if(s.push(i),r.add(i[0]),r.add(i[1]),i[0]===t&&i[1]===e||i[0]===e&&i[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d(Hs,"popBlock");function Xs(t,e,n){const o=[...t.nodes],s=new Map;for(const[M,E]of o.entries())s.set(E,M);const r=o.length,i=new Array(r).fill(-1),c=new Array(r).fill(0),a=[],l=new Set;for(const M of o){const E=n.parent.get(M)??null,T=s.get(M);T!=null&&E==null&&(i[T]=-1,c[T]=0,l.has(M)||(l.add(M),a.push(M)))}for(;a.length>0;){const M=a.shift(),E=s.get(M);if(E==null)continue;const T=n.children.get(M)??[];for(const m of T){if(l.has(m))continue;const S=s.get(m);S!=null&&(i[S]=E,c[S]=c[E]+1,l.add(m),a.push(m))}}for(const M of o){if(l.has(M))continue;const E=s.get(M);E!=null&&(i[E]=-1,c[E]=0,l.add(M))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),x=Array.from({length:g},()=>new Array(r).fill(-1));for(let M=0;M{if(M===-1||E===-1)return-1;c[M]>m&1&&(M=x[m][M],M===-1))return-1;if(M===E)return M;for(let m=g-1;m>=0;m--){const S=x[m][M],A=x[m][E];S===-1||A===-1||S!==A&&(M=S,E=A)}return x[0][M]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const M of t.edges){let E=M.src,T=M.dst,m=e[E],S=e[T];if(m==null||S==null||(m>S&&([E,T]=[T,E],[m,S]=[S,m]),m==null||S==null||m===S))continue;const A=s.get(E),R=s.get(T);if(A==null||R==null)continue;const k=I(A,R);if(k===-1)continue;const O=u[k];for(let _=m;_{if(E.size!==0)for(const[T,m]of E)M.set(T,(M.get(T)??0)+m)},"mergeInto"),y=new Set,v=d(M=>{const E=s.get(M);y.add(M);const T=E==null?void 0:u[E],m=T?new Map(T):new Map,S=n.children.get(M)??[];for(const A of S){const R=v(A),k=e[M];if(k!=null){let O=p.get(M);O||(O=new Map,p.set(M,O));let _=R.get(k)??0;const H=e[A];H!=null&&H>k&&(_+=1),O.set(A,_)}f(m,R)}return m},"dfs");for(const M of n.roots)y.has(M)||v(M);for(const M of o)y.has(M)||v(M);return p}d(Xs,"computeSubtreeCrossCounts");function Ys(t,e,n){const o=new Map,s=d(r=>{let i=n[r]??0;const c=[...e.get(r)??[]];c.sort(Co(n));for(const a of c){s(a);const l=o.get(a);l!=null&&(i=Math.min(i,l))}o.set(r,i)},"annotate");for(const r of t)s(r);return o}d(Ys,"annotateMinimumLayers");function Co(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(Co,"compareByRankThenId");function Gs(t,e,n,o){let s=0;for(const a of e){const l=n[a]??0;l>s&&(s=l)}const r=Array.from({length:s+1},()=>[]),i=new Set,c=d(a=>{if(i.has(a))return;i.add(a);const l=n[a]??0;r[l]||(r[l]=[]),r[l].push(a);for(const g of o(a))c(g)},"emit");for(const a of t)c(a);for(const a of e)if(!i.has(a)){const l=n[a]??0;r[l]||(r[l]=[]),r[l].push(a),i.add(a)}return r}d(Gs,"emitNodesInTreeOrder");function $s(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d($s,"deduplicateLayers");function zs(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const i=e[s]??0,c=[],a=[],l=n.get(s);for(const g of r){const x=o.get(g)??i;x>i?c.push({child:g,min:x}):a.push(g)}return c.sort((g,x)=>g.min===x.min?g.child.localeCompare(x.child):g.min-x.min),a.sort((g,x)=>{const I=l?.get(g)??0,u=l?.get(x)??0;if(I!==u)return I-u;const p=o.get(g)??i,f=o.get(x)??i;return p!==f?p-f:g.localeCompare(x)}),[...c.map(g=>g.child),...a]}}d(zs,"createChildOrderer");function rn(t,e,n){const o=Bs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const x of t.nodes)s.has(x)||s.set(x,[]);const i=Xs(t,e,o),c=[...r].sort(Co(e)),a=Ys(c,s,e),l=zs(s,e,i,a);let g=Gs(c,t.nodes,e,l);return g=$s(g),g}d(rn,"buildMultitreeLayerOrder");function Vs(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(e),i=[];for(const c of n)o.has(c.src)&&s.has(c.dst)&&i.push(r.get(c.dst));return Io(i)}d(Vs,"countCrossingsBetweenAdjacent");function Un(t,e,n){const o=[];for(const r of e){const i=n[r.src],c=n[r.dst];if(i==null||c==null||i===c)continue;let a=r.src,l=r.dst,g=i,x=c;i>c&&(a=r.dst,l=r.src,g=c,x=i);for(let I=g;I(n[I]??0)-(n[x]??0));for(const x of g){const I=n[x]??0;if(I===0)continue;let u=0;for(const v of o.get(x)??[])u=Math.max(u,(n[v]??0)+1);if(u>=I)continue;const p=I;n[x]=u;const f=rn(t,n,s),y=Un(f,t.edges,n);y(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const i=t.edges.filter(f=>f.src===s);if(i.length===0)continue;let c=!1,a=0;for(const f of i){const y=n(f.dst);y==null||y===r?c=!0:a++}if(a===0||c)continue;let l=0,g=!1;for(const f of t.edges){if(f.dst!==s)continue;const y=n(f.src);y&&(y===r?g=!0:l++)}if(l>0||!g)continue;const x=e[s]??0,I=x+a;let u=0;for(const f of t.edges)f.dst===s&&(u=Math.max(u,(e[f.src]??0)+1));const p=Math.max(x,u,I);p!==x&&(e[s]=p)}}d(Us,"adjustCrossLaneSources");function Ws(t,e){const n=ye(t),o=Be(n)??[...n.nodes].sort(),s=e?.compactSingleInput??!1,r=fe(n);let i=Object.create(null);for(const a of o){const l=mo(n,a),g=e?.ignoreCrossLaneEdges?l.filter(x=>{const I=r(x.src),u=r(a);return!I||!u?!0:I===u}):l;if(g.length===0)i[a]=0;else if(s&&g.length===1){const x=g[0].src,I=r(x),u=r(a);I!==u?i[a]=i[x]??0:i[a]=(i[x]??0)+1}else{let x=-1/0;for(const I of g)x=Math.max(x,(i[I.src]??0)+1);i[a]=x===-1/0?0:x}}return(e?.optimizeRanksByCrossings??!1)&&(i=js(n,i)),e?.ignoreCrossLaneEdges&&Us(n,i),{layers:rn(n,i,r),rankOf:i,dummy:new Set}}d(Ws,"assignLayers_LongestPath");function Ks(t,e){const n=ye(t),s={...Ws(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=fe(n),{preds:i,succs:c}=ln(n,p=>{if(e?.ignoreCrossLaneEdges){const f=r(p.src),y=r(p.dst);if(f&&y&&f!==y)return!1}return!0}),a=Be(n)??[...n.nodes],l=[...a].reverse(),g=d((p,f)=>{let y=0;for(const E of i.get(p)??[])y=Math.max(y,(s[E]??0)+1);let v=Number.POSITIVE_INFINITY;const M=c.get(p)??[];return M.length>0&&(v=Math.min(...M.map(E=>(s[E]??0)-1))),Number.isFinite(v)||(v=Math.max(y,f)),Math.min(Math.max(f,y),v)},"clampFeasible"),x=sn.GRAVITY_ITERATIONS,I=d(p=>{let f=!1;for(const y of p){const v=i.get(y)??[],M=c.get(y)??[];if(v.length===0&&M.length===0)continue;const E=v.length>0?v.reduce((A,R)=>A+(s[R]??0)+1,0)/v.length:s[y]??0,T=M.length>0?M.reduce((A,R)=>A+(s[R]??0)-1,0)/M.length:s[y]??0,m=Math.round((E+T)/2),S=g(y,m);S!==s[y]&&(s[y]=S,f=!0)}return f},"relaxOrder");for(let p=0;p0){const y=Math.min(...f.map(v=>(s[v]??0)-1));(s[p]??0)>y&&(s[p]=y)}}return{layers:Mo(n,a,s),rankOf:s,dummy:new Set}}d(Ks,"assignLayers_Gravity");function qs(t){const e=xo(t),n=yo(t);let o=bo(e);const s=[];for(;o.length>0;){const r=[];for(const i of o){s.push(i);for(const c of n.get(i)??[])e.set(c,(e.get(c)??0)-1),(e.get(c)??0)===0&&r.push(c)}o=r.sort((i,c)=>i.localeCompare(c))}return s.length===t.nodes.length?s:null}d(qs,"topoSortByGenerationIfAcyclic");function Js(t,e){const n=ye(t),o=e?.direction==="LR"?qs(n)??[...n.nodes].sort():Be(n)??[...n.nodes].sort(),s=fe(n),r=d(g=>s(g)??g,"laneOf"),i=Object.create(null),c=new Map,a=d((g,x)=>e?.ignoreCrossLaneEdges??!0?r(g)===r(x)?1:0:1,"edgeWeight");for(const g of o){if(n.nodeById.get(g)?.isGroup)continue;const I=mo(n,g);let u=0;if(I.length>0)for(const v of I){const M=v.src,E=i[M]??0;u=Math.max(u,E+a(M,g))}const p=r(g),f=c.get(p)??0,y=Math.max(u,f);i[g]=y,c.set(p,y+1)}return{layers:Mo(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}d(Js,"assignLayers_LaneAwareCompact");function Zs(t,e){const n=ye(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let i=0;const c=new Map(n.nodeById),a=d(u=>{const p=`placeholder-${i++}`,f={id:p,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(p,f),r.add(p);s.length<=u;)s.push([]);return s[u].push(p),o[p]=u,p},"addDummyAt"),l=[...n.edges].sort((u,p)=>u.id===p.id?u.src===p.src?u.dst.localeCompare(p.dst):u.src.localeCompare(p.src):u.id.localeCompare(p.id)),g=[];for(const u of l){const p=o[u.src]??0,f=o[u.dst]??0;if(f-p<=1){g.push(u);continue}let y=u.src;for(let M=p+1,E=0;M!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:c};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:I}}d(Zs,"makeProperLayering");function Wn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(Wn,"median");function Kn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Kn,"barycenter");function Qs(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(Qs,"neighborPositionsFor");function tr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(tr,"currentOrderTieBreak");function qn(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(t),i=Ne(e),c=[];for(const l of n)o.has(l.src)&&s.has(l.dst)&&c.push({u:r.get(l.src),v:i.get(l.dst)});c.sort((l,g)=>l.u===g.u?l.v-g.v:l.u-g.u);const a=c.map(l=>l.v);return Io(a)}d(qn,"countCrossingsBetweenAdjacent");function We(t,e,n){return[...t].sort((o,s)=>{const r=Wn(e.get(o)??[]),i=Wn(e.get(s)??[]);return r===i?tr(o,s,n):isFinite(r)?isFinite(i)?r-i:-1:1})}d(We,"sortByHeuristic");function Jn(t,e,n,o,s,r){const i=Ne(t),c=Ne(e),a=Qs(e,i,n,o);if(!s||!r||r.length===0)return We(e,a,c);const l=new Map;for(const I of e){const u=s(I),p=l.get(u)??[];p.push(I),l.set(u,p)}const g=[];for(const I of r){const u=l.get(I);if(!u||u.length===0)continue;const p=We(u,a,c);g.push(...p)}const x=l.get(null);if(x&&x.length>0){const I=We(x,a,c);for(const u of I){const p=Kn(a.get(u)??[]);let f=g.length;if(isFinite(p))for(const[y,v]of g.entries()){const M=Kn(a.get(v)??[]);if(pi.has(f.src)&&c.has(f.dst)),g=a?n.filter(f=>c.has(f.src)&&a.has(f.dst)):void 0,x=d(f=>{let y=qn(t,f,l);return g&&o&&(y+=qn(f,o,g)),y},"crossingScore"),I=s?new Map:null;if(s&&I)for(const f of e)I.set(f,s(f));let u=!0,p=x(r);for(;u;){u=!1;for(let f=0;f+1[...c]),s=e.edges,r=fe(e),i=So(e,n?.laneOrder);for(let c=0;c<3;c++){for(let a=1;a=0;a--)o[a]=Jn(o[a+1],o[a],s,"up",r,i),o[a]=Zn(o[a+1],o[a],s,o[a-1],r)}return{layers:o}}d(er,"orderLayers");function nr(t,e,n){const o=n?.layerGap??ko.DEFAULT_LAYER_GAP,s=n?.nodeGap??ko.DEFAULT_NODE_GAP,r=n?.laneGap??s*2,i=n?.direction??"TB",c=i==="LR"||i==="RL",a=t.layers,l=Object.create(null),g=Object.create(null),x=d(O=>e.nodeById.get(O),"getNode"),I=d(O=>x(O)?.width??0,"getWidth"),u=d(O=>x(O)?.height??0,"getHeight"),p=fe(e),f=So(e,n?.laneOrder),y=a.map(O=>O.reduce((_,H)=>Math.max(_,u(H)),0)),v=[];if(c)for(let O=0;O+1Math.max(mt,I(kt)),0),H=a[O+1].reduce((mt,kt)=>Math.max(mt,I(kt)),0),P=y[O],G=y[O+1],j=P/2+G/2,J=(_+H)/2,dt=Math.max(0,J-j-o);v.push(dt)}const M=new Set;for(const O of a)for(const _ of O)M.add(p(_));const E=M.has(null),T=f.filter(O=>M.has(O)),m=[...E?[null]:[],...T],S=Object.create(null);for(const O of T)S[O]=0;E&&(S.null=0);for(const O of a){const _=Object.create(null),H=[];for(const P of O){const G=p(P);G===null?H.push(P):(_[G]||=[]).push(P)}for(const[P,G]of Object.entries(_)){const j=G.reduce((J,dt)=>J+I(dt),0)+s*Math.max(0,G.length-1);S[P]=Math.max(S[P]??0,j)}if(E&&H.length){const P=H.reduce((G,j)=>G+I(j),0)+s*Math.max(0,H.length-1);S.null=Math.max(S.null??0,P)}}const A=new Map;{const O=m.map(P=>(P===null?S.null:S[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,m.length-1))/2;for(let P=0;PI(Q)),kt=mt.reduce((Q,W)=>Q+W,0)+s*(J.length-1);let Pt=dt-kt/2;for(const[Q,W]of J.entries()){const et=mt[Q];l[W]=Pt+et/2,g[W]=R+H/2,Pt+=et+s}}}const G=v[O]??0;R+=H+o+G}const k=new Map;for(const O of e.edges){const _=O.ref.id;k.has(_)||k.set(_,[]),k.get(_).push(O)}for(const[,O]of k){if(O.length===0)continue;const _=O[0].ref,H=_.start,P=_.end;if(H==null||P==null)continue;const G=Math.round(((l[H]??0)+(l[P]??0))/2),j=new Set;for(const J of O)j.add(J.src),j.add(J.dst);for(const J of j){if(J===H||J===P)continue;e.nodeById.get(J)?.isDummy&&(l[J]=G)}}return{x:l,y:g}}d(nr,"assignCoordinates");var or=8;function sr(t){let e=2166136261;for(let n=0;n>>0}d(sr,"hashString");function rr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(rr,"mulberry32");function ir(t,e){const n=[...t],o=rr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(ir,"deterministicShuffle");function cr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(cr,"sourceDistance");function Qn(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:i}of e){const c=n.get(s),a=n.get(r);c==null||a==null||(o+=i*Math.abs(c-a))}return o}d(Qn,"laneArrangementCost");function ar(t){const e=fn(t);if(e.length<2)return[];const n=new Map(e.map((r,i)=>[r,i])),o=fe(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const i=typeof r.start=="string"?r.start:void 0,c=typeof r.end=="string"?r.end:void 0;if(!i||!c||!t.nodeById.has(i)||!t.nodeById.has(c))continue;const a=o(i),l=o(c);if(!a||!l||a===l)continue;const g=n.get(a),x=n.get(l);if(g==null||x==null)continue;const[I,u]=g<=x?[a,l]:[l,a],p=`${I}\0${u}`,f=s.get(p);f?f.weight++:s.set(p,{a:I,b:u,weight:1})}return[...s.values()]}d(ar,"buildWeightedLaneEdges");function to(t,e,n){const o=[...t];let s=Qn(o,e),r=!0,i=0;const c=Math.max(1,o.length);for(;r&&is.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:i})=>`${s}:${r}:${i}`).join("|");return sr(`${t.join("|")}#${o}#${n}`)}d(fr,"seedForRestart");function dr(t,e={}){const n=fn(t);if(n.length<2)return n;const o=ar(t);if(o.length===0)return n;const s=new Map(n.map((c,a)=>[c,a]));let r=to(n,o,s);const i=Math.max(0,e.restarts??or);for(let c=0;cct&&a*3>=c?i>0?"bottom":"top":c>ct?r>0?"right":"left":n}d(eo,"chooseOrthogonalSide");function no(t,e){return Math.abs(t.to-e.from)h.isGroup&&!h.parentId);for(const h of l){const b={id:h.id},C=d(L=>{i.set(L.id,b),n.filter(w=>w.parentId===L.id).forEach(C)},"assignLane");C(h)}const g=n.filter(h=>!h.isGroup&&!h.isEdgeLabel).map(h=>{const b=h.width??10,C=h.height??10,L=h.x??0,w=h.y??0,B=Zr;return{nodeId:h.id,minX:L-b/2-B,maxX:L+b/2+B,minY:w-C/2-B,maxY:w+C/2+B,visualXHalfExtent:a?C/2+B:b/2+B}}),x=d((h,b,C,L)=>{let w=c.find(B=>B.orientation===h&&Math.abs(B.coord-b)<1);return w||(w={id:`pipe-${h}-${b.toFixed(0)}`,orientation:h,coord:b,spanMin:C,spanMax:L,tracks:[]},c.push(w)),w.spanMin=Math.min(w.spanMin,C),w.spanMax=Math.max(w.spanMax,L),w},"getOrAddPipe"),I=d((h,b)=>{const C=h.width??10,L=h.height??10,w=h.x??0,B=h.y??0;switch(b){case"top":return{x:w,y:B-L/2};case"bottom":return{x:w,y:B+L/2};case"left":return{x:w-C/2,y:B};case"right":return{x:w+C/2,y:B}}},"portForSide"),u=d((h,b,C)=>I(h,eo(h,b,C?"bottom":"top")),"getOrthogonalPort"),p=[],f=[],y=new Set,v=1e3,M=d((h,b,C)=>{if(p.length===0)return 0;const L=Math.abs(b.y-C.y)z||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}else if(w){const U=b.x,q=Math.min(b.y,C.y)-ct,z=Math.max(b.y,C.y)+ct;if(z<=q)return 0;for(const Y of p)Y.edgeIndex===h||Y.orientation!=="horizontal"||Y.pipe.coordz||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}return B},"crossingPenalty"),E=s.map((h,b)=>{if(!h.start||!h.end)return{idx:b,crossLane:0,dx:0,dy:0};const C=r.get(h.start),L=r.get(h.end),w=i.get(h.start),B=i.get(h.end),U=w&&B&&w.id!==B.id?1:0,q=C&&L?Math.abs((L.x??0)-(C.x??0)):0,z=C&&L?Math.abs((L.y??0)-(C.y??0)):0;return{idx:b,crossLane:U,dx:q,dy:z}}).sort((h,b)=>{if(h.crossLane!==b.crossLane)return b.crossLane-h.crossLane;const C=h.dx+h.dy,L=b.dx+b.dy;return Math.abs(C-L)>1?C-L:h.idx-b.idx}).map(h=>h.idx),T=d((h,b,C,L)=>{const w=Math.min(h.x,b.x),B=Math.max(h.x,b.x),U=Math.min(h.y,b.y),q=Math.max(h.y,b.y);return!!g.find(Y=>C&&Y.nodeId===C||L&&Y.nodeId===L?!1:Math.abs(h.x-b.x)>ct?Y.minYh.y&&Y.maxX>w&&Y.minXh.x&&Y.maxY>U&&Y.minYeo(h,b,"bottom"),"determineSide"),R=new Map;for(const[h,b]of s.entries()){if(!b.start||!b.end||b.start===b.end||b.points&&b.points.length>0)continue;const C=r.get(b.start),L=r.get(b.end);if(!C||!L)continue;const w=(L.x??0)-(C.x??0),B=(L.y??0)-(C.y??0);R.set(h,{edgeIdx:h,srcId:b.start,dstId:b.end,srcSide:A(C,{x:L.x??0,y:L.y??0}),dstSide:A(L,{x:C.x??0,y:C.y??0}),absDx:Math.abs(w),absDy:Math.abs(B),dxSign:Math.sign(w),dySign:Math.sign(B)})}const k=d(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.absDx===0?1/0:h.absDy/h.absDx:h.absDy===0?1/0:h.absDx/h.absDy,"preferenceStrength"),O=d(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.dxSign>=0?"right":"left":h.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const h of R.values()){const b=`${h.srcId}:${h.srcSide}`;_.has(b)||_.set(b,[]),_.get(b).push(h)}const H=new Map,P=d((h,b)=>`${h}:${b}`,"loadKey");for(const h of R.values())H.set(P(h.srcId,h.srcSide),(H.get(P(h.srcId,h.srcSide))??0)+1),H.set(P(h.dstId,h.dstSide),(H.get(P(h.dstId,h.dstSide))??0)+1);for(const h of _.values())if(!(h.length<2)){h.sort((b,C)=>{const L=k(b),w=k(C);return Math.abs(L-w)>1e-9?w-L:b.edgeIdx-C.edgeIdx});for(let b=1;b=w||(H.set(P(C.srcId,C.srcSide),w-1),H.set(P(C.srcId,L),B+1),C.srcSide=L)}}const G=d(h=>{const b=h?.shape;return b==="question"||b==="diamond"},"isDiamondNode"),j=new Map;for(const h of R.values())j.has(h.dstId)||j.set(h.dstId,new Set),j.get(h.dstId).add(h.dstSide);for(const h of R.values()){if(!G(r.get(h.srcId)))continue;const b=j.get(h.srcId);if(!b?.has(h.srcSide))continue;const C=O(h);if(b.has(C)||(H.get(P(h.srcId,C))??0)>0)continue;const L=H.get(P(h.srcId,h.srcSide))??0;H.set(P(h.srcId,h.srcSide),Math.max(0,L-1)),H.set(P(h.srcId,C),1),h.srcSide=C}for(const h of R.values()){const{edgeIdx:b,srcId:C,dstId:L,srcSide:w,dstSide:B}=h,U=r.get(C),q=r.get(L),z=`${C}:${w}:src`,Y=w==="top"||w==="bottom"?q.x??0:q.y??0;m.has(z)||m.set(z,[]),m.get(z).push({edgeIdx:b,oppositeCoord:Y});const ot=`${L}:${B}:dst`,rt=B==="top"||B==="bottom"?U.x??0:U.y??0;m.has(ot)||m.set(ot,[]),m.get(ot).push({edgeIdx:b,oppositeCoord:rt})}const J=new Map,dt=8;for(const[h,b]of m){if(b.length<2)continue;b.sort((Lt,Dt)=>Lt.oppositeCoord-Dt.oppositeCoord);const C=h.split(":"),L=C.slice(0,-2).join(":"),w=C[C.length-2],B=C[C.length-1],U=r.get(L);if(!U)continue;const z=w==="left"||w==="right"?U.height??10:U.width??10,Y=U.shape,rt=Y==="question"||Y==="diamond"?z*.3:z,tt=Math.min(20,Math.max(dt,rt/(b.length+1))),Rt=-(tt*(b.length-1))/2;for(const[Lt,Dt]of b.entries()){const Jt=Rt+Lt*tt,gn=`${Dt.edgeIdx}:${B}`;J.set(gn,Jt)}}const mt=d(h=>!!s[h]?.labelNodeId,"edgeHasLabelNode"),kt=d((h,b)=>h?(m.get(`${h}:${b}:src`)??[]).some(({edgeIdx:C})=>mt(C))||(m.get(`${h}:${b}:dst`)??[]).some(({edgeIdx:C})=>mt(C)):!1,"faceHasLabelNode"),Pt=d((h,b,C)=>b==="top"||b==="bottom"?{x:h.x+C,y:h.y}:{x:h.x,y:h.y+C},"applyPortOffset"),Q=d((h,b,C)=>{const L=R.get(h),w={x:C.x??0,y:C.y??0},B={x:b.x??0,y:b.y??0},U=L?.srcSide??A(b,w),q=L?.dstSide??A(C,B);let z=L?I(b,L.srcSide):u(b,w,!0),Y=L?I(C,L.dstSide):u(C,B,!1);const ot=J.get(`${h}:src`),rt=J.get(`${h}:dst`);return ot!==void 0&&(z=Pt(z,U,ot)),rt!==void 0&&(Y=Pt(Y,q,rt)),{pSrcPort:z,pDstPort:Y,srcSide:U,dstSide:q}},"portsForEdge");for(const h of E){const b=s[h];if(f[h]=[],!b.start||!b.end||b.points&&b.points.length>0||b.start===b.end)continue;const C=r.get(b.start),L=r.get(b.end);if(!C||!L)continue;const{pSrcPort:w,pDstPort:B,srcSide:U,dstSide:q}=Q(h,C,L),z={...w},Y={...B},ot=U==="top"||U==="bottom",rt=q==="top"||q==="bottom";if(ot){const X=w.y>(C.y??0);z.y=X?w.y+ne:w.y-ne}else{const X=w.x>(C.x??0);z.x=X?w.x+ne:w.x-ne}if(rt){const X=B.y>(L.y??0);Y.y=X?B.y+ne:B.y-ne}else{const X=B.x>(L.x??0);Y.x=X?B.x+ne:B.x-ne}const st=d((X,$)=>{for(const K of g)if(!$.includes(K.nodeId)&&X.x>K.minX&&X.xK.minY&&X.y{if(Ct){const Nt=X.y>($.y??0);return{x:(K.x??0)>=X.x?lt.maxX+be:lt.minX-be,y:Nt?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:Nt}}const bt=X.x>($.x??0),Et=(K.y??0)>=X.y;return{x:bt?lt.maxX+be:lt.minX-be,y:Et?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:bt}},"obstacleDetour");let yt=[];const Rt=[b.start,b.end],Lt=st(z,Rt);if(Lt.inside&&Lt.obstacle){const X=Lt.obstacle;if(ot){const $=tt(w,C,L,X,!0);z.x=$.x,z.y=$.y;const K=$.leavesPositiveSide?Math.min(X.minY-2,w.y+ne):Math.max(X.maxY+2,w.y-ne);yt=[{x:w.x,y:K},{x:$.x,y:K},{x:$.x,y:$.y}]}else{const $=tt(w,C,L,X,!1),K=$.leavesPositiveSide?Math.min(X.minX-2,w.x+ne):Math.max(X.maxX+2,w.x-ne);z.x=$.x,z.y=$.y,yt=[{x:K,y:w.y},{x:K,y:$.y},{x:$.x,y:$.y}]}}let Dt=[];const Jt=st(Y,Rt);if(Jt.inside&&Jt.obstacle){const X=Jt.obstacle;if(rt){const $=tt(B,L,C,X,!0);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:B.x,y:$.y}]}else{const $=tt(B,L,C,X,!1);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:$.x,y:B.y}]}}if(yt.length===0&&Dt.length===0){const X=be,$=Math.abs(z.x-Y.x)1||bt>1,Nt=S.get(b.start??"")??0,ut=S.get(b.end??"")??0,Yt=Ct>1&&kt(b.start,U)||bt>1&&kt(b.end,q),ee=Ct<=1||Nt<=2,Bt=bt<=1||ut<=2;if(($||K)&&!lt&&(!Et||Et&&!Yt&&ee&&Bt)&&!T(w,B,b.start,b.end)){b.points=[{...w},{...z},{...Y},{...B}],y.add(h);const Mt=K?"horizontal":"vertical",$t=K?w.y:w.x,It=K?Math.min(w.x,B.x):Math.min(w.y,B.y),St=K?Math.max(w.x,B.x):Math.max(w.y,B.y),Wt={id:`fast-path-${Mt}-${$t.toFixed(0)}-${h}`,orientation:Mt,coord:$t,spanMin:It,spanMax:St,tracks:[]};p.push({edgeIndex:h,segmentIndex:0,orientation:Mt,pipe:Wt,trackIndex:0,from:It,to:St});continue}}const gn=x("vertical",z.x,z.y,z.y);z.x=gn.coord;const mr=x("vertical",Y.x,Y.y,Y.y);Y.x=mr.coord;let ue=Math.min(z.x,Y.x)-50,he=Math.max(z.x,Y.x)+50,ve=Math.min(z.y,Y.y)-50,Le=Math.max(z.y,Y.y)+50;for(const X of g){const $=Math.min(z.x,Y.x),K=Math.max(z.x,Y.x),lt=Math.min(z.y,Y.y),Ct=Math.max(z.y,Y.y);X.minX$&&X.minYlt&&(ue=Math.min(ue,X.minX-je),he=Math.max(he,X.maxX+je),ve=Math.min(ve,X.minY-je),Le=Math.max(Le,X.maxY+je))}for(const X of g){if(X.maxXhe||X.maxYLe)continue;const $=be;x("horizontal",X.minY-$,ue,he),x("horizontal",X.maxY+$,ue,he);const K=Te;x("vertical",X.minX-K,ve,Le),x("vertical",X.maxX+K,ve,Le)}x("horizontal",z.y,ue,he),x("horizontal",Y.y,ue,he);const yr=c.filter(X=>X.orientation==="horizontal"&&X.coord>=ve&&X.coord<=Le),xr=c.filter(X=>X.orientation==="vertical"&&X.coord>=ue&&X.coord<=he),ke=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),_e=ke(z.x,z.y),vo=ke(Y.x,Y.y),Fe=new Map,pn=new Map,mn=new Map,De=new Set,xe=[];Fe.set(_e,0),mn.set(_e,"n"),xe.push({key:_e,f:Math.hypot(Y.x-z.x,Y.y-z.y),pt:z}),De.add(_e);let Ht=[];const ge=d((X,$)=>T(X,$,b.start,b.end),"checkSegmentBlocked"),yn={x:Y.x,y:z.y},br=ge(z,yn),Mr=ge(yn,Y),Ir=br||Mr,xn={x:z.x,y:Y.y},Sr=ge(z,xn),Cr=ge(xn,Y);if(Ir?Sr||Cr||(Math.abs(z.x-Y.x)0;){xe.sort((ut,Yt)=>ut.f-Yt.f);const X=xe.shift();if(De.delete(X.key),X.key===vo){let ut=vo,Yt=Y;for(Ht=[Yt];pn.has(ut);){const ee=pn.get(ut);Ht.unshift(ee),Yt=ee,ut=ke(ee.x,ee.y)}break}const $=X.pt.x,K=X.pt.y,lt=xr.sort((ut,Yt)=>ut.coord-Yt.coord),Ct=lt.findIndex(ut=>Math.abs(ut.coord-$)<1),bt=yr.sort((ut,Yt)=>ut.coord-Yt.coord),Et=bt.findIndex(ut=>Math.abs(ut.coord-K)<1),Nt=[];Ct>0&&Nt.push({x:lt[Ct-1].coord,y:K}),Ct>=0&&Ct0&&Nt.push({x:$,y:bt[Et-1].coord}),Et>=0&&EtZt.nodeId===b.start||Zt.nodeId===b.end?!1:Yt!==ee?Zt.minYK&&Zt.maxX>Yt&&Zt.minX$&&Zt.maxY>Bt&&Zt.minY10&&bn<-5||Ee<-10&&bn>5)&&(St=Math.abs(bn)*100),(Wt>10&&He<-5||Wt<-10&&He>5)&&(St+=Math.abs(He)*50);let Lo=0;const Eo=mn.get(X.key)??"n",To=Math.abs(He)>ct?"h":"v";Eo!=="n"&&Eo!==To&&(Lo=50);const vr=$t+It+St+Lo,Xe=(Fe.get(X.key)??1/0)+vr,wo=Math.abs(Y.x-ut.x)+Math.abs(Y.y-ut.y);if(Xe<(Fe.get(Mt)??1/0))if(pn.set(Mt,X.pt),Fe.set(Mt,Xe),mn.set(Mt,To),!De.has(Mt))xe.push({key:Mt,f:Xe+wo,pt:ut}),De.add(Mt);else{const Zt=xe.findIndex(Lr=>Lr.key===Mt);Zt!==-1&&(xe[Zt].f=Xe+wo)}}}if(Ht.length===0&&(Ht=[z,{x:z.x,y:Y.y},Y]),Ht.length>4){const X=Ht[0],$=Ht[Ht.length-1];let K=Math.min(X.x,$.x),lt=Math.max(X.x,$.x),Ct=Math.min(X.y,$.y),bt=Math.max(X.y,$.y);for(const Bt of Ht)K=Math.min(K,Bt.x),lt=Math.max(lt,Bt.x),Ct=Math.min(Ct,Bt.y),bt=Math.max(bt,Bt.y);const Et=lt>Math.max(X.x,$.x),Nt=KIt.minXGt&&It.minYOt);if($t.length>0){let It=Math.max(X.x,$.x);for(const St of $t){const Wt=(St.minX+St.maxX)/2;if(St.visualXHalfExtent===void 0||isNaN(St.visualXHalfExtent))continue;const Ee=Wt+St.visualXHalfExtent+Bt;It=Math.max(It,Ee)}isNaN(It)||(lt=It)}}if(Nt){const Gt=g.filter(Ot=>Ot.minXMath.min(X.y,$.y));if(Gt.length>0){let Ot=Math.min(X.x,$.x);for(const Mt of Gt){const It=(Mt.minX+Mt.maxX)/2-Mt.visualXHalfExtent-Bt;Ot=Math.min(Ot,It)}K=Ot}}}const ut=d(Bt=>{const Gt=$.y>X.y,Ot=g.filter(It=>{const St=Math.min(X.x,$.x)It.minX,Wt=Math.min(X.y,$.y)It.minY;return St&&Wt});let Mt=Ot;if(a&&Ot.length>0){const It=Ot.filter(St=>St.minXBt);It.length>0&&(Mt=It)}if(Mt.length===0)return $.y;const $t=be;if(Gt){const St=Math.max(...Mt.map(Wt=>Wt.maxY))+$t;if(St<$.y-ct)return St}else{const St=Math.min(...Mt.map(Wt=>Wt.minY))-$t;if(St>$.y+ct)return St}return $.y},"findBestReturnY"),Yt=d(Bt=>{const Gt=ut(Bt),Ot={x:Bt,y:X.y},Mt={x:Bt,y:Gt},$t={x:$.x,y:Gt},It=ge(X,Ot),St=ge(Ot,Mt),Wt=ge(Mt,$t),Ee=Gt!==$.y?ge($t,$):!1;return!It&&!St&&!Wt&&!Ee?Math.abs(Gt-$.y)=3){const X=Xt[Xt.length-1],$=Xt[Xt.length-2],K=Xt[Xt.length-3],lt=Math.abs(K.y-$.y)Math.abs(X.x-K.x)&&Xt.splice(-2,1)}else if(Ct){const bt=Math.sign($.y-K.y),Et=Math.sign(X.y-K.y);bt!==0&&bt===Et&&Math.abs($.y-K.y)>Math.abs(X.y-K.y)&&Xt.splice(-2,1)}}const ie=[Xt[0]];for(let X=1;X$.x,bt=lt.x>K.x;if(Ct!==bt){ie.push(K);continue}continue}if(Math.abs($.x-K.x)$.y,bt=lt.y>K.y;if(Ct!==bt){ie.push(K);continue}continue}ie.push(K)}ie.push(Xt[Xt.length-1]);for(let X=0;Xh.from{const w=!L.segments.some(U=>(U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex)&&W(U,h)),B=!C.segments.some(U=>(U.edgeIndex!==h.edgeIndex||U.segmentIndex!==h.segmentIndex)&&W(U,b));return w&&B?(h.trackIndex=L.index,b.trackIndex=C.index,C.segments=[...C.segments.filter(U=>U.edgeIndex!==h.edgeIndex||U.segmentIndex!==h.segmentIndex),{edgeIndex:b.edgeIndex,segmentIndex:b.segmentIndex,from:b.from,to:b.to}],L.segments=[...L.segments.filter(U=>U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex),{edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to}],!0):!1},"trySwapSegmentsAcrossTracks"),at=d(h=>{const b=h.tracks.length;return h.tracks[b]={index:b,coord:h.coord,segments:[]},b},"createNewTrack"),gt=d((h,b)=>{const C=h.pipe.tracks[h.trackIndex];C.segments=C.segments.filter(w=>w.edgeIndex!==h.edgeIndex||w.segmentIndex!==h.segmentIndex),h.trackIndex=b,h.pipe.tracks[b].segments.push({edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to})},"moveSegmentToTrack"),xt=d((h,b)=>{const C=f[h.edgeIndex];for(const L of C){const w=p[L];w.pipe===h.pipe&>(w,b)}},"moveSegmentChainToTrack"),vt=d(h=>{const b=f[h.edgeIndex],C=b.indexOf(p.indexOf(h)),L=[];return C>0&&L.push(p[b[C-1]]),C{if(h.orientation===b.orientation)return!1;const C=h.orientation==="horizontal"?h:b,L=h.orientation==="horizontal"?b:h;return L.pipe.coord>C.from&&L.pipe.coordL.from&&C.pipe.coord{for(const C of h.tracks)if(!C.segments.some(w=>(w.edgeIndex!==b.edgeIndex||w.segmentIndex!==b.segmentIndex)&&W(w,b)))return C.index;return-1},"findAvailableTrack"),Ut=d((h,b)=>{if(h.trackIndex===b.trackIndex)return W(h,b);const C=vt(h),L=vt(b);return C.some(w=>L.some(B=>Vt(w,B)))},"segmentsConflict"),te=d((h,b,C)=>{if(et(h,b,h.pipe.tracks[h.trackIndex],b.pipe.tracks[b.trackIndex]))return;const L=jt(h.pipe,b);C(b,L!==-1?L:at(h.pipe))},"resolveTrackConflict"),Se=d(h=>{let b=0;for(let C=0;C{if(de.has(h))return de.get(h);const b=f[h];if(b.length===0){const q={dest:0,deviation:0,base:0,delta:0};return de.set(h,q),q}const L=p[b[0]].pipe.coord;let w=L;for(let q=1;qMath.abs(ot-L)?Y:ot;break}}const B=Math.abs(w-L),U={dest:w,deviation:B,base:L,delta:w-L};return de.set(h,U),U},"getDestInfo"),dn=d(()=>{let h=0;const b=new Map;for(const[L,w]of s.entries())f[L].length!==0&&w.start&&(b.has(w.start)||b.set(w.start,[]),b.get(w.start).push(L));const C=d(L=>{const w=s[L];if(!w.start||!w.end)return 0;const B=r.get(w.start),U=r.get(w.end);if(!B||!U)return 0;const q=(U.x??0)-(B.x??0),z=(U.y??0)-(B.y??0);return Math.abs(q)+Math.abs(z)},"getEdgeDistance");for(const L of b.values()){L.sort((B,U)=>{const q=Ce(B),z=Ce(U);if(Math.abs(q.deviation-z.deviation)>1)return q.deviation-z.deviation;if(Math.abs(q.dest-z.dest)>1)return q.dest-z.dest;const Y=C(B),ot=C(U);if(Math.abs(Y-ot)>1)return ot-Y;const rt=f[B].length,st=f[U].length;if(rt!==st)return rt-st;if(rt===1){const tt=f[B][0],yt=f[U][0];if(p[tt]&&p[yt]){const Rt=p[tt],Lt=p[yt],Dt=Math.abs(Rt.to-Rt.from),Jt=Math.abs(Lt.to-Lt.from);if(Math.abs(Dt-Jt)>1)return Dt-Jt}}return 0});const w=L.map(B=>p[f[B][0]]);h+=Se(w)}return h},"fixSourceHandleCrossings"),un=d(()=>{let h=0;const b=new Map;for(const[C,L]of s.entries())f[C].length!==0&&L.end&&(b.has(L.end)||b.set(L.end,[]),b.get(L.end).push(C));for(const C of b.values()){C.sort((w,B)=>{const U=d(Y=>{const ot=f[Y];if(ot.length<2)return 0;const rt=p[ot[ot.length-2]];return Math.abs(rt.to-rt.from)},"getDist"),q=U(w),z=U(B);return Math.abs(q-z)>.1?q-z:w-B});const L=C.map(w=>p[f[w][f[w].length-1]]);h+=Se(L)}return h},"fixTargetHandleCrossings"),hn=d(()=>{let h=0;for(const b of c){const C=[];for(const L of b.tracks)for(const w of L.segments){const B=f[w.edgeIndex].find(U=>p[U].segmentIndex===w.segmentIndex);B!==void 0&&C.push(p[B])}C.sort((L,w)=>L.edgeIndex-w.edgeIndex||L.segmentIndex-w.segmentIndex);for(let L=0;L{L.segments.forEach(w=>{b.push({edgeIndex:w.edgeIndex,segmentIndex:w.segmentIndex,trackIndex:L.index,from:w.from,to:w.to})})}),b.sort((L,w)=>L.from-w.from);const C=[];if(b.length>0){let L=[b[0]],w=b[0].to;for(let B=1;Bw.add(tt.trackIndex));const B=new Map;L.forEach(tt=>{const yt=Ce(tt.edgeIndex);B.set(tt.trackIndex,(B.get(tt.trackIndex)??0)+yt.delta)});const U=[...w].filter(tt=>(B.get(tt)??0)<-1),q=[...w].filter(tt=>(B.get(tt)??0)>1),z=[...w].filter(tt=>Math.abs(B.get(tt)??0)<=1);U.sort((tt,yt)=>(B.get(yt)??0)-(B.get(tt)??0)),q.sort((tt,yt)=>(B.get(tt)??0)-(B.get(yt)??0));const Y=d((tt,yt)=>{L.filter(Rt=>Rt.trackIndex===tt).forEach(Rt=>{const Lt=y.has(Rt.edgeIndex)?h.coord:yt;D.set(`${Rt.edgeIndex}-${Rt.segmentIndex}`,Lt)})},"assignCoord");let ot=0;for(const tt of U)ot++,Y(tt,h.coord-ot*Cn);if(z.length===0&&w.size>0){const tt=[...w].sort((Lt,Dt)=>Math.abs(B.get(Lt)??0)-Math.abs(B.get(Dt)??0))[0],yt=U.indexOf(tt);yt!==-1&&U.splice(yt,1);const Rt=q.indexOf(tt);Rt!==-1&&q.splice(Rt,1),z.push(tt)}let rt=0;for(const tt of z){if(rt===0)Y(tt,h.coord);else{const yt=rt%2===1?1:-1,Rt=Math.ceil(rt/2);Y(tt,h.coord+yt*Rt*Cn*.5)}rt++}let st=0;for(const tt of q)st++,Y(tt,h.coord+st*Cn)}}for(const[h,b]of s.entries()){const C=f[h]??[];if(C.length===0)continue;const L=[],w=r.get(b.start),B=r.get(b.end),{pSrcPort:U,pDstPort:q}=Q(h,w,B),z=C.map(rt=>{const st=p[rt],tt=D.get(`${st.edgeIndex}-${st.segmentIndex}`)??st.pipe.coord;return{orient:st.orientation,coord:tt,from:st.from,to:st.to}});L.push(U);for(let rt=0;rtct&&L.push(Me(st,yt)),Dt&&Lt.orient===st.orient)if(Math.abs(st.coord-Lt.coord)>ct){const Jt=st.orient==="vertical"?(yt+Lt.from)/2:no(st,Lt);L.push(Me(st,Jt),Me(Lt,Jt))}else(rt===0||rt===z.length-2)&&L.push(Me(st,no(st,Lt)));else if(Dt)L.push(Me(st,Lt.coord));else{const Jt=Math.abs(st.from-yt)ct||Math.abs(Y.y-q.y)>ct)&&L.push(q);const ot=[];L.length>0&&ot.push(L[0]);for(let rt=1;rtct||Math.abs(st.y-tt.y)>ct)&&ot.push(st)}b.points=ot}for(const h of s){const b=h.__originalEdge;b&&h.points&&(b.points=h.points)}t.edges=(t.edges??[]).filter(h=>!h.isLayoutOnly);const V=d((h,b)=>{const C=b.x??0,L=b.y??0,w=b.width??0,B=b.height??0;if(w<=0||B<=0)return h;const U=C-w/2,q=C+w/2,z=L-B/2,Y=L+B/2;if(h.xq||h.yY)return h;const ot=h.x-U,rt=q-h.x,st=h.y-z,tt=Y-h.y,yt=Math.min(ot,rt,st,tt);return yt===ot?{x:U,y:h.y}:yt===rt?{x:q,y:h.y}:yt===st?{x:h.x,y:z}:{x:h.x,y:Y}},"nodeBoundaryClamp");for(const h of t.edges){const b=h.points;if(!b||b.length<2)continue;const C=h.start,L=h.end,w=C?r.get(C):void 0,B=L?r.get(L):void 0;w&&(b[0]=V(b[0],w)),B&&(b[b.length-1]=V(b[b.length-1],B))}return t}d(hr,"routeEdgesOrthogonal");function gr(t){return t.direction??"TB"}d(gr,"getSwimlaneDirection");function pr(t){const e=Jo(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,s=t.config.swimlane?.ignoreCrossLaneEdges??!0,r=t.config.swimlane?.optimizeRanksByCrossings??!0,i=t.config.swimlane?.automaticLaneOrdering??!1,c=gr(t),{ordered:a,coordinates:l}=ur(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:i,direction:c});Zo(e,a,l,{nodeGap:n,layerGap:o});for(const g of t.edges??[])delete g.points;hr(t,c);for(const g of t.edges??[])(!g.curve||g.curve==="basis")&&(g.curve="rounded");return Rs(t,c),As(t),c}d(pr,"runSwimlaneLayoutCore");async function Qr(t,e){const n=e.select("g");wr(n,t.markers,t.type,t.diagramId),Ar(),Rr(),Nr(),Tr(),qo(t);const o=Qo(t);t.nodes=o.nodes,t.edges=o.edges;const{groups:s}=await _o(n,t);pr(t),await Uo(t,s)}d(Qr,"render");export{Qr as render}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-X5ZJPWSS-C2SuSg-g.js","assets/mermaid.core-XMN3hSDH.js","assets/index-ChnXJINq.js","assets/index-QkzZp0Kk.css","assets/_commonjsHelpers-CqkleIqs.js"])))=>i.map(i=>d[i]); +import{bR as Er}from"./index-ChnXJINq.js";import{c as Tr}from"./chunk-RYQCIY6F-8FUQcOpv.js";import{am as wr,an as Ar,ao as Rr,ap as Nr,l as Ke,c as Or,ag as Pr,af as Br,ah as kr,at as _r,av as Fr,y as Dr,as as Hr,aw as Xr,x as Oe,ax as Ye,_ as d,ay as Ao}from"./mermaid.core-XMN3hSDH.js";import{G as Yr}from"./graph-DOmOIIwC.js";import"./map-DxJ2ADlA.js";import"./_commonjsHelpers-CqkleIqs.js";async function _o(t,e){const n=new Yr({multigraph:!0,compound:!0}),o=[...e.edges],s=Or(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),c=r.insert("g").attr("class","edges edgePath"),a=r.insert("g").attr("class","edgeLabels"),l=r.insert("g").attr("class","nodes"),g=new Map,x=t.node()!=null;await Promise.all(e.nodes.map(async I=>{if(I.isGroup)n.setNode(I.id,{...I});else{if(x){const u=await Pr(l,I,{config:s,dir:I.dir}),p=u.node()?.getBBox()??{width:0,height:0};g.set(I.id,u),I.width=p.width,I.height=p.height}n.setNode(I.id,{...I})}}));for(const I of o)n.setEdge(I.start,I.end,{...I},I.id),e.edges.some(p=>p.id===I.id)||e.edges.push(I);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:I}=await Er(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS-C2SuSg-g.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2,3,4]));I(t,e)}return{graph:n,groups:{clusters:i,edgePaths:c,edgeLabels:a,nodes:l,rootGroups:r},nodeElements:g}}d(_o,"createGraphWithElements");var Ro=5,Ge=1e-5,$e=1e-6;function qe(t){const e=[];for(let n=0;n=1-$e||I<=$e||I>=1-$e?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:I}}d(Fo,"segmentIntersection");function vn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(vn,"isHorizontalSeg");function Do(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Ho,"getArcSweepFlag");var Gr=.001;function Xo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Ao[e.arrowTypeStart];if(o){const r=t[0],i=t[1],c=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(c),n[0].y=r.y+o*Math.sin(c)}const s=e.arrowTypeEnd&&Ao[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],c=t[r-1],a=Math.atan2(c.y-i.y,c.x-i.x);n[r-1].x=c.x-s*Math.cos(a),n[r-1].y=c.y-s*Math.sin(a)}return n}d(Xo,"applyMarkerOffsets");function Yo(t,e,n,o,s){const r=t.point.x,i=t.point.y,c={x:r-e*t.r,y:i-n*t.r},a={x:r+e*t.r,y:i+n*t.r},l=[`L${we(c)}`];return s==="arc"?l.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${we(a)}`):l.push(`M${we(a)}`),l}d(Yo,"emitJump");function Ln(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,c=n.y-e.y,a=Math.hypot(s,r),l=Math.hypot(i,c);if(a0){const E=Ln(s[l-1],s[l],s[l+1]??s[l],Ro);E&&(f=E.cutLen)}let y=x,v=null;r&&lE.t-T.t);for(const E of M)E.r=Math.min(E.r,E.d-f,y-E.d);for(let E=0;ET){const m=T/2;M[E].r=Math.min(M[E].r,m),M[E+1].r=Math.min(M[E+1].r,m)}}for(const E of M)E.r=2?o:null}catch{return null}}d(Vo,"decodeDataPoints");function jo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const l of e)s.set(l.id,l);const r=[],i=new Map;for(const l of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(l.id):l.id,x=o.querySelector(`path[data-id="${g}"]`);if(!x)continue;i.set(l.id,x);const u=Vo(x.getAttribute("data-points"))??l.points;r.push({...l,points:u})}const c=Do(r);if(c.length===0)return;const a=new Map;for(const l of c){const g=a.get(l.jumpEdgeId)??[];g.push(l),a.set(l.jumpEdgeId,g)}for(const l of r){const g=a.get(l.id);if(!g||g.length===0)continue;const I=s.get(l.id)?.curve;if(I!==void 0&&!zo(I))continue;const u=i.get(l.id);if(!u)continue;if(I===void 0){const E=u.getAttribute("d")??"";if(!$o(E))continue}const p=u.getAttribute("style")??"",f=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(p),y=f?Number.parseFloat(f[1]):null,v=f?Number.parseFloat(f[2]):null,M=Go(l,g,n);if(u.setAttribute("d",M),y!==null&&v!==null&&typeof u.getTotalLength=="function"){const E=u.getTotalLength(),T=Math.max(0,E-y-v),m=`0 ${y} ${T} ${v}`,S=p.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${m};`).replace(/;\s*;+/g,";");u.setAttribute("style",S)}}}d(jo,"applyLineJumpsToSvg");async function Uo(t,e){for(const s of t.nodes)s.isGroup?await Br(e.clusters,s):kr(s);const n=new Map;for(const s of t.nodes)s?.id&&n.set(s.id,s);for(const s of t.edges){const r=s.start?n.get(s.start)??{}:{},i=s.end?n.get(s.end)??{}:{},c=_r(e.edgePaths,{...s},{},t.type,r,i,t.diagramId);s.label&&await Fr(e.rootGroups,s),s.label&&Wo(s,c)}const o=t.config?.swimlane?.lineHops;if(o!==!1){const s=o==="gap"?"gap":"arc",r=t.edges.filter(i=>Array.isArray(i.points)&&i.points.length>=2).map(i=>({id:i.id,points:i.points,curve:i.curve,arrowTypeStart:i.arrowTypeStart,arrowTypeEnd:i.arrowTypeEnd}));jo(e.edgePaths,r,{enabled:!0,jumpRadius:6,jumpStyle:s})}}d(Uo,"adjustLayout");function Wo(t,e){const n=e?.updatedPath??e?.originalPath,o=Dr(),{subGraphTitleTotalMargin:s}=Hr({flowchart:o.flowchart??{}});if(t.label){const r=Xr.get(t.id);let i=t.x,c=t.y;if(n){const a=Oe.calcLabelPosition(n);Ke.debug("Moving label "+t.label+" from (",i,",",c,") to (",a.x,",",a.y,") abc88"),e&&(i=a.x,c=a.y)}r.attr("transform",`translate(${i}, ${c+s/2})`)}if(t?.startLabelLeft){const r=Ye.get(t.id).startLeft;let i=t?.x,c=t?.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.startLabelRight){const r=Ye.get(t.id).startRight;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.endLabelLeft){const r=Ye.get(t.id).endLeft;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.endLabelRight){const r=Ye.get(t.id).endRight;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}}d(Wo,"positionEdgeLabel");var Mn="__swimlane_default__",$r=21,No=20;function En(t){return Math.max(t.padding??No,No)}d(En,"topLaneHorizontalPadding");function Ko(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const i=n-s/2,c=Math.min(r,n+s/2),a=Math.min($r,Math.max(0,c-i)),l=i+a;if(l<=i){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:l}}d(Ko,"assignTopLaneTitleRect");function qo(t){const e=t.direction,n=t.nodes??=[];for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===Mn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:Mn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=Mn}d(qo,"prepareLayoutForSwimlanes");function Jo(t){const e=new Map;for(const a of t.nodes??[])e.set(a.id,a);const n=[];for(const a of t.edges??[]){const l=typeof a.start=="string"?a.start:void 0,g=typeof a.end=="string"?a.end:void 0;!l||!g||a.labelNodeId||n.push({id:a.id,src:l,dst:g,ref:a})}const o=t.nodes??[],s=o.filter(a=>a.isGroup),r=o.filter(a=>!a.isGroup);return{nodes:[...[...s].reverse(),...r].map(a=>a.id),edges:n,layout:t,nodeById:e}}d(Jo,"toGraphView");function Zo(t,e,n,o){const{layout:s}=t,r=t.nodeById,i=o?.layerGap??100,c=o?.nodeGap??40;let a=0;for(const I of e.layers){let u=0;for(const p of I){const f=r.get(p);if(!f){u++;continue}f.layer=a,f.order=u;const y=n.x[p]??u*c,v=n.y[p]??a*i;f.x=y,f.y=v,u++}a++}const l=s.nodes??[],g=new Map,x=[];for(const I of l){if(!I?.isGroup)continue;I.parentId||x.push(I);const u=l.filter(M=>M.parentId===I.id);let p=1/0,f=-1/0,y=1/0,v=-1/0;for(const M of u){const E=M.x??n.x[M.id],T=M.y??n.y[M.id],m=M.width??0,S=M.height??0;E!=null&&T!=null&&(p=Math.min(p,E-m/2),f=Math.max(f,E+m/2),y=Math.min(y,T-S/2),v=Math.max(v,T+S/2))}if(p===1/0||y===1/0)I.x=I.x??0,I.y=I.y??0,I.width=I.width??0,I.height=I.height??0;else{const M=I.padding??20,E=I.parentId?M:2*En(I),T=M,m=Math.max(0,f-p)+E,S=Math.max(0,v-y)+T,A=(p+f)/2,R=(y+v)/2;I.x=A,I.y=R,I.width=m,I.height=S,g.set(I.id,{minX:p,maxX:f,minY:y,maxY:v})}}if(x.length>0&&g.size>0){let I=1/0,u=-1/0,p=0;for(const f of x){const y=f.padding??20;y>p&&(p=y);const v=g.get(f.id);v&&(I=Math.min(I,v.minY),u=Math.max(u,v.maxY))}if(I!==1/0&&u!==-1/0){const f=Math.max(0,u-I),v=Math.max(p,36),M=f+2*v,E=(I+u)/2;for(const k of x)k.y=E,k.height=M,k.swimlaneContentTop=I;const T=[...x].sort((k,O)=>{const _=k.x??0,H=O.x??0;return _-H}),m=[],S=[],A=[];for(const k of T){const O=g.get(k.id);if(!O)continue;const _=Math.max(0,O.maxX-O.minX)+2*En(k),H=(O.minX+O.maxX)/2;m.push(k.id),S.push(H),A.push(_)}const R=m.length;if(R>0){const k=new Map;if(R===1)k.set(m[0],A[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:Ae(e,n,o,s)}:void 0}d(oo,"measuredNodeRect");function so(t){if(t.isGroup)return;const e=oo(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(so,"nodeBoundsInfoFor");function oe(t,e,n=Ft){return Math.abs(t.x-e.x)n}d(Tt,"isHorizontalSegment");function wt(t,e,n=Ft){return ft(t,e,n)&&Math.abs(t.y-e.y)>n}d(wt,"isVerticalSegment");function zt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(zt,"overlapLength");function ce(t,e,n=Ft){return t.horizontal&&e.horizontal&&ht(t.a,e.a,n)?zt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&ft(t.a,e.a,n)?zt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(ce,"sameAxisSegmentOverlapLength");function Re(t,e=Ft){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!oe(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(pt,"dedupeConsecutivePoints");function ro(t,e=Ft){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Tt(n,o,e)&&wt(o,s,e)&&Tt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:wt(n,o,e)&&Tt(o,s,e)&&wt(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(ro,"classifyThreeSegmentRoute");function cn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),c=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ie.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ts,"rectContainsRect");function Je(t,e){return t.lefte.left&&t.tope.top}d(Je,"rectsOverlap");function Tn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Tn,"inflateRect");function Ae(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Ae,"rectFromCenterSize");function qt(t){return oo(t)?.rect}d(qt,"rectOfNodeBounds");function Ie(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Ie,"portForRectSide");function co(t,e,n,o,s,r=Ft){const i=e==="left"||e==="right",c=o==="left"||o==="right";if(i&&c){if(e==="right"&&o==="left"&&t.xn.x){if(ht(t,n,r))return[t,n];const x=(t.x+n.x)/2;return[t,{x,y:t.y},{x,y:n.y},n]}if(e===o){if(ht(t,n,r))return;const x=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x,y:t.y},{x,y:n.y},n]}return}if(!i&&!c){if(e===o){if(ft(t,n,r))return;const I=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:I},{x:n.x,y:I},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(ft(t,n,r))return[t,n];const x=(t.y+n.y)/2;return[t,{x:t.x,y:x},{x:n.x,y:x},n]}if(i&&!c){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&x?[t,{x:n.x,y:t.y},n]:void 0}const a=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return a&&l?[t,{x:t.x,y:n.y},n]:void 0}d(co,"buildOrthogonalPortPath");function ao(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(ao,"buildSameSideTrackPath");function an(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=so(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(an,"collectRealNodeBounds");function me(t){const e=[],n=[];for(const o of t){const s=so(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(me,"collectNodeRectEntries");function es(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,i=o.width??0,c=o.height??0;n.push({nodeId:o.id,...Ae(s,r,i,c)})}return n}d(es,"collectLayoutNodeRects");function lo(t,e,n=Ft){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),i=e.get(s);if(!(!r||!i))return{srcId:o,dstId:s,srcInfo:r,dstInfo:i,collinearX:Math.abs(r.cx-i.cx)p||Iv)return!1;const M=Math.abs(f-g.a.x)s:r&&c&&ht(t,n,s)?zt(t.x,e.x,n.x,o.x)>s:!1}d(ns,"sameAxisSegmentsOverlap");function Ze(t,e,n,o,{epsilon:s=Ft,skipDegenerateOther:r=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const c=i.points;if(!(!c||c.length<2))for(let a=0;aI+s&&pf+s&&xo+Ft&&t=2?e[e.length-2]:void 0,a=(i?ft(i,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(a)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!oe(s,o))&&n.push(o)}return n}d(Qe,"orthogonalizePolyline");function ae(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=ss(e);if(e=o.points,!o.changed)break}return e}d(ae,"simplifyPolyline");var nt=.001,Vr=.5,Oo=4;function uo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const i=rs(t[s],t[r],e);return n?[i,...t.slice(s)]:[...t.slice(0,s+1),i]}d(An,"clipEndpoint");function is(t,e){for(const n of t){const o=uo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=An(s,o.srcRect,!0)),o.dstRect&&(s=An(s,o.dstRect,!1)),s=ae(Qe(s)),s=ho(s,o.srcRect,o.dstRect),o.edge.points=ae(Qe(s))}}d(is,"clipEdgeEndpointsToNodeBoundaries");function Rn(t,e,n,o=!1){if(ht(t,e,nt)){if(e.yn.bottom+nt)return e;if(o){if(t.xn.right+nt)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(ft(t,e,nt)){if(e.xn.right+nt)return e;if(o){if(t.yn.bottom+nt)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(Rn,"snapEndpointToBoundary");function tn(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(cs,"intersectRanges");function On(t,e){return e==="left"||e==="right"?en(t.top,t.bottom):en(t.left,t.right)}d(On,"clearanceRangeForSide");function nn(t,e,n){const o=t.y>=n.top-nt&&t.y<=n.bottom+nt,s=t.x>=n.left-nt&&t.x<=n.right+nt;if(ht(t,e,nt)&&o){if(Math.abs(t.x-n.left)0?cs(r):void 0}d(as,"straightClearanceRange");function Pn(t,e,n,o,s){const r=as(t,e,n,o,s);if(!r)return;const i=s?t.y:t.x,c=Math.min(r.hi,Math.max(r.lo,i));if(!(Math.abs(c-i)({...c}));for(let c=e;c>=0&&c=n.left-nt&&Math.max(t.x,e.x)<=n.right+nt,s=Math.min(t.y,e.y)>=n.top-nt&&Math.max(t.y,e.y)<=n.bottom+nt;if(Math.abs(t.y-n.top)o.bottom+nt;case"left":return ht(e,n,nt)&&n.xo.right+nt}}d(_n,"leavesOutward");function Fn(t,e,n){if(t.length<3)return t;if(n){const r=kn(t[0],t[1],e);return r&&_n(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=kn(t[o-1],t[o],e);return s&&_n(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Fn,"collapseOwnBorderStub");function ds(t,e,n){let o=t;if(e){const r=tn(o,0,1);if(r){const i=Rn(r,o[0],e);i!==o[0]&&(o=[i,...o.slice(1)])}o=Fn(o,e,!0)}if(n){const r=o.length-1,i=tn(o,r,-1);if(i){const c=Rn(i,o[r],n,!0);c!==o[r]&&(o=[...o.slice(0,r),c])}o=Fn(o,n,!1)}const s=ho(o,e,n);return s!==o||o.length===2?s:(e&&(o=Bn(o,e,!0)),n&&(o=Bn(o,n,!1)),o)}d(ds,"snapAndCollapseEndpoints");function Dn(t,e){for(const n of t){const o=uo(n,e,2);if(!o)continue;const s=pt(o.points,nt),r=ds(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=i}}d(Dn,"prepareEdgeEndpointsForRenderer");function go(t){return new Map(t.map(e=>[e.id,e]))}d(go,"buildNodeMap");function us(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!s?.isGroup)break;o=s.id,n=s.parentId}return o}d(us,"resolveTopLevelGroupId");function Hn(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!s?.isGroup)break;n++,o=s.parentId}return n}d(Hn,"groupDepth");function po(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const i=r.x,c=r.y;if(typeof i!="number"||typeof c!="number")continue;const a=r.width??0,l=r.height??0;e=Math.min(e,i-a/2),n=Math.max(n,i+a/2),o=Math.min(o,c-l/2),s=Math.max(s,c+l/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(po,"boundsForChildren");function hs(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(hs,"applyGroupBounds");function gs(t){const e=go(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>Hn(s,e)-Hn(o,e));for(const o of n){const s=t.filter(i=>i.parentId===o.id),r=po(s);r&&hs(o,r)}}d(gs,"recomputeNestedGroupBounds");function on(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);let r=1/0,i=-1/0;for(const a of s){const l=a[e];typeof l=="number"&&(r=Math.min(r,l),i=Math.max(i,l))}if(!Number.isFinite(r)||!Number.isFinite(i))return!1;const c=d(a=>r+i-a,"mirror");for(const a of n){const l=a[e];typeof l=="number"&&(a[e]=c(l));const g=a.groupTitleRect;g&&(a.groupTitleRect=e==="x"?{...g,left:c(g.right),right:c(g.left)}:{...g,top:c(g.bottom),bottom:c(g.top)})}for(const a of o)for(const l of a.points??[])l[e]=c(l[e]);return!0}d(on,"mirrorAxis");function ps(t){return(t.nodes??[]).some(n=>!n.isGroup)?on(t,"y"):!0}d(ps,"applyBtDirectionTransform");function ms(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,i=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/x):1;for(const P of s){const G=P.x??0,J=((P.y??0)-i)*I+c,dt=G-r;P.x=J,P.y=dt}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,dt=(G.y-i)*I+c,mt=j-r;G.x=dt,G.y=mt}gs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&on(t,"x"),!0;const p=go(n),f=new Map;for(const P of n){if(P.isGroup)continue;const G=us(P,p);if(!G)continue;const j=f.get(G)??[];j.push(P),f.set(G,j)}let y=0;for(const P of u){const G=P.padding??0;G>y&&(y=G)}const v=[];let M=1/0,E=-1/0;for(const P of u){const G=f.get(P.id)??[],j=po(G);j&&(M=Math.min(M,j.minX),E=Math.max(E,j.maxX),v.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(M===1/0||E===-1/0)return!0;const T=Math.max(0,E-M),m=Math.max(y,10),S=T+2*m,A=c+S,O=(M+E)/2-S/2-c,_=O+A/2,H=Math.max(y,c);v.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PI.cy?v.bottom:v.top,H=I.cx+M;if(H<=v.left+se||H>=v.right-se)continue;E={x:H,y:_},T={x:H,y:c.y},m={x:c.x,y:c.y}}else{const _=u.cx>I.cx?v.right:v.left,H=I.cy+M;if(H<=v.top+se||H>=v.bottom-se)continue;E={x:_,y:H},T={x:c.x,y:H},m={x:c.x,y:c.y}}const S=oe(E,T,se),A=oe(T,m,se);if(S&&A||!S&&At(E,T,o,[g],1)||!A&&At(T,m,o,[x],1))continue;const R=!S&&Ze(E,T,t,s,{epsilon:se,skipDegenerateOther:!0}),k=!A&&Ze(T,m,t,s,{epsilon:se,skipDegenerateOther:!0});if(!(R||k)){S?y=[T,m]:A?y=[E,T]:y=[E,T,m];break}}y&&(s.points=y)}}d(ys,"portSwapToLShape");function xs(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values());for(const c of t){if(c.isLayoutOnly)continue;const a=c.points;if(!a||a.length<4)continue;const l=pt(a,.001);if(l.length<4)continue;const g=l.length-1,x=l[g],I=l[g-1],u=l[g-2],p=x.x-I.x,f=x.y-I.y,y=Math.hypot(p,f);if(y>=10||y<.001)continue;const v=I.x-u.x,M=I.y-u.y;if(Math.hypot(v,M)<.001)continue;const T=Tt(I,x,.001),m=wt(I,x,.001),S=Tt(u,I,.001),A=wt(u,I,.001);if(!(T&&A||m&&S))continue;const R=c.end,k=c.start,O=R?e.get(R):void 0;if(!O)continue;const _=O.x??0,H=O.y??0,P=qt(O);if(!P)continue;let G,j;if(A){const W=M<0;G={x:_,y:u.y},j={x:_,y:W?P.bottom:P.top}}else{const W=v>0;G={x:u.x,y:H},j={x:W?P.right:P.left,y:H}}if(At(G,j,r,R?[R]:[],-2)||At(G,j,i,[],-2))continue;if(k){const W=e.get(k),et=W?qt(W):void 0;if(et&&io(G,et,2))continue}const J=d((W,et)=>`${W.x.toFixed(3)},${W.y.toFixed(3)}|${et.x.toFixed(3)},${et.y.toFixed(3)}`,"ownSegmentKey"),dt=new Set;for(let W=0;W{for(const at of t){if(at===c||at.isLayoutOnly)continue;const gt=at.points;if(!(!gt||gt.length<2))for(let xt=0;xt=0){const W=l[g-3],et=[k,R].filter(at=>!!at);if(At(W,G,r,et,-2)||mt(W,G))continue}const Pt=[...l.slice(0,g-2),G,j];c.points=Pt;const Q=c.labelNodeId;if(Q){const W=e.get(Q);if(W){const et=W.width??0,at=W.height??0;if(et>0&&at>0){let gt,xt,vt=-1;for(let Vt=0;Vt=et+2||de&&te>=at+2)&&te>vt&&(vt=te,gt=(jt.x+Ut.x)/2,xt=(jt.y+Ut.y)/2)}gt!==void 0&&xt!==void 0&&(W.x=gt,W.y=xt)}}}}}d(xs,"collapseShortTerminalStub");var Z=.001,_t=8,it=Re,In=d((t,e)=>ft(t,e,Z)||ht(t,e,Z),"orthogonallyAligned");function bs(t,e){const s=d((u,p)=>{const f=u.x??0,y=u.y??0,v=p.x-f,M=p.y-y;let E=(u.width??0)/2,T=(u.height??0)/2;return Math.abs(M)*E>Math.abs(v)*T?(M<0&&(T=-T),{x:f+(M===0?0:T*v/M),y:y+T}):(v<0&&(E=-E),{x:f+E,y:y+(v===0?0:E*M/v)})},"rectIntersect"),r=d((u,p)=>{const f=pt(u.points??[]);if(f.length<2)return;const y=p?u.start:u.end,v=y?e.get(y):void 0,M=v?qt(v):void 0;if(!v||!y||!M)return;const E=p?f[0]:f[f.length-1],T=p?f[1]:f[f.length-2],m=s(v,E);let S=E;if(In(T,m)&&(S=T),ft(m,S,Z))return{edge:u,edgeId:String(u.id??""),nodeId:y,atStart:p,orientation:"V",coord:m.x,min:Math.min(m.y,S.y),max:Math.max(m.y,S.y),boundary:m,railEnd:S,rect:M};if(ht(m,S,Z))return{edge:u,edgeId:String(u.id??""),nodeId:y,atStart:p,orientation:"H",coord:m.y,min:Math.min(m.x,S.x),max:Math.max(m.x,S.x),boundary:m,railEnd:S,rect:M}},"terminalLaneFor"),i=d((u,p)=>Math.max(0,Math.min(u.max,p.max)-Math.max(u.min,p.min)),"projectedOverlapLength"),c=d((u,p)=>u.nodeId!==p.nodeId||u.orientation!==p.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&&ft(u.boundary,p.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&ht(u.boundary,p.boundary,1),"sameTerminalFace"),a=d((u,p)=>u.nodeId!==p.nodeId||u.orientation!==p.orientation?!1:i(u,p)>=_t&&Math.abs(u.coord-p.coord)<.5,"exactTerminalLaneConflict"),l=d((u,p)=>{if(u.nodeId!==p.nodeId||u.orientation!==p.orientation||u.orientation!=="H"||u.atStart===p.atStart)return!1;const f=i(u,p);if(f<_t)return!1;const y=u.rect.bottom-u.rect.top;return f2*y?!1:c(u,p)&&Math.abs(u.coord-p.coord)<16},"nearTerminalLaneConflict"),g=d((u,p)=>{const f=pt(u.edge.points??[]);if(f.length<2)return;const y=u.orientation==="V"?{x:u.boundary.x+p,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+p},v=u.orientation==="V"?{x:u.railEnd.x+p,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+p};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?ht(y,u.boundary,Z)&&y.x>=u.rect.left+1&&y.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?ft(y,u.boundary,Z)&&y.y>=u.rect.top+1&&y.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const S=f.length>1&&oe(f[1],u.railEnd,Z),A=f.slice(S?2:1),R=A[0];return R&&!In(R,v)?void 0:[y,v,...A]}const E=f.length>1&&oe(f[f.length-2],u.railEnd,Z),T=f.slice(0,E?-2:-1),m=T[T.length-1];if(!(m&&!In(m,v)))return[...T,v,y]},"shiftedCandidate"),x=d(u=>{const p=u.edge,f=pt(p.points??[]);if(f.length!==2)return!1;const y=p.start,v=p.end,M=y?e.get(y):void 0,E=v?e.get(v):void 0;if(!M||!E)return!1;const T=M.x??0,m=M.y??0,S=E.x??0,A=E.y??0,[R,k]=f;return ht(R,k,Z)&&Math.abs(m-A)<1&&Math.abs(T-S)>1||ft(R,k,Z)&&Math.abs(T-S)<1&&Math.abs(m-A)>1},"laneIsStraightCollinearConnector"),I=[-7,7,-14,14,-21,21];for(let u=0;u<8;u++){const p=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[r(y,!0),r(y,!1)]).filter(y=>!!y);let f=!1;for(let y=0;y{const R=x(S),k=x(A);return R!==k?Number(R)-Number(k):+!A.atStart-+!S.atStart});for(const S of m){for(const A of I){const R=g(S,A);if(!R)continue;const k=r({...S.edge,points:R},S.atStart);if(!(!k||p.some(O=>O.edge!==S.edge&&(a(k,O)||T&&l(k,O))))){S.edge.points=R,f=!0;break}}if(f)break}}if(!f)return}}d(bs,"separateSharedRenderedTerminalLanes");function Ms(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=d((c,a)=>{const l=c.start,g=c.end,x=it(a);if(x.length!==a.length-1)return!1;const I=[l,g].filter(u=>!!u);for(const u of x)if(At(u.a,u.b,o,I,-2)||At(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===c||u.isLayoutOnly)continue;const p=u.points;if(!(!p||p.length<2)){for(const f of x)for(const y of it(pt(p)))if(ce(f,y,.5)>=_t||le(f.a,f.b,y.a,y.b,Z))return!1}}return!0},"candidateIsSafe"),i=d((c,a)=>{if(a+4>=c.length)return;const l=c[a],g=c[a+1],x=c[a+2],I=c[a+3],u=c[a+4],p=Tt(l,g)&&wt(g,x)&&Tt(x,I)&&wt(I,u)&&ft(l,I,Z)&&ft(l,u,Z)&&ft(g,x,Z)&&(g.x-l.x)*(I.x-x.x)<0,f=wt(l,g)&&Tt(g,x)&&wt(x,I)&&Tt(I,u)&&ht(l,I,Z)&&ht(l,u,Z)&&ht(g,x,Z)&&(g.y-l.y)*(I.y-x.y)<0;if(p||f)return pt([...c.slice(0,a+1),u,...c.slice(a+5)]);if(a+5>=c.length)return;const y=c[a+5],v=wt(l,g)&&Tt(g,x)&&wt(x,I)&&Tt(I,u)&&wt(u,y)&&ft(l,u,Z)&&ft(l,y,Z)&&ft(x,I,Z)&&(x.x-g.x)*(u.x-I.x)<0,M=Tt(l,g)&&wt(g,x)&&Tt(x,I)&&wt(I,u)&&Tt(u,y)&&ht(l,u,Z)&&ht(l,y,Z)&&ht(x,I,Z)&&(x.y-g.y)*(u.y-I.y)<0;if(!(!v&&!M))return pt([...c.slice(0,a+1),y,...c.slice(a+6)])},"withoutDogleg");for(let c=0;c<8;c++){let a=!1;for(const l of t){if(l.isLayoutOnly)continue;const g=pt(l.points??[]);for(let x=0;x<=g.length-5;x++){const I=i(g,x);if(!(!I||!r(l,I))){l.points=I,a=!0;break}}if(a)break}if(!a)return}}d(Ms,"collapseRedundantRectangularDoglegs");function Xn(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values()),c=t.filter(p=>!p.isLayoutOnly),a=d((p,f,y)=>pt(p===f?y??[]:p.points??[]),"pointsFor"),l=d((p,f)=>{let y=0;for(let v=0;v{const f=it(p);if(f.length!==3)return;const y=f[1];if(!(f[0].horizontal===y.horizontal||f[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),x=d((p,f)=>{const y=[p.start,p.end].filter(v=>!!v);return r.filter(v=>{if(y.includes(v.id))return!1;const M=v.rect;return f.horizontal?zt(f.a.x,f.b.x,M.left,M.right)>=_t&&f.a.y>=M.top-2&&f.a.y<=M.bottom+2:zt(f.a.y,f.b.y,M.top,M.bottom)>=_t&&f.a.x>=M.left-2&&f.a.x<=M.right+2})},"blockingRectsFor"),I=d((p,f,y)=>{const v=p.map(E=>({...E}));if(f.horizontal)v[f.index].y=y,v[f.index+1].y=y;else if(f.vertical)v[f.index].x=y,v[f.index+1].x=y;else return;const M=ae(pt(v));return it(M).length===M.length-1?M:void 0},"candidateByMovingRail"),u=d((p,f,y)=>{const v=[p.start,p.end].filter(E=>!!E),M=it(f);if(M.length!==f.length-1)return!1;for(const E of M)if(At(E.a,E.b,r,v,-2)||At(E.a,E.b,i,[],-2))return!1;for(const E of c)if(E!==p){for(const T of M)for(const m of it(a(E)))if(ce(T,m,.5)>=_t)return!1}return l(p,f)<=y},"candidateIsSafe");for(let p=0;p<8;p++){const f=l();let y=!1;for(const v of c){const M=a(v),E=g(M);if(!E)continue;const T=x(v,E.segment);if(T.length===0)continue;const m=E.horizontal?[Math.min(...T.map(S=>S.rect.top))-20,Math.max(...T.map(S=>S.rect.bottom))+20]:[Math.min(...T.map(S=>S.rect.left))-20,Math.max(...T.map(S=>S.rect.right))+20];for(const S of m){const A=I(M,E.segment,S);if(!(!A||!u(v,A,f))){v.points=A,y=!0;break}}if(y)break}if(!y)return}}d(Xn,"liftObstacleHuggingSameSideRails");function Yn(t,e){const o=d(a=>{const l=a.groupTitleRect;if(!(!l||typeof l.left!="number"||typeof l.right!="number"||typeof l.top!="number"||typeof l.bottom!="number"||!Number.isFinite(l.left)||!Number.isFinite(l.right)||!Number.isFinite(l.top)||!Number.isFinite(l.bottom)||l.right<=l.left||l.bottom<=l.top))return{left:l.left,right:l.right,top:l.top,bottom:l.bottom}},"validTitleRect"),s=d(a=>{if(!a.isGroup||a.parentId)return;const l=a.direction,g=typeof l=="string"?l.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const x=o(a),I=a.y,u=a.height;if(!x||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const p=x.right-x.left,f=x.bottom-x.top;if(!(f<=0||p{if(!a.horizontal)return!1;const g=a.a.y;return g<=l.top+Z||g>=l.bottom-Z?!1:zt(a.a.x,a.b.x,l.left,l.right)>=_t},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(s).filter(a=>!!a);if(i.length===0)return;let c=0;for(const a of t){if(a.isLayoutOnly)continue;const l=pt(a.points??[]);for(const g of it(l))for(const x of i)r(g,x.rect)&&(c=Math.max(c,x.rect.bottom-g.a.y+4))}if(!(c<=Z))for(const a of i){const l=a.node.y,g=a.node.height;typeof l!="number"||typeof g!="number"||!Number.isFinite(l)||!Number.isFinite(g)||g<=0||(a.node.y=l-c/2,a.node.height=g+c,a.node.groupTitleRect={...a.rect,top:a.rect.top-c,bottom:a.rect.bottom-c})}}d(Yn,"liftTopLaneTitleBandsAboveRails");function Gn(t,e){const o=d(l=>{const g=l.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(l=>{if(!l.isGroup||l.parentId||l.direction!=="LR")return;const x=o(l),I=l.x,u=l.width;if(!x||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const p=x.right-x.left,f=x.bottom-x.top;if(!(p<=0||f{if(!l.vertical)return!1;const x=l.a.x;return x<=g.left+Z||x>=g.right-Z?!1:zt(l.a.y,l.b.y,g.top,g.bottom)>=_t},"verticalSegmentIntersectsTitle"),i=d((l,g)=>{if(!l.horizontal)return!1;const x=l.a.y;return x<=g.top+Z||x>=g.bottom-Z?!1:zt(l.a.x,l.b.x,g.left,g.right)>=_t},"horizontalSegmentIntersectsTitle"),c=[...e.values()].map(s).filter(l=>!!l);if(c.length===0)return;let a=0;for(const l of t){if(l.isLayoutOnly)continue;const g=pt(l.points??[]);for(const x of it(g))for(const I of c)if(r(x,I.rect))a=Math.max(a,I.rect.right-x.a.x+4);else if(i(x,I.rect)){const u=Math.min(x.a.x,x.b.x);a=Math.max(a,I.rect.right-u+4)}}if(!(a<=Z))for(const l of c){const g=l.node.x,x=l.node.width;typeof g!="number"||typeof x!="number"||!Number.isFinite(g)||!Number.isFinite(x)||x<=0||(l.node.x=g-a/2,l.node.width=x+a,l.node.groupTitleRect={...l.rect,left:l.rect.left-a,right:l.rect.right-a})}}d(Gn,"shiftLeftLaneTitleBandsLeftOfRails");function Is(t,e){const{realNodeRects:o}=me(e.values()),s=t.filter(p=>!p.isLayoutOnly),r=d((p,f=new Map)=>pt(f.get(p)??p.points??[]),"replacementPointsFor"),i=d((p=new Map)=>{let f=0;for(let y=0;ys.reduce((f,y)=>f+Qt(r(y,p)),0),"totalBends"),a=d(p=>{const f=r(p);if(f.length<4)return;const y=f[f.length-2],v=f[f.length-1];if(!(!Tt(y,v,Z)&&!wt(y,v,Z)))return{tailStart:y,terminal:v}},"terminalTailFor"),l=d((p,f)=>{const y=r(p);if(y.length<3)return;const v=y[0],M=y[1];let E;if(Tt(v,M,Z))E={x:M.x,y:f.tailStart.y};else if(wt(v,M,Z))E={x:f.tailStart.x,y:M.y};else return;const T=ae(pt([v,M,E,f.tailStart,f.terminal]));return it(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),g=d((p,f)=>{const y=[p.start,p.end].filter(v=>!!v);for(const v of it(f))if(At(v.a,v.b,o,y,-2))return!0;return!1},"pathHasNodeHit"),x=d((p,f,y)=>{for(const v of s)if(v!==p){for(const M of it(f))for(const E of it(r(v,y)))if(ce(M,E,.5)>=_t)return!0}return!1},"pathHasSharedTrack"),I=d((p,f,y)=>!g(p,f)&&!x(p,f,y),"candidateIsSafe"),u=d(()=>{const p=new Map;for(const f of s){const y=f.end;if(!y||!e.has(y)||r(f).length<4)continue;const M=p.get(y)??[];M.push(f),p.set(y,M)}return p},"edgesByDestination");for(let p=0;p<4;p++){const f=i();if(f===0)return;const y=c();let v,M=f,E=y;for(const T of u().values())for(let m=0;m=f||G>M||G===M&&j>=E||(v=P,M=G,E=j)}if(!v)return;for(const[T,m]of v)T.points=m}}d(Is,"swapDestinationTerminalTailsToReduceCrossings");function Ss(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values()),c=t.filter(T=>!T.isLayoutOnly),a=d((T,m=new Map)=>pt(m.get(T)??T.points??[]),"replacementPointsFor"),l=d((T=new Map)=>{let m=0;for(let S=0;Sc.reduce((m,S)=>m+Qt(a(S,T)),0),"totalBends"),x=d(T=>{const m=T.start,S=T.end,A=m?e.get(m):void 0,R=S?e.get(S):void 0,k=A?qt(A):void 0,O=R?qt(R):void 0;return k&&O?{src:k,dst:O}:void 0},"endpointRectsFor"),I=d((T,m,S)=>{if(S.index<=0||S.index+1>=m.length-1)return;const A=x(T);if(A){if(S.vertical){const R=S.a.x,k=Math.min(A.src.left,A.dst.left),O=Math.max(A.src.right,A.dst.right),_=RO+Z?"right":void 0;return _?{edge:T,points:m,segmentIndex:S.index,axis:"vertical",side:_,coord:R,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const R=S.a.y,k=Math.min(A.src.top,A.dst.top),O=Math.max(A.src.bottom,A.dst.bottom),_=RO+Z?"bottom":void 0;return _?{edge:T,points:m,segmentIndex:S.index,axis:"horizontal",side:_,coord:R,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const T=[];for(const m of c){const S=a(m);for(const A of it(S)){const R=I(m,S,A);R&&T.push(R)}}return T},"collectExternalRails"),p=d((T,m)=>T.edge!==m.edge&&T.axis===m.axis&&T.side===m.side&&zt(T.min,T.max,m.min,m.max)>=_t,"railsInteract"),f=d(T=>{const m=[],S=new Set;for(const A of T){if(S.has(A))continue;const R=[A],k=[];for(S.add(A);R.length>0;){const O=R.pop();k.push(O);for(const _ of T)!S.has(_)&&p(O,_)&&(S.add(_),R.push(_))}k.length>1&&m.push(k)}return m},"connectedComponents"),y=d(T=>{const m=[];for(const S of T)m.some(A=>Math.abs(A-S.coord){const m=T.map(R=>R.coord),S=y(T),A=[];if(T.length<=6){const R=new Array(S.length).fill(!1),k=[],O=d(()=>{if(k.length===T.length){k.some((_,H)=>Math.abs(_-m[H])>=Z)&&A.push([...k]);return}for(const[_,H]of S.entries())R[_]||(R[_]=!0,k.push(H),O(),k.pop(),R[_]=!1)},"visit");return O(),A}for(let R=0;R{const S=new Map;for(const[R,k]of T.entries()){const O=m[R],_=S.get(k.edge)??k.points.map(H=>({x:H.x,y:H.y}));k.axis==="vertical"?(_[k.segmentIndex].x=O,_[k.segmentIndex+1].x=O):(_[k.segmentIndex].y=O,_[k.segmentIndex+1].y=O),S.set(k.edge,_)}const A=new Map;for(const[R,k]of S){const O=ae(pt(k));if(it(O).length!==O.length-1)return;A.set(R,O)}return A},"replacementsForAssignment"),E=d(T=>{for(const[m,S]of T){const A=[m.start,m.end].filter(R=>!!R);for(const R of it(S))if(At(R.a,R.b,r,A,-2)||At(R.a,R.b,i,[],-2))return!1}for(let m=0;m=_t)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const m=l();if(m===0)return;let S,A=m,R=g(),k=Number.POSITIVE_INFINITY;for(const O of f(u()))for(const _ of v(O)){const H=M(O,_);if(!H||!E(H))continue;const P=l(H);if(P>=m)continue;const G=g(H),j=O.reduce((J,dt,mt)=>J+Math.abs(_[mt]-dt.coord),0);P>A||P===A&&(G>R||G===R&&j>=k)||(S=H,A=P,R=G,k=j)}if(!S)return;for(const[O,_]of S)O.points=_}}d(Ss,"reassignCrossingExternalRailChannels");function Cs(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=t.filter(u=>!u.isLayoutOnly),i=d((u,p,f)=>pt(u===p?f??[]:u.points??[]),"pointsFor"),c=d(u=>it(u).reduce((p,f)=>{const y=f.a.x-f.b.x,v=f.a.y-f.b.y;return p+Math.hypot(y,v)},0),"pathLength"),a=d((u,p)=>{let f=0;for(let y=0;y{if(u.horizontal){const f=u.a.y;return(Math.abs(f-p.top)<1||Math.abs(f-p.bottom)<1)&&zt(u.a.x,u.b.x,p.left,p.right)>=_t}if(u.vertical){const f=u.a.x;return(Math.abs(f-p.left)<1||Math.abs(f-p.right)<1)&&zt(u.a.y,u.b.y,p.top,p.bottom)>=_t}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const p=[u.start,u.end].filter(y=>!!y),f=[];for(const y of p){const v=e.get(y),M=v?qt(v):void 0;M&&f.push(M)}return f},"endpointRectsFor"),x=d((u,p)=>{if(p+3>=u.length)return[];const f=u[p],y=u[p+1],v=u[p+2],M=u[p+3],E=Tt(f,y,Z)&&wt(y,v,Z)&&Tt(v,M,Z),T=wt(f,y,Z)&&Tt(y,v,Z)&&wt(v,M,Z);if(!E&&!T)return[];if(!(E?Math.sign(y.x-f.x)!==Math.sign(M.x-v.x):Math.sign(y.y-f.y)!==Math.sign(M.y-v.y)))return[];const S=ft(f,M,Z)||ht(f,M,Z)?[]:[{x:f.x,y:M.y},{x:M.x,y:f.y}],A=S.length===0?[[...u.slice(0,p+1),...u.slice(p+3)]]:S.map(k=>[...u.slice(0,p+1),k,...u.slice(p+3)]),R=new Set;return A.map(k=>ae(pt(k))).filter(k=>{if(it(k).length!==k.length-1||!k.some(_=>oe(_,M,Z)))return!1;const O=k.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return R.has(O)?!1:(R.add(O),!0)})},"shortcutCandidatesAt"),I=d((u,p,f)=>{const y=[u.start,u.end].filter(M=>!!M),v=g(u);for(const M of it(p))if(At(M.a,M.b,o,y,-2)||At(M.a,M.b,s,[],-2)||v.some(E=>l(M,E)))return!1;for(const M of r)if(M!==u){for(const E of it(p))for(const T of it(i(M)))if(ce(E,T,.5)>=_t)return!1}return a(u,p)<=f},"candidateIsSafe");for(let u=0;u<8;u++){const p=a();let f,y,v=p,M=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(const T of r){const m=i(T),S=Qt(m,Z),A=c(m);for(let R=0;R<=m.length-4;R++)for(const k of x(m,R)){const O=Qt(k,Z),_=c(k);if(!(Ov||P===v&&(O>M||O===M&&_>=E)||(f=T,y=k,v=P,M=O,E=_)}}if(!f||!y)return;f.points=y}}d(Cs,"shortcutRedundantOrthogonalJogs");function vs(t,e){const i=[];for(const N of e.values()){if(N.isGroup||N.isEdgeLabel)continue;const F=N.x??0,D=N.y??0,V=qt(N);V&&i.push({id:String(N.id??""),cx:F,cy:D,rect:V})}if(i.length===0)return;const c=new Map(i.map(N=>[N.id,N])),a=i.map(N=>({id:N.id,rect:N.rect})),l=["top","bottom","left","right"],g={top:Math.min(...i.map(N=>N.rect.top))-20,bottom:Math.max(...i.map(N=>N.rect.bottom))+20,left:Math.min(...i.map(N=>N.rect.left))-20,right:Math.max(...i.map(N=>N.rect.right))+20},x=t.filter(N=>!N.isLayoutOnly),I=new Map(x.map((N,F)=>[N,F])),u=d(N=>{const F=N==="left"||N==="top"?-1:1,D=[];for(let V=0;V<=2;V++)D.push(g[N]+F*20*V);return D},"outwardTracksForSide"),p=d((N,F=new Map)=>pt(F.get(N)??N.points??[]),"replacementPointsFor"),f=d((N,F)=>{let D=0;for(const V of N)for(const h of F)le(V.a,V.b,h.a,h.b,Z)&&D++;return D},"crossingCountBetweenSegments"),y=d((N,F)=>f(it(N),it(F)),"crossingCountBetweenPaths"),v=d((N=new Map)=>{let F=0;const D=[],V=new Set,h=[],b=d(C=>{V.has(C)||(V.add(C),h.push(C))},"addEdge");for(let C=0;C0&&(F+=q,D.push({first:L,second:U,count:q}),b(L),b(U))}}return h.sort((C,L)=>(I.get(C)??0)-(I.get(L)??0)),{count:F,pairs:D,edgeSet:V,edges:h}},"crossingSnapshot"),M=d((N,F)=>{const D=new Set(F.keys());if(D.size===0)return N.count;let V=0;for(const b of N.pairs)(D.has(b.first)||D.has(b.second))&&(V+=b.count);let h=0;for(let b=0;b{const F=new Map;for(const h of N.pairs){const b=F.get(h.first)??new Set;b.add(h.second),F.set(h.first,b);const C=F.get(h.second)??new Set;C.add(h.first),F.set(h.second,C)}const D=[],V=new Set;for(const h of N.edges){if(V.has(h))continue;const b=[h],C=[];for(V.add(h);b.length>0;){const L=b.pop();C.push(L);for(const w of F.get(L)??[])V.has(w)||(V.add(w),b.push(w))}C.sort((L,w)=>(I.get(L)??0)-(I.get(w)??0)),C.length>1&&D.push(C)}return D},"crossingComponents"),T=d(N=>[N.start,N.end].filter(F=>!!F),"endpointIdsFor"),m=d(N=>{const F=[];for(const D of E(N)){const V=new Set(D),h=new Set(D.flatMap(C=>T(C))),b=[...D];for(const C of x)V.has(C)||T(C).some(L=>h.has(L))&&b.push(C);b.sort((C,L)=>(I.get(C)??0)-(I.get(L)??0)),F.push(b)}return F},"pairSearchGroups"),S=d((N,F,D)=>M(N,new Map([[F,D]])),"crossingCountWithSingleReplacement"),A=d(N=>{const F=new Map;for(const D of N.pairs)F.set(D.first,(F.get(D.first)??0)+D.count),F.set(D.second,(F.get(D.second)??0)+D.count);return F},"currentCrossingsByEdge"),R=d(N=>N.slice(1).reduce((F,D,V)=>{const h=N[V];return F+Math.abs(D.x-h.x)+Math.abs(D.y-h.y)},0),"pathLength"),k=d((N=new Map)=>x.reduce((F,D)=>F+Qt(p(D,N)),0),"totalBends"),O=d((N=new Map)=>x.reduce((F,D)=>F+R(p(D,N)),0),"totalLength"),_=d((N,F,D=new Map)=>{const V=it(F);for(const h of x)if(h!==N){for(const b of V)for(const C of it(p(h,D)))if(ce(b,C,.5)>=_t)return!0}return!1},"pathHasSegmentConflict"),H=d((N,F)=>{const D=[N.start,N.end].filter(V=>!!V);for(const V of it(F))if(At(V.a,V.b,a,D,-2))return!0;return!1},"pathHitsNode"),P=d((N,F)=>{const D=ae(pt(F));it(D).length===D.length-1&&N.push(D)},"pushOrthogonalCandidate"),G=d(N=>N==="left"||N==="right","sideIsHorizontal"),j=d((N,F,D)=>{switch(F){case"left":return Math.min(N.x,D.x)-20;case"right":return Math.max(N.x,D.x)+20;case"top":return Math.min(N.y,D.y)-20;case"bottom":return Math.max(N.y,D.y)+20}},"localTrackForSameSide"),J=d((N,F,D,V)=>{const h=D==="left"||D==="top"?-1:1,b=[j(F,D,V),g[D]];for(const C of b)for(let L=0;L<=2;L++)P(N,ao(F,D,V,C+h*20*L))},"addSameSideCandidates"),dt=d((N,F,D,V,h)=>{for(const b of u(D))for(const C of u(h))P(N,[F,{x:b,y:F.y},{x:b,y:C},{x:V.x,y:C},V])},"addHorizontalToVerticalCandidates"),mt=d((N,F,D,V,h)=>{for(const b of u(D))for(const C of u(h))P(N,[F,{x:F.x,y:b},{x:C,y:b},{x:C,y:V.y},V])},"addVerticalToHorizontalCandidates"),kt=d((N,F,D,V,h)=>{const b=[...u("top"),...u("bottom")];for(const C of u(D))for(const L of u(h))for(const w of b)P(N,[F,{x:C,y:F.y},{x:C,y:w},{x:L,y:w},{x:L,y:V.y},V])},"addHorizontalPairCandidates"),Pt=d((N,F,D,V,h)=>{const b=[...u("left"),...u("right")];for(const C of u(D))for(const L of u(h))for(const w of b)P(N,[F,{x:F.x,y:C},{x:w,y:C},{x:w,y:L},{x:V.x,y:L},V])},"addVerticalPairCandidates"),Q=d(N=>{const F=new Set;return N.map(D=>pt(D)).filter(D=>{const V=D.map(h=>`${h.x.toFixed(3)},${h.y.toFixed(3)}`).join("|");return F.has(V)||D.length<2?!1:(F.add(V),!0)})},"dedupeCandidatePaths"),W=d((N,F,D,V)=>{const h=[],b=co(N,F,D,V,20,Z);b&&P(h,b),F===V&&J(h,N,F,D);const C=G(F),L=G(V);return C&&!L?dt(h,N,F,D,V):!C&&L?mt(h,N,F,D,V):C?kt(h,N,F,D,V):Pt(h,N,F,D,V),Q(h)},"buildCandidatesForSides"),et=d((N,F,D,V)=>{const h=[...u("left"),...u("right")],b=[...u("top"),...u("bottom")];for(const C of l){const L=Ie(V,C),w=C==="top"||C==="bottom"?u(C):b;for(const B of h){P(N,[F,D,{x:B,y:D.y},{x:B,y:L.y},L]);for(const U of w)P(N,[F,D,{x:B,y:D.y},{x:B,y:U},{x:L.x,y:U},L])}}},"addVerticalDepartureOuterTrackCandidates"),at=d((N,F,D,V)=>{const h=[...u("left"),...u("right")],b=[...u("top"),...u("bottom")];for(const C of l){const L=Ie(V,C),w=C==="left"||C==="right"?u(C):h;for(const B of b){P(N,[F,D,{x:D.x,y:B},{x:L.x,y:B},L]);for(const U of w)P(N,[F,D,{x:D.x,y:B},{x:U,y:B},{x:U,y:L.y},L])}}},"addHorizontalDepartureOuterTrackCandidates"),gt=d(N=>{const F=N.start,D=N.end,V=D?c.get(D):void 0;if(!F||!V)return[];const h=pt(N.points??[]);if(h.length<4)return[];const b=h[0],C=h[1],L=[];return wt(b,C,Z)?et(L,b,C,V):Tt(b,C,Z)&&at(L,b,C,V),L},"terminalPreservingOuterTrackCandidates"),xt=d(N=>{const F=N.start,D=N.end,V=F?c.get(F):void 0,h=D?c.get(D):void 0;if(!V||!h)return[];const b=[];for(const C of l){const L=Ie(V,C);for(const w of l)b.push(...W(L,C,Ie(h,w),w))}return b.push(...gt(N)),b},"candidatePathsFor"),vt=d(()=>new Map(x.map(N=>[N,it(p(N))])),"currentSegmentsByEdge"),Vt=d((N,F,D)=>{const V=new Set;for(const h of x){if(h===N)continue;const b=D.get(h)??it(p(h));F.some(C=>b.some(L=>ce(C,L,.5)>=_t))&&V.add(h)}return V},"sharedTrackConflictsFor"),jt=d((N,F,D,V)=>{const h=new Set;return xt(N).map(C=>ae(pt(C))).filter(C=>{if(H(N,C))return!1;const L=C.map(w=>`${w.x.toFixed(3)},${w.y.toFixed(3)}`).join("|");return h.has(L)||C.length<2?!1:(h.add(L),!0)}).map(C=>{const L=it(C);let w=0;for(const B of x)B!==N&&(w+=f(L,D.get(B)??it(p(B))));return{candidate:C,candidateSegments:L,crossings:F.count-(V.get(N)??0)+w,bends:Qt(C,Z),totalBends:Qt(C),length:R(C)}}).filter(({crossings:C})=>C<=F.count).sort((C,L)=>C.crossings-L.crossings||C.bends-L.bends||C.length-L.length).slice(0,48).map(C=>({path:C.candidate,segments:C.candidateSegments,sharedTrackConflicts:Vt(N,C.candidateSegments,D),totalBends:C.totalBends,length:C.length}))},"pairCandidatesFor"),Ut=d((N,F,D,V,h,b)=>{let C=0;for(const w of N.pairs)(w.first===F||w.second===F||w.first===V||w.second===V)&&(C+=w.count);let L=f(D.segments,h.segments);for(const w of x){if(w===F||w===V)continue;const B=b.get(w)??it(p(w));L+=f(D.segments,B)+f(h.segments,B)}return N.count-C+L},"pairCrossingCount"),te=d((N,F)=>{for(const D of N.sharedTrackConflicts)if(D!==F)return!1;return!0},"conflictsOnlyWith"),Se=d((N,F)=>N.segments.some(D=>F.segments.some(V=>ce(D,V,.5)>=_t)),"candidatesShareTrack"),de=d((N,F,D,V)=>te(F,D.edge)&&te(V,N.edge)&&!Se(F,V),"pairCandidatesAreCompatible"),Ce=d((N,F,D,V,h)=>{const b=Ut(N.current,F.edge,D,V.edge,h,N.baseSegments);if(!(b>=N.current.count))return{replacements:new Map([[F.edge,D.path],[V.edge,h.path]]),crossings:b,bends:N.currentBends-(N.baseBendsByEdge.get(F.edge)??0)-(N.baseBendsByEdge.get(V.edge)??0)+D.totalBends+h.totalBends,length:N.currentLength-(N.baseLengthByEdge.get(F.edge)??0)-(N.baseLengthByEdge.get(V.edge)??0)+D.length+h.length}},"scorePairReplacement"),dn=d((N,F)=>N.crossings{let h=V;for(const b of F.candidates)for(const C of D.candidates){if(!de(F,b,D,C))continue;const L=Ce(N,F,b,D,C);L&&dn(L,h)&&(h=L)}return h},"bestScoreForOptionPair"),hn=d(N=>{const F=k(),D=O(),V=vt(),h=A(N),b=new Map(x.map(q=>[q,Qt(p(q))])),C=new Map(x.map(q=>[q,R(p(q))])),L=new Map,w=m(N);for(const q of w)for(const z of q){if(L.has(z))continue;const Y=jt(z,N,V,h);Y.length>0&&L.set(z,{edge:z,candidates:Y})}let B={replacements:new Map,crossings:N.count,bends:F,length:D};const U={current:N,currentBends:F,currentLength:D,baseBendsByEdge:b,baseLengthByEdge:C,baseSegments:V};for(const q of w){const z=new Set(q.filter(ot=>N.edgeSet.has(ot))),Y=q.map(ot=>L.get(ot)).filter(ot=>!!ot);for(let ot=0;ot0?B.replacements:void 0},"bestPairedReplacement");for(let N=0;N<4;N++){const F=v(),D=F.count;if(D===0)return;let V,h,b=D,C=Number.POSITIVE_INFINITY;for(const w of F.edges){const B=Qt(p(w),Z);for(const U of xt(w)){const q=H(w,U),z=!q&&_(w,U),Y=S(F,w,U),ot=Qt(U,Z);q||z||!(Yb||Y===b&&ot>=C||(V=w,h=U,b=Y,C=ot)}}if(V&&h){V.points=h;continue}const L=hn(F);if(!L)return;for(const[w,B]of L)w.points=B}}d(vs,"resolveRenderedOrthogonalCrossings");var pe=.001,Wr=8;function Ls(t,e){const{nodeInfoById:n,realNodeRects:o}=an(e),s=["top","bottom","left","right"],r=20,i={top:Math.min(...o.map(f=>f.rect.top))-r,bottom:Math.max(...o.map(f=>f.rect.bottom))+r,left:Math.min(...o.map(f=>f.rect.left))-r,right:Math.max(...o.map(f=>f.rect.right))+r},c=d((f,y,v,M)=>{const E=[],T=co(f,y,v,M,r,pe);return T&&E.push(T),y===M&&E.push(ao(f,y,v,i[y])),E},"buildOrthogonalPathCandidates"),a=d((f,y)=>{for(let v=0;v{let M=0;const E=Re(f,pe),T=y.start,m=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const A=S.start,R=S.end;if(!v&&T&&m&&(A===T||A===m||R===T||R===m))continue;const k=S.points;if(!(!k||k.length<2))for(const O of E)for(const _ of Re(k,pe)){if(fo(O.a,O.b,_.a,_.b,pe,pe)){M++;continue}ce(O,_,pe)>=Wr&&M++}}return M},"pathConflictCount"),g=4,x=d((f,y)=>{const v=Math.abs(f.y-y.rect.top),M=Math.abs(f.y-y.rect.bottom),E=Math.abs(f.x-y.rect.left),T=Math.abs(f.x-y.rect.right);let m="top",S=v;return M{const M=I.get(f)??[];M.push({side:y,edgeId:v}),I.set(f,M)},"addFaceClaim");for(const f of t){if(f.isLayoutOnly)continue;const y=f.points??[];if(y.length<1)continue;const v=f.id??"",M=f.start,E=f.end;if(M){const T=n.get(M);T&&u(M,x(y[0],T),v)}if(E){const T=n.get(E);T&&u(E,x(y[y.length-1],T),v)}}const p=d((f,y,v)=>I.get(f)?.some(M=>M.edgeId!==v&&M.side===y)??!1,"faceIsClaimed");for(const f of t){if(f.isLayoutOnly)continue;const y=f.points;if(!y||y.length<2)continue;const v=Qt(y,pe);if(v0){const mt=l(J,f,!0);if(mt>O||mt===O&&dt>=_)continue;O=mt,_=dt,k=J;continue}l(J,f)>R||dt<_&&(_=dt,k=J)}}}if(k){f.points=k;const H=I.get(M);H&&I.set(M,H.filter(G=>G.edgeId!==S));const P=I.get(E);P&&I.set(E,P.filter(G=>G.edgeId!==S)),u(M,x(k[0],T),S),u(E,x(k[k.length-1],m),S)}}}d(Ls,"simplifyDetouredEdges");var Kt=.001,Po=10,Ve=7;function $n(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const i=r.x-s.x,c=r.y-s.y;if(!(Math.abs(i)+Math.abs(c)r&&Je(t,Es(r)))}d(zn,"labelOverlapsOwnMarker");function Ue(t,e){const n=[];for(const p of t){if(p.isLayoutOnly)continue;const f=p.points;if(!(!f||f.length<2))for(let y=0;y{const y=Tn(f,r);for(const{nodeId:v,rect:M}of o)if(v!==p&&Je(y,M))return!0;return!1},"labelOverlapsForeignNode"),l=d((p,f)=>{const y=Tn(f,r);for(const v of n)if(v.edgeId!==p&&cn(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),g=d((p,f,y)=>a(p,y)||l(f,y),"labelOverlapsAnything"),x=[],I=d(p=>{for(const{id:f,rect:y}of s)if(ts(y,p))return f},"findContainingLane"),u=d((p,f)=>x.some(y=>y.labelId!==p&&Je(f,y.rect)),"overlapsPlacedLabel");for(const p of t){if(p.isLayoutOnly)continue;const f=p.labelNodeId;if(!f)continue;const y=e.get(f);if(!y)continue;const v=p.points;if(!v||v.length<2)continue;const M=y.width??0,E=y.height??0;if(M<=0||E<=0)continue;const T=[];for(let Q=0;Q=Kt&>>=Kt||T.push({idx:Q,length:at+gt,orientation:at>=Kt?"horizontal":"vertical",midX:(W.x+et.x)/2,midY:(W.y+et.y)/2})}if(T.length===0)continue;const m=T.length>=3?T.filter(Q=>Q.idx>0&&Q.idx0?m:T,A=M>=E?"horizontal":"vertical",R=d(Q=>[...Q].sort((W,et)=>{const at=W.orientation===A,gt=et.orientation===A;if(at!==gt)return at?-1:1;const xt=W.length>=(W.orientation==="horizontal"?M:E)+2,vt=et.length>=(et.orientation==="horizontal"?M:E)+2;return xt!==vt?xt?-1:1:et.length-W.length}),"rankSegments"),k=T[0],O=T[T.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((Q,W)=>{const et=v[Q.idx],at=v[Q.idx+1];return{midX:et.x+(at.x-et.x)*W,midY:et.y+(at.y-et.y)*W}},"anchorAtT"),P=d((Q,W,et)=>Math.min(et,Math.max(W,Q)),"clamp"),G=d((Q,W)=>Q.midX>=W.left-Kt&&Q.midX<=W.right+Kt&&Q.midY>=W.top-Kt&&Q.midY<=W.bottom+Kt,"pointInsideRectInclusive"),j=d(Q=>{const W=Ae(Q.midX,Q.midY,M,E),et=I(W);if(et)return{laneId:et,anchor:Q,rect:W};const at=s.find(({rect:te})=>G(Q,te));if(!at)return;const gt=at.rect.left+M/2+i,xt=at.rect.right-M/2-i,vt=at.rect.top+E/2+i,Vt=at.rect.bottom-E/2-i;if(gt>xt||vt>Vt)return;const jt={midX:P(Q.midX,gt,xt),midY:P(Q.midY,vt,Vt)},Ut=Ae(jt.midX,jt.midY,M,E);return G(Q,Ut)?{laneId:at.id,anchor:jt,rect:Ut}:void 0},"placementForAnchor"),J=d((Q,W,et)=>Q.orientation==="horizontal"?Math.abs(W.midX-et.x):Math.abs(W.midY-et.y),"distanceAlongSegment"),dt=d((Q,W)=>{const at=(Q.orientation==="horizontal"?M/2:E/2)+c;if(Q===k){const gt=v[Q.idx];if(J(Q,W,gt)+Kt{const W=R(Q);for(const et of W)for(const at of _){const gt=H(et,at);if(!dt(et,gt))continue;const xt=j(gt);if(xt&&!zn(xt.rect,v)&&!u(f,xt.rect)&&!g(f,p.id,xt.rect))return{laneId:xt.laneId,anchor:xt.anchor}}},"tryPool"),kt=d((Q,W,et=!1)=>{const at=R(Q);for(const gt of at){const xt={midX:gt.midX,midY:gt.midY};if(W&&!dt(gt,xt))continue;const vt=j(xt);if(vt&&!zn(vt.rect,v)&&!u(f,vt.rect)&&!a(f,vt.rect)&&(et||!l(p.id,vt.rect)))return{laneId:vt.laneId,anchor:vt.anchor}}},"findLaneContainingFallback"),Pt=mt(S)??(S.lengthet.labelId===f);W>=0?x[W]={labelId:f,rect:Q}:x.push({labelId:f,rect:Q})}}}d(Ue,"anchorLabelsToPolyline");var Sn=1e-6,Kr=8,Bo=Kr/2,qr=3;function Vn(t,e){return t{const g=Vn(c,a);let x=0;const I=d(u=>{if(!u)return;const p=s.get(u);if(!p)return;const f=l==="x"?p.w/2:p.h/2;f>x&&(x=f)},"consider");I(i.labelNodeId);for(const u of t){if(u===i||u.isLayoutOnly)continue;const p=u.start,f=u.end;!p||!f||Vn(p,f)===g&&I(u.labelNodeId)}return x>0?x+qr:0},"labelClearanceFor");for(const i of t){if(i.isLayoutOnly)continue;const c=i.points;if(!ro(c,Sn))continue;const a=lo(i,n,Sn);if(!a)continue;const{srcId:l,dstId:g,srcInfo:x,dstInfo:I,collinearX:u,collinearY:p}=a;if(u===p)continue;let f,y;if(u){const m=I.cy>x.cy;f={x:x.cx,y:m?x.rect.bottom:x.rect.top},y={x:I.cx,y:m?I.rect.top:I.rect.bottom}}else{const m=I.cx>x.cx;f={x:m?x.rect.right:x.rect.left,y:x.cy},y={x:m?I.rect.left:I.rect.right,y:I.cy}}if(At(f,y,o,[l,g],1))continue;const M=r(i,l,g,u?"x":"y"),E=M>Bo?M:Bo,T=[0,E,-E];for(const m of T){const S={...f},A={...y};if(u){if(S.x+=m,A.x+=m,S.x<=x.rect.left||S.x>=x.rect.right||A.x<=I.rect.left||A.x>=I.rect.right)continue}else if(S.y+=m,A.y+=m,S.y<=x.rect.top||S.y>=x.rect.bottom||A.y<=I.rect.top||A.y>=I.rect.bottom)continue;if(!At(S,A,o,[l,g],1)&&!Ze(S,A,t,i,{epsilon:Sn})){i.points=[S,A];break}}}}d(Ts,"straightenCollinearSiblingDetours");function jn(t,e){const{realNodeRects:a,labelNodeRects:l}=me(e.values()),g=d((m,S)=>Re(S,.001).map(A=>({...A,edge:m,interior:A.index>=1&&A.index<=S.length-3})),"segmentsFor"),x=d(()=>{const m=[];for(const S of t){if(S.isLayoutOnly)continue;const A=S.points;!A||A.length<2||m.push(...g(S,pt(A)))}return m},"allSegments"),I=d((m,S)=>m.horizontal&&S.horizontal?zt(m.a.x,m.b.x,S.a.x,S.b.x)>=8&&Math.abs(m.a.y-S.a.y)<7:m.vertical&&S.vertical?zt(m.a.y,m.b.y,S.a.y,S.b.y)>=8&&Math.abs(m.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((m,S)=>{const A=m.start,R=m.end,k=g(m,S);if(k.length!==S.length-1)return!1;const O=[A,R].filter(H=>!!H),_=m.labelNodeId?[m.labelNodeId]:[];for(const H of k)if(At(H.a,H.b,a,O,-2)||At(H.a,H.b,l,_,-2))return!1;for(const H of t){if(H===m||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of k)for(const j of g(H,pt(P)))if(I(G,j)||le(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),p=d((m,S)=>{const A=pt(m.edge.points??[]);if(A.length<4||m.index>=A.length-1)return;const R=A.map(k=>({...k}));if(m.horizontal)R[m.index].y+=S,R[m.index+1].y+=S;else if(m.vertical)R[m.index].x+=S,R[m.index+1].x+=S;else return;return g(m.edge,R).length===R.length-1?R:void 0},"shiftedCandidate"),f=d((m,S)=>({x:m.x??(S.left+S.right)/2,y:m.y??(S.top+S.bottom)/2}),"nodeCenter"),y=d(m=>{const S=m.edge,A=pt(S.points??[]);if(A.length!==4||m.index!==1)return;const R=S.start?e.get(S.start):void 0,k=S.end?e.get(S.end):void 0,O=R?qt(R):void 0,_=k?qt(k):void 0,H=A.slice(m.index+2);if(!(!R||!k||!O||!_||H.length===0))return{sourceCenter:f(R,O),targetCenter:f(k,_),sourceRect:O,tail:H}},"sourceDetourContextFor"),v=d((m,S,A,R,k,O)=>{const _=R.y>=A.y,H=_?k.bottom:k.top,P=H+(_?20:-20);if(_&&m.b.y<=P+.001||!_&&m.b.y>=P-.001)return;const G=m.a.x+S;return pt([{x:A.x,y:H},{x:A.x,y:P},{x:G,y:P},{x:G,y:m.b.y},...O],.001)},"verticalSourceDetour"),M=d((m,S,A,R,k,O)=>{const _=R.x>=A.x,H=_?k.right:k.left,P=H+(_?20:-20);if(_&&m.b.x<=P+.001||!_&&m.b.x>=P-.001)return;const G=m.a.y+S;return pt([{x:H,y:A.y},{x:P,y:A.y},{x:P,y:G},{x:m.b.x,y:G},...O],.001)},"horizontalSourceDetour"),E=d((m,S)=>{const A=y(m);if(A){if(m.vertical)return v(m,S,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail);if(m.horizontal)return M(m,S,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let m=0;m<12;m++){const S=x();let A=!1;for(let R=0;RP.interior);for(const P of H){for(const G of T){const j=p(P,G);if(j&&u(P.edge,j)){P.edge.points=j,A=!0;break}const J=E(P,G);if(J&&u(P.edge,J)){P.edge.points=J,A=!0;break}}if(A)break}}if(!A)return}}d(jn,"nudgeSharedInteriorSubpaths");function ws(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,c=o.y-n.y,a=s*c-r*i;if(Math.abs(a)<1e-10)return!1;const l=n.x-t.x,g=n.y-t.y,x=(l*c-g*i)/a,I=(l*r-g*s)/a,u=.01;return x>u&&x<1-u&&I>u&&I<1-u}d(ws,"segmentsIntersect");function As(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=es(e),r=[];for(const c of n){if(c.isLayoutOnly)continue;const a=c.points;if(!a||a.length<2)continue;const l=c.start,g=c.end,x=c.labelNodeId,I=c.id??`${l}->${g}`;for(const u of s)if(!(u.nodeId===l||u.nodeId===g)&&!(x&&u.nodeId===x)){for(let p=0;p0){const c=o.filter(l=>l.type==="edge-node-overlap").length,a=o.filter(l=>l.type==="edge-edge-crossing").length;Ke.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${c} edge-node overlap(s), ${a} edge crossing(s)`);for(const l of o)Ke.warn(`[SWIMLANE_VALIDATE] ${l.type}: ${l.detail}`)}return o}d(As,"validateSwimlanesLayout");function Rs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!ms(t,e)||e==="BT"&&s.length>0&&!ps(t))return;for(const c of o){if(c.isLayoutOnly)continue;const a=c.points;!a||a.length<2||(c.points=ae(Qe(a)))}Ls(o,n),Ts(o,n),ys(o,n);const r=new Map;for(const c of n)r.set(String(c.id),c);Ue(o,r),is(o,r),xs(o,r),jn(o,r),bs(o,r),Ms(o,r),Xn(o,r),Is(o,r);const i=d(()=>{vs(o,r),Ss(o,r),Cs(o,r),Ue(o,r),Dn(o,r),Xn(o,r),Ue(o,r),Dn(o,r)},"finalizeRenderedEdges");i(),jn(o,r),i(),Yn(o,r),Gn(o,r),Yn(o,r),Gn(o,r)}d(Rs,"postProcessSwimlaneLayout");function ye(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const i=`${r.id}:${r.src}->${r.dst}`;n.has(i)||(n.add(i),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(ye,"normalizeGraph");function mo(t,e){return t.edges.filter(n=>n.dst===e)}d(mo,"incoming");function Ns(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(Ns,"buildSuccessorMap");function yo(t){const e=Ns(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(yo,"buildSortedSuccessorMap");function xo(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(xo,"buildInDegreeMap");function bo(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(bo,"sortedZeroInDegreeNodes");function ln(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(ln,"buildPredecessorSuccessorMaps");function Mo(t,e,n,o){let s=0;for(const i of t.nodes)o?.skipGroups&&t.nodeById.get(i)?.isGroup||(s=Math.max(s,n[i]??0));const r=Array.from({length:s+1},()=>[]);for(const i of e)o?.skipGroups&&t.nodeById.get(i)?.isGroup||r[Math.max(0,n[i]??0)].push(i);return r}d(Mo,"buildLayersFromRanks");function Be(t){const e=xo(t),n=bo(e),o=[],s=yo(t);for(;n.length;){const r=n.shift();o.push(r);for(const i of s.get(r)??[])if(e.set(i,(e.get(i)??0)-1),(e.get(i)??0)===0){let c=0;for(;c{if(s-o<=1)return 0;const r=o+s>>1;let i=n(o,r)+n(r,s),c=o,a=r,l=o;for(;c=s||cx.dst===I.dst?x.id.localeCompare(I.id):x.dst.localeCompare(I.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const x of n.get(g)??[]){const I=x.dst;o[I]===0?r(I):o[I]===1&&s.push(x)}o[g]=2},"dfs"),i=[...e.nodes].sort((g,x)=>g.localeCompare(x));for(const g of i)o[g]===0&&r(g);const c=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),a=e.edges.map(g=>c.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:a,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(Os,"removeCycles_DFS");function Ps(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const c=n(r)??r;return e.set(o,c),c},"resolve");for(const o of t.nodes)n(o);return e}d(Ps,"buildTopLaneMap");function fe(t){const e=Ps(t);return n=>e.get(n)??null}d(fe,"createTopLaneResolver");function fn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(fn,"buildTopLaneOrder");function So(t,e){const n=fn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const i of e)!o.has(i)||s.has(i)||(s.add(i),r.push(i));for(const i of n)s.has(i)||r.push(i);return r}d(So,"resolveTopLaneOrder");var Jr={EPSILON:1e-6},sn={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},ko={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Bs(t,e){const n=ye(t),o=e?.laneOf??(()=>null),s=e?.rankHint,{preds:r}=ln(n);for(const m of r.values())m.sort((S,A)=>S.localeCompare(A));const i=Be(n)??[...n.nodes].sort((m,S)=>m.localeCompare(S)),c=new Map;for(const[m,S]of i.entries())c.set(S,m);const a=new Map,l=new Map;for(const m of n.nodes)l.set(m,[]);for(const m of i){const S=(r.get(m)??[]).filter(A=>a.has(A));if(S.length>0){const A=ks(m,S,{laneOf:o,rankHint:s,topoIndex:c});a.set(m,A),l.get(A).push(m)}else a.has(m)||a.set(m,null)}for(const m of n.nodes)a.has(m)||a.set(m,null);const g=new Set;for(const m of n.nodes)(a.get(m)??null)===null&&g.add(m);const x=[...g].sort((m,S)=>{const A=c.get(m)??0,R=c.get(S)??0;return A===R?m.localeCompare(S):A-R}),I=_s(n),u=new Map;for(const[m,S]of I.entries())u.set(m,[...S].sort((A,R)=>A.localeCompare(R)));const p=Fs(u),f=Ds(u),y=new Map;for(const m of n.nodes)y.set(m,[]);for(const m of f)for(const S of m.nodes){const A=y.get(S);A?A.push(m.id):y.set(S,[m.id])}const v=[],M=[],E=new Set,T=d(m=>{if(!E.has(m)){E.add(m),v.push(m);for(const S of l.get(m)??[])T(S);M.push(m)}},"walk");for(const m of x)T(m);for(const m of i)T(m);return{parent:a,children:l,roots:x,componentOf:p,blocks:f,nodeBlocks:y,adjacency:u,preorder:v,postorder:M,topologicalOrder:i}}d(Bs,"buildDrivingTree");function ks(t,e,n){const o=n.laneOf(t);return[...e].sort((r,i)=>{const c=n.laneOf(r),a=n.laneOf(i),l=c!=null&&c===o,g=a!=null&&a===o;if(l!==g)return l?-1:1;const x=n.rankHint?.[r],I=n.rankHint?.[i];if(x!=null&&I!=null&&x!==I)return I-x;const u=n.topoIndex.get(r)??0,p=n.topoIndex.get(i)??0;return u!==p?u-p:r.localeCompare(i)})[0]}d(ks,"chooseParent");function _s(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(_s,"buildAdjacency");function Fs(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const i of t.get(r)??[])e.has(i)||s.push(i)}}n++}return e}d(Fs,"assignComponents");function Ds(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const i=d((c,a)=>{e.set(c,++r),n.set(c,r);for(const l of t.get(c)??[])l!==a&&(e.has(l)?(e.get(l)??0)<(e.get(c)??0)&&(o.push([c,l]),n.set(c,Math.min(n.get(c)??r,e.get(l)??r))):(o.push([c,l]),i(l,c),n.set(c,Math.min(n.get(c)??r,n.get(l)??r)),(n.get(l)??0)>=(e.get(c)??0)&&s.push(Hs(c,l,o,s.length))))},"visit");for(const c of t.keys())e.has(c)||i(c,null);return s}d(Ds,"computeBlocks");function Hs(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const i=n.pop();if(s.push(i),r.add(i[0]),r.add(i[1]),i[0]===t&&i[1]===e||i[0]===e&&i[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d(Hs,"popBlock");function Xs(t,e,n){const o=[...t.nodes],s=new Map;for(const[M,E]of o.entries())s.set(E,M);const r=o.length,i=new Array(r).fill(-1),c=new Array(r).fill(0),a=[],l=new Set;for(const M of o){const E=n.parent.get(M)??null,T=s.get(M);T!=null&&E==null&&(i[T]=-1,c[T]=0,l.has(M)||(l.add(M),a.push(M)))}for(;a.length>0;){const M=a.shift(),E=s.get(M);if(E==null)continue;const T=n.children.get(M)??[];for(const m of T){if(l.has(m))continue;const S=s.get(m);S!=null&&(i[S]=E,c[S]=c[E]+1,l.add(m),a.push(m))}}for(const M of o){if(l.has(M))continue;const E=s.get(M);E!=null&&(i[E]=-1,c[E]=0,l.add(M))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),x=Array.from({length:g},()=>new Array(r).fill(-1));for(let M=0;M{if(M===-1||E===-1)return-1;c[M]>m&1&&(M=x[m][M],M===-1))return-1;if(M===E)return M;for(let m=g-1;m>=0;m--){const S=x[m][M],A=x[m][E];S===-1||A===-1||S!==A&&(M=S,E=A)}return x[0][M]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const M of t.edges){let E=M.src,T=M.dst,m=e[E],S=e[T];if(m==null||S==null||(m>S&&([E,T]=[T,E],[m,S]=[S,m]),m==null||S==null||m===S))continue;const A=s.get(E),R=s.get(T);if(A==null||R==null)continue;const k=I(A,R);if(k===-1)continue;const O=u[k];for(let _=m;_{if(E.size!==0)for(const[T,m]of E)M.set(T,(M.get(T)??0)+m)},"mergeInto"),y=new Set,v=d(M=>{const E=s.get(M);y.add(M);const T=E==null?void 0:u[E],m=T?new Map(T):new Map,S=n.children.get(M)??[];for(const A of S){const R=v(A),k=e[M];if(k!=null){let O=p.get(M);O||(O=new Map,p.set(M,O));let _=R.get(k)??0;const H=e[A];H!=null&&H>k&&(_+=1),O.set(A,_)}f(m,R)}return m},"dfs");for(const M of n.roots)y.has(M)||v(M);for(const M of o)y.has(M)||v(M);return p}d(Xs,"computeSubtreeCrossCounts");function Ys(t,e,n){const o=new Map,s=d(r=>{let i=n[r]??0;const c=[...e.get(r)??[]];c.sort(Co(n));for(const a of c){s(a);const l=o.get(a);l!=null&&(i=Math.min(i,l))}o.set(r,i)},"annotate");for(const r of t)s(r);return o}d(Ys,"annotateMinimumLayers");function Co(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(Co,"compareByRankThenId");function Gs(t,e,n,o){let s=0;for(const a of e){const l=n[a]??0;l>s&&(s=l)}const r=Array.from({length:s+1},()=>[]),i=new Set,c=d(a=>{if(i.has(a))return;i.add(a);const l=n[a]??0;r[l]||(r[l]=[]),r[l].push(a);for(const g of o(a))c(g)},"emit");for(const a of t)c(a);for(const a of e)if(!i.has(a)){const l=n[a]??0;r[l]||(r[l]=[]),r[l].push(a),i.add(a)}return r}d(Gs,"emitNodesInTreeOrder");function $s(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d($s,"deduplicateLayers");function zs(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const i=e[s]??0,c=[],a=[],l=n.get(s);for(const g of r){const x=o.get(g)??i;x>i?c.push({child:g,min:x}):a.push(g)}return c.sort((g,x)=>g.min===x.min?g.child.localeCompare(x.child):g.min-x.min),a.sort((g,x)=>{const I=l?.get(g)??0,u=l?.get(x)??0;if(I!==u)return I-u;const p=o.get(g)??i,f=o.get(x)??i;return p!==f?p-f:g.localeCompare(x)}),[...c.map(g=>g.child),...a]}}d(zs,"createChildOrderer");function rn(t,e,n){const o=Bs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const x of t.nodes)s.has(x)||s.set(x,[]);const i=Xs(t,e,o),c=[...r].sort(Co(e)),a=Ys(c,s,e),l=zs(s,e,i,a);let g=Gs(c,t.nodes,e,l);return g=$s(g),g}d(rn,"buildMultitreeLayerOrder");function Vs(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(e),i=[];for(const c of n)o.has(c.src)&&s.has(c.dst)&&i.push(r.get(c.dst));return Io(i)}d(Vs,"countCrossingsBetweenAdjacent");function Un(t,e,n){const o=[];for(const r of e){const i=n[r.src],c=n[r.dst];if(i==null||c==null||i===c)continue;let a=r.src,l=r.dst,g=i,x=c;i>c&&(a=r.dst,l=r.src,g=c,x=i);for(let I=g;I(n[I]??0)-(n[x]??0));for(const x of g){const I=n[x]??0;if(I===0)continue;let u=0;for(const v of o.get(x)??[])u=Math.max(u,(n[v]??0)+1);if(u>=I)continue;const p=I;n[x]=u;const f=rn(t,n,s),y=Un(f,t.edges,n);y(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const i=t.edges.filter(f=>f.src===s);if(i.length===0)continue;let c=!1,a=0;for(const f of i){const y=n(f.dst);y==null||y===r?c=!0:a++}if(a===0||c)continue;let l=0,g=!1;for(const f of t.edges){if(f.dst!==s)continue;const y=n(f.src);y&&(y===r?g=!0:l++)}if(l>0||!g)continue;const x=e[s]??0,I=x+a;let u=0;for(const f of t.edges)f.dst===s&&(u=Math.max(u,(e[f.src]??0)+1));const p=Math.max(x,u,I);p!==x&&(e[s]=p)}}d(Us,"adjustCrossLaneSources");function Ws(t,e){const n=ye(t),o=Be(n)??[...n.nodes].sort(),s=e?.compactSingleInput??!1,r=fe(n);let i=Object.create(null);for(const a of o){const l=mo(n,a),g=e?.ignoreCrossLaneEdges?l.filter(x=>{const I=r(x.src),u=r(a);return!I||!u?!0:I===u}):l;if(g.length===0)i[a]=0;else if(s&&g.length===1){const x=g[0].src,I=r(x),u=r(a);I!==u?i[a]=i[x]??0:i[a]=(i[x]??0)+1}else{let x=-1/0;for(const I of g)x=Math.max(x,(i[I.src]??0)+1);i[a]=x===-1/0?0:x}}return(e?.optimizeRanksByCrossings??!1)&&(i=js(n,i)),e?.ignoreCrossLaneEdges&&Us(n,i),{layers:rn(n,i,r),rankOf:i,dummy:new Set}}d(Ws,"assignLayers_LongestPath");function Ks(t,e){const n=ye(t),s={...Ws(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=fe(n),{preds:i,succs:c}=ln(n,p=>{if(e?.ignoreCrossLaneEdges){const f=r(p.src),y=r(p.dst);if(f&&y&&f!==y)return!1}return!0}),a=Be(n)??[...n.nodes],l=[...a].reverse(),g=d((p,f)=>{let y=0;for(const E of i.get(p)??[])y=Math.max(y,(s[E]??0)+1);let v=Number.POSITIVE_INFINITY;const M=c.get(p)??[];return M.length>0&&(v=Math.min(...M.map(E=>(s[E]??0)-1))),Number.isFinite(v)||(v=Math.max(y,f)),Math.min(Math.max(f,y),v)},"clampFeasible"),x=sn.GRAVITY_ITERATIONS,I=d(p=>{let f=!1;for(const y of p){const v=i.get(y)??[],M=c.get(y)??[];if(v.length===0&&M.length===0)continue;const E=v.length>0?v.reduce((A,R)=>A+(s[R]??0)+1,0)/v.length:s[y]??0,T=M.length>0?M.reduce((A,R)=>A+(s[R]??0)-1,0)/M.length:s[y]??0,m=Math.round((E+T)/2),S=g(y,m);S!==s[y]&&(s[y]=S,f=!0)}return f},"relaxOrder");for(let p=0;p0){const y=Math.min(...f.map(v=>(s[v]??0)-1));(s[p]??0)>y&&(s[p]=y)}}return{layers:Mo(n,a,s),rankOf:s,dummy:new Set}}d(Ks,"assignLayers_Gravity");function qs(t){const e=xo(t),n=yo(t);let o=bo(e);const s=[];for(;o.length>0;){const r=[];for(const i of o){s.push(i);for(const c of n.get(i)??[])e.set(c,(e.get(c)??0)-1),(e.get(c)??0)===0&&r.push(c)}o=r.sort((i,c)=>i.localeCompare(c))}return s.length===t.nodes.length?s:null}d(qs,"topoSortByGenerationIfAcyclic");function Js(t,e){const n=ye(t),o=e?.direction==="LR"?qs(n)??[...n.nodes].sort():Be(n)??[...n.nodes].sort(),s=fe(n),r=d(g=>s(g)??g,"laneOf"),i=Object.create(null),c=new Map,a=d((g,x)=>e?.ignoreCrossLaneEdges??!0?r(g)===r(x)?1:0:1,"edgeWeight");for(const g of o){if(n.nodeById.get(g)?.isGroup)continue;const I=mo(n,g);let u=0;if(I.length>0)for(const v of I){const M=v.src,E=i[M]??0;u=Math.max(u,E+a(M,g))}const p=r(g),f=c.get(p)??0,y=Math.max(u,f);i[g]=y,c.set(p,y+1)}return{layers:Mo(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}d(Js,"assignLayers_LaneAwareCompact");function Zs(t,e){const n=ye(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let i=0;const c=new Map(n.nodeById),a=d(u=>{const p=`placeholder-${i++}`,f={id:p,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(p,f),r.add(p);s.length<=u;)s.push([]);return s[u].push(p),o[p]=u,p},"addDummyAt"),l=[...n.edges].sort((u,p)=>u.id===p.id?u.src===p.src?u.dst.localeCompare(p.dst):u.src.localeCompare(p.src):u.id.localeCompare(p.id)),g=[];for(const u of l){const p=o[u.src]??0,f=o[u.dst]??0;if(f-p<=1){g.push(u);continue}let y=u.src;for(let M=p+1,E=0;M!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:c};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:I}}d(Zs,"makeProperLayering");function Wn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(Wn,"median");function Kn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Kn,"barycenter");function Qs(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(Qs,"neighborPositionsFor");function tr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(tr,"currentOrderTieBreak");function qn(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(t),i=Ne(e),c=[];for(const l of n)o.has(l.src)&&s.has(l.dst)&&c.push({u:r.get(l.src),v:i.get(l.dst)});c.sort((l,g)=>l.u===g.u?l.v-g.v:l.u-g.u);const a=c.map(l=>l.v);return Io(a)}d(qn,"countCrossingsBetweenAdjacent");function We(t,e,n){return[...t].sort((o,s)=>{const r=Wn(e.get(o)??[]),i=Wn(e.get(s)??[]);return r===i?tr(o,s,n):isFinite(r)?isFinite(i)?r-i:-1:1})}d(We,"sortByHeuristic");function Jn(t,e,n,o,s,r){const i=Ne(t),c=Ne(e),a=Qs(e,i,n,o);if(!s||!r||r.length===0)return We(e,a,c);const l=new Map;for(const I of e){const u=s(I),p=l.get(u)??[];p.push(I),l.set(u,p)}const g=[];for(const I of r){const u=l.get(I);if(!u||u.length===0)continue;const p=We(u,a,c);g.push(...p)}const x=l.get(null);if(x&&x.length>0){const I=We(x,a,c);for(const u of I){const p=Kn(a.get(u)??[]);let f=g.length;if(isFinite(p))for(const[y,v]of g.entries()){const M=Kn(a.get(v)??[]);if(pi.has(f.src)&&c.has(f.dst)),g=a?n.filter(f=>c.has(f.src)&&a.has(f.dst)):void 0,x=d(f=>{let y=qn(t,f,l);return g&&o&&(y+=qn(f,o,g)),y},"crossingScore"),I=s?new Map:null;if(s&&I)for(const f of e)I.set(f,s(f));let u=!0,p=x(r);for(;u;){u=!1;for(let f=0;f+1[...c]),s=e.edges,r=fe(e),i=So(e,n?.laneOrder);for(let c=0;c<3;c++){for(let a=1;a=0;a--)o[a]=Jn(o[a+1],o[a],s,"up",r,i),o[a]=Zn(o[a+1],o[a],s,o[a-1],r)}return{layers:o}}d(er,"orderLayers");function nr(t,e,n){const o=n?.layerGap??ko.DEFAULT_LAYER_GAP,s=n?.nodeGap??ko.DEFAULT_NODE_GAP,r=n?.laneGap??s*2,i=n?.direction??"TB",c=i==="LR"||i==="RL",a=t.layers,l=Object.create(null),g=Object.create(null),x=d(O=>e.nodeById.get(O),"getNode"),I=d(O=>x(O)?.width??0,"getWidth"),u=d(O=>x(O)?.height??0,"getHeight"),p=fe(e),f=So(e,n?.laneOrder),y=a.map(O=>O.reduce((_,H)=>Math.max(_,u(H)),0)),v=[];if(c)for(let O=0;O+1Math.max(mt,I(kt)),0),H=a[O+1].reduce((mt,kt)=>Math.max(mt,I(kt)),0),P=y[O],G=y[O+1],j=P/2+G/2,J=(_+H)/2,dt=Math.max(0,J-j-o);v.push(dt)}const M=new Set;for(const O of a)for(const _ of O)M.add(p(_));const E=M.has(null),T=f.filter(O=>M.has(O)),m=[...E?[null]:[],...T],S=Object.create(null);for(const O of T)S[O]=0;E&&(S.null=0);for(const O of a){const _=Object.create(null),H=[];for(const P of O){const G=p(P);G===null?H.push(P):(_[G]||=[]).push(P)}for(const[P,G]of Object.entries(_)){const j=G.reduce((J,dt)=>J+I(dt),0)+s*Math.max(0,G.length-1);S[P]=Math.max(S[P]??0,j)}if(E&&H.length){const P=H.reduce((G,j)=>G+I(j),0)+s*Math.max(0,H.length-1);S.null=Math.max(S.null??0,P)}}const A=new Map;{const O=m.map(P=>(P===null?S.null:S[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,m.length-1))/2;for(let P=0;PI(Q)),kt=mt.reduce((Q,W)=>Q+W,0)+s*(J.length-1);let Pt=dt-kt/2;for(const[Q,W]of J.entries()){const et=mt[Q];l[W]=Pt+et/2,g[W]=R+H/2,Pt+=et+s}}}const G=v[O]??0;R+=H+o+G}const k=new Map;for(const O of e.edges){const _=O.ref.id;k.has(_)||k.set(_,[]),k.get(_).push(O)}for(const[,O]of k){if(O.length===0)continue;const _=O[0].ref,H=_.start,P=_.end;if(H==null||P==null)continue;const G=Math.round(((l[H]??0)+(l[P]??0))/2),j=new Set;for(const J of O)j.add(J.src),j.add(J.dst);for(const J of j){if(J===H||J===P)continue;e.nodeById.get(J)?.isDummy&&(l[J]=G)}}return{x:l,y:g}}d(nr,"assignCoordinates");var or=8;function sr(t){let e=2166136261;for(let n=0;n>>0}d(sr,"hashString");function rr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(rr,"mulberry32");function ir(t,e){const n=[...t],o=rr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(ir,"deterministicShuffle");function cr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(cr,"sourceDistance");function Qn(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:i}of e){const c=n.get(s),a=n.get(r);c==null||a==null||(o+=i*Math.abs(c-a))}return o}d(Qn,"laneArrangementCost");function ar(t){const e=fn(t);if(e.length<2)return[];const n=new Map(e.map((r,i)=>[r,i])),o=fe(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const i=typeof r.start=="string"?r.start:void 0,c=typeof r.end=="string"?r.end:void 0;if(!i||!c||!t.nodeById.has(i)||!t.nodeById.has(c))continue;const a=o(i),l=o(c);if(!a||!l||a===l)continue;const g=n.get(a),x=n.get(l);if(g==null||x==null)continue;const[I,u]=g<=x?[a,l]:[l,a],p=`${I}\0${u}`,f=s.get(p);f?f.weight++:s.set(p,{a:I,b:u,weight:1})}return[...s.values()]}d(ar,"buildWeightedLaneEdges");function to(t,e,n){const o=[...t];let s=Qn(o,e),r=!0,i=0;const c=Math.max(1,o.length);for(;r&&is.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:i})=>`${s}:${r}:${i}`).join("|");return sr(`${t.join("|")}#${o}#${n}`)}d(fr,"seedForRestart");function dr(t,e={}){const n=fn(t);if(n.length<2)return n;const o=ar(t);if(o.length===0)return n;const s=new Map(n.map((c,a)=>[c,a]));let r=to(n,o,s);const i=Math.max(0,e.restarts??or);for(let c=0;cct&&a*3>=c?i>0?"bottom":"top":c>ct?r>0?"right":"left":n}d(eo,"chooseOrthogonalSide");function no(t,e){return Math.abs(t.to-e.from)h.isGroup&&!h.parentId);for(const h of l){const b={id:h.id},C=d(L=>{i.set(L.id,b),n.filter(w=>w.parentId===L.id).forEach(C)},"assignLane");C(h)}const g=n.filter(h=>!h.isGroup&&!h.isEdgeLabel).map(h=>{const b=h.width??10,C=h.height??10,L=h.x??0,w=h.y??0,B=Zr;return{nodeId:h.id,minX:L-b/2-B,maxX:L+b/2+B,minY:w-C/2-B,maxY:w+C/2+B,visualXHalfExtent:a?C/2+B:b/2+B}}),x=d((h,b,C,L)=>{let w=c.find(B=>B.orientation===h&&Math.abs(B.coord-b)<1);return w||(w={id:`pipe-${h}-${b.toFixed(0)}`,orientation:h,coord:b,spanMin:C,spanMax:L,tracks:[]},c.push(w)),w.spanMin=Math.min(w.spanMin,C),w.spanMax=Math.max(w.spanMax,L),w},"getOrAddPipe"),I=d((h,b)=>{const C=h.width??10,L=h.height??10,w=h.x??0,B=h.y??0;switch(b){case"top":return{x:w,y:B-L/2};case"bottom":return{x:w,y:B+L/2};case"left":return{x:w-C/2,y:B};case"right":return{x:w+C/2,y:B}}},"portForSide"),u=d((h,b,C)=>I(h,eo(h,b,C?"bottom":"top")),"getOrthogonalPort"),p=[],f=[],y=new Set,v=1e3,M=d((h,b,C)=>{if(p.length===0)return 0;const L=Math.abs(b.y-C.y)z||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}else if(w){const U=b.x,q=Math.min(b.y,C.y)-ct,z=Math.max(b.y,C.y)+ct;if(z<=q)return 0;for(const Y of p)Y.edgeIndex===h||Y.orientation!=="horizontal"||Y.pipe.coordz||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}return B},"crossingPenalty"),E=s.map((h,b)=>{if(!h.start||!h.end)return{idx:b,crossLane:0,dx:0,dy:0};const C=r.get(h.start),L=r.get(h.end),w=i.get(h.start),B=i.get(h.end),U=w&&B&&w.id!==B.id?1:0,q=C&&L?Math.abs((L.x??0)-(C.x??0)):0,z=C&&L?Math.abs((L.y??0)-(C.y??0)):0;return{idx:b,crossLane:U,dx:q,dy:z}}).sort((h,b)=>{if(h.crossLane!==b.crossLane)return b.crossLane-h.crossLane;const C=h.dx+h.dy,L=b.dx+b.dy;return Math.abs(C-L)>1?C-L:h.idx-b.idx}).map(h=>h.idx),T=d((h,b,C,L)=>{const w=Math.min(h.x,b.x),B=Math.max(h.x,b.x),U=Math.min(h.y,b.y),q=Math.max(h.y,b.y);return!!g.find(Y=>C&&Y.nodeId===C||L&&Y.nodeId===L?!1:Math.abs(h.x-b.x)>ct?Y.minYh.y&&Y.maxX>w&&Y.minXh.x&&Y.maxY>U&&Y.minYeo(h,b,"bottom"),"determineSide"),R=new Map;for(const[h,b]of s.entries()){if(!b.start||!b.end||b.start===b.end||b.points&&b.points.length>0)continue;const C=r.get(b.start),L=r.get(b.end);if(!C||!L)continue;const w=(L.x??0)-(C.x??0),B=(L.y??0)-(C.y??0);R.set(h,{edgeIdx:h,srcId:b.start,dstId:b.end,srcSide:A(C,{x:L.x??0,y:L.y??0}),dstSide:A(L,{x:C.x??0,y:C.y??0}),absDx:Math.abs(w),absDy:Math.abs(B),dxSign:Math.sign(w),dySign:Math.sign(B)})}const k=d(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.absDx===0?1/0:h.absDy/h.absDx:h.absDy===0?1/0:h.absDx/h.absDy,"preferenceStrength"),O=d(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.dxSign>=0?"right":"left":h.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const h of R.values()){const b=`${h.srcId}:${h.srcSide}`;_.has(b)||_.set(b,[]),_.get(b).push(h)}const H=new Map,P=d((h,b)=>`${h}:${b}`,"loadKey");for(const h of R.values())H.set(P(h.srcId,h.srcSide),(H.get(P(h.srcId,h.srcSide))??0)+1),H.set(P(h.dstId,h.dstSide),(H.get(P(h.dstId,h.dstSide))??0)+1);for(const h of _.values())if(!(h.length<2)){h.sort((b,C)=>{const L=k(b),w=k(C);return Math.abs(L-w)>1e-9?w-L:b.edgeIdx-C.edgeIdx});for(let b=1;b=w||(H.set(P(C.srcId,C.srcSide),w-1),H.set(P(C.srcId,L),B+1),C.srcSide=L)}}const G=d(h=>{const b=h?.shape;return b==="question"||b==="diamond"},"isDiamondNode"),j=new Map;for(const h of R.values())j.has(h.dstId)||j.set(h.dstId,new Set),j.get(h.dstId).add(h.dstSide);for(const h of R.values()){if(!G(r.get(h.srcId)))continue;const b=j.get(h.srcId);if(!b?.has(h.srcSide))continue;const C=O(h);if(b.has(C)||(H.get(P(h.srcId,C))??0)>0)continue;const L=H.get(P(h.srcId,h.srcSide))??0;H.set(P(h.srcId,h.srcSide),Math.max(0,L-1)),H.set(P(h.srcId,C),1),h.srcSide=C}for(const h of R.values()){const{edgeIdx:b,srcId:C,dstId:L,srcSide:w,dstSide:B}=h,U=r.get(C),q=r.get(L),z=`${C}:${w}:src`,Y=w==="top"||w==="bottom"?q.x??0:q.y??0;m.has(z)||m.set(z,[]),m.get(z).push({edgeIdx:b,oppositeCoord:Y});const ot=`${L}:${B}:dst`,rt=B==="top"||B==="bottom"?U.x??0:U.y??0;m.has(ot)||m.set(ot,[]),m.get(ot).push({edgeIdx:b,oppositeCoord:rt})}const J=new Map,dt=8;for(const[h,b]of m){if(b.length<2)continue;b.sort((Lt,Dt)=>Lt.oppositeCoord-Dt.oppositeCoord);const C=h.split(":"),L=C.slice(0,-2).join(":"),w=C[C.length-2],B=C[C.length-1],U=r.get(L);if(!U)continue;const z=w==="left"||w==="right"?U.height??10:U.width??10,Y=U.shape,rt=Y==="question"||Y==="diamond"?z*.3:z,tt=Math.min(20,Math.max(dt,rt/(b.length+1))),Rt=-(tt*(b.length-1))/2;for(const[Lt,Dt]of b.entries()){const Jt=Rt+Lt*tt,gn=`${Dt.edgeIdx}:${B}`;J.set(gn,Jt)}}const mt=d(h=>!!s[h]?.labelNodeId,"edgeHasLabelNode"),kt=d((h,b)=>h?(m.get(`${h}:${b}:src`)??[]).some(({edgeIdx:C})=>mt(C))||(m.get(`${h}:${b}:dst`)??[]).some(({edgeIdx:C})=>mt(C)):!1,"faceHasLabelNode"),Pt=d((h,b,C)=>b==="top"||b==="bottom"?{x:h.x+C,y:h.y}:{x:h.x,y:h.y+C},"applyPortOffset"),Q=d((h,b,C)=>{const L=R.get(h),w={x:C.x??0,y:C.y??0},B={x:b.x??0,y:b.y??0},U=L?.srcSide??A(b,w),q=L?.dstSide??A(C,B);let z=L?I(b,L.srcSide):u(b,w,!0),Y=L?I(C,L.dstSide):u(C,B,!1);const ot=J.get(`${h}:src`),rt=J.get(`${h}:dst`);return ot!==void 0&&(z=Pt(z,U,ot)),rt!==void 0&&(Y=Pt(Y,q,rt)),{pSrcPort:z,pDstPort:Y,srcSide:U,dstSide:q}},"portsForEdge");for(const h of E){const b=s[h];if(f[h]=[],!b.start||!b.end||b.points&&b.points.length>0||b.start===b.end)continue;const C=r.get(b.start),L=r.get(b.end);if(!C||!L)continue;const{pSrcPort:w,pDstPort:B,srcSide:U,dstSide:q}=Q(h,C,L),z={...w},Y={...B},ot=U==="top"||U==="bottom",rt=q==="top"||q==="bottom";if(ot){const X=w.y>(C.y??0);z.y=X?w.y+ne:w.y-ne}else{const X=w.x>(C.x??0);z.x=X?w.x+ne:w.x-ne}if(rt){const X=B.y>(L.y??0);Y.y=X?B.y+ne:B.y-ne}else{const X=B.x>(L.x??0);Y.x=X?B.x+ne:B.x-ne}const st=d((X,$)=>{for(const K of g)if(!$.includes(K.nodeId)&&X.x>K.minX&&X.xK.minY&&X.y{if(Ct){const Nt=X.y>($.y??0);return{x:(K.x??0)>=X.x?lt.maxX+be:lt.minX-be,y:Nt?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:Nt}}const bt=X.x>($.x??0),Et=(K.y??0)>=X.y;return{x:bt?lt.maxX+be:lt.minX-be,y:Et?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:bt}},"obstacleDetour");let yt=[];const Rt=[b.start,b.end],Lt=st(z,Rt);if(Lt.inside&&Lt.obstacle){const X=Lt.obstacle;if(ot){const $=tt(w,C,L,X,!0);z.x=$.x,z.y=$.y;const K=$.leavesPositiveSide?Math.min(X.minY-2,w.y+ne):Math.max(X.maxY+2,w.y-ne);yt=[{x:w.x,y:K},{x:$.x,y:K},{x:$.x,y:$.y}]}else{const $=tt(w,C,L,X,!1),K=$.leavesPositiveSide?Math.min(X.minX-2,w.x+ne):Math.max(X.maxX+2,w.x-ne);z.x=$.x,z.y=$.y,yt=[{x:K,y:w.y},{x:K,y:$.y},{x:$.x,y:$.y}]}}let Dt=[];const Jt=st(Y,Rt);if(Jt.inside&&Jt.obstacle){const X=Jt.obstacle;if(rt){const $=tt(B,L,C,X,!0);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:B.x,y:$.y}]}else{const $=tt(B,L,C,X,!1);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:$.x,y:B.y}]}}if(yt.length===0&&Dt.length===0){const X=be,$=Math.abs(z.x-Y.x)1||bt>1,Nt=S.get(b.start??"")??0,ut=S.get(b.end??"")??0,Yt=Ct>1&&kt(b.start,U)||bt>1&&kt(b.end,q),ee=Ct<=1||Nt<=2,Bt=bt<=1||ut<=2;if(($||K)&&!lt&&(!Et||Et&&!Yt&&ee&&Bt)&&!T(w,B,b.start,b.end)){b.points=[{...w},{...z},{...Y},{...B}],y.add(h);const Mt=K?"horizontal":"vertical",$t=K?w.y:w.x,It=K?Math.min(w.x,B.x):Math.min(w.y,B.y),St=K?Math.max(w.x,B.x):Math.max(w.y,B.y),Wt={id:`fast-path-${Mt}-${$t.toFixed(0)}-${h}`,orientation:Mt,coord:$t,spanMin:It,spanMax:St,tracks:[]};p.push({edgeIndex:h,segmentIndex:0,orientation:Mt,pipe:Wt,trackIndex:0,from:It,to:St});continue}}const gn=x("vertical",z.x,z.y,z.y);z.x=gn.coord;const mr=x("vertical",Y.x,Y.y,Y.y);Y.x=mr.coord;let ue=Math.min(z.x,Y.x)-50,he=Math.max(z.x,Y.x)+50,ve=Math.min(z.y,Y.y)-50,Le=Math.max(z.y,Y.y)+50;for(const X of g){const $=Math.min(z.x,Y.x),K=Math.max(z.x,Y.x),lt=Math.min(z.y,Y.y),Ct=Math.max(z.y,Y.y);X.minX$&&X.minYlt&&(ue=Math.min(ue,X.minX-je),he=Math.max(he,X.maxX+je),ve=Math.min(ve,X.minY-je),Le=Math.max(Le,X.maxY+je))}for(const X of g){if(X.maxXhe||X.maxYLe)continue;const $=be;x("horizontal",X.minY-$,ue,he),x("horizontal",X.maxY+$,ue,he);const K=Te;x("vertical",X.minX-K,ve,Le),x("vertical",X.maxX+K,ve,Le)}x("horizontal",z.y,ue,he),x("horizontal",Y.y,ue,he);const yr=c.filter(X=>X.orientation==="horizontal"&&X.coord>=ve&&X.coord<=Le),xr=c.filter(X=>X.orientation==="vertical"&&X.coord>=ue&&X.coord<=he),ke=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),_e=ke(z.x,z.y),vo=ke(Y.x,Y.y),Fe=new Map,pn=new Map,mn=new Map,De=new Set,xe=[];Fe.set(_e,0),mn.set(_e,"n"),xe.push({key:_e,f:Math.hypot(Y.x-z.x,Y.y-z.y),pt:z}),De.add(_e);let Ht=[];const ge=d((X,$)=>T(X,$,b.start,b.end),"checkSegmentBlocked"),yn={x:Y.x,y:z.y},br=ge(z,yn),Mr=ge(yn,Y),Ir=br||Mr,xn={x:z.x,y:Y.y},Sr=ge(z,xn),Cr=ge(xn,Y);if(Ir?Sr||Cr||(Math.abs(z.x-Y.x)0;){xe.sort((ut,Yt)=>ut.f-Yt.f);const X=xe.shift();if(De.delete(X.key),X.key===vo){let ut=vo,Yt=Y;for(Ht=[Yt];pn.has(ut);){const ee=pn.get(ut);Ht.unshift(ee),Yt=ee,ut=ke(ee.x,ee.y)}break}const $=X.pt.x,K=X.pt.y,lt=xr.sort((ut,Yt)=>ut.coord-Yt.coord),Ct=lt.findIndex(ut=>Math.abs(ut.coord-$)<1),bt=yr.sort((ut,Yt)=>ut.coord-Yt.coord),Et=bt.findIndex(ut=>Math.abs(ut.coord-K)<1),Nt=[];Ct>0&&Nt.push({x:lt[Ct-1].coord,y:K}),Ct>=0&&Ct0&&Nt.push({x:$,y:bt[Et-1].coord}),Et>=0&&EtZt.nodeId===b.start||Zt.nodeId===b.end?!1:Yt!==ee?Zt.minYK&&Zt.maxX>Yt&&Zt.minX$&&Zt.maxY>Bt&&Zt.minY10&&bn<-5||Ee<-10&&bn>5)&&(St=Math.abs(bn)*100),(Wt>10&&He<-5||Wt<-10&&He>5)&&(St+=Math.abs(He)*50);let Lo=0;const Eo=mn.get(X.key)??"n",To=Math.abs(He)>ct?"h":"v";Eo!=="n"&&Eo!==To&&(Lo=50);const vr=$t+It+St+Lo,Xe=(Fe.get(X.key)??1/0)+vr,wo=Math.abs(Y.x-ut.x)+Math.abs(Y.y-ut.y);if(Xe<(Fe.get(Mt)??1/0))if(pn.set(Mt,X.pt),Fe.set(Mt,Xe),mn.set(Mt,To),!De.has(Mt))xe.push({key:Mt,f:Xe+wo,pt:ut}),De.add(Mt);else{const Zt=xe.findIndex(Lr=>Lr.key===Mt);Zt!==-1&&(xe[Zt].f=Xe+wo)}}}if(Ht.length===0&&(Ht=[z,{x:z.x,y:Y.y},Y]),Ht.length>4){const X=Ht[0],$=Ht[Ht.length-1];let K=Math.min(X.x,$.x),lt=Math.max(X.x,$.x),Ct=Math.min(X.y,$.y),bt=Math.max(X.y,$.y);for(const Bt of Ht)K=Math.min(K,Bt.x),lt=Math.max(lt,Bt.x),Ct=Math.min(Ct,Bt.y),bt=Math.max(bt,Bt.y);const Et=lt>Math.max(X.x,$.x),Nt=KIt.minXGt&&It.minYOt);if($t.length>0){let It=Math.max(X.x,$.x);for(const St of $t){const Wt=(St.minX+St.maxX)/2;if(St.visualXHalfExtent===void 0||isNaN(St.visualXHalfExtent))continue;const Ee=Wt+St.visualXHalfExtent+Bt;It=Math.max(It,Ee)}isNaN(It)||(lt=It)}}if(Nt){const Gt=g.filter(Ot=>Ot.minXMath.min(X.y,$.y));if(Gt.length>0){let Ot=Math.min(X.x,$.x);for(const Mt of Gt){const It=(Mt.minX+Mt.maxX)/2-Mt.visualXHalfExtent-Bt;Ot=Math.min(Ot,It)}K=Ot}}}const ut=d(Bt=>{const Gt=$.y>X.y,Ot=g.filter(It=>{const St=Math.min(X.x,$.x)It.minX,Wt=Math.min(X.y,$.y)It.minY;return St&&Wt});let Mt=Ot;if(a&&Ot.length>0){const It=Ot.filter(St=>St.minXBt);It.length>0&&(Mt=It)}if(Mt.length===0)return $.y;const $t=be;if(Gt){const St=Math.max(...Mt.map(Wt=>Wt.maxY))+$t;if(St<$.y-ct)return St}else{const St=Math.min(...Mt.map(Wt=>Wt.minY))-$t;if(St>$.y+ct)return St}return $.y},"findBestReturnY"),Yt=d(Bt=>{const Gt=ut(Bt),Ot={x:Bt,y:X.y},Mt={x:Bt,y:Gt},$t={x:$.x,y:Gt},It=ge(X,Ot),St=ge(Ot,Mt),Wt=ge(Mt,$t),Ee=Gt!==$.y?ge($t,$):!1;return!It&&!St&&!Wt&&!Ee?Math.abs(Gt-$.y)=3){const X=Xt[Xt.length-1],$=Xt[Xt.length-2],K=Xt[Xt.length-3],lt=Math.abs(K.y-$.y)Math.abs(X.x-K.x)&&Xt.splice(-2,1)}else if(Ct){const bt=Math.sign($.y-K.y),Et=Math.sign(X.y-K.y);bt!==0&&bt===Et&&Math.abs($.y-K.y)>Math.abs(X.y-K.y)&&Xt.splice(-2,1)}}const ie=[Xt[0]];for(let X=1;X$.x,bt=lt.x>K.x;if(Ct!==bt){ie.push(K);continue}continue}if(Math.abs($.x-K.x)$.y,bt=lt.y>K.y;if(Ct!==bt){ie.push(K);continue}continue}ie.push(K)}ie.push(Xt[Xt.length-1]);for(let X=0;Xh.from{const w=!L.segments.some(U=>(U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex)&&W(U,h)),B=!C.segments.some(U=>(U.edgeIndex!==h.edgeIndex||U.segmentIndex!==h.segmentIndex)&&W(U,b));return w&&B?(h.trackIndex=L.index,b.trackIndex=C.index,C.segments=[...C.segments.filter(U=>U.edgeIndex!==h.edgeIndex||U.segmentIndex!==h.segmentIndex),{edgeIndex:b.edgeIndex,segmentIndex:b.segmentIndex,from:b.from,to:b.to}],L.segments=[...L.segments.filter(U=>U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex),{edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to}],!0):!1},"trySwapSegmentsAcrossTracks"),at=d(h=>{const b=h.tracks.length;return h.tracks[b]={index:b,coord:h.coord,segments:[]},b},"createNewTrack"),gt=d((h,b)=>{const C=h.pipe.tracks[h.trackIndex];C.segments=C.segments.filter(w=>w.edgeIndex!==h.edgeIndex||w.segmentIndex!==h.segmentIndex),h.trackIndex=b,h.pipe.tracks[b].segments.push({edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to})},"moveSegmentToTrack"),xt=d((h,b)=>{const C=f[h.edgeIndex];for(const L of C){const w=p[L];w.pipe===h.pipe&>(w,b)}},"moveSegmentChainToTrack"),vt=d(h=>{const b=f[h.edgeIndex],C=b.indexOf(p.indexOf(h)),L=[];return C>0&&L.push(p[b[C-1]]),C{if(h.orientation===b.orientation)return!1;const C=h.orientation==="horizontal"?h:b,L=h.orientation==="horizontal"?b:h;return L.pipe.coord>C.from&&L.pipe.coordL.from&&C.pipe.coord{for(const C of h.tracks)if(!C.segments.some(w=>(w.edgeIndex!==b.edgeIndex||w.segmentIndex!==b.segmentIndex)&&W(w,b)))return C.index;return-1},"findAvailableTrack"),Ut=d((h,b)=>{if(h.trackIndex===b.trackIndex)return W(h,b);const C=vt(h),L=vt(b);return C.some(w=>L.some(B=>Vt(w,B)))},"segmentsConflict"),te=d((h,b,C)=>{if(et(h,b,h.pipe.tracks[h.trackIndex],b.pipe.tracks[b.trackIndex]))return;const L=jt(h.pipe,b);C(b,L!==-1?L:at(h.pipe))},"resolveTrackConflict"),Se=d(h=>{let b=0;for(let C=0;C{if(de.has(h))return de.get(h);const b=f[h];if(b.length===0){const q={dest:0,deviation:0,base:0,delta:0};return de.set(h,q),q}const L=p[b[0]].pipe.coord;let w=L;for(let q=1;qMath.abs(ot-L)?Y:ot;break}}const B=Math.abs(w-L),U={dest:w,deviation:B,base:L,delta:w-L};return de.set(h,U),U},"getDestInfo"),dn=d(()=>{let h=0;const b=new Map;for(const[L,w]of s.entries())f[L].length!==0&&w.start&&(b.has(w.start)||b.set(w.start,[]),b.get(w.start).push(L));const C=d(L=>{const w=s[L];if(!w.start||!w.end)return 0;const B=r.get(w.start),U=r.get(w.end);if(!B||!U)return 0;const q=(U.x??0)-(B.x??0),z=(U.y??0)-(B.y??0);return Math.abs(q)+Math.abs(z)},"getEdgeDistance");for(const L of b.values()){L.sort((B,U)=>{const q=Ce(B),z=Ce(U);if(Math.abs(q.deviation-z.deviation)>1)return q.deviation-z.deviation;if(Math.abs(q.dest-z.dest)>1)return q.dest-z.dest;const Y=C(B),ot=C(U);if(Math.abs(Y-ot)>1)return ot-Y;const rt=f[B].length,st=f[U].length;if(rt!==st)return rt-st;if(rt===1){const tt=f[B][0],yt=f[U][0];if(p[tt]&&p[yt]){const Rt=p[tt],Lt=p[yt],Dt=Math.abs(Rt.to-Rt.from),Jt=Math.abs(Lt.to-Lt.from);if(Math.abs(Dt-Jt)>1)return Dt-Jt}}return 0});const w=L.map(B=>p[f[B][0]]);h+=Se(w)}return h},"fixSourceHandleCrossings"),un=d(()=>{let h=0;const b=new Map;for(const[C,L]of s.entries())f[C].length!==0&&L.end&&(b.has(L.end)||b.set(L.end,[]),b.get(L.end).push(C));for(const C of b.values()){C.sort((w,B)=>{const U=d(Y=>{const ot=f[Y];if(ot.length<2)return 0;const rt=p[ot[ot.length-2]];return Math.abs(rt.to-rt.from)},"getDist"),q=U(w),z=U(B);return Math.abs(q-z)>.1?q-z:w-B});const L=C.map(w=>p[f[w][f[w].length-1]]);h+=Se(L)}return h},"fixTargetHandleCrossings"),hn=d(()=>{let h=0;for(const b of c){const C=[];for(const L of b.tracks)for(const w of L.segments){const B=f[w.edgeIndex].find(U=>p[U].segmentIndex===w.segmentIndex);B!==void 0&&C.push(p[B])}C.sort((L,w)=>L.edgeIndex-w.edgeIndex||L.segmentIndex-w.segmentIndex);for(let L=0;L{L.segments.forEach(w=>{b.push({edgeIndex:w.edgeIndex,segmentIndex:w.segmentIndex,trackIndex:L.index,from:w.from,to:w.to})})}),b.sort((L,w)=>L.from-w.from);const C=[];if(b.length>0){let L=[b[0]],w=b[0].to;for(let B=1;Bw.add(tt.trackIndex));const B=new Map;L.forEach(tt=>{const yt=Ce(tt.edgeIndex);B.set(tt.trackIndex,(B.get(tt.trackIndex)??0)+yt.delta)});const U=[...w].filter(tt=>(B.get(tt)??0)<-1),q=[...w].filter(tt=>(B.get(tt)??0)>1),z=[...w].filter(tt=>Math.abs(B.get(tt)??0)<=1);U.sort((tt,yt)=>(B.get(yt)??0)-(B.get(tt)??0)),q.sort((tt,yt)=>(B.get(tt)??0)-(B.get(yt)??0));const Y=d((tt,yt)=>{L.filter(Rt=>Rt.trackIndex===tt).forEach(Rt=>{const Lt=y.has(Rt.edgeIndex)?h.coord:yt;D.set(`${Rt.edgeIndex}-${Rt.segmentIndex}`,Lt)})},"assignCoord");let ot=0;for(const tt of U)ot++,Y(tt,h.coord-ot*Cn);if(z.length===0&&w.size>0){const tt=[...w].sort((Lt,Dt)=>Math.abs(B.get(Lt)??0)-Math.abs(B.get(Dt)??0))[0],yt=U.indexOf(tt);yt!==-1&&U.splice(yt,1);const Rt=q.indexOf(tt);Rt!==-1&&q.splice(Rt,1),z.push(tt)}let rt=0;for(const tt of z){if(rt===0)Y(tt,h.coord);else{const yt=rt%2===1?1:-1,Rt=Math.ceil(rt/2);Y(tt,h.coord+yt*Rt*Cn*.5)}rt++}let st=0;for(const tt of q)st++,Y(tt,h.coord+st*Cn)}}for(const[h,b]of s.entries()){const C=f[h]??[];if(C.length===0)continue;const L=[],w=r.get(b.start),B=r.get(b.end),{pSrcPort:U,pDstPort:q}=Q(h,w,B),z=C.map(rt=>{const st=p[rt],tt=D.get(`${st.edgeIndex}-${st.segmentIndex}`)??st.pipe.coord;return{orient:st.orientation,coord:tt,from:st.from,to:st.to}});L.push(U);for(let rt=0;rtct&&L.push(Me(st,yt)),Dt&&Lt.orient===st.orient)if(Math.abs(st.coord-Lt.coord)>ct){const Jt=st.orient==="vertical"?(yt+Lt.from)/2:no(st,Lt);L.push(Me(st,Jt),Me(Lt,Jt))}else(rt===0||rt===z.length-2)&&L.push(Me(st,no(st,Lt)));else if(Dt)L.push(Me(st,Lt.coord));else{const Jt=Math.abs(st.from-yt)ct||Math.abs(Y.y-q.y)>ct)&&L.push(q);const ot=[];L.length>0&&ot.push(L[0]);for(let rt=1;rtct||Math.abs(st.y-tt.y)>ct)&&ot.push(st)}b.points=ot}for(const h of s){const b=h.__originalEdge;b&&h.points&&(b.points=h.points)}t.edges=(t.edges??[]).filter(h=>!h.isLayoutOnly);const V=d((h,b)=>{const C=b.x??0,L=b.y??0,w=b.width??0,B=b.height??0;if(w<=0||B<=0)return h;const U=C-w/2,q=C+w/2,z=L-B/2,Y=L+B/2;if(h.xq||h.yY)return h;const ot=h.x-U,rt=q-h.x,st=h.y-z,tt=Y-h.y,yt=Math.min(ot,rt,st,tt);return yt===ot?{x:U,y:h.y}:yt===rt?{x:q,y:h.y}:yt===st?{x:h.x,y:z}:{x:h.x,y:Y}},"nodeBoundaryClamp");for(const h of t.edges){const b=h.points;if(!b||b.length<2)continue;const C=h.start,L=h.end,w=C?r.get(C):void 0,B=L?r.get(L):void 0;w&&(b[0]=V(b[0],w)),B&&(b[b.length-1]=V(b[b.length-1],B))}return t}d(hr,"routeEdgesOrthogonal");function gr(t){return t.direction??"TB"}d(gr,"getSwimlaneDirection");function pr(t){const e=Jo(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,s=t.config.swimlane?.ignoreCrossLaneEdges??!0,r=t.config.swimlane?.optimizeRanksByCrossings??!0,i=t.config.swimlane?.automaticLaneOrdering??!1,c=gr(t),{ordered:a,coordinates:l}=ur(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:i,direction:c});Zo(e,a,l,{nodeGap:n,layerGap:o});for(const g of t.edges??[])delete g.points;hr(t,c);for(const g of t.edges??[])(!g.curve||g.curve==="basis")&&(g.curve="rounded");return Rs(t,c),As(t),c}d(pr,"runSwimlaneLayoutCore");async function Qr(t,e){const n=e.select("g");wr(n,t.markers,t.type,t.diagramId),Ar(),Rr(),Nr(),Tr(),qo(t);const o=Qo(t);t.nodes=o.nodes,t.edges=o.edges;const{groups:s}=await _o(n,t);pr(t),await Uo(t,s)}d(Qr,"render");export{Qr as render}; diff --git a/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-Ou5HSK_e.js b/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-Ou5HSK_e.js new file mode 100644 index 00000000000..6774f746023 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-Ou5HSK_e.js @@ -0,0 +1,8 @@ +import{c as r,s as e}from"./flowDiagram-23GEKE2U-CAiKF6Zk.js";import{_ as a}from"./mermaid.core-XMN3hSDH.js";import"./chunk-5VM5RSS4-BV4ucc4y.js";import"./chunk-XXDRQBXY-BLb3KbCy.js";import"./chunk-VR4S4FIN-DXOr7Xkl.js";import"./chunk-32BRIVSS-BXcVdJ-W.js";import"./channel-C-YOi8lT.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var o=a(t=>`${e(t)} + .swimlane.cluster rect { + stroke: ${t.clusterBorder} !important; + } + [data-look="neo"].cluster rect { + filter: none; + } +`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-gPkWeD2t.js b/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-gPkWeD2t.js deleted file mode 100644 index 2ec829cf741..00000000000 --- a/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-gPkWeD2t.js +++ /dev/null @@ -1,8 +0,0 @@ -import{c as r,s as e}from"./flowDiagram-23GEKE2U-CSk8qFwd.js";import{_ as a}from"./mermaid.core-CGrLstUA.js";import"./chunk-5VM5RSS4-K_NNkrmw.js";import"./chunk-XXDRQBXY-BwEKpC0s.js";import"./chunk-VR4S4FIN-Cp8JVohH.js";import"./chunk-32BRIVSS-0ImWpiFu.js";import"./channel-5_2atmZK.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var o=a(t=>`${e(t)} - .swimlane.cluster rect { - stroke: ${t.clusterBorder} !important; - } - [data-look="neo"].cluster rect { - filter: none; - } -`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-CsGFMDtB.js b/apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-DTRr-LYc.js similarity index 99% rename from apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-CsGFMDtB.js rename to apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-DTRr-LYc.js index 2e33f472bc2..e89f6bb4a67 100644 --- a/apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-CsGFMDtB.js +++ b/apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-DTRr-LYc.js @@ -1,4 +1,4 @@ -import{_ as o,y as pt,aa as Rt,ab as Ct,ac as Wt,c as gt,l as E,D as Pt,K as Bt,ad as ft,d as X,t as Vt,ae as Ft,p as zt}from"./mermaid.core-CGrLstUA.js";import{d as ot}from"./arc-C525Mmp6.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var U=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`: +import{_ as o,y as pt,aa as Rt,ab as Ct,ac as Wt,c as gt,l as E,D as Pt,K as Bt,ad as ft,d as X,t as Vt,ae as Ft,p as zt}from"./mermaid.core-XMN3hSDH.js";import{d as ot}from"./arc-x24dd6EE.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var U=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`: `+w.showPosition()+` Expecting `+j.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:j})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},U&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-B5PLrg4a.js b/apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-CF_UwcSA.js similarity index 99% rename from apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-B5PLrg4a.js rename to apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-CF_UwcSA.js index d96341bdc06..8c12d05831f 100644 --- a/apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-B5PLrg4a.js +++ b/apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-CF_UwcSA.js @@ -1,4 +1,4 @@ -import{b4 as Wt,s as Kt,g as Ht,o as Yt,n as Xt,a as Zt,b as Jt,_ as w,y as wt,D as Qt,d as ot,al as $t,aa as te,ab as ee,ac as ne,e as se,p as ie,A as oe,B as re}from"./mermaid.core-CGrLstUA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;ua.angle-u.angle);let f=e[e.length-1];for(let u=0;up.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(f)ct(n))}function $(t,n){let s=0;for(let e=0;ev.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx=1)break;for(let d=1;dl+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a{const y={};for(let h=0;hxt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;ul===f?0:lo.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;hy.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;bt[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(F=>D.has(F)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let T=!1;O.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(T=!0,R[k.sets[0]]=Me(F))});function A(k){return F=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=K(G.exit()).remove();typeof G.transition=="function"&&j.selectAll("path").attrTween("d",A);const X=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(` +import{b4 as Wt,s as Kt,g as Ht,o as Yt,n as Xt,a as Zt,b as Jt,_ as w,y as wt,D as Qt,d as ot,al as $t,aa as te,ab as ee,ac as ne,e as se,p as ie,A as oe,B as re}from"./mermaid.core-XMN3hSDH.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;ua.angle-u.angle);let f=e[e.length-1];for(let u=0;up.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(f)ct(n))}function $(t,n){let s=0;for(let e=0;ev.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx=1)break;for(let d=1;dl+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a{const y={};for(let h=0;hxt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;ul===f?0:lo.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;hy.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;bt[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(F=>D.has(F)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let T=!1;O.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(T=!0,R[k.sets[0]]=Me(F))});function A(k){return F=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=K(G.exit()).remove();typeof G.transition=="function"&&j.selectAll("path").attrTween("d",A);const X=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(` M`,t,n),e.push(` m`,-s,0),e.push(` a`,s,s,0,1,0,s*2,0),e.push(` diff --git a/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-Ii2EKmOx.js b/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-BMAq9omn.js similarity index 98% rename from apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-Ii2EKmOx.js rename to apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-BMAq9omn.js index b1346c4e589..87d00e5dbcd 100644 --- a/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-Ii2EKmOx.js +++ b/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-BMAq9omn.js @@ -1,4 +1,4 @@ -import{B as t,a as o,C as r,D as n,E as i,b as c,c as l,F as d,K as p,R as b,S as m,d as f,T as u,e as h,f as S,g as y,h as R,i as v,V as C,j as g,k as w,l as T,m as E,n as x,o as M,p as k,q as D,r as P,s as V,t as A,u as B,v as H,w as N,x as O,y as I,z,A as F,G as U,H as K,I as W,J as j,L as q,M as G,N as L,O as J,P as Q,Q as X,U as Y,W as Z,X as _,Y as $,Z as aa,_ as ea,$ as sa,a0 as ta,a1 as oa,a2 as ra,a3 as na,a4 as ia,a5 as ca,a6 as la,a7 as da,a8 as pa,a9 as ba,aa as ma,ab as fa,ac as ua,ad as ha,ae as Sa,af as ya,ag as Ra,ah as va,ai as Ca,aj as ga,ak as wa,al as Ta,am as Ea,an as xa,ao as Ma,ap as ka,aq as Da,ar as Pa,as as Va,at as Aa,au as Ba,av as Ha,aw as Na,ax as Oa,ay as Ia,az as za,aA as Fa,aB as Ua,aC as Ka,aD as Wa,aE as ja,aF as qa,aG as Ga,aH as La,aI as Ja,aJ as Qa,aK as Xa,aL as Ya,aM as Za,aN as _a,aO as $a,aP as ae,aQ as ee,aR as se,aS as te,aT as oe,aU as re,aV as ne,aW as ie,aX as ce,aY as le,aZ as de,a_ as pe,a$ as be,b0 as me,b1 as fe,b2 as ue,b3 as he,b4 as Se,b5 as ye,b6 as Re,b7 as ve,b8 as Ce,b9 as ge,ba as we,bb as Te,bc as Ee,bd as xe,be as Me,bf as ke,bg as De,bh as Pe,bi as Ve,bj as Ae,bk as Be,bl as He,bm as Ne,bn as Oe,bo as Ie,bp as ze,bq as Fe,br as Ue,bs as Ke,bt as We,bu as je,bv as qe,bw as Ge,bx as Le,by as Je,bz as Qe,bA as Xe,bB as Ye,bC as Ze,bD as _e,bE as $e,bF as as,bG as es,bH as ss,bI as ts,bJ as os,bK as rs,bL as ns,bM as is,bN as cs,bO as ls,bP as ds}from"./index-CvgiEu-R.js";/** +import{B as t,a as o,C as r,D as n,E as i,b as c,c as l,F as d,K as p,R as b,S as m,d as f,T as u,e as h,f as S,g as y,h as R,i as v,V as C,j as g,k as w,l as T,m as E,n as x,o as M,p as k,q as D,r as P,s as V,t as A,u as B,v as H,w as N,x as O,y as I,z,A as F,G as U,H as K,I as W,J as j,L as q,M as G,N as L,O as J,P as Q,Q as X,U as Y,W as Z,X as _,Y as $,Z as aa,_ as ea,$ as sa,a0 as ta,a1 as oa,a2 as ra,a3 as na,a4 as ia,a5 as ca,a6 as la,a7 as da,a8 as pa,a9 as ba,aa as ma,ab as fa,ac as ua,ad as ha,ae as Sa,af as ya,ag as Ra,ah as va,ai as Ca,aj as ga,ak as wa,al as Ta,am as Ea,an as xa,ao as Ma,ap as ka,aq as Da,ar as Pa,as as Va,at as Aa,au as Ba,av as Ha,aw as Na,ax as Oa,ay as Ia,az as za,aA as Fa,aB as Ua,aC as Ka,aD as Wa,aE as ja,aF as qa,aG as Ga,aH as La,aI as Ja,aJ as Qa,aK as Xa,aL as Ya,aM as Za,aN as _a,aO as $a,aP as ae,aQ as ee,aR as se,aS as te,aT as oe,aU as re,aV as ne,aW as ie,aX as ce,aY as le,aZ as de,a_ as pe,a$ as be,b0 as me,b1 as fe,b2 as ue,b3 as he,b4 as Se,b5 as ye,b6 as Re,b7 as ve,b8 as Ce,b9 as ge,ba as we,bb as Te,bc as Ee,bd as xe,be as Me,bf as ke,bg as De,bh as Pe,bi as Ve,bj as Ae,bk as Be,bl as He,bm as Ne,bn as Oe,bo as Ie,bp as ze,bq as Fe,br as Ue,bs as Ke,bt as We,bu as je,bv as qe,bw as Ge,bx as Le,by as Je,bz as Qe,bA as Xe,bB as Ye,bC as Ze,bD as _e,bE as $e,bF as as,bG as es,bH as ss,bI as ts,bJ as os,bK as rs,bL as ns,bM as is,bN as cs,bO as ls,bP as ds}from"./index-ChnXJINq.js";/** * vue v3.5.39 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT diff --git a/apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-B6OLyL9l.js b/apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-Dlkrf9qY.js similarity index 99% rename from apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-B6OLyL9l.js rename to apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-Dlkrf9qY.js index 06e5c66d17d..d2faab613fa 100644 --- a/apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-B6OLyL9l.js +++ b/apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-Dlkrf9qY.js @@ -1,4 +1,4 @@ -import{p as St}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{s as Mt,g as Nt,o as zt,n as Lt,a as Tt,b as At,_ as u,E as Xt,y as Et,A as U,l as K,D as Yt,e as It,p as Bt,c as j}from"./mermaid.core-CGrLstUA.js";import{p as Ft}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var D=u((e,n)=>{const r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=u((e,n,r)=>({x:D(n,`${r} evolution`),y:D(e,`${r} visibility`)}),"toCoordinates"),J=u(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Rt=u(e=>{if(!e?.startsWith("+"))return{};const r=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:r}:e.includes("<")?{flow:"backward",label:r}:e.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Ot=u((e,n)=>{if(St(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){const r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),x=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:x})}if(e.anchors.forEach(r=>{const x=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,x.x,x.y,"anchor")}),e.components.forEach(r=>{const x=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,d=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,w=r.decorator?.strategy;n.addNode(r.name,r.name,x.x,x.y,"component",a,d,r.inertia,w)}),e.notes.forEach(r=>{const x=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,x.x,x.y)}),e.pipelines.forEach(r=>{const x=n.getNode(r.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const a=x.y;n.startPipeline(r.parent),r.components.forEach(d=>{const w=`${r.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=D(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(w,d.name,F,a,"pipeline-component",C,g),n.addPipelineComponent(r.parent,w)})}),e.links.forEach(r=>{const x=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let a=J(r.fromPort)??J(r.toPort);const{flow:d,label:w}=Rt(r.arrow);!a&&d&&(a=d);const C=r.linkLabel,g=w??C;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),x,g,a)}),e.evolves.forEach(r=>{const x=n.getNode(r.component);if(x?.y!==void 0){const a=D(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,x.y)}}),e.annotations.length>0){const r=e.annotations[0],x=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(x.x,x.y)}e.annotation.forEach(r=>{const x=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:x.x,y:x.y}],r.text)}),e.accelerators.forEach(r=>{const x=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,x.x,x.y)}),e.deaccelerators.forEach(r=>{const x=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,x.x,x.y)})},"populateDb"),Q={parser:{yy:void 0},parse:u(async e=>{const n=await Ft("wardley",e);K.debug(n);const r=Q.parser?.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ot(n,r)},"parse")},Wt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{u(this,"WardleyBuilder")}addNode(e){const n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){const r=this.pipelines.get(e);r&&r.componentIds.push(n);const x=this.nodes.get(n);x&&(x.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[n,r]of this.nodes)if(r.label===e)return n;return e}build(){const e=[];for(const n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},k=new Wt;function tt(){return j()["wardley-beta"]}u(tt,"getConfig");function et(e,n,r,x,a,d,w,C,g){k.addNode({id:e,label:n,x:r,y:x,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(et,"addNode");function at(e,n,r=!1,x,a){k.addLink({source:e,target:n,dashed:r,label:x,flow:a})}u(at,"addLink");function rt(e,n,r){k.addTrend({nodeId:e,targetX:n,targetY:r})}u(rt,"addTrend");function ot(e,n,r){k.addAnnotation({number:e,coordinates:n,text:r})}u(ot,"addAnnotation");function nt(e,n,r){k.addNote({text:e,x:n,y:r})}u(nt,"addNote");function st(e,n,r){k.addAccelerator({name:e,x:n,y:r})}u(st,"addAccelerator");function it(e,n,r){k.addDeaccelerator({name:e,x:n,y:r})}u(it,"addDeaccelerator");function dt(e,n){k.setAnnotationsBox(e,n)}u(dt,"setAnnotationsBox");function lt(e,n){k.setSize(e,n)}u(lt,"setSize");function ct(e){k.startPipeline(e)}u(ct,"startPipeline");function pt(e,n){k.addPipelineComponent(e,n)}u(pt,"addPipelineComponent");function ft(e){k.setAxes(e)}u(ft,"updateAxes");function ht(e){return k.getNode(e)}u(ht,"getNode");function xt(e){return k.resolveNodeId(e)}u(xt,"resolveNodeId");function gt(){return k.build()}u(gt,"getWardleyData");function yt(){k.clear(),Bt()}u(yt,"clear");var Dt={getConfig:tt,addNode:et,addLink:at,addTrend:rt,addAnnotation:ot,addNote:nt,addAccelerator:st,addDeaccelerator:it,setAnnotationsBox:dt,setSize:lt,startPipeline:ct,addPipelineComponent:pt,updateAxes:ft,getNode:ht,resolveNodeId:xt,getWardleyData:gt,clear:yt,setAccTitle:At,getAccTitle:Tt,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Nt,setAccDescription:Mt},Gt=["Genesis","Custom Built","Product","Commodity"],qt=u(()=>{const{themeVariables:e}=j();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme"),Ht=u(()=>{const e=j()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},"getConfigValues"),jt=u((e,n,r,x)=>{K.debug(`Rendering Wardley map +import{p as St}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{s as Mt,g as Nt,o as zt,n as Lt,a as Tt,b as At,_ as u,E as Xt,y as Et,A as U,l as K,D as Yt,e as It,p as Bt,c as j}from"./mermaid.core-XMN3hSDH.js";import{p as Ft}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var D=u((e,n)=>{const r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=u((e,n,r)=>({x:D(n,`${r} evolution`),y:D(e,`${r} visibility`)}),"toCoordinates"),J=u(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Rt=u(e=>{if(!e?.startsWith("+"))return{};const r=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:r}:e.includes("<")?{flow:"backward",label:r}:e.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Ot=u((e,n)=>{if(St(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){const r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),x=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:x})}if(e.anchors.forEach(r=>{const x=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,x.x,x.y,"anchor")}),e.components.forEach(r=>{const x=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,d=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,w=r.decorator?.strategy;n.addNode(r.name,r.name,x.x,x.y,"component",a,d,r.inertia,w)}),e.notes.forEach(r=>{const x=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,x.x,x.y)}),e.pipelines.forEach(r=>{const x=n.getNode(r.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const a=x.y;n.startPipeline(r.parent),r.components.forEach(d=>{const w=`${r.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=D(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(w,d.name,F,a,"pipeline-component",C,g),n.addPipelineComponent(r.parent,w)})}),e.links.forEach(r=>{const x=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let a=J(r.fromPort)??J(r.toPort);const{flow:d,label:w}=Rt(r.arrow);!a&&d&&(a=d);const C=r.linkLabel,g=w??C;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),x,g,a)}),e.evolves.forEach(r=>{const x=n.getNode(r.component);if(x?.y!==void 0){const a=D(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,x.y)}}),e.annotations.length>0){const r=e.annotations[0],x=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(x.x,x.y)}e.annotation.forEach(r=>{const x=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:x.x,y:x.y}],r.text)}),e.accelerators.forEach(r=>{const x=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,x.x,x.y)}),e.deaccelerators.forEach(r=>{const x=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,x.x,x.y)})},"populateDb"),Q={parser:{yy:void 0},parse:u(async e=>{const n=await Ft("wardley",e);K.debug(n);const r=Q.parser?.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ot(n,r)},"parse")},Wt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{u(this,"WardleyBuilder")}addNode(e){const n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){const r=this.pipelines.get(e);r&&r.componentIds.push(n);const x=this.nodes.get(n);x&&(x.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[n,r]of this.nodes)if(r.label===e)return n;return e}build(){const e=[];for(const n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},k=new Wt;function tt(){return j()["wardley-beta"]}u(tt,"getConfig");function et(e,n,r,x,a,d,w,C,g){k.addNode({id:e,label:n,x:r,y:x,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(et,"addNode");function at(e,n,r=!1,x,a){k.addLink({source:e,target:n,dashed:r,label:x,flow:a})}u(at,"addLink");function rt(e,n,r){k.addTrend({nodeId:e,targetX:n,targetY:r})}u(rt,"addTrend");function ot(e,n,r){k.addAnnotation({number:e,coordinates:n,text:r})}u(ot,"addAnnotation");function nt(e,n,r){k.addNote({text:e,x:n,y:r})}u(nt,"addNote");function st(e,n,r){k.addAccelerator({name:e,x:n,y:r})}u(st,"addAccelerator");function it(e,n,r){k.addDeaccelerator({name:e,x:n,y:r})}u(it,"addDeaccelerator");function dt(e,n){k.setAnnotationsBox(e,n)}u(dt,"setAnnotationsBox");function lt(e,n){k.setSize(e,n)}u(lt,"setSize");function ct(e){k.startPipeline(e)}u(ct,"startPipeline");function pt(e,n){k.addPipelineComponent(e,n)}u(pt,"addPipelineComponent");function ft(e){k.setAxes(e)}u(ft,"updateAxes");function ht(e){return k.getNode(e)}u(ht,"getNode");function xt(e){return k.resolveNodeId(e)}u(xt,"resolveNodeId");function gt(){return k.build()}u(gt,"getWardleyData");function yt(){k.clear(),Bt()}u(yt,"clear");var Dt={getConfig:tt,addNode:et,addLink:at,addTrend:rt,addAnnotation:ot,addNote:nt,addAccelerator:st,addDeaccelerator:it,setAnnotationsBox:dt,setSize:lt,startPipeline:ct,addPipelineComponent:pt,updateAxes:ft,getNode:ht,resolveNodeId:xt,getWardleyData:gt,clear:yt,setAccTitle:At,getAccTitle:Tt,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Nt,setAccDescription:Mt},Gt=["Genesis","Custom Built","Product","Commodity"],qt=u(()=>{const{themeVariables:e}=j();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme"),Ht=u(()=>{const e=j()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},"getConfigValues"),jt=u((e,n,r,x)=>{K.debug(`Rendering Wardley map `+e);const a=Ht(),d=qt(),w=a.nodeRadius*1.6,C=x.db,g=C.getWardleyData(),F=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,E=Yt(n);E.selectAll("*").remove(),It(E,b,S,a.useMaxWidth),E.attr("viewBox",`0 0 ${S} ${b}`);const v=E.append("g").attr("class","wardley-map"),G=E.append("defs");G.append("marker").attr("id",`arrow-${n}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-end-${n}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-start-${n}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const Y=S-a.padding*2,I=b-a.padding*2;F&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(F);const z=u(t=>a.padding+t/100*Y,"projectX"),L=u(t=>b-a.padding-t/100*I,"projectY"),R=v.append("g").attr("class","wardley-axes");R.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),R.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const ut=g.axes.xLabel??"Evolution",wt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+Y/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(ut),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+I/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+I/2})`).text(wt);const B=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Gt;if(B.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,o=[];if(s&&s.length===B.length){let i=0;s.forEach(p=>{o.push({start:i,end:p}),i=p})}else{const i=1/B.length;B.forEach((p,l)=>{o.push({start:l*i,end:(l+1)*i})})}B.forEach((i,p)=>{const l=o[p],f=a.padding+l.start*Y,h=a.padding+l.end*Y,y=(f+h)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const o=s/4,i=a.padding+Y*o;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-I*o).attr("y2",b-a.padding-I*o).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(o=>{if(o.componentIds.length===0)return;const i=o.componentIds.map(h=>({id:h,pos:c.get(h),node:g.nodes.find(y=>y.id===h)})).filter(h=>h.pos&&h.node).sort((h,y)=>h.node.x-y.node.x);for(let h=0;h{const y=c.get(h);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(o.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const V=v.append("g").attr("class","wardley-links"),_=new Map;g.pipelines.forEach(t=>{_.set(t.nodeId,new Set(t.componentIds))});const Z=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||_.get(t.target)?.has(t.source)));V.selectAll("line").data(Z).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.x+l/h*p}).attr("y1",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.y+f/h*p}).attr("x2",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.x+l/h*p}).attr("y2",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.y+f/h*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${n})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${n})`:null),V.selectAll("text").data(Z.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=o.y-s.y,l=o.x-s.x,f=Math.sqrt(l*l+p*p),h=8,y=p/f;return i+y*h}).attr("y",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.y+o.y)/2,p=o.x-s.x,l=o.y-s.y,f=Math.sqrt(p*p+l*l),h=8,y=-p/f;return i+y*h}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=(s.y+o.y)/2,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f),y=8,m=f/h,P=-l/h,N=i+m*y,O=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${O})`}).text(t=>t.label);const mt=v.append("g").attr("class","wardley-trends"),kt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const o=z(t.targetX),i=L(t.targetY),p=o-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),h=a.nodeRadius+2,y=f>h?o-p/f*h:o,m=f>h?i-l/f*h:i;return{origin:s,targetX:o,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);mt.selectAll("line").data(kt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${n})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const q=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let o=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y1",t=>{const s=c.get(t.id),o=t.isPipelineParent?w:a.nodeRadius*2;return s.y-o/2}).attr("x2",t=>{const s=c.get(t.id);let o=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y2",t=>{const s=c.get(t.id),o=t.isPipelineParent?w:a.nodeRadius*2;return s.y+o/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let o=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(o+=10);const i=t.labelOffsetX??o;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let o=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(o-=10);const i=t.labelOffsetY??o;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const o=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(o.length>1)for(let i=0;i{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),o=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),h=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(h.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",o+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(H=>{const W=H.node(),Pt=W.getComputedTextLength();m=Math.max(m,Pt);const Ct=W.getBBox();P=Math.max(P,Ct.height)});const N=m+i*2+105,O=h.length*p+i*2+P/2,X=a.padding,bt=S-a.padding-N,$t=a.padding,vt=b-a.padding-O;s=Math.max(X,Math.min(s,bt)),o=Math.max($t,Math.min(o,vt)),y.forEach((H,W)=>{H.attr("x",s+i).attr("y",o+i+(W+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",o).attr("width",N).attr("height",O).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const o=z(s.x),i=L(s.y);t.append("text").attr("x",o).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=` M ${o} ${i-l/2} L ${o+p-f} ${i-l/2} diff --git a/apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-DfHxJPKU.js b/apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-OovywL2x.js similarity index 99% rename from apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-DfHxJPKU.js rename to apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-OovywL2x.js index 54865583e36..e586c0b20ed 100644 --- a/apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-DfHxJPKU.js +++ b/apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-OovywL2x.js @@ -1,4 +1,4 @@ -import{s as si,g as ai,o as Et,n as ni,a as oi,b as ri,_ as n,l as It,D as hi,e as li,p as ci,y as pt,i as ui,A as Mt,B as gi,E as xi,az as di,a7 as Dt}from"./mermaid.core-CGrLstUA.js";import{i as fi}from"./init-Gi6I4Gst.js";import{o as pi}from"./ordinal-Cboi1Yqb.js";import{l as vt}from"./linear-Cu3jckud.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";import"./defaultLocale-DX6XiGOO.js";function mi(t,i,e){t=+t,i=+i,e=(a=arguments.length)<2?(i=t,t=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((i-t)/e))|0,c=new Array(a);++s"u"&&(D.yylloc={});var ht=D.yylloc;o.push(ht);var ii=D.options&&D.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ei(z){g.length=g.length-2*z,w.length=w.length-z,o.length=o.length-z}n(ei,"popStack");function kt(){var z;return z=x.pop()||D.lex()||_t,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(kt,"lex");for(var M,$,O,lt,G={},st,N,Tt,at;;){if($=g[g.length-1],this.defaultActions[$]?O=this.defaultActions[$]:((M===null||typeof M>"u")&&(M=kt()),O=K[$]&&K[$][M]),typeof O>"u"||!O.length||!O[0]){var ct="";at=[];for(st in K[$])this.terminals_[st]&&st>Jt&&at.push("'"+this.terminals_[st]+"'");D.showPosition?ct="Parse error on line "+(et+1)+`: +import{s as si,g as ai,o as Et,n as ni,a as oi,b as ri,_ as n,l as It,D as hi,e as li,p as ci,y as pt,i as ui,A as Mt,B as gi,E as xi,az as di,a7 as Dt}from"./mermaid.core-XMN3hSDH.js";import{i as fi}from"./init-Gi6I4Gst.js";import{o as pi}from"./ordinal-Cboi1Yqb.js";import{l as vt}from"./linear-DZwFWlPa.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";import"./defaultLocale-DX6XiGOO.js";function mi(t,i,e){t=+t,i=+i,e=(a=arguments.length)<2?(i=t,t=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((i-t)/e))|0,c=new Array(a);++s"u"&&(D.yylloc={});var ht=D.yylloc;o.push(ht);var ii=D.options&&D.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ei(z){g.length=g.length-2*z,w.length=w.length-z,o.length=o.length-z}n(ei,"popStack");function kt(){var z;return z=x.pop()||D.lex()||_t,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(kt,"lex");for(var M,$,O,lt,G={},st,N,Tt,at;;){if($=g[g.length-1],this.defaultActions[$]?O=this.defaultActions[$]:((M===null||typeof M>"u")&&(M=kt()),O=K[$]&&K[$][M]),typeof O>"u"||!O.length||!O[0]){var ct="";at=[];for(st in K[$])this.terminals_[st]&&st>Jt&&at.push("'"+this.terminals_[st]+"'");D.showPosition?ct="Parse error on line "+(et+1)+`: `+D.showPosition()+` Expecting `+at.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ct="Parse error on line "+(et+1)+": Unexpected "+(M==_t?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ct,{text:D.match,token:this.terminals_[M]||M,line:D.yylineno,loc:ht,expected:at})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+M);switch(O[0]){case 1:g.push(M),w.push(D.yytext),o.push(D.yylloc),g.push(O[1]),M=null,Rt=D.yyleng,d=D.yytext,et=D.yylineno,ht=D.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=w[w.length-N],G._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},ii&&(G._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),lt=this.performAction.apply(G,[d,Rt,et,U.yy,O[1],w,o].concat(ti)),typeof lt<"u")return lt;N&&(g=g.slice(0,-1*N*2),w=w.slice(0,-1*N),o=o.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),w.push(G.$),o.push(G._$),Tt=K[g[g.length-2]][g[g.length-1]],g.push(Tt);break;case 3:return!0}}return!0},"parse")},Q=(function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(r,u){return this.yy=u||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var u=r.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:n(function(r){var u=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(r){this.unput(this.match.slice(r))},"less"),pastInput:n(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var r=this.pastInput(),u=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/index.html b/apps/kimi-code/dist-web/index.html index 4580d90b9ec..4f7e8d9d310 100644 --- a/apps/kimi-code/dist-web/index.html +++ b/apps/kimi-code/dist-web/index.html @@ -14,8 +14,8 @@ the server's Content-Security-Policy forbids inline scripts. --> Kimi Code Web - - + +

      From 05d44beb795fac0afded2c9a8060e99dd5721777 Mon Sep 17 00:00:00 2001 From: qilongyu Date: Fri, 28 Aug 2026 07:55:16 +0000 Subject: [PATCH 2/2] chore: sync web dist from code-app code-app: 6f8f60ffe48f042a4464a43d03bfd08aff591317 --- ...-DiXk8vTC.js => CodeBlockNode-CuI0kUU2.js} | 4 +- ...ooltip-BI78FOq1.js => Tooltip-B_XKKsoo.js} | 2 +- ...G_.js => abnfDiagram-VRR7QNED-DXIJHUhi.js} | 2 +- .../{arc-x24dd6EE.js => arc-DvnRk6Nq.js} | 2 +- ... architectureDiagram-ZJ3FMSHR-BkFTWyPL.js} | 2 +- ...B.js => blockDiagram-677ZJIJ3-dcwx65-g.js} | 2 +- ...2ZOL.js => c4Diagram-LMCZKHZV-CKCcIU8j.js} | 2 +- .../dist-web/assets/channel-C-YOi8lT.js | 1 - .../dist-web/assets/channel-DRV27vN-.js | 1 + ...DoBgLSx1.js => chunk-2Q5K7J3B-BZszbgyO.js} | 2 +- ...BXcVdJ-W.js => chunk-32BRIVSS-IAHjo_8M.js} | 2 +- ...BV4ucc4y.js => chunk-5VM5RSS4-T6ZfJwFq.js} | 2 +- ...DyuxL3R0.js => chunk-EX3LRPZG-BwdwY9_G.js} | 2 +- ...C3Ln9Diz.js => chunk-JWPE2WC7-DAAIR0Fi.js} | 2 +- ...DfjF6X7a.js => chunk-MOJQB5TN-DEUKbfBz.js} | 2 +- ...8FUQcOpv.js => chunk-RYQCIY6F-DC1nQV1h.js} | 2 +- ...DD40RxNF.js => chunk-V7JOEXUC-CBy4In3c.js} | 2 +- ...DXOr7Xkl.js => chunk-VR4S4FIN-SMzu0FAl.js} | 2 +- ...BLb3KbCy.js => chunk-XXDRQBXY-B34NejJn.js} | 2 +- .../assets/classDiagram-OUVF2IWQ-BouDd7KD.js | 1 + .../assets/classDiagram-OUVF2IWQ-C0VBUqk7.js | 1 - .../classDiagram-v2-EOCWNBFH-BouDd7KD.js | 1 + .../classDiagram-v2-EOCWNBFH-C0VBUqk7.js | 1 - ...9.js => cose-bilkent-JH36ORCC-BoiGDa4E.js} | 2 +- ...Wbot6H.js => cynefin-VYW2F7L2-DshBI3i_.js} | 2 +- ...js => cynefinDiagram-TSTJHNR4-C1LJEj_7.js} | 2 +- ...BPvIVMQX.js => dagre-VKFMJZFB-CsRzig98.js} | 2 +- ...4w020-.js => diagram-FQU43EPY-CIGMiRNq.js} | 2 +- ...ySynrU.js => diagram-G47NLZAW-CgpekfqC.js} | 2 +- ...v1qX00.js => diagram-NH7WQ7WH-Cdv1wVCe.js} | 2 +- ...HxgtCp.js => diagram-OA4YK3LP-BH80-JW9.js} | 2 +- ...MqZGXv.js => diagram-WEI45ONY--QJ6KdgL.js} | 2 +- ...UD.js => ebnfDiagram-CCIWWBDH-D5RkPBmD.js} | 2 +- ...xxSO.js => erDiagram-Q63AITRT-BeHEHU1X.js} | 2 +- ...Zk.js => flowDiagram-23GEKE2U-BBsDuEMp.js} | 2 +- ...a.js => ganttDiagram-NO4QXBWP-Bnt6x8v3.js} | 2 +- ...s => gitGraphDiagram-IHSO6WYX-CHnhMzpt.js} | 2 +- .../{index-CLyK-bJw.js => index-43G4l3IG.js} | 2 +- .../dist-web/assets/index-BRkLL_ut.js | 818 ++++++++++++++++++ .../{index-V9jHT2Qw.js => index-Bx4TPvIQ.js} | 4 +- .../dist-web/assets/index-C31Y85AG.css | 32 + .../dist-web/assets/index-ChnXJINq.js | 818 ------------------ .../{index-DzigsE_1.js => index-DvnquuzZ.js} | 2 +- .../dist-web/assets/index-QkzZp0Kk.css | 32 - ...ndex10-DGuREUB3.js => index10-CoFm5QTj.js} | 2 +- ...ndex11-ChlZyGAH.js => index11-DHi1-CuT.js} | 2 +- ...{index5-CfzaNIoE.js => index5-Cwvp7yqU.js} | 2 +- ...{index6-CPKEqG-u.js => index6-3HBp-5pe.js} | 2 +- ...{index7-Dw6CHuX-.js => index7-DiAQ7wTz.js} | 2 +- ...{index8-6GF_RzW4.js => index8-QUl1r--p.js} | 2 +- ...3y.js => infoDiagram-FWYZ7A6U-CR5xgev-.js} | 2 +- ...s => ishikawaDiagram-FXEZZL3T-D2iRkcq6.js} | 2 +- ...js => journeyDiagram-5HDEW3XC-BXloij0-.js} | 2 +- ...=> kanban-definition-HUTT4EX6-TsV5yiiG.js} | 2 +- ...{linear-DZwFWlPa.js => linear-HTwyis_A.js} | 2 +- ...e-XMN3hSDH.js => mermaid.core-D1bi95DL.js} | 8 +- ...> mindmap-definition-LN4V7U3C-DtoMJEfu.js} | 2 +- ...Oo8.js => pegDiagram-2B236MQR-Cop_BTXa.js} | 2 +- ...iWq.js => pieDiagram-ENE6RG2P-CCABqJnt.js} | 2 +- ...s => quadrantDiagram-ABIIQ3AL-CWsF0R_5.js} | 2 +- ...s => railroadDiagram-RFXS5EU6-DaxiNxCc.js} | 2 +- ...> requirementDiagram-TGXJPOKE-9cRQkjZe.js} | 2 +- ....js => sankeyDiagram-HTMAVEWB-BzB5tVU7.js} | 2 +- ...s => sequenceDiagram-DBY2YBRQ-CNTRMcnh.js} | 2 +- ...-g.js => sizeCapture-X5ZJPWSS-BiTxvksE.js} | 2 +- ...e.js => stateDiagram-2N3HPSRC-B_zZbxKh.js} | 2 +- .../stateDiagram-v2-6OUMAXLB-BCD5XF-G.js | 1 + .../stateDiagram-v2-6OUMAXLB-DA4wVJGo.js | 1 - ...s0uW.js => swimlanes-5IMT3BWC-BcdZfuAj.js} | 4 +- .../swimlanesDiagram-G3AALYLV-DpNQvzIJ.js | 8 + .../swimlanesDiagram-G3AALYLV-Ou5HSK_e.js | 8 - ... timeline-definition-FHXFAJF6-Z4bSaKhV.js} | 2 +- ...SA.js => vennDiagram-L72KCM5P-Cpcsqgru.js} | 2 +- ...js => vue.runtime.esm-bundler-g_Y84vG0.js} | 2 +- ...js => wardleyDiagram-EHGQE667-DsInwL89.js} | 2 +- ...js => xychartDiagram-FW5EYKEG-Dbf5J7eT.js} | 2 +- apps/kimi-code/dist-web/index.html | 4 +- 77 files changed, 932 insertions(+), 932 deletions(-) rename apps/kimi-code/dist-web/assets/{CodeBlockNode-DiXk8vTC.js => CodeBlockNode-CuI0kUU2.js} (99%) rename apps/kimi-code/dist-web/assets/{Tooltip-BI78FOq1.js => Tooltip-B_XKKsoo.js} (98%) rename apps/kimi-code/dist-web/assets/{abnfDiagram-VRR7QNED-4qTui6G_.js => abnfDiagram-VRR7QNED-DXIJHUhi.js} (86%) rename apps/kimi-code/dist-web/assets/{arc-x24dd6EE.js => arc-DvnRk6Nq.js} (98%) rename apps/kimi-code/dist-web/assets/{architectureDiagram-ZJ3FMSHR-DU8Ns-cR.js => architectureDiagram-ZJ3FMSHR-BkFTWyPL.js} (99%) rename apps/kimi-code/dist-web/assets/{blockDiagram-677ZJIJ3-CSXzh0NB.js => blockDiagram-677ZJIJ3-dcwx65-g.js} (99%) rename apps/kimi-code/dist-web/assets/{c4Diagram-LMCZKHZV-DqXL2ZOL.js => c4Diagram-LMCZKHZV-CKCcIU8j.js} (99%) delete mode 100644 apps/kimi-code/dist-web/assets/channel-C-YOi8lT.js create mode 100644 apps/kimi-code/dist-web/assets/channel-DRV27vN-.js rename apps/kimi-code/dist-web/assets/{chunk-2Q5K7J3B-DoBgLSx1.js => chunk-2Q5K7J3B-BZszbgyO.js} (67%) rename apps/kimi-code/dist-web/assets/{chunk-32BRIVSS-BXcVdJ-W.js => chunk-32BRIVSS-IAHjo_8M.js} (96%) rename apps/kimi-code/dist-web/assets/{chunk-5VM5RSS4-BV4ucc4y.js => chunk-5VM5RSS4-T6ZfJwFq.js} (83%) rename apps/kimi-code/dist-web/assets/{chunk-EX3LRPZG-DyuxL3R0.js => chunk-EX3LRPZG-BwdwY9_G.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-JWPE2WC7-C3Ln9Diz.js => chunk-JWPE2WC7-DAAIR0Fi.js} (71%) rename apps/kimi-code/dist-web/assets/{chunk-MOJQB5TN-DfjF6X7a.js => chunk-MOJQB5TN-DEUKbfBz.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-RYQCIY6F-8FUQcOpv.js => chunk-RYQCIY6F-DC1nQV1h.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-V7JOEXUC-DD40RxNF.js => chunk-V7JOEXUC-CBy4In3c.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-VR4S4FIN-DXOr7Xkl.js => chunk-VR4S4FIN-SMzu0FAl.js} (87%) rename apps/kimi-code/dist-web/assets/{chunk-XXDRQBXY-BLb3KbCy.js => chunk-XXDRQBXY-B34NejJn.js} (72%) create mode 100644 apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-BouDd7KD.js delete mode 100644 apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-C0VBUqk7.js create mode 100644 apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-BouDd7KD.js delete mode 100644 apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-C0VBUqk7.js rename apps/kimi-code/dist-web/assets/{cose-bilkent-JH36ORCC-bJETd0G9.js => cose-bilkent-JH36ORCC-BoiGDa4E.js} (99%) rename apps/kimi-code/dist-web/assets/{cynefin-VYW2F7L2-CjWbot6H.js => cynefin-VYW2F7L2-DshBI3i_.js} (99%) rename apps/kimi-code/dist-web/assets/{cynefinDiagram-TSTJHNR4-CMTHGHjI.js => cynefinDiagram-TSTJHNR4-C1LJEj_7.js} (98%) rename apps/kimi-code/dist-web/assets/{dagre-VKFMJZFB-BPvIVMQX.js => dagre-VKFMJZFB-CsRzig98.js} (97%) rename apps/kimi-code/dist-web/assets/{diagram-FQU43EPY-D74w020-.js => diagram-FQU43EPY-CIGMiRNq.js} (98%) rename apps/kimi-code/dist-web/assets/{diagram-G47NLZAW-BNySynrU.js => diagram-G47NLZAW-CgpekfqC.js} (97%) rename apps/kimi-code/dist-web/assets/{diagram-NH7WQ7WH-DSv1qX00.js => diagram-NH7WQ7WH-Cdv1wVCe.js} (93%) rename apps/kimi-code/dist-web/assets/{diagram-OA4YK3LP-CBHxgtCp.js => diagram-OA4YK3LP-BH80-JW9.js} (96%) rename apps/kimi-code/dist-web/assets/{diagram-WEI45ONY-H-MqZGXv.js => diagram-WEI45ONY--QJ6KdgL.js} (95%) rename apps/kimi-code/dist-web/assets/{ebnfDiagram-CCIWWBDH-CEJoe0UD.js => ebnfDiagram-CCIWWBDH-D5RkPBmD.js} (87%) rename apps/kimi-code/dist-web/assets/{erDiagram-Q63AITRT-CythxxSO.js => erDiagram-Q63AITRT-BeHEHU1X.js} (99%) rename apps/kimi-code/dist-web/assets/{flowDiagram-23GEKE2U-CAiKF6Zk.js => flowDiagram-23GEKE2U-BBsDuEMp.js} (99%) rename apps/kimi-code/dist-web/assets/{ganttDiagram-NO4QXBWP-BZuybaxa.js => ganttDiagram-NO4QXBWP-Bnt6x8v3.js} (99%) rename apps/kimi-code/dist-web/assets/{gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js => gitGraphDiagram-IHSO6WYX-CHnhMzpt.js} (99%) rename apps/kimi-code/dist-web/assets/{index-CLyK-bJw.js => index-43G4l3IG.js} (99%) create mode 100644 apps/kimi-code/dist-web/assets/index-BRkLL_ut.js rename apps/kimi-code/dist-web/assets/{index-V9jHT2Qw.js => index-Bx4TPvIQ.js} (99%) create mode 100644 apps/kimi-code/dist-web/assets/index-C31Y85AG.css delete mode 100644 apps/kimi-code/dist-web/assets/index-ChnXJINq.js rename apps/kimi-code/dist-web/assets/{index-DzigsE_1.js => index-DvnquuzZ.js} (99%) delete mode 100644 apps/kimi-code/dist-web/assets/index-QkzZp0Kk.css rename apps/kimi-code/dist-web/assets/{index10-DGuREUB3.js => index10-CoFm5QTj.js} (99%) rename apps/kimi-code/dist-web/assets/{index11-ChlZyGAH.js => index11-DHi1-CuT.js} (99%) rename apps/kimi-code/dist-web/assets/{index5-CfzaNIoE.js => index5-Cwvp7yqU.js} (95%) rename apps/kimi-code/dist-web/assets/{index6-CPKEqG-u.js => index6-3HBp-5pe.js} (98%) rename apps/kimi-code/dist-web/assets/{index7-Dw6CHuX-.js => index7-DiAQ7wTz.js} (98%) rename apps/kimi-code/dist-web/assets/{index8-6GF_RzW4.js => index8-QUl1r--p.js} (99%) rename apps/kimi-code/dist-web/assets/{infoDiagram-FWYZ7A6U-CUw0bC3y.js => infoDiagram-FWYZ7A6U-CR5xgev-.js} (69%) rename apps/kimi-code/dist-web/assets/{ishikawaDiagram-FXEZZL3T-BQLkKOjp.js => ishikawaDiagram-FXEZZL3T-D2iRkcq6.js} (99%) rename apps/kimi-code/dist-web/assets/{journeyDiagram-5HDEW3XC-D9J7zYIT.js => journeyDiagram-5HDEW3XC-BXloij0-.js} (98%) rename apps/kimi-code/dist-web/assets/{kanban-definition-HUTT4EX6-BFENhRSJ.js => kanban-definition-HUTT4EX6-TsV5yiiG.js} (99%) rename apps/kimi-code/dist-web/assets/{linear-DZwFWlPa.js => linear-HTwyis_A.js} (98%) rename apps/kimi-code/dist-web/assets/{mermaid.core-XMN3hSDH.js => mermaid.core-D1bi95DL.js} (99%) rename apps/kimi-code/dist-web/assets/{mindmap-definition-LN4V7U3C-DVXXLA72.js => mindmap-definition-LN4V7U3C-DtoMJEfu.js} (98%) rename apps/kimi-code/dist-web/assets/{pegDiagram-2B236MQR-C6WedOo8.js => pegDiagram-2B236MQR-Cop_BTXa.js} (87%) rename apps/kimi-code/dist-web/assets/{pieDiagram-ENE6RG2P-hsSQniWq.js => pieDiagram-ENE6RG2P-CCABqJnt.js} (95%) rename apps/kimi-code/dist-web/assets/{quadrantDiagram-ABIIQ3AL-DczKOfwA.js => quadrantDiagram-ABIIQ3AL-CWsF0R_5.js} (99%) rename apps/kimi-code/dist-web/assets/{railroadDiagram-RFXS5EU6-Bo3Qjwvx.js => railroadDiagram-RFXS5EU6-DaxiNxCc.js} (84%) rename apps/kimi-code/dist-web/assets/{requirementDiagram-TGXJPOKE-BTUv_Oh8.js => requirementDiagram-TGXJPOKE-9cRQkjZe.js} (99%) rename apps/kimi-code/dist-web/assets/{sankeyDiagram-HTMAVEWB-lACUqAhA.js => sankeyDiagram-HTMAVEWB-BzB5tVU7.js} (99%) rename apps/kimi-code/dist-web/assets/{sequenceDiagram-DBY2YBRQ-td3c-NEP.js => sequenceDiagram-DBY2YBRQ-CNTRMcnh.js} (99%) rename apps/kimi-code/dist-web/assets/{sizeCapture-X5ZJPWSS-C2SuSg-g.js => sizeCapture-X5ZJPWSS-BiTxvksE.js} (86%) rename apps/kimi-code/dist-web/assets/{stateDiagram-2N3HPSRC-A7OvRFce.js => stateDiagram-2N3HPSRC-B_zZbxKh.js} (96%) create mode 100644 apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-BCD5XF-G.js delete mode 100644 apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-DA4wVJGo.js rename apps/kimi-code/dist-web/assets/{swimlanes-5IMT3BWC-e4qfs0uW.js => swimlanes-5IMT3BWC-BcdZfuAj.js} (99%) create mode 100644 apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-DpNQvzIJ.js delete mode 100644 apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-Ou5HSK_e.js rename apps/kimi-code/dist-web/assets/{timeline-definition-FHXFAJF6-DTRr-LYc.js => timeline-definition-FHXFAJF6-Z4bSaKhV.js} (99%) rename apps/kimi-code/dist-web/assets/{vennDiagram-L72KCM5P-CF_UwcSA.js => vennDiagram-L72KCM5P-Cpcsqgru.js} (99%) rename apps/kimi-code/dist-web/assets/{vue.runtime.esm-bundler-BMAq9omn.js => vue.runtime.esm-bundler-g_Y84vG0.js} (98%) rename apps/kimi-code/dist-web/assets/{wardleyDiagram-EHGQE667-Dlkrf9qY.js => wardleyDiagram-EHGQE667-DsInwL89.js} (99%) rename apps/kimi-code/dist-web/assets/{xychartDiagram-FW5EYKEG-OovywL2x.js => xychartDiagram-FW5EYKEG-Dbf5J7eT.js} (99%) diff --git a/apps/kimi-code/dist-web/assets/CodeBlockNode-DiXk8vTC.js b/apps/kimi-code/dist-web/assets/CodeBlockNode-CuI0kUU2.js similarity index 99% rename from apps/kimi-code/dist-web/assets/CodeBlockNode-DiXk8vTC.js rename to apps/kimi-code/dist-web/assets/CodeBlockNode-CuI0kUU2.js index 9b11cb14e76..4e5b684d91a 100644 --- a/apps/kimi-code/dist-web/assets/CodeBlockNode-DiXk8vTC.js +++ b/apps/kimi-code/dist-web/assets/CodeBlockNode-CuI0kUU2.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-V9jHT2Qw.js","assets/index-ChnXJINq.js","assets/index-QkzZp0Kk.css"])))=>i.map(i=>d[i]); -import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-ChnXJINq.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-V9jHT2Qw.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bx4TPvIQ.js","assets/index-BRkLL_ut.js","assets/index-C31Y85AG.css"])))=>i.map(i=>d[i]); +import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-BRkLL_ut.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-Bx4TPvIQ.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" diff --git a/apps/kimi-code/dist-web/assets/Tooltip-BI78FOq1.js b/apps/kimi-code/dist-web/assets/Tooltip-B_XKKsoo.js similarity index 98% rename from apps/kimi-code/dist-web/assets/Tooltip-BI78FOq1.js rename to apps/kimi-code/dist-web/assets/Tooltip-B_XKKsoo.js index c9d258734d5..41f1acb4a18 100644 --- a/apps/kimi-code/dist-web/assets/Tooltip-BI78FOq1.js +++ b/apps/kimi-code/dist-web/assets/Tooltip-B_XKKsoo.js @@ -1 +1 @@ -import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-ChnXJINq.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; +import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-BRkLL_ut.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; diff --git a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-4qTui6G_.js b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DXIJHUhi.js similarity index 86% rename from apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-4qTui6G_.js rename to apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DXIJHUhi.js index a1c4e67094e..e1ceead0ef8 100644 --- a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-4qTui6G_.js +++ b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DXIJHUhi.js @@ -1 +1 @@ -import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DfjF6X7a.js";import{p as f}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as n,l as o}from"./mermaid.core-XMN3hSDH.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; +import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DEUKbfBz.js";import{p as f}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as n,l as o}from"./mermaid.core-D1bi95DL.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; diff --git a/apps/kimi-code/dist-web/assets/arc-x24dd6EE.js b/apps/kimi-code/dist-web/assets/arc-DvnRk6Nq.js similarity index 98% rename from apps/kimi-code/dist-web/assets/arc-x24dd6EE.js rename to apps/kimi-code/dist-web/assets/arc-DvnRk6Nq.js index 947d84b18bf..8f9efc0bfaf 100644 --- a/apps/kimi-code/dist-web/assets/arc-x24dd6EE.js +++ b/apps/kimi-code/dist-web/assets/arc-DvnRk6Nq.js @@ -1 +1 @@ -import{P as ln,Q as an,R as j,S,T as W,V as un,W as y,X as tn,Y as C,$ as _,a0 as rn,a1 as o,a2 as on,a3 as sn,a4 as fn}from"./mermaid.core-XMN3hSDH.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,R,X,a){var I=E-l,i=q-h,n=X-v,d=a-R,u=d*I-n*i;if(!(u*ur*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` +import{p as ke}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as gt,D as Ze,ad as qe,l as Se,b as Qe,a as Je,n as Ke,o as je,g as _e,s as tr,p as er,A as rr,y as ir,B as ar,c as me,a$ as Ee,ai as ve,i as nr,d as or,q as sr,aj as hr,b7 as lr}from"./mermaid.core-D1bi95DL.js";import{p as fr}from"./cynefin-VYW2F7L2-DshBI3i_.js";import{c as Fe}from"./cytoscape.esm-OyMbaexL.js";import{g as cr}from"./_commonjsHelpers-CqkleIqs.js";import"./index-BRkLL_ut.js";var se={exports:{}},he={exports:{}},le={exports:{}},gr=le.exports,Me;function ur(){return Me||(Me=1,(function(L,b){(function(G,N){L.exports=N()})(gr,function(){return(function(A){var G={};function N(v){if(G[v])return G[v].exports;var h=G[v]={i:v,l:!1,exports:{}};return A[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=A,N.c=G,N.i=function(v){return v},N.d=function(v,h,i){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:i})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(A,G,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,A.exports=v}),(function(A,G,N){var v=N(2),h=N(8),i=N(9);function r(f,e,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var u=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(u.getOwner()==e)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},A.exports=r}),(function(A,G,N){function v(h){this.vGraphObject=h}A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(13),r=N(0),a=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var u in v)e[u]=v[u];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` .edge { stroke-width: ${L.archEdgeWidth}; stroke: ${L.archEdgeColor}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CSXzh0NB.js b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-dcwx65-g.js similarity index 99% rename from apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CSXzh0NB.js rename to apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-dcwx65-g.js index 80c1835afd4..8c58e917471 100644 --- a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CSXzh0NB.js +++ b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-dcwx65-g.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-BV4ucc4y.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-XMN3hSDH.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-C-YOi8lT.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: +import{g as de}from"./chunk-5VM5RSS4-T6ZfJwFq.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-D1bi95DL.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-DRV27vN-.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: `+O.showPosition()+` Expecting `+it.join(", ")+", got '"+(this.terminals_[P]||P)+"'":ft="Parse error on line "+(C+1)+": Unexpected "+(P==at?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[P]||P,line:O.yylineno,loc:dt,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+P);switch(H[0]){case 1:x.push(P),E.push(O.yytext),o.push(O.yylloc),x.push(H[1]),P=null,Z=O.yyleng,f=O.yytext,C=O.yylineno,dt=O.yylloc;break;case 2:if(G=this.productions_[H[1]][1],J.$=E[E.length-G],J._$={first_line:o[o.length-(G||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(G||1)].first_column,last_column:o[o.length-1].last_column},ge&&(J._$.range=[o[o.length-(G||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(J,[f,Z,C,j.yy,H[1],E,o].concat(gt)),typeof pt<"u")return pt;G&&(x=x.slice(0,-1*G*2),E=E.slice(0,-1*G),o=o.slice(0,-1*G)),x.push(this.productions_[H[1]][0]),E.push(J.$),o.push(J._$),It=F[x[x.length-2]][x[x.length-1]],x.push(It);break;case 3:return!0}}return!0},"parse")},N=(function(){var T={EOF:1,parseError:g(function(p,x){if(this.yy.parser)this.yy.parser.parseError(p,x);else throw new Error(p)},"parseError"),setInput:g(function(m,p){return this.yy=p||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var p=m.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:g(function(m){var p=m.length,x=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===L.length?this.yylloc.first_column:0)+L[L.length-x.length].length-x[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(m){this.unput(this.match.slice(m))},"less"),pastInput:g(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var m=this.pastInput(),p=new Array(m.length+1).join("-");return m+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DqXL2ZOL.js b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-CKCcIU8j.js similarity index 99% rename from apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DqXL2ZOL.js rename to apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-CKCcIU8j.js index ef0d2526a31..44999517c0b 100644 --- a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DqXL2ZOL.js +++ b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-CKCcIU8j.js @@ -1,4 +1,4 @@ -import{g as Oe,d as Re}from"./chunk-32BRIVSS-BXcVdJ-W.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-XMN3hSDH.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: +import{g as Oe,d as Re}from"./chunk-32BRIVSS-IAHjo_8M.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-D1bi95DL.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: `+D.showPosition()+` Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/channel-C-YOi8lT.js b/apps/kimi-code/dist-web/assets/channel-C-YOi8lT.js deleted file mode 100644 index 1d0e8f8f3d5..00000000000 --- a/apps/kimi-code/dist-web/assets/channel-C-YOi8lT.js +++ /dev/null @@ -1 +0,0 @@ -import{U as a,O as n}from"./mermaid.core-XMN3hSDH.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/channel-DRV27vN-.js b/apps/kimi-code/dist-web/assets/channel-DRV27vN-.js new file mode 100644 index 00000000000..ca902b9ce21 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-DRV27vN-.js @@ -0,0 +1 @@ +import{U as a,O as n}from"./mermaid.core-D1bi95DL.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DoBgLSx1.js b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BZszbgyO.js similarity index 67% rename from apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DoBgLSx1.js rename to apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BZszbgyO.js index 698cda4ca4a..abf655ac642 100644 --- a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DoBgLSx1.js +++ b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BZszbgyO.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-XMN3hSDH.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; +import{_ as i}from"./mermaid.core-D1bi95DL.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BXcVdJ-W.js b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-IAHjo_8M.js similarity index 96% rename from apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BXcVdJ-W.js rename to apps/kimi-code/dist-web/assets/chunk-32BRIVSS-IAHjo_8M.js index e42076cb043..def2a222083 100644 --- a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BXcVdJ-W.js +++ b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-IAHjo_8M.js @@ -1 +1 @@ -import{_ as i,d as l,N as d,j as o}from"./mermaid.core-XMN3hSDH.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; +import{_ as i,d as l,N as d,j as o}from"./mermaid.core-D1bi95DL.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; diff --git a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BV4ucc4y.js b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-T6ZfJwFq.js similarity index 83% rename from apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BV4ucc4y.js rename to apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-T6ZfJwFq.js index fac41095430..b66df8b306f 100644 --- a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BV4ucc4y.js +++ b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-T6ZfJwFq.js @@ -1,4 +1,4 @@ -import{_ as e}from"./mermaid.core-XMN3hSDH.js";var l=e(()=>` +import{_ as e}from"./mermaid.core-D1bi95DL.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DyuxL3R0.js b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BwdwY9_G.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DyuxL3R0.js rename to apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BwdwY9_G.js index 9ab37eed196..16a75f9cb6a 100644 --- a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DyuxL3R0.js +++ b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BwdwY9_G.js @@ -1,4 +1,4 @@ -import{g as te}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as ee}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-XMN3hSDH.js";import{f as fe}from"./chunk-32BRIVSS-BXcVdJ-W.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: +import{g as te}from"./chunk-XXDRQBXY-B34NejJn.js";import{s as ee}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-D1bi95DL.js";import{f as fe}from"./chunk-32BRIVSS-IAHjo_8M.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: `+b.showPosition()+` Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(R[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,R[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[R[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(d,r){if(this.yy.parser)this.yy.parser.parseError(d,r);else throw new Error(d)},"parseError"),setInput:f(function(a,d){return this.yy=d||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var d=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C3Ln9Diz.js b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DAAIR0Fi.js similarity index 71% rename from apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C3Ln9Diz.js rename to apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DAAIR0Fi.js index 96837712c39..6560354cd01 100644 --- a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C3Ln9Diz.js +++ b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DAAIR0Fi.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-XMN3hSDH.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; +import{_ as i}from"./mermaid.core-D1bi95DL.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DfjF6X7a.js b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DEUKbfBz.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DfjF6X7a.js rename to apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DEUKbfBz.js index 362375621c7..1d6aeda142d 100644 --- a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DfjF6X7a.js +++ b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DEUKbfBz.js @@ -1,4 +1,4 @@ -import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-XMN3hSDH.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` +import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-D1bi95DL.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` `),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` .railroad-diagram { font-family: ${i}; diff --git a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-8FUQcOpv.js b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DC1nQV1h.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-8FUQcOpv.js rename to apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DC1nQV1h.js index 9c64bbe6a82..cf878b1d0eb 100644 --- a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-8FUQcOpv.js +++ b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DC1nQV1h.js @@ -1 +1 @@ -import{_ as u,l as i}from"./mermaid.core-XMN3hSDH.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; +import{_ as u,l as i}from"./mermaid.core-D1bi95DL.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; diff --git a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-DD40RxNF.js b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CBy4In3c.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-DD40RxNF.js rename to apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CBy4In3c.js index 767675c2091..f736db909b1 100644 --- a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-DD40RxNF.js +++ b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CBy4In3c.js @@ -1,4 +1,4 @@ -import{g as tt}from"./chunk-5VM5RSS4-BV4ucc4y.js";import{g as st}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as it}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-XMN3hSDH.js";import{f as gt}from"./chunk-32BRIVSS-BXcVdJ-W.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: +import{g as tt}from"./chunk-5VM5RSS4-T6ZfJwFq.js";import{g as st}from"./chunk-XXDRQBXY-B34NejJn.js";import{s as it}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-D1bi95DL.js";import{f as gt}from"./chunk-32BRIVSS-IAHjo_8M.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: `+D.showPosition()+` Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DXOr7Xkl.js b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-SMzu0FAl.js similarity index 87% rename from apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DXOr7Xkl.js rename to apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-SMzu0FAl.js index 63ce20696b1..87b05ff816c 100644 --- a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DXOr7Xkl.js +++ b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-SMzu0FAl.js @@ -1 +1 @@ -import{_ as a,e as w,l as x}from"./mermaid.core-XMN3hSDH.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; +import{_ as a,e as w,l as x}from"./mermaid.core-D1bi95DL.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BLb3KbCy.js b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-B34NejJn.js similarity index 72% rename from apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BLb3KbCy.js rename to apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-B34NejJn.js index a5c0801e8c8..28027c32b06 100644 --- a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BLb3KbCy.js +++ b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-B34NejJn.js @@ -1 +1 @@ -import{_ as a,d as o}from"./mermaid.core-XMN3hSDH.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{_ as a,d as o}from"./mermaid.core-D1bi95DL.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-BouDd7KD.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-BouDd7KD.js new file mode 100644 index 00000000000..a54ee1ab30f --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-BouDd7KD.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-CBy4In3c.js";import{_ as i}from"./mermaid.core-D1bi95DL.js";import"./chunk-5VM5RSS4-T6ZfJwFq.js";import"./chunk-XXDRQBXY-B34NejJn.js";import"./chunk-VR4S4FIN-SMzu0FAl.js";import"./chunk-32BRIVSS-IAHjo_8M.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-C0VBUqk7.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-C0VBUqk7.js deleted file mode 100644 index 2afc4bc77ec..00000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-C0VBUqk7.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-DD40RxNF.js";import{_ as i}from"./mermaid.core-XMN3hSDH.js";import"./chunk-5VM5RSS4-BV4ucc4y.js";import"./chunk-XXDRQBXY-BLb3KbCy.js";import"./chunk-VR4S4FIN-DXOr7Xkl.js";import"./chunk-32BRIVSS-BXcVdJ-W.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-BouDd7KD.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-BouDd7KD.js new file mode 100644 index 00000000000..a54ee1ab30f --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-BouDd7KD.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-CBy4In3c.js";import{_ as i}from"./mermaid.core-D1bi95DL.js";import"./chunk-5VM5RSS4-T6ZfJwFq.js";import"./chunk-XXDRQBXY-B34NejJn.js";import"./chunk-VR4S4FIN-SMzu0FAl.js";import"./chunk-32BRIVSS-IAHjo_8M.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-C0VBUqk7.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-C0VBUqk7.js deleted file mode 100644 index 2afc4bc77ec..00000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-C0VBUqk7.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-DD40RxNF.js";import{_ as i}from"./mermaid.core-XMN3hSDH.js";import"./chunk-5VM5RSS4-BV4ucc4y.js";import"./chunk-XXDRQBXY-BLb3KbCy.js";import"./chunk-VR4S4FIN-DXOr7Xkl.js";import"./chunk-32BRIVSS-BXcVdJ-W.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-bJETd0G9.js b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BoiGDa4E.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-bJETd0G9.js rename to apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BoiGDa4E.js index 23a596cf63b..32065a199c2 100644 --- a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-bJETd0G9.js +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BoiGDa4E.js @@ -1 +1 @@ -import{_ as V,l as k,d as lt}from"./mermaid.core-XMN3hSDH.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-ChnXJINq.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; +import{_ as V,l as k,d as lt}from"./mermaid.core-D1bi95DL.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-BRkLL_ut.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; diff --git a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-CjWbot6H.js b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DshBI3i_.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-CjWbot6H.js rename to apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DshBI3i_.js index 0e5ea3b36fe..71f70040ecb 100644 --- a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-CjWbot6H.js +++ b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DshBI3i_.js @@ -1,4 +1,4 @@ -import{bR as et}from"./index-ChnXJINq.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` +import{bR as et}from"./index-BRkLL_ut.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` `,`\r `,"\r"],(function(e){function t(s,o,l,u){return new lh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` +import{p as xt}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,e as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaid.core-D1bi95DL.js";import{p as Bt}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` .cynefinDomain { stroke: none; } diff --git a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BPvIVMQX.js b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-CsRzig98.js similarity index 97% rename from apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BPvIVMQX.js rename to apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-CsRzig98.js index ecdf0e3c0bf..956d987d583 100644 --- a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BPvIVMQX.js +++ b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-CsRzig98.js @@ -1,4 +1,4 @@ -import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-8FUQcOpv.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-XMN3hSDH.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX +import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-DC1nQV1h.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-D1bi95DL.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX Node.id = `,d,` data=`,u.height,` Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,m,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,m);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),le=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),m=t.select("g");v(m,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),y=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},y.originalEdge=i,y.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,y.toCluster=r),y.id=r+"-cyclic-special-2",y.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,y,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(m,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,le as render}; diff --git a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D74w020-.js b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-CIGMiRNq.js similarity index 98% rename from apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D74w020-.js rename to apps/kimi-code/dist-web/assets/diagram-FQU43EPY-CIGMiRNq.js index b39dee786b4..6e2826759b6 100644 --- a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D74w020-.js +++ b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-CIGMiRNq.js @@ -1,3 +1,3 @@ -import{p as re}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-XMN3hSDH.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
      "};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +import{p as re}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-D1bi95DL.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
      "};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
      ")}const m=r!==void 0;m&&(c+=`

      ${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` `,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,Ue={parser:Ee,db:F,renderer:$e,styles:Ne};export{Ue as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-BNySynrU.js b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgpekfqC.js similarity index 97% rename from apps/kimi-code/dist-web/assets/diagram-G47NLZAW-BNySynrU.js rename to apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgpekfqC.js index bbb6618c507..14eedfdc166 100644 --- a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-BNySynrU.js +++ b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgpekfqC.js @@ -1,4 +1,4 @@ -import{p as me}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-XMN3hSDH.js";import{s as Fe}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{p as Ne}from"./cynefin-VYW2F7L2-CjWbot6H.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` +import{p as me}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-D1bi95DL.js";import{s as Fe}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{p as Ne}from"./cynefin-VYW2F7L2-DshBI3i_.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DSv1qX00.js b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Cdv1wVCe.js similarity index 93% rename from apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DSv1qX00.js rename to apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Cdv1wVCe.js index 93768380161..7bb5bf0a7a7 100644 --- a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DSv1qX00.js +++ b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Cdv1wVCe.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-XMN3hSDH.js";import{p as _}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` +import{p as B}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-D1bi95DL.js";import{p as _}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` .packetByte { font-size: ${e.byteFontSize}; } diff --git a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CBHxgtCp.js b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BH80-JW9.js similarity index 96% rename from apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CBHxgtCp.js rename to apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BH80-JW9.js index ec6f797cd82..4e8ad112aa2 100644 --- a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CBHxgtCp.js +++ b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BH80-JW9.js @@ -1,4 +1,4 @@ -import{I as X}from"./chunk-2Q5K7J3B-DoBgLSx1.js";import{p as O}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-XMN3hSDH.js";import{p as ne}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` +import{I as X}from"./chunk-2Q5K7J3B-BZszbgyO.js";import{p as O}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-D1bi95DL.js";import{p as ne}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` `),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:F,getDiagramTitle:j,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram `+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return` diff --git a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-H-MqZGXv.js b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY--QJ6KdgL.js similarity index 95% rename from apps/kimi-code/dist-web/assets/diagram-WEI45ONY-H-MqZGXv.js rename to apps/kimi-code/dist-web/assets/diagram-WEI45ONY--QJ6KdgL.js index 56eace7864f..7cd418a5fdd 100644 --- a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-H-MqZGXv.js +++ b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY--QJ6KdgL.js @@ -1,4 +1,4 @@ -import{p as k}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{s as R,g as E,o as I,n as _,a as D,b as F,_ as c,D as P,p as z,A as y,y as C,B as G,l as B,E as W,e as V}from"./mermaid.core-XMN3hSDH.js";import{p as H}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;ry({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; +import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-DEUKbfBz.js";import{p}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as t,l as o}from"./mermaid.core-D1bi95DL.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-CythxxSO.js b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-BeHEHU1X.js similarity index 99% rename from apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-CythxxSO.js rename to apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-BeHEHU1X.js index ce96dd45753..055e57c0c8a 100644 --- a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-CythxxSO.js +++ b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-BeHEHU1X.js @@ -1,4 +1,4 @@ -import{g as Mt}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as Bt}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-XMN3hSDH.js";import{c as Jt}from"./channel-C-YOi8lT.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: +import{g as Mt}from"./chunk-XXDRQBXY-B34NejJn.js";import{s as Bt}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-D1bi95DL.js";import{c as Jt}from"./channel-DRV27vN-.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: `+_.showPosition()+` Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),Rt=Z[o[o.length-2]][o[o.length-1]],o.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=(function(){var I={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CAiKF6Zk.js b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BBsDuEMp.js similarity index 99% rename from apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CAiKF6Zk.js rename to apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BBsDuEMp.js index 5157efafba7..bb2b76e4f8d 100644 --- a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CAiKF6Zk.js +++ b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BBsDuEMp.js @@ -1,4 +1,4 @@ -import{g as He}from"./chunk-5VM5RSS4-BV4ucc4y.js";import{g as Xe}from"./chunk-XXDRQBXY-BLb3KbCy.js";import{s as Qe}from"./chunk-VR4S4FIN-DXOr7Xkl.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-XMN3hSDH.js";import{f as ft}from"./chunk-32BRIVSS-BXcVdJ-W.js";import{c as gt}from"./channel-C-YOi8lT.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` +import{g as He}from"./chunk-5VM5RSS4-T6ZfJwFq.js";import{g as Xe}from"./chunk-XXDRQBXY-B34NejJn.js";import{s as Qe}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-D1bi95DL.js";import{f as ft}from"./chunk-32BRIVSS-IAHjo_8M.js";import{c as gt}from"./channel-DRV27vN-.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` `)?k=A+` `:k=`{ `+A+` diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BZuybaxa.js b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-Bnt6x8v3.js similarity index 99% rename from apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BZuybaxa.js rename to apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-Bnt6x8v3.js index 5f18e1ae0a9..41e164a045d 100644 --- a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BZuybaxa.js +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-Bnt6x8v3.js @@ -1,4 +1,4 @@ -import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-XMN3hSDH.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-DZwFWlPa.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-ChnXJINq.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-D1bi95DL.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-HTwyis_A.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-BRkLL_ut.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CHnhMzpt.js similarity index 99% rename from apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js rename to apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CHnhMzpt.js index 18192d625d1..9440b5d44c6 100644 --- a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-Bp_Cw3He.js +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CHnhMzpt.js @@ -1,4 +1,4 @@ -import{I as le}from"./chunk-2Q5K7J3B-DoBgLSx1.js";import{p as he}from"./chunk-JWPE2WC7-C3Ln9Diz.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-XMN3hSDH.js";import{p as Ee}from"./cynefin-VYW2F7L2-CjWbot6H.js";import"./index-ChnXJINq.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` +import{I as le}from"./chunk-2Q5K7J3B-BZszbgyO.js";import{p as he}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-D1bi95DL.js";import{p as Ee}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` ${s-i/2-L/2},${x+R} ${s-i/2-L/2},${x-R} ${t.posWithOffset-i/2-L},${x-c-R} diff --git a/apps/kimi-code/dist-web/assets/index-CLyK-bJw.js b/apps/kimi-code/dist-web/assets/index-43G4l3IG.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index-CLyK-bJw.js rename to apps/kimi-code/dist-web/assets/index-43G4l3IG.js index d591edcd2e0..47a9ea2770c 100644 --- a/apps/kimi-code/dist-web/assets/index-CLyK-bJw.js +++ b/apps/kimi-code/dist-web/assets/index-43G4l3IG.js @@ -1,4 +1,4 @@ -import{t as pe,b as Ln,n as Or,c as Nr,a as Fr,d as zr,s as Ur,g as Vr,e as Br}from"./index-DzigsE_1.js";import{f as Ld}from"./index-DzigsE_1.js";import{bR as k}from"./index-ChnXJINq.js";const Ei="diffs-container",$r=(()=>{try{return!1}catch{return!1}})(),Wr=/(?=^From [a-f0-9]+ .+$)/m,Ti=/(?=^diff --git)/gm,Ul=/(?=^---\s+\S)/gm,Vl=/(?=^@@ )/gm,Gr=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,jr=/(?<=\n)/,qr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yr=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Bl=/^<{7,}(?:\s.*)?$/,$l=/^\|{7,}(?:\s.*)?$/,Wl=/^={7,}$/,Gl=/^>{7,}(?:\s.*)?$/,on="header-prefix",sn="header-metadata",an="header-custom",_={dark:"pierre-dark",light:"pierre-light"},Ii="data-theme-css",Ri="data-unsafe-css",Qr="data-core-css",Jr="data-diffs-scrollbar-measure",Ai="--diffs-scrollbar-gutter-measured",jl=1,Zr=1e5,ln={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},_e={...ln,hunkLineCount:1},eo={paddingTop:8,paddingBottom:8,gap:8},to={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},no=Object.freeze({fromStart:0,fromEnd:0}),Ae={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Hi={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ie=new Set;let Re=null;function Y(e){Ie.add(e),Re??=requestAnimationFrame(Mi)}function io(e){Ie.delete(e),Ie.size===0&&Re!=null&&(cancelAnimationFrame(Re),Re=null)}function Mi(e){const t=new Set(Ie);Ie.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ie.size>0?Re=requestAnimationFrame(Mi):Re=null}function He(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function dn(e,t){const n=e?.theme??_,i=t?.theme??_,r=kn(e),o=kn(t);return De(n,i)&&He(e,t,["theme","parseDiffOptions"])&&He(r,o)}function kn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Wt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Gt({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const h=Math.max(e-r,0),c=Math.min(e+l,t);return{top:h,bottom:Math.max(c,h)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function ro(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function W(e){return{type:"text",value:e}}function A({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function pt({name:e,width:t=16,height:n=16,properties:i}){return A({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[A({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function oo(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ee(e){return A({tagName:"div",properties:{"data-gutter":""},children:e})}function Di(e,t,n,i={}){return A({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[A({tagName:"span",properties:{"data-line-number-content":""},children:[W(`${t}`)]})]:void 0})}function j(e,t,n){return A({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function so(){return A({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[pt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function ao(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Pi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||Wt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&et(e.composedPath())||(he(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(he(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(he(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){he(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();he(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);he(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Tt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Tt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(co(r)&&f!=null){f(r);break}if(ho(r)&&u!=null){u(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Tt(r))break;ut(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,b=g!=null,y=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||h!=null||c!=null||u||f||b;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,he(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const C=[];return(t==="both"||t==="click")&&(i!=null&&C.push("onLineClick"),r!=null&&C.push("onLineNumberClick"),h!=null&&C.push("expandable hunk separators"),c!=null&&C.push("merge conflict actions")),C})()),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const m=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&m||!b&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();et(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(ao(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=pe(so());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ve(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(Ze(r));if(Ve(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ve(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ve(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&et(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Ze(e);if(t&&et(n))return;const i=fo(e);return i!=null?Ze(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=go(po(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Ze(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=En(t)?t:En(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Wt(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,h=d.children.length;if(h!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let c=0;cs)break;if(g==null||gNumber.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Ke({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p},C,v,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:lo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:C,onMergeConflictActionClick:x,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:v}}function lo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ve(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function Tt(e){return Ve(e)||ut(e)}function ho(e){return"type"in e&&e.type==="line-info"}function co(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function wn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ze(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function po(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function go(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function En(e){return e!=null&&typeof e.elementFromPoint=="function"}function Tn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function In(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function et(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function he(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var _i=class ue{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ue.resizeObserver??new ResizeObserver(ue.handleSharedResizeEntries);return ue.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=ue.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let h=l.get(d);h==null&&(h=[],l.set(d,h)),h.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[h,c]=d,u=h.firstElementChild,f=c.firstElementChild;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(u);if(g!=null){this.observedNodes.set(u,g),this.observedNodes.set(f,g),o.delete(u),o.delete(f);continue}const b=u.getBoundingClientRect().height,y=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:h,child:u,childHeight:b},column2:{container:c,child:f,childHeight:y},currentHeight:"auto"},i.add({child1:u,child2:f,item:g,newHeight:Math.max(b,y)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?bo(l):Co(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=ue,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),ue.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=ue,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),ue.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},h=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=h:o===a.numberElement&&(d.numberInlineSize=h),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?vo(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function vo(e){return Math.max(Math.ceil(e),0)}function bo(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Co(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Se=new Map,It=new Map,jt=new Map,gt=new Set;function mt(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gt.has(t))return!1;return!0}function Rn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gt.has(n.name))continue;let i=Se.get(n.name);i==null&&(i=n,Se.set(n.name,i)),gt.add(i.name),t.loadLanguageSync(i.data)}}function So(){Se.clear(),gt.clear()}function Oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function Ni(e){if(Oi())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=It.get(e);if(t!=null)return t;try{let n=jt.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Ln,e)&&(n=Ln[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Se.has(e)||Se.set(e,o),o});return It.set(e,i),await i}finally{It.delete(e)}}function Fi(e){return Se.get(e)??Ni(e)}const vt=new Set;function Ye(e){const t=[],n=new Set;for(const c of yo(e.themes)){const u=zi(c)?c.getThemes():[c];for(const f of u){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function h(c){if(c==null)return i;const{colorScheme:u,collection:f}=c;return f==null?u==="light"?r:u==="dark"?o:i:i.filter(g=>g.collection!==f?!1:u==null||g.colorScheme===u)}return{getTheme(c){return s.get(c)},getThemes(c){return h(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:h(c).map(u=>u.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ye({themes:i.map((u,f)=>({descriptor:u,index:f})).sort((u,f)=>{const g=c(u.descriptor,f.descriptor);return g!==0?g:u.index-f.index}).map(u=>u.descriptor)})},pick(c){const u=[],f=new Set;for(const g of c){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const b=s.get(g);if(b==null)throw new Error(`Theme collection does not contain theme "${g}"`);u.push(b)}return Ye({themes:u})},registerInto(c){for(const u of i)c.registerThemeIfAbsent(u.name,u.load)}}}function yo(e){return xo(e)?[e]:e}function xo(e){return zi(e)||Lo(e)}function Lo(e){return typeof e.name=="string"&&typeof e.load=="function"}function zi(e){return typeof e.getThemes=="function"}function Ui(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Vi=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},ko=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(){const e=new Map,t=new Map,n=new Map;let i=0;function r(m,p){if(e.has(m))throw new Vi(m);e.set(m,p)}function o(m,p){return e.has(m)?!1:(e.set(m,p),!0)}function s(m){return e.has(m)}function l(m){const p=t.get(m);if(p!==void 0)return Promise.resolve(p);const C=n.get(m);if(C!==void 0)return C;const v=e.get(m);if(v===void 0)return Promise.reject(new ko(m));const x=i,S=v().then(L=>{const E=Ui(L);return x===i&&t.set(m,E),n.get(m)===S&&n.delete(m),E}).catch(L=>{throw n.get(m)===S&&n.delete(m),L});return n.set(m,S),S}function a(m){return Promise.all(m.map(p=>l(p)))}function d(m,p){t.set(m,p)}function h(m){for(const[p,C]of m)d(p,C)}function c(m){return t.get(m)}function u(m){const p=[];for(const C of m){const v=t.get(C);if(v===void 0)throw new wo(C);p.push(v)}return p}function f(m){return t.has(m)}function g(m){for(const p of m)if(!t.has(p))return!1;return!0}function b(m){const p=t.get(m);return p!==void 0?p:l(m)}function y(){i++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:b,getResolvedTheme:c,getResolvedThemes:u,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:h}}const X=Eo();function An(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=X.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,X.getResolvedTheme(n)==null&&X.seedResolvedTheme(n,i);vt.has(n)||(vt.add(n),t.loadThemeSync(i))}}function To(){X.clearResolvedThemes(),vt.clear()}function hn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Io(t)}}function Io(e){return async()=>Or(Ui(await e()))}const Ro="pierre",Ao=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Bi=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Ho=[...Bi,...Ao],Mo=new Set(Bi);function Do(e){return Mo.has(e)?"light":"dark"}const Po={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},_o={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function Oo(e){return hn({name:e,collection:Ro,colorScheme:Do(e),displayName:Po[e],load:_o[e]})}const $i=Ye({themes:Ho.map(e=>Oo(e))}),No="shiki",Wi=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Fo=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],zo=new Set(Wi);function Uo(e){return zo.has(e)?"light":"dark"}const Vo={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function Hn(e){return hn({name:e,collection:No,colorScheme:Uo(e),load:Vo[e]})}const Gi=Ye({themes:Object.freeze([...Wi.map(e=>Hn(e)),...Fo.map(e=>Hn(e))])});Ye({themes:[$i,Gi]});function ji(e){if(Oi())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(X.hasRegisteredTheme(e))return;const t=Gi.getTheme(e);if(t!=null){X.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Bo(e){ji(e);const t=await X.resolveTheme(e);return qi(e,t),t}function $o(e){return X.getResolvedTheme(e)??Bo(e)}let $;async function xt({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){$??=Nr({themes:[],langs:["text"],engine:n==="shiki-wasm"?Fr(k(()=>import("./wasm-CG6Dc4jp.js"),[])):zr()});const i=Wo($)?await $:$;$=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Fi(s);"then"in l?r.push(l):Rn(l,i)}const o=[];for(const s of e){const l=$o(s);"then"in l?o.push(l):An(l,$)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Rn(s,i)}),Promise.all(o).then(s=>{An(s,i)})]),i}function ql(e=$){return e!=null&&!("then"in e)}function Ki(){if($!=null&&!("then"in $))return $}function Wo(e=$){return e!=null&&"then"in e}function Kl(e=$){return e==null}async function Yl(e){await xt(e)}async function Xl(){$!=null&&((await $).dispose(),So(),To(),$=void 0)}for(const e of $i.getThemes())X.registerThemeIfAbsent(e.name,e.load);function cn(e=_){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Ge(e){for(const t of cn(e))if(!vt.has(t))return!1;return!0}function Go(e){return X.hasResolvedThemes(e)}function Oe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ae(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Lt(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function qt(e){return A({tagName:"div",children:[A({tagName:"div",children:e.annotations?.map(t=>A({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function jo(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Yi({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return A({tagName:"div",children:[t==="custom"?A({tagName:"slot",properties:{name:an}}):qo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ko(i)]],properties:r})}function qo({name:e,prevName:t,iconType:n}){const i=[A({tagName:"slot",properties:{name:on}}),pt({name:jo(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(t)]})],properties:{"data-prev-name":""}})),i.push(pt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(e)]})],properties:{"data-title":""}})),A({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ko(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(A({tagName:"span",children:[W(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(A({tagName:"span",children:[W(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(A({tagName:"slot",properties:{name:sn}})),A({tagName:"div",children:t,properties:{"data-metadata":""}})}function Xi(e){return A({tagName:"pre",properties:Yo(e)})}function Yo({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Z=new Map;let bt=0;const Ne={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Q(e){if(Z.has(e))return Z.get(e)??"text";if(Ne[e]!=null)return Ne[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Z.has(t[1]))return Z.get(t[1])??"text";if(Ne[t[1]]!=null)return Ne[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Z.has(n)?Z.get(n)??"text":Ne[n]??"text"}function Ql(e,t){if(e<=bt)return!1;Z.clear();for(const n in t){const i=t[n];i!=null&&Z.set(n,i)}return bt=e,!0}function Jl(){return bt}function Xo(e,t){const n=Z.get(e);return n===t?!1:(n!=null&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${n}" to "${t}"`),Z.set(e,t),bt++,!0)}function Zl(){return Object.fromEntries(Z)}function un(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:cn(t),preferredHighlighter:n}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function xe(e){return e.replace(/\n$|\r\n$/,"")}function Qo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(W(` +import{t as pe,b as Ln,n as Or,c as Nr,a as Fr,d as zr,s as Ur,g as Vr,e as Br}from"./index-DvnquuzZ.js";import{f as Ld}from"./index-DvnquuzZ.js";import{bR as k}from"./index-BRkLL_ut.js";const Ei="diffs-container",$r=(()=>{try{return!1}catch{return!1}})(),Wr=/(?=^From [a-f0-9]+ .+$)/m,Ti=/(?=^diff --git)/gm,Ul=/(?=^---\s+\S)/gm,Vl=/(?=^@@ )/gm,Gr=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,jr=/(?<=\n)/,qr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yr=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Bl=/^<{7,}(?:\s.*)?$/,$l=/^\|{7,}(?:\s.*)?$/,Wl=/^={7,}$/,Gl=/^>{7,}(?:\s.*)?$/,on="header-prefix",sn="header-metadata",an="header-custom",_={dark:"pierre-dark",light:"pierre-light"},Ii="data-theme-css",Ri="data-unsafe-css",Qr="data-core-css",Jr="data-diffs-scrollbar-measure",Ai="--diffs-scrollbar-gutter-measured",jl=1,Zr=1e5,ln={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},_e={...ln,hunkLineCount:1},eo={paddingTop:8,paddingBottom:8,gap:8},to={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},no=Object.freeze({fromStart:0,fromEnd:0}),Ae={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Hi={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ie=new Set;let Re=null;function Y(e){Ie.add(e),Re??=requestAnimationFrame(Mi)}function io(e){Ie.delete(e),Ie.size===0&&Re!=null&&(cancelAnimationFrame(Re),Re=null)}function Mi(e){const t=new Set(Ie);Ie.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ie.size>0?Re=requestAnimationFrame(Mi):Re=null}function He(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function dn(e,t){const n=e?.theme??_,i=t?.theme??_,r=kn(e),o=kn(t);return De(n,i)&&He(e,t,["theme","parseDiffOptions"])&&He(r,o)}function kn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Wt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Gt({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const h=Math.max(e-r,0),c=Math.min(e+l,t);return{top:h,bottom:Math.max(c,h)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function ro(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function W(e){return{type:"text",value:e}}function A({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function pt({name:e,width:t=16,height:n=16,properties:i}){return A({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[A({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function oo(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ee(e){return A({tagName:"div",properties:{"data-gutter":""},children:e})}function Di(e,t,n,i={}){return A({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[A({tagName:"span",properties:{"data-line-number-content":""},children:[W(`${t}`)]})]:void 0})}function j(e,t,n){return A({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function so(){return A({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[pt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function ao(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Pi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||Wt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&et(e.composedPath())||(he(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(he(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(he(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){he(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();he(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);he(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Tt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Tt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(co(r)&&f!=null){f(r);break}if(ho(r)&&u!=null){u(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Tt(r))break;ut(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,b=g!=null,y=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||h!=null||c!=null||u||f||b;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,he(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const C=[];return(t==="both"||t==="click")&&(i!=null&&C.push("onLineClick"),r!=null&&C.push("onLineNumberClick"),h!=null&&C.push("expandable hunk separators"),c!=null&&C.push("merge conflict actions")),C})()),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const m=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&m||!b&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();et(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(ao(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=pe(so());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ve(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(Ze(r));if(Ve(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ve(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ve(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&et(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Ze(e);if(t&&et(n))return;const i=fo(e);return i!=null?Ze(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=go(po(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Ze(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=En(t)?t:En(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Wt(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,h=d.children.length;if(h!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let c=0;cs)break;if(g==null||gNumber.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Ke({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p},C,v,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:lo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:C,onMergeConflictActionClick:x,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:v}}function lo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ve(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function Tt(e){return Ve(e)||ut(e)}function ho(e){return"type"in e&&e.type==="line-info"}function co(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function wn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ze(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function po(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function go(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function En(e){return e!=null&&typeof e.elementFromPoint=="function"}function Tn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function In(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function et(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function he(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var _i=class ue{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ue.resizeObserver??new ResizeObserver(ue.handleSharedResizeEntries);return ue.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=ue.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let h=l.get(d);h==null&&(h=[],l.set(d,h)),h.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[h,c]=d,u=h.firstElementChild,f=c.firstElementChild;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(u);if(g!=null){this.observedNodes.set(u,g),this.observedNodes.set(f,g),o.delete(u),o.delete(f);continue}const b=u.getBoundingClientRect().height,y=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:h,child:u,childHeight:b},column2:{container:c,child:f,childHeight:y},currentHeight:"auto"},i.add({child1:u,child2:f,item:g,newHeight:Math.max(b,y)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?bo(l):Co(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=ue,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),ue.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=ue,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),ue.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},h=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=h:o===a.numberElement&&(d.numberInlineSize=h),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?vo(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function vo(e){return Math.max(Math.ceil(e),0)}function bo(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Co(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Se=new Map,It=new Map,jt=new Map,gt=new Set;function mt(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gt.has(t))return!1;return!0}function Rn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gt.has(n.name))continue;let i=Se.get(n.name);i==null&&(i=n,Se.set(n.name,i)),gt.add(i.name),t.loadLanguageSync(i.data)}}function So(){Se.clear(),gt.clear()}function Oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function Ni(e){if(Oi())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=It.get(e);if(t!=null)return t;try{let n=jt.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Ln,e)&&(n=Ln[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Se.has(e)||Se.set(e,o),o});return It.set(e,i),await i}finally{It.delete(e)}}function Fi(e){return Se.get(e)??Ni(e)}const vt=new Set;function Ye(e){const t=[],n=new Set;for(const c of yo(e.themes)){const u=zi(c)?c.getThemes():[c];for(const f of u){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function h(c){if(c==null)return i;const{colorScheme:u,collection:f}=c;return f==null?u==="light"?r:u==="dark"?o:i:i.filter(g=>g.collection!==f?!1:u==null||g.colorScheme===u)}return{getTheme(c){return s.get(c)},getThemes(c){return h(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:h(c).map(u=>u.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ye({themes:i.map((u,f)=>({descriptor:u,index:f})).sort((u,f)=>{const g=c(u.descriptor,f.descriptor);return g!==0?g:u.index-f.index}).map(u=>u.descriptor)})},pick(c){const u=[],f=new Set;for(const g of c){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const b=s.get(g);if(b==null)throw new Error(`Theme collection does not contain theme "${g}"`);u.push(b)}return Ye({themes:u})},registerInto(c){for(const u of i)c.registerThemeIfAbsent(u.name,u.load)}}}function yo(e){return xo(e)?[e]:e}function xo(e){return zi(e)||Lo(e)}function Lo(e){return typeof e.name=="string"&&typeof e.load=="function"}function zi(e){return typeof e.getThemes=="function"}function Ui(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Vi=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},ko=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(){const e=new Map,t=new Map,n=new Map;let i=0;function r(m,p){if(e.has(m))throw new Vi(m);e.set(m,p)}function o(m,p){return e.has(m)?!1:(e.set(m,p),!0)}function s(m){return e.has(m)}function l(m){const p=t.get(m);if(p!==void 0)return Promise.resolve(p);const C=n.get(m);if(C!==void 0)return C;const v=e.get(m);if(v===void 0)return Promise.reject(new ko(m));const x=i,S=v().then(L=>{const E=Ui(L);return x===i&&t.set(m,E),n.get(m)===S&&n.delete(m),E}).catch(L=>{throw n.get(m)===S&&n.delete(m),L});return n.set(m,S),S}function a(m){return Promise.all(m.map(p=>l(p)))}function d(m,p){t.set(m,p)}function h(m){for(const[p,C]of m)d(p,C)}function c(m){return t.get(m)}function u(m){const p=[];for(const C of m){const v=t.get(C);if(v===void 0)throw new wo(C);p.push(v)}return p}function f(m){return t.has(m)}function g(m){for(const p of m)if(!t.has(p))return!1;return!0}function b(m){const p=t.get(m);return p!==void 0?p:l(m)}function y(){i++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:b,getResolvedTheme:c,getResolvedThemes:u,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:h}}const X=Eo();function An(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=X.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,X.getResolvedTheme(n)==null&&X.seedResolvedTheme(n,i);vt.has(n)||(vt.add(n),t.loadThemeSync(i))}}function To(){X.clearResolvedThemes(),vt.clear()}function hn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Io(t)}}function Io(e){return async()=>Or(Ui(await e()))}const Ro="pierre",Ao=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Bi=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Ho=[...Bi,...Ao],Mo=new Set(Bi);function Do(e){return Mo.has(e)?"light":"dark"}const Po={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},_o={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function Oo(e){return hn({name:e,collection:Ro,colorScheme:Do(e),displayName:Po[e],load:_o[e]})}const $i=Ye({themes:Ho.map(e=>Oo(e))}),No="shiki",Wi=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Fo=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],zo=new Set(Wi);function Uo(e){return zo.has(e)?"light":"dark"}const Vo={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function Hn(e){return hn({name:e,collection:No,colorScheme:Uo(e),load:Vo[e]})}const Gi=Ye({themes:Object.freeze([...Wi.map(e=>Hn(e)),...Fo.map(e=>Hn(e))])});Ye({themes:[$i,Gi]});function ji(e){if(Oi())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(X.hasRegisteredTheme(e))return;const t=Gi.getTheme(e);if(t!=null){X.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Bo(e){ji(e);const t=await X.resolveTheme(e);return qi(e,t),t}function $o(e){return X.getResolvedTheme(e)??Bo(e)}let $;async function xt({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){$??=Nr({themes:[],langs:["text"],engine:n==="shiki-wasm"?Fr(k(()=>import("./wasm-CG6Dc4jp.js"),[])):zr()});const i=Wo($)?await $:$;$=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Fi(s);"then"in l?r.push(l):Rn(l,i)}const o=[];for(const s of e){const l=$o(s);"then"in l?o.push(l):An(l,$)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Rn(s,i)}),Promise.all(o).then(s=>{An(s,i)})]),i}function ql(e=$){return e!=null&&!("then"in e)}function Ki(){if($!=null&&!("then"in $))return $}function Wo(e=$){return e!=null&&"then"in e}function Kl(e=$){return e==null}async function Yl(e){await xt(e)}async function Xl(){$!=null&&((await $).dispose(),So(),To(),$=void 0)}for(const e of $i.getThemes())X.registerThemeIfAbsent(e.name,e.load);function cn(e=_){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Ge(e){for(const t of cn(e))if(!vt.has(t))return!1;return!0}function Go(e){return X.hasResolvedThemes(e)}function Oe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ae(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Lt(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function qt(e){return A({tagName:"div",children:[A({tagName:"div",children:e.annotations?.map(t=>A({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function jo(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Yi({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return A({tagName:"div",children:[t==="custom"?A({tagName:"slot",properties:{name:an}}):qo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ko(i)]],properties:r})}function qo({name:e,prevName:t,iconType:n}){const i=[A({tagName:"slot",properties:{name:on}}),pt({name:jo(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(t)]})],properties:{"data-prev-name":""}})),i.push(pt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(e)]})],properties:{"data-title":""}})),A({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ko(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(A({tagName:"span",children:[W(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(A({tagName:"span",children:[W(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(A({tagName:"slot",properties:{name:sn}})),A({tagName:"div",children:t,properties:{"data-metadata":""}})}function Xi(e){return A({tagName:"pre",properties:Yo(e)})}function Yo({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Z=new Map;let bt=0;const Ne={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Q(e){if(Z.has(e))return Z.get(e)??"text";if(Ne[e]!=null)return Ne[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Z.has(t[1]))return Z.get(t[1])??"text";if(Ne[t[1]]!=null)return Ne[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Z.has(n)?Z.get(n)??"text":Ne[n]??"text"}function Ql(e,t){if(e<=bt)return!1;Z.clear();for(const n in t){const i=t[n];i!=null&&Z.set(n,i)}return bt=e,!0}function Jl(){return bt}function Xo(e,t){const n=Z.get(e);return n===t?!1:(n!=null&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${n}" to "${t}"`),Z.set(e,t),bt++,!0)}function Zl(){return Object.fromEntries(Z)}function un(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:cn(t),preferredHighlighter:n}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function xe(e){return e.replace(/\n$|\r\n$/,"")}function Qo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(W(` `)),e}const tt=Symbol("no-token"),Rt=Symbol("multiple-tokens");function Qi(e){const t=Jo(e);if(t!=null)return t;let n=tt;const i=[];let r=[],o;const s=()=>{if(r.length===0||o==null){r=[],o=void 0;return}if(r.length===1){const a=r[0];if(a?.type==="element"){Zo(a,o);for(const d of a.children)ft(d)}else ft(a);i.push(a),r=[],o=void 0;return}for(const a of r)ft(a);i.push(A({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},l=a=>{if(a!==tt){if(a===Rt){n=Rt;return}if(n===tt){n=a;return}n!==a&&(n=Rt)}};for(const a of e.children){const d=a.type==="element"?Qi(a):tt;if(l(d),typeof d!="number"){s(),i.push(a);continue}o!=null&&o!==d&&s(),o??=d,r.push(a)}return s(),e.children=i,n}function Jo(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function ft(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)ft(t)}}function Zo(e,t){e.properties["data-char"]=t}function es(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=l=>l}=e,r=new Map;function o(l){return Object.entries(l).map(([a,d])=>`${a}:${d}`).join(";")}function s(l){let a=t+ts(typeof l=="string"?l:o(l))+n;return a=i(a),r.has(a)||r.set(a,typeof l=="string"?l:{...l}),a}return{name:"@shikijs/transformers:style-to-class",pre(l){if(!l.properties.style)return;const a=s(l.properties.style);delete l.properties.style,this.addClassToHast(l,a)},tokens(l){for(const a of l)for(const d of a){if(!d.htmlStyle)continue;const h=s(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${h}`:d.htmlAttrs.class=h}},getClassRegistry(){return r},getCSS(){let l="";for(const[a,d]of r.entries())l+=`.${a}{${typeof d=="string"?d:o(d)}}`;return l},clearRegistry(){r.clear()}}}function ts(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function Ji(e=!1,t=!1){const n={lineInfo:[]},i=[{line(r){return delete r.properties.class,r},pre(r){const o=oo(r),s=[];if(o!=null){let l=1;for(const a of o.children)a.type==="element"&&(e&&Qi(a),s.push(Qo(a,l,n)),l++);o.children=s}return r},...e?{tokens(r){for(const o of r){let s=0;for(const l of o){const a=l;a.__lineChar??=s,s+=l.content.length}}},preprocess(r,o){o.mergeWhitespaces="never"},span(r,o,s,l,a){if(a?.offset!=null&&a.content!=null){const d=a.__lineChar;return d!=null&&(r.properties["data-char"]=d),r}return r}}:null}];return t&&i.push(ns,Mn),{state:n,transformers:i,toClass:Mn}}const Mn=es({classPrefix:"hl-"}),ns={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function B(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const is=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,rs=/^0(?:\.0+)?%?$/;function os(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const r=i.lastIndexOf("/");if(r!==-1)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const o=i.split(",");if(o.length===4)return o[3]?.trim()}}function ss(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,r=1;return n.length===3?i=n.split("").map(o=>o+o).join(""):n.length===6?i=n:(i=n.slice(0,6),r=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),r]}function At(e){if(e==null)return null;const t=ss(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,r=t[2]/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function Dn(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||is.test(t))return!0;const n=os(t);return n!=null&&rs.test(n)}function as(e,t,n){if(t==null||n==null)return!1;const i=At(e),r=At(t),o=At(n);return i==null||r==null||o==null?!1:Math.abs(i-o){const s=e.at(-1);return s===""||s===` `||s===`\r `||s==="\r"?Math.max(0,e.length-2):e.length-1})();for(let s=t;s0||l<1/0,{state:h,transformers:c}=Ji(r),u=o?"text":e.lang??Q(e.name),f=typeof n=="string"?t.getTheme(n).type:void 0,g=fn({theme:n,highlighter:t});h.lineInfo=p=>({type:"context",lineIndex:p-1+s,lineNumber:p+s});const b=typeof n=="string"?{lang:u,theme:n,transformers:c,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}:{lang:u,themes:n,transformers:c,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0},y=Kt(t.codeToHast(d?cs(a??St(e.contents),s,l):xe(e.contents),b)),m=d?new Array(s):y;return d&&m.push(...y),{code:m,themeStyles:g,baseThemeType:f}}function cs(e,t,n){let i="";return Ct({lines:e,startingLine:t,totalLines:n,callback({content:r}){i+=r}}),i}const Zi="-1,-1";function Yt(e){return e?.some(t=>t.lineNumber===0)??!1}function Xt(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function kt(e){return e.startingLine===0&&e.totalLines>0}function er(e,t){return A({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Qt(e){return(e.lang??Q(e.name))==="text"}function tr(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}let us=-1;var fs=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++us}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:_},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Ge(e.theme??_)?Ki():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e),n=Pt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let i=this.workerManager?.getFileResultCache(e);i!=null&&!Oe(t,i.options)&&(i=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Qt(e),result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??Q(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:i=_,tokenizeMaxLineLength:r=1e3}=this.options;return{theme:i,useTokenTransformer:tr(this.options),tokenizeMaxLineLength:r}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!ae(e,n.file)||!Oe(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,St(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:St(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=Ae){if(e==null)return;let{options:n,forceHighlight:i}=this.getRenderOptions(e);const r=this.getMatchingWorkerResultCache(e,n);r!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...r},i=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const o=this.getOrCreateLineCache(e),s=e.contents.length>0,l=!s||Qt(e)||Pt(o.length,this.getTokenizeMaxLength()),a=!ae(e,this.renderCache.file),d=!Lt(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(l||this.renderCache.result==null||!this.renderCache.highlighted&&(a||d))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||a||d||i)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,o)),this.renderCache.renderRange=t),!l&&s&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Q(e.name);const h=this.highlighter!=null&&Ge(n.theme),c=this.highlighter!=null&&mt(this.computedLang),u=!l&&c;if(this.highlighter!=null&&h&&(i||l||!this.renderCache.highlighted&&u||this.renderCache.result==null)){const{result:f,options:g}=this.renderFileWithHighlighter(e,this.highlighter,l||!c);this.renderCache={file:e,options:g,highlighted:u,result:f,renderRange:void 0}}(!h||!l&&!c)&&this.asyncHighlight(e).then(({result:f,options:g})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,f,g,!l)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=Ae){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=Pt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Q(e.name);const n=this.highlighter!=null&&Go(cn(this.options.theme)),i=t||this.highlighter!=null&&mt(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e);return{result:hs(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){const{disableFileHeader:o=!1}=this.options,s=[],l=Ee(),a=this.getOrCreateLineCache(e);let d=0;const h=kt(t)?Xt(this.lineAnnotations):void 0;return h!=null&&(l.children.push(j("context","annotation",1)),s.push(qt({hunkIndex:-1,lineIndex:-1,annotations:h.map(c=>ge(c))})),d++),Ct({lines:a,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:c,lineNumber:u})=>{const f=n[c];if(f==null){const g="FileRenderer.processFileResult: Line doesnt exist";throw console.error(g,{name:e.name,lineIndex:c,lineNumber:u,lines:a}),new Error(g)}if(f!=null){l.children.push(Di("context",u,`${c}`)),s.push(f),d++;const g=this.lineAnnotations[u];g!=null&&(l.children.push(j("context","annotation",1)),s.push(qt({hunkIndex:0,lineIndex:u,annotations:g.map(b=>ge(b))})),d++)}}}),l.properties.style=`grid-row: span ${d}`,{gutterAST:l.children??[],contentAST:s,preAST:this.createPreElement(a.length),headerAST:o?void 0:this.renderHeader(e),totalLines:a.length,rowCount:d,themeStyles:i,baseThemeType:r,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return Yi({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return pe(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(A({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=Ee();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,er(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return t?pe(A({tagName:"code",children:e,properties:{"data-code":""}})):pe(e)}async initializeHighlighter(){return this.highlighter=await xt(un(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const r=!ae(e,this.renderCache.file)||!this.renderCache.highlighted||!Oe(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Oe(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&ae(e,n.file)&&Oe(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return Xi({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function Pt(e,t){return e>t}const nr=`
      +`:`
      +`)+`
      +
        +`}function Eue(){return`
      +
      +`}function Lue(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
    1. `}function Nue(){return`
    2. +`}function Due(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
      ↩︎`}function Fue(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Iue,e.renderer.rules.footnote_block_open=Tue,e.renderer.rules.footnote_block_close=Eue,e.renderer.rules.footnote_open=Lue,e.renderer.rules.footnote_close=Nue,e.renderer.rules.footnote_anchor=Due,e.renderer.rules.footnote_caption=Mue,e.renderer.rules.footnote_anchor_name=_ue;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const v=l.bMarks[a],y=l.tShift[a],b=l.sCount[a],C=l.parentType,A=h,T=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let N=T;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let C=0;C?@[\]^_`{|}~-])/g;function $ue(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,v){v=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},v),g.core.ruler.after("inline","github-task-lists",function(y){for(var b=y.tokens,C=0,A=2;A=0;b--)if(g[b].level===y)return b;return-1}function o(g,v){return d(g[v])&&f(g[v-1])&&h(g[v-2])&&m(g[v])}function s(g,v,y,b){var C=y.idPrefix+v;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(C,b)),g.children.push(a(b)),g.children.unshift(r(g,C,y,b)),y.divWrap&&(g.children.unshift(u(y,b)),g.children.push(c(b)))}function r(g,v,y,b){var C=new b("checkbox_input","input",0);return C.attrs=[["type","checkbox"],["id",v]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&C.attrs.push(["checked","true"]),y.disabled===!0&&C.attrs.push(["disabled","true"]),C}function l(g,v){var y=new v("label_open","label",1);return y.attrs=[["for",g]],y}function a(g){return new g("label_close","label",-1)}function u(g,v){var y=new v("checkbox_open","div",0);return y.attrs=[["class",g.divClass]],y}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const jue=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Hue(e){return e>=55296&&e<=57343||e>1114111?65533:jue.get(e)??e}function Wue(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=Eo.ZERO&&e<=Eo.NINE}function Uue(e){return e>=Eo.UPPER_A&&e<=Eo.UPPER_F||e>=Eo.LOWER_A&&e<=Eo.LOWER_F}function Vue(e){return e>=Eo.UPPER_A&&e<=Eo.UPPER_Z||e>=Eo.LOWER_A&&e<=Eo.LOWER_Z||hC(e)}function Kue(e){return e===Eo.EQUALS||Vue(e)}var zs;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(zs||(zs={}));var dd;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(dd||(dd={}));var Zue=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=zs.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=dd.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=zs.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case zs.EntityStart:return e.charCodeAt(t)===Eo.NUM?(this.state=zs.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=zs.NamedEntity,this.stateNamedEntity(e,t));case zs.NumericStart:return this.stateNumericStart(e,t);case zs.NumericDecimal:return this.stateNumericDecimal(e,t);case zs.NumericHex:return this.stateNumericHex(e,t);case zs.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|xT)===Eo.LOWER_X?(this.state=zs.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=zs.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&$r.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&$r.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===Eo.SEMI&&o!==0&&(i&$r.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=Que(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===dd.Attribute&&(o===0||Kue(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&$r.VALUE_LENGTH)>>14,o!==0){if(s===Eo.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==dd.Strict&&(i&$r.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&$r.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~($r.VALUE_LENGTH|$r.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case zs.NamedEntity:return this.result!==0&&(this.decodeMode!==dd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case zs.NumericDecimal:return this.emitNumericEntity(0,2);case zs.NumericHex:return this.emitNumericEntity(0,3);case zs.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case zs.EntityStart:return 0}}};function Gue(e){let t="";const n=new Zue(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function Que(e,t,n,i){const o=(t&$r.BRANCH_LENGTH)>>7,s=t&$r.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const Yue=Gue(que);function n7(e,t=dd.Legacy){return Yue(e,t)}var Jue=mz(zue());const ST={};function Xue(e){let t=ST[e];if(t)return t;t=ST[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}jb.defaultChars=";/?:@&=+$,#";jb.componentChars="";var pC=jb;const _T={};function ece(e){let t=_T[e];if(t)return t;t=_T[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=ece(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}Hb.defaultChars=";/?:@&=+$,-_.!~*'()#";Hb.componentChars="-_.!~*'()";var gz=Hb;function i7(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function X9(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const tce=/^([a-z0-9.+-]+:)/i,nce=/:[0-9]*$/,ice=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,oce=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),sce=["'"].concat(oce),MT=["%","/","?",";","#"].concat(sce),IT=["/","?","#"],rce=255,TT=/^[+a-z0-9A-Z_-]{0,63}$/,lce=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ET={javascript:!0,"javascript:":!0},LT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ace(e,t){if(e&&e instanceof X9)return e;const n=new X9;return n.parse(e,t),n}X9.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=ice.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=tce.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&ET[r])&&(s=s.substr(2),this.slashes=!0)),!ET[r]&&(o||r&&!LT[r])){let u=-1;for(let m=0;m127?b+="x":b+=y[C];if(!b.match(TT)){const C=m.slice(0,g),A=m.slice(g+1),T=y.match(lce);T&&(C.push(T[1]),A.unshift(T[2])),A.length&&(s=A.join(".")+s),this.hostname=C.join(".");break}}}}this.hostname.length>rce&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),LT[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};X9.prototype.parseHost=function(e){let t=nce.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var o7=ace,vz=xue({decode:()=>pC,encode:()=>gz,format:()=>i7,parse:()=>o7}),uce=Object.defineProperty,yz=e=>{let t={};for(var n in e)uce(t,n,{get:e[n],enumerable:!0});return t},Ds=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},cce=yz({arrayReplaceAt:()=>vce,assign:()=>mce,countLines:()=>zo,escapeHtml:()=>_ce,escapeRE:()=>Ice,fromCodePoint:()=>H0,has:()=>pce,isMdAsciiPunct:()=>nk,isPunctChar:()=>tk,isPunctCode:()=>mC,isSpace:()=>gce,isString:()=>fce,isValidEntityCode:()=>qb,isWhiteSpace:()=>j0,lib:()=>Tce,mdurl:()=>vz,normalizeReference:()=>Wb,ucmicro:()=>ek,unescapeAll:()=>W0,unescapeMd:()=>wce});const ek={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function dce(e){return Object.prototype.toString.call(e)}function fce(e){return dce(e)==="[object String]"}const hce=Object.prototype.hasOwnProperty;function pce(e,t){return hce.call(e,t)}function mce(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function gce(e){return e===9||e===32}function j0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function tk(e){return ek.P.test(e)||ek.S.test(e)}const NT=new Map;function mC(e){if(nk(e))return!0;if(e>=0&&e<128)return!1;const t=NT.get(e);if(t!==void 0)return t;const n=tk(String.fromCharCode(e));return NT.set(e,n),n}function nk(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Wb(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function vce(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function qb(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function H0(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const kz=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,yce=new RegExp(`${kz.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),kce=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function bce(e,t){if(t.charCodeAt(0)===35&&kce.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return qb(i)?H0(i):e}const n=n7(e);return n!==e?n:e}function wce(e){return e.includes("\\")?e.replace(kz,"$1"):e}function W0(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(yce,(t,n,i)=>n||bce(t,i))}const Cce=/[&<>"]/,Ace=/[&<>"]/g,xce={"&":"&","<":"<",">":">",'"':"""};function Sce(e){return xce[e]}function _ce(e){return Cce.test(e)?e.replace(Ace,Sce):e}const Mce=/[.?*+^$[\]\\(){}|-]/g;function Ice(e){return e.replace(Mce,"\\$&")}const Tce={mdurl:vz,ucmicro:ek};function zo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` +`,n+1))!==-1;)t++;return t}const Ece=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Lce=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Nce=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,s7=["references","footnotes","abbreviations","abbr","abbrs"],r7=Symbol.for("markdown-it-ts.global-state"),l7=Object.prototype.hasOwnProperty;function DT(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function ja(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Sd(e){if(Array.isArray(e))return e.map(t=>Sd(t));if(ja(e)){const t={};for(const n of Object.keys(e))t[n]=Sd(e[n]);return t}return e}function ik(e){return Array.isArray(e)?e.map((t,n)=>String(n)):ja(e)?Object.keys(e):[]}function gC(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!gC(o[r],bz(i.value,r)):!0)}}function Ic(e){const t=a7(e);if(t){for(const n of s7){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Fce(e,n,i);continue}i.existed?e[n]=Dce(e[n],i.value):delete e[n]}delete e[r7]}}function Y3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const vC=Symbol.for("markdown-it-ts.diagnostics");function Lv(e,t){if(e)try{const n=e[vC];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[vC]=i,i}catch{return}}function oc(e){return Lv(e,!1)}function Rce(e){if(e)try{const t=e[vC];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Pr(e){Rce(e)}function Jm(e,t){const n=Lv(e,!0);n&&(n.stockFast=t)}function fs(e,t){const n=Lv(e,!0);n&&(n.strategy=t)}function J3(e,t){const n=Lv(e,!0);n&&(n.chunk=t)}function wz(e,t){const n=Lv(e,!0);n&&(n.unbounded=t)}const Oce=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,$ce=/[\0-\x1F\x7F-\x9F]/,Pce=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,zce=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var jce=class{src_Any=Oce.source;src_Cc=$ce.source;src_Z=zce.source;src_P=Pce.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},X3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},Hce={"http:":X3,"https:":X3,"ftp:":X3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},Wce="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",qce="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function Uce(){const e=qce.split("|");return Wce.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var Vce={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Uce(),urlAuth:!1,maxLength:1e4},FT=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},Cz=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...Vce,...n},this.__schemas__={...Hce},this.re=t||new jce,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const b=a;a=void 0;const C=this.testSchemaAt(e,b.schema,b.lastIndex);if(C){g={schema:b.schema,index:b.index,lastIndex:b.lastIndex+C};break}}let v=g;if((!v||l&&(l.indexv.lastIndex))&&(v=l),(!v||r&&(r.indexv.lastIndex))&&(v=r),!v)break;v===l?l=void 0:v===r&&(r=void 0);const y=new FT(e,v.schema,v.index,v.lastIndex);y.schema?this.__schemas__[y.schema].normalize(y,this):this.normalize(y),t.push(y),f=v.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new FT(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},Kce=pz({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,v=Math.floor,y=String.fromCharCode;function b(P){throw new RangeError(m[P])}function C(P,O){const R=[];let z=P.length;for(;z--;)R[z]=O(P[z]);return R}function A(P,O){const R=P.split("@");let z="";R.length>1&&(z=R[0]+"@",P=R[1]),P=P.replace(h,".");const H=C(P.split("."),O).join(".");return z+H}function T(P){const O=[];let R=0;const z=P.length;for(;R=55296&&H<=56319&&RString.fromCodePoint(...P),_=function(P){return P>=48&&P<58?26+(P-48):P>=65&&P<91?P-65:P>=97&&P<123?P-97:36},w=function(P,O){return P+22+75*(P<26)-((O!=0)<<5)},M=function(P,O,R){let z=0;for(P=R?v(P/700):P>>1,P+=v(P/O);P>g*26>>1;z+=36)P=v(P/g);return v(z+(g+1)*P/(P+38))},x=function(P){const O=[],R=P.length;let z=0,H=128,j=72,K=P.lastIndexOf("-");K<0&&(K=0);for(let re=0;re=128&&b("not-basic"),O.push(P.charCodeAt(re));for(let re=K>0?K+1:0;re=R&&b("invalid-input");const ge=_(P.charCodeAt(re++));ge>=36&&b("invalid-input"),ge>v((2147483647-z)/ne)&&b("overflow"),z+=ge*ne;const Ae=te<=j?1:te>=j+26?26:te-j;if(gev(2147483647/me)&&b("overflow"),ne*=me}const Q=O.length+1;j=M(z-q,Q,q==0),v(z/Q)>2147483647-H&&b("overflow"),H+=v(z/Q),z%=Q,O.splice(z++,0,H)}return String.fromCodePoint(...O)},E=function(P){const O=[];P=T(P);const R=P.length;let z=128,H=0,j=72;for(const q of P)q<128&&O.push(y(q));const K=O.length;let re=K;for(K&&O.push("-");re=z&&nev((2147483647-H)/Q)&&b("overflow"),H+=(q-z)*Q,z=q;for(const ne of P)if(ne2147483647&&b("overflow"),ne===z){let te=H;for(let ge=36;;ge+=36){const Ae=ge<=j?1:ge>=j+26?26:ge-j;if(te32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=W0(e.slice(t,o)),s.pos=o,s.ok=!0),s}var xz=d7;const qy=-2;function Zce(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=Zce(l,t,a,n);if(f!==qy)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function Yce(e,t,n){const i=Ub(e,t);i<0?p7(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var Jce=yz({attrGet:()=>Qce,attrIndex:()=>Ub,attrJoin:()=>Yce,attrPush:()=>p7,attrSet:()=>Gce,parseLinkDestination:()=>d7,parseLinkLabel:()=>f7,parseLinkTitle:()=>h7});function Xce(e){return e.includes("\r")||e.includes("\0")}function _z(e){return typeof e=="string"?e:e.toString()}function ede(e){if(e.inlineMode){const t=new Ds("inline","",0);t.content=_z(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const tde=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,nde=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function ide(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(nde.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(tde.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var Mz=ide;function ode(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var Iz=ode;function BT(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function sde(e){const t=e.tokens_meta,n=e.tokens_meta.length;BT(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?Tz:Ez,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function ade(e){const t=e.tokens_meta,n=e.tokens_meta.length;RT(e,e.delimiters);for(let i=0;i=48&&e<=57}function ude(e){const t=e|32;return m7(e)||t>=97&&t<=102}function Nz(e){const t=e|32;return t>=97&&t<=122}function cde(e){return Nz(e)||m7(e)}function dde(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function fde(e,t,n){let i=t+1;if(i>=n||!Nz(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return Lz(o)!==o?o:null}function hde(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=dde(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=qb(s)?H0(s):H0(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=fde(e.src,n,i);if(o){const s=Lz(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var Dz=hde;const Fz=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),kC=new Array(128),Bz=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);kC[e]=`\\${t}`,Bz[e]=Fz[e]?t:kC[e]}function OT(e,t,n){e.pending&&e.pushPending();const i=new Ds("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function pde(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return OT(e,s<256&&Fz[s]?r:l,l),e.pos=n+1,!0}var Rz=pde;function mde(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,$z="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",vde=new RegExp(`^(?:${Oz}|${$z}||<\\?[\\s\\S]*?\\?>|]*>|)`),yde=new RegExp(`^(?:${Oz}|${$z})`);function Pz(e){return e===32||e===9||e===10||e===12||e===13}function kde(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||Pz(t)}function bde(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function Cde(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!wde(s))return!1;const r=o.slice(i).match(vde);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,kde(l)&&e.linkLevel++,bde(l)&&e.linkLevel--}return e.pos+=l.length,!0}var zz=Cde;function Ade(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=ok(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=xz(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[Wb(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const v=e.push("image","img",0);v.attrs=[["src",c],["alt",""]],v.children=g,v.content=i,a&&v.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var jz=Ade;function e8(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[Wb(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var Hz=xde;function Wz(e){const t=e|32;return t>=97&&t<=122}function Sde(e){return e>=48&&e<=57}function _de(e){return Wz(e)||Sde(e)||e===43||e===45||e===46}function Mde(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&_de(e.charCodeAt(t));)t--;return t++,t>=e.length||!Wz(e.charCodeAt(t))?null:e.slice(t)}function Ide(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=Mde(e.pending);if(!o)return!1;const s=Ide(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Tde(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||PT(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function Fde(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function Kz(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:g7(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function g1(e,t,n,i,o,s){const r=Kz(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Fde(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=g7()}function Bde(e){const t=Kz(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},Zz=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Ds("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Ds(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Ds(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function jT(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return Uz(e,t);case 33:return jz(e,t);case 38:return Dz(e,t);case 42:case 95:return yC.tokenize(e,t);case 58:return e.md.options.linkify&&qz(e,t);case 60:return Mz(e,t)||zz(e,t);case 91:return Hz(e,t);case 92:return Rz(e,t);case 96:return Iz(e,t);case 126:return bC.tokenize(e,t);default:return Vz(e,t)}}function Gz(e){return!Rde.test(e)}var Ode=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new zT,this.ruler2=new zT,this.ruler.push("text",Vz),this.ruler.push("linkify",qz),this.ruler.push("newline",Uz),this.ruler.push("escape",Rz),this.ruler.push("backticks",Iz),this.ruler.push("strikethrough",bC.tokenize),this.ruler.push("emphasis",yC.tokenize),this.ruler.push("link",Hz),this.ruler.push("image",jz),this.ruler.push("autolink",Mz),this.ruler.push("html_inline",zz),this.ruler.push("entity",Dz),this.ruler2.push("balance_pairs",rde),this.ruler2.push("strikethrough",bC.postProcess),this.ruler2.push("emphasis",yC.postProcess),this.ruler2.push("fragments_join",gde),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=jT(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&Gz(e)){const a=new Ds("text","",0);a.content=e,i.push(a);return}const o=new Zz(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&Gz(s.content)){const r=new Ds("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const Pde=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,zde=/[0-9a-z]/i;function jde(e){return/^\s]/i.test(e)}function Hde(e){return/^<\/a\s*>/i.test(e)}function Wde(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(jde(l.content)&&s>0&&s--,Hde(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>Wde(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const T=new Ds("text","",0);T.content=a.slice(f,y),T.level=d,c.push(T)}const b=new Ds("link_open","a",1);b.attrs=[["href",g]],b.level=d++,b.markup="linkify",b.info="auto",c.push(b);const C=new Ds("text","",0);C.content=v,C.level=d,c.push(C);const A=new Ds("link_close","a",-1);A.level=--d,A.markup="linkify",A.info="auto",c.push(A),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(Gde,Yde)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Xde(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&Qz.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function efe(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");Zde.test(i)&&Jde(n.children||[]),Qz.test(i)&&Xde(n.children||[])}}var tfe=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const nfe=/['"]/,HT=/['"]/g,WT="’";function j2(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function ife(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=y,h=b),!f&&!h){m&&(r.content=j2(r.content,d.index,WT));continue}if(h)for(n=i.length-1;n>=0;n--){let T=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!nfe.test(i)||!n.children||ife(n.children,e)}}function sfe(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],v=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let C=!1,A;for(A=t;A=d)break;if(o.charCodeAt(c++)===62&&!M){let E=a[A]+1,I,F;o.charCodeAt(c)===32?(c++,E++,F=!1,I=!0):o.charCodeAt(c)===9?(I=!0,(u[A]+E)%4===3?(c++,E++,F=!1):F=!0):I=!1;let W=E;for(h.push(s[A]),s[A]=c;c=d,m.push(u[A]),u[A]=a[A]+1+(I?1:0),g.push(a[A]),a[A]=W-E,v.push(l[A]),l[A]=c-s[A];continue}if(C)break;let x=!1;for(let E=0,I=y.length;E";const _=[t,0];N.map=_,e.md.block.tokenize(e,t,A);const w=e.push("blockquote_close","blockquote",-1);w.markup=">",e.lineMax=f,e.parentType=b,_[1]=e.line;for(let M=0;M=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} +`,s.map=[t,e.line],!0}function dfe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&VT(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",qT[d],1);h.markup=UT[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",qT[d],-1);return g.markup=UT[d],!0}function hfe(e){switch(e){case 9:case 32:return!0}return!1}function pfe(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${yde.source}\\s*$`),/^$/,!1]];function mfe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var tj=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,v=this.bsCount,y=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};tj.prototype.Token=Ds;function vfe(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:vfe(n,i,o)}const ZT=["","h1","h2"];function yfe(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=nj(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=T)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(A),h===45||h===61)){let _=A+1,w=_;for(;_=T){f=h===61?1:2;break}if(w-A>1)continue}if(a[m]<0||c&&!ij(e,m,o,A,T))continue;let N=!1;for(let _=0,w=i.length;_A;){const N=o.charCodeAt(T-1);if(N!==9&&N!==32)break;T--}g=o.slice(A,T)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const v=h===61?"=":"-",y=e.push("heading_open",ZT[f],1);y.markup=v,y.map=[t,e.line];const b=e.push("inline","",0);b.content=g,b.map=[t,e.line-1],b.children=[];const C=e.push("heading_close",ZT[f],-1);return C.markup=v,e.parentType=d,!0}function oj(e){switch(e){case 9:case 32:return!0}return!1}function GT(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,v=e.eMarks,y=e.sCount,b=e.bsCount,C=m[l]+g[l];if(C>=v[l])return!1;const A=h.charCodeAt(C);if(A>=48&&A<=57){if(f=QT(e,l),f<0||(c=!0,r=C,d=kfe(e,l,f),u&&d!==1))return!1}else if(A===42||A===45||A===43){if(f=GT(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=v[l])return!1;if(i)return!0;const T=h.charCodeAt(f-1),N=String.fromCharCode(T);if(c){const I=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(I.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const _=[l,0];e.tokens[e.tokens.length-1].map=_,e.tokens[e.tokens.length-1].markup=N;let w=!1;const M=e.tokens.length-1,x=e.md.block.ruler.getRulesForState(e,"list"),E=e.parentType;for(e.parentType="list";l=o?P=1:P=F-I,P>4&&(P=1);const O=I+P,R=e.push("list_item_open","li",1);R.markup=N;const z=[l,0];R.map=z,c&&(R.info=f-r-1===1?bfe[h.charCodeAt(r)-48]:h.slice(r,f-1));const H=e.tight,j=e.tShift[l],K=e.sCount[l],re=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=O,e.tight=!0,e.tShift[l]=W-m[l],e.sCount[l]=F,W>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||w)&&(a=!1),w=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=re,e.tShift[l]=j,e.sCount[l]=K,e.tight=H,e.push("list_item_close","li",-1).markup=N,l=e.line,z[1]=l,l>=n||e.sCount[l]=4)break;let q=!1;for(let Q=0,ne=x.length;Q3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const C=r[f]+l[f],A=a[f];if(C=A||YT(s.charCodeAt(C+1)))break}else if(T>=48&&T<=57&&C+1=A){N=-1;break}const _=s.charCodeAt(N++);if(_>=48&&_<=57){if(N-C>=10){N=-1;break}continue}if((_===41||_===46)&&(N>=A||YT(s.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const v=r[f]+l[f],y=a[f];if(d&&!ij(e,f,s,v,y))continue;let b=!1;for(let C=0,A=i.length;C=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const A=e.lineMax;if(C>=A||e.isEmpty(C))return null;let T=!1;if(e.sCount[C]-e.blkIndent>3&&(T=!0),e.sCount[C]<0&&(T=!0),!T){const w=e.parentType;e.parentType="reference";let M=!1;for(let x=0,E=l.length;x"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:y,href:f}),e.line=r),!0):!1}function t8(e){switch(e){case 9:case 32:return!0}return!1}const Sfe=65536;function n8(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function _fe(e,t){if(e.lineFlags)return(e.lineFlags[t]&Qg.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!t8(l)||r===45&&t8(l)||!_fe(e,t))return!1;for(;s=4)return!1;u=JT(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let A=0;A=4||(u=JT(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),C+=d-u.length,C>Sfe))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=b=[t+2,0]}const T=e.push("tr_open","tr",1);T.map=[o,o+1];for(let N=0;Nr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return g1(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const W2=[["table",Mfe,["paragraph","reference"]],["code",cfe],["fence",dfe,["paragraph","reference","blockquote","list"]],["blockquote",ufe,["paragraph","reference","blockquote","list"]],["hr",pfe,["paragraph","reference","blockquote","list"]],["list",Cfe,["paragraph","reference","blockquote"]],["reference",xfe],["html_block",mfe,["paragraph","reference","blockquote"]],["heading",ffe,["paragraph","reference","blockquote"]],["lheading",yfe],["paragraph",Afe]];var Tfe=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Ife;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new tj(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},sj=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};sj.prototype.Token=Ds;const XT=[["normalize",Kde],["block",ede],["inline",$de],["linkify",qde],["replacements",efe],["smartquotes",ofe],["text_join",sfe]],Efe={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Lfe={parseLinkLabel:f7,parseLinkDestination:d7,parseLinkTitle:h7};function Nfe(){return{...Efe}}function Dfe(){return{...Lfe}}var Ffe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Tfe,this.inline=new Ode,this.ruler=new tfe;for(let e=0;e@[\]\\^_`{}~]/;function sk(e){return!Bfe.test(e)}function wg(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function Uy(e,t,n){for(let i=t;i3)return sk(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!sk(c))return!1;const d=Ofe[s],f=$fe[s],h=ga("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(v7(c,o,1));const m=ga("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function zfe(e,t,n){const i=ga("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(v7(t,n,1)),e.push(ga("paragraph_close","p",-1,0))}function jfe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function r8(e,t){for(;t=1e5?tE:s8,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,nE=/[&<>"]/g,Zfe=/&/g,Gfe=/[<>"]/g,Qfe={"&":"&","<":"<",">":">",'"':"""};function l8(e){return Qfe[e]||e}function qi(e){if(e.length===0)return"";if(e.length<32)return Kfe.test(e)?e.replace(nE,l8):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(Zfe,"&"):t?e.replace(nE,l8):e.replace(Gfe,l8)}const Yfe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Jfe=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function rj(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Yfe,(t,n,i)=>{if(n)return n;if(Jfe.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return qb(s)?H0(s):"�"}const o=n7(t);return o!==t?o:t})}const Xfe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,ehe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,the=/"/g;function Gp(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function rk(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!rk(e,t,Gp(e,t))}function iE(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=y7(e.slice(s,r));return a===null?null:`${a} +`}function oE(e,t,n){return t+1" +`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
    3. ${e[t]}
    4. +`}function rhe(e,t,n){const i=t+2;if(n===i+1)return she(e,i);const o=y7(e.slice(t+2,n));return o===null?null:`
    5. ${o}
    6. +`}function lhe(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
      ",i.lang=s,i.open=d),{html:`${d}${qi(c)}
      +`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n +`;A +`,l=y,a=b}let C=q2(e,v);for(;C${v}

      +`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=Vy(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=hhe(r,o.maxChunks)),Ky(t,r))return J3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),m1(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return J3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),m1(n,s,()=>{for(let u=0;u=3&&(c?c.marker===C&&T>=c.length&&(c=null):c={marker:C,length:T})}}const v=m-f;o+=v,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=v);const y=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(y)d(m);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),C=Math.max(t.maxChunkChars,8e3);(a>=b||u>=C)&&d(m)}f=m}return n&&d(e.length),i}function Ky(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function fhe(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Uc(e){return e.length===0?0:zo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function bhe(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function Che(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return bhe(e,n+1,e.length-1)?!whe(e,t):!1}function Ahe(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??vhe:e.options.fullChunkSizeChars??mhe),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??yhe:e.options.fullChunkSizeLines??ghe);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var Nv=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Uc(this.pending);if(this.pending.length=i||n>=o}function fj(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??aj))return"yes";const i=e.options.autoUnboundedThresholdLines??uj;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new Nv(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){cj(s,l)}});if(o&&u7(n,o),r.feed(t),r.flushForce(n),o&&(c7(n),i.fallbackOnGlobalState===!1)){const l=oc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const v1=(e,t,n)=>en?n:e;function hj(e){return e.experimental?{...e,...e.experimental}:e}const lE=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],aE=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function pj(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Ihe(e,t=Math.max(0,e/40|0),n={}){const i=hj(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:v1(Math.ceil(e/s),8e3,64e3),maxChunkLines:v1(Math.ceil(t/s),150,700),maxChunks:v1(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function uE(e,t=Math.max(0,e/40|0),n={}){const i=hj(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:v1(Math.ceil(e/s),8e3,64e3),maxChunkLines:v1(Math.ceil(t/s),150,700),maxChunks:v1(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var The={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},Ehe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Lhe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Vb(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Zy(e,t){if(Vb(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const cE=e=>Vb(e)?e:Promise.resolve(e);function Jg(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return qi(e)}}function zd(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Jg(t[0])}="${qi(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} +`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
      ${t}
      +`}return`
      ${t}
      +`}function q0(e){return!e.attrs||e.attrs.length===0?`${qi(e.content)}`:`${qi(e.content)}`}function wC(e){const t=qi(e.content);return e.attrs?`${t} +`:`
      ${t}
      +`}function Nhe(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

      `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function dE(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function Dhe(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function fE(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function ak(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const Fhe={langPrefix:"language-",xhtmlOut:!1,breaks:!1},U2=Object.prototype.hasOwnProperty,_i={code_inline(e,t){return q0(e[t])},code_block(e,t){return wC(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?rj(s.info).trim():"",{langName:l,langAttrs:a}=mj(r),u=n.highlight,c=qi(s.content);if(!u)return Xg(s,c,r,l,n);const d=u(s.content,l,a);return Vb(d)?d.then(f=>Xg(s,f||c,r,l,n)):Xg(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],ak(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
      +`:`
      +`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
      +`:`
      +`:` +`},text(e,t){return qi(e[t].content)},text_special(e,t){return qi(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function hE(e,t,n){const i=e.info?rj(e.info).trim():"",{langName:o,langAttrs:s}=mj(i),r=t.highlight,l=qi(e.content);if(!r)return Xg(e,l,i,o,t);const a=r(e.content,o,s);if(Vb(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Xg(e,a||l,i,o,t)}function a8(e,t,n,i){switch(e.type){case"text":return t.text===_i.text?e.content.length===0?"":qi(e.content):null;case"text_special":return t.text_special===_i.text_special?e.content.length===0?"":qi(e.content):null;case"softbreak":return t.softbreak===_i.softbreak?i:null;case"hardbreak":return t.hardbreak===_i.hardbreak?n:null;case"html_inline":return t.html_inline===_i.html_inline?e.content:null;case"code_inline":return t.code_inline===_i.code_inline?q0(e):null;default:return null}}function Bhe(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===_i.text)return s.content.length===0?"":qi(s.content);break;case"text_special":if(o.text_special===_i.text_special)return s.content.length===0?"":qi(s.content);break;case"softbreak":if(o.softbreak===_i.softbreak)return t.breaks?t.xhtmlOut?`
      +`:`
      +`:` +`;break;case"hardbreak":if(o.hardbreak===_i.hardbreak)return t.xhtmlOut?`
      +`:`
      +`;break;case"html_inline":if(o.html_inline===_i.html_inline)return s.content;break;case"code_inline":if(o.code_inline===_i.code_inline)return q0(s);break}const r=o[s.type];if(!r)return ak(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:Zy(l,s.type)}var Rhe=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={..._i}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,v="";for(let y=0;y0&&e[y-1].hidden?` +`:"";if(C==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&y+3${this.renderInlineTokens(w.children||[],i,o)}`,y+=3;continue}}if(y+2 +`,y+=2;continue}}}if(C==="inline"){const _=b.children||[];if(_.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
      +`:`
      +`,m=i.breaks?h:` +`,g=!0);const w=_[0];switch(w.type){case"text":if(l===_i.text){v+=qi(w.content);continue}break;case"text_special":if(a===_i.text_special){v+=qi(w.content);continue}break;case"softbreak":if(u===_i.softbreak){v+=m;continue}break;case"hardbreak":if(c===_i.hardbreak){v+=h;continue}break;case"html_inline":if(d===_i.html_inline){v+=w.content;continue}break;case"code_inline":if(f===_i.code_inline){v+=q0(w);continue}break}}v+=this.renderInlineTokens(_,i,o);continue}const T=s[C];if(!T){const _=b.attrs;if(!b.hidden){if(!_||_.length===0)switch(C){case"hr":v+=r?`


      +`:`
      +`;continue;case"heading_open":v+=`<${b.tag}>`;continue;case"heading_close":v+=` +`;continue;case"paragraph_open":v+=`${A}

      `;continue;case"paragraph_close":v+=`

      +`;continue;case"list_item_open":{const w=e[y+1];v+=A+(w&&(w.type==="inline"||w.hidden||w.nesting===-1&&w.tag==="li")?"
    7. ":`
    8. +`);continue}case"list_item_close":v+=`
    9. +`;continue;case"bullet_list_open":v+=`${A}
        +`;continue;case"bullet_list_close":v+=`
      +`;continue;case"blockquote_open":v+=A+(e[y+1]&&e[y+1].nesting===-1&&e[y+1].tag==="blockquote"?"
      ":`
      +`);continue;case"blockquote_close":v+=`
      +`;continue;case"ordered_list_open":v+=`${A}
        +`;continue;case"ordered_list_close":v+=`
      +`;continue;case"table_open":v+=`${A} +`;continue;case"table_close":v+=`
      +`;continue;case"thead_open":v+=`${A} +`;continue;case"thead_close":v+=` +`;continue;case"tbody_open":v+=`${A} +`;continue;case"tbody_close":v+=` +`;continue;case"tr_open":v+=`${A} +`;continue;case"tr_close":v+=` +`;continue;case"td_open":v+=`${A}`;continue;case"td_close":v+=` +`;continue;case"th_open":v+=`${A}`;continue;case"th_close":v+=` +`;continue}else if(_.length===1){const w=_[0];if(C==="ordered_list_open"&&w[0]==="start"){v+=`${A}
        +`;continue}if(C==="td_open"&&w[0]==="style"){v+=`${A}`;continue}if(C==="th_open"&&w[0]==="style"){v+=`${A}`;continue}}}v+=this.renderToken(e,y,i);continue}if(C==="code_block"&&T===_i.code_block){v+=wC(b);continue}if(C==="fence"&&T===_i.fence){v+=hE(b,i);continue}if(C==="html_block"&&T===_i.html_block){v+=b.content;continue}const N=T(e,y,i,o,this);typeof N=="string"?v+=N:v+=Zy(N,b.type)}return v}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` +`:"",c=a?`> +`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(U2.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),U2.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(U2.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(U2.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...Fhe,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===_i.code_block)return wC(t);if(s==="html_block"&&o.html_block===_i.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):ak(t,r.xhtmlOut===!0);if(s==="fence"&&a===_i.fence)return hE(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:Zy(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return Bhe(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
        +`:`
        +`,r=t.breaks?s:` +`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,v=i.em_close,y=i.strong_open,b=i.strong_close;let C="";for(let A=0;A`;if(u===_i.softbreak&&A+3`,A+=1;continue}if(T.type==="em_open"&&!g&&!v&&A+2${M}`,A+=2;continue}}}if(T.type==="strong_open"&&!y&&!b&&A+2${M}`,A+=2;continue}}}switch(T.type){case"text":if(l===_i.text){const w=T.content.length===0?"":qi(T.content);if(d===_i.html_inline&&A+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=Ae,!Y&&me!==void 0&&(de=zo(e),Y=de>=me)),Y){const Z=this.parseFullDocument(e,F,n,de,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",fs(F,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!oc(F)?.unbounded}),Z.tokens}else if(z){const Z=(fe,ve,Ce)=>feCe?Ce:fe;de===void 0&&(de=zo(e));const se=ne&&!Q?uE(e.length,de,n.options):null,ke=se?.maxChunkChars??(H?Z(Math.ceil(e.length/j),8e3,64e3):K??1e4),be=se?.maxChunkLines??(H?Z(Math.ceil(de/j),150,700):re??200),we=se?.maxChunks??(H?Z(Math.ceil(e.length/64e3),j,32):q),oe=e.length>0&&e.charCodeAt(e.length-1)===10,J=R&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&se?.strategy!=="plain";if((O||J)&&(e.length>=ke*2||de>=be*2)&&oe){const fe=lk(n,e,F,{maxChunkChars:ke,maxChunkLines:be,fenceAware:se?.fenceAware??te,maxChunks:we});return this.cache={src:e,tokens:fe,env:F,lineCount:de,lastSegment:void 0,globalStateReason:ll(e)},this.updateCacheLineCount(this.cache,de),this.recordChunkedParseResult(F,O?"explicit-initial-large-doc":"default-initial-large-doc"),fe}}const ue=this.parseFullDocument(e,F,n,de);return de=ue.lineCount,this.cache={src:e,tokens:ue.tokens,env:F,lineCount:de,lastSegment:void 0,globalStateReason:ll(e)},this.updateCacheLineCount(this.cache,de),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",fs(F,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!oc(F)?.unbounded}),ue.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",fs(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=ll(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):ll(e),a=r||l;if(a){const F=i??o.env;Ic(F);const W=ll(e),P=this.parseFullDocument(e,F,n),O=P.tokens,R=P.lineCount;return this.cache={src:e,tokens:O,env:F,lineCount:R,lastSegment:void 0,globalStateReason:W},this.updateCacheLineCount(this.cache,R),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",fs(F,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!oc(F)?.unbounded}),O}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?W=8:c.length>1e3?W=6:c.length>200&&(W=4),W=Math.min(W,F);let P=null;const O=n.options?.streamContextParseStrategy??"chars",R=n.options?.streamContextParseMinChars??200,z=n.options?.streamContextParseMinLines??2;let H;const j=()=>(H===void 0&&(H=zo(c)),H),K=this.canDirectlyParseAppend(o),re=K&&this.shouldUseUnboundedAppend(e,o,c);let q=!1;if(!K)switch(O){case"lines":q=j()>=z;break;case"constructs":if(c.length>=R){q=!0;break}if(Phe(c)){q=!0;break}q=j()>=z;break;case"chars":default:q=c.length>=R}if(W>0&&q){const te=this.getTailLines(o.src,W)+c;try{const ge=this.core.parse(te,o.env,n).tokens,Ae=ge.findIndex(me=>me.map&&typeof me.map[1]=="number"&&me.map[1]>W);if(Ae!==-1){const me=ge.slice(Ae),de=F-W;de!==0&&this.shiftTokenLines(me,de),P={tokens:me}}}catch{P=null}}else P=null;if(!P){const te=F;if(re)P={tokens:Yg(n,c,o.env,{mode:"stream"})},te>0&&this.shiftTokenLines(P.tokens,te);else{const ge=this.core.parse(c,o.env,n);te>0&&this.shiftTokenLines(ge.tokens,te),P=ge}}let Q=0;if(o.tokens.length>0&&P.tokens.length>0){const te=o.tokens[o.tokens.length-1],ge=P.tokens[0];try{te.type==="inline"&&ge.type==="inline"&&(ge.children&&ge.children.length>0&&(te.children||(te.children=[]),this.appendTokens(te.children,ge.children)),te.content=(te.content||"")+(ge.content||""),Q=1)}catch{Q=0}}const ne=o.tokens.length;if(P.tokens.length>Q){const te=o.tokens,ge=P.tokens,Ae=Math.min(te.length,ge.length-Q);let me=0;for(let de=Ae;de>0;de--){let Y=!0;for(let ue=0;ue0&&(Q+=me),ge.length>Q&&this.appendTokens(o.tokens,ge,Q)}if(o.src=e,o.globalStateReason=null,o.lineCount=F+(H??j()),o.tokens.length>ne){const te=this.getLastSegment(o.tokens,e,ne,o.tokens.length,e.length-c.length,F);te?o.lastSegment=te:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,re&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",fs(o.env,{area:"stream",path:re?"stream-unbounded-append":"stream-append",reason:re?"large-delta":"safe-append",unbounded:re}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",fs(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,v=!h&&!c&&m,y=g||v,b=n.options?.streamChunkAdaptive!==!1,C=n.options?.streamChunkTargetChunks??8,A=n.options?.streamChunkSizeChars,T=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,_=!!n.__explicitStreamChunkConfig,w=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let x=c&&o.lineCount!==void 0?o.lineCount+zo(c):void 0;if(y){x===void 0&&(x=zo(e));const F=(j,K,re)=>jre?re:j,W=w&&!_?uE(e.length,x,n.options):null,P=W?.maxChunkChars??(b?F(Math.ceil(e.length/C),8e3,64e3):A??1e4),O=W?.maxChunkLines??(b?F(Math.ceil(x/C),150,700):T??200),R=W?.maxChunks??(b?F(Math.ceil(e.length/64e3),C,32):N),z=e.length>0&&e.charCodeAt(e.length-1)===10,H=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&W?.strategy!=="plain";if((g||H)&&(e.length>=P*2||x>=O*2)&&z){const j=lk(n,e,d,{maxChunkChars:P,maxChunkLines:O,fenceAware:W?.fenceAware??M,maxChunks:R});return this.cache={src:e,tokens:j,env:d,lineCount:x,lastSegment:void 0,globalStateReason:ll(e)},this.updateCacheLineCount(this.cache,x),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),j}}const E=this.parseFullDocument(e,d,n,x),I=E.tokens;return x=E.lineCount,this.cache={src:e,tokens:I,env:d,lineCount:x,lastSegment:void 0,globalStateReason:ll(e)},this.updateCacheLineCount(this.cache,x),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",fs(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!oc(d)?.unbounded}),I}recordChunkedParseResult(e,t){const n=oc(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",fs(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!oc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",fs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=ll(e);Ev(t)&&Ic(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?fj(n,e.length,i):"no";if(r==="yes"){const a=Yg(n,e,t);return fs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?zo(e):0)}}let l=i;if(r==="need-lines"&&(l=zo(e),dj(n,e.length,l))){const a=Yg(n,e,t);return fs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?zo(e):0),{tokens:m1(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:zo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` +`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` +`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+zo(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` +`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??$he}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;ou8?n.slice(n.length-u8):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` +`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` +`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+zo(s);t.lineCount=g;const v=this.getDocLineCount(e,g);return r.map&&(r.map[1]=v),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const v=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,y=t.lineCount??zo(t.src);t.tokens.splice(v,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const b=y+zo(s);t.lineCount=b;const C=this.getDocLineCount(e,b);if(r.map&&(r.map[1]=C),h.tbodyOpenIndex>=0){const A=t.tokens[h.tbodyOpenIndex];A?.map&&(A.map[1]=C)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:C,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` +`);if(t<0)return null;const n=e.indexOf(` +`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=zo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const mE={default:Ehe,zero:Lhe,commonmark:The};function Whe(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function qhe(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function gE(e){return e.experimental?{...e,...e.experimental}:e}function aa(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function vE(e,t,n){for(let i=0;i=4?n.quotes=[w[0],w[1],w[2],w[3]]:n.quotes=["“","”","‘","’"]}let r=vE(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=vE(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=yE(s?.options,o,"fullChunkedFallback"),u=yE(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Ffe;let m=null;const g=()=>(m||(m=new Ohe(n)),m);let v=null;const y=()=>(v||(v=new Hhe(h)),v);let b=null;const C=()=>(b||(b=new Cz({fuzzyLink:!0})),b),A=w=>!c&&!!d&&!qhe(w,d),T=(w,M)=>i==="default"&&!c&&m===null&&f!==null&&w.parse===f&&A(w)&&!w.stream.enabled&&M<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.xhtmlOut===!1&&w.options.breaks===!1&&w.options.langPrefix==="language-"&&w.options.linkify===!1&&w.options.typographer===!1&&w.options.highlight===null,N=(w,M)=>i==="default"&&!c&&A(w)&&!w.stream.enabled&&!w.options.fullChunkedFallback&&M<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.linkify===!1&&w.options.typographer===!1,_={core:h,block:h.block,inline:h.inline,get linkify(){const w=C();return Object.defineProperty(this,"linkify",{value:w,writable:!0,configurable:!0}),w},get renderer(){const w=g();return Object.defineProperty(this,"renderer",{value:w,writable:!0,configurable:!0}),w},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return A(this)},set(w){const M=gE(w);return this.options={...this.options,...M},(aa(w,"fullChunkSizeChars")||aa(w,"fullChunkSizeLines")||aa(w,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(aa(w,"streamChunkSizeChars")||aa(w,"streamChunkSizeLines")||aa(w,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),aa(w,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),aa(w,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,v&&(v.reset(),v.resetStats())),this},configure(w){const M=typeof w=="string"?mE[w]:w;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const x=M.components;x.core?.rules&&this.core.ruler.enableOnly(x.core.rules),x.block?.rules&&this.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&this.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&this.inline.ruler2.enableOnly(x.inline2.rules)}return this},enable(w,M){const x=Array.isArray(w)?w:[w],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const F of E){if(!F)continue;const W=F.enable(x,!0);for(let P=0;P!I.has(W));if(F.length)throw new Error(`Rules manager: invalid rule name ${F.join(", ")}`)}return this},disable(w,M){const x=Array.isArray(w)?w:[w],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const F of E){if(!F)continue;const W=F.disable(x,!0);for(let P=0;P!I.has(W));if(F.length)throw new Error(`Rules manager: invalid rule name ${F.join(", ")}`)}return this},use(w,...M){const x=typeof w=="function"?w:w&&typeof w.default=="function"?w.default:void 0;if(!x)throw new TypeError("MarkdownIt.use: plugin must be a function");const E=[this,...M],I=w;return c=!0,x.apply(I,E),this},render(w,M){let x;if(T(this,w.length)){M!==void 0&&(Pr(M),x=Y3("render"));const F=x?Cp():0,W=x?rE(w,x):sE(w);if(x&&(x.attemptMs=Cp()-F,W===null&&(x.fallbackReason="unsupported-stock-subset"),Jm(M,x)),W!==null)return M!==void 0&&fs(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),W}const E=M??{},I=this.parse(w,E);return x&&Jm(E,x),g().render(I,this.options,E)},async renderAsync(w,M){let x;if(T(this,w.length)){M!==void 0&&(Pr(M),x=Y3("render"));const F=x?Cp():0,W=x?rE(w,x):sE(w);if(x&&(x.attemptMs=Cp()-F,W===null&&(x.fallbackReason="unsupported-stock-subset"),Jm(M,x)),W!==null)return M!==void 0&&fs(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),W}const E=M??{},I=this.parse(w,E);return x&&Jm(E,x),g().renderAsync(I,this.options,E)},renderIterable(w,M={}){const x=this.parseIterable(w,M);return g().render(x,this.options,M)},async renderAsyncIterable(w,M={}){const x=await this.parseAsyncIterable(w,M);return g().renderAsync(x,this.options,M)},renderInline(w,M={}){const x=this.parseInline(w,M);return g().render(x,this.options,M)},validateLink:Jz,normalizeLink:Xz,normalizeLinkText:ej,utils:cce,helpers:{...Jce},parse(w,M){if(typeof w!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&Pr(M),N(this,w.length)){const F=M===void 0?void 0:Y3("parse"),W=F?Cp():0,P=Vfe(w,F);if(F&&(F.attemptMs=Cp()-W,P===null&&(F.fallbackReason="unsupported-stock-subset"),Jm(M,F)),P!==null)return M!==void 0&&fs(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),P}const x=M??{};let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&A(this)){const F=fj(this,w.length);if(F==="yes"){const W=Yg(this,w,x);return fs(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),W}F==="need-lines"&&(E=zo(w))}if(!this.stream.enabled){const F=w.length,W=this.options.autoTuneChunks!==!1,P=r,O=!a&&A(this),R=!!this.options.fullChunkedFallback,z=O&&F>=2e5;let H;(R||z||E!==void 0)&&(H=E??zo(w));const j=(R||z)&&W&&!P?Ihe(F,H,this.options):null;if(R||z){const K=H??0;if(R?F>=(this.options.fullChunkThresholdChars??2e4)||K>=(this.options.fullChunkThresholdLines??400):z){if(j&&j.strategy!=="plain"){const re=lk(this,w,x,{maxChunkChars:j.maxChunkChars,maxChunkLines:j.maxChunkLines,fenceAware:j.fenceAware,maxChunks:j.maxChunks});return M&&kE(M,R?"explicit-full-chunk":"default-large-string"),re}if(R){const re=(Y,ue,Z)=>YZ?Z:Y,q=this.options.fullChunkAdaptive!==!1,Q=this.options.fullChunkTargetChunks??8,ne=re(Math.ceil(F/Q),8e3,64e3),te=re(Math.ceil(K/Q),150,700),ge=q?ne:this.options.fullChunkSizeChars??1e4,Ae=q?te:this.options.fullChunkSizeLines??200,me=q?re(Math.ceil(F/64e3),Q,32):this.options.fullChunkMaxChunks,de=lk(this,w,x,{maxChunkChars:ge,maxChunkLines:Ae,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:me});return M&&kE(M,"explicit-full-chunk"),de}}}if(E!==void 0&&A(this)&&dj(this,F,H??E)){const K=Yg(this,w,x);return fs(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const I=ll(w);return fs(M,{area:"parse",path:"plain",reason:"default-plain"}),m1(x,I,()=>h.parse(w,x,this).tokens)},parseIterable(w,M={}){return Pr(M),xhe(this,w,M)},parseAsyncIterable(w,M={}){return Pr(M),She(this,w,M)},parseIterableToSink(w,M,x={}){return Pr(x),_he(this,w,M,x)},parseAsyncIterableToSink(w,M,x={}){return Pr(x),Mhe(this,w,M,x)},parseInline(w,M={}){if(typeof w!="string")throw new TypeError("Input data should be a String");Pr(M),Ev(M)&&Ic(M);const x=h.createState(w,M,this);return x.inlineMode=!0,h.process(x),x.tokens}};if(_.stream={enabled:!!n.stream,parse(w,M){return _.stream.enabled?y().parse(w,M,_):_.parse(w,M??{})},reset(){y().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},s?.components){const w=s.components;w.core?.rules&&_.core.ruler.enableOnly(w.core.rules),w.block?.rules&&_.block.ruler.enableOnly(w.block.rules),w.inline?.rules&&_.inline.ruler.enableOnly(w.inline.rules),w.inline2?.rules&&_.inline.ruler2.enableOnly(w.inline2.rules)}return d=Whe(_),f=_.parse,_}var Vhe=Uhe;const vj=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Khe=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],yj=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],Zhe=["svg","g","path"],Ghe=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],Qhe=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],Yhe=["action","data","href","src","srcset","poster","xlink:href","formaction"],Jhe=["script"],Xhe=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],jd=new Set(vj),kj=new Set(yj),U0=new Set([...vj,...Khe,...yj,...Zhe]),bj=new Set([...U0,...Ghe]),epe=new Set(Qhe),tpe=new Set(Yhe),Dv=new Set(Jhe),wj=new Set(Xhe);function Cj(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const npe={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function Aj(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return npe[String(o??"").toLowerCase()]??t})}const V2=new Set(["http","https","mailto","tel"]),ipe=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Ef=new Set(["http","https"]);function xj(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const ope=/^https?:\/\//i;function spe(e){if(!ope.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function rpe(e,t,n){if(!e0(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function e0(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function lpe(e,t){return t==="href"||t==="xlink:href"?e0(e,t)?V2:Ef:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Ef:(e0(e,t),V2)}function yh(e,t={}){if(spe(e))return!1;const n=Cj(Aj(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=xj(n);return s?s==="file"?!rpe(n,i,o):e0(i,o)?ipe.has(s):!lpe(i,o).has(s):!1}function ape(e){const t=Aj(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=xj(Cj(t).toLowerCase());return n==="http"||n==="https"}function upe(e,t={}){const n=String(e??"").trim();return n?yh(n,t)?"":n:""}function bE(e){return upe(e,{tagName:"img",attrName:"src"})}function cpe(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,v){return f[h].nesting===1&&f[h].attrJoin("class",t),v.renderToken(f,h,m,g,v)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let v,y=!1,b=f.bMarks[h]+f.tShift[h],C=f.eMarks[h];if(l!==f.src.charCodeAt(b))return!1;for(v=b+1;v<=C&&r[(v-b)%a]===f.src[v];v++);const A=Math.floor((v-b)/a);if(A=m||(b=f.bMarks[_]+f.tShift[_],C=f.eMarks[_],b=4)){for(v=b+1;v<=C&&r[(v-b)%a]===f.src[v];v++);if(!(Math.floor((v-b)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&Sj(o.children,t,n)}}function fpe(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(cpe,t,{render(n,i){return n[i].nesting===1?`
        `:`
        +`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let N=0,_=-1;for(let w=0;w0&&(h=g.slice(0,_))}h||(f=d||void 0)}if(o)return!0;const v=!!s.env.__markstreamFinal;let y=n+1,b=!1;for(;y<=i;){const N=s.bMarks[y]+s.tShift[y],_=s.eMarks[y];if(s.src.slice(N,_).trim()===":::"){b=!0;break}y++}b||(y=i);const C=s.push("vmr_container_open","div",1);if(C.attrSet("class",`vmr-container vmr-container-${c}`),C.map=[n,b?y:i],C.meta={...C.meta??{},unclosed:!b&&!v},f&&C.attrSet("data-args",f),h)try{const N=JSON.parse(h);for(const[_,w]of Object.entries(N)){const M=w!=null&&typeof w=="object";C.attrSet(`data-${_}`,M?JSON.stringify(w):String(w))}}catch{const N=dpe(h);if(N)for(const[_,w]of Object.entries(N)){const M=w!=null&&typeof w=="object";C.attrSet(`data-${_}`,M?JSON.stringify(w):String(w))}else C.attrSet("data-attrs",h)}const A=[];for(let N=n+1;NN.trim().length>0)){let N=A.join(` +`);N.endsWith(` +`)||(N+=` +`),N.endsWith(` + +`)||(N+=` +`);const _=s.tokens[s.tokens.length-1];_&&(_.raw=N);const w=[];s.md.block.parse(N,s.md,s.env,w),Sj(w,n+1,n+1+A.length),s.tokens.push(...w)}const T=s.push("vmr_container_close","div",-1);return b||(T.hidden=!0,T.map=[i,i]),s.line=b?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ga(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qo(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function Kb(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const hpe=/^[a-z][a-z0-9_-]*$/;function wE(e){return hpe.test(String(e??"").trim().toLowerCase())}function Ca(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return wE(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":wE(o)?o:""}function Yh(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=Ca(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function ppe(...e){const t=new Set,n=[];for(const i of e)for(const o of Yh(i))t.has(o)||(t.add(o),n.push(o));return n}function mpe(e){const t=Yh(e);return{key:t.join(","),tags:t}}function _j(e){return Ca(e)}function gpe(e,t){const n=String(e??""),i=Ca(t);if(!i)return!1;const o=Ga(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Mj(e,t){const n=Ca(t);return!!n&&!U0.has(n)&&!gpe(e,n)}function vpe(e,t){const n=String(e??""),i=Ca(t);if(!i)return n;const o=Ga(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const Ij=jd,ype=U0,Tj=new Set(kj);Tj.delete("details");const kpe=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,bpe=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,CC=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,wpe=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function uk(e){return(e.match(CC)?.[1]??"").toLowerCase()}function k7(e){return/^\s*<\s*\//.test(e)}function b7(e,t){return Ij.has(t)||/\/\s*>\s*$/.test(e)}function Cpe(e,t){let n=0;for(let i=0;i0&&n--;continue}b7(o,s)||n++}}return n}function CE(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Ga(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function xpe(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ga(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function ck(e){const t=e;return String(t.raw??t.content??t.markup??"")}function Spe(e){const t=e;return t.meta||(t.meta={}),t.meta}function c8(e,t,n){const i=Spe(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function _pe(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ga(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` +`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Ga(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const v=g??(h.type==="html_inline"?uk(m):"");if(!(v&&t.has(v))){r(m);return}const y=k7(m),b=!y&&b7(m,v);if(y){if(!i.length||i[i.length-1].tag!==v){r(m);return}u(m);return}if(r(m),b){c8(h,m,"");return}i.push({tag:v,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,v=!0;for(const y of h.children){const b=ck(y),C=y.type==="html_inline"?uk(b):"",A=C&&t.has(C);let T=b;if(v&&m&&b&&(i.length||A)){const N=m.indexOf(b,g);if(N!==-1)a(m.slice(g,N)),T=m.slice(N,N+b.length),g=N+b.length;else{if(i.length&&!A)continue;v=!1}}f(y,T,C)}v&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=ck(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` +`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)c8(h.token,h.raw,h.inner)}function Mpe(e){return/^\s*<\s*[!?]/.test(e)}function Ipe(e){const t=new Set(ype);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function AE(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Tpe(e,t){let n=null;for(const s of e.matchAll(kpe)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();AE(l,t)&&qo(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const C of g){const A=Ca(String(C??""));A&&m.add(A)}const v=Ipe(Array.from(m)),y=new Set(Npe);for(const C of m)y.add(C);return{autoCloseInlineTagSet:y,commonHtmlTags:v,customTagSet:m,shouldMergeHtmlBlockTag:C=>m.has(C)||!v.has(C)||Tj.has(C)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const v={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},v,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[v]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const v of h){const y=v;if(y.type!=="inline"||!Array.isArray(y.children))continue;const b=String(y.content??""),C=y.children.length?y.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(C)try{const A=Lpe(C,m);if(y.children=A.children,A.pendingBuffer){const T=b.lastIndexOf(A.pendingBuffer);if(T!==-1){const N=b.slice(0,T);y.content=N,typeof y.raw=="string"&&(y.raw=N)}}}catch(A){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",A)}}_pe(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:v}=i(f),y=[];for(let b=0;b0){const[T,N]=y[y.length-1];if(b!==N){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(b,1),b--;continue}const _=String(C.content??C.raw??"");if(_){const w=h[N],M=`${String(w.content||"")} +${_}`,x=qo(M),E=x===-1?null:CE(M,T,x+1);if(E){const I=M.slice(0,E.end),F=M.slice(E.end);w.content=I,w.loading=!1,h.splice(b,1),y.pop();const W=d(w,F)?[]:u(F,c(h,b,"paragraph"));W.length&&h.splice(b,0,...W),b--;continue}w.content=M,w.loading!==!1&&(w.loading=!0)}h.splice(b,1),b--;continue}}const A=o(C);if(A){if(Mpe(A))continue;const T=(A.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(A);if(!T||!v(T))continue;if(s(C,A),!N)T&&!new RegExp(`^\\s*<\\s*${T}\\b[^>]*\\/\\s*>`,"i").test(A)&&xpe(A,T)>0&&y.push([T,b]);else if(y.length>0&&T&&y[y.length-1][0]===T){const[,_]=y[y.length-1],w=h[_];w.content=`${String(w.content||"")} +${A}`,w.loading=!1,y.pop(),h.splice(b,1),b--}continue}else if(y.length>0){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(b,1),b--;continue}const T=C.content||"",N=new RegExp(`<\\s*\\/\\s*${y[y.length-1][0]}\\s*>`,"i").test(T);if(T){const[,_]=y[y.length-1],w=h[_];w.content=`${w.content||""} +${T}`,w.loading!==!1&&(w.loading=!N)}N&&y.pop(),h.splice(b,1),b--}else continue}if(g.size>0){const b=new Map,C=new Map,A=_=>{let w=b.get(_);return w||(w=new RegExp(`<\\s*${_}\\b`,"i"),b.set(_,w)),w},T=_=>{let w=C.get(_);return w||(w=new RegExp(`<\\s*\\/\\s*${_}\\s*>`,"i"),C.set(_,w)),w},N=[];for(let _=0;_0){const E=N[N.length-1],I=h[E.index],F=w.type==="html_block"?T(E.tag).exec(M):null;if(F){const O=F.index+F[0].length,R=M.slice(0,O),z=M.slice(O);I.content=`${String(I.content??"")} +${R}`,Array.isArray(I.children)&&I.children.push({type:"html_inline",content:``,raw:``}),N.pop();const H=d(I,z)?[]:u(z,c(h,_,"paragraph"));H.length?h.splice(_,1,...H):(h.splice(_,1),_--);continue}if(w.type!=="inline")continue;const W=Array.isArray(w.children)?w.children:[],P=Cpe(W,E.tag);if(P!==-1){const O=W.slice(0,P+1),R=W.slice(P+1),z=O.map(H=>String(H?.content??H?.raw??"")).join("");if(I.content=`${String(I.content??"")} +${z}`,Array.isArray(I.children)&&I.children.push(...O),R.length){const H=R.map(j=>String(j.content??j.raw??"")).join("");if(H.trim()){const j=H.replace(/^\s+/,"");if(d(I,H))h.splice(_,1),_--;else if(j.startsWith("<"))h.splice(_,1,{type:"html_block",content:j});else{const K=u(H,c(h,_,"paragraph"));h.splice(_,1,...K)}}else h.splice(_,1),_--}else h.splice(_,1),_--;N.pop();continue}I.content=`${String(I.content??"")} +${M}`,Array.isArray(I.children)&&I.children.push(...W),h.splice(_,1),_--;continue}if(w.type!=="inline")continue;const x=Array.isArray(w.children)?w.children:[];for(const E of g)if((x.length?Ape(x,E):A(E).test(M)&&!T(E).test(M)?1:0)>0){N.push({tag:E,index:_});break}}}{let b=0;for(let C=0;C0?b--:(h.splice(C,1),C--))}}for(let b=0;b/]+)/)?.[1]??"").toLowerCase();if(w.startsWith("!")||w.startsWith("?")){C.loading=!1;continue}if(g.has(w)){const P=String(C.content??""),O=qo(P),R=O===-1?null:CE(P,w,O+1);C.loading=R?!1:C.loading!==void 0?C.loading:!0;const z=R?.start??-1,H=R?R.end-R.start:0;if(z!==-1){const j=P.slice(0,z+H);let K="";O!==-1&&O]+)))?/g;let x;for(;(x=M.exec(C.content||""))!==null;)x[1],x[2]||x[3]||x[4];const E=String(C.content??""),I=new RegExp(`<\\/\\s*${w}\\s*>`,"i").exec(E),F=I?I.index:-1,W=I?I[0].length:0;if(F!==-1){const P=E.slice(0,F+W),O=(E.slice(F+W)||"").replace(/^\s+/,"");C.children=[{type:"html_block",content:P,tag:w,loading:!1}],C.content=P,C.raw=P,O&&h.splice(b+1,0,O.startsWith("<")?{type:"html_block",content:O}:{type:"text",content:O,raw:O})}else C.children=[{type:"html_block",content:C.content,tag:w,loading:!0}];continue}if(!C||C.type!=="inline")continue;if(C.children.length===2&&C.children[0].type==="html_inline"){const w=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=C.children[1],x=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&x===w)continue;m.has(w)?(C.children[0].loading=!0,C.children[0].tag=w,C.children.push({type:"html_inline",tag:w,loading:!0,content:``})):C.children=[{type:"html_block",loading:!0,tag:w,content:String(C.children[0]?.content??"")+String(C.children[1]?.content??"")}];continue}else if(C.children.length===3&&C.children[0].type==="html_inline"&&C.children[2].type==="html_inline"){const w=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(w))continue;C.children=[{type:"html_block",loading:!1,tag:w,content:C.children.map(M=>M.content).join("")}];continue}if(!C.content?.startsWith("<")||C.children?.length!==1)continue;const A=String(C.content),T=C,N=T.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(A)&&(T.children.length=0);continue}const _=String(N.content??A).match(wpe)?.[1]?.toLowerCase()??"";if(_){if(/\/\s*>\s*$/.test(A)||Ij.has(_)){T.children=[{type:"html_inline",content:A}];continue}T.children.length=0}}})}function Fpe(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function Bpe(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!Fpe(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const Ej=/\.([a-z0-9]{1,15})$/i,Rpe=/[_()[\]{}<>]/u,Ope=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,$pe=/[?#@]/u,Ppe=/[\\/]/u,zpe=/^[\p{L}\p{N}./\\-]+$/u,jpe=/^[A-Za-z0-9-]{1,63}$/u,Hpe=/^xn--[a-z0-9-]{2,59}$/i,Wpe=/^(?:[A-Z]{1,6}|\d{1,8})$/u,qpe=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,Upe=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,Vpe=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,Kpe=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,Zpe=2e3,Gpe=512,Qpe={},Ype=new Set(["ai","md","py","rs","sh","zip"]),Lj=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),Jpe=new Set([...Lj,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),Xpe=new Set(["com","dev","io","page","site"]),e1e=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),t1e=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),ih=new Map;function xE(e,t){if(!e||e.length>Gpe)return t;for(ih.set(e,t);ih.size>Zpe;){const n=ih.keys().next().value;if(!n)break;ih.delete(n)}return t}function V0(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function d8(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return V0(n)?n:void 0}function SE(e,t){if(!V0(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function _E(e){const t=Fv(e);return V0(t)?t:void 0}function n1e(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function ME(e,t){if(!V0(t))return;const n=String(e??"").trim().split(/\s+/u).map(n1e).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>dk(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>dk(o,{marketTicker:!0}))&&(i.marketTicker=!0),V0(i)?i:void 0}function lf(e,t=!1){let n;return{options(i){return t||i==null?SE(e,n):SE(e,d8(_E(i),ME(i,n)))},remember(i){const o=_E(i);n=t?d8(n,o):d8(o,ME(i,n))},reset(){n=void 0}}}function IE(e){return jpe.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function i1e(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return IE(n)||Hpe.test(n)?t.every(IE):!1}function Nj(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function o1e(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function s1e(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function Dj(e,t,n){const i=o1e(t);return Nj(e)&&s1e(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function r1e(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function Fv(e){const t=String(e??""),n=ih.get(t);return n?(ih.delete(t),ih.set(t,n),n):r1e(t)?xE(t,{explicitFilename:Upe.test(t),filename:Vpe.test(t),marketTicker:Kpe.test(t)}):xE(t,Qpe)}function l1e(e){return i1e(e.split(/[\\/]/)[0]??"")}function a1e(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function u1e(e){if(Rpe.test(e)||!zpe.test(e))return!0;if(Ppe.test(e))return!l1e(e);const t=e.replace(Ej,"");return Nj(t)?!0:t.split(".").filter(Boolean).some(a1e)}function c1e(e,t,n){if(!(n?Jpe:Lj).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?qpe:Wpe).test(i)}function dk(e,t={}){if(!e||Ope.test(e)||$pe.test(e))return!1;const n=e.match(Ej);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return c1e(e,i,t.marketTicker===!0)?!0:t1e.has(i)?!Ype.has(i)||t.filename?!0:u1e(e):!!(t.explicitFilename&&Xpe.has(i)||t.filename&&e1e.has(i))}const Fj=new WeakMap,Bj=new WeakSet;function AC(e,t){return Fj.set(e,t),e}function d1e(e){return Fj.get(e)}function f1e(e){Bj.add(e)}function h1e(e){return e===void 0||Bj.has(e)}const TE=["!"];function EE(e){return e==="linkify"||e==="autolink"?e:"recovery"}function ol(e){return{type:"text",content:e,raw:e}}function Lf(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Nf(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Vc(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return AC({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function p1e(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(ol(t))}}function LE(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function g1e(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function NE(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?DE(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=Fv(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=DE(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const v=g.content[h],y=g.content.slice(0,h);let b=g.content.slice(h);for(let T=m+1;T0&&(e.splice(m+1,C),a=m+1);let A=c;if(v==="!"&&f!==-1)A=c.slice(0,f);else if(b){const T=encodeURI(b);if(T&&c.endsWith(T))A=c.slice(0,c.length-T.length);else{const N=v?encodeURI(v):"",_=N?c.indexOf(N):-1;_!==-1&&(A=c.slice(0,_))}}A!==c&&g1e(l,A),b&&e.splice(a+1,0,ol(b));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Vc(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(ol(h)),e.splice(r-4,8,...a)}else a.push(AC({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(y=>y[0]==="href")?.[1]||"",d=u.find(y=>y[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const y=m[1].length;Lf(g,y)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let y=r+1;yv[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Vc(d,f,m)),Nf(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];Lf(d,2),d.push(Vc(u,c,!1)),Nf(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v{const n=t;try{const i=L1e(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function FE(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function BE(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function RE(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function Rj(e,t){if(!e.startsWith("|")||e.includes(` +`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function f8(e){return Rj(e)!==null}function Oj(e){return/^:?-+:?$/.test(e.trim())}function _1e(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(Oj)}function M1e(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function I1e(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(Oj)&&M1e(n)}function T1e(e){return e==="|"||e==="|:"}function E1e(e){const t=Rj(e);return t!==null&&t.every(n=>!n.includes(":"))}function L1e(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` +`)[0]??"",[a="",u="",...c]=r.split(` +`),d=!t&&!r.includes(` +`)&&/\r?\n$/.test(n)&&f8(r);if(!t&&(r.includes(` +`)&&c.length===0&&f8(a)&&I1e(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>RE(m)),h=[...FE(),...f,...BE()];i.splice(o-1,3,...h)}else if(r.includes(` +`)&&c.length===0&&f8(a)&&_1e(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>RE(m)),h=[...FE(),...f,...BE()];i.splice(o-1,3,...h)}else r.includes(` +`)&&c.length===0&&E1e(a)&&T1e(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function N1e(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var D1e=N1e;const F1e=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],fk=F1e.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),B1e=/\\[a-z]+/i,$j="(?:\\\\|\\u0008)",R1e=new RegExp(String.raw`${$j}(?:${fk})\s*\{[^}]+\}`,"i"),O1e=new RegExp(String.raw`(?:${$j})?(?:${fk})\s*\{`,"i"),$1e=/\\(?:text|frac|left|right|times)/,P1e=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,z1e=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,j1e=/[A-Z]+\s*\([^)]+\)/i,H1e=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,W1e=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,q1e=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,U1e={"\b":"\\b","\v":"\\v","\f":"\\f"};function V1e(e){let t="";for(const n of e)t+=U1e[n]??n;return t}function fd(e){if(!e)return!1;const t=V1e(e),n=t.trim();if(q1e.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=B1e.test(t),o=R1e.test(t),s=O1e.test(t),r=$1e.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=P1e.test(t)&&!z1e.test(t),u=j1e.test(t),c=H1e.test(n),d=W1e.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const Pj="__markstreamMathPluginApplied",xC=80,zj=2e4,OE=zj+4096;function w7(e){return!!e[Pj]}function K1e(e){e[Pj]=!0}const jj=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],Z1e=["cdot","mathbf{","partial","mu_{"],Hj=jj.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Wj="[ \r\b\f\v]",G1e=new RegExp(`([^\\\\])(${Z1e.map(e=>e).join("|")})+`,"g"),Q1e=/span\{([^}]+)\}/,Y1e=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,J1e=/(^|[^\\])\\\r?\n/g,X1e=/(^|[^\\])\\$/g,eme=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,tme=new RegExp(`(${Wj})|(${Hj})\\b`,"g"),$E=new Map,PE=new Map;function nme(e){if(!e)return tme;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=$E.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${Wj})|(${o})\\b`,"g");return $E.set(n,s),s}function ime(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=PE.get(i);if(o)return o;const s=e?[fk,Hj].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),fk].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return PE.set(i,r),r}const zE={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function jE(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function ome(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&eme.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function HE(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function Kc(e,t){const n=t?.commands??jj,i=t?.escapeExclamation??!0,o=t?.commands==null,s=nme(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&zE[c]!==void 0)return`\\${zE[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=ome(r));let l=r;const a=ime(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(Q1e,"span\\{$1\\}").replace(Y1e,"\\operatorname{span}\\{$1\\}"),l=l.replace(J1e,`$1\\\\ +`),l=l.replace(X1e,"$1\\\\"),l=l.replace(G1e,"$1\\$2"),l}function WE(e){const t=e.trim();return!(!fd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function qj(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function SC(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=hk(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}Bv(e,a)||s++,r=a+Math.max(1,t.length)}return s}function C7(e,t,n){const i=Z0(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!Z0(i.slice(0,o)).trim()||Bv(i,o))return-1;const s=qj(i);if(hk(s,o))return-1;const r=qE(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>qE(i,n,0,o,s))return-1;return o}function K0(e){return e===" "||e===" "}function Z0(e){let t=e.length;for(;t>0&&K0(e[t-1]);)t--;return e.slice(0,t)}function UE(e){let t=0;for(let n=0;n=48&&t<=57}function rme(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function lme(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function ame(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(lme)}function ume(e){let t=0;if(!VE(e[t]))return!1;for(;VE(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:K0(e[t+1])}function Uj(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&K0(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&K0(t[1])||ume(t)||rme(t)||ame(t))}function KE(e,t){return e?t?`${e} +${t}`:e:t}function _C(e){const t=String(e??"").trim();return t?fd(t):!1}function ZE(e){let t=0;for(let n=0;nxC){h=!0;break}const g=o[m],v=$p(g,c);if(v!==-1){const y=KE(f,g.slice(0,v));if(!_C(y)){h=!0;break}const b=g.slice(v+c.length),C=b.trim()?`suffix:${ZE(b)}`:"nosuffix";return["closed",u,i+l,d,i+m,v,ZE(y),C].join(":")}if(Uj(g)){h=!0;break}if(f=KE(f,g),f.length>zj){h=!0;break}}if(!h&&_C(f))return["pending",u,i+l,d].join(":")}}return null}function p8(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function dme(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function m8(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function fme(e,t){K1e(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(b,C)=>{let A=C;for(;A=3&&(!A||/\s/.test(A))){const T=a.push("text","",0);return T.content=a.src.slice(a.pos,b),a.pos=b,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,v=m;const y=m;for(const[b,C]of f){const A=a.src,T=qj(A),N=sme(A,c);let _=!1;b==="$$"&&g!==y&&(g=y);let w=-1,M=-1,x=0;const E=I=>{if((I==="undefined"||I==null)&&(I=""),I==="\\"){a.pos=a.pos+I.length,g=a.pos;return}if(I==="\\)"||I==="\\("){const P=a.push("text_special","",0);P.content=I==="\\)"?")":"(",P.markup=I,a.pos=a.pos+I.length,g=a.pos;return}if(!I)return;if(b==="$$"&&I.includes("$")){let P=0;for(;P0&&I[O-1]==="$"||O+10){const R=I.slice(0,F),z=a.push("text","",0);z.content=R,a.pos=a.pos+R.length,g=a.pos}const P=I.slice(F).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(P){const[,R,z]=P,H=z.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),j=H?H[1]:z,K=H&&H[2]?H[2]:null,re=a.push("image","img",0);re.attrs=[["src",j],["alt",R]],K&&re.attrs.push(["title",K]),re.content=R,re.children=[{type:"text",content:R,tag:""}],a.pos=a.pos+P[0].length,g=a.pos;const q=I.slice(F+P[0].length);q&&E(q);return}const O=a.push("text","",0);O.content=I,a.pos=a.pos+I.length,g=a.pos;return}const W=a.push("text","",0);W.content=I,a.pos=a.pos+I.length,g=a.pos};for(;!(g>=A.length);){const I=A.indexOf(b,g);if(I===-1)break;if(Bv(A,I)){g=I+Math.max(1,b.length);continue}const F=hk(T,I);if(F){g=F[1];continue}const W=hk(N,I);if(W){g=W[1];continue}if(I===w&&g===M){if(x++,x>2){g=I+Math.max(1,b.length);continue}}else x=0,w=I,M=g;if(b==="("&&I>0){let q=I-1;for(;q>=0&&A[q]===" ";)q--;if(q>=0&&A[q]==="]"){g=I+b.length;continue}}if(b==="$"&&I>0&&A[I-1]==="$"){g=I+1;continue}if(b==="$"&&I=A.length);){const F=SC(A,I);if(F===-1)break;if(F+10&&A[F-1]==="$"){I=F+1;continue}const W=h8(A,F+1);if(W===-1)break;const P=A.slice(F+1,W),O=P.includes("`"),R=!P||!P.trim(),z=A[W+1],H=p8(P,z),j=m8(P);if(!O&&!R&&!H&&!j){const K=A.slice(g,F);K&&E(K);const re=a.push("math_inline","math",0);re.content=Kc(P,t),re.markup="$",re.raw=`$${P}$`,re.loading=!1,g=W+1,I=W+1}else E("$"),I=F+1}I{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),v=!1,y="",b="",C=!1,A="",T=!1;for(const[K,re]of h)if(g.startsWith(K))if(K.includes("[")){const q=K==="\\["?g.slice(K.length):"";if(K==="\\["&&$p(q,re)===-1&&!/^\s*!\[/.test(q)&&!q.includes("`")&&fd(q)){v=!0,y=K,b=re;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":b,x=w>=0?w:$p(g,b,_);if(!C&&x>y.length){const K=g.slice(N+y.length,x),re=c.push("math_block","math",0);re.content=Kc(K),re.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",re.map=[l,l+1],re.raw=`${y}${K}${M}`,re.block=!0,re.loading=!1,c.line=l+1;const q=g.slice(x+M.length);return q.trim()&&n(c,q,l),!0}let E=l,I="",F=!1,W="",P=l;const O=C?g:g===y?"":g.slice(y.length),R=!f&&y==="\\["?"]":"",z=$p(O,b);if(z!==-1){const K=z;I=O.slice(0,K),W=O.slice(K+b.length),P=C?l+1:l,F=!0,E=P}else for(O&&!C&&(I=O),E=l+1;E{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function hme(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
        ${e.utils.escapeHtml(String(o.content??""))}
        `})}const pme=/^\s]/i,mme=/^<\/a\s*>/i;function gme(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");pme.test(r)&&i>0&&i--,mme.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function vme(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>gme(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function yme(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function kme(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new Vhe({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!yh(l,{tagName:"a",attrName:"href"});f1e(r),s.set({validateLink:r})}return yme(s),vme(s),(e.enableMath??!0)&&fme(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&fpe(s),e.enableFixIndentedCodeBlock!==!1&&Bpe(s),v1e(s),w1e(s),k1e(s),S1e(s),hme(s),Dpe(s,{customHtmlTags:e.customHtmlTags}),s}function kh(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>kh(n))),t}function bme(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function wme(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function Cme(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function K2(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function GE(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function QE(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function _me(e,t){const n=[],i=[],o=[],s=[],r=e.split(xme),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!Zj.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(QE(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(QE(g,a))}else{GE(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&GE(n,i,o,s);const d=n.join(` +`),f=i.join(` +`);return{original:t&&l&&d?`${d} +`:d,updated:t&&l&&f?`${f} +`:f}}function A7(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=Ame(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=_me(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function Mme(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function Ime(){return{type:"hardbreak",raw:`\\ +`}}function Tme(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||jd.has(e)}function Eme(e){if(!e||e.length===0)return YE();const t=v8.get(e);if(t)return t;const n=e.map(Ca).filter(Boolean);if(!n.length){const o=YE();return v8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:Yb({customHtmlTags:e})};return v8.set(e,i),i}function Jj(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function Lme(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function pk(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function Nme(e,t,n){const i=e.slice();return pk(i,"href")||i.push(["href",t]),n!=null&&!pk(i,"title")&&i.push(["title",n]),i}function MC(e){return e.map(Jj).join("")}function Gy(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:Gy(i.children)});continue}t.push(i)}return t}function Dme(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(T.toLowerCase())||(g+=T),y=!0,v=!0}const b=[],C=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let A;for(;(A=C.exec(l))!==null;){const T=A[1],N=A[2]||A[3]||A[4]||"";b.push([T,N])}if(u?.has(a)){const T=Lme(e);return[{type:a,tag:a,attrs:b,content:T?T.inner:h.innerTokens.length?MC(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:T?.raw??g,loading:e.loading||v,autoClosed:y},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:g,children:m,raw:g,loading:v,autoClosed:y},h.nextIndex]}function Xj(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>Xj(t)).join(""):String(e.content??"")}function Bme(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>Xj(t)).join("")}function JE(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=Bme(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function Rme(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function Ome(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function Pme(e,t,n){const i=e.slice();return mk(i,"href")||i.push(["href",t]),n!=null&&!mk(i,"title")&&i.push(["title",n]),i}function Z2(e,t,n){const i=e[t],o=$me(i.attrs),s=String(mk(o,"href")??""),r=mk(o,"title"),l=r==null?null:String(r),a=Pme(o,s,l);let u=t+1;const c=[];let d=!0;for(;uv.type==="strong_open")){const v=String(h.content??""),y=String(h.raw??v),b=kh(h);b.content=v.slice(0,-2),b.raw=y.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=b}const m=Lo(f,void 0,void 0,n),g=m.map(v=>{const y=v;return"content"in v?String(y.content??""):String(y.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,Jme=/\p{P}/u,Xme=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,ege=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,tge=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,nge=/:\/\//,IC=1,eH=2,ige=4,oge=8,tH=16,Xc=32,Qy=64,Cg=128,nH=256,sge=512,Ag=1024,rge=1982;function G2(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Hd(e){return!!e&&Qme.test(e)}function Wd(e){return!!e&&(Yme.test(e)||Jme.test(e))}function oH(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&Xme.test(e)}function sH(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&ege.test(e)}function age(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||Hd(i)?!1:!(Wd(i)&&!oH(i,n)&&n&&!Hd(n)&&!Wd(n))}function uge(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||Hd(n)?!1:!(Wd(n)&&!sH(n,i)&&i&&!Hd(i)&&!Wd(i))}function cge(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||Hd(i)?!1:!(Wd(i)&&!oH(i,n)&&n&&!Hd(n)&&!Wd(n))}function fge(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||Hd(n)?!1:!(Wd(n)&&!sH(n,i)&&i&&!Hd(i)&&!Wd(i))}function hge(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const vge=/[\p{L}\p{N}]/u,yge=/^[\p{L}\p{N}]+$/u;function TC(e){return e?vge.test(e):!1}function rH(e){return e?yge.test(e):!1}function t0(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function Cge(e){return e?tge.test(e)||nge.test(e):!1}function Age(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Lo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=Fv(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(Y,ue){const Z=e.length===1?t:String(ue.content??""),se=[],ke=kge(Y);if(ke!==-1){T(Y.slice(0,ke),Y.slice(0,ke));const we=Y.slice(ke);return we&&(E({type:"text",content:we,raw:we}),c--),c++,!0}if(Vme.test(Y)){const we=Y.indexOf("~~");we!==-1&&se.push({type:"strikethrough",index:we})}if(Kme.test(Y)){const we=Y.indexOf("**");we!==-1&&se.push({type:"strong",index:we})}if(/[^*]*\*[^*]+/.test(Y)){const we=Z?iH(Z,0):Y.indexOf("*");if(Z&&we===-1)return!1;we!==-1&&se.push({type:"emphasis",index:we})}se.sort((we,oe)=>we.index!==oe.index?we.index-oe.index:we.type===oe.type?0:we.type==="strong"?-1:oe.type==="strong"?1:0);const be=se[0];if(!be)return!1;if(be.type==="strikethrough"){const we=be.index,oe=we>-1?Y.slice(0,we):"";if(oe&&T(oe,oe),we===-1)return c++,!0;const J=Y.indexOf("~~",we+2),fe=J===-1?Y.slice(we+2):Y.slice(we+2,J),ve=J===-1?"":Y.slice(J+2),{node:Ce}=eL([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:fe,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),A(Ce),ve&&(E({type:"text",content:ve,raw:ve}),c--),c++,!0}if(be.type==="strong"){const we=be.index,oe=we>-1?Y.slice(0,we):"";if(oe&&T(oe,oe),we===-1)return c++,!0;if(t&&we===0){let ie=!1,Ee=0;for(;Ee=2)return T(Y,Y),c++,!0}}if(t&&(Y.match(/\*/g)||[]).length>lge(t))return T(Y.slice(oe.length),Y.slice(oe.length)),c++,!0;const J=t0(Y,we);if(J.len>=3){const ie=wge(Y,we+J.len);if(ie!==-1){const Ee=Y.slice(we+J.len,ie);if(bge(Ee)){const{node:Ke}=Xm([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ee,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),A(Ke);const Ue=Y.slice(ie+3);return Ue&&(E({type:"text",content:Ue,raw:Ue}),c--),c++,!0}}}if(!dge(Y,we)){const ie=Y.slice(we,we+J.len);T(ie,ie);const Ee=Y.slice(we+J.len);return Ee&&(E({type:"text",content:Ee,raw:Ee}),c--),c++,!0}const fe=hge(Y,we+2);let ve="",Ce="";if(fe.index!==-1){ve=Y.slice(we+2,fe.index),Ce=Y.slice(fe.index+2);const ie=fe.index,Ee=t0(Y,ie);if(J.intraword&&Ee.intraword&&!rH(ve)||!ve&&J.len>=4&&J.intraword)return T(Y.slice(oe.length),Y.slice(oe.length)),c++,!0}else{if(d||fe.sawInvalidClose||J.intraword)return T(Y.slice(oe.length),Y.slice(oe.length)),c++,!0;ve=Y.slice(we+2),Ce=""}if(!ve&&/^\*+$/.test(Ce))return T(Y,Y),c++,!0;const{node:le}=Xm([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ve,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),A(le),Ce&&(E({type:"text",content:Ce,raw:Ce}),c--),c++,!0}if(be.type==="emphasis"){let we=be.index;we===-1&&(we=0);const oe=Y.slice(0,we);if(oe&&T(oe,oe),!age(Y,we)){T(Y[we],Y[we]);const ie=Y.slice(we+1);return ie&&(E({type:"text",content:ie,raw:ie}),c--),c++,!0}const J=t0(Y,we),fe=cge(Z,Y,we+1),ve=fe.index,Ce=e[c+1];if(i?.final&&Ce?.type==="em_open"&&ve!==-1&&Y.slice(we+1,ve).trim()!==Y.slice(we+1,ve)||ve===-1&&(fe.sawInvalidClose||i?.final||J.intraword||!TC(Y[we+1])))return T(Y.slice(we),Y.slice(we)),c++,!0;const{node:le}=K2([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ve>-1?Y.slice(we+1,ve):Y.slice(we+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),A(le),ve!==-1&&ve{for(let le=0;le=0&&Ce[Ee]==="\\";Ee--)ie++;if(ie%2===0)return le}return-1})(Y);if(se===-1)return!1;let ke=1;for(let Ce=se+1;Cebe?.type==="math_inline")||!Zme.test(Y))return null;const Z=ue.parseInline(Y,{__markstreamFinal:!!i?.final});if(!Array.isArray(Z)||Z.length===0)return null;const se=(Z.find(be=>be?.type==="inline")?.children??[]).filter(be=>!(be?.type==="text"&&String(be.content??"")===""));if(!se.length||!se.some(be=>be?.type!=="text")||se.length===1&&se[0]?.type==="text"&&String(se[0].content??"")===Y)return null;const ke=Lo(se,Y,n,i);return ke.length?ke:null}function b(Y){m(),a.push(Y)}function C(Y){m();const ue=kh(Y);a.push(ue)}function A(Y){b(Y)}function T(Y,ue){u?(u.content+=Y,u.raw+=ue??Y):(u={type:"text",content:String(Y??""),raw:String(ue??Y??"")},a.push(u))}function N(Y,ue){if(!Y)return;const Z=Lo([{...ue,type:"text",content:Y,raw:Y}],Y,n,i);if(Z.length===1&&Z[0]?.type==="text"){const se=Z[0];T(String(se.content??""),String(se.raw??se.content??""));return}for(const se of Z)A(se)}function _(Y,ue){return String(Y.markup??"").startsWith(ue)}function w(Y){if(!u||Y.loading!==!0||Y.markup!=="\\(\\)")return;const ue=e[c-1];!ue||ue.type!=="text"||!_(ue,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function M(Y){return Y.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function x(Y,ue,Z=G2(Y)){let se=Y;const ke=String(ue.content??"");return(Z&IC)!==0&&se.endsWith("\\")&&!_(ue,"\\\\")&&!ke.endsWith("\\\\")&&(se=se.slice(0,-1)),(Z&Ag)!==0&&se.endsWith("(")&&!_(ue,"\\(")&&!ke.endsWith("\\(")&&(se=se.slice(0,-1)),(Z&eH)!==0&&/\*+$/.test(se)&&!_(ue,"\\*")&&!ke.endsWith("\\*")&&(se=se.replace(/\*+$/,"")),se}for(;c=0;ie--){const Ee=a[ie];if(Ee.type!=="text")break;J=ie,fe=String(Ee.content??"")+fe}JJ==="href")?.[1],oe=String(we??"");if(t&&oe){const J=t.indexOf("](");if(J!==-1){const fe=t.indexOf(")",J+2);fe===-1?Z.loading=!0:Z.loading&&t.slice(J+2,fe).includes(oe)&&(Z.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(Z.href)&&j(Z,ue-1)||R(Z)||b(Z)}function P(Y){if(Y.markup!=="linkify")return!1;const{node:ue,nextIndex:Z}=Z2(e,c,i);return H(ue,Z)?(c=Z,!0):!1}function O(Y){m(),A(zme(Y)),c++}function R(Y){if(Y.type!=="link")return!1;const ue=a[a.length-1];if(!ue||ue.type!=="text")return!1;const Z=String(ue.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!Z)return!1;const se=Y,ke=String(se.href??""),be=String(se.text??""),we=String(Z[2]??""),oe=ke.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ke||!(be===ke||be===oe||Cge(be)))return!1;const J=String(Z[1]??"");return J?(ue.content=J,ue.raw=J):a.pop(),b({...Y,text:we,children:[{type:"text",content:we,raw:we}],raw:`[${we}](${ke}${se.title?` "${se.title}"`:""})`}),!0}function z(Y){if(Y.type!=="link")return!1;const ue=Y,Z=String(ue.href??"");return Z?H({href:Z,title:ue.title==null||ue.title===""?null:String(ue.title),loading:!!ue.loading},c+1):!1}function H(Y,ue){const Z=a[a.length-1];if(Z?.type!=="image"||Z.src||!Z.loading||!String(Z.raw??"").endsWith("]("))return!1;const se=e[ue],ke=String(se?.content??"");if(se?.type!=="text"||!ke.startsWith(")"))return!1;a.pop(),u=null;const be=String(Z.alt??"");b({type:"image",src:Y.href,alt:be,title:Y.title,raw:`![${be}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const we=ke.slice(1),oe=kh(se);return oe.content=we,oe.raw=we,h()[ue]=oe,!0}function j(Y,ue=c-1){if(Y.type!=="link")return!1;const Z=a[a.length-1],se=e[ue];if(!Z||Z.type!=="text"||se?.type!=="text")return!1;const ke=String(Z.content??""),be=String(se.content??"");if(!ke.endsWith("!")||!be.endsWith("!")||_(se,"\\!"))return!1;const we=ke.slice(0,-1);we?(Z.content=we,Z.raw=we,u=Z):(a.pop(),u=null);const oe=Y,J=String(oe.text??oe.children?.map(Ce=>String(Ce?.content??Ce?.raw??"")).join("")??""),fe=String(oe.href??""),ve=oe.title==null||oe.title===""?null:String(oe.title);return b({type:"image",src:fe,alt:J,title:ve,raw:`![${J}](${fe}${ve?` "${ve}"`:""})`,loading:!!oe.loading}),!0}function K(Y,ue="",Z=null){const se=String(Y.alt??Y.raw??"");return{type:"link",href:ue,title:Z,text:se,children:[Y],raw:`[${se}](${ue}${Z?` "${Z}"`:""})`,loading:!0}}function re(Y){const ue=Y.startsWith("![")?Y:`![${Y}`,Z=ue.slice(2),se=Z.indexOf("](");return{type:"image",src:"",alt:se===-1?Z.replace(/\]$/,""):Z.slice(0,se),title:null,raw:ue,loading:!0}}function q(Y){const ue=Y.indexOf("[![");if(ue===-1||typeof t=="string"&&e.length===1&&gge(t,ue,"["))return!1;const Z=Y.slice(0,ue);return Z&&T(Z,Z),b(K(re(Y.slice(ue+1)))),c++,!0}function Q(Y){if(i?.final)return!1;const ue=e[c-1];if(ue?.type!=="text"||!String(ue.content??"").endsWith("[")||_(ue,"\\["))return!1;const Z=a[a.length-1];if(Z?.type==="text"&&Z.content.endsWith("[")){const se=Z.content.slice(0,-1);se?(Z.content=se,Z.raw=se,u=Z):(a.pop(),u=null)}return b(K(JE(Y))),c++,!0}function ne(Y){if(Y.type!=="link")return!1;const ue=Y,Z=String(ue.raw??""),se=String(ue.text??"");if(!Z.startsWith("[![")&&!se.startsWith("!["))return!1;const ke=ue.title==null||ue.title===""?null:String(ue.title);return b(K({type:"image",src:String(ue.href??""),alt:se.replace(/^!\[/,"").replace(/\]$/,""),title:ke,raw:Z.startsWith("[![")?Z.slice(1):Z,loading:!0})),!0}function te(Y){if(!Y.startsWith("]("))return!1;const ue=e[c-2];if(ue?.type==="text"&&String(ue.content??"").endsWith("[")&&_(ue,"\\["))return!1;const Z=a[a.length-1];if(Z?.type!=="image"&&Z?.type!=="link")return!1;const se=Z,ke=Z?.type==="link"&&Array.isArray(se.children)&&se.children.length===1&&se.children[0]?.type==="image"?a.pop():null,be=ke?ke.children[0]:a.pop();if(!be||be.type!=="image")return!1;const we=e[c+1];let oe=String(ke?.href??""),J=ke?.title==null?null:String(ke.title),fe=!0;if(we?.type==="link_open"){const{node:Ce,nextIndex:le}=Z2(e,c+1,i);oe=Ce.href,J=Ce.title,fe=!0,c=le}else{if(oe=Y.slice(2),oe.includes('"')){const Ce=oe.split('"');oe=String(Ce[0]??"").trim(),J=Ce[1]==null?null:String(Ce[1]).trim()}c++}const ve=K(be,oe,J);return ve.loading=fe,b(ve),!0}function ge(){const Y=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&_(Y,"\\[")}function Ae(Y,ue){const Z=Y.indexOf("[");if(Z===-1)return!1;let se=Y.slice(0,Z);const ke=Y.indexOf("](",Z);if(ke!==-1){const be=e[c+2];let we=Y.slice(Z+1,ke);if(we.includes("[")){const ie=we.indexOf("[");se+=Y.slice(0,Z+ie+1);const Ee=Z+ie+1;we=Y.slice(Ee+1,ke)}const oe=e[c+1];if(Y.endsWith("](")&&oe?.type==="link_open"&&be){const ie=e[c+4];let Ee=4,Ke=!0;if(ie?.type==="text"){const at=String(ie.content??"");if(at.startsWith(")")){Ke=!1;const bt=at.slice(1);if(bt){const It=kh(ie);It.content=bt,It.raw=bt,h()[c+4]=It}else Ee++}else at==="."&&Ee++}N(se,ue);const Ue=String(be.content??"");return i?.validateLink&&!i.validateLink(Ue)?T(we,we):b({type:"link",href:Ue,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:Ke}),c+=Ee,!0}const J=Y.indexOf(")",ke),fe=J!==-1?Y.slice(ke+2,J):"",ve=J===-1;let Ce=se.match(/\*+$/);if(Ce&&(se=se.replace(/\*+$/,"")),N(se,ue),Ce||(Ce=we.match(/^\*+/)),!d&&Ce){const ie=Ce[0].length;we=we.replace(/^\*+/,"").replace(/\*+$/,"");const Ee=[];if(ie===1?Ee.push({type:"em_open",tag:"em",nesting:1}):ie===2?Ee.push({type:"strong_open",tag:"strong",nesting:1}):ie===3&&(Ee.push({type:"strong_open",tag:"strong",nesting:1}),Ee.push({type:"em_open",tag:"em",nesting:1})),Ee.push({type:"link",href:fe,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:ve}),ie===1){Ee.push({type:"em_close",tag:"em",nesting:-1});const{node:Ke}=K2(Ee,0,i);A(Ke)}else if(ie===2){Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ke}=Xm(Ee,0,void 0,i);A(Ke)}else if(ie===3){Ee.push({type:"em_close",tag:"em",nesting:-1}),Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ke}=Xm(Ee,0,void 0,i);A(Ke)}else{const{node:Ke}=K2(Ee,0,i);A(Ke)}}else i?.validateLink&&!i.validateLink(fe)?T(we,we):b({type:"link",href:fe,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:ve});const le=J!==-1?Y.slice(J+1):"";return le&&(E({type:"text",content:le,raw:le}),c--),c++,!0}return!1}function me(Y){const ue=Y.indexOf("![");if(ue===-1)return!1;const Z=Y.slice(0,ue);return Z&&!u?u={type:"text",content:Z,raw:Z}:Z&&u&&(u.content+=Z),u&&(a.push(u),u=null),b(re(Y.slice(ue))),c++,!0}function de(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ue=Y.slice(1).match(/[^\s\]]/);if(ue===null)return c++,!0;if(ue&&/x/i.test(ue[0])){const Z=ue[0]==="x"||ue[0]==="X";return b({type:"checkbox_input",checked:Z,raw:Z?"[x]":"[ ]"}),c++,!0}return!1}return a}function S7(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function tL(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` +`&&r++,{startLine:s,endLine:r}}function G0(e,t,n,i){const o=xge(e,t,n);return S7(o.startLine,o.endLine,i)}function Sge(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:S7(i,o,t)}function Ii(e,t,n){if(!n?.includeSourceMap)return e;const i=Sge(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function _ge(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=S7(s,Math.max(r,l),i)),e}function Mge(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Ige(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Tge(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function cm(e,t,n){const i=e[t],o=[],s=lf(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Ii(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` +`)};return n?.includeSourceMap&&Ii(l,i,n),[l,r+1]}function Ege(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=lf(i,!0);let a=t+1;for(;au.raw).join(` +`)} +:::`},a+1]}const Lge=new Set(["warning","info","note","tip","danger","caution"]);function Nge(e){let t=0;for(;t=0;g--){const v=f[g];if(v.type==="text"&&/:+/.test(v.content)){h=g;break}}const m={type:"paragraph",children:Lo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Ii(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=cm(e,u,a.options());n?.includeSourceMap&&Ii(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=dm(e,u,a.options());n?.includeSourceMap&&Ii(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=Zb(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} +${l.map(d=>d.raw).join(` +`)} +:::`},u+1]}const Fge=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function Bge(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Fge.exec(String(i.info??""));return o?Ege(e,t,o,n):null}const _7={parseContainer:(e,t,n)=>Dge(e,t,n),matchAdmonition:Bge};function dm(e,t,n){const i=[],o=lf(n,!0);let s=t+1;for(;sl.raw).join(` +`)};return n?.includeSourceMap&&Ii(r,e[t],n),[r,s+1]}function Rge(e){if(e.info?.startsWith("diff"))return A7(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function Oge(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=lf(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` +`)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` +`)},o+1]}function $ge(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=lf(n,!0);let l=t+1;for(;la.raw).join(` +`)}`},l+1]}function Pge(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:Lo(a.children||[],u,void 0,n),raw:u}}function zge(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function lH(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!v.includes(">");else if(u)u=!v.includes("?>");else if(v.startsWith("");else if(v.startsWith("");else if(v.startsWith("");else{const y=o(v);if(y)if(y.closing){for(let b=r.length-1;b>=0;b--)if(r[b]===y.tag){r.length=b;break}}else y.selfClosing||s(y.after,y.tag)||r.push(y.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function S0e(e,t,n){if(!n?.length)return!1;const i=new Set(Yh(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const v=c.indexOf(">",d);if(v===-1)return null;let y=v-1;for(;y>=0&&s(c[y]);)y--;return{closing:f,tag:m,selfClosing:!f&&c[y]==="/",after:c.slice(v+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=fm(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let v=a.length-1;v>=0;v--)if(a[v]===g.tag){a.length=v;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function _0e(e,t){const n=n0e.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` +`,o),r=e.slice(o,s===-1?e.length:s);return!fm(r.endsWith("\r")?r.slice(0,-1):r)||vH(e,o)||x0e(e,o)||S0e(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function D7(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!Au(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!Au(e,l)){const a=D7(e,s,"`"),u=yH(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!Au(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!Au(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function M0e(e,t){if(!w7(t))return e;const n=t,i=rL.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?kH(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:Qb(e).state;rL.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` +`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return fd(l)&&!c?e:e.slice(0,r)}function I0e(e,t,n,i,o){const s=T7(e),r=E7(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&L7(e)==null&&A8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&A8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return cL(e,t,n,i,o)}else return cL(e,t,n,i,o);return!1}function Qb(e,t=k0e(),n=null,i=!1,o=0){const s=i0(t);let r=i0(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);I0e(h,s,o+u,n,i)&&(a=!0),d?(r=i0(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function kH(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:i0(e.committedContext),context:i0(e.context),lineBuffer:e.lineBuffer+t}}:Qb(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function T0e(e,t){if(!w7(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=Gb.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?kH(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):Qb(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!A0e(o.source,r)&&!w0e(t)){o.source=t,o.explicitBracketMath=a;return}const c=cme(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),b0e(e,t,c,a)}function E0e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function bH(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function L0e(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function pL(e){return{type:"paragraph",children:e,raw:e.map(B0e).join("")}}function mL(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function gL(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=p0e(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(pL(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(pL(u)),a}function R0e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function o0(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function O0e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ga(t)}\s*>\s*$`,"i").test(n)}const S8=new Set(["iframe","script","style","textarea","title"]);function Rv(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}const h=qo(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let v=g.slice(1).trimStart();const y=v.startsWith("/");y&&(v=v.slice(1).trimStart());const b=v.match(/^([A-Z][\w:-]*)/i);return b?.[1]?{closing:y,end:m,selfClosing:/\/\s*>$/.test(g),tag:b[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Ga(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const v=o(g.index);return v?{start:g.index,end:v.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(S8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} +`}function vL(e){return e.replace(/\r\n/g,` +`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function z0e(e,t,n){return n?e.includes(n,t)?!0:vL(e.slice(Math.max(0,t))).includes(vL(n)):!1}function j0e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function CH(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const W0e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),q0e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function U0e(e){return/\n\s*\n/.test(e)||q0e.test(e)}function V0e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>W0e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!U0e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function K0e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=Rv(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function Z0e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=sL.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:y1(u,t,n));return sL.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function G0e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||wj.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=qo(l);if(a===-1)return o;const u=Rv(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=CH(n,i),m=d?null:K0e(f),g=m?Z0e(m,t,h,i):y1(f,t,h);return V0e(f,g)?{...o,children:g}:o})}function Q0e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function y1(e,t,n){return e.trim()?xH(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function Y0e(e,t,n){const i=y1(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function J0e(e,t,n){const i=lH({content:e}),o=qo(e),s=wH(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=Y0e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function X0e(e,t,n){const i=qo(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=Rv(o,"summary",0);if(!s)return y1(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...y1(r,t,n),J0e(s.raw,t,n),...y1(l,t,n)]}function AH(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const j=wH(f,"details");return j!==-1?f.slice(0,j):f})():f,[C]=AH(y?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),A=X0e(b,n,CH(i,o)),T=g===-1?"":String(e[g].raw??o0(e[g])??""),N=y||g!==-1&&v?.closed===!0,_=T.replace(/[\t\r\n ]+$/,""),w=N?(()=>{const j=(v?.raw??"").lastIndexOf(_);return j===-1?t.length:h+j})():t.length,M=qo(f),x=y&&M!==-1?h+M+1:h+f.length,E=t.slice(x,w===-1?t.length:w),I=n.parse(E,{__markstreamFinal:o}),F=n.renderer.render(I,n.options,{__markstreamFinal:o}),W=w+_.length,P=N?Math.max(w+T.length,j0e(t,W)):t.length,O=N?t.slice(w,P):T,R=N?t.slice(h,P):t.slice(h),z=y&&M!==-1?f.slice(0,M+1):f,H={...u,tag:"details",attrs:Kb(f.slice(0,M+1)),raw:R,content:`${z}${F}${O}`,children:[...A,...C],loading:!o&&!N};if(i.includeSourceMap&&(H.sourceMap=G0(t,h,N?P:t.length,i)),r.push(H),l=N?P:t.length,g===-1&&!y)break;g!==-1&&(a=g)}return[r,l]}function eve(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&M.end<=d.end){o.splice(N,1);continue}break}T=w+_.length,o.splice(N,1)}}return o}function tve(e){const t=l=>l===" "||l===" "||l===` +`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const v=g.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122},c=g=>{const v=g.charCodeAt(0);return v>=48&&v<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||v==='"'||v==="'"||v==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>vH(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` +`||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` +`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function kL(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let v=0;v=4)return!0;continue}if(y===" ")return!0;break}return!1},r=m=>{let g=!1,v=!1;for(let y=0;y")return y}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const v=m.replace(/^[ \t]+/,"");if(!v||v.startsWith(">")||v.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(v))return-1;let y=!1,b=0;for(;b=T.length){y=!0,b++;continue}const _=T[N];if(_==="!"||_==="?"){y=!0,b+=A+1;continue}if(_==="/"){y=!0,b+=A+1;continue}const w=N;for(;N"&&x!=="/"){y=!0,b++;continue}const E=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),I=/\/\s*>$/.test(T),F=E.test(m.slice(b+A+1)),W=E.test(e.slice(g+b+A+1)),P=/[\r\n]/.test(e.slice(g+b+A+1));if(y&&n.has(M)&&!I&&!F&&(W||P))return b;y=!0,b+=A+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",y=g?v?m-1:m:e.length,b=e.slice(h,y),C=g?v?`\r +`:` +`:"",A=l(b);let T=b;if(!u&&!A){const N=a(b,h);if(N!==-1){const _=C||` +`;T=`${b.slice(0,N).replace(/[ \t]+$/,"")}${_}${_}${b.slice(N).replace(/^[ \t]+/,"")}`}}f+=T,f+=C,A&&(u?A.markerChar===c&&A.markerLen>=d&&/^\s*$/.test(A.rest)&&(u=!1,c="",d=0):(u=!0,c=A.markerChar,d=A.markerLen)),h=g?m+1:e.length}return f}function ive(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let v=g+1;for(;v=d.length||d[v]!=="/"){g=d.indexOf("<",g+1);continue}for(v++;vd.length){g=d.indexOf("<",g+1);continue}let y=!0;for(let C=0;C="A"&&A<="Z"?String.fromCharCode(A.charCodeAt(0)+32):A)!==m[C]){y=!1;break}}if(!y){g=d.indexOf("<",g+1);continue}let b=v+m.length;if(b")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=a(m),u+=f?`\r +`:` +`,c=d+1}return u}function ove(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,v=e.slice(d,g),y=h?m?`\r +`:` +`:"",b=o(v),C=b?.prefix??"",A=b?.content??v,T=s(A);T&&(l?T.markerChar===a&&T.markerLen>=u&&/^\s*$/.test(T.rest)&&(l=!1,a="",u=0):(l=!0,a=T.markerChar,u=T.markerLen));let N=A;if(!l&&N.includes("{if(E.replace(/^[\t ]+/,"").startsWith("|"))return w;const I=E.slice(0,x).replace(/^[\t ]+/,"");if(I.length>0){const F=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",W=I.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!F||!W||F!==W)return w}return`${M} + +`});if(C){const _=C+N.split(` +`).join(` +${C}`);c+=_}else c+=N;c+=y,d=h?f+1:e.length}return c}function sve(e,t){if(!e||!t.length)return e;const n=new Set(t.map(I=>String(I??"").toLowerCase()));if(!n.size)return e;const i=I=>I===" "||I===" ",o=I=>{if(!I)return!1;if(I[0]===" ")return!0;let F=0;for(let W=0;W=4)return!0;continue}if(P===" ")return!0;break}return!1},s=I=>{const F=I.charCodeAt(0);return F>=65&&F<=90||F>=97&&F<=122||F>=48&&F<=57||I==="_"||I==="-"||I===":"},r=I=>{let F=0;for(;F{let F=0,W=!1,P=0;for(;F=I.length||I[F]!==">")break;for(W=!0,F++;Fr(I).startsWith("<"),u=I=>{for(let F=0;F{if(o(I))return"";const F=r(I);if(!F.startsWith("<"))return"";let W=1;for(;W=F.length||F[W]==="/"||F[W]==="!"||F[W]==="?")return"";const P=W;for(;W"&&R!=="/"?"":O},d=I=>{if(o(I))return null;const F=r(I);if(!F.startsWith("<"))return null;let W=1;for(;W=F.length)return null;const P=F[W]==="/";if(P)for(W++;W"&&H!=="/")return null;if(P)return{type:"close",name:z};if(/\/\s*>\s*$/.test(F))return{type:"open",name:z,complete:!0};const j=F.indexOf(">",W);if(j!==-1){const K=F.slice(j+1);if(new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i").test(K))return{type:"open",name:z,complete:!0}}return{type:"open",name:z,complete:!1}},f=I=>{if(o(I))return null;const F=r(I).replace(/[ \t]+$/,"");if(!F.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(F))return null;const W=F.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(W?.[1])return W[1].toLowerCase();const P=F.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!P?.[1]||!P[2])return null;const O=P[1].toLowerCase();return O===P[2].toLowerCase()?O:null};let h=!1,m="",g=0;const v=I=>{let F=0;for(;Fv(I),b=I=>{const F=r(I);return F?o(I)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(F):!1},C=(I,F,W)=>{let P=I,O=0;for(;PP&&e[R-1]==="\r",j=z?H?R-1:R:e.length,K=e.slice(P,j),re=l(K),q=re?.key??"";if(O>0&&F&&q!==F)break;const Q=re?.content??K,ne=d(Q);if(ne?.name===W){if(ne.type==="open")ne.complete||O++;else if(O>0&&(O--,O===0))return!1}else if(O>0&&(u(Q)||b(Q)))return!0;if(z)P=R+1;else break}return!1};let A="",T=0,N=!0,_=!1,w=!1,M=` +`;const x=[];let E="";for(;TT&&e[I-1]==="\r",P=F?W?I-1:I:e.length,O=e.slice(T,P),R=F?W?`\r +`:` +`:"",z=l(O),H=z?.key??"",j=z?.content??O,K=y(j);K&&(h?K.markerChar===m&&K.markerLen>=g&&/^\s*$/.test(K.rest)&&(h=!1,m="",g=0):(h=!0,m=K.markerChar,g=K.markerLen));const re=x.length>0;if(!h&&!re){const Q=c(j),ne=!!Q&&!N&&_&&w&&C(T,H,Q);Q&&!N&&(!_||ne)&&(H&&E&&H===E?A+=`${H}${M}`:H||(A+=M))}if(A+=O,A+=R,R&&(M=R),!h){const Q=d(j);if(Q){if(Q.type==="open")Q.complete||x.push(Q.name);else for(let ne=x.length-1;ne>=0;ne--)if(x[ne]===Q.name){x.length=ne;break}}}const q=u(j);N=q,_=!q&&a(j),w=!q&&!!f(j),E=H,T=F?I+1:e.length}return A}function rve(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=N7(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function _8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=rve(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` +`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` +`)?` +`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` +`)),o=_0e(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=Yh(i.customHtmlTags);if(r.length&&(o=nve(o,r),o=ive(o,r),o=sve(o,r),o=ove(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=tve(o)),o}function lve(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=LC.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-i0e-o0e),u=_8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:_8(t,n,e,i)}else l=_8(t,n,e,i);return n||(l=M0e(l,e)),LC.set(o,{source:t,safeMarkdown:l,mode:s}),l}function xH(e,t,n={}){const i=dH(n),o=i?Ba():0,s=!!n.final,r=(e??"").toString();v0e(t,n)&&(t.stream.reset(),y0e(t),LC.delete(t));const l=lve(t,r,s,n);i&&_d(i,"safeMarkdownMs",Ba()-o);const a=R0e(l);if(a){if(n.includeSourceMap){const T={...n,__sourceLineMapper:kL(r,l)};a[0].sourceMap=G0(l,0,l.length,T)}const C=n.preTransformTokens,A=n.postTransformTokens;if(I7(t,n)||typeof C=="function"||typeof A=="function"){const T=hL(t,l,{__markstreamFinal:s},n),N=typeof C=="function"&&C(T)||T;typeof A=="function"&&A(N)}return lL(a,n,i,o)}const u=i?Ba():0,c=hL(t,l,{__markstreamFinal:s},n);if(i&&_d(i,"tokenizeMs",Ba()-u),!c||!Array.isArray(c))return lL([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,v=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),y={...n,validateLink:v,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?kL(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let b=h0e(t,l,h,y,i);if(f&&typeof f=="function"){const C=f(h);if(Array.isArray(C)){const A=C[0],T=A?.type;A&&typeof T=="string"?b=Pp(C,{...y,__customHtmlBlockCursor:0},i):b=C}}if(Q0e(b)){const C=i?Ba():0;b=eve(b,s,l,y),b=AH(b,l,t,y,s)[0],b=G0e(b,t,y,s),i&&_d(i,"htmlBlockPassesMs",Ba()-C)}if(s){const C=new WeakSet,A=T=>{if(!T||typeof T!="object"||C.has(T))return;if(C.add(T),Array.isArray(T)){for(const _ of T)A(_);return}const N=T;N.type==="html_block"&&N.loading===!0&&(N.loading=!1);for(const _ of Object.values(N))A(_)};A(b)}return b=hH(b,n),n.debug&&console.log("Parsed Markdown Tree Structure:",b),fH(b,i,o)}function bL(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=lf(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)Ii(d,a,t);for(const d of c)cu(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&Ii(d,a,t);const f=gL(d,t);if(f){s&&mL(f,d);for(const h of f)cu(h,a,t);n.push(...f)}else cu(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const ave=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,s0=/\d/u,uve=/[,.!?;:,。;、!?:]/u,cve=/\d\p{Script=Han}{1,3}$/u;function dve(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&dve(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,mve=new Set([...Dv,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),gve=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function wL(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function vve(e){return typeof e=="string"?e:e==null?"":String(e)}function SH(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function hd(e){return vve(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function _H(e){return hd(e).replace(/`/g,"`")}function Jb(e){return String(e??"").trim().toLowerCase()}function F7(e,t="safe"){const n=Jb(e);return n?t==="escape"?!0:t==="trusted"?Dv.has(n):!gve.has(n):!1}function MH(e,t="safe"){const n=Jb(e);return n?t==="escape"?!0:t==="trusted"?Dv.has(n):mve.has(n):!1}function CL(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${_H(i)}"`).join("")}function IH(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(pve);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function yve(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||yh(o,{tagName:t,attrName:"srcset"})})}function TH(e,t,n,i){return epe.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?yve(t,i):!!(tpe.has(e)&&t&&yh(t,{tagName:i,attrName:e}))}function Qf(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function EH(e,t,n,i=!1){if(t!=="safe"||Jb(n)!=="a")return e;const o=Qf(e,"href");if(i&&(!o||!e[o])){const a=Qf(e,"target"),u=Qf(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Qf(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Qf(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function AL(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!SH(r)||TH(l,s,t,n)||(i[r]=s)}return EH(i,t,n,!!Qf(e,"href"))}function LH(e,t){const n=e.toLowerCase();return bj.has(n)?!1:wL(t,n)||wL(t,e)}function B7(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!SH(r)||TH(l,s,t,n)||(i[r]=s)}return EH(i,t,n,!!Qf(e,"href"))}function r0(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function Yy(e,t="safe",n){const i=B7(r0(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function kve(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function bve(e){const t={};for(const[n,i]of Object.entries(e))t[n]=kve(i,n);return t}function M8(e){return e.trim().length>0}function NH(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);M8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=IH(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);M8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||jd.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function wve(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=IH(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||jd.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function Cve(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${hd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${hd(i)}`:` ${hd(i)}="${_H(o)}"`).join("");return e.type==="self_closing"?`<${hd(t)}${n} />`:`<${hd(t)}${n}>`}function Ave(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of NH(e))if((n.type==="tag_open"||n.type==="self_closing")&&LH(n.tagName??"",t))return!0;return!1}function k1(e,t="safe"){if(!e)return"";if(t==="escape")return hd(e);const n=wve(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(hd(r.content??""));continue}const l=Jb(r.tagName);if(!l)continue;if(MH(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&F7(l,t)){o.push(Cve(r));continue}if(r.type==="self_closing"){o.push(`<${l}${CL(AL(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${CL(AL(r.attrs??{},t,l))}>`),jd.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const xve=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],xL="http://www.w3.org/2000/svg",Sve=new Set(["script","style","iframe","object","embed","link","meta"]),_ve=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),Mve=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Ive=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Tve=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Eve(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Lve(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Nve(e){const t=e.nodeName.toLowerCase();return t==="use"?Eve(e):t==="image"?Lve(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Tve.has(t)}function Dve(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Fve(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?yh(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?yh(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":yh(s,{tagName:i,attrName:o})?"":s:""}function Bve(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function FH(e){const t=DH(e),n=t.toLowerCase();let i=0;for(;in.test(t))||FH(t)}function Rve(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function Y2(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function BH(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!Sve.has(i)){if(i==="br"){t.push(` +`);return}for(const o of Array.from(n.childNodes))BH(o,t)}}function Ove(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];BH(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=Y2(t.getAttribute("width")),s=Y2(t.getAttribute("height")),r=Y2(t.getAttribute("x")),l=Y2(t.getAttribute("y")),a=e.ownerDocument.createElementNS(xL,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(xL,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function $ve(e){Ove(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!_ve.has(i)){n.remove();continue}if(i==="style"&&SL(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&SL(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(Mve.has(r)&&s.value){const l=Fve(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(Ive.has(r)&&s.value&&FH(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=Dve(s.value);l!==s.value&&n.setAttribute(s.name,l)}}Rve(n)}}function Q9t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return $ve(n),Pve(n)?null:n}catch{return null}}function Pve(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){Nve(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const J2=[];function I8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function zve(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function jve(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function _L(e=`editor-${Date.now()}`,t={}){const n=kme(t),i=n;i.__markstreamRegisteredPluginCount=J2.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||J2.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...v]=m;typeof g=="function"&&n.use(g,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(J2.length)for(const h of J2)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(hve),n.use(Pue),n.use(Rue);const r=Jue,l=r.default??r;n.use(l),n.use(Bue),n.use(Fue),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,v=!!m.env?.__markstreamFinal,y=g.split(/\r?\n/);for(const b of m.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const C=b.map[0],A=b.map[1],T=b.markup,N=T[0],_=T.length,w=y[Math.max(0,A-1)]??"";let M=0;for(;MC+1&&x>=_&&E===w.length,F=b;F.meta=F.meta??{},F.meta.unclosed=!I,F.meta.closed=!!I}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],v=String(g.info??"").trim(),y=String(g.content??""),b=btoa(unescape(encodeURIComponent(y))),C=zve(v),A=I8(C),T=jve(`editor-${e}-${m}-${C}`),N=I8(s("common.copy"));return`
        +
        + ${I8(C.toUpperCase())} + +
        +
        +
        `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const v=a.exec(g.src.slice(g.pos));if(!v)return!1;const y=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(y))return!1;const b=g.src.slice(g.pos+v[0].length);if(b.startsWith("](")||b.startsWith("(")||c(b))return!1;if(!m){const C=v[1],A=g.push("reference","span",0);A.content=C,A.markup=v[0],A.raw=v[0]}return g.pos+=v[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const v=String(h[m].content??"");return`${v}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const Hve="modulepreload",Wve=function(e){return"/"+e},ML={},es=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(u=>{if(u=Wve(u),u in ML)return;ML[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":Hve,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};function qve({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function RH({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:qve({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const Uve={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Vve(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function OH(e){const t=Vve(e);return Uve[t]??t}function Kve(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>OH(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Zve(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function Gve(e){return Zve(e)?.join("\0")??""}function Qve(e,t){return`${Gve(e)}\0\0${Kve(t)?.join("\0")??""}`}function Ap(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function IL(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Yve=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=TL();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=TL();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,v=t2e(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(v-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const y=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=e2e(this.source.slice(this.visible.length),y,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=Ap(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Ap(i,1e3,1)),this.normalizedTargetLatencyMs=Ap(o,900,1),this.normalizedCatchUpLatencyMs=Ap(s,350,1),this.normalizedCatchUpThreshold=IL(r,600),this.normalizedStartDelayMs=IL(a,80),this.maxCommitFps=Math.trunc(Ap(l,30,1)),this.maxCharsPerCommit=Math.trunc(Ap(u,80,1)),this.flushOnFinish=c,this.segmenter=Xve(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Jve(e={},t){const n=new Yve(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Xve(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function e2e(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function TL(){return typeof performance<"u"?performance.now():Date.now()}function t2e(e,t,n){return Math.min(n,Math.max(t,e))}var n2e=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const DC=Symbol.for("markstream-vue:node-lifecycle");function Y9t(){}const R7=new Map;let $H="material";const Qp=new Map,EL=new Map;let FC=null;function i2e(e){R7.set(e.id,e)}function o2e(e){const t=R7.get($H);if(!t)return;const n=t.core[e];if(n)return n;const i=Qp.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!Qp.has(t.id)&&r2e(t)}function s2e(){var e,t;return(t=(e=R7.get($H))==null?void 0:e.fallback)!=null?t:""}function r2e(e){return n2e(this,null,function*(){var t,n,i;if(Qp.has(e.id))return(t=Qp.get(e.id))!=null?t:null;let o=EL.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(Qp.set(e.id,s),FC?.(),s)).catch(()=>(Qp.set(e.id,null),null)),EL.set(e.id,o)),o})}const LL='',NL='',l2e={id:"material",core:{"":NL,plain:'',text:NL,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:LL,csharp:LL,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>es(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},a2e=Ya(0);FC=()=>{a2e.value++},i2e(l2e);const u2e={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Xb(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=u2e[n])!=null?t:n}function J9t(e){const t=Xb(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function X9t(e){return o2e(Xb(e))||s2e()}const DL={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var e4=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let Hr=null,oh=!1,sh=null,t4=$7;function Ov(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function O7(){try{const e=globalThis;return Ov(e?.katex)}catch{return null}}function $7(){return e4(null,null,function*(){const e=O7();if(e)return e;const t=yield es(()=>import("./katex-DnlPpQZa.js"),[]);try{yield es(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Ov(t)})}function PH(e){const t=Promise.resolve(e).then(n=>{var i;return sh===t&&n?(Hr=(i=Ov(n))!=null?i:n,Hr):null}).catch(()=>null).finally(()=>{sh===t&&(sh=null)});return sh=t,oh=!0,t}function c2e(e){t4=e,Hr=null,oh=!1,sh=null}function d2e(e){c2e($7)}function zH(){return typeof t4=="function"}function ekt(){var e;const t=t4;if(!t||t===$7)return null;if(Hr)return Hr;const n=O7();if(n)return Hr=n,Hr;if(oh)return null;try{const i=t();return i?typeof i?.then=="function"?(PH(i),null):(Hr=(e=Ov(i))!=null?e:i,Hr):null}catch{return null}}function jH(){return e4(this,null,function*(){var e;const t=O7();if(t)return Hr=t,Hr;if(Hr)return Hr;if(sh)return sh;if(oh)return null;const n=t4;if(!n)return oh=!0,null;try{const i=n();if(typeof i?.then=="function")return PH(i);if(i)return Hr=(e=Ov(i))!=null?e:i,oh=!0,Hr}catch{}return oh=!0,null})}function HH(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Jy=null,zf=null;const zr=new Map,pc=new Map;let Q0=5;const bh=new Set;function l0(){if(zr.size{const{id:n,html:i,error:o}=t.data,s=zr.get(n);if(s)if(zr.delete(n),clearTimeout(s.timeoutId),s.cleanup(),l0(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(pc.set(a,i),pc.size>200){const u=pc.keys().next().value;pc.delete(u)}}s.aborted||s.resolve(i)}},Jy.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of zr.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));zr.clear(),f2e()}}function p2e(e,t=!0,n=2e3,i){return e4(this,null,function*(){performance.now();const o=HH(e);if(!zH()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(zf)return Promise.reject(zf);const s=`${t?"d":"i"}:${o}`,r=pc.get(s);if(r)return l0(),Promise.resolve(r);const l=Jy||(zf=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),zf.name="WorkerInitError",zf.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(zf);if(zr.size>=Q0){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=zr.size,a.max=Q0,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=zr.get(c);if(!g)return;zr.delete(c),g.cleanup();const v=new Error("Worker render timed out");v.name="WorkerTimeout",v.code="WORKER_TIMEOUT",g.aborted||g.reject(v),l0()},n);d=()=>{const g=zr.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const v=new Error("Aborted");v.name="AbortError",u(v)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;zr.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const v=zr.get(c);zr.delete(c),clearTimeout(f),v?.cleanup(),v?.reject(g),l0()}})})}function tkt(e,t=!0,n){const i=`${t?"d":"i"}:${HH(e)}`;if(pc.set(i,n),pc.size>200){const o=pc.keys().next().value;pc.delete(o)}}const m2e="WORKER_BUSY";function g2e(e=2e3,t){return zr.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),bh.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},bh.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>l0()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const eg={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function nkt(e){return e4(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!zH()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:eg.timeout,u=(s=i.waitTimeout)!=null?s:eg.waitTimeout,c=(r=i.backoffMs)!=null?r:eg.backoffMs,d=(l=i.maxRetries)!=null?l:eg.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):eg.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield p2e(t,n,a,h)}catch(g){if(g?.code!==m2e||m>=f)throw g;if(m++,yield g2e(u,h).catch(()=>{}),h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}c>0&&(yield new Promise(v=>globalThis.setTimeout(v,c*m)))}}})}function Yp(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function v2e(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function gk(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=v2e(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function vk(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function WH(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function yk(e,t=360,n=500){return WH(e,t,n)}function kk(e,t=360,n=500){return WH(e,t,n)}var y2e=Object.defineProperty,k2e=Object.defineProperties,b2e=Object.getOwnPropertyDescriptors,FL=Object.getOwnPropertySymbols,w2e=Object.prototype.hasOwnProperty,C2e=Object.prototype.propertyIsEnumerable,BL=(e,t,n)=>t in e?y2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qH=(e,t)=>{for(var n in t||(t={}))w2e.call(t,n)&&BL(e,n,t[n]);if(FL)for(var n of FL(t))C2e.call(t,n)&&BL(e,n,t[n]);return e},RL=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const bk=()=>es(()=>import("./mermaid.core-D1bi95DL.js").then(e=>e.bp),__vite__mapDeps([2,3]));let ec=null,Jp=bk,Sg=null,BC=!1,RC=!1,_g=0;function A2e(e){Jp=e,_g++,ec=null,Sg=null,BC=!1,RC=!1}function x2e(e){A2e(bk)}function OL(){return typeof Jp=="function"}function $L(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=qH({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},k2e(n,b2e(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function PL(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=qH({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function ikt(){return RL(this,null,function*(){if(ec)return ec;const e=(function(){try{const i=globalThis;return $L(i?.mermaid)}catch{return null}})();if(e)return ec=e,PL(ec),ec;const t=Jp,n=_g;return t?t===bk&&BC?null:Sg||(Sg=RL(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===bk)return n===_g&&t===Jp&&(BC=!0,(function(s){RC||(RC=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===_g&&t===Jp&&(Sg=null)}return n!==_g||t!==Jp?null:i?(ec=$L(i),PL(ec),ec):null}),Sg):null})}let pu=null,jf=null;const Ra=new Map,Hf=new Map;function T8(e){for(const t of Ra.values())t.reject(e);Ra.clear(),Hf.clear()}let zL=5,jL=!1;const S2e="WORKER_BUSY",HL="MERMAID_DISABLED";function _2e(e){if(pu&&pu!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",T8(n)}pu=e,jf=null;const t=e;pu.onmessage=n=>{if(pu!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=Ra.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},pu.onerror=n=>{var i,o;if(pu===t)if(Ra.size!==0){try{jL?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}T8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},pu.onmessageerror=n=>{var i,o;if(pu===t)if(Ra.size!==0){try{jL?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}T8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function UH(e,t,n,i){if(!OL()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=HL,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=Hf.get(o);return s||(s=(function(r,l,a=1400){if(!OL()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=HL,Promise.reject(c)}if(jf)return Promise.reject(jf);const u=pu||(jf=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),jf.name="WorkerInitError",jf.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(jf);if(Ra.size>=zL){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=S2e,c.inFlight=Ra.size,c.max=zL,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Ra.delete(f))},v={resolve:y=>{g(),c(y)},reject:y=>{g(),d(y)}};Ra.set(f,v);try{u.postMessage({id:f,action:r,payload:l})}catch(y){return Ra.delete(f),void d(y)}h=globalThis.setTimeout(()=>{const y=new Error("Worker call timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT";const b=Ra.get(f);b&&b.reject(y)},a)})})(e,t,n),Hf.set(o,s),s.then(()=>{Hf.get(o)===s&&Hf.delete(o)},()=>{Hf.get(o)===s&&Hf.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function okt(e,t,n=1400,i){return UH("canParse",{code:e,theme:t},n,i)}function skt(e,t,n=1400,i){return UH("findPrefix",{code:e,theme:t},n,i)}var M2e=Object.defineProperty,I2e=Object.defineProperties,T2e=Object.getOwnPropertyDescriptors,WL=Object.getOwnPropertySymbols,E2e=Object.prototype.hasOwnProperty,L2e=Object.prototype.propertyIsEnumerable,qL=(e,t,n)=>t in e?M2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ot=(e,t)=>{for(var n in t||(t={}))E2e.call(t,n)&&qL(e,n,t[n]);if(WL)for(var n of WL(t))L2e.call(t,n)&&qL(e,n,t[n]);return e},On=(e,t)=>I2e(e,T2e(t)),ao=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const N2e="__global__",E8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",OC=(()=>{const e=globalThis;if(e[E8])return e[E8];const t={scopedCustomComponents:{},revision:Ya(0)};return e[E8]=t,t})(),UL=OC.revision,D2e=Symbol("markstreamCustomComponents"),F2e=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function $v(e){return F2e.has(String(e).trim().toLowerCase())}function B2e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function L8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([Ca(n),Ca(B2e(n))]))!o||$v(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function xs(e){const t=tn(D2e,null);return D(()=>{var n;return UL.value,(function(i,o={}){return UL.value,Ot(Ot(Ot({},L8(OC.scopedCustomComponents[N2e]||{})),L8(o)),L8((function(s){return s&&OC.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const R2e=["aria-label"],O2e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},$2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},$i=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},zl=$i(ct({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),L("svg",$2e,[...n[1]||(n[1]=[S("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),S("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),L("svg",O2e,[...n[0]||(n[0]=[S("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,R2e))}),[["__scopeId","data-v-be21ab83"]]);zl.install=e=>{e.component(zl.__name,zl)};const P2e={class:"emoji-node"},pl=$i(ct({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",P2e,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);pl.install=e=>{e.component(pl.__name,pl)};const z2e=["id"],j2e=["title"],jl=$i(ct({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),L("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[S("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,j2e)],8,z2e))}}),[["__scopeId","data-v-c1463a29"]]);jl.install=e=>{e.component(jl.__name,jl)};const VH=(()=>{try{return!1}catch{}return!1})();function N8(e){VH&&console.warn(e)}function VL(e,t="safe",n){return B7(e,t,n)}function KH(e){return bve(e)}function D8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function P7(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=Yy((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),D8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),D8(r.value)]):Object.entries(o).map(([r,l])=>[r,D8(l)]):null,t,n);var o;if(!i)return;const s=KH(r0(i));return Object.keys(s).length>0?s:void 0}function KL(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function tg(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function F8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return LH(d,f)})(e,i);if(Dv.has(e.toLowerCase())||!l&&MH(e,s))return null;if(!l&&F7(e,s))return r?[KL(e,t,!0)]:[KL(e,t),...n,``];const a=B7(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=KH(a);return Fn(d,On(Ot({},f),{key:c}),n.length>0?n:void 0)}return Fn(e,On(Ot({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function ZH(e,t){return Ave(e,t)}function wk(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=F8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);tg(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=F8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?tg(u[u.length-1].children,g):tg(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&N8(`Auto-closing unclosed tag: <${m.tagName}>`)}else N8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=F8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?tg(u[u.length-1].children,f):tg(c,f),N8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(NH(e),t,n)}catch(o){return i=o,VH&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const H2e=["innerHTML"],Hl=$i(ct({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=tn("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=xs(()=>t.customId),s=ct({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:k1(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=wk(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!ZH(l,o.value))return{mode:"html",content:k1(l,i.value)};const a=wk(l,o.value,i.value);return a===null?{mode:"html",content:k1(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),L("span",{key:0,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[V(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),L("span",{key:1,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(k(),L("span",{key:2,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,H2e))}}),[["__scopeId","data-v-d17f12b0"]]);Hl.install=e=>{e.component(Hl.__name,Hl)};const W2e={class:"inline-code"},q2e={key:0},Mr=$i(ct({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=sm(),i=tn("markstreamFade",void 0),o=tn("markstreamTextStreamState",void 0),s=tn("markstreamStreamVersion",void 0),r=D(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=D(()=>!l.value),c=D(()=>{var b;const C=(b=n["index-key"])!=null?b:n.indexKey;return C==null||C===""?"":String(C)}),d=U(t.node.code),f=U(""),h=U(0);let m;function g(){m?.(),m=void 0}function v(){g(),f.value&&(d.value=d.value+f.value,f.value="")}qe([()=>t.node.code,c,l],([b])=>{const C=String(b??""),A=c.value,T=RH({nextContent:C,persistedContent:A?o?.get(A):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=T.settledContent,f.value=T.streamedDelta,T.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const N=s.value;m=qe(()=>s.value,_=>{_!==N&&v()},{flush:"sync"})})()):f.value||g(),A&&o?.set(A,C)},{immediate:!0}),Jd(g);const y=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,C)=>(k(),L("code",W2e,[u.value?(k(),L(Be,{key:0},[Pe(B(a.value),1)],64)):(k(),L(Be,{key:1},[d.value?(k(),L("span",q2e,B(d.value),1)):ee("",!0),f.value?(k(),L("span",{key:1,class:$e(["inline-code-stream-delta",[y.value]]),onAnimationend:v},B(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Mr.install=e=>{e.component(Mr.__name,Mr)};const $C=U(!1),ZL=U(""),GL=U("top"),a0=U(null),u0=U(null),PC=U(null),zC=U(null),QL=U(null);let Xy=null,e9=null,jC=0;function GH(){Xy&&(clearTimeout(Xy),Xy=null),e9&&(clearTimeout(e9),e9=null)}let X2=!1,ey=null,YL=!1;function U2e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++jC;GH();const l=()=>ao(null,null,function*(){var a,u;if(yield(function(){return ao(this,null,function*(){if(!X2&&!YL&&typeof document<"u"){ey!=null||(ey=ao(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([es(()=>import("./vue.runtime.esm-bundler-g_Y84vG0.js"),[]),es(()=>import("./Tooltip-B_XKKsoo.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:$C.value,"anchor-el":a0.value,content:ZL.value,placement:GL.value,id:u0.value,originX:PC.value,originY:zC.value,isDark:(m=QL.value)!=null?m:void 0})}}).mount(h),X2=!0}));try{yield ey}catch(c){X2=!1,ey=null,YL=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),X2&&r===jC){u0.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,a0.value=e,ZL.value=t,GL.value=n,PC.value=(a=o?.x)!=null?a:null,zC.value=(u=o?.y)!=null?u:null,QL.value=typeof s=="boolean"?s:null,$C.value=!0;try{e.setAttribute("aria-describedby",u0.value)}catch{}}});i?l():Xy=setTimeout(l,80)}function V2e(e=!1){jC+=1,GH();const t=()=>{if(a0.value&&u0.value)try{a0.value.removeAttribute("aria-describedby")}catch{}$C.value=!1,a0.value=null,u0.value=null,PC.value=null,zC.value=null};e?t():e9=setTimeout(t,120)}const K2e={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Z2e=Symbol("markstreamI18nFallback");function QH(e,t){var n;return(n=t?.[e])!=null?n:K2e[e]}const HC=(e,t)=>{var n;return(n=QH(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function JL(e,t){return{t(n){const i=QH(n,t);if(e.te&&i!=null&&!e.te(n))return HC(n,t);const o=e.t(n);return o===n&&i!=null?HC(n,t):o}}}function G2e(){const e=(function(){var n,i,o;try{const s=As(),r=Z2e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=As(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return JL(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return JL({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>HC(n,e)}}const YH=Symbol("ViewportPriority"),JH=Symbol("ViewportPriorityOptions"),XH=Symbol("OffscreenHeavyNodeDeferral"),Q2e=D(()=>!1),Fh="400px";function z7(){return tn(JH,void 0)}function j7(){return tn(XH,Q2e)}function Y2e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?U(t):t,r=o?(n=window.requestIdleCallback)!=null?n:_=>window.setTimeout(()=>_({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:_=>window.clearTimeout(_):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(_){if(!_)return"viewport";let w=a.get(_);return w||(w=u++,a.set(_,w)),String(w)}function v(){if(h!=null){try{l?.(h)}catch{}h=null}}function y(_){if(_){const w=c.get(_);if(w&&!w.targets.size){try{w.io.disconnect()}catch{}c.delete(_)}}d.size||f.size||v()}function b(_){const w=d.get(_);if(!w)return;const M=c.get(w.bucketKey);if(!w.visible.value){w.visible.value=!0;try{w.resolve()}catch{}}try{M?.io.unobserve(_)}catch{}M?.targets.delete(_),d.delete(_),f.delete(_),y(w.bucketKey)}function C(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const _=f.values().next().value;_&&(f.delete(_),b(_),f.size&&C())},{timeout:1200}))}function A(_,w){if(!o||typeof IntersectionObserver>"u")return null;const M=(function(P,O){var R,z,H;return{root:(R=e?.(P??null))!=null?R:null,rootMargin:(z=O?.rootMargin)!=null?z:Fh,threshold:(H=O?.threshold)!=null?H:0}})(_,w),x=[g((E=M).root),E.rootMargin,E.threshold].join("\0");var E;const I=c.get(x);if(I)return{key:x,bucket:I};let F;try{F=new IntersectionObserver(P=>{for(const O of P)(O.isIntersecting||O.intersectionRatio>0)&&b(O.target)},{root:M.root,rootMargin:M.rootMargin,threshold:M.threshold})}catch{return null}const W={io:F,targets:new Map};return c.set(x,W),{key:x,bucket:W}}function T(){if(o&&s.value)for(const[_,w]of Array.from(d.entries())){const M=A(_,w.opts);if(!M){b(_);continue}if(M.key===w.bucketKey)continue;const x=w.bucketKey,E=c.get(x);try{E?.io.unobserve(_)}catch{}E?.targets.delete(_),w.bucketKey=M.key,M.bucket.targets.set(_,w),M.bucket.io.observe(_),y(x)}}qe(s,_=>{if(!_){for(const w of Array.from(d.keys()))b(w);v()}},{flush:"sync"});const N=(_,w)=>{const M=U(!1);let x,E=!1;const I=new Promise(O=>{x=()=>{E||(E=!0,O())}}),F=()=>{const O=d.get(_);if(!O)return f.delete(_),void y();const R=c.get(O.bucketKey);try{R?.io.unobserve(_)}catch{}R?.targets.delete(_),d.delete(_),f.delete(_),y(O.bucketKey)};if(!o||!s.value)return M.value=!0,x(),{isVisible:M,whenVisible:I,destroy:F};const W=A(_,w);if(!W)return M.value=!0,x(),{isVisible:M,whenVisible:I,destroy:F};const P={resolve:x,visible:M,bucketKey:W.key,opts:w};return d.set(_,P),W.bucket.targets.set(_,P),W.bucket.io.observe(_),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,T()})),w?.allowIdle!==!1&&(f.add(_),C()),{isVisible:M,whenVisible:I,destroy:F}};return N.refresh=T,ri(YH,N),N}function H7(){var e,t;const n=tn(YH,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=U(!1);let v,y=!1;const b=new Promise(T=>{v=()=>{y||(y=!0,T())}}),C=()=>{const T=i.get(h);if(!T)return s.delete(h),void(s.size||u());const N=o.get(T.bucketKey);try{N?.io.unobserve(h)}catch{}i.delete(h),N?.targets.delete(h),s.delete(h),c(T.bucketKey),s.size||u()},A=(T=>{var N,_;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const w=(F=>{var W,P;return[(W=F?.rootMargin)!=null?W:Fh,(P=F?.threshold)!=null?P:0].join("\0")})(T),M=o.get(w);if(M)return{key:w,bucket:M};const x=(N=T?.rootMargin)!=null?N:Fh;let E;try{E=new IntersectionObserver(F=>{for(const W of F)(W.isIntersecting||W.intersectionRatio>0)&&d(W.target)},{root:null,rootMargin:x,threshold:(_=T?.threshold)!=null?_:0})}catch{return null}const I={io:E,targets:new Set};return o.set(w,I),{key:w,bucket:I}})(m);return A?(i.set(h,{resolve:v,visible:g,bucketKey:A.key}),A.bucket.targets.add(h),A.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:b,destroy:C}):(g.value=!0,v(),{isVisible:g,whenVisible:b,destroy:C})}}function J2e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const X2e=["data-markstream-viewport-pending"],eye=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],tye={key:1,class:"image-placeholder"},nye={key:1,class:"image-node__raw-text"},iye={key:2,class:"image-shimmer-overlay"},oye={key:1,class:"image-node__raw-text"},sye={key:3,class:"image-error"},Md=$i(ct({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=U(!1),a=U(!1),u=U(""),c=U("primary"),d=U(null),f=sm(),h=tn(DC,null),m=H7(),g=z7(),v=j7(),y=D(()=>bE(s.node.src)),b=D(()=>bE(s.fallbackSrc)),C=(o=(i=(n=As())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),A=typeof window<"u"&&C?.getAttribute("src")===(y.value||b.value),T=U(typeof window>"u"||A||!v.value),N=Ya(null);let _="",w=null;const M=D(()=>u.value),x=D(()=>!s.lazy),E=D(()=>typeof window<"u"&&v.value&&!A),I=D(()=>!E.value||T.value),F=D(()=>I.value?M.value:""),W=D(()=>{var Ae,me;return(me=(Ae=g?.value.heavyBlockMargin)!=null?Ae:g?.value.rootMargin)!=null?me:Fh}),P=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),O=D(()=>c.value==="failed"),R=D(()=>(!x.value||E.value&&!T.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),z=D(()=>J2e(s,f));function H(Ae=z.value){Ae&&d.value&&h?.reportHeight(Ae,d.value.offsetHeight)}function j(Ae=z.value){Ae&&vt(()=>{H(Ae)})}function K(){w&&(clearTimeout(w),w=null)}function re(){const Ae=z.value;Ae&&_!==Ae&&(_&&h?.markSettled(_),K(),_=Ae,h?.markPending(Ae),typeof window<"u"&&(w=window.setTimeout(()=>{_===Ae&&(j(Ae),q())},8e3)))}function q(){return ao(this,null,function*(){const Ae=_;Ae&&(K(),_="",yield vt(),H(Ae),h?.markSettled(Ae))})}function Q(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void j();c.value="failed",a.value=!0,r("error",u.value),j()}function ne(){l.value=!0,a.value=!1,r("load",M.value),j()}function te(Ae){Ae.preventDefault(),l.value&&!a.value&&r("click",[Ae,M.value])}const{t:ge}=G2e();return qe([y,b,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||y.value?(u.value=y.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&qe([d,E],([Ae,me],de,Y)=>{var ue;if((ue=N.value)==null||ue.destroy(),N.value=null,!me||T.value)return void(T.value=!0);if(!Ae)return void(T.value=!1);let Z=!0;const se=m(Ae,{rootMargin:W.value,allowIdle:!1});N.value=se,T.value=se.isVisible.value,se.whenVisible.then(()=>{Z&&N.value===se&&(T.value=!0)}),Y(()=>{Z=!1,se.destroy(),N.value===se&&(N.value=null)})},{immediate:!0}),qe([P,l,a,M,()=>s.lazy,I],([Ae,me,de,Y,ue,Z])=>Ae&&Y&&!de&&Z?me?(q(),void j()):ue?(re(),void j()):void(me||de||re()):(q(),void j()),{flush:"post",immediate:!0}),si(()=>{var Ae;(Ae=N.value)==null||Ae.destroy(),N.value=null,(function(){const me=_;me&&(K(),_="",h?.markSettled(me))})()}),(Ae,me)=>{var de,Y,ue,Z,se;return k(),L("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":E.value&&!T.value?"true":void 0},[P.value?(k(),L("img",{key:0,src:F.value||void 0,alt:String((Y=(de=s.node.alt)!=null?de:s.node.title)!=null?Y:""),title:String((Z=(ue=s.node.title)!=null?ue:s.node.alt)!=null?Z:""),class:$e(["image-node__img",{"is-loading":!x.value&&!l.value,"is-loaded":x.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:x.value?"high":void 0,decoding:x.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(se=s.node.alt)!=null?se:p(ge)("image.preview"),onError:Q,onLoad:ne,onClick:te},null,42,eye)):ee("",!0),e.node.loading&&!a.value?(k(),L("span",tye,[s.usePlaceholder?Yn(Ae.$slots,"placeholder",{key:0,node:s.node,displaySrc:M.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[me[0]||(me[0]=S("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",nye,B(e.node.raw),1))])):ee("",!0),R.value&&!e.node.loading?(k(),L("span",iye,[s.usePlaceholder?Yn(Ae.$slots,"placeholder",{key:0,node:s.node,displaySrc:M.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[me[1]||(me[1]=S("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",oye,B(e.node.raw),1))])):ee("",!0),O.value?(k(),L("span",sye,[Yn(Ae.$slots,"error",{node:s.node,displaySrc:M.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[me[2]||(me[2]=S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[S("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),S("span",null,B(p(ge)("image.loadError")),1)],!0)])):ee("",!0)],8,X2e)}}}),[["__scopeId","data-v-046e82ac"]]);Md.install=e=>{e.component(Md.__name,Md)};const rye={key:2},qu=ct({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=xs(()=>t.customId),i=tn("markstreamHtmlPolicy",void 0),o=tn("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const v=(m=o?.value)!=null?m:{};return On(Ot({},v),{customId:(g=t.customId)!=null?g:v.customId,htmlPolicy:s.value})}),l=_u({loader:()=>Promise.resolve().then(()=>X7),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!$v(String(t.node.type)))),c=D(()=>u.value?P7(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(k(),ce(jo(a.value),fi({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ae(()=>[d.value?(k(),ce(p(l),fi({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),ce(p(l),fi({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),ce(jo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),L("span",rye,B(h.value),1)):ee("",!0)}}),XL=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function lye(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return On(Ot(Ot({},XL),n),{enabled:(t=n.enabled)==null||t})}return Ot({},XL)}function W7(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function eW(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function eN(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function aye(e){var t;return e.diff===!0||eN(e.language)||eN(eW(String((t=e.raw)!=null?t:"")))}function uye(e,t,n){const i=(function(o){const s=eW(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const cye=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],dye={key:0,translate:"no",class:"markstream-pre__diff-code"},fye={class:"markstream-pre__diff-pane-content"},hye={class:"markstream-pre__diff-number","aria-hidden":"true"},pye={class:"markstream-pre__diff-content"},mye={class:"markstream-pre__diff-content-inner"},gye={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},vye=["textContent"],yye=["textContent"],al=ct({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(te,ge){const Ae=String(te??"");return ge?Ae:Ae.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var te,ge,Ae;const me=String((ge=(te=t.node)==null?void 0:te.language)!=null?ge:"");return String((Ae=String(me).split(/\s+/g)[0])!=null?Ae:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var te;return t.loading===!0||((te=t.node)==null?void 0:te.loading)===!0}),r=D(()=>{var te;return n((te=t.node)==null?void 0:te.code,s.value)});let l="",a=1;const u=D(()=>(function(te){let ge=0,Ae=1;te.startsWith(l)&&(ge=l.length,Ae=a,ge>0&&te[ge-1]==="\r"&&te[ge]===` +`&&ge++);for(let me=ge;mer.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const te=u.value;te{var te;return t.showLineNumbers===!0&&((te=t.node)==null?void 0:te.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),v=D(()=>{const te=Number(t.reservedHeightPx);if(!Number.isFinite(te)||te<=0)return;const ge=`${Math.ceil(te)}px`;return s.value?{maxHeight:ge,overflow:"auto"}:{height:ge,minHeight:ge,maxHeight:ge,overflow:"auto"}}),y=["diff ","index ","--- ","+++ ","@@ "];function b(te){return String(te??"").trim().length===0}function C(te,ge="context",Ae={}){const me=b(te);return{code:te,kind:me&&ge!=="hunk"&&ge!=="spacer"&&!Ae.preserveBlankKind?"context":ge,empty:me}}function A(te){const ge=n(te,s.value);return ge?ge.split(/\r\n|\n|\r/):[]}function T(te,ge){return!b(te[ge])||gey.some(Ae=>ge.startsWith(Ae)))}function M(te,ge){return ge||!te.startsWith(" ")||te.startsWith(" ")?te:` ${te}`}function x(te,ge){const Ae=te.length,me=ge.length,de=[];let Y=0;for(;Y=Y&&se>=Y&&te[Z]===ge[se];)ue.unshift({originalIndex:Z,modifiedIndex:se}),Z--,se--;const ke=Z-Y+1,be=se-Y+1;if(ke<=0||be<=0||s.value||(ke+1)*(be+1)>15e5)return de.concat(ue);const we=be+1,oe=new Uint32Array((ke+1)*(be+1));for(let Ce=ke-1;Ce>=0;Ce--)for(let le=be-1;le>=0;le--){const ie=Ce*we+le;if(te[Y+Ce]===ge[Y+le])oe[ie]=oe[(Ce+1)*we+le+1]+1;else{const Ee=oe[(Ce+1)*we+le],Ke=oe[Ce*we+le+1];oe[ie]=Ee>=Ke?Ee:Ke}}const J=[];let fe=0,ve=0;for(;fe=oe[fe*we+ve+1]?fe++:ve++;return de.concat(J,ue)}function E(te){var ge;const Ae=(function(){var se,ke;const be=t.diffHideUnchangedRegions;if(be==null||be===!1)return null;const we=be===!0?{}:be;return we.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((se=we.contextLineCount)!=null?se:2)),minimumLineCount:Math.max(1,Math.floor((ke=we.minimumLineCount)!=null?ke:4))}})();if(!Ae||te.length<1||te.length>2||te.length===2&&te[0].lines.length!==te[1].lines.length)return te;const me=te[0].lines,de=(ge=te[1])==null?void 0:ge.lines,Y=se=>me[se].kind==="context"&&(de===void 0||de[se].kind==="context"&&me[se].code===de[se].code),ue=[];let Z=0;for(;Z=Ae.minimumLineCount){const be=se+(se===0?0:Ae.contextLineCount),we=ke-(ke===me.length?0:Ae.contextLineCount);we-be>=Ae.minimumLineCount&&ue.push({start:be,end:we})}Z===se&&Z++}return ue.length?te.map((se,ke)=>{const be=[];let we=0;for(const oe of ue)be.push(...se.lines.slice(we,oe.start)),be.push({code:ke===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${se.key}-collapsed-${oe.start}-${oe.end}`,number:""}),we=oe.end;return be.push(...se.lines.slice(we)),On(Ot({},se),{lines:be})}):te}const I=D(()=>{var te,ge,Ae,me;if(!m.value)return[];const de=(function(ke){const be=ke.some(oe=>N(oe)),we=ke.some(oe=>_(oe));return be&&we||(function(){var oe,J,fe,ve;if(i.value==="diff")return!0;const Ce=(ve=(fe=String((J=(oe=t.node)==null?void 0:oe.raw)!=null?J:"").split(/\r?\n/,1)[0])==null?void 0:fe.trim())!=null?ve:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(be||we)})(c.value),Y=(function(){var ke,be;return((ke=t.node)==null?void 0:ke.originalCode)!=null||((be=t.node)==null?void 0:be.updatedCode)!=null})();if(g.value){const ke=Y?(function(be,we){const oe=A(be),J=A(we),fe=x(oe,J);if(fe.length>0){const Ke=[];let Ue=0,at=0;for(const bt of fe){for(;Ue=Ce&&ie>=Ce&&oe[le]===J[ie];)Ee.unshift(On(Ot({},C(J[ie])),{key:`inline-suffix-${ie}`,number:ie+1})),le--,ie--;for(let Ke=Ce;Ke<=le;Ke++)ve.push(On(Ot({},C(oe[Ke],"removed",{preserveBlankKind:T(oe,Ke)})),{key:`inline-removed-source-${Ke}`,number:Ke+1}));for(let Ke=Ce;Ke<=ie;Ke++)ve.push(On(Ot({},C(J[Ke],"added",{preserveBlankKind:T(J,Ke)})),{key:`inline-added-source-${Ke}`,number:Ke+1}));return ve.concat(Ee)})((te=t.node)==null?void 0:te.originalCode,(ge=t.node)==null?void 0:ge.updatedCode):(function(be){const we=[];let oe=1,J=1;const fe=w(be);for(const[ve,Ce]of be.entries())if(Ce.startsWith("@@")){const le=Ce.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);le&&(oe=Number(le[1]),J=Number(le[2])),we.push(On(Ot({},C(Ce,"hunk")),{key:`inline-hunk-${ve}`,number:""}))}else if(N(Ce))we.push(On(Ot({},C(M(Ce.slice(1),fe),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ve}`,number:oe++}));else if(_(Ce))we.push(On(Ot({},C(M(Ce.slice(1),fe),"added",{preserveBlankKind:!0})),{key:`inline-added-${ve}`,number:J++}));else{const le=fe&&Ce.startsWith(" ")?Ce.slice(1):Ce;we.push(On(Ot({},C(le)),{key:`inline-context-${ve}`,number:J})),oe++,J++}return we})(c.value);return E([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:ke}])}if(!de&&Y)return(function(ke,be){const we=A(ke),oe=A(be),J=x(we,oe),fe=[],ve=[];let Ce=0,le=0,ie=0;const Ee=(Ke,Ue)=>{const at=Math.max(Ke-Ce,Ue-le);for(let bt=0;btOn(Ot({},ke),{key:`original-${be}`,number:be+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((ke,be)=>On(Ot({},ke),{key:`modified-${be}`,number:be+1}))}])}),F=D(()=>{var te,ge;if(t.showLineNumbers!==!0)return;let Ae=m.value?1:u.value;if(m.value){Ae=Math.max(Ae,A((te=t.node)==null?void 0:te.originalCode).length,A((ge=t.node)==null?void 0:ge.updatedCode).length);for(const de of I.value)for(const Y of de.lines)typeof Y.number=="number"&&(Ae=Math.max(Ae,Y.number))}const me=`${Math.max(2,String(Ae).length)}ch`;return{"--markstream-pre-line-number-width":me,"--markstream-pre-diff-line-number-width":me,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),W=D(()=>I.value.some(te=>te.lines.some(ge=>ge.kind==="collapsed"))),P=D(()=>{const te=i.value;return te?`Code block: ${te}`:"Code block"}),O=U(null),R=U([]);let z=null,H=!1,j=null;function K(te){const ge=Number.parseFloat(String(te??""));return Number.isFinite(ge)&&ge>0?ge:0}function re(te,ge){var Ae;if(!te)return ge;if(te.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const me=te.querySelector(".markstream-pre__diff-content"),de=me?.getBoundingClientRect(),Y=(Ae=de?.height)!=null?Ae:0;return Math.max(ge,Math.ceil(Y))}function q(){H||typeof window>"u"||(z!=null&&window.cancelAnimationFrame(z),z=window.requestAnimationFrame(()=>{z=null,H||(function(){var te,ge;z=null;const Ae=O.value;if(!Ae||!m.value||g.value||!Ae.classList.contains("is-wrap"))return void(R.value.length&&(R.value=[]));const me=(function(be){const we=window.getComputedStyle(be),oe=K(we.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const J=K(we.lineHeight);return J>0?J:18})(Ae),de=Array.from(Ae.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),Y=Array.from(Ae.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),ue=Math.max(de.length,Y.length),Z=[];for(let be=0;be{const oe=ke[we];return oe&&Math.abs(be.rowHeight-oe.rowHeight)<=.5&&Math.abs(be.originalHeight-oe.originalHeight)<=.5&&Math.abs(be.modifiedHeight-oe.modifiedHeight)<=.5})||(R.value=Z)})()}))}function Q(te){j?.disconnect(),j=null,te&&m.value&&!g.value&&typeof ResizeObserver<"u"&&(j=new ResizeObserver(()=>{q()}),j.observe(te))}function ne(te,ge){const Ae=R.value[te];if(!Ae)return;const me=ge==="original"?Ae.originalHeight:Ae.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Ae.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(me)}px`}}return qe(O,te=>{Q(te),vt(()=>q())},{flush:"post"}),qe([m,g,I],()=>{Q(O.value),vt(()=>q())},{flush:"post",immediate:!0}),si(()=>{H=!0,z!=null&&(window.cancelAnimationFrame(z),z=null),j?.disconnect(),j=null}),(te,ge)=>(k(),L("pre",{ref_key:"preRef",ref:O,style:sn([v.value,F.value]),class:$e([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":W.value}]),"aria-busy":s.value,"aria-label":P.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),L("code",dye,[(k(!0),L(Be,null,xt(I.value,Ae=>(k(),L("span",{key:Ae.key,class:$e(["markstream-pre__diff-pane",Ae.className])},[S("span",fye,[(k(!0),L(Be,null,xt(Ae.lines,(me,de)=>(k(),L("span",{key:me.key,class:$e(["markstream-pre__diff-line",[`markstream-pre__diff-line--${me.kind}`,{"markstream-pre__diff-line--empty":me.empty}]]),style:sn(ne(de,Ae.key))},[ge[0]||(ge[0]=S("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),S("span",hye,B(me.number),1),S("span",pye,[S("span",mye,B(me.code),1)])],6))),128))])],2))),128))])):(k(),L(Be,{key:1},[t.showLineNumbers?(k(),L("span",gye,[S("span",{class:"markstream-pre__line-numbers-text",textContent:B(h.value)},null,8,vye)])):ee("",!0),S("code",{translate:"no",class:"markstream-pre__code",textContent:B(r.value)},null,8,yye)],64))],14,cye))}});al.install=e=>{e.component(al.__name,al)};const Uo=$i(ct({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=sm(),i=tn("markstreamFade",void 0),o=tn("markstreamTextStreamState",void 0),s=tn("markstreamStreamVersion",void 0),r=D(()=>{const T=n.fade;return T===""||T===!0||T==="true"||T!==!1&&T!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var T;const N=(T=n["index-key"])!=null?T:n.indexKey;return N==null||N===""?"":String(N)}),u=U(t.node.content),c=U(""),d=U(0),f=U(t.node.content);let h;const m=U(null),g=U(null);let v="",y=null;function b(){h?.(),h=void 0}function C(){b(),c.value&&(u.value=u.value+c.value,c.value="")}qe([u,m,g],function(){var T,N;const _=m.value;if(!_)return;const w=String((T=u.value)!=null?T:""),M=g.value;return y||(y=_.firstChild,v=(N=y?.data)!=null?N:""),w.startsWith(v)?!y&&w?(_.textContent=w,y=_.firstChild,void(v=w)):void(w.length>v.length&&M&&(M.appendChild(document.createTextNode(w.slice(v.length))),v=w)):(_.textContent=w,y=_.firstChild,M&&(M.textContent=""),void(v=w))},{immediate:!0}),qe([()=>t.node.content,a,l],([T])=>{const N=String(T??""),_=a.value,w=RH({nextContent:N,persistedContent:_?o?.get(_):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=w.settledContent,c.value=w.streamedDelta,w.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const M=s.value;h=qe(()=>s.value,x=>{x!==M&&C()},{flush:"sync"})})()):c.value||b(),_&&o?.set(_,N)},{immediate:!0}),Jd(b);const A=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(T,N)=>(k(),L("span",{class:$e([[e.node.center?"text-node-center":""],"text-node"])},[hi(S("span",{ref_key:"settledTextEl",ref:m},B(f.value),513),[[Jo,u.value!==""]]),hi(S("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Jo,u.value!==""]]),c.value?(k(),L("span",{key:0,class:$e(["text-node-stream-delta",[A.value]]),onAnimationend:C},B(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function Mg(e,t,n){return ct({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=H7(),u=z7(),c=j7(),d=typeof window<"u"&&((l=(r=As())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=U(typeof window>"u"||d||!c.value),h=Ya(null);let m=null;function g(v){const y=v&&"$el"in v?v.$el:v;h.value=y instanceof HTMLElement?y:null}return typeof window<"u"&&qe([h,c],([v,y],b,C)=>{if(m?.destroy(),m=null,!y||f.value)return void(f.value=!0);if(!v)return;let A=!0;const T=a(v,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=T,f.value=T.isVisible.value,T.whenVisible.then(()=>{A&&m===T&&(f.value=!0)}),C(()=>{A=!1,T.destroy(),m===T&&(m=null)})},{immediate:!0}),si(()=>{m?.destroy(),m=null}),()=>Fn(f.value?t:n,On(Ot({},o),{ref:g}),s)}})}Uo.install=e=>{e.component(Uo.__name,Uo)};const Ck=ct({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=Xb(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=DL[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):DL[""]),f=aye(n.node),h=uye(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:W7(m??{},typeof window>"u"?0:window.innerWidth)),v=m?.diffAppearance,y=v==="dark"||v!=="light"&&n.isDark===!0,b=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,C=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),A=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,T=f?0:8,N=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:T,_=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:T,w=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",M=Ot(Ot({fontSize:`${b}px`,lineHeight:`${C}px`,tabSize:A,paddingTop:`${N}px`,paddingBottom:`${_}px`,"--markstream-pre-line-number-top":`${N}px`},f?{"--markstream-pre-diff-line-height":`${C}px`}:{}),w?{"--markstream-code-font-family":w}:{}),x=()=>Fn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Fn("svg",{class:"action-icon",width:"14",height:"14"})]),E=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||E&&n.showPreviewButton!==!1,F=P=>{if(P!=null)return typeof P=="number"?`${P}px`:String(P)},W=Ot(Ot(Ot({"--markstream-code-layout-character-width":"1ch"},F(n.minWidth)?{minWidth:F(n.minWidth)}:{}),F(n.maxWidth)?{maxWidth:F(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Fn("div",On(Ot({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":y,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[W,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Fn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Fn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[Fn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),Fn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[Fn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?Fn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),Fn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Fn("div",{class:"code-diff-stats","aria-hidden":"true"},[Fn("span",{class:"code-diff-stat removed"},"-0"),Fn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:x(),n.showCollapseButton===!1?null:x(),I?Fn("div",{class:"relative"},[x()]):null])]),Fn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Fn(al,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?lye(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:M,"data-markstream-code-loading":"1"})]),Fn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Fn("div",{class:"loading-skeleton"},[Fn("div",{class:"skeleton-line"}),Fn("div",{class:"skeleton-line"}),Fn("div",{class:"skeleton-line short"})])]),Fn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),B8=Mg("ViewportDeferredCodeBlockNode",_u({loader:()=>ao(null,null,function*(){try{return(yield es(()=>import("./CodeBlockNode-CuI0kUU2.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),al}}),loadingComponent:Ck,delay:0,suspensible:!1}),Ck),Ja=_u(()=>ao(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return Fn(Uo,On(Ot({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield jH(),(yield es(()=>import("./index7-DiAQ7wTz.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return Fn(Uo,On(Ot({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),tW=_u(()=>ao(null,null,function*(){try{return yield jH(),(yield es(()=>import("./index6-3HBp-5pe.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return Fn(Uo,On(Ot({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),Ur=$i(ct({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),L("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const kye={class:"superscript-node"},ml=$i(ct({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,footnote_reference:jl,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,emoji:pl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("sup",kye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);ml.install=e=>{e.component(ml.__name,ml)};const bye={class:"subscript-node"},gl=$i(ct({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,footnote_reference:jl,strikethrough:Kr,highlight:Wl,insert:vl,superscript:ml,emoji:pl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("sub",bye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);gl.install=e=>{e.component(gl.__name,gl)};const wye={class:"strong-node"},Vr=$i(ct({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,emphasis:Gr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("strong",wye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Vr.install=e=>{e.component(Vr.__name,Vr)};const Cye={class:"strikethrough-node"},Kr=$i(ct({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("del",Cye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Kr.install=e=>{e.component(Kr.__name,Kr)};const Aye=["href","title","aria-label","aria-hidden","target","rel"],xye=["aria-hidden"],Sye={class:"link-text-wrapper relative inline-flex"},_ye={class:"leading-[normal] link-text"},Zr=$i(ct({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=tn("markstreamShowTooltips",void 0),i=D(()=>{const y=n?.value;return typeof y=="boolean"?y:t.showTooltip}),o=D(()=>{var y,b,C,A,T;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",_=(y=t.animationOpacity)!=null?y:.35,w=Math.max(.12,Math.min(.5*_,_)),M={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":N,"--underline-opacity":String(_),"--underline-rest-opacity":String(w),"--underline-duration":`${(C=t.animationDuration)!=null?C:1.6}s`,"--underline-timing":(A=t.animationTiming)!=null?A:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(T=t.animationIteration)!=null?T:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),s=xs(()=>t.customId),r=D(()=>Ot({text:Uo,strong:Vr,strikethrough:Kr,emphasis:Gr,image:Md,html_inline:Hl,inline_code:Mr},s.value)),l=sm(),a=D(()=>{var y,b;const C=(y=t.node)==null?void 0:y.attrs;if(!C||typeof C!="object")return{};const A={};if(Array.isArray(C))for(const T of C)Array.isArray(T)&&T[0]&&(A[String(T[0])]=String((b=T[1])!=null?b:""));else for(const[T,N]of Object.entries(C))T&&N!=null&&N!==!1&&(A[T]=N===!0?"":String(N));return VL(A,"safe","a")}),u=D(()=>Ot(Ot({},l),a.value)),c=D(()=>{var y,b;return VL({href:String((b=(y=t.node)==null?void 0:y.href)!=null?b:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const y=u.value.target;return(typeof y=="string"?y.trim():String(y??"").trim())||(ape(c.value)?"_blank":void 0)}),f=D(()=>{var y;return String((y=d.value)!=null?y:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const y=u.value.rel,b=new Set((typeof y=="string"?y:String(y??"")).split(/\s+/).filter(Boolean)),C=new Set(Array.from(b).filter(A=>A.toLowerCase()!=="opener"));return f.value&&(C.add("noopener"),C.add("noreferrer")),C.size>0?Array.from(C).join(" "):void 0}),m=D(()=>{const y=Ot({},u.value);return delete y.title,delete y.href,delete y.target,delete y.rel,y});function g(){i.value&&V2e()}const v=D(()=>{var y,b;const C=(y=t.node)==null?void 0:y.title;return typeof C=="string"&&C.trim().length>0?C:String((b=c.value)!=null?b:"")});return(y,b)=>{var C,A;return e.node.loading?(k(),L("span",fi({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[S("span",Sye,[S("span",_ye,[V(p(Uo),{class:"leading-[normal] link-text",node:{type:"text",content:String((C=e.node.text)!=null?C:""),raw:String((A=e.node.text)!=null?A:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=S("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,xye)):(k(),L("a",fi({key:0,class:"link-node",href:c.value,title:i.value?"":v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:b[0]||(b[0]=T=>(function(N){var _,w,M,x;if(!i.value)return;const E=N,I=E?.clientX!=null&&E?.clientY!=null?{x:E.clientX,y:E.clientY}:void 0,F=((_=t.node)==null?void 0:_.title)||((w=c.value)!=null&&w.includes("xn--")&&((x=(M=t.node)==null?void 0:M.text)!=null&&x.includes("://"))?t.node.text:c.value)||"";U2e(N.currentTarget,F,"top",!1,I)})(T)),onMouseleave:g}),[(k(!0),L(Be,null,xt(e.node.children,(T,N)=>(k(),ce(p(qu),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:T,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Aye))}}}),[["__scopeId","data-v-367e6ca4"]]);Zr.install=e=>{e.component(Zr.__name,Zr)};const Mye={class:"insert-node"},vl=$i(ct({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,strikethrough:Kr,highlight:Wl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("ins",Mye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);vl.install=e=>{e.component(vl.__name,vl)};const Iye={class:"highlight-node"},Wl=$i(ct({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,strikethrough:Kr,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("mark",Iye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Wl.install=e=>{e.component(Wl.__name,Wl)};const Tye={class:"emphasis-node"},Gr=$i(ct({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("em",Tye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Gr.install=e=>{e.component(Gr.__name,Gr)};const Eye={class:"hard-break"},Id=$i(ct({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("br",Eye))}),[["__scopeId","data-v-50c58f70"]]);Id.install=e=>{e.component(Id.__name,Id)};const Y0=ct({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ft({checkbox:zl,checkbox_input:zl,emoji:pl,emphasis:Gr,hardbreak:Id,highlight:Wl,inline_code:Mr,insert:vl,link:Zr,reference:Ur,strikethrough:Kr,strong:Vr,subscript:gl,superscript:ml,text:Uo}),i=xs(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Ot(Ot({},n),s):n});return(s,r)=>(k(!0),L(Be,null,xt(e.nodes,(l,a)=>(k(),ce(p(qu),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function WC(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(WC)}function Ak(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(WC))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(WC)?o:null}function Bh(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Lye=["cite"],Nye={key:0,dir:"auto",class:"paragraph-node"},Dye=["custom-id"],t9=$i(ct({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>Ak(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:Bh(s.value));return ri("markstreamShowTooltips",D(()=>t.showTooltips)),ri("markstreamFade",D(()=>t.fade)),(l,a)=>(k(),L("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),L("p",Nye,[r.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,Dye)):(k(),ce(p(Y0),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),ce(p(yl),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Lye))}}),[["__scopeId","data-v-abfecebc"]]);t9.install=e=>{e.component(t9.__name,t9)};const Fye={class:"definition-list"},Bye={class:"definition-term"},Rye={class:"definition-desc"},n9=$i(ct({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("dl",Fye,[(k(!0),L(Be,null,xt(t.node.items,(o,s)=>(k(),L(Be,{key:s},[S("dt",Bye,[V(p(yl),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),S("dd",Rye,[V(p(yl),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);n9.install=e=>{e.component(n9.__name,n9)};const Oye=["href","title"],c0=$i(ct({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),L("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,Oye))}}),[["__scopeId","data-v-e1eb37b6"]]);c0.install=e=>{e.component(c0.__name,c0)};const $ye=["id"],Pye={class:"flex-1"},i9=ct({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[S("div",Pye,[V(p(yl),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,$ye))}});i9.install=e=>{e.component(i9.__name,i9)};const zye=["custom-id"],qC=$i(ct({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=tn("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:Bh(t.node.children)),s=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,image:Md,strong:Vr,emphasis:Gr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,checkbox:zl,checkbox_input:zl,footnote_reference:jl,hardbreak:Id,math_inline:Ja,reference:Ur},n.value));return(r,l)=>(k(),ce(jo(`h${e.node.level}`),fi({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ae(()=>[o.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,zye)):(k(!0),L(Be,{key:1},xt(e.node.children,(a,u)=>(k(),ce(p(qu),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),n4=qC;n4.install=e=>{e.component(qC.__name,qC)};const jye={key:0,dir:"auto",class:"paragraph-node"},Hye=["custom-id"],Wye={dir:"auto",class:"paragraph-node"},qye=["custom-id"],b1=$i(ct({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=xs(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return Ak((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const v=m.slice(1);if(!v.every(b=>b?.type==="list"))return null;const y=Ak([g]);return y?{paragraphChildren:y,nestedLists:v}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?Bh(r.value):null),c=D(()=>{var h;return a()?Bh((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return ri("markstreamShowTooltips",D(()=>t.showTooltips)),ri("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,v;return k(),L("li",fi({class:"list-item",dir:"auto"},f.value),[r.value?(k(),L("p",jye,[u.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,Hye)):(k(),ce(p(Y0),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(k(),L(Be,{key:1},[S("p",Wye,[c.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,qye)):(k(),ce(p(Y0),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),L(Be,null,xt(l.value.nestedLists,(y,b)=>(k(),ce(p(yl),{key:b,nodes:[y],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=C=>h.$emit("copy",C))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),ce(p(yl),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(v=(g=n.value)==null?void 0:g.children)!=null?v:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=y=>h.$emit("copy",y))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);b1.install=e=>{e.component(b1.__name,b1)};const w1=$i(ct({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=xs(()=>e.customId),n=D(()=>t.value.list_item||b1);return(i,o)=>(k(),ce(jo(e.node.ordered?"ol":"ul"),{class:$e(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ae(()=>[(k(!0),L(Be,null,xt(e.node.items,(s,r)=>{var l;return k(),ce(jo(n.value),fi({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);w1.install=e=>{e.component(w1.__name,w1)};const Uye={key:2,class:"html-block-node__raw"},Vye=["innerHTML"],Kye={key:1,class:"html-block-node__placeholder"},d0=$i(ct({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=tn("markstreamHtmlPolicy",void 0),i=tn("markstreamNestedRendererProps",void 0),o=D(()=>{var I,F;return(F=(I=t.htmlPolicy)!=null?I:n?.value)!=null?F:"safe"}),s=D(()=>{var I,F;const W=(I=i?.value)!=null?I:{};return On(Ot({},W),{customId:(F=t.customId)!=null?F:W.customId,htmlPolicy:o.value})}),r=_u({loader:()=>Promise.resolve().then(()=>X7),suspensible:!1}),l=D(()=>{const I=Yy(t.node.attrs,o.value);if(!I)return;const F=r0(I);return Object.keys(F).length>0?F:void 0}),a=D(()=>{const I=String(t.node.tag||"").trim(),F=Yy(t.node.attrs,o.value,I);if(!F)return;const W=r0(F);return Object.keys(W).length>0?W:void 0}),u=xs(()=>t.customId),c=ct({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=U(null),f=U(typeof window>"u"),h=U(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),v=D(()=>{var I;if(g.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([W])=>String(W).toLowerCase()==="open"))return null;const F=m.value[0];return F?.type==="html_block"&&String(F.tag||"").toLowerCase()==="summary"?F:null}),y=D(()=>{var I;return Bh((I=v.value)==null?void 0:I.children)}),b=D(()=>{const I=v.value;if(!I)return;const F=Yy(I.attrs,o.value,"summary");if(!F)return;const W=r0(F);return Object.keys(W).length>0?W:void 0}),C=D(()=>y.value==null?m.value:m.value.slice(1)),A=D(()=>{const I=g.value.trim().toLowerCase();return wj.has(I)||F7(I,o.value)}),T=D(()=>m.value.length>0&&!!t.node.tag&&!A.value),N=D(()=>{var I,F,W;if(T.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(I=h.value)!=null?I:""};const P=(F=h.value)!=null?F:t.node.content;if(!P)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:k1(P,o.value)};if(t.node.loading){const R=wk(P,u.value,o.value);return R===null?{mode:"text",content:(W=t.node.raw)!=null?W:P}:{mode:"dynamic",nodes:R}}if(!ZH(P,u.value))return{mode:"html",content:k1(P,o.value)};const O=wk(P,u.value,o.value);return O===null?{mode:"html",content:k1(P,o.value)}:{mode:"dynamic",nodes:O}}),_=H7(),w=z7(),M=j7(),x=Ya(null),E=!!t.node.loading;return typeof window<"u"?(qe([()=>d.value,()=>w?.value.heavyBlockMargin,()=>w?.value.rootMargin],([I],F,W)=>{var P,O,R,z;if((O=(P=x.value)==null?void 0:P.destroy)==null||O.call(P),x.value=null,!E)return f.value=!0,void(h.value=t.node.content);if(!I)return void(f.value=!1);let H=!0;const j=(z=(R=w?.value.heavyBlockMargin)!=null?R:w?.value.rootMargin)!=null?z:Fh,K=_(I,{rootMargin:j,allowIdle:!M.value});x.value=K,f.value=f.value||K.isVisible.value,K.whenVisible.then(()=>{H&&x.value===K&&(f.value=!0)}),W(()=>{H=!1,K.destroy(),x.value===K&&(x.value=null)})},{immediate:!0}),qe(()=>t.node.content,I=>{E&&!f.value||(h.value=I)})):f.value=!0,si(()=>{var I,F;(F=(I=x.value)==null?void 0:I.destroy)==null||F.call(I),x.value=null}),(I,F)=>(k(),ce(jo(T.value?g.value:"div"),fi({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(M)&&!f.value?"true":void 0},T.value?a.value:void 0),{default:ae(()=>[f.value?(k(),L(Be,{key:0},[N.value.mode==="structured"?(k(),L(Be,{key:0},[y.value!==null?(k(),L(Be,{key:0},[S("summary",AQ(i$(b.value)),B(y.value),17),C.value.length?(k(),ce(p(r),fi({key:0},s.value,{nodes:C.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(k(),ce(p(r),fi({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):N.value.mode==="dynamic"?(k(),ce(p(c),{key:1,nodes:N.value.nodes},null,8,["nodes"])):N.value.mode==="text"?(k(),L("pre",Uye,B(N.value.content),1)):(k(),L("div",fi({key:3},l.value,{innerHTML:N.value.content}),null,16,Vye))],64)):(k(),L("div",Kye,[Yn(I.$slots,"placeholder",{node:e.node},()=>[F[0]||(F[0]=S("span",{class:"html-block-node__placeholder-bar"},null,-1)),F[1]||(F[1]=S("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),F[2]||(F[2]=S("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);d0.install=e=>{e.component(d0.__name,d0)};const Zye={dir:"auto",class:"paragraph-node"},Gye=["custom-id"],wh=$i(ct({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=xs(()=>t.customId),i=tn("markstreamHtmlPolicy",void 0),o=tn("markstreamFade",void 0),s=tn("markstreamParseOptions",void 0),r=tn("markstreamCustomMarkdownIt",void 0),l=tn("markstreamNestedRendererProps",void 0),a=D(()=>{var w;return(w=i?.value)!=null?w:"safe"}),u=D(()=>{var w;return(w=t.parseOptions)!=null?w:s?.value}),c=D(()=>{var w;return(w=t.customMarkdownIt)!=null?w:r?.value}),d=D(()=>{var w,M;return(M=t.customHtmlTags)!=null?M:(w=l?.value)==null?void 0:w.customHtmlTags}),f=D(()=>{var w,M;const x=(w=l?.value)!=null?w:{};return On(Ot({},x),{customId:(M=t.customId)!=null?M:x.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=_u({loader:()=>Promise.resolve().then(()=>X7),suspensible:!1});function m(w){var M;return w.type==="text"&&String((M=w.content)!=null?M:"").trim()===""}const g=D(()=>t.node.children.filter(w=>!m(w))),v=D(()=>g.value.length>0&&g.value.every(w=>w.type==="image"||(function(M){var x;const E=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter(F=>!m(F)):[]})(M);return E.length===1&&((x=E[0])==null?void 0:x.type)==="image"})(w))),y=D(()=>new Set(Yh(d.value))),b=D(()=>{if(!v.value||g.value.length<=1)return t.node.children;const w=[];for(let M=0;M0,I=t.node.children.slice(M+1).some(F=>!m(F));E&&I&&w.push(On(Ot({},x),{content:" ",raw:" "}))}return w}),C=D(()=>o?.value===!1&&!n.value.text),A=D(()=>C.value?Bh(b.value):null);function T(w,M){return{node:w,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=D(()=>Ot({inline_code:Mr,image:Md,link:Zr,hardbreak:Id,emphasis:Gr,strong:Vr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,html_inline:Hl,html_block:d0,emoji:pl,checkbox:zl,math_inline:Ja,checkbox_input:zl,reference:Ur,footnote_anchor:c0,footnote_reference:jl,text:Uo},n.value)),_=D(()=>b.value.map((w,M)=>{var x;const E=(function(I){var F,W,P,O;if(I.type==="html_block"||I.type==="html_inline"){const R=String((F=I.tag)!=null?F:"").trim().toLowerCase()||_j(I.content);if(R&&!y.value.has(R)&&Mj((W=I.content)!=null?W:I.raw,R)){const z=String((O=(P=I.content)!=null?P:I.raw)!=null?O:"");return{child:{type:"text",content:z,raw:z},component:Uo,isCustomComponent:!1}}}return{child:I,component:N.value[I.type],isCustomComponent:!!(n.value[I.type]&&!$v(String(I.type)))}})(w);return On(Ot({},E),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:E.isCustomComponent?P7(E.child,a.value):void 0,hasSlotChildren:Array.isArray(E.child.children)&&E.child.children.length>0,slotContent:String((x=E.child.content)!=null?x:""),originalChild:w})}));return(w,M)=>(k(),L("p",Zye,[A.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(A.value),9,Gye)):(k(!0),L(Be,{key:1},xt(_.value,x=>{return k(),L(Be,{key:x.key},[v.value&&m(x.originalChild)?(k(),L(Be,{key:0},[Pe(B((E=x.originalChild,String((I=E.content)!=null?I:""))),1)],64)):x.isCustomComponent?(k(),ce(jo(x.component),fi({key:1,ref_for:!0},x.customAttrs,{node:x.child,loading:x.child.loading,"index-key":x.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ae(()=>[x.hasSlotChildren?(k(),ce(p(h),fi({key:0,ref_for:!0},f.value,{nodes:x.child.children,"index-key":x.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):x.slotContent?(k(),ce(p(h),fi({key:1,ref_for:!0},f.value,{content:x.slotContent,final:!x.child.loading,"index-key":`${x.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),ce(jo(x.component),fi({key:2,ref_for:!0},T(x.child,x.index)),null,16))],64);var E,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);wh.install=e=>{e.component(wh.__name,wh)};const Qye={class:"table-node-wrapper"},Yye=["aria-busy"],Jye={key:0},Xye=["custom-id"],e9e=["aria-label","onPointerdown"],t9e=["custom-id"],n9e={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},f0=$i(ct({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var y;return(y=t.node.loading)!=null&&y}),i=D(()=>{var y;return(y=t.node.rows)!=null?y:[]}),o=U(null),s=U([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(y=>Number.isFinite(y)&&y>0)),u=D(()=>a.value?s.value.map(y=>y>0?{width:`${y}px`}:void 0):[]);ri("markstreamShowTooltips",D(()=>t.showTooltips)),ri("markstreamFade",D(()=>t.fade));const c=xs(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(y){const b=t.fade===!1&&!d.value,C=!f.value,A=h.get(y);if(A?.children===y.children&&A.textFastPath===b&&A.paragraphFastPath===C)return A.info;const T=Ak(y.children,C,!0),N={simpleChildren:T,plainText:T&&b?Bh(T):null};return h.set(y,{children:y.children,textFastPath:b,paragraphFastPath:C,info:N}),N}function g(y){if(!r)return;y.preventDefault();const b=r.startWidth+r.nextStartWidth,C=Math.min(48,Math.floor(b/2)),A=Math.max(C,Math.min(b-C,Math.round(r.startWidth+y.clientX-r.startX))),T=[...r.widths];T[r.index]=A,T[r.index+1]=b-A,s.value=T}function v(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),r=null)}return qe(l,()=>{v(),s.value=[]}),si(v),(y,b)=>(k(),L("div",Qye,[S("table",{ref_key:"tableRef",ref:o,class:$e(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),L("colgroup",Jye,[(k(!0),L(Be,null,xt(e.node.header.cells,(C,A)=>(k(),L("col",{key:A,style:sn(u.value[A])},null,4))),128))])):ee("",!0),S("thead",null,[S("tr",null,[(k(!0),L(Be,null,xt(e.node.header.cells,(C,A)=>(k(),L("th",{key:A,dir:"auto",class:$e([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"])},[m(C).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(m(C).plainText),9,Xye)):m(C).simpleChildren?(k(),ce(p(Y0),{key:1,nodes:m(C).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${A}`},null,8,["nodes","custom-id","index-key"])):(k(),ce(p(yl),{key:2,nodes:C.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=T=>y.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),A(function(N,_){if(_.button!==0)return;const w=(function(){var E;const I=(E=o.value)==null?void 0:E.querySelectorAll("thead th");return Array.from(I??[],F=>Math.round(F.getBoundingClientRect().width))})(),M=w[N],x=w[N+1];M&&x&&(_.preventDefault(),r={index:N,startX:_.clientX,startWidth:M,nextStartWidth:x,widths:w},s.value=w,window.addEventListener("pointermove",g),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v))})(A,T)},null,40,e9e)):ee("",!0)],2))),128))])]),S("tbody",null,[(k(!0),L(Be,null,xt(i.value,(C,A)=>(k(),L("tr",{key:A},[(k(!0),L(Be,null,xt(C.cells,(T,N)=>(k(),L("td",{key:N,class:$e([T.align==="right"?"text-right":T.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(T).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(m(T).plainText),9,t9e)):m(T).simpleChildren?(k(),ce(p(Y0),{key:1,nodes:m(T).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${A}-${N}`},null,8,["nodes","custom-id","index-key"])):(k(),ce(p(yl),{key:2,nodes:T.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=_=>y.$emit("copy",_))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Yye),V(mo,{name:"table-node-fade"},{default:ae(()=>[n.value?(k(),L("div",n9e,[Yn(y.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=S("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=S("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);f0.install=e=>{e.component(f0.__name,f0)};const i9e={class:"hr-node"},o9=$i({},[["render",function(e,t){return k(),L("hr",i9e)}],["__scopeId","data-v-39b2349c"]]);o9.install=e=>{e.component(o9.__name,o9)};const o9e={class:"unknown-node"},UC=ct({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),L("div",o9e,B(e.node.raw),1))}),s9=$i(ct({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=xs(()=>t.customId),o=D(()=>Ot({text:Uo,paragraph:wh,heading:n4,inline_code:Mr,link:Zr,image:Md,strong:Vr,emphasis:Gr,strikethrough:Kr,insert:vl,subscript:gl,superscript:ml,checkbox:zl,checkbox_input:zl,hardbreak:Id,math_inline:Ja,reference:Ur,list:w1,math_block:tW,table:f0},i.value));return(s,r)=>(k(),L("div",fi({class:n.value},e.node.attrs),[(k(!0),L(Be,null,xt(e.node.children,(l,a)=>{return k(),ce(jo((u=l.type,o.value[u]||UC)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);s9.install=e=>{e.component(s9.__name,s9)};const s9e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],tN=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function r9e(e){if(e<=255)return s9e[e];let t=0,n=tN.length-1;for(;t<=n;){const i=t+n>>1,o=tN[i];if(eo[1]))return o[2];t=i+1}}return"L"}const l9e=/[ \t\n\r\f]+/g,a9e=/[\t\n\r\f]| {2,}|^ | $/;let R8=null;const u9e=new RegExp("\\p{Script=Arabic}","u"),qd=new RegExp("\\p{M}","u"),q7=new RegExp("\\p{Nd}","u");function nN(e){return u9e.test(e)}function iN(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Iu(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(iN(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(iN(n))return!0}}return!1}const c9e=new Set([" "," ","⁠","\uFEFF"]),d9e=new Set(["-","‐","–","—"]);function nW(e,t){return!((function(n){const i=h0(n);return i!==null&&c9e.has(i)})(e)||t&&((function(n){const i=h0(n);return i!==null&&(U7.has(i)||Rh.has(i))})(e)||(function(n){const i=h0(n);return i!==null&&d9e.has(i)})(e)))}const U7=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),i4=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),V7=new Set(["'","’"]),Rh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),f9e=new Set([":",".","،","؛"]),h9e=new Set(["၏"]),p9e=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function m9e(e){if(K7(e))return!0;let t=!1;for(const n of e)if(Rh.has(n)||Sk(n))t=!0;else if(!t||!qd.test(n))return!1;return t}function g9e(e){for(const t of e)if(!U7.has(t)&&!Rh.has(t))return!1;return e.length>0}function v9e(e){if(K7(e))return!0;for(const t of e)if(!(i4.has(t)||V7.has(t)||qd.test(t)||Sk(t)))return!1;return e.length>0}function K7(e){let t=!1;for(const n of e)if(n!=="\\"&&!qd.test(n)){if(!(i4.has(n)||Rh.has(n)||V7.has(n)))return!1;t=!0}return t}function xk(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function h0(e){if(e.length===0)return null;const t=xk(e,e.length);return e.slice(t)}const y9e=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Sk(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,y9e)}function k9e(e){const t=(function(n){for(const i of n)if(!qd.test(i))return i;return null})(e);return t!==null&&q7.test(t)}function b9e(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(qd.test(i))n--;else{if(!i4.has(i)&&!V7.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function w9e(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function oN(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function sN(e,t){return e&&t!==null&&f9e.has(t)}function C9e(e){const t=h0(e);return t!==null&&h9e.has(t)}function A9e(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function VC(e){let t=e.length;for(;t>0;){const n=xk(e,t),i=e.slice(n,t);if(p9e.has(i))return!0;if(!Rh.has(i))return!1;t=n}return!1}function x9e(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const S9e=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Da(e){return e.length===1?e[0]:e.join("")}function _9e(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Da(n)}function M9e(e,t,n,i){if(!S9e.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=x9e(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:Da(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:Da(r),isWordLike:a,kind:s,start:l}),o}function O8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const I9e=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function T9e(e,t){const n=e.texts[t];return!!n.startsWith("www.")||I9e.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!F9e.has(e)&&!D9e.test(e)&&N9e.test(e)}function rN(e){let t=!1;for(const n of e)if(!qd.test(n)){if(!iW(n))return!1;t=!0}return t}function B9e(e,t,n,i){const o=!t&&rN(e),s=!i&&rN(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=xk(c,d),h=c.slice(f,d);if(!qd.test(h))return h;d=f}return null})(a);return u!==null&&Sk(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=xk(a,u),d=a.slice(c,u);if(!qd.test(d))return iW(d)||Sk(d);u=c}return!1})(e);return!!(o||s||l)&&!Iu(e)&&!Iu(n)&&(t||o||r)&&(i||s)}function lN(e){for(const t of e)if(q7.test(t))return!0;return!1}function r9(e){if(e.length===0)return!1;for(const t of e)if(!q7.test(t)&&!L9e.has(t))return!1;return!0}function R9e(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(R8===null&&(R8=new Intl.Segmenter(void 0,{granularity:"word"})),R8);let g=0;const v=[],y=[],b=[],C=[],A=[],T=[],N=[],_=[],w=[],M=[],x=[],E=[];for(const O of m.segment(a))for(const R of M9e(O.segment,(d=O.isWordLike)!=null&&d,O.index,c)){let z=function(){T[te]!==null&&(y[te]=[oN(v,T,N,te)],T[te]=null),y[te].push(R.text),b[te]=b[te]||R.isWordLike,_[te]=_[te]||K,w[te]=w[te]||re,M[te]=Q,x[te]=ne,E[te]=sN(w[te],q)};const H=R.kind==="text",j=w9e(R.text,R.isWordLike,R.kind),K=Iu(R.text),re=nN(R.text),q=h0(R.text),Q=VC(R.text),ne=C9e(R.text),te=g-1;u.carryCJKAfterClosingQuote&&H&&g>0&&C[te]==="text"&&K&&_[te]&&M[te]||H&&g>0&&C[te]==="text"&&g9e(R.text)&&_[te]||H&&g>0&&C[te]==="text"&&x[te]?z():H&&g>0&&C[te]==="text"&&R.isWordLike&&re&&E[te]?(z(),b[te]=!0):j!==null&&g>0&&C[te]==="text"&&T[te]===j?N[te]=((f=N[te])!=null?f:1)+1:H&&!R.isWordLike&&g>0&&C[te]==="text"&&!_[te]&&(m9e(R.text)||R.text==="-"&&b[te])?z():(v[g]=R.text,y[g]=[R.text],b[g]=R.isWordLike,C[g]=R.kind,A[g]=R.start,T[g]=j,N[g]=j===null?0:1,_[g]=K,w[g]=re,M[g]=Q,x[g]=ne,E[g]=sN(re,q),g++)}for(let O=0;Onull);let F=-1;for(let O=g-1;O>=0;O--){const R=v[O];if(R.length!==0){if(C[O]==="text"&&!b[O]&&F>=0&&C[F]==="text"&&(v9e(R)||R==="-"&&k9e(v[F]))){const z=(h=I[F])!=null?h:[];z.push(R),I[F]=z,A[F]=A[O],v[O]="";continue}F=O}}for(let O=0;OK+1){R.push(Da(ne)),z.push(ge),H.push("text"),j.push(O.starts[K]),K=te;continue}}R.push(re),z.push(Q),H.push(q),j.push(O.starts[K]),K++}return{len:R.length,texts:R,isWordLike:z,kinds:H,starts:j}})((function(O){const R=[],z=[],H=[],j=[];for(let K=0;K1;for(let ne=0;ne=O.len||O8(O.kinds[q]))continue;const Q=[],ne=O.starts[q];let te=q;for(;te0&&(R.push(Da(Q)),z.push(!0),H.push("text"),j.push(ne),K=te-1)}return{len:R.length,texts:R,isWordLike:z,kinds:H,starts:j}})((function(O){const R=O.texts.slice(),z=O.isWordLike.slice(),H=O.kinds.slice(),j=O.starts.slice();for(let re=0;re=0&&!nW(u.texts[C-1],c)&&b(C),g<0&&(g=C),v=v||Iu(A))}return b(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Ot({normalized:s,chunks:R9e(l,o)},l)}let xp=null;const aN=new Map;let Sp=null;const $9e=new RegExp("\\p{Emoji_Presentation}","u"),P9e=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let $8=null;const uN=new Map;function KC(){if(xp!==null)return xp;if(typeof OffscreenCanvas<"u")return xp=new OffscreenCanvas(1,1).getContext("2d"),xp;if(typeof document<"u")return xp=document.createElement("canvas").getContext("2d"),xp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Zc(e,t){let n=t.get(e);return n===void 0&&(n={width:KC().measureText(e).width,containsCJK:Iu(e)},t.set(e,n)),n}function _k(){if(Sp!==null)return Sp;if(typeof navigator>"u")return Sp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Sp;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Sp={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Sp}function oW(){return $8===null&&($8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),$8}function z9e(e){return $9e.test(e)||e.includes("️")}function Df(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=oW();for(const a of l.segment(s))z9e(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function j9e(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function cN(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function dN(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function Z7(e,t){return t===0?0:e+t}function q9e(e,t,n,i,o){return Z7(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function fN(e,t,n,i){return Z7(i,t==="tab"?0:e.lineEndFitAdvances[n])}function hN(e,t,n,i,o){return Z7(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function U9e(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function V9e(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function ty(e,t,n){let i=t;for(;iz){if(be!==null&&oe>Z){te(ue,oe,J),fe=oe,we=ty(be,we,fe+1),oe=-1,J=0;continue}te(),Ae(ue,fe,ve)}else j+=ve,re=ue,q=fe+1;else Ae(ue,fe,ve);const Ce=fe+1;be!==null&&be[we]===Ce&&(oe=Ce,J=j,we++),fe++}K&&re===ue&&q===ke.length&&(re=ue+1,q=0)}let Y=0;for(;Y=W.length)));){const ue=W[Y],Z=cN(P[Y]);if(K)if(j+ue>z){if(Z){me(Y,ue),te(Y+1,0,j-ue),Y++;continue}if(Q>=0){if(re>Q||re===Q&&q>0){te();continue}te(Q,0,ne);continue}if(ue>z&&O[Y]!==null){te(),de(Y,0),Y++;continue}te()}else me(Y,ue),Z&&(Q=Y+1,ne=j-ue),Y++;else ue>z&&O[Y]!==null?de(Y,0):ge(Y,ue),Z&&(Q=Y+1,ne=j-ue),Y++}return K&&te(),H})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=_k(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,v=0,y=-1,b=0,C=null;function A(){y=-1,b=0,C=null}function T(I=g,F=v,W){f++,h=0,m=!1,A()}function N(I,F){m=!0,g=I+1,v=0,h=F}function _(I,F,W){m=!0,g=I,v=F+1,h=W}function w(I,F){m?(h+=F,g=I+1,v=0):N(I,F)}function M(I,F,W,P,O,R){if(!F)return;const z=fN(n,I,W,O);hN(n,I,W,O,P),y=W+1,b=h-R+z,C=I}function x(I,F){var W;const P=r[I],O=(W=l[I])!=null?W:null;let R=O===null?-1:ty(O,0,F+1),z=-1,H=F;for(;Hd){if(O!==null&&z>F){T(I,z),H=z,R=ty(O,R,H+1),z=-1;continue}T(),_(I,H,j)}else h=q,g=I,v=H+1}else _(I,H,j);const K=H+1;O!==null&&O[R]===K&&(z=K,R++),H++}m&&g===I&&v===P.length&&(g=I+1,v=0)}function E(I){f++,A()}for(let I=0;I=F.endSegmentIndex)));){const P=s[W],O=cN(P),R=W9e(n,m,W),z=P==="tab"?H9e(h+R,n.tabStopAdvance):o[W],H=R+z,j=q9e(n,P,W,R,z);if(P!=="soft-hyphen")if(m){if(h+j>d){const K=h+fN(n,P,W,R);if(hN(n,P,W,R,z),C==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){T(y,0);continue}if(O&&K<=d){w(W,H),T(W+1,0),W++;continue}if(y>=0&&b<=d){if(g>y||g===y&&v>0){T();continue}const re=y;T(re,0),W=re;continue}if(j>d&&r[W]!==null){T(),x(W,0),W++;continue}T();continue}w(W,H),M(P,O,W,z,R,H),W++}else j>d&&r[W]!==null?x(W,0):N(W,z),M(P,O,W,z,R,H),W++;else m&&(g=W+1,v=0,y=W+1,b=h+a,C=P),W++}m&&(F.consumedEndSegmentIndex,T(F.consumedEndSegmentIndex,0))}return f})(e,t)}let P8=null;function G7(){return P8===null&&(P8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),P8}function Z9e(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=VC(d),l=i4.has(d)}function c(d,f){i.push(d),s=s||f;const h=VC(d);r=d.length===1&&Rh.has(d)&&r||h,l=!1}for(const d of G7().segment(e)){const f=d.segment,h=Iu(f);i.length!==0?l||U7.has(f)||Rh.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function G9e(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!nW(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||Iu(a.text)}return r(t.length),i}function pN(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=G7();for(const o of i.segment(e))n++;return n}function Q9e(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Y9e(e,t,n,i,o){const s=_k(),{cache:r,emojiCorrection:l}=(function(E,I){KC().font=E;const F=(function(O){let R=aN.get(O);return R||(R=new Map,aN.set(O,R)),R})(E),W=(function(O){const R=O.match(/(\d+(?:\.\d+)?)\s*px/);return R?parseFloat(R[1]):16})(E),P=I?(function(O,R){let z=uN.get(O);if(z!==void 0)return z;const H=KC();H.font=O;const j=H.measureText("😀").width;if(z=0,j>R+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=O,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const re=K.getBoundingClientRect().width;document.body.removeChild(K),j-re>.5&&(z=j-re)}return uN.set(O,z),z})(E,W):0;return{cache:F,fontSize:W,emojiCorrection:P}})(t,(a=e.normalized,P9e.test(a)));var a;const u=Df("-",Zc("-",r),l)+(o===0?0:2*o),c=8*Df(" ",Zc(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=null,b=[],C=[],A=[],T=null,N=Array.from({length:e.len});function _(E,I,F,W,P,O,R,z,H){P!=="text"&&P!=="space"&&P!=="zero-width-break"&&(v=!1),f.push(I),h.push(F),m.push(W),g.push(P),b.push(R),C.push(z),d&&A.push(H)}function w(E,I,F,W,P){const O=Zc(E,r),R=d?pN(E,I):0,z=(function(re,q,Q){return q>1?re+(q-1)*Q:re})(Df(E,O,l),R,o),H=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:z,j=H===0?0:H+(R>0?o:0),K=I==="space"||I==="zero-width-break"?0:z;if(P&&W&&E.length>1){let re="sum-graphemes";o!==0?re="segment-prefixes":r9(E)?re="pair-context":s.preferPrefixWidthsForBreakableRuns&&(re="segment-prefixes");const q=(function(ne,te,ge,Ae,me){if(te.breakableFitAdvances!==void 0&&te.breakableFitMode===me)return te.breakableFitAdvances;te.breakableFitMode=me;const de=oW(),Y=[];for(const ke of de.segment(ne))Y.push(ke.segment);if(Y.length<=1)return te.breakableFitAdvances=null,te.breakableFitAdvances;if(me==="sum-graphemes"){const ke=[];for(const be of Y){const we=Zc(be,ge);ke.push(Df(be,we,Ae))}return te.breakableFitAdvances=ke,te.breakableFitAdvances}if(me==="pair-context"||Y.length>96){const ke=[];let be=null,we=0;for(const oe of Y){const J=Df(oe,Zc(oe,ge),Ae);if(be===null)ke.push(J);else{const fe=be+oe,ve=Zc(fe,ge);ke.push(Df(fe,ve,Ae)-we)}be=oe,we=J}return te.breakableFitAdvances=ke,te.breakableFitAdvances}const ue=[];let Z="",se=0;for(const ke of Y){Z+=ke;const be=Df(Z,Zc(Z,ge),Ae);ue.push(be-se),se=be}return te.breakableFitAdvances=ue,te.breakableFitAdvances})(E,O,r,l,re),Q=q===null||i==="keep-all"?null:(function(ne){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(ne))return null;const te=[];let ge=0;for(const Ae of G7().segment(ne))ge++,Q9e(Ae.segment)&&te.push(ge);return te.length===0?null:te})(E);return void _(E,z,j,K,I,F,q,Q,R)}_(E,z,j,K,I,F,null,null,R)}for(let E=0;E=55296&&ne<=56319&&Q+1=56320&&me<=57343&&(te=me-56320+(ne-55296<<10)+65536,ge=2)}const Ae=r9e(te);Ae!=="R"&&Ae!=="AL"&&Ae!=="AN"||(z=!0);for(let me=0;me=0&&R[ne]==="ET";ne--)R[ne]="EN";for(ne=Q+1;ne0?R[Q-1]:re)!=="L"?"R":"L";if(te===((ne{const e=globalThis;if(e[z8])return e[z8];const t={configs:{},controllers:{},revision:Ya(0),preparedCache:new Map,blockEstimateCache:new Map};return e[z8]=t,t})();let ng=null;const j8=Ms.revision;function mN(e){var t;return e&&(t=Ms.configs[e])!=null?t:null}function gN(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function X9e(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function H8(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!X9e(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` +`)}return o.length>0?o:null}function W8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(ng!=null)return ng;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return ng=!!((s=r.getContext)!=null&&s.call(r,"2d")),ng}catch{return ng=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=Ms.blockEstimateCache.get(r);if(l)return Ms.blockEstimateCache.delete(r),Ms.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const v=`${g}\0${m}\0${h}`,y=Ms.preparedCache.get(v);if(y)return Ms.preparedCache.delete(v),Ms.preparedCache.set(v,y),y.prepared;const b=(function(C,A,T){return(function(N,_,w,M){var x,E;const I=(x=M?.wordBreak)!=null?x:"normal",F=(E=M?.letterSpacing)!=null?E:0;return Y9e(O9e(N,_k(),M?.whiteSpace,I),_,!1,I,F)})(C,A,0,T)})(h,m,{whiteSpace:g});for(Ms.preparedCache.set(v,{prepared:b});Ms.preparedCache.size>240;){const C=Ms.preparedCache.keys().next().value;if(!C)break;Ms.preparedCache.delete(C)}return b})(e,n.font,a),c=(function(h,m,g){const v=K9e(h,m);return{lineCount:v,height:v*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Ms.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Ms.blockEstimateCache.size>4e3;){const h=Ms.blockEstimateCache.keys().next().value;if(!h)break;Ms.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function sW(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=H8(e.children);return s&&n.paragraph?W8(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=H8(e.children),l=n.headings[s];return r&&l?W8(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=H8((o=s[0])==null?void 0:o.children);return r?W8(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=sW(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function ig(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Ff(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function q8(e,t,n=0){return e.diff?W7(t??{},n)?(function(i){const o=Ff(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!J9e.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return ig(Ff(i.originalCode))+ig(Ff(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(ig(Ff(o)),ig(Ff(s)));const r=Ff(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):ig(Ff(e.code,e.loading===!0))}function eke(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function U8(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=gN(i.lineHeight,1.5*gN(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:eke(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const tke=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function vN(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))tke.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function yN(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function kN(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function bN(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const rW=Symbol("MarkstreamMathBlockMinHeightCache");function rkt(){return tn(rW,null)}const nke=new Set(["text","inline_code","emoji","footnote_reference"]),ike=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function og(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function Bf(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function lW(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(nke.has(i))return!0;if(!ike.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(lW)}function ZC(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(ZC).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function aW(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(aW)})}function oke(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function ske(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const v=e,y=String((n=v.type)!=null?n:""),b=Number.isFinite(t)&&t>0?t:640;switch(y){case"heading":return(function(C){var A;const T=Number((A=C.level)!=null?A:C.depth);return T>=4?20:T===3?30:T===2?32:44})(v);case"paragraph":return(function(C,A){const T=String(C??"");if(!T)return 28;const N=Math.max(18,Math.floor(Math.max(320,A)/8)),_=T.split(/\r?\n/).length,w=Math.ceil(T.length/N);return Math.max(1,_,w)<=1?28:Bf(T,A,34)})(String((o=(i=v.raw)!=null?i:v.content)!=null?o:""),b);case"list":return(function(C,A){var T;const N=Array.isArray(C.items)?C.items:[];if(!N.length)return 48;const _=Math.max(48,30*N.length+12);let w=12;for(const E of N)w+=oke(ZC(E)||String((T=E.raw)!=null?T:""),A);const M=Math.max(0,w-_);if(N.length>20){const E=Math.round(2.4*N.length);return Math.round(_+Math.max(E,Math.min(M,3*N.length)))}if(M<=0)return _;const x=N.length>8?8*N.length:M;return Math.round(_+Math.min(M,x))})(v,b);case"list_item":return Bf(String((r=(s=v.raw)!=null?s:v.content)!=null?r:""),b,34);case"blockquote":return Bf(String((a=(l=v.raw)!=null?l:v.content)!=null?a:""),b,56);case"table":return(function(C,A){const T=[...C.header?[C.header]:[],...Array.isArray(C.rows)?C.rows:[]];if(!T.length){const N=Array.isArray(C.children)?C.children.length:3;return Math.max(120,38*N+48)}return Math.max(120,Math.round(4+T.reduce((N,_)=>N+(function(w,M){const x=Math.max(1,w.length),E=Math.max(80,(M-32)/x),I=Math.max(10,Math.floor(E/8)),F=Math.max(1,...w.map(W=>{var P;const O=ZC(W)||String((P=W?.raw)!=null?P:"");return Math.ceil(O.length/I)||1}));return 54+34*Math.max(0,F-1)+(x<=3&&w.some(aW)?14:0)})((function(w){var M;return Array.isArray(w?.cells)&&(M=w.cells)!=null?M:[]})(_),A),0)))})(v,b);case"code_block":{const C=String((u=v.language)!=null?u:"").trim().toLowerCase(),A=String((d=(c=v.code)!=null?c:v.raw)!=null?d:"");return C==="mermaid"?yk(gk(A)):C==="infographic"?kk(vk(A)):Bf(A,b,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(C,A){var T,N,_;const w=C.match(/^\s*]*)>/i);return w&&!/(?:^|\s)open(?:\s|=|$)/i.test((T=w[1])!=null?T:"")?Bf(((_=(N=C.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:N[1])==null?void 0:_.replace(/<[^>]*>/g,"").trim())||"Details",A,28,28):Bf(C,A,96)})(String((h=(f=v.raw)!=null?f:v.content)!=null?h:""),b);case"thematic_break":return 24;default:return Bf(String((g=(m=v.raw)!=null?m:v.content)!=null?g:""),b,40)}}function wN(e,t,n){return Math.min(Math.max(e,t),n)}const rke=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],lke=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],ake=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),uW=["raw","content","code","originalCode","updatedCode"],CN=new WeakMap,AN=new WeakMap;let uke=1;function Na(){return typeof performance<"u"?performance.now():Date.now()}function xN(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Bl(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=CN.get(t);return n||(n=uke++,CN.set(t,n)),String(n)}function SN(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:Bl(t),customMarkdownIt:Bl(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:Bl(e.validateLink),preTransformTokens:Bl(e.preTransformTokens),postTransformTokens:Bl(e.postTransformTokens),postTransformNodes:Bl(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function _N(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` +`,t-1)+1;return e.slice(n,t).trim()}function MN(e){const t=cW(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function cW(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function dW(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function Q7(e){const t=String(e??"");return`${t.length}:${dW(t)}`}function GC(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?Q7(r):`${r.length}:${dW(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Bl(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${Bl(i)}`;const s=Bl(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>GC(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${GC(r[u],t,n+1)}`).join(";")}`}return typeof e}function Mk(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function fW(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>Mk(i)?Ud(i,t,n+1):fW(i,t,n+1)).join(",")}`:Mk(e)?Ud(e,t,n):GC(e,t,n)}function cke(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!uW.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${Q7(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${Bl(o)}`:ake.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${fW(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${Bl(o)}`:""}).filter(Boolean).join(";")}function dke(e){return uW.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Q7(n)}`:""}).filter(Boolean).join(";")}function Ud(e,t=new WeakMap,n=0){const i=AN.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${Bl(o)}`;const r=Bl(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Ud(m,u,c+1)).join("|"):"";return[a.type,dke(d),cke(d,u,c),f.length,h].join(":")})(e,t,n);return AN.set(o,l),l}function hW(e,t){return Ud(e)===Ud(t)}function Y7(e,t,n){const i=Na(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Na()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function IN(e,t,n){return Y7(t,n,()=>Ud(e))}function pW(e,t,n){return IN(e,n,"stabilizeSignatureMs")===IN(t,n,"stabilizeSignatureMs")}function ny(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function TN(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function EN(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function fke(e,t){return e.length===t.length&&e===t}function J7(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=J7(e,t)}),i??pW(e,t,n)}function mke(e,t){const n={};for(const i of rke){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function gke(e,t){var n;const i=_L(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=U(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let W="",P=0,O=!1,R=!1,z=!1,H=!1;function j(){W="",P=0,O=!1,R=!1,z=!1,H=!1}function K(re){let q=!1;for(let Q=0;Q{if(!re||!q.startsWith(re)||q.length<=re.length)return j(),[!0,0];let Q=0;W!==re&&(j(),K(re),Q=re.length);const ne=q.slice(re.length),te=K(ne);return W=q,[te,Q+ne.length]}})();let h,m=0,g=0,v=Na(),y=-1,b=0;function C(W){y=Number.isInteger(W)?W:0,b+=1}function A(){h&&(clearTimeout(h),h=void 0)}function T(){A();const W=t.renderContent.value;r.value!==W&&(r.value=W),v=Na()}qe([t.renderContent,t.effectiveFinal,s],([W,P,O])=>{r.value!==W&&(!O||P||(function(R,z){if(!R&&z||z.length<=80||z.length\s*|`{3,}|~{3,})/.test(H))||H.endsWith(` +`)&&!(function(j){const K=_N(j);if(MN(K))return!1;const re=cW(K);return re.length>=2&&re.some(q=>q.trim())})(z))})(r.value,W)?T():(function(){if(g+=1,h)return;const R=Math.max(0,(function(z){const H=z.parseCoalesceMs;return typeof H=="number"&&Number.isFinite(H)&&H>=0?H:80})(e)-(Na()-v));R<=0?T():h=setTimeout(T,R)})())},{flush:"sync",immediate:!0}),Jd(A);const N=D(()=>{var W,P,O,R;return ppe(e.customHtmlTags,(W=e.parseOptions)==null?void 0:W.customHtmlTags,(R=(O=(P=t.customComponentsMap)==null?void 0:P.value)!=null?O:{},Object.entries(R).map(([z,H])=>{const j=Ca(z);return H==null||!j||$v(j)||bj.has(j)||Dv.has(j)?"":j}).filter(Boolean)))}),_=D(()=>{const{key:W,tags:P}=mpe(N.value);if(!W)return i;const O=o.get(W);if(O)return O;const R=_L(t.instanceMsgId,{customHtmlTags:P});return o.set(W,R),R}),w=D(()=>{const W=_.value;if(!e.customMarkdownIt)return W;const P=e.customMarkdownIt(W);return W.__markstreamHasCustomParserExtensions=!0,P.__markstreamHasCustomParserExtensions=!0,P}),M=D(()=>{var W,P;const O=(W=e.parseOptions)!=null?W:{},R=t.effectiveFinal.value,z=N.value,H=R!=null,j=z.length>0;return H||j||O.streamParse==null?Ot(Ot(On(Ot({},O),{streamParse:(P=O.streamParse)==null||P}),H?{final:R}:{}),j?{customHtmlTags:z}:{}):O}),x=D(()=>{var W;return new Set(((W=M.value.customHtmlTags)!=null?W:[]).map(P=>String(P).trim().toLowerCase()).filter(Boolean))}),E=D(()=>SN(M.value,w.value,e.customMarkdownIt,{includeFinal:!0})),I=D(()=>SN(M.value,w.value,e.customMarkdownIt,{includeFinal:!1}));qe([E,I],([W,P],[O,R])=>{O&&(W===O&&P===R||(T(),P!==R&&(l=[],c="")))},{flush:"sync"});const F=D(()=>{var W,P,O,R,z,H,j,K,re,q,Q;if((W=e.nodes)!=null&&W.length)return l=[],c="",C(0),Ft(e.nodes.slice());const ne=r.value;if(!ne)return l=[],c="",C(-1),[];const te=t.debugPerformanceEnabled.value,ge=te?Na():0,Ae=w.value,me=E.value,de=I.value;a&&me!==a&&(function(Ue){var at,bt;(bt=(at=Ue.stream)==null?void 0:at.reset)==null||bt.call(at)})(Ae),u&&de!==u&&(l=[],c="");const Y=Object.keys((O=(P=t.customComponentsMap)==null?void 0:P.value)!=null?O:{}).length>0||typeof M.value.postTransformNodes=="function";Y!==d&&(l=[],c="");const ue=!Y&&l.length>0&&ne.startsWith(c)&&de===u,Z=te?xN(Ae):null,se=te?{}:void 0,ke=EN(Ae),be=!ke&&!Y,we=Ot(Ot(On(Ot({},M.value),{__reuseStableTopLevelNodes:be}),ke?{__disableStreamParse:!0}:{}),se?{__timing:se}:{}),oe=xH(ne,Ae,we),J=te?Na():0,fe=te?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ve,Ce=te?ny(oe.length):void 0,le=0,ie=0,Ee=0;if(ue){const Ue=te?Na():0,[at,bt]=(function(Pt){var Zt,Ut;const[Le,Re]=Pt.scanGlobalReferenceAppend(Pt.previousContent,Pt.content),Ze=Pt.parseOptions;return[Pt.previousDirtyStartIndex>0&&Ze.final!==!0&&!Pt.customMarkdownIt&&!EN(Pt.md)&&!Le&&typeof Ze.preTransformTokens!="function"&&typeof Ze.postTransformTokens!="function"&&typeof Ze.postTransformNodes!="function"&&((Ut=(Zt=Ze.customHtmlTags)==null?void 0:Zt.length)!=null?Ut:0)===0?Pt.previousDirtyStartIndex:0,Re]})({content:ne,previousContent:c,previousDirtyStartIndex:y,parseOptions:M.value,customMarkdownIt:e.customMarkdownIt,md:Ae,scanGlobalReferenceAppend:f});Ee=bt;const It=at<=0;if(fe){const Pt=(function(Zt,Ut,Le,Re={}){var Ze;if(!Ut.length)return{nodes:Zt,metrics:ny(Zt.length)};const st=(Ze=Re.scanStartIndex)!=null?Ze:0,Bt=Re.reuseDirtyTail!==!1,Nt=(function(ft,Fe,Ve,mt=0){const qt=Math.min(ft.length,Fe.length);for(let jt=Math.min(qt,Math.max(0,mt));jtUd(Ue[It]))})(ve,fe,ie):(function(Ue,at=0){for(let bt=Math.max(0,at);bt((z=Z?.total)!=null?z:0);t.logPerf(at?"parse(stream)":"parse(sync)",Ot(Ot(Ot({rendererId:t.instanceMsgId,ms:Math.round(Na()-ge),nodes:ve.length,contentLength:ne.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:Ke,referenceDefinitionScanChars:Ee,signatureMs:(H=fe?.signatureMs)!=null?H:0,stabilizeSignatureMs:(j=fe?.stabilizeSignatureMs)!=null?j:0,primeSignatureMs:(K=fe?.primeSignatureMs)!=null?K:0,signatureCallCount:(re=fe?.signatureCallCount)!=null?re:0,stabilizeSignatureCallCount:(q=fe?.stabilizeSignatureCallCount)!=null?q:0,primeSignatureCallCount:(Q=fe?.primeSignatureCallCount)!=null?Q:0,stabilizeMs:le},Ce??{}),se?Object.fromEntries(lke.map(bt=>{var It;return[bt,(It=se[bt])!=null?It:0]})):{}),Ue?{streamMode:Ue.lastMode,streamDelta:mke(Ue,Z),streamStats:Ue}:{}))}return Ft(ve)});return{effectiveCustomHtmlTags:N,effectiveCustomHtmlTagsSet:x,mdBase:_,mdInstance:w,mergedParseOptions:M,getParsedNodesDirtyStartIndex:()=>y,getParsedNodesRevision:()=>b,parsedNodes:F}}function vke(e){const{isClient:t}=e,n=U(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const v=n.value,y=v.has(f);if(h){if(y)return;const C=new Set(v);return C.add(f),void(n.value=C)}if(!y)return;const b=new Set(v);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return Av()&&Jd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const kke={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},LN=/auto|scroll|overlay/i;function bke(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return LN.test(t)||LN.test(n)}function wke(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const Cke={class:"m-0 p-0"},Ake=["data-probe"],xke=$i(ct(On(Ot({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),L("div",{class:"height-estimation-probes",style:sn({width:`${e.width}px`}),"aria-hidden":"true"},[S("div",{ref:s=>e.setParagraphWrapper(s),class:$e(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[V(p(wh),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),S("div",{ref:s=>e.setListItemWrapper(s),class:$e(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[S("ul",Cke,[V(p(b1),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),S("div",{ref:s=>e.setListWrapper(s),class:$e(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[V(p(w1),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),L(Be,null,xt(6,s=>S("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:$e(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[V(p(n4),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,Ake)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),NN=ct({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return kk((i=Yp(e.estimatedPreviewHeightPx))!=null?i:vk(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Fn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Fn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Fn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Fn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Fn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Fn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Fn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Fn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Fn("div",{class:"absolute inset-0"},[Fn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),DN=ct({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return yk((i=Yp(e.estimatedPreviewHeightPx))!=null?i:gk(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Fn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Fn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Fn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Fn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Fn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Fn("span",{class:"action-icon block"})])))]):null,Fn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Fn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Fn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),Ske={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Ps(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const _ke=["data-custom-id"],Mke=["data-node-index","data-node-type"],FN="typewriter-simple-cursor-target",mW=$i(ct(On(Ot({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s($){if(!(typeof Event<"u"&&$ instanceof Event))return typeof $=="string"&&o("copy-code",$),void o("copy",$)}const r=As(),l=tn("markstreamNestedRendererProps",void 0);function a($){const X=r?.vnode.props;return!!X&&(Object.prototype.hasOwnProperty.call(X,$)||Object.prototype.hasOwnProperty.call(X,String($).replace(/[A-Z]/g,he=>`-${he.toLowerCase()}`)))}function u($){var X,he;const pe=i[$];return a($)?pe:(he=(X=l?.value)==null?void 0:X[$])!=null?he:pe}const c=D(()=>{return($=u("mode"))==="chat"||$==="minimal"||$==="docs"?$:"docs";var $}),d=D(()=>bN(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return($={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":$.codeRenderer==="pre"||$.codeRenderer==="shiki"||$.codeRenderer==="monaco"?$.codeRenderer:$.renderCodeBlocksAsPre===!1||$.mode==="docs"?"monaco":"pre";var $}),g=D(()=>Ske[c.value]),v=D(()=>{var $;return($=u("showTooltips"))!=null?$:g.value.showTooltips}),y=D(()=>{var $;return($=u("fade"))!=null?$:g.value.fade}),b=D(()=>{var $;return($=u("batchRendering"))!=null?$:g.value.batchRendering}),C=D(()=>{var $;return($=u("initialRenderBatchSize"))!=null?$:g.value.initialRenderBatchSize}),A=D(()=>{var $;return($=u("renderBatchSize"))!=null?$:g.value.renderBatchSize}),T=D(()=>{var $;return($=u("renderBatchDelay"))!=null?$:g.value.renderBatchDelay}),N=D(()=>{var $;return($=u("renderBatchBudgetMs"))!=null?$:g.value.renderBatchBudgetMs}),_=D(()=>{var $;return($=u("renderBatchIdleTimeoutMs"))!=null?$:g.value.renderBatchIdleTimeoutMs}),w=D(()=>{var $;return($=u("deferNodesUntilVisible"))!=null?$:g.value.deferNodesUntilVisible}),M=D(()=>{var $;return($=u("maxLiveNodes"))!=null?$:g.value.maxLiveNodes}),x=D(()=>{var $;return($=u("liveNodeBuffer"))!=null?$:g.value.liveNodeBuffer}),E=D(()=>{var $;return($=u("nodeVirtual"))!=null?$:g.value.nodeVirtual}),I={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return v.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return y.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return C.value},get renderBatchSize(){return A.value},get renderBatchDelay(){return T.value},get renderBatchBudgetMs(){return N.value},get renderBatchIdleTimeoutMs(){return _.value},get deferNodesUntilVisible(){return w.value},get maxLiveNodes(){return M.value},get liveNodeBuffer(){return x.value},get nodeVirtual(){return E.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function F($){o("height-change",$)}function W($){o("virtual-state-change",$)}function P($){o("anchor-change",$)}const O=U(),R=U(null),z=U(null),H=U(null),j=co({1:null,2:null,3:null,4:null,5:null,6:null}),K=U(!1),re=new Map,q=U(0),Q=U(0),ne=U({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function te($,X){return typeof $!="string"?X:$.trim()||X}function ge($){const X=Number($);return Number.isFinite(X)&&X>0?Math.max(1,Math.trunc(X)):640}const Ae=D(()=>{var $;const X=($=I.viewportPriorityOptions)!=null?$:{},he=te(X.rootMargin,Fh);return{rootMargin:he,heavyBlockMargin:te(X.heavyBlockMargin,he),maxTargets:ge(X.maxTargets)}}),me=D(()=>{var $;return($=Ae.value.rootMargin)!=null?$:Fh}),de=D(()=>{var $;return($=Ae.value.maxTargets)!=null?$:640});function Y(){var $,X;if((($=i.virtualScroll)==null?void 0:$.enabled)!==!0)return null;const he=(X=i.virtualScroll)==null?void 0:X.scrollRoot;return ue(typeof he=="function"?he():he)}function ue($){return $?typeof HTMLElement<"u"&&$ instanceof HTMLElement?$:typeof $=="object"&&"value"in $?ue($.value):typeof $=="object"&&"$el"in $?ue($.$el):null:null}ri(JH,Ae);const{isClient:Z,renderAsFragment:se,debugPerformanceEnabled:ke,resolvedShowTooltips:be,resolvedHtmlPolicy:we,inheritedSmoothStreaming:oe,ownsTypewriterCursor:J}=(function($){const X=typeof window<"u",he=sm(),pe=tn("markstreamHtmlPolicy",void 0),Ne=tn("markstreamTypewriterCursor",void 0),ze=tn("markstreamSmoothStreaming",void 0),tt=D(()=>$.renderAsFragment===!0),ot=D(()=>!!($.debugPerformance&&X&&typeof console<"u")),kt=D(()=>{var yt;if(typeof $.showTooltips=="boolean")return $.showTooltips;const nt=(yt=he.showTooltips)!=null?yt:he["show-tooltips"];return nt===""||nt===!0||nt==="true"||nt!==!1&&nt!=="false"&&void 0}),rt=D(()=>{var yt,nt;return(nt=(yt=$.htmlPolicy)!=null?yt:pe?.value)!=null?nt:"safe"}),ht=D(()=>Ne?.value!==!0);return{isClient:X,renderAsFragment:tt,debugPerformanceEnabled:ot,resolvedShowTooltips:kt,resolvedHtmlPolicy:rt,inheritedSmoothStreaming:ze,inheritedTypewriterCursor:Ne,ownsTypewriterCursor:ht}})(I),{resolveViewportRoot:fe,resolveScrollContainer:ve,isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:le,getOffsetTopWithinRoot:ie}=(function($,X){function he(){var ot,kt;return(kt=(ot=X.scrollRoot)==null?void 0:ot.call(X))!=null?kt:null}function pe(ot){if(typeof window>"u")return null;const kt=he();if(kt)return kt;const rt=ot??$.value;if(!rt)return null;const ht=rt.ownerDocument||document,yt=ht.scrollingElement||ht.documentElement;let nt=rt;for(;nt&&nt!==ht.body&&nt!==yt;){if(bke(window.getComputedStyle(nt))&&wke(nt))return nt;nt=nt.parentElement}return null}function Ne(ot){if(!X.isClient)return!1;try{const kt=window.getComputedStyle(ot);return!!(kt.display||"").toLowerCase().includes("flex")&&(kt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ze(ot,kt,rt){var ht,yt;if(rt)return tt(kt);const nt=ot.scrollTop;if(!Ne(ot))return nt;const pt=nt<0?-nt:nt;return Math.max(0,((ht=ot.scrollHeight)!=null?ht:0)-((yt=ot.clientHeight)!=null?yt:0))-pt}function tt(ot){var kt,rt,ht,yt,nt;const pt=Number((kt=ot.scrollingElement)==null?void 0:kt.scrollTop),St=Number((ht=(rt=ot.documentElement)==null?void 0:rt.scrollTop)!=null?ht:0),wt=Number((nt=(yt=ot.body)==null?void 0:yt.scrollTop)!=null?nt:0);return Math.max(0,Number.isFinite(pt)?pt:0,Number.isFinite(St)?St:0,Number.isFinite(wt)?wt:0)}return{resolveViewportRoot:pe,resolveScrollContainer:function(ot){var kt,rt,ht,yt;const nt=he();if(nt)return nt;const pt=pe((kt=ot??$.value)!=null?kt:null);if(pt)return pt;const St=(yt=(ht=ot?.ownerDocument)!=null?ht:(rt=$.value)==null?void 0:rt.ownerDocument)!=null?yt:typeof document<"u"?document:null;return St?.scrollingElement||St?.documentElement||null},isReverseFlexScrollRoot:Ne,getNormalizedScrollTop:ze,getOffsetTopWithinRoot:function(ot,kt){const rt=kt.ownerDocument||ot.ownerDocument||document;if((function(pt,St){return pt===St.documentElement||pt===St.body||pt===St.scrollingElement})(kt,rt))return ot.getBoundingClientRect().top+tt(rt);const ht=kt.getBoundingClientRect(),yt=ot.getBoundingClientRect(),nt=ze(kt,rt,!1);return yt.top-ht.top+nt}}})(O,{isClient:Z,scrollRoot:Y});ri("markstreamShowTooltips",be),ri("markstreamHtmlPolicy",we),ri("markstreamTypewriter",f),ri("markstreamFade",D(()=>I.fade!==!1)),ri("markstreamTypewriterCursor",D(()=>!0)),ri("markstreamTextStreamState",re),ri("markstreamStreamVersion",q),ri("markstreamParseOptions",D(()=>I.parseOptions)),ri("markstreamCustomMarkdownIt",D(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Ee,renderContent:Ke,requestedFinal:Ue,effectiveFinal:at}=(function($,X){const he=yke(Ot(Ot({},kke),$.smoothStreamingOptions)),pe=D(()=>{var nt,pt,St;return $.smoothStreaming!==!1&&!((nt=$.nodes)!=null&&nt.length)&&($.smoothStreaming===!0||!((pt=X.inheritedSmoothStreaming)!=null&&pt.value))&&($.smoothStreaming===!0||bN($.typewriter)!=="off"||((St=$.maxLiveNodes)!=null?St:0)<=0)}),Ne=U(!X.isClient||$.smoothStreaming===!0);vn(()=>{Ne.value=!0});const ze=D(()=>Ne.value&&pe.value),tt=D(()=>{var nt;return ze.value?he.visible.value:(nt=$.content)!=null?nt:""}),ot=D(()=>{var nt,pt;const St=(nt=$.parseOptions)!=null?nt:{};return(pt=$.final)!=null?pt:St.final}),kt=D(()=>{const nt=ot.value;return ze.value&&nt!=null?!!nt&&he.caughtUp.value:nt});let rt=0,ht=!1;function yt(){rt=0,ht=!1}return qe([()=>$.content,()=>$.nodes,ze,ot],([nt,pt,St,wt])=>{if(pt?.length)return yt(),void he.reset("");const Vt=nt??"";if(!St)return yt(),he.reset(Vt),void(wt&&he.finish({flush:!0}));const Dt=he.source.value;if(Vt){if(Vt!==Dt)if(Vt.startsWith(Dt)){const rn=Vt.slice(Dt.length),hn=he.pendingChars.value;rn.length<=8?(rt++,ht||rt>=2&&hn<=8?(ht=!0,he.reset(Vt)):he.enqueue(rn)):(yt(),he.enqueue(rn))}else yt(),he.reset(Vt)}else yt(),he.reset("");wt&&he.finish()},{immediate:!0}),{smoothStream:he,smoothStreamingEligible:pe,smoothStreamingEnabled:ze,renderContent:tt,requestedFinal:ot,effectiveFinal:kt}})(I,{isClient:Z,inheritedSmoothStreaming:oe}),bt=Ue.value===!0;ri("markstreamSmoothStreaming",Ee);const It=U(!1),Pt=U(!1),Zt=U(!1);let Ut="",Le=!1,Re=null;function Ze(){Z&&Re!=null&&(window.clearTimeout(Re),Re=null)}function st(){It.value=!1,Ze()}function Bt($,X){if(!ke.value)return;const he=(function(){if(!ke.value)return null;const pe=Fe(Nt),Ne=Fe(Qt),ze=Math.max(ft,Ne);if(pe<=0&&ze<=0)return null;const tt={total:pe,maxPerFrame:ze,byLabel:(ot=Nt,Object.fromEntries(Array.from(ot.entries()).sort((kt,rt)=>rt[1]-kt[1]||kt[0].localeCompare(rt[0]))))};var ot;return Nt.clear(),Qt.clear(),ft=0,tt})();console.info(`[markstream-vue][perf] ${$}`,he?On(Ot({},X),{layoutReads:he}):X)}qe([()=>I.indexKey,()=>I.customId],()=>{var $,X;st(),Pt.value=!1,Zt.value=!(($=i.nodes)!=null&&$.length)&&Ue.value!==!0&&!!i.content,Ut=(X=Ke.value)!=null?X:"",Le=Ut.length>0},{flush:"sync"}),qe([()=>i.content,()=>i.nodes,Ue],([$,X,he])=>{!X?.length&&he!==!0&&$&&(Zt.value=!0)},{flush:"sync",immediate:!0}),qe([Ke,()=>i.nodes,Ue],([$,X,he])=>{const pe=$??"";return X?.length||he===!0?(st(),Pt.value=!1,Ut=pe,void(Le=!0)):(pe.length>0&&(Zt.value=!0),Le?(Ut&&pe.length>Ut.length&&pe.startsWith(Ut)?(It.value=!0,Pt.value=!0,Z&&(Ze(),Re=window.setTimeout(()=>{var Ne;Re=null,at.value===!0||(Ne=i.nodes)!=null&&Ne.length||(fp(),It.value=!1,Ku())},1200))):(pe.length"u")return null;const ze=window;if(ze.__markstreamLayoutReadPerformance)return ze.__markstreamLayoutReadPerformance;const tt={total:0,maxPerFrame:0,byLabel:{}};return ze.__markstreamLayoutReadPerformance=tt,tt})();Ne&&(Ne.total=Number(Ne.total||0)+1,Ne.byLabel[pe]=Number(Ne.byLabel[pe]||0)+1,Ne.currentFrameTotal=Number(Ne.currentFrameTotal||0)+1,Ne.frameScheduled||(Ne.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>mt(Ne),0):queueMicrotask(()=>mt(Ne)):window.requestAnimationFrame(()=>mt(Ne))))})($),De||(De=!0,Z&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ve):typeof queueMicrotask!="function"?setTimeout(Ve,0):queueMicrotask(Ve)))}function jt($,X){return qt($),X()}const Sn=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Rn=(function($){const X=new Map;return{scope:$,cache:X,clear:()=>X.clear()}})(Sn),ho=Sn;ri(rW,Rn);const xi=xs(()=>I.customId),{effectiveCustomHtmlTagsSet:xo,mergedParseOptions:lt,parsedNodes:Qe,getParsedNodesDirtyStartIndex:ut,getParsedNodesRevision:Dn}=gke(I,{instanceMsgId:Sn,renderContent:Ke,effectiveFinal:at,smoothStreamingEnabled:Ee,debugPerformanceEnabled:ke,customComponentsMap:xi,logPerf:Bt});qe(Qe,()=>{It.value||Rn.clear(),q.value+=1},{immediate:!0});const Ct=D(()=>({customId:I.customId,customHtmlTags:lt.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:we.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:Ae.value,mode:c.value,domMode:I.domMode,codeRenderer:m.value,codeBlockStream:I.codeBlockStream,codeBlockDarkTheme:I.codeBlockDarkTheme,codeBlockLightTheme:I.codeBlockLightTheme,codeBlockMonacoOptions:I.codeBlockMonacoOptions,renderCodeBlocksAsPre:I.renderCodeBlocksAsPre,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockProps:I.codeBlockProps,mermaidProps:I.mermaidProps,d2Props:I.d2Props,infographicProps:I.infographicProps,showTooltips:be.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:f.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));ri("markstreamNestedRendererProps",Ct);const Zn=D(()=>Qe.value),Ss=D(()=>Qe.value.length),po=U(null),Bs=U(null),qs=U(null),Nr=U(null),ts=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Ji=!ts&&I.customId?mN(I.customId):null,pr=D(()=>Ji?(j8.value,mN(I.customId)):null),bi=D(()=>{var $;return!!(!se.value&&I.customId&&!ts&&(($=pr.value)!=null&&$.enabled))}),Bo=D(()=>!!(Z&&bi.value)),So=D(()=>{var $;return!!(!se.value&&(($=i.virtualScroll)!=null&&$.enabled))}),Rs=D(()=>So.value),Ko=U(!1);vn(()=>{Ko.value=!0});const ei=D(()=>!!(Z&&So.value));ri("markstreamHostScrollManaged",ei);const ns=D(()=>!!(Ko.value&&ei.value)),Pi=D(()=>Bo.value||ei.value),ci=D(()=>Bo.value||ns.value),Ni=D(()=>{var $;return Pi.value&&(($=pr.value)==null?void 0:$.textEstimation)!==!1});function Si(){const $=Q.value||jt("getMeasuredContainerWidth.clientWidth",()=>{var X;return((X=O.value)==null?void 0:X.clientWidth)||0});return Number.isFinite($)&&$>0?$:0}const di=D(()=>{const $=Si();return $>0?Math.max(1,Math.round($)):640}),pi=D(()=>{var $,X;return!(at.value!==!0||So.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||($=i.nodes)!=null&&$.length||Zt.value||!(((X=I.maxLiveNodes)!=null?X:0)<=0))}),no=D(()=>{var $;return pi.value?50:Math.max(1,($=I.maxLiveNodes)!=null?$:320)}),io=D(()=>{var $;return pi.value?16:Math.max(0,($=I.liveNodeBuffer)!=null?$:60)}),En=D(()=>{var $;return!se.value&&I.nodeVirtual!==!1&&!((($=I.maxLiveNodes)!=null?$:0)<=0&&!pi.value)&&(I.nodeVirtual===!0?Qe.value.length>0:Qe.value.length>no.value)}),mr=D(()=>En.value||Bo.value||ei.value),el=D(()=>I.viewportPriority!==!1),Ro=D(()=>!!el.value&&!K.value);var _o;_o=D(()=>el.value),ri(XH,_o);const oo=D(()=>{var $;return!(se.value||I.deferNodesUntilVisible===!1||(($=I.maxLiveNodes)!=null?$:0)<=0||En.value||Qe.value.length>900||I.viewportPriority===!1)}),Xi=Y2e($=>{var X;return fe((X=$??O.value)!=null?X:null)},el),{requestFrame:eo,cancelFrame:Ki,hasIdleCallback:He,isTestEnv:_e}=(function($){const X=$.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,he=$.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,pe=$.isClient&&typeof window.requestIdleCallback=="function",Ne=(function(){var ze;if(typeof globalThis>"u"||!("process"in globalThis))return;const tt=(ze=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:ze.value;return tt?.env})();return{requestFrame:X,cancelFrame:he,hasIdleCallback:pe,isTestEnv:Ne?.NODE_ENV==="test"}})({isClient:Z}),je=D(()=>at.value===!0&&!So.value),{resolvedBatchSize:dn,resolvedInitialBatch:ti,batchingEnabled:oi,incrementalRenderingActive:Zi,renderedCount:Jn,previousRenderContext:Us,adaptiveBatchSize:is,previousBatchConfig:it}=(function($,X){var he;const pe=D(()=>{var yt;const nt=Math.trunc((yt=$.renderBatchSize)!=null?yt:80);return Number.isFinite(nt)?Math.max(0,nt):0}),Ne=D(()=>{var yt;const nt=Math.trunc((yt=$.initialRenderBatchSize)!=null?yt:pe.value);return Number.isFinite(nt)?Math.max(0,nt):pe.value}),ze=D(()=>!X.renderAsFragment.value&&$.batchRendering!==!1&&pe.value>0&&X.isClient&&!X.isTestEnv),tt=U(0),ot=U({key:$.indexKey,total:0}),kt=U(Math.max(1,pe.value||1)),rt=D(()=>{var yt,nt,pt;return ze.value&&!((yt=X.continuousStreaming)!=null&&yt.value)&&!((nt=X.forceFullRenderFinalContent)!=null&&nt.value)&&((pt=$.maxLiveNodes)!=null?pt:0)<=0}),ht=U({batchSize:pe.value,initial:Ne.value,delay:(he=$.renderBatchDelay)!=null?he:16,enabled:rt.value});return{resolvedBatchSize:pe,resolvedInitialBatch:Ne,batchingEnabled:ze,incrementalRenderingActive:rt,renderedCount:tt,previousRenderContext:ot,adaptiveBatchSize:kt,previousBatchConfig:ht}})(I,{isClient:Z,isTestEnv:_e,renderAsFragment:se,forceFullRenderFinalContent:je,continuousStreaming:D(()=>Pt.value&&at.value!==!0)}),Ye=D(()=>{var $;return!se.value&&I.batchRendering!==!1&&dn.value>0&&!_e&&(($=I.maxLiveNodes)!=null?$:0)<=0&&!je.value}),Mt=D(()=>Ye.value),zt=D(()=>Pi.value||Mt.value),Pn=D(()=>{var $;return zt.value&&(($=pr.value)==null?void 0:$.codeBlockEstimation)!==!1}),mi=new Map,Mo=new Map,Zo=new WeakMap;let Oo=null;const Io=new WeakMap,Gn=new Map,Vs=[];let Di=[],Ks=[],Go=-1;const Dr=Ya(Vs),$o=new Set,Ql=U(0);let ss=0;const Yl=U(0),vf=D(()=>(Yl.value,Array.from(mi.entries()).sort(($,X)=>$[0]-X[0]))),Jl=U(null),Qo=U(null);let Os,_l=null,tu=0,Fr=null;function so(){Os.markFallbackHeightPrefixDirty()}function nu($){return Os.getFallbackNodeHeight($)}function Zs($,X){return Os.estimateHeightRange($,X)}function Po($){return Os.estimateIndexForOffset($)}const{activeRestoreAnchor:rs,getRelativeScrollTopWithinContainer:Gs,setRelativeScrollTopWithinContainer:Xl,resolveAnchorOffset:ea,clearRestoreReconcile:Br,scheduleRestoreReconcile:_a,captureRestoreAnchor:iu,restoreAnchor:Ml,getAnchorDrift:Uu}=(function($){const{isClient:X,containerRef:he,parsedNodeCount:pe,requestFrame:Ne,cancelFrame:ze,resolveScrollContainer:tt,getNormalizedScrollTop:ot,getOffsetTopWithinRoot:kt,isReverseFlexScrollRoot:rt,estimateIndexForOffset:ht,estimateHeightRange:yt,getFallbackNodeHeight:nt,clamp:pt}=$,St=U(null);let wt=null,Vt=[];function Dt(){const An=tt(),Kn=he.value;if(!An||!Kn)return null;const ii=An.ownerDocument||Kn.ownerDocument||document;if(An===ii.documentElement||An===ii.body||An===ii.scrollingElement){const Wi=Kn.getBoundingClientRect();return Math.max(0,-Wi.top)}return Math.max(0,ot(An,ii,!1)-kt(Kn,An))}function rn(An){var Kn;const ii=tt(),Wi=he.value;if(!ii||!Wi)return;const er=Math.max(0,An),$s=ii.ownerDocument||Wi.ownerDocument||document,Ea=$s.defaultView||(typeof window<"u"?window:null);if(ii===$s.documentElement||ii===$s.body||ii===$s.scrollingElement){const lu=ot(ii,$s,!0)+Wi.getBoundingClientRect().top;return void((Kn=Ea?.scrollTo)==null||Kn.call(Ea,0,Math.max(0,lu+er)))}yN(ii,$s,kt(Wi,ii)+er,{isReverseFlexScrollRoot:lu=>{var qm;return(qm=rt?.(lu))!=null&&qm},getNormalizedScrollTop:ot})}function hn(An){const Kn=pe.value,ii=pt(An.nodeIndex,0,Math.max(0,Kn-1));return yt(0,ii)+Math.max(0,An.offsetWithinNodePx)}function Cn(){if(wt!=null&&(ze?.(wt),wt=null),X)for(const An of Vt)window.clearTimeout(An);Vt=[]}function kn(An){const Kn=hn(An),ii=Dt();ii!=null&&Math.abs(ii-Kn)<=.5||rn(Kn)}return{activeRestoreAnchor:St,getRelativeScrollTopWithinContainer:Dt,setRelativeScrollTopWithinContainer:rn,resolveAnchorOffset:hn,clearRestoreReconcile:Cn,applyRestoreAnchor:kn,scheduleRestoreReconcile:function(){St.value&&X&&wt==null&&(wt=Ne?Ne(()=>{wt=null,St.value&&kn(St.value)}):null,wt==null&&St.value&&kn(St.value))},captureRestoreAnchor:function(){const An=Dt(),Kn=pe.value;if(An==null||Kn<=0)return null;const ii=pt(ht(An+1),0,Kn-1),Wi=yt(0,ii),er=nt(ii);return{nodeIndex:ii,offsetWithinNodePx:pt(An-Wi,0,Math.max(0,er-1))}},restoreAnchor:function(An){const Kn=pe.value;if(St.value={nodeIndex:pt(An.nodeIndex,0,Math.max(0,Kn-1)),offsetWithinNodePx:Math.max(0,An.offsetWithinNodePx)},Cn(),kn(St.value),X)for(const ii of[0,120,280,480])Vt.push(window.setTimeout(()=>{St.value&&kn(St.value)},ii))},getAnchorDrift:function(An){const Kn=Dt();return Kn==null?null:Kn-hn(An)}}})({isClient:Z,containerRef:O,parsedNodeCount:Ss,requestFrame:eo,cancelFrame:Ki,resolveScrollContainer:()=>Jl.value||ve(),getNormalizedScrollTop:le,getOffsetTopWithinRoot:ie,isReverseFlexScrollRoot:Ce,estimateIndexForOffset:Po,estimateHeightRange:Zs,getFallbackNodeHeight:nu,clamp:Xs}),{nodeHeights:ls,heightStats:as,heightTreeSize:G,heightSumTree:ye,heightKnownTree:Oe,averageNodeHeight:We,resetHeightMeasurements:Ge,pruneHeightMeasurements:Je,rebuildHeightTrees:gt,recordNodeHeight:Rt,removeNodeHeights:en,exportHeightCache:gn,importHeightCache:_n,fenwickRangeSum:Wn}=(function($={}){const X=co({}),he=co({total:0,count:0}),pe=U(0),Ne=U([]),ze=U([]);function tt(){for(const nt of Object.keys(X))delete X[Number(nt)];he.total=0,he.count=0,pe.value=0,Ne.value=[],ze.value=[]}function ot(nt,pt,St){for(let wt=pt+1;wt0;wt-=wt&-wt)St+=nt[wt];return St}function rt(nt){pe.value=nt;const pt=new Array(nt+1).fill(0),St=new Array(nt+1).fill(0);for(const[wt,Vt]of Object.entries(X)){const Dt=Number(wt),rn=Number(Vt);!Number.isFinite(Dt)||Dt<0||Dt>=nt||!Number.isFinite(rn)||rn<=0||(ot(pt,Dt,rn),ot(St,Dt,1))}Ne.value=pt,ze.value=St}function ht(nt){if(!Number.isInteger(nt)||nt<0)return!1;const pt=X[nt];if(!Number.isFinite(pt)||pt<=0)return!1;if(delete X[nt],he.total=Math.max(0,he.total-pt),he.count=Math.max(0,he.count-1),pe.value>nt){const St=Ne.value,wt=ze.value;St.length&&wt.length&&(ot(St,nt,-pt),ot(wt,nt,-1))}return!0}const yt=D(()=>he.count>0?Math.max(12,he.total/he.count):32);return{nodeHeights:X,heightStats:he,heightTreeSize:pe,heightSumTree:Ne,heightKnownTree:ze,averageNodeHeight:yt,resetHeightMeasurements:tt,pruneHeightMeasurements:function(nt){if(nt<=0)return void tt();let pt=0,St=0;for(const[wt,Vt]of Object.entries(X)){const Dt=Number(wt),rn=Number(Vt);!Number.isFinite(Dt)||Dt<0||Dt>=nt||!Number.isFinite(rn)||rn<=0?delete X[Dt]:(pt+=rn,St++)}he.total=pt,he.count=St},rebuildHeightTrees:rt,recordNodeHeight:function(nt,pt,St={}){(function(wt,Vt,Dt={}){var rn;if(!Number.isFinite(Vt)||Vt<=0)return!1;const hn=X[wt];if(hn&&(Dt.allowShrink===!1&&Vtwt){const Cn=Ne.value,kn=ze.value;if(Cn.length&&kn.length)if(hn){const An=Vt-hn;An!==0&&ot(Cn,wt,An)}else ot(Cn,wt,Vt),ot(kn,wt,1)}Dt.notify!==!1&&((rn=$.onHeightRecorded)==null||rn.call($))})(nt,pt,On(Ot({},St),{notify:!0}))},removeNodeHeight:function(nt,pt={}){var St;const wt=ht(nt);return wt&&pt.notify!==!1&&((St=$.onHeightRecorded)==null||St.call($)),wt},removeNodeHeights:function(nt,pt={}){var St;let wt=0;for(const Vt of nt)ht(Number(Vt))&&wt++;return wt>0&&pt.notify!==!1&&((St=$.onHeightRecorded)==null||St.call($)),wt},exportHeightCache:function(){return Object.entries(X).map(([nt,pt])=>({index:Number(nt),height:Number(pt)})).filter(nt=>Number.isFinite(nt.index)&&nt.index>=0&&Number.isFinite(nt.height)&&nt.height>0).sort((nt,pt)=>nt.index-pt.index)},importHeightCache:function(nt,pt={}){var St;if(!Array.isArray(nt))return;const wt=pe.value;let Vt=!1;if(pt.mode!=="merge"){const Dt=Object.keys(X);if(Dt.length>0){for(const rn of Dt)delete X[Number(rn)];Vt=!0}}for(const Dt of nt){const rn=Number(Dt.index),hn=Number(Dt.height);if(!Number.isInteger(rn)||rn<0||wt>0&&rn>=wt||!Number.isFinite(hn)||hn<=0)continue;const Cn=X[rn];Cn&&Math.abs(Cn-hn)<=1||(X[rn]=hn,Vt=!0)}Vt&&((function(){let Dt=0,rn=0;const hn=pe.value;for(const[Cn,kn]of Object.entries(X)){const An=Number(Cn),Kn=Number(kn);!Number.isFinite(An)||An<0||hn>0&&An>=hn||!Number.isFinite(Kn)||Kn<=0?delete X[An]:(Dt+=Kn,rn++)}he.total=Dt,he.count=rn})(),wt>0&&rt(wt),(St=$.onHeightRecorded)==null||St.call($))},fenwickRangeSum:function(nt,pt,St){if(St<=pt)return 0;const wt=kt(nt,St-1);return pt<=0?wt:wt-kt(nt,pt-1)}}})({onHeightRecorded:()=>{so(),ei.value&&$m(),rs.value&&_a(),Qo.value&&up(),ro("node-resize")}});function an($){Number.isInteger($)&&$>=0&&$o.add($)}function Mn($){for(const X of $)an(Number(X))}function Ln($){ss++;let X=!0;try{const he=$();return X=he!==!1,he}finally{ss--,ss===0&&X&&Ql.value++}}function xn(){Di=[],Ks=[],Go=-1,$o.clear(),Dr.value=Vs}function to(){xn(),Ln(()=>Ge()),Gn.clear()}function Qs($){!Number.isInteger($)||$<0||$>=Qe.value.length||Gn.set($,Mm($))}function tl($,X,he={}){const pe=ls[$];an($),Rt($,X,he);const Ne=ls[$];return Object.is(pe,Ne)?($o.delete($),!1):(Ne&&Ne>0?Qs($):pe&&Gn.delete($),!0)}function Ys($,X){const he=jt("getNodeLayoutHeight.slot.offsetHeight",()=>{var pe,Ne;return(Ne=(pe=mi.get($))==null?void 0:pe.offsetHeight)!=null?Ne:0});return he>0?he:jt("getNodeLayoutHeight.content.offsetHeight",()=>X.offsetHeight)}function Me($,X={}){X.mode!=="merge"?xn():Mn($.map(he=>he.index)),Ln(()=>_n($,X)),s3()}const Te=D(()=>oo.value&&Ro.value),Xe=D(()=>{var $;return!se.value&&I.batchRendering!==!1&&dn.value>0&&(($=I.maxLiveNodes)!=null?$:0)<=0}),Tt=D(()=>!se.value&&bt&&at.value===!0&&!En.value&&!So.value&&!bi.value&&!Te.value&&!Xe.value),cn=D(()=>!!Xi&&Te.value),jn=D(()=>En.value||ei.value),{focusIndex:Un,liveRange:zn,updateLiveRange:vo}=(function($,X){const{parsedNodeCount:he,virtualizationEnabled:pe,maxLiveNodesResolved:Ne,liveNodeBufferResolved:ze,clamp:tt}=X,ot=ze??D(()=>{var ht;return Math.max(0,(ht=$.liveNodeBuffer)!=null?ht:60)}),kt=U(0),rt=co({start:0,end:0});return{liveNodeBufferResolved:ot,focusIndex:kt,liveRange:rt,updateLiveRange:function(){const ht=he.value;if(!pe.value||ht===0)return rt.start=0,void(rt.end=ht);const yt=Math.min(Ne.value,ht),nt=ot.value,pt=tt(kt.value-nt,0,Math.max(0,ht-yt));rt.start=pt,rt.end=Math.min(ht,pt+yt)}}})(I,{parsedNodeCount:Ss,virtualizationEnabled:En,maxLiveNodesResolved:no,liveNodeBufferResolved:io,clamp:Xs}),Js=new Map,Il=new Map,Ma=new Map,yf=[],Ia=new Map,Ta=new Set,np=U(0);let ou=!1;const n2=D(()=>(np.value,Ta.size)),us=new Map,ta=new Map,Am=U(0),xm=D(()=>{Am.value;let $=0;for(const X of us.values())$+=Math.max(0,X);return $});let gr=null;const Ie=D(()=>{if(!En.value)return Qe.value.length;const $=io.value,X=Math.max(zn.end+$,ti.value),he=Math.min(Qe.value.length,X);return Math.max(Jn.value,he)});function dt(){ou||(ou=!0,queueMicrotask(()=>{ou=!1,np.value+=1}))}function et($,X,he="node-resize"){if(!Z||typeof window>"u")return null;const pe=window.setTimeout(()=>{Ta.delete(pe)&&dt();try{X()}finally{ro(he)}},Math.max(0,$));return Ta.add(pe),dt(),pe}function At($){Z&&$!=null&&(Ta.delete($)&&dt(),window.clearTimeout($))}function nn(){if(Z&&typeof window<"u")for(const $ of Ta)window.clearTimeout($);Ta.size&&(Ta.clear(),dt()),yf.length=0,Ma.clear()}function yn($){R.value=$}function Bn($){z.value=$}function ni($){H.value=$}const{cancelScheduledFocusSync:In,scheduleFocusSync:yi}=(function($){const{isClient:X,containerRef:he,virtualizationEnabled:pe,requestFrame:Ne,cancelFrame:ze,syncFocusToScroll:tt}=$;let ot=null;function kt(){var ht,yt,nt;return(nt=(yt=(ht=he.value)==null?void 0:ht.ownerDocument)==null?void 0:yt.defaultView)!=null?nt:typeof window<"u"?window:null}function rt(){if(!ot)return;const ht=kt();ot.viaTimeout?ht?ht.clearTimeout(ot.id):clearTimeout(ot.id):ze?.(ot.id),ot=null}return{cancelScheduledFocusSync:rt,scheduleFocusSync:function(ht={}){if(!pe.value)return;if(!X)return void tt(!0);if(ht.immediate)return rt(),void tt(!0);if(ot)return;const yt=()=>{ot=null,tt()};if(Ne)return void(ot={id:Ne(yt),viaTimeout:!1});const nt=kt();ot={id:nt?nt.setTimeout(yt,16):setTimeout(yt,16),viaTimeout:!0}}}})({isClient:Z,containerRef:O,virtualizationEnabled:En,requestFrame:eo,cancelFrame:Ki,syncFocusToScroll:function($=!1){var X;if(!En.value)return;const he=Jl.value||ve();if(!he)return;const pe=he.ownerDocument||((X=O.value)==null?void 0:X.ownerDocument)||document,Ne=pe?.defaultView||(typeof window<"u"?window:null),ze=he===pe?.documentElement||he===pe?.body,tt=Qe.value.length;if(tt<=0)return;if(!ze&&tt>0&&Ce(he)){const wt=jt("syncFocusToScroll.clientHeight",()=>he.clientHeight||0),Vt=jt("syncFocusToScroll.scrollTop",()=>he.scrollTop),Dt=Vt<0?-Vt:Vt;return void i2(Xs((ot=Math.max(0,Dt)+.5*Math.max(0,wt),Os.estimateIndexForOffsetFromEnd(ot)),0,Math.max(0,tt-1)),$)}var ot;const kt=(function(wt,Vt,Dt,rn){const hn=O.value;if(!hn)return null;const Cn=rn?0:jt("syncFocusToScroll.model.root.getBoundingClientRect",()=>wt.getBoundingClientRect().top),kn=jt("syncFocusToScroll.model.container.getBoundingClientRect",()=>hn.getBoundingClientRect().top),An=Math.max(0,Cn-kn),Kn=rn?jt("syncFocusToScroll.model.viewport.clientHeight",()=>{var ii,Wi,er,$s;return($s=(er=(Wi=Dt?.innerHeight)!=null?Wi:(ii=Vt.documentElement)==null?void 0:ii.clientHeight)!=null?er:wt.clientHeight)!=null?$s:0}):jt("syncFocusToScroll.model.root.clientHeight",()=>wt.clientHeight);return Xs(Po(An+.5*Math.max(0,Kn)),0,Math.max(0,Qe.value.length-1))})(he,pe,Ne,ze);if(kt!=null)return void i2(kt,$);const rt=ze?null:jt("syncFocusToScroll.root.getBoundingClientRect",()=>he.getBoundingClientRect()),ht=ze?0:rt.top,yt=ze?jt("syncFocusToScroll.viewport.clientHeight",()=>{var wt,Vt;return(Vt=(wt=Ne?.innerHeight)!=null?wt:he.clientHeight)!=null?Vt:0}):rt.bottom,nt=vf.value;let pt=null,St=null;for(const[wt,Vt]of nt){if(!Vt)continue;const Dt=jt("syncFocusToScroll.slot.getBoundingClientRect",()=>Vt.getBoundingClientRect());Dt.bottom<=ht||Dt.top>=yt||(pt==null&&(pt=wt),St=wt)}if(pt==null||St==null){const wt=O.value;if(!wt)return;const Vt=ze?{top:0}:jt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>he.getBoundingClientRect()),Dt=jt("syncFocusToScroll.fallback.scrollTop",()=>le(he,pe,ze)),rn=ze?(()=>{const Cn=jt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>wt.getBoundingClientRect()),kn=(ze?0:Vt.top)-Cn.top;return Math.max(0,kn)})():(()=>{const Cn=ie(wt,he);return Math.max(0,Dt-Cn)})(),hn=ze?jt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Cn,kn,An,Kn;return(Kn=(An=(kn=Ne?.innerHeight)!=null?kn:(Cn=pe?.documentElement)==null?void 0:Cn.clientHeight)!=null?An:he.clientHeight)!=null?Kn:0}):jt("syncFocusToScroll.fallback.root.clientHeight",()=>he.clientHeight);return void i2(Xs(Po(rn+.5*Math.max(0,hn)),0,Math.max(0,Qe.value.length-1)),!0)}i2(Math.round((pt+St)/2),$)}}),{visibleNodeIndices:vr,nodeVisibilityHandles:_s,nodeVisibilityWatchStops:Tl,nodeVisibilityFallbackTimers:su,clearVisibilityFallback:ru,markNodeVisible:Oc,cleanupNodeVisibility:_G,destroyNodeVisibilityState:R4}=vke({isClient:Z,shouldTrackVisibleNodeIndices:()=>Te.value,shouldCleanupNodeVisibility:()=>En.value,onNodeMarkedVisible:$=>{En.value?yi():Un.value=Xs($,0,Math.max(0,Qe.value.length-1))},onNodeVisibilityCleaned:$=>{mi.delete($)&&b_()}}),{cleanupScrollListener:KS,setupScrollListener:MG}=(function($){const{isClient:X,virtualizationEnabled:he,listenerEnabled:pe,scrollRootElement:Ne,resolveScrollContainer:ze,scheduleFocusSync:tt,onScroll:ot}=$;let kt=null,rt=null;function ht(){kt&&(kt(),kt=null),rt=null,Ne.value=null}function yt(nt){const pt=$.getScrollTop?$.getScrollTop(nt):nt.scrollTop;return Math.max(0,Number.isFinite(pt)?Math.abs(pt):0)}return{cleanupScrollListener:ht,setupScrollListener:function(){if(!X)return;if(!((nt=pe?.value)!=null?nt:he.value))return void ht();var nt;const pt=ze();if(!pt)return void ht();if(Ne.value===pt&&kt)return;ht(),rt=yt(pt);const St=()=>{if(ot?.(),he.value){const wt=(function(Vt){const Dt=yt(Vt),rn=rt;rt=Dt;const hn=Math.max(480,.75*(Vt.clientHeight||0));return rn==null?Dt>hn?{immediate:!0}:void 0:Math.abs(Dt-rn)>hn?{immediate:!0}:void 0})(pt);wt?tt(wt):tt()}};pt.addEventListener("scroll",St,{passive:!0}),Ne.value=pt,kt=()=>{pt.removeEventListener("scroll",St)}}}})({isClient:Z,virtualizationEnabled:En,listenerEnabled:jn,scrollRootElement:Jl,resolveScrollContainer:ve,scheduleFocusSync:yi,onScroll:function(){const $=Qo.value;if(!$)return;const X=_m();if(!X||(function(pe){if(Nm()>=tu)return Fr=null,!1;const Ne=Fr;if(Ne==null)return!0;const ze=Math.abs(pe.scrollTop-Ne)<=2;return ze||(Fr=null),ze})(X))return;const he=a_(X);he!=null?(he<-32||Math.abs(Math.max(0,he)-Math.max(0,$.distanceFromBottomPx))>32)&&ap("restore"):ap("restore")},getScrollTop:$=>{var X;const he=$.ownerDocument||((X=O.value)==null?void 0:X.ownerDocument)||document,pe=$===he.documentElement||$===he.body||$===he.scrollingElement;return jt("scrollListener.getScrollTop",()=>le($,he,pe))}});function i2($,X=!1){const he=Xs($,0,Math.max(0,Qe.value.length-1));!X&&Math.abs(he-Un.value)<=1||(Un.value=he,vo())}function Xs($,X,he){return Math.min(Math.max($,X),he)}function O4($=Qe.value.length){const X=ut();return!Number.isInteger(X)||X<0?$:Xs(X,0,$)}function $4($){return $?.firstElementChild}function ZS($,X){var he;return $?(he=$.matches)!=null&&he.call($,X)?$:$.querySelector(X):null}function IG($,X){$<1||$>6||(j[$]=X)}function GS(){if(!Pi.value)return void(Q.value=0);const $=jt("updateExperimentContainerWidth.clientWidth",()=>{var X,he;return(he=(X=O.value)==null?void 0:X.clientWidth)!=null?he:0});Q.value=$>0?$:0}let Sm=null;function P4(){Sm?.disconnect(),Sm=null}const QS=Mg("ViewportDeferredMarkdownCodeBlockNode",_u({loader:()=>ao(null,null,function*(){return(yield es(()=>import("./index5-Cwvp7yqU.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:Ck,delay:0,suspensible:!1}),Ck);function YS($){return $===QS}const JS=D(()=>m.value==="pre"?al:m.value==="shiki"?QS:B8);function XS(){var $;return(($=I.codeBlockProps)==null?void 0:$.showHeader)!==!1}function e_($,X,he){const pe=ls[X],Ne=typeof pe=="number"&&pe>0;if(Ni.value&&!Ne&&!(function(ze){return!!xi.value.paragraph&&(ze.type==="paragraph"||ze.type==="list_item"||ze.type==="list")})($)){const ze=sW($,he,ne.value);if(ze)return ze}if(Pn.value&&$.type==="code_block"){const ze=(function(tt){if(tt.type!=="code_block")return null;const ot=N_(tt,h2(tt));return YS(ot)?"markdown":ot===al?"pre":ot===JS.value||ot===B8?"monaco":null})($);if(ze==="monaco"||ze==="markdown"||ze==="pre")return(function(tt,ot){var kt,rt,ht;if(!tt||tt.type!=="code_block")return null;const yt=ot.rendererKind,nt=yt!=="pre"&&ot.showHeader!==!1,pt=!!tt.diff;let St=0,wt=500;if(yt==="monaco"){const Dt=(kt=ot.monacoOptions)!=null?kt:{},rn=q8(tt,Dt,ot.width),hn=(function(kn){const An=typeof kn?.fontSize=="number"&&kn.fontSize>0?kn.fontSize:12;return typeof kn?.lineHeight=="number"&&kn.lineHeight>0?kn.lineHeight:Math.round(1.5*An)})(Dt),Cn=(function(kn,An){var Kn,ii;const Wi=typeof((Kn=kn?.padding)==null?void 0:Kn.top)=="number"?kn.padding.top:An?0:8,er=typeof((ii=kn?.padding)==null?void 0:ii.bottom)=="number"?kn.padding.bottom:An?0:8;return Math.max(0,Wi)+Math.max(0,er)})(Dt,pt);wt=typeof Dt.MAX_HEIGHT=="number"&&Dt.MAX_HEIGHT>0?Dt.MAX_HEIGHT:500,St=Math.round(rn*hn+Cn)}else if(yt==="markdown"){const Dt=q8(tt);St=Math.round(21*Dt+32)}else{const Dt=q8(tt);St=Math.round(28*Dt),wt=Number.POSITIVE_INFINITY}const Vt=Math.max(1,Math.min(St,wt));return Ot({kind:"code-block",height:Math.round(Vt+(nt?40:0)),contentHeight:Vt,rendererKind:yt},pt&&yt==="monaco"?{diffInline:W7((rt=ot.monacoOptions)!=null?rt:{},(ht=ot.width)!=null?ht:0)}:{})})($,{rendererKind:ze,monacoOptions:I.codeBlockMonacoOptions,showHeader:XS(),width:he})}return null}c1(()=>{if(Ql.value,ss>0)return;const $=Qe.value,X=Dn();if(!$.length||!zt.value)return Di=[],Ks=[],Go=-1,$o.clear(),void(Dr.value=Vs);const he=Q.value||jt("estimatedNodeHeights.clientWidth",()=>{var rt;return((rt=O.value)==null?void 0:rt.clientWidth)||0});if(!Number.isFinite(he)||he<=0)return Di=[],Ks=[],Go=-1,$o.clear(),void(Dr.value=Vs);const pe=(function(rt){return[Math.round(rt),Ni.value,Pn.value,ne.value,I.codeBlockMonacoOptions,XS(),m.value,xi.value,j8.value]})(he),Ne=Di.length<=$.length&&(tt=pe,(ze=Ks).length===tt.length&&ze.every((rt,ht)=>Object.is(rt,tt[ht])));var ze,tt;const ot=Ne&&Go===X?$.length:Ne?O4($.length):0,kt=Ne?Array.from($o):[];Di.length=$.length;for(let rt=ot;rt<$.length;rt++)Di[rt]=e_($[rt],rt,he);for(const rt of kt)rt>=0&&rt<$.length&&rtDr.value);Os=(function($){let X=!0,he=[0],pe="";function Ne(ht){var yt;const nt=$.nodeHeights[ht];if(Number.isFinite(nt)&&nt>0)return nt;const pt=$.parsedNodes.value[ht],St=pt?.type,wt=!!((yt=$.hasCustomParagraphComponent)!=null&&yt.call($)),Vt=$.estimatedNodeHeights.value[ht],Dt=Vt?.height;if(!(function(hn,Cn,kn){return!!(kn&&Cn?.kind==="simple-text"&&(hn==="paragraph"||hn==="list_item"||hn==="list"))})(St,Vt,wt)&&Number.isFinite(Dt)&&Dt>0)return Dt;const rn=ske(pt,$.getContainerWidth()||640);return St==="heading"||St==="paragraph"&&rn<=28&&(function(hn,Cn){if(Cn)return!1;const kn=hn.children;return!Array.isArray(kn)||!kn.length||kn.every(lW)})(pt,wt)?rn:Math.max($.averageNodeHeight.value,rn)}function ze(){var ht;const yt=$.parsedNodes.value.length,nt=$.getPrefixCacheKeyParts().join(":");if(!X&&pe===nt)return he;const pt=new Array(yt+1);pt[0]=0;for(let St=0;St=((yt=St[pt])!=null?yt:0))return pt-1;let wt=0,Vt=pt-1,Dt=pt-1;for(;wt<=Vt;){const rn=wt+Vt>>1;((nt=St[rn+1])!=null?nt:0)>=ht?(Dt=rn,Vt=rn-1):wt=rn+1}return Dt}function ot(ht,yt){var nt,pt;if(ht>=yt)return 0;if($.heightEstimationActive.value)return(function(Vt,Dt){var rn,hn;const Cn=$.parsedNodes.value.length,kn=wN(Math.trunc(Vt),0,Cn),An=wN(Math.trunc(Dt),kn,Cn);if(kn>=An)return 0;const Kn=ze();return((rn=Kn[An])!=null?rn:0)-((hn=Kn[kn])!=null?hn:0)})(ht,yt);if($.heightTreeSize.value!==$.parsedNodes.value.length){let Vt=0;for(let Dt=ht;Dtkn<=0?0:$.fenwickRangeSum(wt,0,kn)+(kn-$.fenwickRangeSum(Vt,0,kn))*St;let rn=0,hn=nt.length-1,Cn=nt.length-1;for(;rn<=hn;){const kn=rn+hn>>1;Dt(kn+1)>=ht?(Cn=kn,hn=kn-1):rn=kn+1}return Cn}let pt=ht;for(let St=0;St0||ht++}return ht}return{markFallbackHeightPrefixDirty:function(){X=!0},getFallbackNodeHeight:Ne,estimateHeightRange:ot,estimateIndexForOffset:kt,estimateIndexForOffsetFromEnd:function(ht){var yt,nt;const pt=$.parsedNodes.value;if(!pt.length)return 0;if(ht<=0)return Math.max(0,pt.length-1);if($.heightEstimationActive.value){const wt=(yt=ze()[pt.length])!=null?yt:0;return tt(Math.max(0,wt-ht))}if($.heightTreeSize.value===pt.length){const wt=ot(0,pt.length);return kt(Math.max(0,wt-ht))}let St=ht;for(let wt=pt.length-1;wt>=0;wt--){const Vt=(nt=$.nodeHeights[wt])!=null?nt:$.averageNodeHeight.value;if(St<=Vt)return wt;St-=Vt}return 0},getEstimatedNodeHeightCount:rt,buildVirtualHeightSummary:function(ht){var yt;const nt=$.parsedNodes.value.length;return{totalNodes:nt,measuredCount:$.heightStats.count,estimatedCount:rt(),averageNodeHeight:$.averageNodeHeight.value,topSpacerHeight:ht.topSpacerHeight,bottomSpacerHeight:ht.bottomSpacerHeight,estimatedTotalHeight:ot(0,nt),width:(yt=ht.width)!=null?yt:$.getContainerWidth()}}}})({parsedNodes:Qe,nodeHeights:ls,heightStats:as,heightTreeSize:G,heightSumTree:ye,heightKnownTree:Oe,averageNodeHeight:We,heightEstimationActive:Pi,estimatedNodeHeights:ip,getContainerWidth:Si,hasCustomParagraphComponent:()=>!!xi.value.paragraph,getPrefixCacheKeyParts:()=>{var $;const X=og(Q.value||jt("getFallbackHeightPrefix.clientWidth",()=>{var pe;return((pe=O.value)==null?void 0:pe.clientWidth)||0})),he=(($=i.virtualScroll)==null?void 0:$.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Qe.value.length,as.count,Math.round(as.total),Math.round(100*We.value),he,X,Pi.value?1:0,j8.value,q.value,xi.value.paragraph?1:0]},fenwickRangeSum:Wn}),qe(()=>Qe.value.length,$=>{var X;so(),$<=0?to():($Je(X))),$!==G.value&>($))},{immediate:!0});const TG=D(()=>{if(!En.value)return Qe.value.map((pe,Ne)=>({node:pe,index:Ne}));const $=Qe.value.length,X=Xs(zn.start,0,$),he=Xs(zn.end,X,$);return Qe.value.slice(X,he).map((pe,Ne)=>({node:pe,index:X+Ne}))}),z4=D(()=>En.value?Zs(0,Math.min(zn.start,Qe.value.length)):0),j4=D(()=>{if(!En.value)return 0;const $=Qe.value.length;return Zs(Math.min(zn.end,$),$)});function t_(){return Os.buildVirtualHeightSummary({topSpacerHeight:z4.value,bottomSpacerHeight:j4.value,width:kf()})}function EG(){const $=Qe.value,X=t_();return On(Ot({},X),{probe:{paragraphReady:!!ne.value.paragraph,listItemReady:!!ne.value.listItem,listWrapperOverhead:ne.value.listWrapperOverhead,headingReadyLevels:Object.entries(ne.value.headings).filter(([,he])=>!!he).map(([he])=>Number(he))},nodes:$.map((he,pe)=>{var Ne,ze,tt,ot,kt,rt,ht,yt,nt;return{index:pe,type:he.type,estimateKind:(ze=(Ne=ip.value[pe])==null?void 0:Ne.kind)!=null?ze:null,rendererKind:(ot=(tt=ip.value[pe])==null?void 0:tt.rendererKind)!=null?ot:null,estimatedHeight:(rt=(kt=ip.value[pe])==null?void 0:kt.height)!=null?rt:null,estimatedContentHeight:(yt=(ht=ip.value[pe])==null?void 0:ht.contentHeight)!=null?yt:null,measuredHeight:(nt=ls[pe])!=null?nt:null}})})}function H4(){return i.indexKey!=null?String(i.indexKey):So.value?`virtual-${yo()}`:"markdown-renderer"}function n_($){const X=String($),he=`${H4()}-`;if(!X.startsWith(he))return null;const pe=X.slice(he.length).match(/^(\d+)(?:$|-)/);if(!pe)return null;const Ne=Number(pe[1]);return!Number.isInteger(Ne)||Ne<0||Ne>=Qe.value.length?null:Ne}function yo(){var $,X,he;const pe=($=i.virtualScroll)==null?void 0:$.sessionKey;return String(pe!=null&&pe!==""?pe:(he=(X=i.indexKey)!=null?X:I.customId)!=null?he:Sn)}function cs(){var $;const X=($=i.virtualScroll)==null?void 0:$.threadKey;return X==null||X===""?void 0:String(X)}const LG=D(()=>{var $,X,he;return(he=cs())!=null?he:String((X=($=i.indexKey)!=null?$:I.customId)!=null?X:Sn)});function W4($){var X;return($??"")===((X=cs())!=null?X:"")}function Vu(){var $,X,he;return X=($=i.virtualScroll)==null?void 0:$.measurementKey,he=(function(){const pe=m.value;return(function(Ne){var ze,tt;const ot=Ne.renderer,kt=ot==="monaco"?Ne.codeBlockMonacoOptions:void 0,rt=Ne.codeBlockProps,ht=ot==="shiki";return[Ne.isDark?"dark":"light",ot==="monaco"?"code-rich":ot==="pre"?"code-pre":"code-shiki",Ne.codeBlockStream===!1?"code-static":"code-stream",Ps(Ne.codeBlockMinWidth),Ps(Ne.codeBlockMaxWidth),...ht?[Qve((ze=rt?.themes)!=null?ze:Ne.themes,(tt=rt?.langs)!=null?tt:Ne.langs)]:[],Ps(kt?.fontSize),Ps(kt?.lineHeight),Ps(kt?.fontFamily),Ps(kt?.tabSize),Ps(kt?.MAX_HEIGHT),Ps(kt?.wordWrap),Ps(kt?.wrappingIndent),Ps(kt?.padding),Ps(rt?.showHeader),Ps(rt?.showCopyButton),Ps(rt?.showExpandButton),Ps(rt?.showPreviewButton),Ps(rt?.showCollapseButton),Ps(rt?.showFontSizeButtons)].join("\0")})({renderer:pe,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:pe==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:pe==="shiki"?I.themes:void 0,langs:pe==="shiki"?I.langs:void 0})})(),[X==null?"":String(X),he].join("\0")}function kf(){return Si()}const o2=D(()=>og(kf())),El=D(()=>[Vu(),o2.value].join("\0")),NG=D(()=>{var $;return So.value?["virtual",($=cs())!=null?$:"",yo(),El.value].join("\0"):i.indexKey});function op(){Am.value+=1}function q4($){return!(!$||!Number.isInteger($.index)||$.index<0||$.index>=Qe.value.length||$.sessionKey!==yo()||$.threadKey!==cs()||$.layoutEpochKey!==El.value)}function i_($){const X=String($),he=ta.get(X);return he?q4(he)?he.index:null:n_(X)}function o_($="async-node"){(us.size||ta.size)&&(us.clear(),ta.clear(),op(),ro($))}const sp=tn(DC,null),U4={reportHeight($,X){if(!ei.value)return;const he=i_($);if(he==null)return;const pe=Js.get(he);if(!pe)return;const Ne=Number(X),ze=Ys(he,pe);(function(tt,ot,kt={}){Ln(()=>tl(tt,ot,kt))})(he,Number.isFinite(Ne)&&Ne>0?Math.max(Ne,ze||0):ze)},markPending($){if(!ei.value)return;const X=n_($);X!=null&&(function(he,pe){var Ne;const ze=ta.get(he);if(ze&&q4(ze))return us.set(he,Math.max(0,(Ne=us.get(he))!=null?Ne:0)+1),op(),void ro("async-node");us.set(he,1),ta.set(he,(function(tt){return{index:tt,sessionKey:yo(),threadKey:cs(),layoutEpochKey:El.value}})(pe)),op(),ro("async-node")})(String($),X)},markSettled($){if(!ei.value)return;const X=String($),he=i_($);(he!=null||(function(pe){return us.has(String(pe))})(X))&&(function(pe){var Ne;const ze=(Ne=us.get(pe))!=null?Ne:0;return!(ze<=0||(ze<=1?(us.delete(pe),ta.delete(pe)):us.set(pe,ze-1),op(),ze===1&&ro("async-node"),0))})(X)&&he!=null&&Ku()}};function DG(){let $=0;for(const X of Js.values())$+=jt("getVisibleDomHeight.offsetHeight",()=>{var he;return(he=X?.offsetHeight)!=null?he:0});return Math.ceil(Math.max(0,$))}ri(DC,{reportHeight($,X){U4.reportHeight($,X),sp?.reportHeight($,X)},markPending($){U4.markPending($),sp?.markPending($)},markSettled($){U4.markSettled($),sp?.markSettled($)}});let V4,K4=null,rp=null;function s2($){return $!==!1&&$!=null&&$!==""}function s_(){return En.value?(function(){if(!En.value)return!0;const $=Qe.value.length,X=Xs(zn.start,0,$),he=Xs(zn.end,X,$);if(X>=he)return!0;for(let pe=X;pe=Ie.value}function Z4(){return at.value===!0&&!It.value&&xm.value===0&&Ta.size===0&&Ia.size===0&&gr==null&&s_()}function r_(){var $,X;if((($=i.virtualScroll)==null?void 0:$.settleMode)!=="manual"||K4===yo()&&V4===cs())return!0;const he=(X=i.virtualScroll)==null?void 0:X.settledToken;return!!s2(he)&&rp===Pm(he)}function G4(){return Z4()&&r_()}function FG($,X){return X.totalNodes<=0?$==="final"?"final":"estimate":X.measuredCount>=X.totalNodes?$==="final"?"final":"measured":X.measuredCount>0||X.estimatedCount>0?"mixed":"estimate"}function bf($="manual",X){const he=t_(),pe=(function(Ne){return Ne||(at.value!==!0?Qe.value.length>0?"streaming":"estimating":!s_()||Ia.size>0||gr!=null?"measuring":G4()?"settled":"settling")})(X);return{sessionKey:yo(),threadKey:cs(),phase:pe,nodeCount:he.totalNodes,liveRange:{start:zn.start,end:zn.end},renderedCount:Jn.value,measuredCount:he.measuredCount,estimatedCount:he.estimatedCount,averageNodeHeight:he.averageNodeHeight,topSpacerHeight:he.topSpacerHeight,bottomSpacerHeight:he.bottomSpacerHeight,visibleDomHeight:DG(),totalHeight:l_(),width:he.width,final:at.value===!0,stable:G4(),confidence:FG(pe,he),reason:$}}function _m(){const $=Jl.value||ve(),X=O.value;if(!$||!X)return null;const he=$.ownerDocument||X.ownerDocument||document,pe=$===he.documentElement||$===he.body||$===he.scrollingElement,Ne=jt("getScrollBox.scrollTop",()=>le($,he,pe)),ze=jt("getScrollBox.scrollHeight",()=>{var ot,kt,rt,ht,yt;return pe?Math.max((kt=(ot=he.documentElement)==null?void 0:ot.scrollHeight)!=null?kt:0,(ht=(rt=he.body)==null?void 0:rt.scrollHeight)!=null?ht:0,(yt=$.scrollHeight)!=null?yt:0):$.scrollHeight}),tt=jt("getScrollBox.clientHeight",()=>{var ot;return pe?((ot=he.documentElement)==null?void 0:ot.clientHeight)||$.clientHeight||0:$.clientHeight});return{root:$,doc:he,isViewportRoot:pe,scrollTop:Ne,scrollHeight:ze,clientHeight:tt}}function l_(){const $=Qe.value.length,X=Math.max(0,Zs(0,$)),he=jt("getRendererLogicalHeight.offsetHeight",()=>{var Ne,ze;return(ze=(Ne=O.value)==null?void 0:Ne.offsetHeight)!=null?ze:0}),pe=Math.max(0,he>0?he:jt("getRendererLogicalHeight.scrollHeight",()=>{var Ne,ze;return(ze=(Ne=O.value)==null?void 0:Ne.scrollHeight)!=null?ze:0}));return $<=0?Math.ceil(he):En.value?X>0?Math.max(1,Math.ceil(X),(function(){let Ne=z4.value+j4.value;for(const ze of mi.values())ze&&(Ne+=Math.max(0,jt("getVirtualizedDomLogicalHeight.offsetHeight",()=>ze.offsetHeight||0)));return Math.ceil(Math.max(0,Ne))})(),(function(Ne,ze){return Ne<=0||ze<=0?0:ze<=Ne+Math.max(512,.05*Ne)?Math.ceil(ze):0})(X,pe)):Math.max(1,Math.ceil(pe)):ei.value?X>0||as.count>0||Os.getEstimatedNodeHeightCount()>0?(Zi.value&&Jn.value,Math.max(1,Math.ceil(pe),Math.ceil(X))):Math.ceil(pe):Math.max(1,Math.ceil(pe),Math.ceil(X))}function a_($){const X=O.value;if(!X)return null;const he=jt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>X.getBoundingClientRect());return(function(Ne){return Ne.isViewportRoot?Ne.clientHeight:jt("getViewportBottomInRoot.getBoundingClientRect",()=>Ne.root.getBoundingClientRect().bottom)})($)-he.bottom}function BG($={}){const X=$.requireViewport!==!1,he=(function(ze=64){const tt=_m(),ot=O.value;if(!tt||!ot)return!1;const kt=(function(ht){if(ht.isViewportRoot)return{top:0,bottom:ht.clientHeight};const yt=jt("getVirtualViewportRect.getBoundingClientRect",()=>ht.root.getBoundingClientRect());return{top:yt.top,bottom:yt.bottom}})(tt),rt=jt("isRendererNearVirtualViewport.getBoundingClientRect",()=>ot.getBoundingClientRect());return rt.bottom>=kt.top-ze&&rt.top<=kt.bottom+ze})();if(X&&!he)return null;const pe=(function(){const ze=_m(),tt=O.value;if(!ze||!tt||Math.max(0,ze.scrollHeight-ze.scrollTop-ze.clientHeight)>64)return null;const ot=a_(ze);return ot==null?null:ot>=-8&&ot<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,ot)}:null})();if(pe)return{anchor:pe,captured:!0};const Ne=iu();if(Ne)return{anchor:{type:"node",nodeIndex:Ne.nodeIndex,offsetWithinNodePx:Ne.offsetWithinNodePx},captured:he};if($.allowFallback===!0){const ze=(function(){const tt=Qe.value.length;return tt<=0?null:{type:"node",nodeIndex:Xs(Un.value,0,Math.max(0,tt-1)),offsetWithinNodePx:0}})();return ze?{anchor:ze,captured:!1}:null}return null}function Q4($){let X=2166136261;for(let he=0;he<$.length;he++)X^=$.charCodeAt(he),X=Math.imul(X,16777619);return(X>>>0).toString(36)}function RG($,X){let he=$;for(let pe=0;pe8192?`${pe.slice(0,8192)}...${pe.length}`:pe;return`${pe.length}:${Q4(Ne)}`})($)}`;if(typeof $=="function")return"fn";if(typeof $!="object")return typeof $;if(X.has($))return"cycle";if(he>=6)return"max-depth";X.add($);try{if(Array.isArray($)){if($.length<=160){const rt=[];for(let ht=0;ht<$.length;ht++)rt.push(r2($[ht],X,he+1));return`a:${$.length}:${rt.join(",")}`}const ze=[],tt=[],ot=Math.max(0,$.length-32);let kt=2166136261;for(let rt=0;rt<$.length;rt++){const ht=r2($[rt],X,he+1);kt=RG(kt,ht),rt<32&&ze.push(ht),rt>=ot&&tt.push(ht)}return[`a:${$.length}`,`h=${ze.join(",")}`,`t=${tt.join(",")}`,`all=${(kt>>>0).toString(36)}`].join(":")}const pe=$,Ne=Object.keys(pe).filter(ze=>{const tt=pe[ze];return ze!=="parent"&&ze!=="el"&&ze!=="component"&&(tt==null||typeof tt=="string"||typeof tt=="number"||typeof tt=="boolean"||OG.has(ze))}).sort();return`o:${Ne.length}:${Ne.map(ze=>`${ze}=${r2(pe[ze],X,he+1)}`).join(";")}`}finally{X.delete($)}}let Y4=-1,J4="",wf=[2166136261];function Mm($){const X=Qe.value[$];return X?Q4(r2(X)):""}function $G($,X){let he=$;for(let pe=0;pe>>0}function X4(){var $,X;const he=q.value;if(Y4===he)return J4;const pe=Qe.value.length;let Ne=O4(pe);(Y4!==he-1||Ne>pe||wf.length>>0).toString(36),Y4=he,J4}function lp($,X={}){var he;const pe=X.includeHeightCache===!0,Ne=(he=X.includeContentHash)!=null?he:pe,ze=pe?(function(ot){const kt=(function(){var wt,Vt;const Dt=Number((Vt=(wt=i.virtualScroll)==null?void 0:wt.heightCacheLimit)!=null?Vt:5e3);return!Number.isFinite(Dt)||Dt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Dt))})();if(!Number.isFinite(kt)||ot.length<=kt)return ot;const rt=new Map,ht=wt=>{!wt||rt.size>=kt||rt.set(wt.index,wt)},yt=Qe.value.length,nt=Xs(zn.start-2*io.value,0,yt),pt=Xs(zn.end+2*io.value,nt,yt);for(const wt of ot)wt.index>=nt&&wt.index=0&&rt.sizewt.index-Vt.index).slice(0,kt)})(gn().map(ot=>{var kt;const rt=Qe.value[ot.index];return rt?On(Ot({},ot),{nodeType:String((kt=rt.type)!=null?kt:""),signature:Mm(ot.index)}):null}).filter(ot=>!!ot)):[],tt=BG({allowFallback:X.allowAnchorFallback===!0,requireViewport:X.requireViewport});return tt||ze.length||X.includeEmptyState===!0?On(Ot({sessionKey:$.sessionKey,threadKey:$.threadKey},tt?{anchor:tt.anchor,anchorCaptured:tt.captured}:{anchorCaptured:!1}),{metrics:$,width:$.width,contentHash:Ne?X4():void 0,measurementKey:Vu()||void 0,heightCache:ze.length?ze:void 0}):null}function e3($){var X,he;const pe=_m();if(!pe)return;const Ne=(function(ot){const kt=O.value;if(!kt)return null;const rt=ie(kt,ot.root),ht=Qe.value.length,yt=jt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>kt.offsetHeight||0),nt=Math.max(0,yt>0?yt:ht>0?jt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>kt.scrollHeight||0):0),pt=l_();return rt+Math.max(nt,pt)})(pe);if(Ne==null)return;const ze=Math.max(0,$.distanceFromBottomPx),tt=Math.max(0,Ne-pe.clientHeight-ze);(function(ot){tu=Nm()+120,Fr=ot})(tt),pe.isViewportRoot?(he=(X=pe.doc.defaultView)==null?void 0:X.scrollTo)==null||he.call(X,0,tt):yN(pe.root,pe.doc,tt,{isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:le})}const t3=[];function u_(){if(Z)for(_l!=null&&(Ki?.(_l),_l=null);t3.length;){const $=t3.pop();$!=null&&window.clearTimeout($)}}function ap($){const X=!!Qo.value;Qo.value=null,tu=0,Fr=null,u_(),X&&$&&ro($)}function up(){if(!Qo.value||!Z||_l!=null)return;const $=()=>{_l=null;const X=Qo.value;X&&e3(X)};_l=eo?eo($):null,_l==null&&$()}function c_($,X={}){const he=Qe.value.length;return he<=0?[]:$.filter(pe=>!(!Number.isInteger(pe.index)||pe.index<0||pe.index>=he)&&!(!Number.isFinite(pe.height)||pe.height<=0)&&!(X.requireSignature&&!pe.signature)&&!(X.requireCompatibilityMetadata&&!pe.nodeType&&!pe.signature)&&(function(Ne){var ze;const tt=Qe.value[Ne.index];return!(!tt||Ne.nodeType&&Ne.nodeType!==String((ze=tt.type)!=null?ze:"")||Ne.signature&&Ne.signature!==Mm(Ne.index))})(pe))}function d_($){const X=og(kf()),he=og($);return X!==-1&&he!==-1&&X===he}function n3($){var X;const he=Number($?.width);if(Number.isFinite(he)&&he>0)return he;const pe=Number((X=$?.metrics)==null?void 0:X.width);return Number.isFinite(pe)&&pe>0?pe:null}function f_($){var X;return $.sessionKey===yo()&&!!W4($.threadKey)&&((X=$.measurementKey)!=null?X:"")===Vu()&&!!d_(n3($))&&!!(function(he){const pe=he.heightCache;return!!pe?.length&&(h_(he)?pe.some(Ne=>!!(Ne.nodeType||Ne.signature)):pe.some(Ne=>!!Ne.signature))})($)}function h_($){return!!($.contentHash&&$.contentHash===X4())}function PG($){return!h_($)}let Cf=null,Af=null,l2=null,Im=null,Tm=null;function i3($){var X;const he=$.map(Ne=>{var ze,tt;return[Ne.index,Math.round(10*Ne.height),(ze=Ne.nodeType)!=null?ze:"",(tt=Ne.signature)!=null?tt:""].join("")}).join(""),pe=og(kf());return[(X=cs())!=null?X:"",yo(),Vu(),Qe.value.length,pe,$.length,Q4(he)].join(":")}function p_($=(X=>(X=i.virtualScroll)==null?void 0:X.heightCache)()){if(!ei.value||!$?.length||Qe.value.length<=0||!d_((X=i.virtualScroll)==null?void 0:X.heightCacheWidth))return!1;var X;const he=c_($,{requireSignature:!0});if(!he.length)return!1;const pe=i3(he);return pe===Cf?(Af="standalone",!0):(Me(he,{mode:"merge"}),so(),Cf=pe,Af="standalone",Fm(),ro("restore"),!0)}function o3($,X={}){var he,pe,Ne;if(!ei.value||!$||$.sessionKey!==yo()||!W4($.threadKey)||Qe.value.length<=0)return!1;const ze=!!((he=$.heightCache)!=null&&he.length)&&!a2(),tt=!$.anchor||$.anchorCaptured===!1&&X.allowUncapturedAnchor!==!0?null:$.anchor,ot=X.restoreAnchor===!0&&!!tt&&!a2()&&Number(n3($))>0;let kt=!1;if((pe=$.heightCache)!=null&&pe.length&&f_($)){const ht=c_($.heightCache,{requireCompatibilityMetadata:!$.contentHash,requireSignature:PG($)});ht.length&&(Me(ht,{mode:"merge"}),so(),Cf=i3(ht),Af="restore",Fm(),kt=!0)}if(ze||ot)return!1;if(!X.restoreAnchor||!tt)return kt&&ro("restore"),!0;const rt=(function(ht,yt){var nt;const pt=ht.anchor,St=pt?pt.type==="bottom"?`bottom:${Math.round(pt.distanceFromBottomPx)}`:`node:${pt.nodeIndex}:${Math.round(pt.offsetWithinNodePx)}`:"none";return[(nt=cs())!=null?nt:"",yo(),Vu(),o2.value,yt,St].join(":")})($,(Ne=X.restoreToken)!=null?Ne:"imperative");return l2===rt?(kt&&ro("restore"),!0):(l2=rt,(function(ht){const yt=()=>{if(ht.type==="node")return ap(),void Ml({nodeIndex:ht.nodeIndex,offsetWithinNodePx:ht.offsetWithinNodePx});if(Br(),rs.value=null,Qo.value=ht,u_(),e3(ht),Z)for(const nt of[0,120,280,480])t3.push(window.setTimeout(()=>{const pt=Qo.value;pt&&e3(pt)},nt))};(function(nt){if(!En.value)return!1;const pt=Qe.value.length;return!(pt<=0||(Un.value=nt.type==="node"?Xs(nt.nodeIndex,0,pt-1):pt-1,vo(),0))})(ht)?vt(yt):yt()})(tt),ro("restore"),!0)}function a2(){const $=kf();return Number.isFinite($)&&$>0}function m_($){var X;return $.sessionKey===yo()&&!!W4($.threadKey)&&(Qe.value.length<=0||!(!((X=$.heightCache)!=null&&X.length)||a2())||!(!($.anchor&&Number(n3($))>0)||a2()))}function s3(){Gn.clear();for(const $ of Object.keys(ls)){const X=Number($);Number.isInteger(X)&&X>=0&&X{let X=!1,he=null;const pe=()=>{X||(X=!0,he!=null&&window.clearTimeout(he),$())};if(eo)return eo(pe),void(he=window.setTimeout(pe,50));he=window.setTimeout(pe,0)})}function r3($,X=cs(),he=El.value){return yo()===$&&cs()===X&&El.value===he}function l3(){return ao(this,arguments,function*($={}){var X,he,pe,Ne,ze;const tt=yo(),ot=cs(),kt=El.value,rt=(X=$.frames)!=null?X:2,ht=(he=$.timeoutMs)!=null?he:120,yt=(pe=$.reason)!=null?pe:"manual",nt=$.expectedSettledTokenKey,pt=$.flushPendingTimers===!0,St=bf(yt),wt=()=>On(Ot({},St),{phase:St.final?"settling":St.phase,stable:!1,confidence:St.confidence==="final"?"mixed":St.confidence,reason:yt}),Vt=()=>r3(tt,ot,kt)&&(nt==null||Dm()===nt);for(let Cn=0;Cnwindow.setTimeout(kn,Cn))})(ht),!Vt()||(pt&&nn(),Ku(),Em(),!Vt()))return wt();const Dt=Z4();Dt&&(K4=tt,V4=ot,((Ne=i.virtualScroll)==null?void 0:Ne.settleMode)==="manual"&&nt!=null&&s2((ze=i.virtualScroll)==null?void 0:ze.settledToken)&&Dm()===nt&&(rp=Pm(i.virtualScroll.settledToken)));const rn=Vt()&&Dt&&r_(),hn=bf(yt,rn?"final":void 0);return f3(hn,!0),hn})}let a3="content",xf=null,Sf=null,u3=0,Lm=null,cp=null,c3=null,d3=null;function Nm(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function v_($){var X,he;const pe=Lm;if(!pe)return!0;const Ne=(he=(X=i.virtualScroll)==null?void 0:X.heightDiffThresholdPx)!=null?he:1;return Math.abs($.totalHeight-pe.totalHeight)>Ne||$.sessionKey!==pe.sessionKey||$.phase!==pe.phase||$.stable!==pe.stable||$.final!==pe.final||$.threadKey!==pe.threadKey||$.nodeCount!==pe.nodeCount||$.measuredCount!==pe.measuredCount||$.width!==pe.width}function Dm($=(X=>(X=i.virtualScroll)==null?void 0:X.settledToken)()){return Ps($)}function y_($,X){var he,pe;return[$,X.sessionKey,(he=X.threadKey)!=null?he:"",Vu(),X4(),Ps((pe=i.virtualScroll)==null?void 0:pe.settledToken),Math.round(X.totalHeight),Math.round(X.width)].join("\0")}function Fm(){c3=null,d3=null,cp=null}function zG($){const X=$.heightCache;return X?.length?i3(X):""}function Bm($){var X,he,pe;const Ne=$.metrics,ze=$.anchor?(tt=$.anchor).type==="bottom"?`bottom:${Math.round(tt.distanceFromBottomPx)}`:`node:${tt.nodeIndex}:${Math.round(tt.offsetWithinNodePx)}`:"none";var tt;return[$.sessionKey,(X=$.threadKey)!=null?X:"",(he=$.measurementKey)!=null?he:Vu(),(pe=$.contentHash)!=null?pe:"",zG($),ze,$.anchorCaptured?1:0,Ne.liveRange.start,Ne.liveRange.end,Ne.renderedCount,Ne.nodeCount,Math.round(Ne.totalHeight),Math.round(Ne.width),Ne.phase,Ne.stable?1:0].join("\0")}function f3($,X=!1){if(!ei.value||(function(tt=!1){return!tt&&So.value&&!ns.value})(X))return;const he=X||v_($),pe=(function(tt,ot=!1){return ot||tt.stable||tt.phase==="final"?{state:lp(tt,{includeHeightCache:!0})}:{state:lp(tt)}})($,X),Ne=pe.state,ze=!!(Ne&&(he||(function(tt,ot=!1){return!!ot||Bm(tt)!==cp})(Ne,X)));if(he&&(F($),Lm=$,u3=Nm()),Ne&&ze&&(W(Ne),Ne.anchor&&P(Ne.anchor),cp=Bm(Ne)),$.stable){const tt=y_("settled",$);if(tt!==c3){c3=tt;const ot=lp($,{includeHeightCache:!0});ot&&(W(ot),cp=Bm(ot)),(function(kt){o("render-settled",kt)})($)}}if($.phase==="final"){const tt=y_("final",$);if(tt!==d3){d3=tt;const ot=lp($,{includeHeightCache:!0});ot&&(W(ot),cp=Bm(ot)),(function(kt){o("render-final",kt)})($)}}}function h3(){xf!=null&&(Ki?.(xf),xf=null),Sf!=null&&Z&&(window.clearTimeout(Sf),Sf=null)}function k_(){xf=null,Sf=null,(function($){if(Ia.size>0||gr!=null)return!0;switch($){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(a3)&&(Ku(),Em()),f3(bf(a3))}function ro($){var X,he;if(!ei.value||(a3=$,xf!=null||Sf!=null))return;const pe=Math.max(0,(he=(X=i.virtualScroll)==null?void 0:X.emitIntervalMs)!=null?he:32),Ne=Math.max(0,pe-(Nm()-u3)),ze=()=>{Sf=null,xf=eo?eo(k_):null,xf==null&&k_()};Z&&Ne>0?Sf=window.setTimeout(ze,Ne):ze()}function b_(){Yl.value+=1}function u2($){if(Zi.value&&$>=Jn.value){const X=Qe.value[$],he=Ue.value===!0&&at.value!==!0&&$>=Qe.value.length-2,pe=X?.type==="code_block"||X?.type==="image"||X?.type==="mermaid"||X?.type==="infographic";if(!he||pe)return!1}return!Te.value||$=de.value&&(K.value||(K.value=!0,R4()),!cn.value||!Xi))return dp($),void(X&&Oc($,!0));if(${if(su.delete(ze),!Te.value||vr.value.has(ze))return;const kt=mi.get(ze);if(!kt)return;const rt=ve(kt),ht=kt.ownerDocument||document,yt=ht.defaultView||window,nt=!rt||rt===ht.documentElement||rt===ht.body,pt=!nt&&rt?jt("nodeVisibilityFallback.root.getBoundingClientRect",()=>rt.getBoundingClientRect()):null,St=nt?0:pt.top,wt=nt?jt("nodeVisibilityFallback.clientHeight",()=>{var Dt,rn;return(rn=(Dt=yt.innerHeight)!=null?Dt:rt?.clientHeight)!=null?rn:0}):pt.bottom,Vt=jt("nodeVisibilityFallback.node.getBoundingClientRect",()=>kt.getBoundingClientRect());Vt.bottom>=St-500&&Vt.top<=wt+500&&Oc(ze,!0)},1800+tt);su.set(ze,ot)})($);let Ne=null;Ne=qe(()=>pe.isVisible.value,ze=>{if(ze){ru($),Oc($,!0),Ne?.(),Tl.delete($),_s.get($)===pe&&_s.delete($);try{pe.destroy()}catch{}}},{immediate:!0}),Tl.set($,Ne),En.value&&yi()}function p3(){gr=null,Ln(()=>{let $=!1;for(const[X,he]of Ia)Ia.delete(X),Js.get(X)===he.el&&Il.get(X)===he.version&&($=tl(X,he.height,{allowShrink:he.allowShrink})||$);return $})}function fp(){gr!=null&&(Ki?.(gr),gr=null),Ia.clear()}function d2($,X){(function(he,pe,Ne){var ze;if(!Number.isFinite(Ne)||Ne<=0||Js.get(he)!==pe)return;const tt=Il.get(he);if(tt==null)return;const ot=Qe.value[he],kt=It.value&&at.value!==!0&&!((ze=i.nodes)!=null&&ze.length)&&he>=Qe.value.length-2,rt=!(ot?.loading===!0||kt),ht=Ia.get(he),yt=ht?ht.allowShrink&&rt:rt,nt=ht&&!yt?Math.max(ht.height,Ne):Ne;Ia.set(he,{height:nt,allowShrink:yt,version:tt,el:pe}),gr==null&&(gr=eo?eo(p3):null,gr==null&&p3())})($,X,Ys($,X))}function Ku(){for(const[$,X]of Js)X&&d2($,X)}function w_(){Oo?.disconnect(),Oo=null,Mo.clear()}function m3(){for(;yf.length;)At(yf.pop())}qe(ns,$=>{$&&ro("content")},{flush:"post"}),t({getVirtualMetrics:bf,captureVirtualState:function($={}){var X;return lp(bf("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:$.allowFallbackAnchor===!0,requireViewport:$.requireViewport===!0,includeEmptyState:(X=$.includeEmptyState)==null||X})},restoreVirtualState:function($,X={}){const he=X.restoreAnchor===!0,pe=X.restoreToken==null?"imperative":String(X.restoreToken);Im=$,Tm={restoreAnchor:he,restoreToken:pe,allowUncapturedAnchor:X.allowUncapturedAnchor===!0},!o3($,{restoreAnchor:he,restoreToken:pe,allowUncapturedAnchor:X.allowUncapturedAnchor===!0})&&m_($)||(Im=null,Tm=null)},forceMeasure:function($="manual"){return ao(this,null,function*(){yield vt(),yield g_(),Ku(),Em(),yield vt();const X=bf($);return f3(X,!0),X})},settle:l3,scrollToNode:function($,X="start"){ap(),Br();const he=Qe.value.length;if(he<=0)return;const pe=Xs($,0,he-1),Ne=()=>{var ze;const tt=ea({nodeIndex:pe,offsetWithinNodePx:0}),ot=nu(pe),kt=_m(),rt=(ze=kt?.clientHeight)!=null?ze:0,ht=Gs();let yt=tt;if(X==="center")yt=tt-rt/2+ot/2;else if(X==="end")yt=tt-rt+ot;else if(X==="nearest"&&ht!=null){if(tt>=ht&&tt+ot<=ht+rt)return;yt=ttmr.value,$=>{if(!$){w_();for(const X of Ma.values())for(const he of X)At(he);Ma.clear(),Il.clear(),m3(),fp()}},{immediate:!0}),qe(at,$=>{$&&(function(){if(Z&&at.value&&Js.size){m3();for(const X of[80,240,640]){const he=et(X,()=>{for(const[pe,Ne]of Js)Ne&&d2(pe,Ne)},"final");he!=null&&yf.push(he)}}})(),ro($?"final":"content")});const jG=kN(()=>ro("content"),16),HG=kN(()=>ro("batch"),16);qe([()=>Qe.value.length,()=>Jn.value],()=>{Qo.value&&up(),jG()},{flush:"post",immediate:!0}),qe([()=>zn.start,()=>zn.end],()=>{HG()},{flush:"post"});const{cleanupBatchScheduler:WG}=(function($){const{props:X,isClient:he,isTestEnv:pe,parsedNodesIdentity:Ne,parsedNodeCount:ze,desiredRenderedCount:tt,datasetKey:ot,batchingEnabled:kt,incrementalRenderingActive:rt,resolvedBatchSize:ht,resolvedInitialBatch:yt,renderedCount:nt,adaptiveBatchSize:pt,previousRenderContext:St,previousBatchConfig:wt,requestFrame:Vt,cancelFrame:Dt,hasIdleCallback:rn,cleanupNodeVisibility:hn,onDatasetKeyChanged:Cn,onDatasetChanged:kn}=$;let An=null,Kn="raf",ii=null,Wi=0,er=!1,$s=!1;const Ea=new Set,lu=new Set;function qm(){if(he){An!=null&&(Kn==="raf"&&Dt?Dt(An):Kn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(An):Kn==="timeout"&&window.clearTimeout(An),An=null),Wi+=1;for(const yr of Ea)Dt&&Dt(yr);for(const yr of lu)window.clearTimeout(yr);Ea.clear(),lu.clear(),ii=null,er=!1,$s=!1}}function b2(){return typeof performance<"u"?performance.now():Date.now()}function P_(yr){(function(Zu){var Pc;if(!rt.value)return;const Gu=Math.max(2,(Pc=X.renderBatchBudgetMs)!=null?Pc:6),Qu=Math.max(1,ht.value||1),La=Math.max(1,Math.floor(Qu/4));Zu>1.5*Gu?pt.value=Math.max(La,Math.floor(.8*pt.value)):Zu<.6*Gu&&pt.value=Gu)return;const Qu=Math.max(1,yr),La=()=>{const mp=b2();An=null;const Um=ii??Qu;ii=null;const gp=b2();nt.value=Math.min(Gu,nt.value+Um),hn(nt.value),(function(C3,w2){if(!he)return void P_(w2);er=!0;const W_=++Wi;vt().then(()=>{var q_;if(W_!==Wi)return;const cQ=b2(),dQ=Math.max(w2,cQ-C3),U_=()=>{W_===Wi&&P_(dQ)};if(Vt){let Mf=null,vp=null,K_=!1;const Z_=()=>{K_||(K_=!0,Mf!==null&&(Ea.delete(Mf),Mf=null),vp!==null&&(lu.delete(vp),window.clearTimeout(vp),vp=null),U_())};return Mf=Vt(()=>{Z_()}),Ea.add(Mf),vp=window.setTimeout(()=>{Mf!==null&&Dt&&Dt(Mf),Z_()},Math.max(32,(q_=X.renderBatchIdleTimeoutMs)!=null?q_:120)),void lu.add(vp)}const V_=window.setTimeout(()=>{lu.delete(V_),U_()},0);lu.add(V_)})})(mp,b2()-gp)};if(!he||il.immediate)return void La();const zc=Math.max(0,(Zu=X.renderBatchDelay)!=null?Zu:16);if(ii=ii!=null?Math.max(ii,Qu):Qu,An==null){if(!pe&&rn&&window.requestIdleCallback){const mp=Math.max(0,(Pc=X.renderBatchIdleTimeoutMs)!=null?Pc:120);return Kn="idle",void(An=window.requestIdleCallback(()=>La(),{timeout:mp}))}if(Vt&&!pe)return Kn="raf",void(An=Vt(()=>{zc===0?La():(Kn="timeout",An=window.setTimeout(()=>La(),zc))}));Kn="timeout",An=window.setTimeout(()=>La(),zc)}}function j_(yr,il={}){er?$s=!0:yr==null?H_():z_(yr,il)}function H_(){rt.value&&z_(kt.value?Math.max(1,Math.round(pt.value)):Math.max(1,ht.value))}return qe([Ne,ze,ot,rt,ht,yt,()=>X.renderBatchDelay],()=>{var yr;const il=ze.value,Zu=St.value,Pc=ot.value,Gu=!Object.is(Pc,Zu.key),Qu=il!==Zu.total,La=Gu||Qu;St.value={key:Pc,total:il};const zc=wt.value,mp=(yr=X.renderBatchDelay)!=null?yr:16,Um=zc.batchSize!==ht.value||zc.initial!==yt.value||zc.delay!==mp||zc.enabled!==rt.value;wt.value={batchSize:ht.value,initial:yt.value,delay:mp,enabled:rt.value},Gu&&Cn(il),(La||Um||!rt.value)&&qm(),(La||Um)&&(pt.value=Math.max(1,ht.value||1)),La&&kn();const gp=tt.value;if(!il)return nt.value=0,void hn(0);if(!rt.value)return nt.value=gp,void hn(nt.value);const C3=Gu||Zu.total===0;nt.value=C3||Um?Math.min(gp,yt.value):Math.min(nt.value,gp);const w2=Math.max(1,yt.value||ht.value||il);nt.value{rt.value&&(typeof il=="number"&&yr<=il||yr>nt.value&&j_())}),{cleanupBatchScheduler:qm}})({props:I,isClient:Z,isTestEnv:_e,parsedNodesIdentity:Zn,parsedNodeCount:Ss,desiredRenderedCount:Ie,datasetKey:NG,batchingEnabled:oi,incrementalRenderingActive:Zi,resolvedBatchSize:dn,resolvedInitialBatch:ti,renderedCount:Jn,adaptiveBatchSize:is,previousRenderContext:Us,previousBatchConfig:it,requestFrame:eo,cancelFrame:Ki,hasIdleCallback:He,cleanupNodeVisibility:_G,onDatasetKeyChanged:$=>{fp(),to(),so(),Fm(),$>0&>($)},onDatasetChanged:()=>{En.value&&yi({immediate:!0})}});qe([jn,En,()=>O.value,()=>Y()],([$,X])=>{if(!$)return KS(),void In();MG(),X?yi({immediate:!0}):In()},{flush:"post",immediate:!0}),qe([()=>Qe.value.length,()=>En.value],$=>ao(null,[$],function*([X,he]){he&&X&&Z&&(yield vt(),yi({immediate:!0}))}),{flush:"post"}),qe(Pi,$=>{$&&(function(){var X;if(po.value&&Bs.value&&qs.value&&((X=Nr.value)!=null&&X[1]))return;const he=Ft({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),pe=Ft({type:"list_item",children:[he],raw:"- Probe paragraph text"}),Ne=Ft({type:"list",ordered:!1,items:[pe],raw:"- Probe paragraph text"});po.value=he,Bs.value=pe,qs.value=Ne;const ze={1:null,2:null,3:null,4:null,5:null,6:null};for(let tt=1;tt<=6;tt++)ze[tt]=Ft({type:"heading",level:tt,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(tt)} Probe heading`});Nr.value=ze})()},{immediate:!0}),qe([()=>O.value,Pi],()=>{if(!Pi.value)return P4(),void(Q.value=0);GS(),P4(),Pi.value&&O.value&&typeof ResizeObserver<"u"&&(Sm=new ResizeObserver(()=>{GS(),rs.value&&_a(),Qo.value&&up(),ro("resize")}),Sm.observe(O.value))},{immediate:!0}),qe([Pi,di,El],()=>ao(null,null,function*(){if(!Pi.value)return ne.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void so();yield vt(),(function(){if(!Pi.value||typeof window>"u")return ne.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void so();const $={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},X=ZS($4(R.value),".paragraph-node");$.paragraph=U8(R.value,X,"pre-wrap");const he=$4(z.value),pe=he?.querySelector(".paragraph-node");$.listItem=U8(z.value,pe,"pre-wrap");const Ne=jt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var tt,ot;return(ot=(tt=H.value)==null?void 0:tt.offsetHeight)!=null?ot:0}),ze=jt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var tt,ot;return(ot=(tt=z.value)==null?void 0:tt.offsetHeight)!=null?ot:0});$.listWrapperOverhead=Math.max(0,Ne-ze);for(let tt=1;tt<=6;tt++){const ot=ZS($4(j[tt]),`h${tt}`);$.headings[tt]=U8(j[tt],ot,"pre-wrap")}ne.value=$,so()})()}),{flush:"post",immediate:!0}),qe(()=>Qe.value.length,()=>{En.value&&yi({immediate:!0})}),qe([Pi,Q],()=>{so(),En.value&&yi({immediate:!0}),rs.value&&_a(),Qo.value&&up(),ro("resize")},{immediate:!1}),qe(()=>Te.value,$=>{if($)for(const[X,he]of mi)c2(X,he);else if(R4(),En.value)yi({immediate:!0});else for(const[X,he]of mi)he&&Oc(X,!0)},{immediate:!1}),qe([me,de,()=>Y()],()=>{var $;($=Xi.refresh)==null||$.call(Xi);for(const[X,he]of mi)c2(X,he)},{immediate:!1}),qe([()=>I.viewportPriority,()=>Qe.value.length,de],([$,X,he])=>{if($!==!1){if(K.value&&(X<=200||X<=he)){K.value=!1;for(const[pe,Ne]of mi)c2(pe,Ne)}}else K.value=!1}),qe(()=>Jn.value,()=>{En.value&&yi({immediate:!0})}),qe([Un,no,io,()=>Qe.value.length,En],()=>{vo()},{immediate:!0});let Rm=null,Om=!1,hp=null;function $m(){Rm=null,K4=null,V4=void 0,rp=null,Fm()}function g3(){fp(),to(),so(),Gn.clear();const $=Qe.value.length;$>0&>($),s3()}function v3(){h3(),nn(),Lm=null,Cf=null,Af=null,l2=null,Im=null,Tm=null,Om=!1,$m(),o_("restore"),Br(),ap()}function Pm($){var X;return[(X=cs())!=null?X:"",yo(),Vu(),o2.value,Dm($),Qe.value.length,Math.round(Zs(0,Qe.value.length)),Math.round(kf()),as.count,Math.round(as.total)].join(":")}function C_(){return ao(this,null,function*(){var $,X,he,pe;const Ne=($=i.virtualScroll)==null?void 0:$.settledToken,ze=Dm(Ne),tt=yo(),ot=cs(),kt=El.value;if(ei.value&&((X=i.virtualScroll)==null?void 0:X.settleMode)==="manual"&&s2(Ne))if(Z4()){if(Pm(Ne)!==rp&&!Om){Om=!0;try{const rt=yield l3({reason:"manual",expectedSettledTokenKey:ze}),ht=Dm()===ze;r3(tt,ot,kt)&&rt.sessionKey===tt&&rt.threadKey===ot&&ht&&rt.stable&&rt.phase==="final"&&(rp=Pm((he=i.virtualScroll)==null?void 0:he.settledToken))}finally{Om=!1,yield vt();const rt=(pe=i.virtualScroll)==null?void 0:pe.settledToken,ht=s2(rt)?Pm(rt):"";r3(tt,ot,kt)&&ht&&rp!==ht&&C_()}}}else ro("manual")})}qe(ei,($,X)=>{if($!==X){if(!$)return v3(),void h3();v3(),g3(),hp=El.value,ro("content")}},{flush:"post"}),qe([ei,El],([$,X])=>{$?hp!=null?hp!==X&&(hp=X,(function(he="resize"){fp(),to(),so(),Gn.clear();const pe=Qe.value.length;pe>0&>(pe),s3(),Cf=null,Af=null,l2=null,Lm=null,Om=!1,$m(),p_(),vt(()=>{Ku(),rs.value&&_a(),Qo.value&&up(),ro(he)})})("resize")):hp=X:hp=null},{flush:"post",immediate:!0}),qe([ei,()=>yo(),()=>cs()],([$])=>{$&&(v3(),g3(),o_("content"),ro("content"))}),qe([ei,()=>yo(),()=>cs(),El,()=>Qe.value.length],([$])=>{$&&(function(X="async-node"){let he=!1;for(const[pe,Ne]of Array.from(ta.entries()))q4(Ne)||(ta.delete(pe),us.delete(pe),he=!0);he&&(op(),ro(X))})("async-node")},{flush:"post"}),qe([ei,()=>{var $;return($=i.virtualScroll)==null?void 0:$.sessionKey},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>i.indexKey,()=>q.value],([$])=>{$&&(Fm(),(function(X="content"){if(!ei.value)return;const he=[],pe=Qe.value.length,Ne=O4(pe);for(const ze of Array.from(Gn.keys())){if(ze>=pe){he.push(ze);continue}if(ze=pe&&Gn.delete(ze);he.length&&((function(ze,tt={}){const ot=Array.from(ze,Number);Mn(ot);let kt=0;if(Ln(()=>(kt=en(ot,tt),kt>0)),kt>0)(function(rt){for(const ht of rt)Gn.delete(ht)})(ot);else for(const rt of ot)$o.delete(rt)})(he,{notify:!1}),so(),$m(),rs.value&&_a(),Qo.value&&up(),ro(X))})("content"))},{flush:"post",immediate:!0}),qe([ei,()=>Qe.value.length,()=>yo(),()=>cs()],([$,X,he,pe],[Ne,ze,tt,ot])=>{$&&Ne&&he===tt&&pe===ot&&X!==ze&&$m()},{flush:"post"}),qe([ei,()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCache},()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCacheWidth},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Qe.value.length,()=>yo(),Q],()=>{p_()},{flush:"post",immediate:!0}),qe([ei,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreAnchor},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Qe.value.length,()=>yo(),Q],$=>ao(null,[$],function*([X,he]){if(!X||!he)return;yield vt();const pe=(function(){var Ne;const ze=(Ne=i.virtualScroll)==null?void 0:Ne.restoreAnchor;return ze==null||ze===!1?null:ze===!0?"true":String(ze)})();o3(he,{restoreAnchor:pe!=null,restoreToken:pe??void 0})}),{flush:"post",immediate:!0}),qe([ei,Q,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey}],([$])=>{var X;if(!$)return;const he=(X=i.virtualScroll)==null?void 0:X.restoreState;he&&Cf&&Af==="restore"&&(f_(he)||(g3(),Cf=null,Af=null,ro("resize")))},{flush:"post"}),qe([ei,()=>Qe.value.length,()=>yo(),Q],$=>ao(null,[$],function*([X]){var he;const pe=Im,Ne=Tm;X&&pe&&(yield vt(),!o3(pe,{restoreAnchor:Ne?.restoreAnchor===!0,restoreToken:(he=Ne?.restoreToken)!=null?he:"imperative",allowUncapturedAnchor:Ne?.allowUncapturedAnchor===!0})&&m_(pe)||(Im=null,Tm=null))}),{flush:"post",immediate:!0}),qe([ei,at,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>yo(),()=>cs(),El,xm,n2,()=>Jn.value,Ie,()=>as.count,()=>as.total],([$,X,he])=>{if(!$||X!==!0||he==="manual"||!G4())return;const pe=(function(){var Ne;const ze=Qe.value.length;return[(Ne=cs())!=null?Ne:"",yo(),Vu(),o2.value,ze,Math.round(Zs(0,ze)),Math.round(kf()),as.count,Math.round(as.total)].join(":")})();Rm!==pe&&(Rm=pe,l3({reason:"final"}).then(Ne=>{Ne.stable||Rm!==pe||(Rm=null)}))},{flush:"post",immediate:!0}),qe([ei,at,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>{var $;return($=i.virtualScroll)==null?void 0:$.settledToken},()=>yo(),()=>cs(),El,xm,n2,()=>Jn.value,Ie,()=>Qe.value.length,()=>as.count,()=>as.total],()=>{C_()},{flush:"post",immediate:!0}),qe([()=>Qe.value.length,En,no,io,()=>zn.start,()=>zn.end],([$,X,he,pe,Ne,ze])=>{ke.value&&Bt("virtualization",{nodes:$,virtualization:X,maxLiveNodes:he,buffer:pe,focusIndex:Un.value,scroll:X?(()=>{const tt=Jl.value||ve();return tt?{reverse:Ce(tt),scrollTop:Math.round(tt.scrollTop),scrollTopAbs:Math.round(Math.abs(tt.scrollTop)),scrollHeight:Math.round(tt.scrollHeight),clientHeight:Math.round(tt.clientHeight)}:null})():null,liveRange:{start:Ne,end:ze},rendered:Jn.value})}),qe([()=>I.customId],([$],X,he)=>{if(!$||ts)return;const pe=(function(Ne,ze){return Ne?(Ms.controllers[Ne]=ze,()=>{Ms.controllers[Ne]===ze&&delete Ms.controllers[Ne]}):()=>{}})($,{captureRestoreAnchor:iu,restoreAnchor:Ml,getAnchorDrift:Uu,getReport:EG});he(()=>{pe()})},{immediate:!0}),si(()=>{(function(){if(ei.value)try{Ku(),Em();const $=bf("manual");v_($)&&(F($),Lm=$,u3=Nm());const X=lp($,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});X&&(W(X),X.anchor&&P(X.anchor),cp=Bm(X))}catch{}})(),WG(),R4(),Ze(),w_();for(const $ of Ma.values())for(const X of $)At(X);Ma.clear(),Il.clear(),Gn.clear(),m3(),fp(),P4(),Br(),ap(),h3(),KS(),In()});const qG=Mg("ViewportDeferredMermaidBlockNode",_u({loader:()=>ao(null,null,function*(){try{return(yield es(()=>import("./index11-DHi1-CuT.js"),__vite__mapDeps([7,5]))).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',$),al}}),loadingComponent:DN,delay:0}),DN),UG=Mg("ViewportDeferredInfographicBlockNode",_u({loader:()=>ao(null,null,function*(){try{return(yield es(()=>import("./index10-CoFm5QTj.js"),[])).default}catch($){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',$),al}}),loadingComponent:NN,delay:0}),NN),VG=Mg("ViewportDeferredD2BlockNode",_u(()=>ao(null,null,function*(){try{return(yield es(()=>import("./index8-QUl1r--p.js"),[])).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',$),al}})),al),A_={text:Uo,paragraph:wh,heading:n4,code_block:B8,list:w1,list_item:b1,blockquote:t9,table:f0,definition_list:n9,footnote:i9,footnote_reference:jl,footnote_anchor:c0,admonition:l9,vmr_container:s9,hardbreak:Id,link:Zr,image:Md,thematic_break:o9,math_inline:Ja,math_block:tW,strong:Vr,emphasis:Gr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,checkbox:zl,checkbox_input:zl,inline_code:Mr,html_inline:Hl,reference:Ur,html_block:d0},KG=D(()=>H4()),x_=D(()=>vN(I.codeBlockProps)),ZG=D(()=>vN(I.codeBlockProps,{omit:["langs"]})),S_=D(()=>Ot(Ot({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,monacoOptions:I.codeBlockMonacoOptions,themes:I.themes,langs:m.value==="shiki"?I.langs:void 0,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),ZG.value)),__=D(()=>Ot(On(Ot({},S_.value),{langs:I.langs}),x_.value));function M_($){return typeof $=="boolean"?$:void 0}const GG=D(()=>{const $=I.codeBlockProps||{},X={},he=M_($.showLineNumbers);he!==void 0&&(X.showLineNumbers=he);const pe=M_($.diffInline);pe!==void 0&&(X.diffInline=pe);const Ne=(function(ze){const tt=Number(ze);return Number.isFinite(tt)&&tt>0?tt:void 0})($.reservedHeightPx);return Ne!==void 0&&(X.reservedHeightPx=Ne),X}),QG=D(()=>Ot(Ot({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),x_.value)),YG=D(()=>Ot({},I.mermaidProps||{})),I_=D(()=>Ot({},I.d2Props||{})),JG=D(()=>Ot({},I.infographicProps||{})),zm=D(()=>({typewriter:f.value,fade:I.fade,customHtmlTags:lt.value.customHtmlTags})),XG=D(()=>Ot(Ot({},zm.value),typeof be.value=="boolean"?{showTooltip:be.value}:{})),eQ=D(()=>Ot(Ot({},zm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),tQ=D(()=>Ot(Ot({},zm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),nQ=D(()=>Ot(Ot({},zm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{}));function iQ($){return Array.isArray($.children)&&$.children.length>0}const f2=D(()=>TG.value.map($=>{var X,he,pe,Ne,ze,tt,ot,kt;let rt=(function(Dt){var rn,hn,Cn,kn,An,Kn,ii;if(Dt.type!=="code_block")return Dt;const Wi=Dt,er=[String((rn=Wi.language)!=null?rn:""),String((hn=Wi.loading)!=null?hn:""),String((Cn=Wi.diff)!=null?Cn:""),String((kn=Wi.code)!=null?kn:""),String((An=Wi.originalCode)!=null?An:""),String((Kn=Wi.updatedCode)!=null?Kn:""),String((ii=Wi.raw)!=null?ii:"")].join("\0"),$s=Io.get(Wi);if($s&&$s.signature===er)return $s.node;const Ea=Ot({},Wi);return Io.set(Wi,{signature:er,node:Ea}),Ea})($.node);const ht=h2(rt);let yt=N_(rt,ht);if((rt.type==="html_block"||rt.type==="html_inline")&&yt===A_[rt.type]){const Dt=rt,rn=String((X=Dt.tag)!=null?X:"").trim().toLowerCase()||_j(Dt.content);if(rn){const hn=xi.value[rn];if(xo.value.has(rn)&&hn)yt=hn,rt=On(Ot({},Dt),{type:rn,tag:rn,content:vpe(Dt.content,rn)});else if(Mj((he=Dt.content)!=null?he:Dt.raw,rn)){const Cn=String((Ne=(pe=Dt.content)!=null?pe:Dt.raw)!=null?Ne:"");rt.type==="html_inline"?(yt=Uo,rt={type:"text",content:Cn,raw:Cn}):(yt=wh,rt={type:"paragraph",children:[{type:"text",content:Cn,raw:Cn}],raw:Cn})}}}const nt=rt.type==="code_block"&&m.value==="pre"&&yt===al&&!y3(xi.value,ht);let pt=Ot({},(function(Dt,rn,hn){const Cn=rn??h2(Dt);if(Dt.type==="code_block"){const kn=Cn?y3(xi.value,Cn):void 0;if(hn&&m.value==="pre"&&!kn&&hn===al)return GG.value;if(hn&&Cn&&hn===kn)return Cn==="mermaid"?E_(Dt):Cn==="infographic"?L_(Dt):Cn==="d2"||Cn==="d2lang"?I_.value:__.value;if(hn&&hn===xi.value.code_block)return __.value;if(YS(hn))return QG.value}return Cn==="mermaid"?E_(Dt):Cn==="infographic"?L_(Dt):Cn==="d2"||Cn==="d2lang"?I_.value:Dt.type==="link"?XG.value:Dt.type==="list"?eQ.value:Dt.type==="blockquote"?tQ.value:Dt.type==="table"?nQ.value:Dt.type==="code_block"?S_.value:zm.value})(rt,ht,yt));const St=Pi.value?ip.value[$.index]:null;rt.type==="code_block"&&St?.kind==="code-block"&&(pt=On(Ot({},pt),nt?{reservedHeightPx:(ze=St.height)!=null?ze:St.contentHeight}:{estimatedHeightPx:St.height,estimatedContentHeightPx:St.contentHeight,estimatedDiffInline:St.diffInline})),nt||rt.type!=="code_block"||ht!=="mermaid"||Yp(pt.estimatedPreviewHeightPx)!=null||(pt=On(Ot({},pt),{estimatedPreviewHeightPx:yk(gk(String((tt=rt.code)!=null?tt:"")))})),nt||rt.type!=="code_block"||ht!=="infographic"||Yp(pt.estimatedPreviewHeightPx)!=null||(pt=On(Ot({},pt),{estimatedPreviewHeightPx:kk(vk(String((ot=rt.code)!=null?ot:"")))})),rt.type==="math_block"&&(pt=On(Ot({},pt),{cacheScope:ho}));const wt=(function(Dt,rn){const hn=String(Dt.type);return!$v(hn)&&xi.value[hn]===rn})(rt,yt),Vt=wt?P7(rt,we.value):void 0;return On(Ot({},$),{node:rt,component:yt,bindings:pt,customBindings:Ot(Ot({},Vt??{}),pt),rendersCustomNode:wt,hasSlotChildren:iQ(rt),slotContent:String((kt=rt.content)!=null?kt:""),isCodeBlock:rt.type==="code_block",indexKey:`${KG.value}-${$.index}`,vnodeKey:`${LG.value}\0${$.index}\0${rt.type}`})}));function h2($){var X;return $?.type==="code_block"?String((X=$.language)!=null?X:"").trim().toLowerCase():""}function y3($,X){const he=X.trim().toLowerCase();if(he)for(const pe of[he,Xb(he),OH(he)]){const Ne=pe&&$[pe];if(Ne)return Ne}}function T_($,X,he,pe){var Ne,ze;const tt=Ot({},$.value);return Yp(tt.estimatedPreviewHeightPx)==null&&(tt.estimatedPreviewHeightPx=pe(he(String((Ne=X?.code)!=null?Ne:"")),void 0,tt.maxHeight==="none"?null:(ze=Yp(tt.maxHeight))!=null?ze:void 0)),tt}function E_($){return T_(YG,$,gk,yk)}function L_($){return T_(JG,$,vk,kk)}function N_($,X){if(!$)return UC;const he=xi.value,pe=he[String($.type)];if($.type==="code_block"){const Ne=X??h2($),ze=Ne?y3(he,Ne):void 0;return ze||(m.value==="pre"?he.code_block||al:Ne==="mermaid"?he.mermaid||qG:Ne==="infographic"?he.infographic||UG:Ne==="d2"||Ne==="d2lang"?he.d2||VG:pe||he.code_block||JS.value)}return pe||A_[String($.type)]||UC}function k3($){o("click",$)}function oQ($){var X;(X=$.target)!=null&&X.closest("[data-node-index]")&&o("mouseover",$)}function sQ($){var X;(X=$.target)!=null&&X.closest("[data-node-index]")&&o("mouseout",$)}function D_($){o("mouseover",$)}function F_($){o("mouseout",$)}const _f=U(null),nl=U(!1),jm=U(null),rQ=D(()=>!(I.domMode!=="minimal"||se.value||I.fade!==!1||f.value||nl.value||Ye.value||En.value||Rs.value||bi.value||oo.value||Object.keys(xi.value).length!==0));let Hm,pp=null,b3=0,p2=0,m2=0;const B_=["code_block","admonition","table","math_block","html_block","image","thematic_break"],lQ=new Set(B_),R_=[".typewriter-cursor",".height-estimation-probes",...B_.map($=>`[data-node-type="${$}"]`),"script","style"].join(",");function O_($){if(!$||typeof $!="object")return!1;const X=$.type;return typeof X=="string"&&lQ.has(X)}function g2($){var X,he;if(!$||typeof $!="object")return 0;const pe=$,Ne=(he=(X=pe.raw)!=null?X:pe.content)!=null?he:pe.code;if(typeof Ne=="string")return Ne.length;const ze=pe.children;if(Array.isArray(ze))return ze.reduce((ot,kt)=>ot+g2(kt),0);const tt=pe.items;return Array.isArray(tt)?tt.reduce((ot,kt)=>ot+g2(kt),0):0}function v2(){Hm&&(clearTimeout(Hm),Hm=void 0)}function w3(){b3+=1,pp!=null&&(Ki?.(pp),pp=null)}function Wm(){w3(),$c(),_f.value&&(_f.value.style.visibility="hidden")}function aQ($){var X;if($.nodeType!==Node.TEXT_NODE||!((X=$.textContent)!=null?X:"").trim())return!1;const he=$.parentElement;return!!he&&!he.closest(R_)}function uQ($){let X=$.lastChild;for(;X;){if(aQ(X))return X;if(X.nodeType===Node.ELEMENT_NODE){const he=X;if(!he.matches(R_)&&he.lastChild){X=he.lastChild;continue}}for(;X&&X!==$&&!X.previousSibling;)X=X.parentNode;if(!X||X===$)break;X=X.previousSibling}return null}function $_(){const $=f2.value;for(let X=$.length-1;X>=0;X--){const he=$[X];if(!he||O_(he.node)||!u2(he.index))continue;const pe=mi.get(he.index);if(!pe)continue;const Ne=uQ(pe);if(Ne)return Ne}return null}function $c(){jm.value&&(jm.value.classList.remove(FN),jm.value=null)}function y2(){if(d.value!=="simple"||!Z||!nl.value||!O.value)return void $c();const $=$_(),X=$?(function(he){var pe;const Ne=(pe=he.parentElement)==null?void 0:pe.closest(".text-node");return Ne instanceof HTMLElement?Ne:he.parentElement})($):null;X!==jm.value&&($c(),X&&(X.classList.add(FN),jm.value=X))}function k2(){if(d.value!=="precise"||!Z||!nl.value||pp!=null)return;const $=b3,X=()=>{pp=null,$===b3&&(function(){var he,pe;if(d.value!=="precise"||!(Z&&nl.value&&O.value&&_f.value))return;const Ne=O.value,ze=_f.value;ze.style.visibility="hidden";const tt=$_();if(!tt)return;let ot=0,kt=0,rt=20,ht=!1;if(tt?.textContent){const yt=tt.textContent.length,nt=document.createRange();nt.setStart(tt,Math.max(0,yt-1)),nt.setEnd(tt,yt);const pt=typeof nt.getClientRects=="function"?nt.getClientRects():void 0,St=(pe=pt?.[pt.length-1])!=null?pe:(he=tt.parentElement)==null?void 0:he.getBoundingClientRect();if(St){const wt=jt("typewriterCursor.root.getBoundingClientRect",()=>Ne.getBoundingClientRect());ot=St.right-wt.left+Ne.scrollLeft,kt=St.top-wt.top+Ne.scrollTop,rt=St.height||rt,ht=!0}nt.detach()}ht&&(ze.style.transform=`translate(${Math.max(0,ot)}px, ${Math.max(0,kt)}px)`,ze.style.height=`${rt}px`,ze.style.visibility="visible")})()};eo?pp=eo(X):X()}return qe([Ke,()=>i.content,()=>i.nodes,()=>I.typewriter,at],()=>ao(null,null,function*(){var $,X;if(!Z||se.value||!J.value)return;if(at.value)return nl.value=!1,v2(),void Wm();if(($=i.nodes)!=null&&$.length)return nl.value=!1,v2(),Wm(),p2=((X=i.content)!=null?X:"").length,void(m2=Ke.value.length);const he=(function(){var ot,kt;return(ot=i.nodes)!=null&&ot.length?i.nodes.reduce((rt,ht)=>rt+g2(ht),0):((kt=i.content)!=null?kt:"").length})(),pe=(function(){var ot;return(ot=i.nodes)!=null&&ot.length?i.nodes.reduce((kt,rt)=>kt+g2(rt),0):Ke.value.length})(),Ne=!O_(Qe.value[Qe.value.length-1]),ze=he>p2,tt=pe>m2;if(!f.value||!Ne||!ze&&!tt)return f.value&&Ne||(nl.value=!1,Wm()),p2=he,void(m2=pe);p2=he,m2=pe,nl.value=!0,d.value==="precise"&&_f.value&&(_f.value.style.visibility="hidden"),v2(),yield vt(),d.value==="simple"?y2():($c(),k2()),Hm=setTimeout(()=>{Hm=void 0,nl.value=!1},3e3)}),{flush:"post",immediate:!0}),qe(nl,$=>ao(null,null,function*(){$?(yield vt(),d.value!=="simple"?($c(),d.value==="precise"&&k2()):y2()):Wm()}),{flush:"post"}),qe(d,()=>ao(null,null,function*(){if(Z&&!se.value&&J.value&&nl.value){if(yield vt(),d.value==="simple")return w3(),void y2();$c(),d.value!=="precise"?Wm():k2()}}),{flush:"post"}),qe([()=>Jn.value,()=>zn.start,()=>zn.end],()=>ao(null,null,function*(){Z&&!se.value&&J.value&&nl.value&&(yield vt(),d.value!=="simple"?($c(),d.value==="precise"&&k2()):y2())}),{flush:"post"}),si(()=>{v2(),w3(),$c(),Rn.clear()}),($,X)=>{const he=zY("NodeRenderer",!0);return p(se)?(k(!0),L(Be,{key:0},xt(f2.value,pe=>(k(),L(Be,{key:pe.vnodeKey},[pe.rendersCustomNode?(k(),ce(jo(pe.component),fi({key:0,ref_for:!0},pe.customBindings,{node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:k3,onMouseover:D_,onMouseout:F_,onCopy:X[0]||(X[0]=Ne=>s(Ne)),onHandleArtifactClick:X[1]||(X[1]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[pe.hasSlotChildren?(k(),ce(he,fi({key:0,ref_for:!0},Ct.value,{nodes:pe.node.children,"index-key":pe.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):pe.slotContent?(k(),ce(he,fi({key:1,ref_for:!0},Ct.value,{content:pe.slotContent,final:!pe.node.loading,"index-key":`${pe.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(jo(pe.component),fi({key:1,node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey},{ref_for:!0},pe.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:k3,onMouseover:D_,onMouseout:F_,onCopy:X[2]||(X[2]=Ne=>s(Ne)),onHandleArtifactClick:X[3]||(X[3]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),L("div",{key:1,ref_key:"containerRef",ref:O,class:$e(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:En.value},{"virtual-scroll-coordinated":ns.value},{"stable-layout":Tt.value},{"typewriter-simple-cursor":nl.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:k3,onMouseover:oQ,onMouseout:sQ},[ci.value||En.value?(k(),L(Be,{key:0},[ci.value?(k(),ce(xke,{key:0,width:di.value,"flow-root":En.value||ns.value,"paragraph-node":po.value,"list-item-node":Bs.value,"list-node":qs.value,"heading-nodes":Nr.value,"set-paragraph-wrapper":yn,"set-list-item-wrapper":Bn,"set-list-wrapper":ni,"set-heading-wrapper":IG},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),En.value?(k(),L("div",{key:1,class:"node-spacer",style:sn({height:`${z4.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),rQ.value?(k(!0),L(Be,{key:1},xt(f2.value,pe=>(k(),L(Be,{key:pe.vnodeKey},[u2(pe.index)?(k(),ce(jo(pe.component),fi({key:0,node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey},{ref_for:!0},pe.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:X[4]||(X[4]=Ne=>o("mouseover",Ne)),onMouseout:X[5]||(X[5]=Ne=>o("mouseout",Ne)),onCopy:X[6]||(X[6]=Ne=>s(Ne)),onHandleArtifactClick:X[7]||(X[7]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(k(!0),L(Be,{key:2},xt(f2.value,pe=>(k(),L("div",{key:pe.vnodeKey,ref_for:!0,ref:Ne=>c2(pe.index,Ne),class:"node-slot","data-node-index":pe.index,"data-node-type":pe.node.type},[u2(pe.index)?(k(),L("div",{key:0,ref_for:!0,ref:Ne=>(function(ze,tt){var ot;tt||(function(yt){const nt=`${H4()}-${yt}`;let pt=!1;for(const St of Array.from(us.keys())){const wt=ta.get(St);(wt?.index===yt||St===nt||St.startsWith(`${nt}-`))&&(us.delete(St),ta.delete(St),pt=!0)}pt&&(op(),ro("async-node"))})(ze),Ia.delete(ze),(function(yt){var nt;const pt=((nt=Il.get(yt))!=null?nt:0)+1;Il.set(yt,pt)})(ze);const kt=Ma.get(ze);if(kt){for(const yt of kt)At(yt);Ma.delete(ze)}if((function(yt){const nt=Mo.get(yt);nt&&(Oo?.unobserve(nt),Zo.delete(nt),Mo.delete(yt))})(ze),!tt||!mr.value)return Js.delete(ze),void Il.delete(ze);Js.set(ze,tt);const rt=()=>{d2(ze,tt)};queueMicrotask(rt);const ht=(Oo||typeof ResizeObserver>"u"||(Oo=new ResizeObserver(yt=>{if(yt.length)for(const nt of yt){const pt=Zo.get(nt.target),St=Mo.get(pt??-1);pt!=null&&St&&d2(pt,St)}else Ku()})),Oo);if(ht&&(Mo.set(ze,tt),Zo.set(tt,ze),ht.observe(tt)),typeof window<"u"){const yt=((ot=Qe.value[ze])==null?void 0:ot.type)==="code_block"?[16,80,240,800]:at.value?[80]:[];if(yt.length){const nt=yt.map(pt=>et(pt,rt,"node-resize")).filter(pt=>pt!=null);nt.length&&Ma.set(ze,nt)}}})(pe.index,Ne),class:"node-content"},[pe.isCodeBlock?pe.rendersCustomNode?(k(),ce(jo(pe.component),fi({key:1,ref_for:!0},pe.customBindings,{node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:X[12]||(X[12]=Ne=>s(Ne)),onHandleArtifactClick:X[13]||(X[13]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[pe.hasSlotChildren?(k(),ce(he,fi({key:0,ref_for:!0},Ct.value,{nodes:pe.node.children,"index-key":pe.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):pe.slotContent?(k(),ce(he,fi({key:1,ref_for:!0},Ct.value,{content:pe.slotContent,final:!pe.node.loading,"index-key":`${pe.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(jo(pe.component),fi({key:2,node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey},{ref_for:!0},pe.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:X[14]||(X[14]=Ne=>s(Ne)),onHandleArtifactClick:X[15]||(X[15]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(mo,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:ae(()=>[pe.rendersCustomNode?(k(),ce(jo(pe.component),fi({key:0,ref_for:!0},pe.customBindings,{node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:X[8]||(X[8]=Ne=>s(Ne)),onHandleArtifactClick:X[9]||(X[9]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[pe.hasSlotChildren?(k(),ce(he,fi({key:0,ref_for:!0},Ct.value,{nodes:pe.node.children,"index-key":pe.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):pe.slotContent?(k(),ce(he,fi({key:1,ref_for:!0},Ct.value,{content:pe.slotContent,final:!pe.node.loading,"index-key":`${pe.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(jo(pe.component),fi({key:1,node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey},{ref_for:!0},pe.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:X[10]||(X[10]=Ne=>s(Ne)),onHandleArtifactClick:X[11]||(X[11]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),L("div",{key:1,class:"node-placeholder",style:sn({height:`${nu(pe.index)}px`})},null,4))],8,Mke))),128)),nl.value&&d.value==="precise"?(k(),L("span",{key:3,ref_key:"typewriterCursorRef",ref:_f,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),En.value?(k(),L("div",{key:4,class:"node-spacer",style:sn({height:`${j4.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,_ke))}}})),[["__scopeId","data-v-a9489508"]]),yl=mW;yl.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",yl.__name,yl.name].filter(n=>!!n));for(const n of t)e.component(n,mW)};const X7=Object.freeze(Object.defineProperty({__proto__:null,default:yl},Symbol.toStringTag,{value:"Module"})),Ike={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Tke={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Eke={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Lke={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Nke={class:"admonition-title"},Dke=["aria-expanded","aria-controls"],Fke=["id"],l9=$i(ct({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=U(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),L("div",{class:$e(["admonition",[`admonition-${i.node.kind}`]])},[S("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),L("svg",Ike,[...c[1]||(c[1]=[S("circle",{cx:"12",cy:"12",r:"10"},null,-1),S("path",{d:"M12 16v-4"},null,-1),S("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),L("svg",Tke,[...c[2]||(c[2]=[S("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),S("path",{d:"M9 18h6"},null,-1),S("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),L("svg",Eke,[...c[3]||(c[3]=[S("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),S("path",{d:"M12 9v4"},null,-1),S("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),L("svg",Lke,[...c[4]||(c[4]=[S("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),S("path",{d:"M12 8v4"},null,-1),S("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),S("span",Nke,B(s.value),1),i.node.collapsible?(k(),L("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),L("svg",{style:sn({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[S("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Dke)):ee("",!0)]),hi(S("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[V(p(yl),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Fke),[[Jo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);l9.install=e=>{e.component(l9.__name,l9)};const QC=()=>es(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let iy=null,oy=QC,sy=null,BN=!1,RN=!1;function lkt(){return ao(this,null,function*(){if(iy)return iy;const e=oy;return e?e===QC&&BN?null:sy||(sy=ao(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===QC)return e===oy&&(BN=!0,(function(i){RN||(RN=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===oy&&(sy=null)}return e!==oy?null:t?(iy=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),iy):null}),sy):null})}let ry=null,gW=null,ly=null;function akt(){return typeof gW=="function"}function ukt(){return ao(this,null,function*(){if(ry)return ry;const e=gW;return e?ly||(ly=ao(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(ry=n,ry):null}).finally(()=>{ly=null}),ly):null})}const ckt=Symbol("markstreamLanguageIconResolver");function Bke(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Rke(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let ON=!1;function vW(){ON||typeof Worker>"u"||(ON=!0,h2e(new Bke),_2e(new Rke))}vW();function pd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function $N(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const ex={},Ik=Symbol("resolveImage");class xu extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class la extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class tx extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function Fi(e){return e instanceof xu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function o4(e){return e instanceof la||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function Oke(e){return o4(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function $ke(e){return e instanceof tx||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const Pke=41301,zke=40922;function PN(e){return Fi(e)&&e.code===zke}const tc=3e4,ay=5*6e4,zN=5*6e4,yW="0123456789ABCDEFGHJKMNPQRSTVWXYZ",YC=500,kW=40101;function jN(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function uy(e=tc){try{return AbortSignal.timeout(e)}catch{return}}function jke(e,t){let n="",i=e;for(let o=0;oyW[n%32]).join("")}function sg(){return`${jke(Date.now(),10)}${Hke(16)}`}function HN(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function V8(e){try{const t=await e.text();return t?t.length>YC?`${t.slice(0,YC)}...`:t:void 0}catch{return}}class WN{constructor(t){this.opts=t,this.tracer=t.tracer??ex}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=pd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;jN(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=sg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:uy()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new la({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tc,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new tx({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new xu({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i?.allowCodes,i?.timeoutMs)}async postZip(t,n,i){const o="POST",s=pd(this.opts.origin,t,this.opts.restBasePath),r=sg(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:uy(ay)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new la({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:ay,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const v=h?.code??u.status,y=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:v,msg:y,envelopeRequestId:h?.request_id}),new xu({code:v,msg:y,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new la({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:ay,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await V8(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new la({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:ay,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=pd(this.opts.origin,t,this.opts.restBasePath),s=sg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:HN(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:uy()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new la({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tc,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new la({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:tc,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await V8(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new xu({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=pd(this.opts.origin,t,this.opts.restBasePath),s=sg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:HN(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=tc;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new la({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new la({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new la({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:tc,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,YC),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new xu({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s=[],r=tc){let l=pd(this.opts.origin,n,this.opts.restBasePath);if(o){const m=new URLSearchParams;jN(m,o);const g=m.toString();g&&(l=`${l}?${g}`)}const a=sg(),u={"X-Request-Id":a};this.addClientHeaders(u),i!==void 0&&(u["Content-Type"]="application/json; charset=utf-8");const c=Date.now();this.tracer.restRequest?.({method:t,path:n,url:l,requestId:a,body:i});let d;try{d=await fetch(l,{method:t,headers:u,body:i!==void 0?JSON.stringify(i):void 0,signal:uy(r)})}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"fetch",durationMs:Date.now()-c,error:m}),new la({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"fetch",timeoutMs:r,timestamp:Date.now(),durationMs:Date.now()-c})}let f;const h=d.clone();try{const m=await d.text();f=d.status===204&&m===""?{code:0,msg:"",data:null,request_id:a}:JSON.parse(m)}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"parse",durationMs:Date.now()-c,status:d.status,error:m}),new la({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"parse",timeoutMs:r,status:d.status,statusText:d.statusText,contentType:d.headers.get("content-type")??void 0,bodyPreview:await V8(h),timestamp:Date.now(),durationMs:Date.now()-c})}if(this.tracer.restResponse?.({method:t,path:n,requestId:a,status:d.status,durationMs:Date.now()-c,code:f.code,msg:f.msg,envelopeRequestId:f.request_id,data:f.data}),this.checkAuthRequired(d,f.code),f.code!==0&&!s.includes(f.code))throw new xu({code:typeof f.code=="number"?f.code:d.status,msg:typeof f.msg=="string"&&f.msg.length>0?f.msg:`HTTP ${d.status}${d.statusText?` ${d.statusText}`:""}`,requestId:f.request_id??a,details:f.details,timestamp:Date.now(),durationMs:Date.now()-c});return f.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===kW)&&this.opts.credentialStore?.markAuthRequired?.()}}function bW(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function qN(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function gu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:bW(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function cy(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function p0(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function UN(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function nx(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:UN(e.source)};case"video":return{type:"video",source:UN(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function wW(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(nx),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function CW(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function Wke(e){return{content:e.content.map(CW),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function qke(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function Uke(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function Vke(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Kke(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Vke),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function Zke(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Kke),createdAt:e.created_at}}function Gke(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function Qke(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=Gke(i);return{answers:t,method:e.method,note:e.note}}function JC(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function VN(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Gc(e,t){const n=e[t];return typeof n=="string"?n:void 0}function _p(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ia(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function AW(e){if(!e||typeof e!="object")return null;const t=e,n=Gc(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:Gc(t,"goalId")??Gc(t,"goal_id")??"goal",objective:Gc(t,"objective")??"",completionCriterion:Gc(t,"completionCriterion")??Gc(t,"completion_criterion"),status:n,turnsUsed:_p(t,"turnsUsed")??_p(t,"turns_used")??0,tokensUsed:_p(t,"tokensUsed")??_p(t,"tokens_used")??0,wallClockMs:_p(t,"wallClockMs")??_p(t,"wall_clock_ms")??0,terminalReason:Gc(t,"terminalReason")??Gc(t,"terminal_reason"),budget:{tokenBudget:ia(o,"tokenBudget")??ia(o,"token_budget"),remainingTokens:ia(o,"remainingTokens")??ia(o,"remaining_tokens"),turnBudget:ia(o,"turnBudget")??ia(o,"turn_budget"),remainingTurns:ia(o,"remainingTurns")??ia(o,"remaining_turns"),wallClockBudgetMs:ia(o,"wallClockBudgetMs")??ia(o,"wall_clock_budget_ms"),remainingWallClockMs:ia(o,"remainingWallClockMs")??ia(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Yke(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:gu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:gu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:p0(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:p0(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:bW(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=AW(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:wW(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(nx),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:Uke(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:Zke(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:JC(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:XC(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function Jke(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function Mp(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function KN(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function XC(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function Xke(e){return e.session_id}function ebe(e){return e.seq}function tbe(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function ZN(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const nbe={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function ibe(e,t){switch(t.op){case"reset":return obe(e,t);case"turn.upsert":return rbe(e,t.turn);case"step.upsert":return abe(e,t.turnId,t.step);case"frame.upsert":return cbe(e,t);case"append":return fbe(e,t);case"marker.upsert":return QN(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return QN(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return mbe(e,t.task);case"interaction.upsert":return gbe(e,t.interaction);case"attachment.upsert":return ybe(e,t.attachment);case"todo.upsert":return bbe(e,t.todo);case"prompt.upsert":return Cbe(e,t.prompt);case"meta.merge":return Sbe(e,t.meta);case"items.remove":return pbe(e,t.ids)}}function obe(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function GN(e,t){return{...e,kind:"turn",steps:[...t]}}function xW(e){return{kind:"turn",turnId:e,ordinal:tbe(e),state:"running",origin:{kind:"other"},steps:[]}}function sbe(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function z1(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function ix(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function s4(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function rbe(e,t){const n=z1(e,t.turnId);return n?lbe(n,t)?{state:e,changed:!1}:{state:{...e,items:s4(e.items,t.turnId,i=>GN(t,i.steps))},changed:!0}:{state:{...e,items:ix(e.items,GN(t,[]))},changed:!0}}function lbe(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function abe(e,t,n){const i=z1(e,t)??xW(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&ube(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=z1(e,t)?s4(e.items,t,()=>l):ix(e.items,l);return{state:{...e,items:a},changed:!0}}function ube(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function cbe(e,t){const n=z1(e,t.turnId)??xW(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??sbe(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&dbe(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=z1(e,t.turnId)?s4(e.items,t.turnId,()=>a):ix(e.items,a);return{state:{...e,items:u},changed:!0}}function dbe(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function fbe(e,t){if(t.target.type==="task")return hbe(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=z1(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=SW(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:s4(e.items,n,()=>d)},changed:!0}}function hbe(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=SW(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function SW(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function QN(e,t,n,i){if(e.items.some(s=>eA(s)===n)){let s=!1;const r=e.items.map(l=>eA(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function eA(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function pbe(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(eA(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function mbe(e,t){const n=e.tasks.get(t.taskId);if(n&&xbe(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function gbe(e,t){const n=e.interactions.get(t.interactionId);if(n&&vbe(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function vbe(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function ybe(e,t){const n=e.attachments.get(t.attachmentId);if(n&&kbe(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function kbe(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function bbe(e,t){const n=e.todos.get(t.todoId);if(n&&wbe(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function wbe(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function Cbe(e,t){const n=e.prompts.get(t.promptId);if(n&&Abe(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function Abe(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function xbe(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function Sbe(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class _be{constructor(t){this.agentId=t}#e=nbe;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=ibe(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Lt(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class C1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _W extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const MW={};function Vd(e){return MW}function IW(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function tA(e,t){return typeof t=="bigint"?t.toString():t}function r4(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ox(e){return e==null}function sx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Mbe(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const YN=Symbol("evaluating");function Hi(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==YN)return i===void 0&&(i=YN,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Jh(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function af(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function JN(e){return JSON.stringify(e)}function Ibe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const TW="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function J0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Tbe=r4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function j1(e){if(J0(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(J0(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function EW(e){return j1(e)?{...e}:Array.isArray(e)?[...e]:e}const Ebe=new Set(["string","number","symbol"]);function H1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Tn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Lbe(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Nbe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Dbe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=af(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return Jh(this,"shape",r),r},checks:[]});return uf(e,s)}function Fbe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=af(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return Jh(this,"shape",r),r},checks:[]});return uf(e,s)}function Bbe(e,t){if(!j1(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=af(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Jh(this,"shape",s),s}});return uf(e,o)}function Rbe(e,t){if(!j1(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=af(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Jh(this,"shape",i),i}});return uf(e,n)}function Obe(e,t){const n=af(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Jh(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return uf(e,n)}function $be(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=af(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return Jh(this,"shape",a),a},checks:[]});return uf(t,r)}function Pbe(e,t,n){const i=af(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return Jh(this,"shape",s),s}});return uf(t,i)}function Xp(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function dy(e){return typeof e=="string"?e:e?.message}function Kd(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=dy(e.inst?._zod.def?.error?.(e))??dy(t?.error?.(e))??dy(n.customError?.(e))??dy(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function rx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function X0(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const LW=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,tA,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},NW=Lt("$ZodError",LW),DW=Lt("$ZodError",LW,{Parent:Error});function zbe(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function jbe(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new C1;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Kd(a,s,Vd())));throw TW(l,o?.callee),l}return r.value},ax=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Kd(a,s,Vd())));throw TW(l,o?.callee),l}return r.value},l4=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new C1;return s.issues.length?{success:!1,error:new(e??NW)(s.issues.map(r=>Kd(r,o,Vd())))}:{success:!0,data:s.value}},Hbe=l4(DW),a4=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>Kd(r,o,Vd())))}:{success:!0,data:s.value}},Wbe=a4(DW),qbe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return lx(e)(t,n,o)},Ube=e=>(t,n,i)=>lx(e)(t,n,i),Vbe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ax(e)(t,n,o)},Kbe=e=>async(t,n,i)=>ax(e)(t,n,i),Zbe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return l4(e)(t,n,o)},Gbe=e=>(t,n,i)=>l4(e)(t,n,i),Qbe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return a4(e)(t,n,o)},Ybe=e=>async(t,n,i)=>a4(e)(t,n,i),Jbe=/^[cC][^\s-]{8,}$/,Xbe=/^[0-9a-z]+$/,e4e=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,t4e=/^[0-9a-vA-V]{20}$/,n4e=/^[A-Za-z0-9]{27}$/,i4e=/^[a-zA-Z0-9_-]{21}$/,o4e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,s4e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,XN=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,r4e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,l4e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function a4e(){return new RegExp(l4e,"u")}const u4e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,c4e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,d4e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,f4e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,h4e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,FW=/^[A-Za-z0-9_-]*$/,p4e=/^\+[1-9]\d{6,14}$/,BW="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",m4e=new RegExp(`^${BW}$`);function RW(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function g4e(e){return new RegExp(`^${RW(e)}$`)}function v4e(e){const t=RW({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${BW}T(?:${i})$`)}const y4e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},k4e=/^-?\d+$/,OW=/^-?\d+(?:\.\d+)?$/,b4e=/^(?:true|false)$/i,w4e=/^[^A-Z]*$/,C4e=/^[^a-z]*$/,xl=Lt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$W={number:"number",bigint:"bigint",object:"date"},PW=Lt("$ZodCheckLessThan",(e,t)=>{xl.init(e,t);const n=$W[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{xl.init(e,t);const n=$W[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),A4e=Lt("$ZodCheckMultipleOf",(e,t)=>{xl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Mbe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),x4e=Lt("$ZodCheckNumberFormat",(e,t)=>{xl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=Nbe[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=k4e)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),S4e=Lt("$ZodCheckMaxLength",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!ox(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=rx(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),_4e=Lt("$ZodCheckMinLength",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!ox(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=rx(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),M4e=Lt("$ZodCheckLengthEquals",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!ox(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=rx(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),u4=Lt("$ZodCheckStringFormat",(e,t)=>{var n,i;xl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),I4e=Lt("$ZodCheckRegex",(e,t)=>{u4.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),T4e=Lt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=w4e),u4.init(e,t)}),E4e=Lt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=C4e),u4.init(e,t)}),L4e=Lt("$ZodCheckIncludes",(e,t)=>{xl.init(e,t);const n=H1(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),N4e=Lt("$ZodCheckStartsWith",(e,t)=>{xl.init(e,t);const n=new RegExp(`^${H1(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),D4e=Lt("$ZodCheckEndsWith",(e,t)=>{xl.init(e,t);const n=new RegExp(`.*${H1(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),F4e=Lt("$ZodCheckOverwrite",(e,t)=>{xl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class B4e{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` +`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` +`))}}const R4e={major:4,minor:3,patch:6},No=Lt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=R4e;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=Xp(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new C1;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=Xp(r,f)))});else{if(r.issues.length===f)continue;u||(u=Xp(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(Xp(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new C1;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new C1;return a.then(u=>o(u,i,l))}return o(a,i,l)}}Hi(e,"~standard",()=>({validate:o=>{try{const s=Hbe(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Wbe(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),ux=Lt("$ZodString",(e,t)=>{No.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??y4e(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ao=Lt("$ZodStringFormat",(e,t)=>{u4.init(e,t),ux.init(e,t)}),O4e=Lt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=s4e),Ao.init(e,t)}),$4e=Lt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=XN(i))}else t.pattern??(t.pattern=XN());Ao.init(e,t)}),P4e=Lt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=r4e),Ao.init(e,t)}),z4e=Lt("$ZodURL",(e,t)=>{Ao.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),j4e=Lt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=a4e()),Ao.init(e,t)}),H4e=Lt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=i4e),Ao.init(e,t)}),W4e=Lt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Jbe),Ao.init(e,t)}),q4e=Lt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Xbe),Ao.init(e,t)}),U4e=Lt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=e4e),Ao.init(e,t)}),V4e=Lt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=t4e),Ao.init(e,t)}),K4e=Lt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=n4e),Ao.init(e,t)}),Z4e=Lt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=v4e(t)),Ao.init(e,t)}),G4e=Lt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=m4e),Ao.init(e,t)}),Q4e=Lt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=g4e(t)),Ao.init(e,t)}),Y4e=Lt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o4e),Ao.init(e,t)}),J4e=Lt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=u4e),Ao.init(e,t),e._zod.bag.format="ipv4"}),X4e=Lt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=c4e),Ao.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),e3e=Lt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=d4e),Ao.init(e,t)}),t3e=Lt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=f4e),Ao.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function jW(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const n3e=Lt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=h4e),Ao.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{jW(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function i3e(e){if(!FW.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return jW(n)}const o3e=Lt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=FW),Ao.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{i3e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),s3e=Lt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=p4e),Ao.init(e,t)});function r3e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const l3e=Lt("$ZodJWT",(e,t)=>{Ao.init(e,t),e._zod.check=n=>{r3e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),HW=Lt("$ZodNumber",(e,t)=>{No.init(e,t),e._zod.pattern=e._zod.bag.pattern??OW,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),a3e=Lt("$ZodNumberFormat",(e,t)=>{x4e.init(e,t),HW.init(e,t)}),u3e=Lt("$ZodBoolean",(e,t)=>{No.init(e,t),e._zod.pattern=b4e,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),c3e=Lt("$ZodUnknown",(e,t)=>{No.init(e,t),e._zod.parse=n=>n}),d3e=Lt("$ZodNever",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function eD(e,t,n){e.issues.length&&t.issues.push(...e1(n,e.issues)),t.value[n]=e.value}const f3e=Lt("$ZodArray",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;reD(u,n,r))):eD(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function Tk(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...e1(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function WW(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Lbe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function qW(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>Tk(h,n,d,t,c))):Tk(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const h3e=Lt("$ZodObject",(e,t)=>{if(No.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=r4(()=>WW(t));Hi(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=J0,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(v=>Tk(v,l,f,u,m))):Tk(g,l,f,u,m)}return s?qW(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),p3e=Lt("$ZodObjectJIT",(e,t)=>{h3e.init(e,t);const n=e._zod.parse,i=r4(()=>WW(t)),o=f=>{const h=new B4e(["shape","payload","ctx"]),m=i.value,g=C=>{const A=JN(C);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const C of m.keys)v[C]=`key_${y++}`;h.write("const newResult = {};");for(const C of m.keys){const A=v[C],T=JN(C),_=f[C]?._zod?.optout==="optional";h.write(`const ${A} = ${g(C)};`),_?h.write(` + if (${A}.issues.length) { + if (${T} in input) { + payload.issues = payload.issues.concat(${A}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${T}, ...iss.path] : [${T}] + }))); + } + } + + if (${A}.value === undefined) { + if (${T} in input) { + newResult[${T}] = undefined; + } + } else { + newResult[${T}] = ${A}.value; + } + + `):h.write(` + if (${A}.issues.length) { + payload.issues = payload.issues.concat(${A}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${T}, ...iss.path] : [${T}] + }))); + } + + if (${A}.value === undefined) { + if (${T} in input) { + newResult[${T}] = undefined; + } + } else { + newResult[${T}] = ${A}.value; + } + + `)}h.write("payload.value = newResult;"),h.write("return payload;");const b=h.compile();return(C,A)=>b(f,C,A)};let s;const r=J0,l=!MW.jitless,u=l&&Tbe.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?qW([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function tD(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Xp(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>Kd(r,i,Vd())))}),t)}const UW=Lt("$ZodUnion",(e,t)=>{No.init(e,t),Hi(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Hi(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Hi(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Hi(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>sx(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>tD(a,o,e,s)):tD(l,o,e,s)}}),m3e=Lt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,UW.init(e,t);const n=e._zod.parse;Hi(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=r4(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!J0(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),g3e=Lt("$ZodIntersection",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>nD(n,a,u)):nD(n,s,r)}});function nA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(j1(e)&&j1(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=nA(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),Xp(e))return e;const r=nA(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const v3e=Lt("$ZodRecord",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!j1(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...e1(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...e1(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&OW.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>Kd(d,i,Vd())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...e1(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...e1(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),y3e=Lt("$ZodEnum",(e,t)=>{No.init(e,t);const n=IW(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>Ebe.has(typeof o)).map(o=>typeof o=="string"?H1(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),k3e=Lt("$ZodLiteral",(e,t)=>{if(No.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?H1(i):i?H1(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),b3e=Lt("$ZodTransform",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new _W(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new C1;return n.value=o,n}});function iD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const VW=Lt("$ZodOptional",(e,t)=>{No.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Hi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Hi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${sx(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>iD(s,n.value)):iD(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),w3e=Lt("$ZodExactOptional",(e,t)=>{VW.init(e,t),Hi(e._zod,"values",()=>t.innerType._zod.values),Hi(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),C3e=Lt("$ZodNullable",(e,t)=>{No.init(e,t),Hi(e._zod,"optin",()=>t.innerType._zod.optin),Hi(e._zod,"optout",()=>t.innerType._zod.optout),Hi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${sx(n.source)}|null)$`):void 0}),Hi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),A3e=Lt("$ZodDefault",(e,t)=>{No.init(e,t),e._zod.optin="optional",Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>oD(s,t)):oD(o,t)}});function oD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const x3e=Lt("$ZodPrefault",(e,t)=>{No.init(e,t),e._zod.optin="optional",Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),S3e=Lt("$ZodNonOptional",(e,t)=>{No.init(e,t),Hi(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>sD(s,e)):sD(o,e)}});function sD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const _3e=Lt("$ZodCatch",(e,t)=>{No.init(e,t),Hi(e._zod,"optin",()=>t.innerType._zod.optin),Hi(e._zod,"optout",()=>t.innerType._zod.optout),Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>Kd(r,i,Vd()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Kd(s,i,Vd()))},input:n.value}),n.issues=[]),n)}}),M3e=Lt("$ZodPipe",(e,t)=>{No.init(e,t),Hi(e._zod,"values",()=>t.in._zod.values),Hi(e._zod,"optin",()=>t.in._zod.optin),Hi(e._zod,"optout",()=>t.out._zod.optout),Hi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>fy(r,t.in,i)):fy(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>fy(s,t.out,i)):fy(o,t.out,i)}});function fy(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const I3e=Lt("$ZodReadonly",(e,t)=>{No.init(e,t),Hi(e._zod,"propValues",()=>t.innerType._zod.propValues),Hi(e._zod,"values",()=>t.innerType._zod.values),Hi(e._zod,"optin",()=>t.innerType?._zod?.optin),Hi(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(rD):rD(o)}});function rD(e){return e.value=Object.freeze(e.value),e}const T3e=Lt("$ZodCustom",(e,t)=>{xl.init(e,t),No.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>lD(s,n,i,e));lD(o,n,i,e)}});function lD(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(X0(o))}}var aD;class E3e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function L3e(){return new E3e}(aD=globalThis).__zod_globalRegistry??(aD.__zod_globalRegistry=L3e());const Ig=globalThis.__zod_globalRegistry;function N3e(e,t){return new e({type:"string",...Tn(t)})}function D3e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Tn(t)})}function uD(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Tn(t)})}function F3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Tn(t)})}function B3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tn(t)})}function R3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tn(t)})}function O3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tn(t)})}function $3e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Tn(t)})}function P3e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Tn(t)})}function z3e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tn(t)})}function j3e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Tn(t)})}function H3e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tn(t)})}function W3e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Tn(t)})}function q3e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Tn(t)})}function U3e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tn(t)})}function V3e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tn(t)})}function K3e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tn(t)})}function Z3e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tn(t)})}function G3e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tn(t)})}function Q3e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Tn(t)})}function Y3e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Tn(t)})}function J3e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Tn(t)})}function X3e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Tn(t)})}function e8e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tn(t)})}function t8e(e,t){return new e({type:"string",format:"date",check:"string_format",...Tn(t)})}function n8e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Tn(t)})}function i8e(e,t){return new e({type:"string",format:"duration",check:"string_format",...Tn(t)})}function o8e(e,t){return new e({type:"number",checks:[],...Tn(t)})}function s8e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Tn(t)})}function r8e(e,t){return new e({type:"boolean",...Tn(t)})}function l8e(e){return new e({type:"unknown"})}function a8e(e,t){return new e({type:"never",...Tn(t)})}function cD(e,t){return new PW({check:"less_than",...Tn(t),value:e,inclusive:!1})}function K8(e,t){return new PW({check:"less_than",...Tn(t),value:e,inclusive:!0})}function dD(e,t){return new zW({check:"greater_than",...Tn(t),value:e,inclusive:!1})}function Z8(e,t){return new zW({check:"greater_than",...Tn(t),value:e,inclusive:!0})}function fD(e,t){return new A4e({check:"multiple_of",...Tn(t),value:e})}function KW(e,t){return new S4e({check:"max_length",...Tn(t),maximum:e})}function Ek(e,t){return new _4e({check:"min_length",...Tn(t),minimum:e})}function ZW(e,t){return new M4e({check:"length_equals",...Tn(t),length:e})}function u8e(e,t){return new I4e({check:"string_format",format:"regex",...Tn(t),pattern:e})}function c8e(e){return new T4e({check:"string_format",format:"lowercase",...Tn(e)})}function d8e(e){return new E4e({check:"string_format",format:"uppercase",...Tn(e)})}function f8e(e,t){return new L4e({check:"string_format",format:"includes",...Tn(t),includes:e})}function h8e(e,t){return new N4e({check:"string_format",format:"starts_with",...Tn(t),prefix:e})}function p8e(e,t){return new D4e({check:"string_format",format:"ends_with",...Tn(t),suffix:e})}function hm(e){return new F4e({check:"overwrite",tx:e})}function m8e(e){return hm(t=>t.normalize(e))}function g8e(){return hm(e=>e.trim())}function v8e(){return hm(e=>e.toLowerCase())}function y8e(){return hm(e=>e.toUpperCase())}function k8e(){return hm(e=>Ibe(e))}function b8e(e,t,n){return new e({type:"array",element:t,...Tn(n)})}function w8e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Tn(n)})}function C8e(e){const t=A8e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(X0(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(X0(o))}},e(n.value,n)));return t}function A8e(e,t){const n=new xl({check:"custom",...Tn(t)});return n._zod.check=e,n}function GW(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ig,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Cs(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),Cs(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Or(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function QW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function YW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Lk(t,"input",e.processors),output:Lk(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Or(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Or(i.element,n);if(i.type==="set")return Or(i.valueType,n);if(i.type==="lazy")return Or(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Or(i.innerType,n);if(i.type==="intersection")return Or(i.left,n)||Or(i.right,n);if(i.type==="record"||i.type==="map")return Or(i.keyType,n)||Or(i.valueType,n);if(i.type==="pipe")return Or(i.in,n)||Or(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Or(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Or(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Or(o,n))return!0;return!!(i.rest&&Or(i.rest,n))}return!1}const x8e=(e,t={})=>n=>{const i=GW({...n,processors:t});return Cs(e,i),QW(i,e),YW(i,e)},Lk=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=GW({...o??{},target:s,io:t,processors:n});return Cs(e,r),QW(r,e),YW(r,e)},S8e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_8e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=S8e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},M8e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},I8e=(e,t,n,i)=>{n.type="boolean"},T8e=(e,t,n,i)=>{n.not={}},E8e=(e,t,n,i)=>{},L8e=(e,t,n,i)=>{const o=e._zod.def,s=IW(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},N8e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},D8e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},F8e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},B8e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=Cs(s.element,t,{...i,path:[...i.path,"items"]})},R8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=Cs(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Cs(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},O8e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>Cs(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},$8e=(e,t,n,i)=>{const o=e._zod.def,s=Cs(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=Cs(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},P8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=Cs(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Cs(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=Cs(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},z8e=(e,t,n,i)=>{const o=e._zod.def,s=Cs(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},j8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},H8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},W8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},q8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},U8e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Cs(s,t,i);const r=t.seen.get(e);r.ref=s},V8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},JW=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},K8e=Lt("ZodISODateTime",(e,t)=>{Z4e.init(e,t),Fo.init(e,t)});function Z8e(e){return e8e(K8e,e)}const G8e=Lt("ZodISODate",(e,t)=>{G4e.init(e,t),Fo.init(e,t)});function Q8e(e){return t8e(G8e,e)}const Y8e=Lt("ZodISOTime",(e,t)=>{Q4e.init(e,t),Fo.init(e,t)});function J8e(e){return n8e(Y8e,e)}const X8e=Lt("ZodISODuration",(e,t)=>{Y4e.init(e,t),Fo.init(e,t)});function e5e(e){return i8e(X8e,e)}const t5e=(e,t)=>{NW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>jbe(e,n)},flatten:{value:n=>zbe(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,tA,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,tA,2)}},isEmpty:{get(){return e.issues.length===0}}})},Aa=Lt("ZodError",t5e,{Parent:Error}),n5e=lx(Aa),i5e=ax(Aa),o5e=l4(Aa),s5e=a4(Aa),r5e=qbe(Aa),l5e=Ube(Aa),a5e=Vbe(Aa),u5e=Kbe(Aa),c5e=Zbe(Aa),d5e=Gbe(Aa),f5e=Qbe(Aa),h5e=Ybe(Aa),Do=Lt("ZodType",(e,t)=>(No.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Lk(e,"input"),output:Lk(e,"output")}}),e.toJSONSchema=x8e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(af(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>uf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>n5e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>o5e(e,n,i),e.parseAsync=async(n,i)=>i5e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>s5e(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>r5e(e,n,i),e.decode=(n,i)=>l5e(e,n,i),e.encodeAsync=async(n,i)=>a5e(e,n,i),e.decodeAsync=async(n,i)=>u5e(e,n,i),e.safeEncode=(n,i)=>c5e(e,n,i),e.safeDecode=(n,i)=>d5e(e,n,i),e.safeEncodeAsync=async(n,i)=>f5e(e,n,i),e.safeDecodeAsync=async(n,i)=>h5e(e,n,i),e.refine=(n,i)=>e.check(lwe(n,i)),e.superRefine=n=>e.check(awe(n)),e.overwrite=n=>e.check(hm(n)),e.optional=()=>mD(e),e.exactOptional=()=>Z5e(e),e.nullable=()=>gD(e),e.nullish=()=>mD(gD(e)),e.nonoptional=n=>ewe(e,n),e.array=()=>Ti(e),e.or=n=>P5e([e,n]),e.and=n=>H5e(e,n),e.transform=n=>vD(e,V5e(n)),e.default=n=>Y5e(e,n),e.prefault=n=>X5e(e,n),e.catch=n=>nwe(e,n),e.pipe=n=>vD(e,n),e.readonly=()=>swe(e),e.describe=n=>{const i=e.clone();return Ig.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return Ig.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ig.get(e);const i=e.clone();return Ig.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),XW=Lt("_ZodString",(e,t)=>{ux.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>_8e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(u8e(...i)),e.includes=(...i)=>e.check(f8e(...i)),e.startsWith=(...i)=>e.check(h8e(...i)),e.endsWith=(...i)=>e.check(p8e(...i)),e.min=(...i)=>e.check(Ek(...i)),e.max=(...i)=>e.check(KW(...i)),e.length=(...i)=>e.check(ZW(...i)),e.nonempty=(...i)=>e.check(Ek(1,...i)),e.lowercase=i=>e.check(c8e(i)),e.uppercase=i=>e.check(d8e(i)),e.trim=()=>e.check(g8e()),e.normalize=(...i)=>e.check(m8e(...i)),e.toLowerCase=()=>e.check(v8e()),e.toUpperCase=()=>e.check(y8e()),e.slugify=()=>e.check(k8e())}),p5e=Lt("ZodString",(e,t)=>{ux.init(e,t),XW.init(e,t),e.email=n=>e.check(D3e(m5e,n)),e.url=n=>e.check($3e(g5e,n)),e.jwt=n=>e.check(X3e(L5e,n)),e.emoji=n=>e.check(P3e(v5e,n)),e.guid=n=>e.check(uD(hD,n)),e.uuid=n=>e.check(F3e(hy,n)),e.uuidv4=n=>e.check(B3e(hy,n)),e.uuidv6=n=>e.check(R3e(hy,n)),e.uuidv7=n=>e.check(O3e(hy,n)),e.nanoid=n=>e.check(z3e(y5e,n)),e.guid=n=>e.check(uD(hD,n)),e.cuid=n=>e.check(j3e(k5e,n)),e.cuid2=n=>e.check(H3e(b5e,n)),e.ulid=n=>e.check(W3e(w5e,n)),e.base64=n=>e.check(Q3e(I5e,n)),e.base64url=n=>e.check(Y3e(T5e,n)),e.xid=n=>e.check(q3e(C5e,n)),e.ksuid=n=>e.check(U3e(A5e,n)),e.ipv4=n=>e.check(V3e(x5e,n)),e.ipv6=n=>e.check(K3e(S5e,n)),e.cidrv4=n=>e.check(Z3e(_5e,n)),e.cidrv6=n=>e.check(G3e(M5e,n)),e.e164=n=>e.check(J3e(E5e,n)),e.datetime=n=>e.check(Z8e(n)),e.date=n=>e.check(Q8e(n)),e.time=n=>e.check(J8e(n)),e.duration=n=>e.check(e5e(n))});function Ht(e){return N3e(p5e,e)}const Fo=Lt("ZodStringFormat",(e,t)=>{Ao.init(e,t),XW.init(e,t)}),m5e=Lt("ZodEmail",(e,t)=>{P4e.init(e,t),Fo.init(e,t)}),hD=Lt("ZodGUID",(e,t)=>{O4e.init(e,t),Fo.init(e,t)}),hy=Lt("ZodUUID",(e,t)=>{$4e.init(e,t),Fo.init(e,t)}),g5e=Lt("ZodURL",(e,t)=>{z4e.init(e,t),Fo.init(e,t)}),v5e=Lt("ZodEmoji",(e,t)=>{j4e.init(e,t),Fo.init(e,t)}),y5e=Lt("ZodNanoID",(e,t)=>{H4e.init(e,t),Fo.init(e,t)}),k5e=Lt("ZodCUID",(e,t)=>{W4e.init(e,t),Fo.init(e,t)}),b5e=Lt("ZodCUID2",(e,t)=>{q4e.init(e,t),Fo.init(e,t)}),w5e=Lt("ZodULID",(e,t)=>{U4e.init(e,t),Fo.init(e,t)}),C5e=Lt("ZodXID",(e,t)=>{V4e.init(e,t),Fo.init(e,t)}),A5e=Lt("ZodKSUID",(e,t)=>{K4e.init(e,t),Fo.init(e,t)}),x5e=Lt("ZodIPv4",(e,t)=>{J4e.init(e,t),Fo.init(e,t)}),S5e=Lt("ZodIPv6",(e,t)=>{X4e.init(e,t),Fo.init(e,t)}),_5e=Lt("ZodCIDRv4",(e,t)=>{e3e.init(e,t),Fo.init(e,t)}),M5e=Lt("ZodCIDRv6",(e,t)=>{t3e.init(e,t),Fo.init(e,t)}),I5e=Lt("ZodBase64",(e,t)=>{n3e.init(e,t),Fo.init(e,t)}),T5e=Lt("ZodBase64URL",(e,t)=>{o3e.init(e,t),Fo.init(e,t)}),E5e=Lt("ZodE164",(e,t)=>{s3e.init(e,t),Fo.init(e,t)}),L5e=Lt("ZodJWT",(e,t)=>{l3e.init(e,t),Fo.init(e,t)}),eq=Lt("ZodNumber",(e,t)=>{HW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>M8e(e,i,o),e.gt=(i,o)=>e.check(dD(i,o)),e.gte=(i,o)=>e.check(Z8(i,o)),e.min=(i,o)=>e.check(Z8(i,o)),e.lt=(i,o)=>e.check(cD(i,o)),e.lte=(i,o)=>e.check(K8(i,o)),e.max=(i,o)=>e.check(K8(i,o)),e.int=i=>e.check(pD(i)),e.safe=i=>e.check(pD(i)),e.positive=i=>e.check(dD(0,i)),e.nonnegative=i=>e.check(Z8(0,i)),e.negative=i=>e.check(cD(0,i)),e.nonpositive=i=>e.check(K8(0,i)),e.multipleOf=(i,o)=>e.check(fD(i,o)),e.step=(i,o)=>e.check(fD(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function bn(e){return o8e(eq,e)}const N5e=Lt("ZodNumberFormat",(e,t)=>{a3e.init(e,t),eq.init(e,t)});function pD(e){return s8e(N5e,e)}const D5e=Lt("ZodBoolean",(e,t)=>{u3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>I8e(e,n,i)});function Pv(e){return r8e(D5e,e)}const F5e=Lt("ZodUnknown",(e,t)=>{c3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>E8e()});function Es(){return l8e(F5e)}const B5e=Lt("ZodNever",(e,t)=>{d3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>T8e(e,n,i)});function R5e(e){return a8e(B5e,e)}const O5e=Lt("ZodArray",(e,t)=>{f3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>B8e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(Ek(n,i)),e.nonempty=n=>e.check(Ek(1,n)),e.max=(n,i)=>e.check(KW(n,i)),e.length=(n,i)=>e.check(ZW(n,i)),e.unwrap=()=>e.element});function Ti(e,t){return b8e(O5e,e,t)}const $5e=Lt("ZodObject",(e,t)=>{p3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>R8e(e,n,i,o),Hi(e,"shape",()=>t.shape),e.keyof=()=>Co(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Es()}),e.loose=()=>e.clone({...e._zod.def,catchall:Es()}),e.strict=()=>e.clone({...e._zod.def,catchall:R5e()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Bbe(e,n),e.safeExtend=n=>Rbe(e,n),e.merge=n=>Obe(e,n),e.pick=n=>Dbe(e,n),e.omit=n=>Fbe(e,n),e.partial=(...n)=>$be(nq,e,n[0]),e.required=(...n)=>Pbe(iq,e,n[0])});function Jt(e,t){const n={type:"object",shape:e??{},...Tn(t)};return new $5e(n)}const tq=Lt("ZodUnion",(e,t)=>{UW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>O8e(e,n,i,o),e.options=t.options});function P5e(e,t){return new tq({type:"union",options:e,...Tn(t)})}const z5e=Lt("ZodDiscriminatedUnion",(e,t)=>{tq.init(e,t),m3e.init(e,t)});function cf(e,t,n){return new z5e({type:"union",options:t,discriminator:e,...Tn(n)})}const j5e=Lt("ZodIntersection",(e,t)=>{g3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>$8e(e,n,i,o)});function H5e(e,t){return new j5e({type:"intersection",left:e,right:t})}const W5e=Lt("ZodRecord",(e,t)=>{v3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>P8e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function cx(e,t,n){return new W5e({type:"record",keyType:e,valueType:t,...Tn(n)})}const iA=Lt("ZodEnum",(e,t)=>{y3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>L8e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new iA({...t,checks:[],...Tn(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new iA({...t,checks:[],...Tn(o),entries:s})}});function Co(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new iA({type:"enum",entries:n,...Tn(t)})}const q5e=Lt("ZodLiteral",(e,t)=>{k3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>N8e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Qn(e,t){return new q5e({type:"literal",values:Array.isArray(e)?e:[e],...Tn(t)})}const U5e=Lt("ZodTransform",(e,t)=>{b3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>F8e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new _W(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(X0(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(X0(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function V5e(e){return new U5e({type:"transform",transform:e})}const nq=Lt("ZodOptional",(e,t)=>{VW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>JW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function mD(e){return new nq({type:"optional",innerType:e})}const K5e=Lt("ZodExactOptional",(e,t)=>{w3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>JW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function Z5e(e){return new K5e({type:"optional",innerType:e})}const G5e=Lt("ZodNullable",(e,t)=>{C3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>z8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function gD(e){return new G5e({type:"nullable",innerType:e})}const Q5e=Lt("ZodDefault",(e,t)=>{A3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>H8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Y5e(e,t){return new Q5e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():EW(t)}})}const J5e=Lt("ZodPrefault",(e,t)=>{x3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>W8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function X5e(e,t){return new J5e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():EW(t)}})}const iq=Lt("ZodNonOptional",(e,t)=>{S3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>j8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ewe(e,t){return new iq({type:"nonoptional",innerType:e,...Tn(t)})}const twe=Lt("ZodCatch",(e,t)=>{_3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>q8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function nwe(e,t){return new twe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const iwe=Lt("ZodPipe",(e,t)=>{M3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>U8e(e,n,i,o),e.in=t.in,e.out=t.out});function vD(e,t){return new iwe({type:"pipe",in:e,out:t})}const owe=Lt("ZodReadonly",(e,t)=>{I3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>V8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function swe(e){return new owe({type:"readonly",innerType:e})}const rwe=Lt("ZodCustom",(e,t)=>{T3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>D8e(e,n)});function lwe(e,t={}){return w8e(rwe,e,t)}function awe(e){return C8e(e)}const Oh=Ht().min(1),dx=Ht().min(1),zv=Ht().min(1),$h=Ht().min(1),Gl=Ht().min(1),uwe=/^[A-Za-z0-9._-]{1,128}$/;function cwe(e){return uwe.test(e)&&e!=="."&&e!==".."}const oq=cf("kind",[Jt({kind:Qn("user"),payload:Es().optional()}),Jt({kind:Qn("cron"),taskId:$h.optional(),payload:Es().optional()}),Jt({kind:Qn("task"),taskId:$h,payload:Es().optional()}),Jt({kind:Qn("hook"),payload:Es().optional()}),Jt({kind:Qn("compaction"),payload:Es().optional()}),Jt({kind:Qn("side"),payload:Es().optional()}),Jt({kind:Qn("other"),payload:Es().optional()})]),dwe=Jt({inputTokens:bn().optional(),outputTokens:bn().optional(),cachedTokens:bn().optional(),cost:bn().optional()}),m0=Jt({inputOther:bn(),output:bn(),inputCacheRead:bn(),inputCacheCreation:bn()}),fwe=Jt({llmFirstTokenLatencyMs:bn().optional(),llmStreamDurationMs:bn().optional(),llmRequestBuildMs:bn().optional(),llmServerFirstTokenMs:bn().optional(),llmServerDecodeMs:bn().optional(),llmClientConsumeMs:bn().optional()}),hwe=Jt({failedAttempt:bn(),nextAttempt:bn(),maxAttempts:bn(),delayMs:bn(),errorName:Ht(),errorMessage:Ht(),statusCode:bn().optional()}),sq=Co(["queued","running","completed","failed","cancelled"]),pwe=Co(["running","completed","interrupted","failed"]),mwe=Jt({kind:Qn("text"),frameId:zv,role:Co(["assistant","user"]),text:Ht(),attachmentIds:Ti(Ht()).optional(),taskId:$h.optional(),promptIds:Ti(Ht()).optional()}),gwe=Jt({kind:Qn("thinking"),frameId:zv,text:Ht()}),vwe=Jt({agentId:Gl,role:Co(["child","member"]).optional()}),ywe=Jt({kind:Co(["stdout","stderr","progress","status","custom"]),text:Ht().optional(),percent:bn().optional(),customKind:Ht().optional(),customData:Es().optional()}),kwe=Jt({kind:Qn("tool"),frameId:zv,toolCallId:Ht(),name:Ht(),view:Ht().optional(),state:Co(["running","done","error"]),input:Es().optional(),output:Es().optional(),display:Es().optional(),error:Ht().optional(),inputText:Ht().optional(),progress:ywe.optional(),taskId:$h.optional(),approvalId:Ht().optional(),todoId:Ht().optional(),agentRefs:Ti(vwe).optional()}),fx=Jt({interactionId:Ht(),interactionKind:Co(["approval","question"]),toolCallId:Ht().optional(),state:Co(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Es().optional(),response:Es().optional()}),bwe=Jt({kind:Qn("notice"),frameId:zv,level:Co(["error","warning","info"]),source:Ht().optional(),message:Ht(),detail:Es().optional()}),rq=cf("kind",[mwe,gwe,kwe,bwe]),lq=Jt({kind:Qn("step"),stepId:dx,turnId:Oh,ordinal:bn().int(),state:pwe,frames:Ti(rq),startedAt:Ht().optional(),endedAt:Ht().optional(),usage:m0.optional(),finishReason:Ht().optional(),timing:fwe.optional(),retry:hwe.optional(),endReason:Ht().optional(),endMessage:Ht().optional()}),aq=Jt({kind:Qn("turn"),turnId:Oh,ordinal:bn().int(),state:sq,origin:oq,prompt:Ht().optional(),attachmentIds:Ti(Ht()).optional(),steps:Ti(lq),startedAt:Ht().optional(),endedAt:Ht().optional(),usage:dwe.optional(),durationMs:bn().optional(),error:Ht().optional()}),uq=Jt({kind:Qn("marker"),markerId:Ht(),marker:Ht(),payload:Es().optional(),at:Ht().optional()}),cq=Jt({kind:Qn("taskref"),refId:Ht(),taskId:$h,at:Ht().optional()}),dq=cf("kind",[aq,uq,cq]),hx=Jt({taskId:$h,kind:Co(["shell","subagent","tool","other"]),state:Co(["running","completed","failed","timed_out","killed","lost"]),detached:Pv(),description:Ht().optional(),agentId:Gl.optional(),outputTail:Ht(),startedAt:Ht().optional(),endedAt:Ht().optional(),resultSummary:Ht().optional(),error:Ht().optional(),stateReason:Ht().optional(),usage:m0.optional(),model:Ht().optional(),thinkingEffort:Ht().optional()}),fq=Jt({objective:Ht(),status:Co(["active","paused","blocked","complete"]),completionCriterion:Ht().optional(),budgetUsed:bn().optional(),budgetLimit:bn().optional()}),wwe=Jt({plan:Jt({reviewPath:Ht().optional(),version:bn().optional()}).optional(),swarm:Jt({trigger:Ht().optional()}).optional(),tower:Jt({}).optional()}),Cwe=Jt({plan:Jt({reviewPath:Ht().optional(),version:bn().optional()}).nullable().optional(),swarm:Jt({trigger:Ht().optional()}).nullable().optional(),tower:Jt({}).nullable().optional()}),Awe=cf("kind",[Jt({kind:Qn("idle")}),Jt({kind:Qn("running"),turnId:bn(),step:bn(),stepId:Ht(),since:bn()}),Jt({kind:Qn("streaming"),turnId:bn(),step:bn(),stepId:Ht(),stream:Co(["assistant","thinking","tool_call"]),toolCallId:Ht().optional(),toolName:Ht().optional(),since:bn()}),Jt({kind:Qn("tool_call"),turnId:bn(),step:bn(),toolCallId:Ht(),name:Ht(),since:bn()}),Jt({kind:Qn("retrying"),turnId:bn(),step:bn(),stepId:Ht(),failedAttempt:bn(),nextAttempt:bn(),maxAttempts:bn(),delayMs:bn(),errorName:Ht().optional(),statusCode:bn().optional(),since:bn()}),Jt({kind:Qn("awaiting_approval"),turnId:bn(),step:bn().optional(),approval:Es().optional(),since:bn()}),Jt({kind:Qn("interrupted"),turnId:bn(),step:bn().optional(),reason:Co(["aborted","max_steps","error"]),message:Ht().optional(),at:bn()}),Jt({kind:Qn("ended"),turnId:bn(),reason:Co(["completed","cancelled","failed","blocked"]),durationMs:bn().optional(),at:bn()})]),xwe=Jt({byModel:cx(Ht(),m0).optional(),currentTurn:m0.optional(),total:m0.optional()}),Swe=Jt({model:Ht().optional(),thinkingEffort:Ht().optional(),usage:xwe.optional(),contextTokens:bn().optional(),maxContextTokens:bn().optional(),contextUsage:bn().optional(),permission:Co(["manual","yolo","auto"]).optional(),phase:Awe.optional()}),px=Jt({goal:fq.optional(),modes:wwe.optional(),activity:Co(["idle","turn","disposing","unknown"]).optional(),agent:Swe.optional()}),_we=px.extend({goal:fq.nullable().optional(),modes:Cwe.optional()}),c4=Jt({attachmentId:Ht(),mediaType:Ht(),name:Ht().optional(),size:bn().optional(),source:cf("kind",[Jt({kind:Qn("url"),url:Ht()}),Jt({kind:Qn("file"),fileId:Ht()}),Jt({kind:Qn("session_media"),fileId:Ht()})]).optional(),placeholder:Ht().optional()}),Mwe=Jt({title:Ht(),status:Co(["pending","in_progress","done"])}),mx=Jt({todoId:Ht(),items:Ti(Mwe),updatedAt:Ht().optional()}),gx=Jt({promptId:Ht(),status:Co(["running","queued","blocked","completed","failed","aborted"]),userMessageId:Ht().optional(),content:Es().optional(),createdAt:Ht(),finishedAt:Ht().optional(),steeredAt:Ht().optional()}),hq=Jt({items:Ti(dq),tasks:Ti(hx),interactions:Ti(fx).default([]),attachments:Ti(c4).default([]),todos:Ti(mx).default([]),prompts:Ti(gx).default([]),meta:px,hasMoreOlder:Pv().optional()}),Iwe=aq.omit({steps:!0}),Twe=lq.omit({frames:!0}),Ewe=cf("type",[Jt({type:Qn("frame"),turnId:Oh,stepId:dx,frameId:zv}),Jt({type:Qn("task"),taskId:$h})]),vx=cf("op",[Jt({op:Qn("reset"),agentId:Gl,snapshot:hq}),Jt({op:Qn("turn.upsert"),turn:Iwe}),Jt({op:Qn("step.upsert"),turnId:Oh,step:Twe}),Jt({op:Qn("frame.upsert"),turnId:Oh,stepId:dx,frame:rq}),Jt({op:Qn("append"),target:Ewe,offset:bn().int().nonnegative(),text:Ht()}),Jt({op:Qn("marker.upsert"),item:uq,beforeTurn:bn().int().optional()}),Jt({op:Qn("taskref.upsert"),item:cq,beforeTurn:bn().int().optional()}),Jt({op:Qn("task.upsert"),task:hx}),Jt({op:Qn("interaction.upsert"),interaction:fx}),Jt({op:Qn("attachment.upsert"),attachment:c4}),Jt({op:Qn("todo.upsert"),todo:mx}),Jt({op:Qn("prompt.upsert"),prompt:gx}),Jt({op:Qn("meta.merge"),meta:_we}),Jt({op:Qn("items.remove"),ids:Ti(Ht())})]);Jt({agentId:Gl,ops:Ti(vx)});const Lwe=Co(["off","turn","block","delta"]),W1=bn().int().nonnegative(),Nwe=cx(Ht(),Lwe);Jt({session_id:Ht().min(1),transcript:Nwe,transcript_since:cx(Ht(),W1).optional()});Jt({agent_id:Gl,before_turn:Ht().min(1).optional(),after_turn:Ht().min(1).optional(),page_size:bn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),cwe(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const Dwe=Jt({agentId:Gl,type:Co(["main","sub","independent"]).optional(),parentAgentId:Gl.optional(),label:Ht().optional(),createdAt:Ht().optional(),disposedAt:Ht().optional()}),Fwe=Jt({agent_id:Gl,items:Ti(dq),has_more:Pv(),tasks:Ti(hx),interactions:Ti(fx).default([]),attachments:Ti(c4).default([]),todos:Ti(mx).default([]),prompts:Ti(gx).default([]),meta:px,agents:Ti(Dwe),pending_interactions:Ti(Ht()),seq:W1.optional()});Jt({agent_id:Gl,batches:Ti(Jt({seq:W1,ops:Ti(vx)})),latest_seq:W1,complete:Pv()});const Bwe=Jt({turn_id:Oh,ordinal:bn().int(),state:sq,origin:oq,prompt:Ht(),attachment_ids:Ti(Ht()).optional(),started_at:Ht().optional()});Jt({agents:Ti(Jt({agent_id:Gl,messages:Ti(Bwe),attachments:Ti(c4).default([])}))});const Rwe=Jt({state:Co(["pending","approved","rejected","cancelled"]),selected_option:Ht().optional(),feedback:Ht().optional()}),Owe=Jt({tool_call_id:Ht(),turn_id:Oh,source:Co(["interaction","display","output"]),plan:Ht(),path:Ht().optional(),options:Ti(Jt({label:Ht(),description:Ht().optional()})).optional(),review:Rwe.optional()});Jt({agent_id:Gl,plans:Ti(Owe)});const $we=Jt({agent_id:Gl,snapshot:hq,has_more_older:Pv(),seq:W1.optional()}),Pwe=Jt({agent_id:Gl,ops:Ti(vx),seq:W1.optional()}),pq=$we.extend({type:Qn("transcript.reset")}),mq=Pwe.extend({type:Qn("transcript.ops")});cf("type",[pq,mq]);const yD=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),zwe=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),jwe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),Hwe=new Set(["assistant.delta","thinking.delta"]);function Wwe(e,t){if(jwe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return Hwe.has(i)?qwe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?zwe.has(i)?{route:"protocol"}:yD.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:yD.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function qwe(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const Uwe="kimi-code.bearer.",Vwe=3e4;class kD{constructor(t){this.opts=t,this.tracer=t.tracer??ex}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${Uwe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=py(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(py(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(py(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Vwe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=pq.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=mq.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=py(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=Wwe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function py(e,t){return`${e}\0${t}`}async function Kwe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=Fwe.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const G8=10485760,Zwe=5e3,bD=40001;function Gwe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function Qwe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function Q8(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function wD(e){return e==="auto_compact"||e==="manual_compact"}class Ywe{constructor(t){this.opts=t,this.tracer=t.tracer??ex,this.http=new WN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new WN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(gu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return gu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return gu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return gu(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return AW(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return gu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(wW),hasMore:o.has_more}}async getSessionTranscript(t,n){return Kwe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` +`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&Fi(d)&&d.code===bD)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:Gwe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Wke(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...Qwe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:zN});return gu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:zN});return gu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(gu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,qke(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Qke(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>JC(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return JC(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(Q8)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return Q8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Q8(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(CW));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(VN)])):void 0;return{items:o.items.map(VN),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:search",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async suggestFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:suggest",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return pd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(p0)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return p0(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return p0(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(Jke)}async listProviders(){return(await this.http.get("/providers")).items.map(Mp)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=Mp(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return Mp(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:Mp(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(KN)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return KN(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:Mp(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(Mp),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Y8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return Y8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return Y8(t)}async getConfig(){const t=await this.http.get("/config");return XC(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return XC(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&Fi(i)&&i.code===bD)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),Zwe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return pd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return pd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:G8});if(n.size>G8)throw new tx({size:n.size,limit:G8});const i=n.type,o=!Jwe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await Xwe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=$N(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new kD({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=Xke(s),l=ebe(s),a=Yke(s);a.type==="historyCompacted"&&!wD(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!wD(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new kD({wsUrl:$N(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function Y8(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function Jwe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function Xwe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const eCe="main",tCe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function J8(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function nCe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function CD(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function Cr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function nr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function oa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function iCe(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=Cr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=Cr(t,"goalId")??Cr(t,"goal_id")??"goal",r=Cr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:Cr(t,"completionCriterion")??Cr(t,"completion_criterion"),status:o,turnsUsed:nr(t,"turnsUsed")??nr(t,"turns_used")??0,tokensUsed:nr(t,"tokensUsed")??nr(t,"tokens_used")??0,wallClockMs:nr(t,"wallClockMs")??nr(t,"wall_clock_ms")??0,terminalReason:Cr(t,"terminalReason")??Cr(t,"terminal_reason"),budget:{tokenBudget:oa(i,"tokenBudget")??oa(i,"token_budget"),remainingTokens:oa(i,"remainingTokens")??oa(i,"remaining_tokens"),turnBudget:oa(i,"turnBudget")??oa(i,"turn_budget"),remainingTurns:oa(i,"remainingTurns")??oa(i,"remaining_turns"),wallClockBudgetMs:oa(i,"wallClockBudgetMs")??oa(i,"wall_clock_budget_ms"),remainingWallClockMs:oa(i,"remainingWallClockMs")??oa(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function sd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function oCe(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=Cr(n,"name")??Cr(n,"toolName")??"tool",o=lP(e,sCe(i)),s=rCe(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=Cr(i,"text");if(s)return X8(s);const r=Cr(i,"message");if(r)return X8(r)}const o=Cr(n,"message");if(o)return X8(o)}return null}function sCe(e){return e.replace(/_\d+$/,"")}const AD=2e3;function X8(e){return e.length>AD?`${e.slice(0,AD)}…`:e}function rCe(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return z6(e,t,i)}function lCe(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=Cr(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=sd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),v=[];return g&&v.push({type:"taskCreated",sessionId:n,task:g}),v.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),v}const l=oCe(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=sd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function aCe(e){return Array.isArray(e)?e.map(t=>nx(t)):[]}function uCe(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const cCe=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function dCe(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=iCe(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function fCe(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=CD(),n.set(f,h)),h}function s(f){n.set(f,CD())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(v){return Cu("[agentProjector] Error projecting event:",f,v instanceof Error?v.message:v),[]}}function d(f,h,m,g){if(cCe.has(f))return dCe(f,h,m);const v=o(m),y=h,b=[],C=y?.agentId;if(typeof C=="string"&&C!==eCe){const A=i.has(C);if(f==="prompt.submitted"){if(!A)return[];const T=y?.promptId,N=y?.userMessageId;if(!T||!N)return[];const _=aCe(y?.content);return _.length===0?[]:[{type:"messageCreated",agentId:C,message:{id:N,sessionId:m,role:"user",content:_,createdAt:typeof y?.createdAt=="string"?y.createdAt:new Date().toISOString(),promptId:T}}]}if(A&&(f==="thinking.delta"||f==="assistant.delta")){const T=y?.delta??"";return T?[{type:"agentDelta",sessionId:m,agentId:C,delta:{[f==="thinking.delta"?"thinking":"text"]:T}}]:[]}if(A&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:C,reason:y?.reason}];if(tCe.has(f))return lCe(t,v,m,C,f,y??{},i)}switch(f){case"turn.started":{const A=y?.turnId,T=v.currentPromptId??J8("pr_");v.currentPromptId=T,A!==void 0&&v.turnPromptId.set(A,T),b.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const A=nCe(y?.usage);v.totalInput+=A.input,v.totalOutput+=A.output,v.totalCacheRead+=A.cacheRead,v.totalCacheCreate+=A.cacheCreate;break}case"agent.status.updated":{y?.model&&(v.model=y.model),y?.contextTokens!==void 0&&(v.contextTokens=y.contextTokens),y?.maxContextTokens!==void 0&&(v.contextLimit=y.maxContextTokens);const A=y?.phase;A!=null&&A.kind==="retrying"?(v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(A,"failedAttempt")??0,nextAttempt:nr(A,"nextAttempt")??0,maxAttempts:nr(A,"maxAttempts")??0,delayMs:nr(A,"delayMs")??0,errorName:Cr(A,"errorName"),statusCode:nr(A,"statusCode"),turnId:nr(A,"turnId")}})):v.retryActive&&A!==void 0&&A!==null&&typeof A.kind=="string"&&(v.retryActive=!1,b.push({type:"turnRetry",sessionId:m,retry:void 0})),b.push({type:"sessionUsageUpdated",sessionId:m,usage:uCe(v),model:v.model||void 0,swarmMode:y?.swarmMode===!0?!0:y?.swarmMode===!1?!1:void 0,planMode:y?.planMode===!0?!0:y?.planMode===!1?!1:void 0,thinking:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:void 0});break}case"turn.ended":{const A=y?.turnId,T=(A!==void 0?v.turnPromptId.get(A):void 0)??v.currentPromptId;b.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:y?.reason,promptId:T}),v.turnCount++,v.currentPromptId=void 0;break}case"prompt.completed":{const A=y?.promptId;typeof A=="string"&&A.length>0&&b.push({type:"promptCompleted",sessionId:m,promptId:A,reason:y?.reason??"completed"});break}case"prompt.aborted":{const A=y?.promptId;typeof A=="string"&&A.length>0&&b.push({type:"promptAborted",sessionId:m,promptId:A});break}case"turn.step.retrying":{v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(y??{},"failedAttempt")??0,nextAttempt:nr(y??{},"nextAttempt")??0,maxAttempts:nr(y??{},"maxAttempts")??0,delayMs:nr(y??{},"delayMs")??0,errorName:Cr(y??{},"errorName"),statusCode:nr(y??{},"statusCode"),turnId:typeof y?.turnId=="number"?y.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const A=typeof y?.subagentId=="string"&&y.subagentId.length>0?y.subagentId:J8("task_"),T=typeof y?.taskId=="string"&&y.taskId.length>0?y.taskId:void 0,N=T!==void 0&&T!==A?v.subagentMeta.get(T):void 0,_=v.subagentMeta.get(A);N!==void 0&&v.subagentMeta.delete(T),T!==void 0&&!v.registrationOrderByKey.has(T)&&v.registrationOrderByKey.set(T,++v.registrationSeq);const w=_===void 0||N===void 0?_??N:{..._,createdAt:N.createdAt,startedAt:N.startedAt??_.startedAt,runInBackground:!0,backgroundTaskId:_.backgroundTaskId??T},M=w?.backgroundTaskId??(w!==void 0&&T!==void 0&&w.id===T?T:void 0),x=T!==void 0?v.registrationOrderByKey.get(T):void 0,E=M!==void 0?v.registrationOrderByKey.get(M):void 0,I=v.retiredBindings.has(T??"")||x!==void 0&&E!==void 0&&x0?y.model:w?.model,thinkingEffort:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:w?.thinkingEffort,parentToolCallId:typeof y?.parentToolCallId=="string"?y.parentToolCallId:w?.parentToolCallId,swarmIndex:typeof y?.swarmIndex=="number"?y.swarmIndex:w?.swarmIndex,runInBackground:F?y?.runInBackground===!0||y?.runInBackground===void 0&&w?.runInBackground===!0:y?.runInBackground===!0||w?.runInBackground===!0,outputPreview:F?void 0:w?.outputPreview,outputBytes:F?void 0:w?.outputBytes,outputLines:F?void 0:w?.outputLines,suspendedReason:F?void 0:w?.suspendedReason,text:F?void 0:w?.text,backgroundTaskId:I?w?.backgroundTaskId:F?T:T??w?.backgroundTaskId};v.subagentMeta.set(P.id,P),b.push({type:"taskCreated",sessionId:m,task:P});break}case"subagent.started":{const A=typeof y?.subagentId=="string"?y.subagentId:void 0,T=A!==void 0&&(v.subagentMeta.get(A)?.status!==void 0&&v.subagentMeta.get(A).status!=="running"||v.settledByKernel.has(A));T&&v.settledByKernel.delete(A);const N=sd(t,v,m,y?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...T?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});T&&A!==void 0&&v.restartedThisRun.add(A),N&&b.push({type:"taskCreated",sessionId:m,task:N});break}case"subagent.suspended":{const A=sd(t,v,m,y?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof y?.reason=="string"?y.reason:void 0});A&&b.push({type:"taskCreated",sessionId:m,task:A});break}case"subagent.completed":{const A=typeof y?.resultSummary=="string"?y.resultSummary:void 0,T=sd(t,v,m,y?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:A});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"completed",outputPreview:A});break}case"subagent.failed":{const A=typeof y?.error=="string"?y.error:void 0,T=sd(t,v,m,y?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:A});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"failed",outputPreview:A});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:y?.code,message:y?.message,name:y?.name,details:y?.details,retryable:y?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:y?.message}});break}case"task.started":case"background.task.started":{const A=y?.info??{},T=typeof A.startedAt=="number"?new Date(A.startedAt).toISOString():void 0,N=typeof A.taskId=="string"?A.taskId:typeof A.taskId=="number"?String(A.taskId):J8("task_"),_=typeof A.description=="string"?A.description:typeof A.command=="string"?A.command:t("tasks.defaultDescription");if(A.kind==="agent"){const M=typeof A.agentId=="string"&&A.agentId.length>0?A.agentId:void 0;if(M!==void 0){const x=v.subagentMeta.get(M),E=v.registrationOrderByKey.get(N),I=x?.backgroundTaskId!==void 0?v.registrationOrderByKey.get(x.backgroundTaskId):void 0;if(v.retiredBindings.has(N)||E!==void 0&&I!==void 0&&EI.backgroundTaskId===N);if(x===void 0&&(v.retiredBindings.has(N)||v.registrationOrderByKey.has(N)&&v.registrationOrderByKey.get(N)0&&v.settledByKernel.add(A.agentId),b.push({type:"taskCompleted",sessionId:m,taskId:typeof A.taskId=="string"?A.taskId:typeof A.taskId=="number"?String(A.taskId):"",status:A.status==="killed"?"cancelled":T?"failed":"completed"});break}}return b}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function hCe(e){return new Ywe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>fCe({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const pCe={t:e=>e},xD="Sub Agent";function mCe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function gCe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function vCe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function my(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const yCe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function oA(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?yCe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function kCe(e,t,n,i=pCe){const o=gCe(e);switch(vCe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!my(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),v=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),y=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,b=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:v?g.status:t.task.status,subagentPhase:v?g.subagentPhase:t.task.subagentPhase,completedAt:v?g.completedAt:b?h.completedAt:t.task.completedAt,completedAtEstimated:v?g.completedAtEstimated:b?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:v?g.outputLines:y?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:v?g.text:y?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:v?g.outputPreview:t.task.outputPreview??(y?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:v?g.outputBytes:t.task.outputBytes??(y?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===xD&&h.description!==xD?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:y?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:y?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!my(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!my(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(my(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,oA(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function bCe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,CCe=/([\w-]+)="([^"]*)"/g,ACe=/]*)>[\s\S]*?<\/output-file>/,xCe=/]*)>([\s\S]*?)<\/output-preview>/,SCe=/^Title: (.*)$/m,_Ce=/^Severity: (.*)$/m;function a9(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function e5(e){const t={};for(const n of e.matchAll(CCe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=a9(n[2]));return t}function MCe(e,t,n){const i=e5(e),o=SCe.exec(t)?.[1]?.trim()??"",s=_Ce.exec(t)?.[1]?.trim()??"";let r=t.split(` +`).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` +`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=ACe.exec(t),u=a?(()=>{const f=e5(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=xCe.exec(t),d=c?(()=>{const f=e5(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` +`),g=a9(m===-1?"":h.slice(m+1)).replace(/\n$/,""),v=Number(f.bytes),y=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(v)?v:void 0,totalBytes:Number.isFinite(y)?y:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:a9(o),severity:s,body:a9(r),outputFile:u,outputPreview:d,raw:n}}function ICe(e){if(!e.includes("SD||s>SD||(o+1)*(s+1)>LCe)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const _D=500;function MD(e,t){const n=[],i=zu(e),o=zu(t),s=Math.min(i.length,_D),r=Math.min(o.length,_D);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function yq(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}const NCe=/^read[_-]?media(?:file)?$/i,DCe=/^data:([^;]+);base64,(.*)$/s,FCe=/^<(image|video|audio)\s+path="([^"]+)">$/,BCe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,RCe=/Mime type:\s*([^.\s]+)/i,OCe=/Size:\s*(\d+)\s*bytes/i,$Ce=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,PCe="Image compressed to fit model limits:",zCe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function jCe(e){return e.includes(PCe)?e.replace(zCe,""):e}function HCe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function ID(e){const t=BCe.exec(e.trim());return t?{kind:t[1],path:HCe(t[2])}:null}const kq=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,WCe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function rA(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return kq.test(i)?i:void 0}const qCe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function TD(e){const t=qCe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",i=WCe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:i!==void 0&&kq.test(i)?i:void 0}}const UCe=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function bq(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function eAe(e,t){if(Er(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function tAe(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function wq(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=Nk(o,s)??MD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=Nk(t.before,t.after)??MD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:Gre(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Cq(e){const t=` +`,n=` +`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):nAe(e)}function nAe(e){const t=e.split(` +`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` +`):e}function iAe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function oAe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` +`);return Cq(t)}function sAe(e,t){const n=e.metadata?.origin??{},i=oAe(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function rAe(e,t,n){const{text:i,cron:o}=sAe(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function lAe(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function aAe(e){return e.metadata?.origin?.kind==="compaction_summary"}function uAe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function cAe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function dAe(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function d4(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const v=d;if(d=null,!g&&v.blocks.length===0&&v.textParts.length===0&&v.thinkingParts.length===0&&v.tools.length===0)return;if(!g||!i)for(let b=0;bN.kind==="tool"&&N.tool.id===A.id);T&&T.kind==="tool"&&(T.tool=A)}const y={id:v.id,role:"assistant",no:a++,text:v.textParts.join(` +`),thinking:v.thinkingParts.length>0?v.thinkingParts.join(` +`):void 0,tools:v.tools.length>0?v.tools:void 0,blocks:v.blocks.length>0?v.blocks:void 0,approval:v.approval,approvalId:v.approvalId,durationMs:v.durationMs,createdAt:v.createdAt,endedAt:v.endedAt,goalContinuation:v.goalContinuation};l.push(y),u?.(y,v.sources)}function h(g,v){let y=null;for(const b of v)if(b.type==="text"){if(b.text){y==="text"?g.textParts[g.textParts.length-1]+=b.text:g.textParts.push(b.text);const C=g.blocks.at(-1);C&&C.kind==="text"?C.text+=(y==="text"?"":` +`)+b.text:g.blocks.push({kind:"text",text:b.text}),y="text"}}else if(b.type==="thinking"){if(b.thinking){y==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=b.thinking:g.thinkingParts.push(b.thinking);const C=g.blocks.at(-1);if(C&&C.kind==="thinking"){C.thinking+=(y==="thinking"?"":` +`)+b.thinking;const A=[C.startedAt,b.startedAt].filter(_=>_!==void 0).sort()[0],T=C.startedAt!==void 0&&C.durationMs===void 0||b.startedAt!==void 0&&b.durationMs===void 0,N=[C,b].flatMap(_=>_.startedAt!==void 0&&_.durationMs!==void 0?[Date.parse(_.startedAt)+_.durationMs]:[]);C.startedAt=A,C.durationMs=!T&&A!==void 0&&N.length>0?Math.max(...N)-Date.parse(A):void 0}else g.blocks.push({kind:"thinking",thinking:b.thinking,startedAt:b.startedAt,durationMs:b.durationMs});y="thinking"}}else if(b.type==="toolUse"){y=null;const C=c.get(b.toolCallId),A=b.toolName==="ExitPlanMode"?s[b.toolCallId]:void 0,T={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),agentId:Er(b.toolName)==="task"?b.agentRefs?.find(N=>N.role!=="member")?.agentId??b.agentRefs?.[0]?.agentId:void 0,status:"running",output:b.outputLines,plan:A,planPath:b.toolName==="ExitPlanMode"?A?.path??o[b.toolCallId]?.path:void 0};g.tools.push(T),g.blocks.push({kind:"tool",tool:T}),C&&(g.approval=wq(C),g.approvalId=C.approvalId)}else if(b.type==="toolResult"){y=null;const C=g.tools.findIndex(A=>A.id===b.toolCallId);if(C!==-1){const A=g.tools[C],T=yx(b.output),N={...A,status:b.isError?"error":"ok",output:T,media:b.isError?void 0:XCe(A.name,b.output),agentId:A.agentId??eAe(A.name,T)};N.name==="ExitPlanMode"&&!N.planPath&&(N.planPath=cAe(N.output)),g.tools[C]=N;const _=g.blocks.find(w=>w.kind==="tool"&&w.tool.id===b.toolCallId);_&&_.kind==="tool"&&(_.tool=N)}}else y=null}function m(g,v){if(g.type==="image"||g.type==="video"){const y=g.type,b=g.source;if(b.kind==="url")return{url:b.url,kind:y};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:y};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:y,fileId:b.fileId};if(b.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(v,b.fileId)??"",kind:y,fileId:b.fileId,sessionId:v}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(aAe(g)){f();const A=g.metadata?.[gq],T={id:g.id,role:"compaction",no:a,text:g.content.filter(N=>N.type==="text").map(N=>N.text).join(` +`),compaction:{trigger:A?.trigger,tokensBefore:A?.tokensBefore,tokensAfter:A?.tokensAfter}};l.push(T),u?.(T,[g]);continue}if(g.role==="user"){const A=iAe(g),T=g.metadata?.origin?.kind,N=T==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(A===void 0&&(T==="injection"||N))continue;if(A===void 0&&(T==="task"||T==="background_task"||T==="task_notification")){const Q=g.content.filter(ge=>ge.type==="text").map(ge=>ge.text).join(` +`),ne=TCe(g.metadata),te=ne!==void 0?[ne]:ICe(Q);if(te.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ge of te)d.blocks.push({kind:"notification",notification:{...ge,createdAt:g.createdAt}})}continue}if(f(),A!==void 0){const Q=rAe(g,a++,A);l.push(Q),u?.(Q,[g]);continue}if(T==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!lAe(g))continue;const _=g.metadata?.origin,w=_?.kind==="skill_activation"&&_?.trigger==="user-slash",M=_?.kind==="plugin_command"&&_?.trigger==="user-slash",x=[],E=[];for(const Q of g.content){if(Q.type==="text")if(w){const te=ID(Q.text);if(te&&(te.kind==="video"||te.kind==="image")&&n){const Ae=rA(te.path);if(Ae){E.push({url:n(Ae),kind:te.kind,fileId:Ae});continue}}const ge=TD(Q.text);ge&&E.push({kind:"file",url:ge.fileId&&n?n(ge.fileId):"",fileId:ge.fileId,name:ge.name,mediaType:ge.mediaType,size:ge.size})}else if(M)x.push(_.commandArgs??"");else{const te=ID(Q.text);if(te&&(te.kind==="video"||te.kind==="image")&&n){const me=rA(te.path);if(me){E.push({url:n(me),kind:te.kind,fileId:me});continue}}const ge=TD(Q.text);if(ge){E.push({kind:"file",url:ge.fileId&&n?n(ge.fileId):"",fileId:ge.fileId,name:ge.name,mediaType:ge.mediaType,size:ge.size});continue}const Ae=jCe(Q.text);if(Ae!==Q.text&&Ae.trim().length===0)continue;x.push(Ae)}const ne=m(Q,g.sessionId);if(ne){E.push({url:ne.url,kind:ne.kind,name:Q.type==="file"?Q.name:void 0,fileId:ne.fileId,sessionId:ne.sessionId});continue}Q.type==="file"&&n&&E.push({kind:"file",url:n(Q.fileId),fileId:Q.fileId,name:Q.name,mediaType:Q.mediaType||void 0,size:Q.size})}const I=w?_?.skillArgs??"":x.join(` +`),F=ZCe(I),W=GCe(I),P=E.filter(Q=>Q.kind==="file"),O=E.filter(Q=>Q.kind==="image"||Q.kind==="video"),R=[...F].some(Q=>Q<=P.length),z=[...W].some(Q=>Q<=O.length),H=R||z?E:[];let j=0,K=0;const re=E.filter(Q=>Q.kind==="file"?(j+=1,!(R&&F.has(j))):Q.kind==="image"||Q.kind==="video"?(K+=1,!(z&&W.has(K))):!0),q={id:g.id,role:"user",no:a++,text:I,attachments:re.length>0?re:void 0,inlineAttachments:H.length>0?H:void 0,skillActivation:w?{name:_.skillName,args:_.skillArgs}:void 0,pluginCommand:M?{pluginId:_.pluginId,commandName:_.commandName,args:_.commandArgs}:void 0,createdAt:g.createdAt};l.push(q),u?.(q,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const v=g.promptId;uAe(d,v)?d!==null&&d.promptId===void 0&&v!==void 0&&(d.promptId=v):(f(),d={id:g.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const b=d;if(b===null)continue;const C=dAe(g.content);b.promptId!==void 0&&b.seenSigs.has(C)||(b.seenSigs.add(C),b.sources.push(g),g.durationMs!==void 0&&(b.durationMs=g.durationMs),h(b,g.content),g.endedAt!==void 0?b.endedAt=g.endedAt:g.id!==b.id&&(b.endedAt=g.createdAt))}return f(!0),l}function Aq(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function fAe(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||Aq(a,c,u)||(d.settledAt=i)}}}function hAe(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function pAe(e,t,n,i){const o=e.items.filter(d=>d.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(d=>[d.taskId,d])),a=new Map(e.prompts.map(d=>[d.promptId,d])),u=e.items.flatMap(d=>d.kind==="turn"?kx(d,e.attachments,l,d.turnId===s?n?.createdAt:void 0,d.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a}):[]),c=e.meta.activity==="turn";return d4(u,[],t,c,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(gAe)}function kx(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(v=>[v.attachmentId,v])),u=lA([e.startedAt,...e.steps.map(v=>v.startedAt),i])??"",c=ED(e.endedAt)??ED(o),d=e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h){const v=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const y of e.attachmentIds??[]){const b=LD(a.get(y));b!==void 0&&v.push(b)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:v,createdAt:u,promptId:d,metadata:r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(y.text.length===0&&!b)continue;if(y.role==="user"){if(y.taskId!==void 0){const T=mAe(y.taskId,y.text,n.get(y.taskId));l.push({id:y.frameId,sessionId:"",role:"user",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:y.taskId},[vq]:T}});continue}const C=y.text.length>0?[{type:"text",text:y.text}]:[];for(const T of y.attachmentIds??[]){const N=LD(a.get(T));N!==void 0&&C.push(N)}const A=y.promptIds?.map(T=>r?.promptById?.get(T)).find(T=>T!==void 0);l.push({id:y.frameId,sessionId:s,role:"user",content:C,createdAt:A?.createdAt??v.startedAt??u,promptId:d});continue}l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d})}else if(y.kind==="thinking"){if(y.text.length===0)continue;const b=r?.pendingInteractionAtByStepId?.get(v.stepId),C=Aq(v,y,b!==void 0),A=r?.thinkingTiming,T=A?.get(y.frameId);let N,_;if(T!==void 0)T.settledAt===void 0&&!C&&(T.settledAt=new Date().toISOString()),N=T.startedAt,_=t5(T.startedAt,T.settledAt);else if(A!==void 0&&C){const w=new Date().toISOString();A.set(y.frameId,{startedAt:w}),N=w}else N=v.startedAt,_=t5(v.startedAt,lA([v.endedAt,b]));l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"thinking",thinking:y.text,startedAt:N,durationMs:_}],createdAt:v.startedAt??u,promptId:d})}else y.kind==="tool"&&(l.push({id:`${y.frameId}:call`,sessionId:"",role:"assistant",content:[{type:"toolUse",toolCallId:y.toolCallId,toolName:y.name,input:y.input??y.display??{},outputLines:y.state==="running"?yx(y.output):void 0,agentRefs:y.agentRefs}],createdAt:v.startedAt??u,promptId:d}),y.state!=="running"&&l.push({id:`${y.frameId}:result`,sessionId:"",role:"tool",content:[{type:"toolResult",toolCallId:y.toolCallId,output:y.output??y.error??"",isError:y.state==="error"}],createdAt:v.endedAt??v.startedAt??u,promptId:d}));const m=e.durationMs??t5(u||void 0,c),g=l.findLastIndex(v=>v.role==="assistant");return g>=0&&(m!==void 0||c!==void 0)&&(l[g]={...l[g],durationMs:m,endedAt:c??l[g].endedAt}),l}function mAe(e,t,n){const[i="",...o]=t.split(` +`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` +`).trim(),raw:t}}function gAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function lA(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const ND=6e3,aA=256*1024,vAe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function DD(e,t){return t===0?e:e-1}function yAe(e,t){const n=zu(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=vAe.exec(s.text);if(!r)return null;const l=DD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=DD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oaA||zu(n).length>ND)return null;const i=yAe(e,n);return i===null||i.length>aA||zu(i).length>ND?null:{before:i,after:n}}const bAe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function wAe(e){return bAe.has(e.type)}const CAe=50,AAe=100,uA=32*1024,xAe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,CAe)},cancelTask(e){clearTimeout(e)}};function SAe(e,t,n={}){const i=n.scheduler??xAe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??AAe)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const y=++u,b=()=>{y===u&&m()};l=i.requestFrame(b),a=i.requestTask(b)};m=()=>{f();let y=0;for(;!c&&y{if(!c){if(t(y)){const b=s.length>r?s.at(-1):void 0,C=b===void 0?void 0:n.coalesce?.(b,y);C===void 0?s.push(y):s[s.length-1]=C,g();return}if(d()===0){e(y);return}s.push(y),m()}});return v.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let b=r;for(let C=r;C{c||(c=!0,f(),s.length=0,r=0)},v}function cA(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function _Ae(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=cA(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=uA)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function MAe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=cA(e.appEvent),s=cA(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>uA)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function IAe(e,t){const i=e.items.filter(d=>d.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(d=>[d.taskId,d])),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=d=>d.kind==="turn"?d.origin.payload??d.origin:void 0,l=new Set,a=e.items.flatMap((d,f)=>{if(d.kind==="turn"){const h=d.startedAt!==void 0||d.steps.some(m=>m.startedAt!==void 0);return TAe(d,e.attachments,o,d.turnId===i&&!h&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s)}if(d.kind==="marker"&&d.marker==="compaction"){const h=EAe(d.payload,d.at,t.sessionId,d.markerId,NAe(e.items,f));return h===void 0?[]:[h]}if(d.kind==="marker"&&d.marker==="cron.fired"){const h=d.payload,m=h?.origin?.jobId,g=typeof h?.prompt=="string"?h.prompt:void 0,v=e.items.slice(f+1).find(b=>{if(b.kind!=="turn"||l.has(b.turnId))return!1;const C=r(b);return C?.kind==="cron_job"&&(m===void 0||C.jobId===m)&&(g===void 0||b.kind==="turn"&&Cq(b.prompt??"")===g)});if(v!==void 0&&v.kind==="turn")return l.add(v.turnId),[];const y=LAe(d.payload,d.at,t.sessionId,d.markerId);return y===void 0?[]:[y]}return[]}),u=e.interactions.map(d=>zp(d,t.sessionId)).filter(d=>d!==void 0),c=e.meta.activity==="turn";return d4(a,u,t.getFileUrl,c,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(BAe)}function TAe(e,t,n,i,o,s,r,l,a){const u=e.origin.payload??e.origin,c=u?.kind;return[...e.prompt===void 0&&c==="system_trigger"?[{id:`${e.turnId}:origin`,sessionId:s,role:"user",content:[],createdAt:lA([e.startedAt,...e.steps.map(f=>f.startedAt),i])??"",promptId:e.turnId,metadata:{origin:u}}]:[],...kx(e,t,n,i,o,s,{includeOrigin:!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a})]}function EAe(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[gq]:l}}}function LAe(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function NAe(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function zp(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function rg(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(DAe),createdAt:""}}function DAe(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(FAe),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function FAe(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function BAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function RAe(){let e=[];const t=(n,i)=>{const s=IAe(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function OAe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function $Ae(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` +`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&OAe(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function FD(e){return e?e.split(` +`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function PAe(e){return e.suspendedReason||FD(e.text)||FD(e.outputLines?.join(` +`))||e.summary||""}function zAe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` +`):e.summary??""}function jAe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function BD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` +`)[0]??"",phase:jAe(e.outcome),body:e.body}}function HAe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function WAe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:PAe(o),phase:o.phase,body:zAe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>HAe(s,o))).map((o,s)=>BD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>BD(o,s))}const qAe=["queued","working","suspended","completed","failed","cancelled"];function xq(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function UAe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function VAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:xq(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=UAe();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function KAe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of qAe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function ZAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:xq(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function bx(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Sq(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const Tg=100*1024;function _q(e){const t=Er(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=bx(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>Tg||a.length>Tg?null:Nk(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>Tg||c.length>Tg)return null;const d=Nk(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=zu(u).length,r+=zu(c).length}return o}const GAe=5e3;function QAe(e){if(Er(e.name)!=="write")return null;const t=bx(e.arg);return!t||typeof t.content!="string"||t.content.length>Tg||t.content.split(` +`).length>GAe?null:{content:t.content,path:Sq(t)}}function RD(e){const t=bx(e.arg);return t?Sq(t):void 0}function YAe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function JAe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function XAe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function e6e(e){return Mq(e).parents}function Mq(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function t6e(e,t,n){const i=Mq(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=YAe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:XAe(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?JAe(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function n6e(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(w,M)=>l.set(w,M);let v=n!==null;if(v){const w=n,M=Object.keys(h);v=M.length===Object.keys(w).length&&M.every(x=>h[x]===w[x])}let y=i!==null;if(y){const w=i,M=Object.keys(m);y=M.length===Object.keys(w).length&&M.every(x=>m[x]===w[x])}const b=e.length>0&&d===t&&v&&y&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let C=0,A=0,T=1;if(b){let w=-1;for(let M=e.length-1;M>=0;M--)if(e[M].role==="assistant"){w=M;break}for(let M=0;M0?[...e.slice(0,C),...N]:N;return e=_,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,_};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function i6e(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&(n++,t.set(o.id,n))}return t}const Iq=["light","dark","system"],o6e=["small","medium","large","xlarge"],n5="medium",Tq="kimi-web.color-scheme",dA="kimi-web.font-scale",OD="kimi-web.ui-font-size";function fA(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function wx(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function s6e(e){try{globalThis.localStorage.removeItem(e)}catch{}}function r6e(){const e=fA(Tq);return e&&Iq.includes(e)?e:"system"}const gy={light:"#ffffff",dark:"#121212"};function l6e(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?gy.dark:e==="light"?gy.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?gy.dark:gy.light;i.setAttribute("content",n??s)})}function Eq(e){return o6e.includes(e)}function a6e(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function u6e(){const e=fA(dA);if(e==="xxlarge")return"xlarge";if(e!==null)return Eq(e)?e:n5;const t=fA(OD);if(t===null)return n5;const n=Number(t),i=Number.isFinite(n)?a6e(n):n5;return wx(dA,i),s6e(OD),i}function c6e(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const Cx=U(r6e()),Ax=U(u6e());let $D=!1;function d6e(){$D||($D=!0,qe(Cx,l6e,{immediate:!0}),qe(Ax,c6e,{immediate:!0}))}function f6e(e){Iq.includes(e)&&(Cx.value=e,wx(Tq,e))}function h6e(e){Eq(e)&&(Ax.value=e,wx(dA,e))}function pm(){return d6e(),{colorScheme:Cx,fontScale:Ax,setColorScheme:f6e,setFontScale:h6e}}const vy=U(!1);let PD=!1;function i5(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function f4(){return!PD&&typeof window<"u"&&typeof document<"u"&&(PD=!0,vy.value=i5(),new MutationObserver(()=>{vy.value=i5()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{vy.value=i5()})),vy}const Lq="kimi-web.sidebar-multi-tab";function p6e(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function m6e(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function g6e(){return p6e(Lq)==="1"}const Nq=U(g6e());function v6e(e){Nq.value=e,m6e(Lq,e?"1":"0")}function mm(){return{sidebarTabs:Nq,setSidebarTabs:v6e}}const zD=document.createElement("i");function y6e(e){const t="&"+e+";";zD.innerHTML=t;const n=zD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ju(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(ju(e,e.length,0,t),e):t}const jD={}.hasOwnProperty;function k6e(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function uo(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Ri(a)?(e.enter(n),l(a)):t(a)}function l(a){return Ri(a)&&s++r))return;const _=t.events.length;let w=_,M,x;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){if(M){x=t.events[w][1].end;break}M=!0}for(y(i),N=_;NC;){const T=n[A];t.containerState=T[1],T[0].exit.call(t,e)}n.length=C}function b(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function L6e(e,t,n){return uo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function WD(e){if(e===null||kl(e)||_6e(e))return 1;if(S6e(e))return 2}function Sx(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};qD(d,-a),qD(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=fa(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=fa(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=fa(u,Sx(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=fa(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=fa(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,ju(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Ri(N)?uo(e,b,"linePrefix",s+1)(N):b(N)}function b(N){return N===null||Vn(N)?e.check(UD,g,A)(N):(e.enter("codeFlowValue"),C(N))}function C(N){return N===null||Vn(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),C)}function A(N){return e.exit("codeFenced"),t(N)}function T(N,_,w){let M=0;return x;function x(P){return N.enter("lineEnding"),N.consume(P),N.exit("lineEnding"),E}function E(P){return N.enter("codeFencedFence"),Ri(P)?uo(N,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):I(P)}function I(P){return P===l?(N.enter("codeFencedFenceSequence"),F(P)):w(P)}function F(P){return P===l?(M++,N.consume(P),F):M>=r?(N.exit("codeFencedFenceSequence"),Ri(P)?uo(N,W,"whitespace")(P):W(P)):w(P)}function W(P){return P===null||Vn(P)?(N.exit("codeFencedFence"),_(P)):w(P)}}}function W6e(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const o5={name:"codeIndented",tokenize:U6e},q6e={partial:!0,tokenize:V6e};function U6e(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),uo(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Vn(u)?e.attempt(q6e,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Vn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function V6e(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Vn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):uo(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Vn(r)?o(r):n(r)}}const K6e={name:"codeText",previous:G6e,resolve:Z6e,tokenize:Q6e};function Z6e(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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 tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&lg(this.left,i),s.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),lg(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lg(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=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function Oq(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||hA(y)?n(y):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||Vn(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function g(y){return!c&&(y===null||y===41||kl(y))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(y)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Vn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Vn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Ri(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function Pq(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):Vn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),uo(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Vn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function g0(e,t){let n;return i;function i(o){return Vn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Ri(o)?uo(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const o7e={name:"definition",tokenize:r7e},s7e={partial:!0,tokenize:l7e};function r7e(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return $q.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=xx(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return kl(h)?g0(e,u)(h):u(h)}function u(h){return Oq(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(s7e,d,d)(h)}function d(h){return Ri(h)?uo(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Vn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function l7e(e,t,n){return i;function i(l){return kl(l)?g0(e,o)(l):n(l)}function o(l){return Pq(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Ri(l)?uo(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Vn(l)?t(l):n(l)}}const a7e={name:"hardBreakEscape",tokenize:u7e};function u7e(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Vn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const c7e={name:"headingAtx",resolve:d7e,tokenize:f7e};function d7e(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},ju(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function f7e(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||kl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Vn(c)?(e.exit("atxHeading"),t(c)):Ri(c)?uo(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||kl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const h7e=["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"],KD=["pre","script","style","textarea"],p7e={concrete:!0,name:"htmlFlow",resolveTo:v7e,tokenize:y7e},m7e={partial:!0,tokenize:b7e},g7e={partial:!0,tokenize:k7e};function v7e(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 y7e(e,t,n){const i=this;let o,s,r,l,a;return u;function u(q){return c(q)}function c(q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(q),d}function d(q){return q===33?(e.consume(q),f):q===47?(e.consume(q),s=!0,g):q===63?(e.consume(q),o=3,i.interrupt?t:j):Su(q)?(e.consume(q),r=String.fromCharCode(q),v):n(q)}function f(q){return q===45?(e.consume(q),o=2,h):q===91?(e.consume(q),o=5,l=0,m):Su(q)?(e.consume(q),o=4,i.interrupt?t:j):n(q)}function h(q){return q===45?(e.consume(q),i.interrupt?t:j):n(q)}function m(q){const Q="CDATA[";return q===Q.charCodeAt(l++)?(e.consume(q),l===Q.length?i.interrupt?t:I:m):n(q)}function g(q){return Su(q)?(e.consume(q),r=String.fromCharCode(q),v):n(q)}function v(q){if(q===null||q===47||q===62||kl(q)){const Q=q===47,ne=r.toLowerCase();return!Q&&!s&&KD.includes(ne)?(o=1,i.interrupt?t(q):I(q)):h7e.includes(r.toLowerCase())?(o=6,Q?(e.consume(q),y):i.interrupt?t(q):I(q)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(q):s?b(q):C(q))}return q===45||Ha(q)?(e.consume(q),r+=String.fromCharCode(q),v):n(q)}function y(q){return q===62?(e.consume(q),i.interrupt?t:I):n(q)}function b(q){return Ri(q)?(e.consume(q),b):x(q)}function C(q){return q===47?(e.consume(q),x):q===58||q===95||Su(q)?(e.consume(q),A):Ri(q)?(e.consume(q),C):x(q)}function A(q){return q===45||q===46||q===58||q===95||Ha(q)?(e.consume(q),A):T(q)}function T(q){return q===61?(e.consume(q),N):Ri(q)?(e.consume(q),T):C(q)}function N(q){return q===null||q===60||q===61||q===62||q===96?n(q):q===34||q===39?(e.consume(q),a=q,_):Ri(q)?(e.consume(q),N):w(q)}function _(q){return q===a?(e.consume(q),a=null,M):q===null||Vn(q)?n(q):(e.consume(q),_)}function w(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||kl(q)?T(q):(e.consume(q),w)}function M(q){return q===47||q===62||Ri(q)?C(q):n(q)}function x(q){return q===62?(e.consume(q),E):n(q)}function E(q){return q===null||Vn(q)?I(q):Ri(q)?(e.consume(q),E):n(q)}function I(q){return q===45&&o===2?(e.consume(q),O):q===60&&o===1?(e.consume(q),R):q===62&&o===4?(e.consume(q),K):q===63&&o===3?(e.consume(q),j):q===93&&o===5?(e.consume(q),H):Vn(q)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(m7e,re,F)(q)):q===null||Vn(q)?(e.exit("htmlFlowData"),F(q)):(e.consume(q),I)}function F(q){return e.check(g7e,W,re)(q)}function W(q){return e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),P}function P(q){return q===null||Vn(q)?F(q):(e.enter("htmlFlowData"),I(q))}function O(q){return q===45?(e.consume(q),j):I(q)}function R(q){return q===47?(e.consume(q),r="",z):I(q)}function z(q){if(q===62){const Q=r.toLowerCase();return KD.includes(Q)?(e.consume(q),K):I(q)}return Su(q)&&r.length<8?(e.consume(q),r+=String.fromCharCode(q),z):I(q)}function H(q){return q===93?(e.consume(q),j):I(q)}function j(q){return q===62?(e.consume(q),K):q===45&&o===2?(e.consume(q),j):I(q)}function K(q){return q===null||Vn(q)?(e.exit("htmlFlowData"),re(q)):(e.consume(q),K)}function re(q){return e.exit("htmlFlow"),t(q)}}function k7e(e,t,n){const i=this;return o;function o(r){return Vn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function b7e(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(h4,t,n)}}const w7e={name:"htmlText",tokenize:C7e};function C7e(e,t,n){const i=this;let o,s,r;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),a}function a(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),T):j===63?(e.consume(j),C):Su(j)?(e.consume(j),w):n(j)}function u(j){return j===45?(e.consume(j),c):j===91?(e.consume(j),s=0,m):Su(j)?(e.consume(j),b):n(j)}function c(j){return j===45?(e.consume(j),h):n(j)}function d(j){return j===null?n(j):j===45?(e.consume(j),f):Vn(j)?(r=d,R(j)):(e.consume(j),d)}function f(j){return j===45?(e.consume(j),h):d(j)}function h(j){return j===62?O(j):j===45?f(j):d(j)}function m(j){const K="CDATA[";return j===K.charCodeAt(s++)?(e.consume(j),s===K.length?g:m):n(j)}function g(j){return j===null?n(j):j===93?(e.consume(j),v):Vn(j)?(r=g,R(j)):(e.consume(j),g)}function v(j){return j===93?(e.consume(j),y):g(j)}function y(j){return j===62?O(j):j===93?(e.consume(j),y):g(j)}function b(j){return j===null||j===62?O(j):Vn(j)?(r=b,R(j)):(e.consume(j),b)}function C(j){return j===null?n(j):j===63?(e.consume(j),A):Vn(j)?(r=C,R(j)):(e.consume(j),C)}function A(j){return j===62?O(j):C(j)}function T(j){return Su(j)?(e.consume(j),N):n(j)}function N(j){return j===45||Ha(j)?(e.consume(j),N):_(j)}function _(j){return Vn(j)?(r=_,R(j)):Ri(j)?(e.consume(j),_):O(j)}function w(j){return j===45||Ha(j)?(e.consume(j),w):j===47||j===62||kl(j)?M(j):n(j)}function M(j){return j===47?(e.consume(j),O):j===58||j===95||Su(j)?(e.consume(j),x):Vn(j)?(r=M,R(j)):Ri(j)?(e.consume(j),M):O(j)}function x(j){return j===45||j===46||j===58||j===95||Ha(j)?(e.consume(j),x):E(j)}function E(j){return j===61?(e.consume(j),I):Vn(j)?(r=E,R(j)):Ri(j)?(e.consume(j),E):M(j)}function I(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,F):Vn(j)?(r=I,R(j)):Ri(j)?(e.consume(j),I):(e.consume(j),W)}function F(j){return j===o?(e.consume(j),o=void 0,P):j===null?n(j):Vn(j)?(r=F,R(j)):(e.consume(j),F)}function W(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||kl(j)?M(j):(e.consume(j),W)}function P(j){return j===47||j===62||kl(j)?M(j):n(j)}function O(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function R(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),z}function z(j){return Ri(j)?uo(e,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):H(j)}function H(j){return e.enter("htmlTextData"),r(j)}}const _x={name:"labelEnd",resolveAll:_7e,resolveTo:M7e,tokenize:I7e},A7e={tokenize:T7e},x7e={tokenize:E7e},S7e={tokenize:L7e};function _7e(e){let t=-1;const n=[];for(;++t=3&&(u===null||Vn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Ri(u)?uo(e,l,"whitespace")(u):l(u))}}const sl={continuation:{tokenize:j7e},exit:W7e,name:"list",tokenize:z7e},$7e={partial:!0,tokenize:q7e},P7e={partial:!0,tokenize:H7e};function z7e(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:pA(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(u9,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return pA(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(h4,i.interrupt?n:c,e.attempt($7e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Ri(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function j7e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(h4,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,uo(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Ri(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(P7e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,uo(e,e.attempt(sl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function H7e(e,t,n){const i=this;return uo(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function W7e(e){e.exit(this.containerState.type)}function q7e(e,t,n){const i=this;return uo(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Ri(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const ZD={name:"setextUnderline",resolveTo:U7e,tokenize:V7e};function U7e(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function V7e(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Ri(u)?uo(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Vn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const K7e={tokenize:Z7e};function Z7e(e){const t=this,n=e.attempt(h4,i,e.attempt(this.parser.constructs.flowInitial,o,uo(e,e.attempt(this.parser.constructs.flow,o,e.attempt(X6e,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const G7e={resolveAll:jq()},Q7e=zq("string"),Y7e=zq("text");function zq(e){return{resolveAll:jq(e==="text"?J7e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function dxe(e,t){let n=-1;const i=[];let o;for(;++n>1}};tr.from=function(e){if(e instanceof tr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new tr(t)};function Hq(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function Uq(e){return e>=55296&&e<56320}class on{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new on(i,o)}cutByIndex(t,n){return t==n?on.empty:t==0&&n==this.content.length?this:new on(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new on(o,s)}addToStart(t){return new on([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new on(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?yy(n+1,s):yy(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return on.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return on.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return on.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}ji.none=[];class ev extends Error{}class mn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=Kq(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new mn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new mn(Vq(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return mn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new mn(on.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new mn(t,i,o)}}mn.empty=new mn(on.empty,0,0);function Vq(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(Vq(s.content,t-o-1,n-o-1)))}function Kq(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=Kq(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function mxe(e,t,n){if(n.openStart>e.depth)throw new ev("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ev("Inconsistent open depths");return Zq(e,t,n,0)}function Zq(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function v0(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(Ch(e.nodeAfter,i),s++));for(let l=s;lo&&gA(e,t,o+1),r=i.depth>o&&gA(n,i,o+1),l=[];return v0(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(Gq(s,r),Ch(Ah(s,Qq(e,t,n,i,o+1)),l)):(s&&Ch(Ah(s,Fk(e,t,o+1)),l),v0(t,n,o,l),r&&Ch(Ah(r,Fk(n,i,o+1)),l)),v0(i,null,o,l),new on(l)}function Fk(e,t,n){let i=[];if(v0(null,e,n,i),e.depth>n){let o=gA(e,t,n+1);Ch(Ah(o,Fk(e,t,n+1)),i)}return v0(t,null,n,i),new on(i)}function gxe(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(on.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class tv{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new kxe(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new tv(n,i,s)}static resolveCached(t,n){let i=QD.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Yq(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=on.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=on.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};xh.prototype.text=void 0;class Bk extends xh{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yq(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Bk(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Bk(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Yq(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ph{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new wxe(t,n);if(i.next==null)return Ph.empty;let o=Jq(i);i.next&&i.err("Unexpected trailing text");let s=Ixe(Mxe(o));return Txe(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` +`)}}Ph.empty=new Ph(!0);class wxe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Jq(e){let t=[];do t.push(Cxe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Cxe(e){let t=[];do t.push(Axe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Axe(e){let t=_xe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=xxe(e,t);else break;return t}function YD(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function xxe(e,t){let n=YD(e),i=n;return e.eat(",")&&(e.next!="}"?i=YD(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function Sxe(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function _xe(e){if(e.eat("(")){let t=Jq(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=Sxe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Mxe(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Ph(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:tU(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new xh(this,this.computeAttrs(t),on.from(n),ji.setFrom(i))}createChecked(t=null,n,i){return n=on.from(n),this.checkContent(n),new xh(this,this.computeAttrs(t),n,ji.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=on.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(on.empty,!0);return s?new xh(this,t,n.append(s),ji.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new oU(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function Exe(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class Lxe{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?Exe(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class p4{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=iU(t,o.attrs),this.excluded=null;let s=eU(this.attrs);this.instance=s?new ji(this,s):null}create(t=null){return!t&&this.instance?this.instance:new ji(this,tU(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new p4(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class Nxe{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=tr.from(t.nodes),n.marks=tr.from(t.marks||{}),this.nodes=XD.compile(this.spec.nodes,this),this.marks=p4.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Ph.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?eF(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:eF(this,r.split(" "))}this.nodeFromJSON=o=>xh.fromJSON(this,o),this.markFromJSON=o=>ji.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof XD){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new Bk(i,i.defaultAttrs,t,ji.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function eF(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function Dxe(e){return e.tag!=null}function Fxe(e){return e.style!=null}let sU=class yA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(Dxe(o))this.tags.push(o);else if(Fxe(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new nF(this,n,!1);return i.addAll(t,ji.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new nF(this,n,!0);return i.addAll(t,ji.none,n.from,n.to),mn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=iF(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=iF(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new yA(t,yA.schemaRules(t)))}};const rU={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Bxe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},lU={ol:!0,ul:!0},nv=1,kA=2,y0=4;function tF(e,t,n){return t!=null?(t?nv:0)|(t==="full"?kA:0):e&&e.whitespace=="pre"?nv|kA:n&~y0}class ky{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=ji.none,this.match=s||(r&y0?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(on.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&nv)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=on.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(on.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!rU.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class nF{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=tF(null,n.preserveWhitespace,0)|(i?y0:0);o?s=new ky(o.type,o.attrs,ji.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new ky(null,null,ji.none,!0,null,r):s=new ky(t.schema.topNodeType,null,ji.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&kA?"full":this.localPreserveWS||(o.options&nv)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` +`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):oF(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new ky(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=nv)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function Rxe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&lU.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function Oxe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function iF(e){let t={};for(let n in e)t[n]=e[n];return t}function oF(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&c9(by(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:c9(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Bu(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=sF(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return sF(t.marks)}}function sF(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function by(e){return e.document||window.document}const rF=new WeakMap;function $xe(e){let t=rF.get(e);return t===void 0&&rF.set(e,t=Pxe(e)),t}function Pxe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=c9(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const aU=65535,uU=Math.pow(2,16);function zxe(e,t){return e+t*uU}function lF(e){return e&aU}function jxe(e){return(e-(e&aU))/uU}const cU=1,dU=2,d9=4,fU=8;class bA{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&fU)>0}get deletedBefore(){return(this.delInfo&(cU|d9))>0}get deletedAfter(){return(this.delInfo&(dU|d9))>0}get deletedAcross(){return(this.delInfo&d9)>0}}class Rl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Rl.empty)return Rl.empty}recover(t){let n=0,i=lF(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:zxe(l/3,t-a),g=t==a?dU:t==d?cU:d9;return(n<0?t!=a:t!=d)&&(g|=fU),new bA(h,g,m)}o+=c-u}return i?t+o:new bA(t+o,0,null)}touches(t,n){let i=0,o=lF(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new iv;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return vs.fromReplace(t,this.from,this.to,s)}invert(){return new Tu(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new yd(n.pos,i.pos,this.mark)}merge(t){return t instanceof yd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new yd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new yd(n.from,n.to,t.markFromJSON(n.mark))}}Lr.jsonID("addMark",yd);class Tu extends Lr{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new mn(Mx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return vs.fromReplace(t,this.from,this.to,i)}invert(){return new yd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Tu(n.pos,i.pos,this.mark)}merge(t){return t instanceof Tu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Tu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Tu(n.from,n.to,t.markFromJSON(n.mark))}}Lr.jsonID("removeMark",Tu);class kd extends Lr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return vs.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return vs.fromReplace(t,this.pos,this.pos+1,new mn(on.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new ql(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ql(n.from,n.to,n.gapFrom,n.gapTo,mn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Lr.jsonID("replaceAround",ql);function wA(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function Hxe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function Wxe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof p4){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new Tu(r.from,r.to,r.style)))}function Ix(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function qxe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Tx(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=on.from(i.node(m).copy(c)),d++):a--;let f=on.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=on.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new ql(o,s,o,s,new mn(i,0,0),n.length,!0))}function Kxe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&Zxe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&pU(e,r,l,s),Ix(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new ql(d,f,d+1,f-1,new mn(on.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&hU(e,r,l,s),!1}})}function hU(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function pU(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` +`))}})}function Zxe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function Gxe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ql(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new mn(on.from(r),0,0),1,!0))}function f9(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function Qxe(e,t,n=1,i){let o=e.doc.resolve(t),s=on.empty,r=on.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=on.from(o.node(l).copy(s));let c=i&&i[u];r=on.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new Hs(t,t,new mn(s.append(r),n,n),!0))}function mU(e,t){let n=e.resolve(t),i=n.index();return Jxe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function Yxe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function Ex(e,t,n=t,i=mn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return gU(o,s,i)?new Hs(t,n,i):new nSe(o,s,i).fit()}function gU(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class nSe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=on.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=on.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new mn(s,r,l);return t>-1?new ql(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new Hs(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=a5(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(on.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=a5(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new mn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=a5(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new mn(Eg(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new mn(Eg(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=v,c.push(vU(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=Lg(this.placed,n,on.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=u5(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Lg(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Lg(this.placed,this.depth,on.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(on.empty,!0);n.childCount&&(this.placed=Lg(this.placed,this.frontier.length,n))}}function Eg(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Eg(e.firstChild.content,t-1,n)))}function Lg(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Lg(e.lastChild.content,t-1,n)))}function a5(e,t){for(let n=0;n1&&(i=i.replaceChild(0,vU(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(on.empty,!0)))),e.copy(i)}function u5(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!iSe(n,s.content,r)?l:null}function iSe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=oSe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function yU(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(on.empty,!0))}return e}function rSe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=eSe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new mn(on.from(i),0,0))}function lSe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=kU(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function kU(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class A1 extends Lr{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return vs.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return vs.fromReplace(t,this.pos,this.pos+1,new mn(on.from(o),0,n.isLeaf?0:1))}getMap(){return Rl.empty}invert(t){return new A1(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new A1(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new A1(n.pos,n.attr,n.value)}}Lr.jsonID("attr",A1);class ov extends Lr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return vs.ok(i)}getMap(){return Rl.empty}invert(t){return new ov(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ov(n.attr,n.value)}}Lr.jsonID("docAttr",ov);let q1=class extends Error{};q1=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};q1.prototype=Object.create(Error.prototype);q1.prototype.constructor=q1;q1.prototype.name="TransformError";class aSe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new iv}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new q1(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=mn.empty){let o=Ex(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new mn(on.from(i),0,0))}delete(t,n){return this.replace(t,n,mn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return sSe(this,t,n,i),this}replaceRangeWith(t,n,i){return rSe(this,t,n,i),this}deleteRange(t,n){return lSe(this,t,n),this}lift(t,n){return Uxe(this,t,n),this}join(t,n=1){return Xxe(this,t,n),this}wrap(t,n){return Vxe(this,t,n),this}setBlockType(t,n=t,i,o=null){return Kxe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return Gxe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new A1(t,n,i)),this}setDocAttribute(t,n){return this.step(new ov(t,n)),this}addNodeMark(t,n){return this.step(new kd(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof ji)n.isInSet(i.marks)&&this.step(new zh(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new zh(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return Qxe(this,t,n,i),this}addMark(t,n,i){return Hxe(this,t,n,i),this}removeMark(t,n,i){return Wxe(this,t,n,i),this}clearIncompatible(t,n,i){return Ix(this,t,n,i),this}}const c5=Object.create(null);class Ui{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new uSe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?jp(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):jp(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ul(t.node(0))}static atStart(t){return jp(t,t,0,0,1)||new Ul(t)}static atEnd(t){return jp(t,t,t.content.size,t.childCount,-1)||new Ul(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=c5[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in c5)throw new RangeError("Duplicate use of selection JSON ID "+t);return c5[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ai.between(this.$anchor,this.$head).getBookmark()}}Ui.prototype.visible=!0;class uSe{constructor(t,n){this.$from=t,this.$to=n}}let aF=!1;function uF(e){!aF&&!e.parent.inlineContent&&(aF=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ai extends Ui{constructor(t,n=t){uF(t),uF(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Ui.near(i);let o=t.resolve(n.map(this.anchor));return new ai(o.parent.inlineContent?o:i,i)}replace(t,n=mn.empty){if(super.replace(t,n),n==mn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof ai&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new m4(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ai(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Ui.findFrom(n,i,!0)||Ui.findFrom(n,-i,!0);if(s)n=s.$head;else return Ui.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Ui.findFrom(t,-i,!0)||Ui.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Xn.isSelectable(l))return Xn.create(e,n-(o<0?l.nodeSize:0))}else{let a=jp(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function cF(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Ui.near(e.doc.resolve(r),n))}const dF=1,wy=2,fF=4;class dSe extends aSe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=wy,this}ensureMarks(t){return ji.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&wy)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~wy,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||ji.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Ui.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=fF,this}get scrolledIntoView(){return(this.updated&fF)>0}}function hF(e,t){return!t||!e?e:e.bind(t)}class Ng{constructor(t,n,i){this.name=t,this.init=hF(n.init,i),this.apply=hF(n.apply,i)}}const fSe=[new Ng("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ng("selection",{init(e,t){return e.selection||Ui.atStart(t.doc)},apply(e){return e.selection}}),new Ng("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new Ng("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class d5{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=fSe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new Ng(i.key,i.spec.state,i))})}}class rh{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new d5(t.schema,t.plugins),s=new rh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=xh.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Ui.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function bU(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=bU(o,t,{})),n[i]=o}return n}class gm{constructor(t){this.spec=t,this.props={},t.props&&bU(t.props,this,this.props),this.key=t.key?t.key.key:wU("plugin")}getState(t){return t[this.key]}}const f5=Object.create(null);function wU(e){return e in f5?e+"$"+ ++f5[e]:(f5[e]=0,e+"$")}class Nx{constructor(t="key"){this.key=wU(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const CA=` + + + + +`,CU=` + + + + +`,AU='',xU=` + + + +`,SU=` + + +`,_U='',MU=` + + +`,IU=` + + +`,TU=` + + +`,hSe='',pSe='',mSe='',gSe='',vSe='',ySe={sm:14,md:16,lg:20},kSe={file:CA,folder:CU,skill:AU,copy:xU,check:SU,"external-link":_U,target:MU,"file-edit":IU,close:TU,attachment:hSe,image:pSe,video:mSe,fullscreen:gSe,quote:vSe};function Qr(e,t="md"){const n=ySe[t];return kSe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^
        ([\s\S]*?)<\/summary>/,Boe=/([\s\S]*?)<\/resume_hint>/,_3=/]*)>|<\/subagent>/g,Roe="",iI=/(completed|failed|aborted):\s*(\d+)/g,oI=/([a-z_]+)="([^"]*)"/g;function Ooe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function $oe(e){const t={};oI.lastIndex=0;let n;for(;(n=oI.exec(e))!==null;)t[n[1]]=Ooe(n[2]);return t}function Poe(e){const t={completed:0,failed:0,aborted:0};iI.lastIndex=0;let n;for(;(n=iI.exec(e))!==null;){const i=n[1];t[i]=Number(n[2])}return t}function zoe(e,t){const n=$oe(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function joe(e){const t=[],n=[];_3.lastIndex=0;let i;for(;(i=_3.exec(e))!==null;)if(i[0]===Roe){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(zoe(o.attrs,e.slice(o.bodyStart,i.index)))}else n.length===0?n.push({attrs:i[1]??"",bodyStart:_3.lastIndex}):n.push(null);return t}function Hoe(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` -`):e;if(!t.includes(""))return null;const n=Foe.exec(t)?.[1]?.trim()??"",{completed:i,failed:o,aborted:s}=Poe(n),r=Boe.exec(t)?.[1]?.trim(),l=joe(t),a=i+o+s;return{summary:n,completed:i,failed:o,aborted:s,total:a>0?a:l.length,subagents:l,resumeHint:r}}const Woe=3,qoe="Use TaskOutput with one of the task_id values above to read the full output.";function Vf(e,t){return new RegExp(`^${t}: (.+)$`,"m").exec(e)?.[1]}function Uoe(e,t){const n=Number(Vf(e,t)??0);return Number.isFinite(n)?n:0}function Q$(e,t){return e.match(t)?.length??0}function sI(e,t,n){const i=new RegExp(`^\\[${t}\\]$`,"gm"),o=[];let s;for(;(s=i.exec(e))!==null;)s.index>=n&&o.push(s.index);return o}function rI(e,t){return t>=2&&e[t-1]===` -`&&e[t-2]===` -`}function lI(e,t,n){const i=e.slice(t+n.length+2),o=/^\[/m.exec(i);return(o===null?i:i.slice(0,o.index)).trim()}function Voe(e){return e.endsWith(qoe)}function Koe(e){const t=Vf(e,"active_background_tasks");if(t===void 0)return!1;const n=Number(t);return Number.isFinite(n)?Q$(e,/^task_id: /gm)===n:!1}function Zoe(e,t){return[...e.matchAll(/^description: (.+)$/gm)].map(i=>i[1]??"").slice(0,Math.min(Woe,t))}function Goe(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` -`):e,n=/^\[/m.exec(t),i=n===null?t:t.slice(0,n.index),o=Vf(i,"wait_status");if(o!=="completed"&&o!=="timed_out"&&o!=="no_tasks")return null;const s=Number(Vf(i,"waited_ms")??0);let r,l=n?.index??t.length;o==="completed"&&n!==null&&t.slice(n.index).startsWith("[finished]")&&(r=lI(t,n.index,"finished"),l=n.index+10);let a=0,u=-1;for(const f of sI(t,"completed_during_wait",l)){if(!rI(t,f))continue;const h=lI(t,f,"completed_during_wait");Voe(h)&&(a=Q$(h,/^task_id: /gm),u=f)}let c=0,d=[];for(const f of sI(t,"still_running",l)){if(u>=0&&fc.replace(/\\/g,"/"),i=n(e);let o=n(t);o.length>1&&(o=o.replace(/\/+$/,""));const s=aI(o)||aI(i),r=s?o.toLowerCase():o,l=s?i.toLowerCase():i,a=r.endsWith("/")?r:`${r}/`;if(l!==r&&!l.startsWith(a))return null;const u=l===r?"":i.slice(a.length);return u.split("/").includes("..")?null:u||null}const Joe=50,Xoe=3,Y$=Joe*2;function ese(e){const t=(e??[]).filter(n=>typeof n=="number"&&Number.isFinite(n)&&n>0).slice(0,2);return t.length===0?Y$:Math.round(t.reduce((n,i)=>n+i,0))}function J$(e){return e==null||!Number.isFinite(e)||e<=0?Y$:Math.round(e)}const Sw=96;function tse(e,t,n){const i=e.filter(r=>r.visible),o=i[0],s=i[2];return{firstRowHeight:o?o.height:null,spanToThirdRow:s?s.viewportBottom-t+n:null}}function nse(e,t,n){const i=s=>s!=null&&Number.isFinite(s)&&s>0;return(s=>s!=null&&Number.isFinite(s)&&s>=0)(t)?i(e)?Math.round(e)+Math.round(t):i(n)?Math.round(n)*3+Math.round(t):Sw:Sw}function ise(e){return e>Xoe}function uI(e){return Math.round(e*.4)}function ose(e){return e==null||!Number.isFinite(e)||e<=0?Sw:Math.round(e)}function sse(e,t,n,i){const o=J$(n),s=ose(i),r=Math.max(o,Math.round(e*.6));if(t===void 0||!Number.isFinite(t))return r;const l=Math.round(t)-s;return Math.max(o,Math.min(r,l))}function M3(e,t,n){return t==null||!Number.isFinite(t)?e:Math.max(J$(n),Math.min(e,Math.round(t)))}function rse(e,t,n,i){return Math.max(Math.round(i),Math.min(Math.round(e+t),Math.round(n)))}function lse(e,t){return t===null||t===e}const N9="application/x-kimi-session-row";function ase(e,t){return e.includes(t)?e:[...e,t]}function use(e,t){return e.includes(t)?e.filter(n=>n!==t):e}function cse(e,t){const n=new Set(t),i=new Map,o=[];for(const r of e)n.has(r.id)?i.set(r.id,r):o.push(r);const s=[];for(const r of t){const l=i.get(r);l!==void 0&&s.push(l)}return{pinned:s,unpinned:o}}const dse={"&":"&","<":"<",">":">",'"':""","'":"'"};function cI(e){return e.replace(/[&<>"']/g,t=>dse[t]??t)}function fse(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hse(e,t,n=40){const i=e.replace(/\s+/g," ").trim();if(i.length===0)return"";const o=t.trim();if(o.length===0)return dI(i,n*2);const s=i.toLowerCase().indexOf(o.toLowerCase());if(s<0)return dI(i,n*2);const r=Math.max(0,s-n),l=Math.min(i.length,s+o.length+n),a=r>0,u=l`${s}`)}const pse=/([\s\S]*?)<\/kbd>/g;function fI(e){return e.replace(pse,"$1")}let mse=0;function gse(e,t){const n=++mse;return e.pendingPlanBySession[t]=n,n}function _w(e,t,n){return n===void 0||e.pendingPlanBySession[t]!==n?!1:(delete e.pendingPlanBySession[t],!0)}function Mw(e,t,n){e.pendingPlanBySession[t]===void 0&&(e.planModeBySession[t]=n)}function vse(e,t,n){return e.find(i=>i.window?.duration===t&&i.window?.unit===n)}const yse=30;function kse(e){return e!==void 0&&e0?(l.push(t("settings.planUsage.durationDay",{n:o})),l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):s>0?(l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):r>0?l.push(t("settings.planUsage.durationMinute",{n:r})):l.push(t("settings.planUsage.durationSecond",{n:i})),t("settings.planUsage.resetsIn",{duration:l.join(" ")})}function Iw(e,t){if(t<=0)return"ok";const n=e/t;return n>=.85?"danger":n>=.5?"warn":"ok"}function Sy(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}function bse(e,t){const n=(e/100).toFixed(2);switch(t.toUpperCase()){case"CNY":return{symbol:"¥",number:n};case"USD":return{symbol:"$",number:n};default:return{symbol:"",number:`${n} ${t}`}}}const wse=["kimi","openai","openai_responses","anthropic","google-genai","vertexai"];function w2(){return{model:"",maxContextSize:"",displayName:"",capabilities:["tool_use","thinking"],supportEfforts:[],adaptiveThinking:!0}}function Tw(e,t){const n=[];for(const i of Object.values(t??{})){if(i===null||typeof i!="object")continue;const o=i;o.provider===e.id&&n.push({model:typeof o.model=="string"?o.model:"",maxContextSize:typeof o.maxContextSize=="number"?String(o.maxContextSize):"",displayName:typeof o.displayName=="string"?o.displayName:"",capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(s=>typeof s=="string"):[],supportEfforts:Array.isArray(o.supportEfforts)?o.supportEfforts.filter(s=>typeof s=="string"):[],...typeof o.adaptiveThinking=="boolean"?{adaptiveThinking:o.adaptiveThinking}:{}})}return n}const tP=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function Cse(e,t={}){const n=e.id.trim();if(n==="")return"idRequired";if(!tP.test(n))return"idInvalid";if(t.requireApiKey===!0&&e.apiKey.trim()==="")return"apiKeyRequired";if(t.requireBaseUrl===!0&&e.baseUrl.trim()==="")return"baseUrlRequired";if(e.models.length===0)return"modelRequired";for(const i of e.models){if(i.model.trim()==="")return"modelRequired";const o=i.maxContextSize.trim();if(o==="")return"contextSizeRequired";if(!/^\d+$/.test(o)||Number(o)<1)return"contextSizeInvalid"}return null}function nP(e){return e.map(t=>{const n=t.displayName.trim();return{model:t.model.trim(),maxContextSize:Number(t.maxContextSize.trim()),...t.capabilities.length>0?{capabilities:[...t.capabilities]}:{},...t.supportEfforts.length>0?{supportEfforts:[...t.supportEfforts]}:{},...t.adaptiveThinking!==void 0?{adaptiveThinking:t.adaptiveThinking}:{},...n===""?{}:{displayName:n}}})}function Ase(e){const t=e.apiKey.trim(),n=e.baseUrl.trim();return{id:e.id.trim(),type:e.type,models:nP(e.models),...t===""?{}:{apiKey:t},...n===""?{}:{baseUrl:n}}}function xse(e,t,n){const i=nP(e.models),o=e.id.trim(),s=e.apiKey.trim(),r=e.baseUrl.trim(),l=n?.existingDefaultModel?.trim()??"",a=l.indexOf("/")>=0?l.slice(l.indexOf("/")+1):l;return{...t!==void 0&&o!==""&&o!==t.id?{newId:o}:{},type:e.type,models:i,...s===""&&n?.includeBlankApiKey!==!0?{}:{apiKey:s},...r===""?{}:{baseUrl:r},...a!==""&&i.some(u=>u.model===a)?{defaultModel:a}:{}}}function iP(e){return e.id==="managed:kimi-code"&&e.type==="kimi"}const D9="/devices/",oP="kimi-rc-device-id";function Sse(e){return new URLSearchParams(e.search).get("rc")==="1"}function sP(e){const{pathname:t}=e;if(!t.startsWith(D9))return;const n=t.slice(D9.length).split("/")[0];if(n)try{const i=decodeURIComponent(n);return i.length>0?i:void 0}catch{return}}function _se(e){if(sP({pathname:e})===void 0)return e;const t=e.slice(D9.length),n=t.indexOf("/");return n<0?"/":t.slice(n)}function Mse(e){return`${D9}${encodeURIComponent(e)}/`}function rP(e,t){const n=new URLSearchParams(t),i=n.get("rc"),o=n.get("from");if(i===null&&o===null)return e;const s=new URLSearchParams;return i!==null&&s.set("rc",i),o!==null&&s.set("from",o),`${e}?${s.toString()}`}function Ise(e){const t=sP(e);return t!==void 0?(Ese(t),t):Tse()}function Tse(){try{return window.sessionStorage.getItem(oP)??void 0}catch{return}}function Ese(e){try{window.sessionStorage.setItem(oP,e)}catch{}}const Lse=/^(\d+)\t(.*)$/;function Nse(e){const t=e.at(-1)===""?e.slice(0,-1):e;if(t.length===0)return null;const n=[],i=[];for(const o of t){const s=Lse.exec(o);if(!s)return null;i.push(Number(s[1])),n.push(s[2]??"")}return{contents:n,lineNumbers:i}}function hI(e,t){let n="",i=t;const o=/^((?:\\\\|\/\/)[^\\/]+[\\/][^\\/]+)/.exec(t),s=/^([a-zA-Z]:)[\\/]?/.exec(t);o?(n=o[1],i=t.slice(o[1].length)):t.startsWith("/")?(n="/",i=t.slice(1)):s&&(n=s[1],i=t.slice(s[0].length));const r=n!=="",l=i.split(/[\\/]+/).filter(Boolean);for(const u of e.split("/"))u===""||u==="."||(u===".."?l.length>0&&l[l.length-1]!==".."?l.pop():r||l.push(".."):l.push(u));const a=l.join("/");return n==="/"?`/${a}`:n!==""?a?`${n}/${a}`:`${n}/`:a}function lP(e,t){for(const n of e.stateMachineNames){const i=(e.stateMachineInputs(n)??[]).find(o=>o.name===t);if(i!==void 0)return i}return null}function Dse(e,t){const n=lP(e,t);return n!==null&&typeof n.fire=="function"?(n.fire(),!0):!1}function pI(e,t,n){const i=lP(e,t);return i!==null&&typeof i.value==typeof n?(i.value=n,!0):!1}const I3={isPageHidden:()=>typeof document<"u"&&document.hidden,onVisibilityChange:e=>typeof document>"u"?()=>{}:(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),observeIntersection:(e,t)=>{if(typeof IntersectionObserver!="function")return()=>{};const n=new IntersectionObserver(i=>{const o=i[0];o!==void 0&&t(o.isIntersecting)});return n.observe(e),()=>n.disconnect()}};function aP(e,t,n={}){const i=n.isPageHidden??I3.isPageHidden,o=n.onVisibilityChange??I3.onVisibilityChange,s=n.observeIntersection??I3.observeIntersection;let r=!i(),l=!0,a=!1;function u(){const f=!r||!l;f!==a&&(a=f,a?e.pause():e.play())}const c=o(()=>{r=!i(),u()}),d=s(t,f=>{l=f,u()});return u(),()=>{c(),d()}}const Xs="kimi-web.server-credential",Fse="token",Bse=10080*60*1e3;let Au;const Ew=new Set;function Rse(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Fse);if(!n)return;const i=new URL(window.location.href);return i.hash="",window.history.replaceState(window.history.state,"",`${i.pathname}${i.search}`),n}function Lw(e){return{version:1,credential:e,expiresAt:Date.now()+Bse}}function Ose(e){return JSON.stringify(e)}function T6(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Nw(e){globalThis.localStorage?.setItem(Xs,Ose(e))}function $se(){try{const e=globalThis.localStorage?.getItem(Xs);if(e){const n=T6(e);if(n===void 0){const i=Lw(e);let o=!1;try{Nw(i),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(Xs)===e&&globalThis.localStorage?.removeItem(Xs),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Xs)}catch{}return o?i:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Xs),globalThis.localStorage?.getItem(Xs)===e&&globalThis.localStorage?.removeItem(Xs);return}const t=globalThis.sessionStorage?.getItem(Xs);if(t){const n=Lw(t);let i=!1;try{Nw(n),i=!0}catch{}try{globalThis.sessionStorage?.removeItem(Xs),i=!0}catch{}return i?n:void 0}return}catch{return}}function Pse(){const e=Rse();return e?(uP(e),!0):(Au=$se(),Au!==void 0)}function zse(){if(Au!==void 0){if(Au.expiresAt<=Date.now()){jse(Au);return}return Au.credential}}function jse(e){Au=void 0;try{globalThis.sessionStorage?.removeItem(Xs);const t=globalThis.localStorage?.getItem(Xs),n=t==null?void 0:T6(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Xs)}catch{}}function uP(e){const t=Lw(e);Au=t;try{Nw(t)}catch{}try{globalThis.sessionStorage?.removeItem(Xs)}catch{}}function Hse(){const e=Au;Au=void 0;try{const t=globalThis.localStorage?.getItem(Xs),i=(t==null?void 0:T6(t))?.credential??t;e!==void 0&&i===e.credential&&globalThis.localStorage?.removeItem(Xs),globalThis.sessionStorage?.removeItem(Xs)}catch{}}function Wse(e){return Ew.add(e),()=>{Ew.delete(e)}}function qse(){Hse();for(const e of Ew)try{e()}catch{}}function hv(e){return e.approvalCount>0?"awaiting-approval":e.questionCount>0?"awaiting-question":e.pendingInteraction==="approval"?"awaiting-approval":e.pendingInteraction==="question"?"awaiting-question":e.busy?"running":e.lastTurnReason==="failed"?"aborted":e.unread?"unread":"idle"}function mI(e){let t=null;for(const n of e){const i=hv(n);if(i==="awaiting-approval")return"approval";i==="awaiting-question"?t="question":i==="aborted"?t!=="question"&&(t="aborted"):i==="unread"&&t===null&&(t="unread")}return t}let gI;function Use(e){if(typeof Intl.Segmenter=="function")return gI??=new Intl.Segmenter("und",{granularity:"grapheme"}),gI.segment(e)}const Vse=/\p{Emoji_Presentation}/u,Kse=/\p{Regional_Indicator}/u,Zse=/\p{Extended_Pictographic}/u,Gse="️";function Qse(e){return Vse.test(e)||Kse.test(e)?!0:Zse.test(e)&&e.includes(Gse)}function cP(e){const t=Use(e)?.[Symbol.iterator]().next().value;if(t===void 0||!Qse(t.segment))return{emoji:null,rest:e};const n=e.slice(t.index+t.segment.length).replace(/^\s+/,"");return{emoji:t.segment,rest:n}}function Yse(e,t){const{rest:n}=cP(e),i=t?.trim()??"";return i?n?`${i} ${n}`:i:n}function dP(e,t){const n=e.findIndex(s=>s.id===t.id);if(n!==-1&&e[n].updatedAt===t.updatedAt)return e.map(s=>s.id===t.id?t:s);const i=e.filter(s=>s.id!==t.id),o=i.findIndex(s=>s.updatedAt0?i:void 0}catch{return}}function Jse(e){return e===void 0||e.length===0?"/":`${Dw}${encodeURIComponent(e)}`}function hP(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function Xse(e,t=hP()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyA"||e.key.toLowerCase()==="a")&&!e.defaultPrevented}function ere(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement&&(e.isContentEditable||e.closest("input, textarea")!==null)}function tre(e,t){return typeof Element>"u"||!(e instanceof Element)?null:e.closest(t)}function kI(e){e.ownerDocument.getSelection()?.selectAllChildren(e)}function nre(e,t=hP()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyK"||e.key.toLowerCase()==="k")&&!e.defaultPrevented}const ire=[{pattern:/\brm\s+(?:-[a-zA-Z]*[rf][a-zA-Z]*|--recursive|--force)\b/,detail:"rm -rf"},{pattern:/\bsudo\b/,detail:"sudo"},{pattern:/\bmkfs(?:\.[a-z0-9]+)?\b/,detail:"mkfs"},{pattern:/\bdd\b[^|;&]*\bof=/,detail:"dd of=…"},{pattern:/>\s*\/dev\/(?:sd|nvme|disk|hd)/,detail:"> /dev/…"},{pattern:/:\(\)\s*\{/,detail:"fork bomb"},{pattern:/\bgit\s+push\b[^|;&]*(?:--force(?:-with-lease)?\b|\s-f\b)/,detail:"git push --force"},{pattern:/\bchmod\s+(?:-[a-zA-Z]+\s+)*777\b/,detail:"chmod 777"},{pattern:/\b(?:curl|wget)\b[^|;&]*\|\s*(?:sudo\s+)?(?:ba|z)?sh\b/,detail:"curl | sh"},{pattern:/\b(?:shutdown|reboot|poweroff|halt)\b/,detail:"shutdown / reboot"}];function ore(e){const t=e.replace(/"[^"]*"|'[^']*'/g," ");for(const{pattern:n,detail:i}of ire)if(n.test(t))return i}function tf(e){return Array.isArray?Array.isArray(e):mP(e)==="[object Array]"}function sre(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Fw(e){return e==null?"":sre(e)}function br(e){return typeof e=="string"}function _y(e){return typeof e=="number"}function rre(e){return e===!0||e===!1||lre(e)&&mP(e)=="[object Boolean]"}function pP(e){return typeof e=="object"}function lre(e){return pP(e)&&e!==null}function Dl(e){return e!=null}function C2(e){return!e.trim().length}function mP(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const are="Incorrect 'index' type",Bw="Invalid doc index: must be a non-negative integer within the bounds of the docs array",ure=e=>`Invalid value for key ${e}`,cre=e=>`Pattern length exceeds max of ${e}.`,dre=e=>`Missing ${e} property in key`,fre=e=>`Property 'weight' in key '${e}' must be a positive integer`,hre="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",bI=Object.prototype.hasOwnProperty;var pre=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const i=gP(n);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function gP(e){let t=null,n=null,i=null,o=1,s=null;if(br(e)||tf(e))i=e,t=wI(e),n=My(e);else{if(!bI.call(e,"name"))throw new Error(dre("name"));const r=e.name;if(i=r,bI.call(e,"weight")&&e.weight!==void 0&&(o=e.weight,o<=0))throw new Error(fre(My(r)));t=wI(r),n=My(r),s=e.getFn??null}return{path:t,id:n,weight:o,src:i,getFn:s}}function wI(e){return tf(e)?e:e.split(".")}function My(e){return tf(e)?e.join("."):e}function mre(e,t){const n=[];let i=!1;const o=(s,r,l,a)=>{if(Dl(s))if(!r[l])n.push(a!==void 0?{v:s,i:a}:s);else{const u=s[r[l]];if(!Dl(u))return;if(l===r.length-1&&(br(u)||_y(u)||rre(u)||typeof u=="bigint"))n.push(a!==void 0?{v:Fw(u),i:a}:Fw(u));else if(tf(u)){i=!0;for(let c=0,d=u.length;ce.score===t.score?e.idx=9&&e<=13||e===32||e===160}function wre(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(o){let s=0,r=!1;for(let a=0;a{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(br(this.docs[0]))for(let n=0;ne&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const i of e)Number.isInteger(i)&&i>=0&&t.add(i);if(t.size===0)return;this.records=this.records.filter(i=>!t.has(i.i));const n=Array.from(t).sort((i,o)=>i-o);for(const i of this.records){let o=0,s=n.length;for(;o>>1;n[r]t),records:this.records}}};function vP(e,t,{getFn:n=$n.getFn,fieldNormWeight:i=$n.fieldNormWeight}={}){const o=new E6({getFn:n,fieldNormWeight:i});return o.setKeys(e.map(gP)),o.setSources(t),o.create(),o}function Cre(e,{getFn:t=$n.getFn,fieldNormWeight:n=$n.fieldNormWeight}={}){const{keys:i,records:o}=e,s=new E6({getFn:t,fieldNormWeight:n});return s.setKeys(i),s.setIndexRecords(o),s}function Are(e=[],t=$n.minMatchCharLength){const n=[];let i=-1,o=-1,s=0;for(let r=e.length;s=t&&n.push([i,o]),i=-1)}return e[s-1]&&s-i>=t&&n.push([i,s-1]),n}function xre(e,t,n,{location:i=$n.location,distance:o=$n.distance,threshold:s=$n.threshold,findAllMatches:r=$n.findAllMatches,minMatchCharLength:l=$n.minMatchCharLength,includeMatches:a=$n.includeMatches,ignoreLocation:u=$n.ignoreLocation}={}){if(t.length>32)throw new Error(cre(32));const c=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let h=s,m=f;const g=(_,x)=>{const E=_/c;if(u)return E;const M=Math.abs(f-x);return o?E+M/o:M?1:E},v=l>1||a,y=v?Array(d):[];let b;for(;(b=e.indexOf(t,m))>-1;){const _=g(0,b);if(h=Math.min(_,h),m=b+c,v){let x=0;for(;x=M;z-=1){const $=z-1,B=n[e[$]];if(q[z]=(q[z+1]<<1|1)&B,_&&(q[z]|=(w[z+1]|w[z])<<1|1|w[z+1]),q[z]&I&&(C=g(_,$),C<=h)){if(h=C,m=$,T=_,m<=f)break;M=Math.max(1,2*f-m)}}if(g(_+1,f)>h)break;w=q}if(v&&m>=0){const _=Math.min(d-1,m+c-1+T);for(let x=m;x<=_;x+=1)n[e[x]]&&(y[x]=1)}const S={isMatch:m>=0,score:Math.max(.001,C)};if(v){const _=Are(y,l);_.length?a&&(S.indices=_):S.isMatch=!1}return S}function Sre(e){const t={};for(let n=0,i=e.length;nn[0]-i[0]||n[1]-i[1]);const t=[e[0]];for(let n=1,i=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(_re,t=>yP[t]):e=>e;var N6=class{constructor(e,{location:t=$n.location,threshold:n=$n.threshold,distance:i=$n.distance,includeMatches:o=$n.includeMatches,findAllMatches:s=$n.findAllMatches,minMatchCharLength:r=$n.minMatchCharLength,isCaseSensitive:l=$n.isCaseSensitive,ignoreDiacritics:a=$n.ignoreDiacritics,ignoreLocation:u=$n.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:o,findAllMatches:s,minMatchCharLength:r,isCaseSensitive:l,ignoreDiacritics:a,ignoreLocation:u},e=l?e:e.toLowerCase(),e=a?x0(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(f,h)=>{this.chunks.push({pattern:f,alphabet:Sre(f),startIndex:h})},d=this.pattern.length;if(d>32){let f=0;const h=d%32,m=d-h;for(;f{const{isMatch:y,score:b,indices:w}=xre(e,m,g,{location:o+v,distance:s,threshold:r,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});y&&(f=!0),d+=b,y&&w&&c.push(...w)});const h={isMatch:f,score:f?d/this.chunks.length:1};return f&&i&&(h.indices=L6(c)),h}};const Mre=new Set(["fuzzy","include"]);function Ire(e){return e.startsWith("inverse")}const Rw=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,i;const o=[],s=e.length;for(;(i=t.indexOf(e,n))>-1;)n=i+s,o.push([i,n-1]);const r=!!o.length;return{isMatch:r,score:r?0:1,indices:o}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new N6(e,{location:t.location??$n.location,threshold:t.threshold??$n.threshold,distance:t.distance??$n.distance,includeMatches:t.includeMatches??$n.includeMatches,findAllMatches:t.findAllMatches??$n.findAllMatches,minMatchCharLength:t.minMatchCharLength??$n.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??$n.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??$n.ignoreDiacritics,ignoreLocation:t.ignoreLocation??$n.ignoreLocation});return{type:"fuzzy",search(i){return n.searchIn(i)}}}}],CI=Rw.length,Tre="\0",Ere="|";function Lre(e){const t=[],n=e.length;let i=0;for(;i=n)break;let o=i;for(;o=n||e[s]===" "){o++;break}if(e[s]==="$"&&(s+1>=n||e[s+1]===" ")){o+=2;break}}o++}t.push(e.substring(i,o)),i=o}else{for(;o{const i=Lre(n.replace(/\u0000/g,"|").trim()).filter(s=>s&&!!s.trim()),o=[];for(let s=0,r=i.length;s!!(e[B9.AND]||e[B9.OR]),Fre=e=>!!e[$w.PATH],Bre=e=>!tf(e)&&pP(e)&&!Pw(e),xI=e=>({[B9.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function kP(e,t,{auto:n=!0}={}){const i=o=>{if(br(o)){const a={keyId:null,pattern:o};return n&&(a.searcher=F9(o,t)),a}const s=Object.keys(o),r=Fre(o);if(!r&&s.length>1&&!Pw(o))return i(xI(o));if(Bre(o)){const a=r?o[$w.PATH]:s[0],u=r?o[$w.PATTERN]:o[a];if(!br(u))throw new Error(ure(a));const c={keyId:My(a),pattern:u};return n&&(c.searcher=F9(u,t)),c}const l={children:[],operator:s[0]};return s.forEach(a=>{const u=o[a];tf(u)&&u.forEach(c=>{l.children.push(i(c))})}),l};return Pw(e)||(e=xI(e)),i(e)}function zw(e,{ignoreFieldNorm:t=$n.ignoreFieldNorm}){let n=1;return e.forEach(({key:i,norm:o,score:s})=>{const r=i?i.weight:null;n*=Math.pow(s===0&&r?Number.EPSILON:s,(r||1)*(t?1:o))}),n}function Rre(e,{ignoreFieldNorm:t=$n.ignoreFieldNorm}){e.forEach(n=>{n.score=zw(n.matches,{ignoreFieldNorm:t})})}var Ore=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const i=t[e];t[e]=t[n],t[n]=i,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let i=e;do{e=i;const o=2*e+1,s=2*e+2;if(o0&&(i=o),s0&&(i=s),i!==e){const r=t[e];t[e]=t[i],t[i]=r}}while(i!==e)}};function $re(e){const t=[];return e.matches.forEach(n=>{if(!Dl(n.indices)||!n.indices.length)return;const i={indices:n.indices,value:n.value};n.key&&(i.key=n.key.id),n.idx>-1&&(i.refIndex=n.idx),t.push(i)}),t}function Pre(e,t,{includeMatches:n=$n.includeMatches,includeScore:i=$n.includeScore}={}){return e.map(o=>{const{idx:s}=o,r={item:t[s],refIndex:s};return n&&(r.matches=$re(o)),i&&(r.score=o.score),r})}const zre=/[\p{L}\p{M}\p{N}_]+/gu,SI=new WeakSet;function jre(e){SI.has(e)||(SI.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Hre(e){if(typeof e=="function"){let t=!1;return n=>{const i=e(n);if(!t&&(t=!0,!Array.isArray(i)||i.some(o=>typeof o!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(i)?"array containing non-strings":typeof i}.`);return i}}return e instanceof RegExp?(e.global||jre(e),t=>t.match(e)||[]):t=>t.match(zre)||[]}function jw({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const i=Hre(n);return{tokenize(o){return e||(o=o.toLowerCase()),t&&(o=x0(o)),i(o)}}}var Wre=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=jw({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:i,fieldCount:o}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const s of n){this.termSearchers.push(new N6(s,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=i.get(s)||0,l=Math.log(1+(o-r+.5)/(r+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,i=0,o=0,s=0;const r=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u0?1-n/i:0,a={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(a.indices=L6(t)),this.combineAll&&(this.useMask?a.matchedMask=s:a.matchedTerms=r,a.termCount=this.numTerms),a}};function T3(e,t,n,i){const o=i.tokenize(t);if(!o.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const s=new Set(o);let r=e.docTermFieldHits.get(n);r||(r=new Map,e.docTermFieldHits.set(n,r));for(const l of s)r.set(l,(r.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function bP(e,t,n,i){const{i:o,v:s,$:r}=t;if(s!==void 0){T3(e,s,o,i);return}if(r)for(let l=0;ll-a);for(const l of n)Vre(e,l);const i=l=>{let a=0,u=n.length;for(;a>>1;n[c]o?i(l):l,a);e.docFieldCount=s;const r=new Map;for(const[l,a]of e.docTermFieldHits)r.set(l>o?i(l):l,a);e.docTermFieldHits=r}var nf=class{constructor(e,t,n){this.options={...$n,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new pre(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=F9(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof E6))throw new Error(are);if(this._myIndex=t||vP(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=jw({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=qre(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!Dl(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=jw({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Ure(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let i=0,o=this._docs.length;i!i.has(s)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(Bw);this._invertedIndex&&_I(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:i,includeScore:o,shouldSort:s,sortFn:r,ignoreFieldNorm:l}=this.options;if(br(e)&&!e.trim()){let f=this._docs.map((h,m)=>({item:h,refIndex:m}));return _y(n)&&n>-1&&(f=f.slice(0,n)),f}const a=s&&_y(n)&&n>0&&br(e),u=r,c=(f,h)=>u(f,h)||f.idx-h.idx;let d;if(a){const f=new Ore(n,c);br(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:l}),d=f.extractSorted()}else d=br(e)?br(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Rre(d,{ignoreFieldNorm:l}),s&&d.sort(br(e)?c:u),_y(n)&&n>-1&&(d=d.slice(0,n));return Pre(d,this._docs,{includeMatches:i,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=t?null:[];return s.forEach(({v:l,i:a,n:u})=>{if(!Dl(l))return;const c=i.searchIn(l);if(c.isMatch){const d={score:c.score,value:l,norm:u,indices:c.indices};o&&(d.matchedMask=c.matchedMask,d.matchedTerms=c.matchedTerms,d.termCount=c.termCount);const f=[d];if(!o||this._coversAllTokens(f)){const h={item:l,idx:a,matches:f};t?(h.score=zw(h.matches,{ignoreFieldNorm:n}),t.insert(h)):r.push(h)}}}),r}_searchLogical(e){const t=kP(e,this.options),n=this._normalizedKeys(),i=(l,a,u)=>{if(!("children"in l)){const{keyId:h,searcher:m}=l;let g;return h===null?(g=[],n.forEach((v,y)=>{g.push(...this._findMatches({key:v,value:a[y],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(a,h),searcher:m}),g&&g.length?[{idx:u,item:a,matches:g}]:[]}const{children:c,operator:d}=l,f=[];for(let h=0,m=c.length;h{if(Dl(l)){const u=i(t,l,a);u.length&&(s.has(a)||(s.set(a,{idx:a,item:l,matches:[]}),r.push(s.get(a))),u.forEach(({matches:c})=>{s.get(a).matches.push(...c)}))}}),r}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=this._normalizedKeys(),l=t?null:[];return s.forEach(({$:a,i:u})=>{if(!Dl(a))return;const c=[];let d=!1,f=!1;if(r.forEach((h,m)=>{const g=this._findMatches({key:h,value:a[m],searcher:i});g.length?(c.push(...g),g[0].hasInverse&&(f=!0)):d=!0}),!(f&&d)&&c.length&&(!o||this._coversAllTokens(c))){const h={idx:u,item:a,matches:c};t?(h.score=zw(h.matches,{ignoreFieldNorm:n}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!Dl(t))return[];const i=[];if(tf(t))t.forEach(({v:o,i:s,n:r})=>{if(!Dl(o))return;const l=n.searchIn(o);if(l.isMatch){const a={score:l.score,key:e,value:o,idx:s,norm:r,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(a.matchedMask=l.matchedMask,a.matchedTerms=l.matchedTerms,a.termCount=l.termCount),i.push(a)}});else{const{v:o,n:s}=t,r=n.searchIn(o);if(r.isMatch){const l={score:r.score,key:e,value:o,norm:s,indices:r.indices,hasInverse:r.hasInverse};r.termCount!==void 0&&(l.matchedMask=r.matchedMask,l.matchedTerms=r.matchedTerms,l.termCount=r.termCount),i.push(l)}}return i}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let i=0;for(let o=0;oD6(t))};var Kre=nf;const Zre=/^[\uD800-\uDBFF]$/,Gre=/^[\uDC00-\uDFFF]$/,Qre=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var MI;(function(e){e[e.Unknown=1e-13]="Unknown",e[e.Rule=1e-12]="Rule",e[e.DICT=2e-8]="DICT",e[e.Surname=1]="Surname",e[e.Custom=1]="Custom"})(MI||(MI={}));const Vl={Normal:1,Surname:10,Custom:100};function $a(e){var t;return e.length-(((t=e.match(Qre))===null||t===void 0?void 0:t.length)||0)}function Hw(e){const t=[];let n=0;for(;n1)return this.StringDICT.get(t);{const n=t.charCodeAt(0);return this.NumberDICT[n]}}set(t,n){if(t.length>1)this.StringDICT.set(t,n);else{const i=t.charCodeAt(0);this.NumberDICT[i]=n}}clear(){this.NumberDICT=[],this.StringDICT.clear()}}const Yre=["zh","ch","sh","z","c","s","b","p","m","f","d","t","n","l","g","k","h","j","q","x","r","y","w",""],Jre=["j","q","x"],Xre=["uān","uán","uǎn","uàn","uan","uē","ué","uě","uè","ue","ūn","ún","ǔn","ùn","un","ū","ú","ǔ","ù","u"],ele={uān:"üān",uán:"üán",uǎn:"üǎn",uàn:"üàn",uan:"üan",uē:"üē",ué:"üé",uě:"üě",uè:"üè",ue:"üe",ūn:"ǖn",ún:"ǘn",ǔn:"ǚn",ùn:"ǜn",un:"ün",ū:"ǖ",ú:"ǘ",ǔ:"ǚ",ù:"ǜ",u:"ü"},tle=["ia","ian","iang","iao","ie","iu","iong","ua","uai","uan","uang","ue","ui","uo","üan","üe","van","ve"],II={一:"yì",二:"èr",三:"sān",四:"sì",五:"wǔ",六:"liù",七:"qī",八:"bā",九:"jiǔ",十:"shí",百:"bǎi",千:"qiān",万:"wàn",亿:"yì",单:"dān",两:"liǎng",双:"shuāng",多:"duō",几:"jǐ",十一:"shí yī",零一:"líng yī",第一:"dì yī",一十:"yī shí",一十一:"yī shí yī"},TI={重:"chóng",行:"háng",斗:"dǒu",更:"gēng"};function nle(){const e={零一:"líng yī","〇一":"líng yī",十一:"shí yī",一十:"yī shí",第一:"dì yī",一十一:"yī shí yī"};for(let t in II)for(let n in TI){const i=`${t}${n}`,o=`${II[t]} ${TI[n]}`;e[i]=o}return e}const EI=nle(),ile=Object.keys(EI).map(e=>({zh:e,pinyin:EI[e],probability:1e-12,length:$a(e),priority:Vl.Normal,dict:Symbol("rule")})),CP={不:{bú:[4]},一:{yí:[4],yì:[1,2,3]}},ole={不:["的","而","之","后","也","还","地"],一:["的","而","之","后","也","还","是"]},sle=Object.keys(CP),Ww={南宫:"nán gōng",第五:"dì wǔ",万俟:"mò qí",司马:"sī mǎ",上官:"shàng guān",欧阳:"ōu yáng",夏侯:"xià hóu",诸葛:"zhū gě",闻人:"wén rén",东方:"dōng fāng",赫连:"hè lián",皇甫:"huáng fǔ",尉迟:"yù chí",公羊:"gōng yáng",澹台:"tán tái",公冶:"gōng yě",宗政:"zōng zhèng",濮阳:"pú yáng",淳于:"chún yú",太叔:"tài shū",申屠:"shēn tú",公孙:"gōng sūn",仲孙:"zhòng sūn",轩辕:"xuān yuán",令狐:"líng hú",钟离:"zhōng lí",宇文:"yǔ wén",长孙:"zhǎng sūn",慕容:"mù róng",鲜于:"xiān yú",闾丘:"lǘ qiū",司徒:"sī tú",司空:"sī kōng",亓官:"qí guān",司寇:"sī kòu",仉督:"zhǎng dū",子车:"zǐ jū",颛孙:"zhuān sūn",端木:"duān mù",巫马:"wū mǎ",公西:"gōng xī",漆雕:"qī diāo",乐正:"yuè zhèng",壤驷:"rǎng sì",公良:"gōng liáng",拓跋:"tuò bá",夹谷:"jiá gǔ",宰父:"zǎi fǔ",榖梁:"gǔ liáng",段干:"duàn gān",百里:"bǎi lǐ",东郭:"dōng guō",南门:"nán mén",呼延:"hū yán",羊舌:"yáng shé",梁丘:"liáng qiū",左丘:"zuǒ qiū",东门:"dōng mén",西门:"xī mén",句龙:"gōu lóng",毌丘:"guàn qiū",赵:"zhào",钱:"qián",孙:"sūn",李:"lǐ",周:"zhōu",吴:"wú",郑:"zhèng",王:"wáng",冯:"féng",陈:"chén",褚:"chǔ",卫:"wèi",蒋:"jiǎng",沈:"shěn",韩:"hán",杨:"yáng",朱:"zhū",秦:"qín",尤:"yóu",许:"xǔ",何:"hé",吕:"lǚ",施:"shī",张:"zhāng",孔:"kǒng",曹:"cáo",严:"yán",华:"huà",金:"jīn",魏:"wèi",陶:"táo",姜:"jiāng",戚:"qī",谢:"xiè",邹:"zōu",喻:"yù",柏:"bǎi",水:"shuǐ",窦:"dòu",章:"zhāng",云:"yún",苏:"sū",潘:"pān",葛:"gě",奚:"xī",范:"fàn",彭:"péng",郎:"láng",鲁:"lǔ",韦:"wéi",昌:"chāng",马:"mǎ",苗:"miáo",凤:"fèng",花:"huā",方:"fāng",俞:"yú",任:"rén",袁:"yuán",柳:"liǔ",酆:"fēng",鲍:"bào",史:"shǐ",唐:"táng",费:"fèi",廉:"lián",岑:"cén",薛:"xuē",雷:"léi",贺:"hè",倪:"ní",汤:"tāng",滕:"téng",殷:"yīn",罗:"luó",毕:"bì",郝:"hǎo",邬:"wū",安:"ān",常:"cháng",乐:"yuè",于:"yú",时:"shí",傅:"fù",皮:"pí",卞:"biàn",齐:"qí",康:"kāng",伍:"wǔ",余:"yú",元:"yuán",卜:"bǔ",顾:"gù",孟:"mèng",平:"píng",黄:"huáng",和:"hé",穆:"mù",萧:"xiāo",尹:"yǐn",姚:"yáo",邵:"shào",湛:"zhàn",汪:"wāng",祁:"qí",毛:"máo",禹:"yǔ",狄:"dí",米:"mǐ",贝:"bèi",明:"míng",臧:"zāng",计:"jì",伏:"fú",成:"chéng",戴:"dài",谈:"tán",宋:"sòng",茅:"máo",庞:"páng",熊:"xióng",纪:"jǐ",舒:"shū",屈:"qū",项:"xiàng",祝:"zhù",董:"dǒng",梁:"liáng",杜:"dù",阮:"ruǎn",蓝:"lán",闵:"mǐn",席:"xí",季:"jì",麻:"má",强:"qiáng",贾:"jiǎ",路:"lù",娄:"lóu",危:"wēi",江:"jiāng",童:"tóng",颜:"yán",郭:"guō",梅:"méi",盛:"shèng",林:"lín",刁:"diāo",钟:"zhōng",徐:"xú",邱:"qiū",骆:"luò",高:"gāo",夏:"xià",蔡:"cài",田:"tián",樊:"fán",胡:"hú",凌:"líng",霍:"huò",虞:"yú",万:"wàn",支:"zhī",柯:"kē",昝:"zǎn",管:"guǎn",卢:"lú",莫:"mò",经:"jīng",房:"fáng",裘:"qiú",缪:"miào",干:"gān",解:"xiè",应:"yīng",宗:"zōng",丁:"dīng",宣:"xuān",贲:"bēn",邓:"dèng",郁:"yù",单:"shàn",杭:"háng",洪:"hóng",包:"bāo",诸:"zhū",左:"zuǒ",石:"shí",崔:"cuī",吉:"jí",钮:"niǔ",龚:"gōng",程:"chéng",嵇:"jī",邢:"xíng",滑:"huá",裴:"péi",陆:"lù",荣:"róng",翁:"wēng",荀:"xún",羊:"yáng",於:"yū",惠:"huì",甄:"zhēn",曲:"qū",家:"jiā",封:"fēng",芮:"ruì",羿:"yì",储:"chǔ",靳:"jìn",汲:"jí",邴:"bǐng",糜:"mí",松:"sōng",井:"jǐng",段:"duàn",富:"fù",巫:"wū",乌:"wū",焦:"jiāo",巴:"bā",弓:"gōng",牧:"mù",隗:"wěi",山:"shān",谷:"gǔ",车:"chē",侯:"hóu",宓:"mì",蓬:"péng",全:"quán",郗:"xī",班:"bān",仰:"yǎng",秋:"qiū",仲:"zhòng",伊:"yī",宫:"gōng",宁:"nìng",仇:"qiú",栾:"luán",暴:"bào",甘:"gān",钭:"tǒu",厉:"lì",戎:"róng",祖:"zǔ",武:"wǔ",符:"fú",刘:"liú",景:"jǐng",詹:"zhān",束:"shù",龙:"lóng",叶:"yè",幸:"xìng",司:"sī",韶:"sháo",郜:"gào",黎:"lí",蓟:"jì",薄:"bó",印:"yìn",宿:"sù",白:"bái",怀:"huái",蒲:"pú",邰:"tái",从:"cóng",鄂:"è",索:"suǒ",咸:"xián",籍:"jí",赖:"lài",卓:"zhuó",蔺:"lìn",屠:"tú",蒙:"méng",池:"chí",乔:"qiáo",阴:"yīn",鬱:"yù",胥:"xū",能:"nài",苍:"cāng",双:"shuāng",闻:"wén",莘:"shēn",党:"dǎng",翟:"zhái",谭:"tán",贡:"gòng",劳:"láo",逄:"páng",姬:"jī",申:"shēn",扶:"fú",堵:"dǔ",冉:"rǎn",宰:"zǎi",郦:"lì",雍:"yōng",郤:"xì",璩:"qú",桑:"sāng",桂:"guì",濮:"pú",牛:"niú",寿:"shòu",通:"tōng",边:"biān",扈:"hù",燕:"yān",冀:"jì",郏:"jiá",浦:"pǔ",尚:"shàng",农:"nóng",温:"wēn",别:"bié",庄:"zhuāng",晏:"yàn",柴:"chái",瞿:"qú",阎:"yán",充:"chōng",慕:"mù",连:"lián",茹:"rú",习:"xí",宦:"huàn",艾:"ài",鱼:"yú",容:"róng",向:"xiàng",古:"gǔ",易:"yì",慎:"shèn",戈:"gē",廖:"liào",庾:"yǔ",终:"zhōng",暨:"jì",居:"jū",衡:"héng",步:"bù",都:"dū",耿:"gěng",满:"mǎn",弘:"hóng",匡:"kuāng",国:"guó",文:"wén",寇:"kòu",广:"guǎng",禄:"lù",阙:"quē",东:"dōng",欧:"ōu",殳:"shū",沃:"wò",利:"lì",蔚:"wèi",越:"yuè",夔:"kuí",隆:"lóng",师:"shī",巩:"gǒng",厍:"shè",聂:"niè",晁:"cháo",勾:"gōu",敖:"áo",融:"róng",冷:"lěng",訾:"zī",辛:"xīn",阚:"kàn",那:"nā",简:"jiǎn",饶:"ráo",空:"kōng",曾:"zēng",母:"mǔ",沙:"shā",乜:"niè",养:"yǎng",鞠:"jū",须:"xū",丰:"fēng",巢:"cháo",关:"guān",蒯:"kuǎi",相:"xiàng",查:"zhā",后:"hòu",荆:"jīng",红:"hóng",游:"yóu",竺:"zhú",权:"quán",逯:"lù",盖:"gě",益:"yì",桓:"huán",公:"gōng",牟:"móu",哈:"hǎ",言:"yán",福:"fú",肖:"xiāo",区:"ōu",覃:"qín",朴:"piáo",繁:"pó",员:"yùn",句:"gōu",要:"yāo",过:"guō",钻:"zuān",谌:"chén",折:"shé",召:"shào",郄:"qiè",撒:"sǎ",甯:"nìng",六:"lù",啜:"chuài",行:"xíng"},rle=Object.keys(Ww).map(e=>({zh:e,pinyin:Ww[e],probability:1+$a(e),length:$a(e),priority:Vl.Surname,dict:Symbol("surname")})),LI={"bǎng páng pāng":["膀"],líng:["〇","伶","凌","刢","囹","坽","夌","姈","婈","孁","岺","彾","掕","昤","朎","柃","棂","櫺","欞","泠","淩","澪","灵","燯","爧","狑","玲","琌","瓴","皊","砱","祾","秢","竛","笭","紷","綾","绫","羐","羚","翎","聆","舲","苓","菱","蓤","蔆","蕶","蛉","衑","裬","詅","跉","軨","輘","酃","醽","鈴","錂","铃","閝","陵","零","霊","霗","霛","霝","靈","駖","魿","鯪","鲮","鴒","鸰","鹷","麢","齡","齢","龄","龗","㥄"],yī:["一","乊","伊","依","医","吚","咿","噫","壱","壹","夁","嫛","嬄","弌","揖","撎","檹","毉","洢","渏","漪","瑿","畩","祎","禕","稦","繄","蛜","衤","譩","辷","郼","醫","銥","铱","鷖","鹥","黟","黳"],"dīng zhēng":["丁"],"kǎo qiǎo yú":["丂"],qī:["七","倛","僛","凄","嘁","墄","娸","悽","慼","慽","戚","捿","柒","桤","桼","棲","榿","欺","沏","淒","漆","紪","緀","萋","褄","諆","迉","郪","鏚","霋","魌","鶈"],shàng:["丄","尙","尚","恦","緔","绱"],xià:["丅","下","乤","圷","夏","夓","懗","梺","疜","睱","罅","鎼","鏬"],hǎn:["丆","喊","浫","罕","豃","㘎"],"wàn mò":["万"],zhàng:["丈","仗","墇","嶂","帐","帳","幛","扙","杖","涱","痮","瘬","瘴","瞕","粀","胀","脹","賬","账","障"],sān:["三","厁","叁","弎","毵","毶","毿","犙","鬖"],"shàng shǎng shang":["上"],"qí jī":["丌","其","奇"],"bù fǒu":["不"],"yǔ yù yú":["与"],miǎn:["丏","偭","免","冕","勉","勔","喕","娩","愐","汅","沔","湎","睌","緬","缅","腼","葂","靦","鮸","𩾃"],gài:["丐","乢","匃","匄","戤","概","槩","槪","溉","漑","瓂","葢","鈣","钙","𬮿"],chǒu:["丑","丒","侴","吜","杽","瞅","矁","醜","魗"],zhuān:["专","叀","嫥","専","專","瑼","甎","砖","磗","磚","蟤","諯","鄟","顓","颛","鱄","䏝"],"qiě jū":["且"],pī:["丕","伓","伾","噼","坯","岯","憵","批","披","炋","狉","狓","砒","磇","礔","礕","秛","秠","耚","豾","邳","鈚","鉟","銔","錃","錍","霹","駓","髬","魾","𬳵"],shì:["世","丗","亊","事","仕","侍","冟","势","勢","卋","呩","嗜","噬","士","奭","嬕","室","市","式","弑","弒","恀","恃","戺","拭","揓","是","昰","枾","柿","栻","澨","烒","煶","眂","眎","眡","睗","示","礻","筮","簭","舐","舓","襫","視","视","觢","試","誓","諡","謚","试","谥","貰","贳","軾","轼","逝","遾","釈","释","釋","鈰","鉃","鉽","铈","飾","餙","餝","饰","鰘","䏡","𬤊"],qiū:["丘","丠","坵","媝","恘","恷","楸","秋","秌","穐","篍","緧","萩","蘒","蚯","蝵","蟗","蠤","趥","邱","鞦","鞧","鰌","鰍","鳅","鶖","鹙","龝"],bǐng:["丙","屛","怲","抦","昞","昺","柄","棅","炳","禀","秉","稟","苪","蛃","邴","鈵","陃","鞆","餅","餠","饼"],yè:["业","亱","僷","墷","夜","嶪","嶫","抴","捙","擛","擪","擫","晔","曄","曅","曗","曳","曵","枼","枽","業","洂","液","澲","烨","燁","爗","璍","皣","瞱","瞸","礏","腋","葉","謁","谒","邺","鄴","鍱","鐷","靥","靨","頁","页","餣","饁","馌","驜","鵺","鸈"],cóng:["丛","从","叢","婃","孮","従","徔","徖","悰","樷","欉","淙","灇","爜","琮","藂","誴","賨","賩","錝"],dōng:["东","倲","冬","咚","埬","岽","崬","徚","昸","東","氡","氭","涷","笗","苳","菄","蝀","鮗","鯟","鶇","鶫","鸫","鼕","𬟽"],sī:["丝","俬","凘","厮","司","咝","嘶","噝","媤","廝","恖","撕","斯","楒","泀","澌","燍","禗","禠","私","糹","絲","緦","纟","缌","罳","蕬","虒","蛳","蜤","螄","蟖","蟴","鉰","銯","鍶","鐁","锶","颸","飔","騦","鷥","鸶","鼶","㟃"],chéng:["丞","呈","城","埕","堘","塍","塖","宬","峸","惩","懲","成","承","挰","掁","揨","枨","棖","橙","檙","洆","溗","澂","珵","珹","畻","程","窚","筬","絾","脭","荿","誠","诚","郕","酲","鋮","铖","騬","鯎"],diū:["丟","丢","銩","铥"],liǎng:["両","两","兩","唡","啢","掚","緉","脼","蜽","裲","魉","魎","𬜯"],yǒu:["丣","卣","友","梄","湵","牖","禉","羑","聈","苃","莠","蜏","酉","銪","铕","黝"],yán:["严","厳","啱","喦","嚴","塩","壛","壧","妍","姸","娫","娮","岩","嵒","嵓","巌","巖","巗","延","揅","昖","楌","檐","櫩","欕","沿","炎","炏","狿","琂","盐","碞","筵","簷","莚","蔅","虤","蜒","言","訁","訮","詽","讠","郔","閆","閻","闫","阎","顏","顔","颜","鹽","麣","𫄧"],bìng:["並","併","倂","傡","垪","摒","栤","病","窉","竝","誁","靐","鮩"],"sàng sāng":["丧"],gǔn:["丨","惃","滚","滾","磙","緄","绲","蓘","蔉","衮","袞","輥","辊","鮌","鯀","鲧"],jiū:["丩","勼","啾","揪","揫","朻","究","糾","纠","萛","赳","阄","鬏","鬮","鳩","鸠"],"gè gě":["个","個","各"],yā:["丫","圧","孲","庘","押","枒","桠","椏","錏","鐚","鴉","鴨","鵶","鸦","鸭"],pán:["丬","媻","幋","槃","洀","瀊","爿","盘","盤","磐","縏","蒰","蟠","蹒","蹣","鎜","鞶"],"zhōng zhòng":["中"],jǐ:["丮","妀","己","戟","挤","掎","撠","擠","橶","泲","犱","脊","虮","蟣","魢","鱾","麂"],jiè:["丯","介","借","唶","堺","屆","届","岕","庎","徣","戒","楐","犗","玠","琾","界","畍","疥","砎","蚧","蛶","衸","褯","誡","诫","鎅","骱","魪"],fēng:["丰","仹","偑","僼","凨","凬","凮","妦","寷","封","峯","峰","崶","枫","楓","檒","沣","沨","渢","灃","烽","犎","猦","琒","疯","瘋","盽","砜","碸","篈","蘴","蜂","蠭","豐","鄷","酆","鋒","鎽","鏠","锋","霻","靊","飌","麷"],"guàn kuàng":["丱"],chuàn:["串","汌","玔","賗","釧","钏"],chǎn:["丳","产","冁","剷","囅","嵼","旵","浐","滻","灛","產","産","簅","蒇","蕆","諂","譂","讇","谄","鏟","铲","閳","闡","阐","骣","𬊤"],lín:["临","冧","壣","崊","嶙","斴","晽","暽","林","潾","瀶","燐","琳","璘","瞵","碄","磷","粦","粼","繗","翷","臨","轔","辚","遴","邻","鄰","鏻","阾","隣","霖","驎","鱗","鳞","麐","麟","𬴊","𬭸"],zhuó:["丵","劅","卓","啄","圴","妰","娺","撯","擆","擢","斫","斮","斱","斲","斵","晫","椓","浊","浞","濁","灼","烵","琸","硺","禚","窡","籗","籱","罬","茁","蠗","蠿","諁","諑","謶","诼","酌","鐲","镯","鵫","鷟","䓬","𬸦"],zhǔ:["丶","主","劯","嘱","囑","宔","帾","拄","渚","濐","煑","煮","燝","瞩","矚","罜","詝","陼","鸀","麈","𬣞"],bā:["丷","仈","八","叭","哵","夿","岜","巴","捌","朳","玐","疤","笆","粑","羓","芭","蚆","豝","釟"],wán:["丸","刓","完","岏","抏","捖","汍","烷","玩","琓","笂","紈","纨","翫","芄","貦","頑","顽"],dān:["丹","勯","匰","単","妉","媅","殚","殫","甔","眈","砃","箪","簞","耼","耽","聃","聸","褝","襌","躭","郸","鄲","酖","頕"],"wèi wéi":["为"],"jǐng dǎn":["丼"],"lì lí":["丽"],jǔ:["举","弆","挙","擧","椇","榉","榘","櫸","欅","矩","筥","聥","舉","莒","蒟","襷","踽","齟","龃"],piě:["丿","苤","鐅","𬭯"],fú:["乀","伏","俘","凫","刜","匐","咈","哹","垘","孚","岪","巿","帗","幅","幞","弗","彿","怫","扶","柫","栿","桴","氟","泭","浮","涪","澓","炥","玸","甶","畉","癁","祓","福","稪","符","箙","紱","紼","絥","綍","绂","绋","罘","罦","翇","艀","芙","芣","苻","茀","茯","菔","葍","虙","蚨","蜉","蝠","袚","袱","襆","襥","諨","豧","踾","輻","辐","郛","鉘","鉜","韍","韨","颫","髴","鮄","鮲","鳧","鳬","鴔","鵩","黻"],"yí jí":["乁"],yì:["乂","义","亄","亦","亿","伇","伿","佾","俋","億","兿","刈","劓","劮","勚","勩","匇","呓","呭","呹","唈","囈","圛","坄","垼","埸","奕","嫕","嬑","寱","屹","峄","嶧","帟","帠","幆","廙","异","弈","弋","役","忆","怈","怿","悒","意","憶","懌","懿","抑","挹","敡","易","晹","曀","曎","杙","枍","棭","榏","槸","檍","歝","殔","殪","殹","毅","浂","浥","浳","湙","溢","潩","澺","瀷","炈","焲","熠","熤","熼","燚","燡","燱","獈","玴","異","疫","痬","瘗","瘞","瘱","癔","益","瞖","穓","竩","篒","縊","繶","繹","绎","缢","義","羿","翊","翌","翳","翼","耴","肄","肊","膉","臆","艗","艺","芅","苅","萟","蓺","薏","藙","藝","蘙","虉","蜴","螠","衪","袣","裔","裛","褹","襼","訲","訳","詍","詣","誼","譯","議","讛","议","译","诣","谊","豙","豛","豷","貖","贀","跇","轶","逸","邑","鄓","醷","釴","鈠","鎰","鐿","镒","镱","阣","隿","霬","饐","駅","驛","驿","骮","鮨","鶂","鶃","鶍","鷁","鷊","鷧","鷾","鸃","鹝","鹢","黓","齸","𬬩","㑊","𫄷","𬟁"],nǎi:["乃","倷","奶","嬭","廼","氖","疓","艿","迺","釢"],wǔ:["乄","五","仵","伍","侮","倵","儛","午","啎","妩","娬","嫵","庑","廡","忤","怃","憮","摀","武","潕","熓","牾","玝","珷","瑦","甒","碔","舞","躌","迕","逜","陚","鵡","鹉","𣲘"],jiǔ:["久","乆","九","乣","奺","杦","汣","灸","玖","紤","舏","酒","镹","韭","韮"],"tuō zhé":["乇","杔","馲"],"me mó ma yāo":["么"],zhī:["之","倁","卮","巵","搘","支","栀","梔","椥","榰","汁","泜","疷","祗","祬","秓","稙","綕","肢","胑","胝","脂","芝","蘵","蜘","衼","隻","鳷","鴲","鼅","𦭜"],"wū wù":["乌"],zhà:["乍","咤","宱","搾","榨","溠","痄","蚱","詐","诈","醡","霅","䃎"],hū:["乎","乯","匢","匫","呼","唿","嘑","垀","寣","幠","忽","惚","昒","歑","泘","淴","滹","烀","苸","虍","虖","謼","軤","轷","雐"],fá:["乏","伐","傠","坺","垡","墢","姂","栰","浌","瞂","笩","筏","罚","罰","罸","藅","閥","阀"],"lè yuè yào lào":["乐","樂"],yín:["乑","吟","噖","嚚","圁","垠","夤","婬","寅","峾","崟","崯","檭","殥","泿","淫","滛","烎","犾","狺","璌","硍","碒","荶","蔩","訔","訚","訡","誾","鄞","鈝","銀","银","霪","鷣","齦"],pīng:["乒","俜","娉","涄","甹","砯","聠","艵","頩"],pāng:["乓","滂","胮","膖","雱","霶"],qiáo:["乔","侨","僑","嫶","憔","桥","槗","樵","橋","櫵","犞","瞧","硚","礄","荍","荞","蕎","藮","譙","趫","鐈","鞒","鞽","顦"],hǔ:["乕","琥","萀","虎","虝","錿","鯱"],guāi:["乖"],"chéng shèng":["乗","乘","娍"],yǐ:["乙","乛","以","倚","偯","嬟","崺","已","庡","扆","攺","敼","旑","旖","檥","矣","礒","笖","舣","艤","苡","苢","蚁","螘","蟻","裿","踦","輢","轙","逘","酏","釔","鈘","鉯","钇","顗","鳦","齮","𫖮","𬺈"],"háo yǐ":["乚"],"niè miē":["乜"],qǐ:["乞","企","启","唘","啓","啔","啟","婍","屺","杞","棨","玘","盀","綺","绮","芑","諬","起","邔","闙"],yě:["也","冶","嘢","埜","壄","漜","野"],xí:["习","喺","媳","嶍","席","椺","檄","漝","習","蓆","袭","襲","覡","觋","謵","趘","郋","鎴","隰","霫","飁","騱","騽","驨","鰼","鳛","𠅤","𫘬"],xiāng:["乡","厢","廂","忀","楿","欀","湘","瓖","稥","箱","緗","缃","膷","芗","萫","葙","薌","襄","郷","鄉","鄊","鄕","鑲","镶","香","驤","骧","鱜","麘","𬙋"],shū:["书","倏","倐","儵","叔","姝","尗","抒","掓","摅","攄","書","枢","梳","樞","殊","殳","毹","毺","淑","瀭","焂","疎","疏","紓","綀","纾","舒","菽","蔬","踈","軗","輸","输","鄃","陎","鮛","鵨"],dǒu:["乧","抖","枓","蚪","鈄","阧","陡"],shǐ:["乨","使","兘","史","始","宩","屎","榁","矢","笶","豕","鉂","駛","驶"],jī:["乩","僟","击","刉","刏","剞","叽","唧","喞","嗘","嘰","圾","基","墼","姬","屐","嵆","嵇","撃","擊","朞","机","枅","樭","機","毄","激","犄","玑","璣","畸","畿","癪","矶","磯","积","積","笄","筓","箕","簊","緁","羁","羇","羈","耭","肌","芨","虀","覉","覊","譏","譤","讥","賫","賷","赍","跻","踑","躋","躸","銈","錤","鐖","鑇","鑙","隮","雞","鞿","韲","飢","饑","饥","魕","鳮","鶏","鶺","鷄","鸄","鸡","齎","齏","齑","𬯀","𫓯","𫓹","𫌀"],náng:["乪","嚢","欜","蠰","饢"],jiā:["乫","佳","傢","加","嘉","抸","枷","梜","毠","泇","浃","浹","犌","猳","珈","痂","笳","糘","耞","腵","葭","袈","豭","貑","跏","迦","鉫","鎵","镓","鴐","麚","𬂩"],jù:["乬","倨","倶","具","剧","劇","勮","埧","埾","壉","姖","屦","屨","岠","巨","巪","怇","惧","愳","懅","懼","拒","拠","昛","歫","洰","澽","炬","烥","犋","秬","窭","窶","簴","粔","耟","聚","虡","蚷","詎","讵","豦","距","踞","躆","遽","邭","醵","鉅","鐻","钜","颶","飓","駏","鮔"],shí:["乭","十","埘","塒","姼","实","実","寔","實","峕","嵵","时","旹","時","榯","湜","溡","炻","祏","竍","蚀","蝕","辻","遈","鉐","飠","饣","鮖","鰣","鲥","鼫","鼭"],mǎo:["乮","冇","卯","峁","戼","昴","泖","笷","蓩","鉚","铆"],mǎi:["买","嘪","荬","蕒","買","鷶"],luàn:["乱","亂","釠"],rǔ:["乳","擩","汝","肗","辱","鄏"],xué:["乴","学","學","峃","嶨","斈","泶","澩","燢","穴","茓","袕","踅","鷽","鸴"],yǎn:["䶮","乵","俨","偃","儼","兖","兗","厣","厴","噞","孍","嵃","巘","巚","弇","愝","戭","扊","抁","掩","揜","曮","椼","檿","沇","渷","演","琰","甗","眼","罨","萒","蝘","衍","褗","躽","遃","郾","隒","顩","魇","魘","鰋","鶠","黡","黤","黬","黭","黶","鼴","鼹","齴","龑","𬸘","𬙂","𪩘"],fǔ:["乶","俌","俛","俯","府","弣","抚","拊","撫","斧","椨","滏","焤","甫","盙","簠","腐","腑","蜅","輔","辅","郙","釜","釡","阝","頫","鬴","黼","㕮","𫖯"],shā:["乷","唦","杀","桬","殺","毮","猀","痧","砂","硰","紗","繺","纱","蔱","裟","鎩","铩","閷","髿","魦","鯊","鯋","鲨"],nǎ:["乸","雫"],qián:["乹","亁","仱","偂","前","墘","媊","岒","拑","掮","榩","橬","歬","潛","潜","濳","灊","箝","葥","虔","軡","鈐","鉗","銭","錢","鎆","钤","钱","钳","靬","騚","騝","鰬","黔","黚"],suǒ:["乺","唢","嗩","所","暛","溑","溹","琐","琑","瑣","索","褨","鎖","鎻","鏁","锁"],yú:["乻","于","亐","伃","余","堣","堬","妤","娛","娯","娱","嬩","崳","嵎","嵛","愚","扵","揄","旟","楡","楰","榆","欤","歈","歟","歶","渔","渝","湡","漁","澞","牏","狳","玗","玙","瑜","璵","盂","睮","窬","竽","籅","羭","腴","臾","舁","舆","艅","茰","萮","萸","蕍","蘛","虞","虶","蝓","螸","衧","褕","覦","觎","諛","謣","谀","踰","輿","轝","逾","邘","酑","鍝","隅","雓","雩","餘","馀","騟","骬","髃","魚","魣","鮽","鯲","鰅","鱼","鷠","鸆","齵"],zhù:["乼","伫","佇","住","坾","墸","壴","嵀","拀","杼","柱","樦","殶","注","炷","疰","眝","祝","祩","竚","筯","箸","篫","簗","紵","紸","纻","羜","翥","苎","莇","蛀","註","貯","贮","跓","軴","鉒","鋳","鑄","铸","馵","駐","驻"],zhě:["乽","者","褶","襵","赭","踷","鍺","锗"],"qián gān":["乾"],"zhì luàn":["乿"],guī:["亀","圭","妫","媯","嫢","嬀","帰","归","摫","椝","槻","槼","櫷","歸","珪","瑰","璝","瓌","皈","瞡","硅","茥","蘬","規","规","邽","郌","閨","闺","騩","鬶","鬹"],"lǐn lìn":["亃"],jué:["亅","决","刔","劂","匷","厥","噊","孒","孓","崛","崫","嶥","彏","憠","憰","戄","抉","挗","掘","攫","桷","橛","橜","欮","氒","決","灍","焳","熦","爑","爴","爵","獗","玃","玦","玨","珏","瑴","瘚","矍","矡","砄","絕","絶","绝","臄","芵","蕝","蕨","虳","蟨","蟩","觖","觮","觼","訣","譎","诀","谲","貜","赽","趉","蹷","躩","鈌","鐍","鐝","钁","镢","鴂","鴃","鷢","𫘝","㵐","𫔎"],"le liǎo":["了"],"gè mā":["亇"],"yǔ yú":["予","懙"],zhēng:["争","佂","凧","姃","媜","峥","崝","崢","征","徰","炡","烝","爭","狰","猙","癥","眐","睁","睜","筝","箏","篜","聇","脀","蒸","踭","鉦","錚","鏳","鬇"],èr:["二","刵","咡","弍","弐","樲","誀","貮","貳","贰","髶"],chù:["亍","傗","儊","怵","憷","搐","斶","歜","珿","琡","矗","竌","絀","绌","臅","触","觸","豖","鄐","閦","黜"],kuī:["亏","刲","岿","巋","盔","窥","窺","聧","虧","闚","顝"],yún:["云","伝","勻","匀","囩","妘","愪","抣","昀","橒","沄","涢","溳","澐","熉","畇","秐","筼","篔","紜","縜","纭","耘","芸","蒷","蕓","郧","鄖","鋆","雲"],hù:["互","冱","嗀","嚛","婟","嫭","嫮","岵","帍","弖","怙","戶","户","戸","戽","扈","护","昈","槴","沍","沪","滬","熩","瓠","祜","笏","簄","粐","綔","蔰","護","豰","鄠","鍙","頀","鱯","鳠","鳸","鸌","鹱"],qí:["亓","剘","埼","岐","岓","崎","嵜","愭","掑","斉","斊","旂","旗","棊","棋","檱","櫀","歧","淇","濝","猉","玂","琦","琪","璂","畦","疧","碁","碕","祁","祈","祺","禥","竒","簯","簱","籏","粸","綥","綦","肵","脐","臍","艩","芪","萁","萕","蕲","藄","蘄","蚑","蚚","蛴","蜝","蜞","螧","蠐","褀","軝","鄿","釮","錡","锜","陭","頎","颀","騎","騏","騹","骐","骑","鬐","鬿","鯕","鰭","鲯","鳍","鵸","鶀","麒","麡","𨙸","𬨂","䓫"],jǐng:["井","儆","刭","剄","坓","宑","幜","憬","暻","殌","汫","汬","澋","璄","璟","璥","穽","肼","蟼","警","阱","頚","頸"],sì:["亖","佀","価","儩","兕","嗣","四","姒","娰","孠","寺","巳","柶","榹","汜","泗","泤","洍","洠","涘","瀃","牭","祀","禩","竢","笥","耜","肂","肆","蕼","覗","貄","釲","鈶","鈻","飤","飼","饲","駟","騃","驷"],suì:["亗","嬘","岁","嵗","旞","檖","歲","歳","澻","煫","燧","璲","砕","碎","祟","禭","穂","穗","穟","繀","繐","繸","襚","誶","譢","谇","賥","邃","鐆","鐩","隧","韢","𫟦","𬭼"],gèn:["亘","亙","揯","搄","茛"],yà:["亚","亜","俹","冴","劜","圔","圠","埡","娅","婭","揠","氩","氬","犽","砑","稏","聐","襾","覀","訝","讶","迓","齾"],"xiē suò":["些"],"qí zhāi":["亝","齊"],"yā yà":["亞","压","垭","壓","铔"],"jí qì":["亟","焏"],tóu:["亠","投","頭","骰"],"wáng wú":["亡"],"kàng háng gāng":["亢"],dà:["亣","眔"],jiāo:["交","僬","娇","嬌","峧","嶕","嶣","憍","椒","浇","澆","焦","礁","穚","簥","胶","膠","膲","茭","茮","蕉","虠","蛟","蟭","跤","轇","郊","鐎","驕","骄","鮫","鲛","鵁","鷦","鷮","鹪","䴔"],hài:["亥","嗐","害","氦","餀","饚","駭","駴","骇"],"hēng pēng":["亨"],mǔ:["亩","姆","峔","拇","母","牡","牳","畂","畆","畒","畝","畞","畮","砪","胟","踇","鉧","𬭁","𧿹"],ye:["亪"],xiǎng:["享","亯","响","想","晑","蚃","蠁","響","飨","餉","饗","饷","鮝","鯗","鱶","鲞"],jīng:["京","亰","兢","坕","坙","婛","惊","旌","旍","晶","橸","泾","涇","猄","睛","秔","稉","粳","精","経","經","綡","聙","腈","茎","荆","荊","菁","葏","驚","鯨","鲸","鶁","鶄","麖","麠","鼱","䴖"],tíng:["亭","停","婷","嵉","庭","廷","楟","榳","筳","聤","莛","葶","蜓","蝏","諪","邒","霆","鼮","䗴"],liàng:["亮","喨","悢","晾","湸","諒","谅","輌","輛","辆","鍄"],"qīn qìng":["亲","親"],bó:["亳","仢","侼","僰","博","帛","愽","懪","挬","搏","欂","浡","淿","渤","煿","牔","狛","瓝","礴","秡","箔","簙","糪","胉","脖","膊","舶","艊","萡","葧","袯","襏","襮","謈","踣","郣","鈸","鉑","鋍","鎛","鑮","钹","铂","镈","餺","馎","馛","馞","駁","駮","驳","髆","鵓","鹁"],yòu:["亴","佑","佦","侑","又","右","哊","唀","囿","姷","宥","峟","幼","狖","祐","蚴","誘","诱","貁","迶","酭","釉","鼬"],xiè:["亵","伳","偞","偰","僁","卨","卸","噧","塮","夑","媟","屑","屧","廨","徢","懈","暬","械","榍","榭","泻","洩","渫","澥","瀉","瀣","灺","炧","炨","燮","爕","獬","祄","禼","糏","紲","絏","絬","繲","纈","绁","缷","薢","薤","蟹","蠏","褉","褻","謝","谢","躞","邂","靾","韰","齂","齘","齛","齥","𬹼","𤫉"],"dǎn dàn":["亶","馾"],lián:["亷","劆","匲","匳","嗹","噒","奁","奩","嫾","帘","廉","怜","憐","涟","漣","濂","濓","瀮","熑","燫","簾","籢","籨","縺","翴","联","聨","聫","聮","聯","臁","莲","蓮","薕","螊","蠊","裢","褳","覝","謰","蹥","连","連","鎌","鐮","镰","鬑","鰱","鲢"],duǒ:["亸","哚","嚲","埵","崜","朵","朶","綞","缍","趓","躱","躲","軃"],"wěi mén":["亹","斖"],rén:["人","亻","仁","壬","忈","忎","朲","秂","芢","魜","鵀"],jí:["亼","亽","伋","佶","偮","卙","即","卽","及","叝","吉","堲","塉","姞","嫉","岌","嵴","嶯","彶","忣","急","愱","戢","揤","极","棘","楫","極","槉","檝","殛","汲","湒","潗","疾","瘠","皍","笈","箿","籍","級","级","膌","艥","蒺","蕀","蕺","蝍","螏","襋","觙","谻","踖","蹐","躤","輯","轚","辑","郆","銡","鍓","鏶","集","雧","霵","鹡","㴔"],wáng:["亾","仼","兦","莣","蚟"],"shén shí":["什"],lè:["仂","叻","忇","氻","泐","玏","砳","簕","艻","阞","韷","餎","鰳","鱳","鳓"],dīng:["仃","叮","帄","玎","疔","盯","耵","虰","靪"],zè:["仄","崱","庂","捑","昃","昗","汄"],"jǐn jìn":["仅","僅","嫤"],"pú pū":["仆"],"chóu qiú":["仇"],zhǎng:["仉","幥","掌","礃"],jīn:["今","堻","巾","惍","斤","津","珒","琻","璡","砛","筋","荕","衿","襟","觔","金","釒","釿","钅","鹶","黅","𬬱"],bīng:["仌","仒","兵","冫","冰","掤","氷","鋲"],réng:["仍","礽","芿","辸","陾"],fó:["仏","坲","梻"],"jīn sǎn":["仐"],lún:["仑","伦","侖","倫","囵","圇","婨","崘","崙","棆","沦","淪","磮","腀","菕","蜦","踚","輪","轮","錀","陯","鯩","𬬭"],cāng:["仓","仺","倉","凔","嵢","沧","滄","濸","獊","舱","艙","苍","蒼","螥","鸧"],"zǎi zǐ zī":["仔"],tā:["他","塌","它","榙","溻","牠","祂","褟","趿","遢","闧"],fù:["付","偩","傅","冨","副","咐","坿","复","妇","婦","媍","嬔","富","復","椱","祔","禣","竎","緮","縛","缚","腹","萯","蕧","蚹","蛗","蝜","蝮","袝","複","覄","覆","訃","詂","讣","負","賦","賻","负","赋","赙","赴","輹","鍑","鍢","阜","附","馥","駙","驸","鮒","鰒","鲋","鳆","㳇"],xiān:["仙","仚","佡","僊","僲","先","嘕","奾","屳","廯","忺","憸","掀","暹","杴","氙","珗","祆","秈","籼","繊","纎","纖","苮","褼","襳","跹","蹮","躚","酰","鍁","锨","韯","韱","馦","鱻","鶱","𬸣"],"tuō chà duó":["仛"],hóng:["仜","吰","垬","妅","娂","宏","宖","弘","彋","汯","泓","洪","浤","渱","潂","玒","玜","竑","竤","篊","粠","紘","紭","綋","纮","翃","翝","耾","苰","荭","葒","葓","谹","谼","鈜","鉷","鋐","閎","闳","霐","霟","鞃","魟","鴻","鸿","黉","黌","𫟹","𬭎"],tóng:["仝","佟","哃","峂","峝","庝","彤","晍","曈","桐","氃","浵","潼","犝","獞","眮","瞳","砼","秱","童","粡","膧","茼","蚒","詷","赨","酮","鉖","鉵","銅","铜","餇","鮦","鲖","𫍣","𦒍"],rèn:["仞","仭","刃","刄","妊","姙","屻","岃","扨","牣","祍","紉","紝","絍","纫","纴","肕","腍","衽","袵","訒","認","认","讱","軔","轫","鈓","靭","靱","韌","韧","飪","餁","饪"],qiān:["仟","佥","僉","千","圲","奷","孯","岍","悭","愆","慳","扦","拪","搴","撁","攐","攑","攓","杄","櫏","汘","汧","牵","牽","竏","签","簽","籖","籤","粁","芊","茾","蚈","褰","諐","謙","谦","谸","迁","遷","釺","鈆","鉛","鏲","钎","阡","韆","顅","騫","骞","鬜","鬝","鵮","鹐"],"gǎn hàn":["仠"],"yì gē":["仡"],dài:["代","侢","叇","垈","埭","岱","帒","带","帯","帶","廗","怠","戴","曃","柋","殆","瀻","玳","瑇","甙","簤","紿","緿","绐","艜","蝳","袋","襶","貣","贷","蹛","軑","軚","軩","轪","迨","霴","靆","鴏","黛","黱"],"lìng líng lǐng":["令"],chào:["仦","耖","觘"],"cháng zhǎng":["仧","兏","長","长"],sā:["仨"],cháng:["仩","偿","償","嘗","嚐","嫦","尝","常","徜","瑺","瓺","甞","肠","腸","膓","苌","萇","镸","鱨","鲿"],yí:["仪","侇","儀","冝","匜","咦","圯","夷","姨","宐","宜","宧","寲","峓","嶬","嶷","巸","彛","彜","彝","彞","怡","恞","扅","暆","栘","椬","椸","沂","洟","熪","瓵","痍","移","簃","籎","羠","胰","萓","蛦","螔","觺","謻","貽","贻","跠","迻","遺","鏔","頉","頤","頥","顊","颐","饴","鮧","鴺"],mù:["仫","凩","募","墓","幕","幙","慔","慕","暮","暯","木","楘","毣","沐","炑","牧","狇","目","睦","穆","艒","苜","莯","蚞","鉬","钼","雮","霂"],"men mén":["们"],fǎn:["仮","反","橎","返"],"chào miǎo":["仯"],"yǎng áng":["仰"],zhòng:["仲","众","堹","妕","媑","狆","眾","祌","筗","茽","蚛","衆","衶","諥"],"pǐ pí":["仳"],wò:["仴","偓","卧","媉","幄","握","楃","沃","渥","濣","瓁","瞃","硪","肟","腛","臥","齷","龌"],jiàn:["件","俴","健","僭","剑","剣","剱","劍","劎","劒","劔","墹","寋","建","徤","擶","旔","楗","毽","洊","涧","澗","牮","珔","瞷","磵","礀","箭","糋","繝","腱","臶","舰","艦","荐","薦","覸","諓","諫","譛","谏","賎","賤","贱","趝","践","踐","踺","轞","鉴","鍳","鍵","鐱","鑑","鑒","鑬","鑳","键","間","餞","饯","𬣡"],"jià jiè jie":["价"],"yǎo fó":["仸"],"rèn rén":["任"],"fèn bīn":["份"],dī:["仾","低","啲","埞","堤","岻","彽","樀","滴","磾","秪","羝","袛","趆","隄","鞮","䃅"],fǎng:["仿","倣","旊","昉","昘","瓬","眆","紡","纺","舫","訪","访","髣","鶭"],zhōng:["伀","刣","妐","幒","彸","忠","柊","汷","泈","炂","盅","籦","終","终","舯","蔠","蜙","螤","螽","衳","衷","蹱","鈡","鍾","鐘","钟","锺","鴤","鼨"],pèi:["伂","佩","姵","帔","斾","旆","沛","浿","珮","蓜","轡","辔","配","霈","馷"],diào:["伄","吊","弔","掉","瘹","盄","窎","窵","竨","訋","釣","鈟","銱","鋽","鑃","钓","铞","雿","魡"],dùn:["伅","潡","炖","燉","盾","砘","碷","踲","逇","遁","遯","鈍","钝"],wěn:["伆","刎","吻","呅","抆","桽","稳","穏","穩","紊","肳","脗"],xǐn:["伈"],kàng:["伉","匟","囥","抗","炕","鈧","钪"],ài:["伌","僾","塧","壒","嫒","嬡","愛","懓","暧","曖","爱","瑷","璦","皧","瞹","砹","硋","碍","礙","薆","譺","賹","鑀","隘","靉","餲","馤","鱫","鴱"],"jì qí":["伎","薺"],"xiū xǔ":["休"],"jìn yín":["伒"],dǎn:["伔","刐","撢","玬","瓭","紞","胆","膽","衴","賧","赕","黕","𬘘"],fū:["伕","呋","娐","孵","尃","怤","懯","敷","旉","玞","砆","稃","筟","糐","綒","肤","膚","荂","荴","衭","趺","跗","邞","鄜","酜","鈇","麩","麬","麱","麸","𫓧"],tǎng:["伖","傥","儻","埫","戃","曭","爣","矘","躺","鎲","钂","镋"],yōu:["优","優","呦","嚘","峳","幽","忧","悠","憂","攸","櫌","滺","瀀","纋","羪","耰","逌","鄾","麀"],huǒ:["伙","夥","火","煷","邩","鈥","钬"],"huì kuài":["会","會","浍","璯"],yǔ:["伛","俁","俣","偊","傴","匬","噳","圄","圉","宇","寙","屿","嶼","庾","挧","敔","斞","楀","瑀","瘐","祤","禹","穥","窳","羽","與","萭","貐","鄅","頨","麌","齬","龉","㺄"],cuì:["伜","啛","忰","悴","毳","淬","焠","疩","瘁","竁","粋","粹","紣","綷","翆","翠","脃","脆","脺","膬","膵","臎","萃","襊","顇"],sǎn:["伞","傘","糤","繖","饊","馓"],wěi:["伟","伪","偉","偽","僞","儰","娓","寪","屗","崣","嶉","徫","愇","捤","暐","梶","洧","浘","渨","炜","煒","猥","玮","瑋","痿","緯","纬","腲","艉","芛","苇","荱","萎","葦","蒍","蔿","蜼","諉","诿","踓","鍡","韑","韙","韡","韪","頠","颹","骩","骪","骫","鮪","鲔","𫇭","𬀩","𬱟"],"chuán zhuàn":["传","傳"],"chē jū":["伡","俥","车"],"jū chē":["車"],yá:["伢","厑","厓","堐","岈","崕","崖","涯","漄","牙","玡","琊","睚","笌","芽","蚜","衙","齖"],qiàn:["伣","俔","倩","儙","刋","壍","嬱","悓","棈","椠","槧","欠","歉","皘","篏","篟","縴","芡","蒨","蔳","輤","𬘬"],shāng:["伤","傷","商","墒","慯","殇","殤","滳","漡","熵","蔏","螪","觞","觴","謪","鬺"],chāng:["伥","倀","娼","昌","椙","淐","猖","琩","菖","裮","錩","锠","閶","阊","鯧","鲳","鼚"],"chen cāng":["伧"],xùn:["伨","侚","卂","噀","巺","巽","徇","愻","殉","殾","汛","潠","狥","蕈","訊","訓","訙","训","讯","迅","迿","逊","遜","鑂","顨","馴","驯"],xìn:["伩","囟","孞","脪","舋","衅","訫","釁","阠","顖"],chǐ:["伬","侈","卶","叺","呎","垑","恥","歯","耻","肔","胣","蚇","裭","褫","豉","鉹","齒","齿"],"xián xuán":["伭"],"nú nǔ":["伮"],"bó bǎi":["伯"],"gū gù":["估"],nǐ:["伱","你","儞","孴","拟","擬","旎","晲","狔","苨","薿","隬"],"nì ní":["伲"],bàn:["伴","办","半","姅","怑","扮","瓣","秚","絆","绊","辦","鉡","靽"],xù:["伵","侐","勖","勗","卹","叙","垿","壻","婿","序","恤","敍","敘","旭","昫","朂","槒","欰","殈","汿","沀","洫","溆","漵","潊","烅","烼","煦","獝","珬","盢","瞁","稸","絮","続","緒","緖","續","绪","续","聓","聟","蓄","藚","訹","賉","酗","頊","鱮","㳚"],zhòu:["伷","僽","冑","呪","咒","咮","宙","昼","晝","甃","皱","皺","籀","籒","籕","粙","紂","縐","纣","绉","胄","荮","葤","詋","酎","駎","驟","骤","㤘","㑇"],shēn:["伸","侁","兟","呻","堔","妽","娠","屾","峷","扟","敒","曑","柛","氠","深","燊","珅","甡","甧","申","眒","砷","穼","籶","籸","糂","紳","绅","罙","罧","葠","蓡","蔘","薓","裑","訷","詵","诜","身","駪","鯓","鯵","鰺","鲹","鵢","𬳽"],qū:["伹","佉","匤","呿","坥","屈","岖","岴","嶇","憈","抾","敺","浀","煀","祛","筁","粬","胠","蛆","蛐","袪","覻","詘","诎","趍","躯","軀","阹","駆","駈","驅","驱","髷","魼","鰸","鱋","鶌","麯","麴","麹","黢","㭕","𪨰","䓛"],"sì cì":["伺"],bēng:["伻","嘣","奟","崩","嵭","閍"],"sì shì":["似"],"jiā qié gā":["伽"],"yǐ chì":["佁"],"diàn tián":["佃","钿"],"hān gàn":["佄"],mài:["佅","劢","勱","卖","唛","売","脈","衇","賣","迈","邁","霡","霢","麥","麦","鿏"],dàn:["但","僤","啖","啗","啿","噉","嚪","帎","憺","旦","柦","氮","沊","泹","淡","狚","疍","癚","禫","窞","腅","萏","蓞","蛋","蜑","觛","訑","誕","诞","贉","霮","餤","饏","駳","髧","鴠","𫢸"],bù:["佈","勏","吥","咘","埗","埠","布","廍","怖","悑","步","歨","歩","瓿","篰","荹","蔀","踄","部","郶","鈈","钚","餢"],bǐ:["佊","俾","匕","夶","妣","彼","朼","柀","比","毞","沘","疕","秕","笔","筆","粃","聛","舭","貏","鄙"],"zhāo shào":["佋"],cǐ:["佌","此","泚","皉","𫚖"],wèi:["位","卫","味","喂","墛","媦","慰","懀","未","渭","煟","熭","犚","猬","畏","緭","罻","胃","苿","菋","藯","蘶","蝟","螱","衛","衞","褽","謂","讆","讏","谓","躗","躛","軎","轊","鏏","霨","餧","餵","饖","魏","鮇","鳚"],zuǒ:["佐","左","繓"],yǎng:["佒","傟","养","坱","岟","慃","懩","攁","氧","氱","炴","痒","癢","礢","紻","蝆","軮","養","駚"],"tǐ tī":["体","體"],zhàn:["佔","偡","嶘","战","戦","戰","栈","桟","棧","湛","站","綻","绽","菚","蘸","虥","虦","譧","轏","驏"],"hé hē hè":["何"],bì:["佖","咇","哔","嗶","坒","堛","壁","奰","妼","婢","嬖","币","幣","幤","庇","庳","廦","弊","弻","弼","彃","必","怭","愊","愎","敝","斃","梐","毕","毖","毙","湢","滗","滭","潷","煏","熚","狴","獘","獙","珌","璧","畀","畢","疪","痹","痺","皕","睤","碧","筚","箅","箆","篦","篳","粊","綼","縪","繴","罼","腷","苾","荜","萆","萞","蓖","蓽","蔽","薜","蜌","袐","襅","襞","襣","觱","詖","诐","貱","贔","赑","跸","蹕","躃","躄","避","邲","鄨","鄪","鉍","鏎","鐴","铋","閇","閉","閟","闭","陛","韠","飶","饆","馝","駜","驆","髀","魓","鮅","鷝","鷩","鼊"],tuó:["佗","坨","堶","岮","槖","橐","沱","砣","砤","碢","紽","詑","跎","酡","阤","陀","陁","駝","駞","騨","驒","驝","驼","鮀","鴕","鸵","鼉","鼍","鼧","𬶍"],shé:["佘","舌","虵","蛥"],"yì dié":["佚","昳","泆","軼"],"fó fú bì bó":["佛"],"zuò zuō":["作"],gōu:["佝","沟","溝","痀","篝","簼","緱","缑","袧","褠","鈎","鉤","钩","鞲","韝"],nìng:["佞","侫","倿","寕","泞","澝","濘"],qú:["佢","劬","戵","斪","欋","欔","氍","淭","灈","爠","璖","璩","癯","磲","籧","絇","胊","臞","菃","葋","蕖","蘧","蟝","蠷","蠼","衐","衢","躣","軥","鑺","鴝","鸜","鸲","鼩"],"yōng yòng":["佣"],wǎ:["佤","咓","砙","邷"],kǎ:["佧","垰","胩","裃","鉲"],bāo:["佨","勹","包","孢","煲","笣","胞","苞","蕔","裦","褒","襃","闁","齙","龅"],"huái huí":["佪"],"gé hè":["佫"],lǎo:["佬","咾","恅","栳","狫","珯","硓","老","耂","荖","蛯","轑","銠","铑","鮱"],xiáng:["佭","庠","栙","祥","絴","翔","詳","跭"],gé:["佮","匌","呄","嗝","塥","愅","挌","搿","槅","櫊","滆","膈","臵","茖","觡","諽","輵","轕","閣","阁","隔","鞷","韐","韚","騔","骼","鮯"],yáng:["佯","劷","垟","崸","徉","扬","揚","敭","旸","昜","暘","杨","楊","洋","炀","珜","疡","瘍","眻","蛘","諹","輰","鍚","钖","阦","阳","陽","霷","颺","飏","鰑","鴹","鸉"],bǎi:["佰","捭","摆","擺","栢","百","竡","粨","襬"],fǎ:["佱","峜","法","灋","砝","鍅"],mǐng:["佲","凕","姳","慏","酩"],"èr nài":["佴"],hěn:["佷","很","狠","詪","𬣳"],huó:["佸","活"],guǐ:["佹","匦","匭","厬","垝","姽","宄","庋","庪","恑","晷","湀","癸","祪","簋","蛫","蟡","觤","詭","诡","軌","轨","陒","鬼"],quán:["佺","全","啳","埢","姾","峑","巏","拳","搼","权","楾","権","權","泉","洤","湶","牷","犈","瑔","痊","硂","筌","縓","荃","葲","蜷","蠸","觠","詮","诠","跧","踡","輇","辁","醛","銓","铨","闎","顴","颧","駩","騡","鬈","鰁","鳈","齤"],tiāo:["佻","庣","旫","祧","聎"],jiǎo:["佼","儌","孂","挢","搅","撟","撹","攪","敫","敽","敿","晈","暞","曒","灚","燞","狡","璬","皎","皦","絞","纐","绞","腳","臫","蟜","譑","賋","踋","鉸","铰","餃","饺","鱎","龣"],cì:["佽","刾","庛","朿","栨","次","絘","茦","莿","蛓","螆","賜","赐"],xíng:["侀","刑","哘","型","娙","形","洐","硎","蛵","邢","郉","鈃","鉶","銒","钘","铏","陉","陘","餳","𫰛"],tuō:["侂","咃","咜","圫","托","拕","拖","汑","脫","脱","莌","袥","託","讬","飥","饦","魠","鮵"],kǎn:["侃","偘","冚","坎","惂","砍","莰","輡","轗","顑"],zhí:["侄","値","值","埴","執","姪","嬂","戠","执","摭","植","樴","淔","漐","直","禃","絷","縶","聀","职","職","膱","蟙","跖","踯","蹠","躑","軄","釞","馽"],gāi:["侅","垓","姟","峐","晐","畡","祴","荄","該","该","豥","賅","賌","赅","陔"],lái:["來","俫","倈","崃","崍","庲","来","梾","棶","涞","淶","猍","琜","筙","箂","莱","萊","逨","郲","錸","铼","騋","鯠","鶆","麳"],kuǎ:["侉","咵","垮","銙"],gōng:["侊","公","功","匑","匔","塨","宫","宮","工","幊","弓","恭","攻","杛","碽","糼","糿","肱","觥","觵","躬","躳","髸","龔","龚","䢼"],lì:["例","俐","俪","傈","儮","儷","凓","利","力","励","勵","历","厉","厤","厯","厲","叓","吏","呖","唎","唳","嚦","囇","坜","塛","壢","娳","婯","屴","岦","悧","悷","慄","戾","搮","暦","曆","曞","朸","枥","栃","栗","栛","檪","櫔","櫪","欐","歴","歷","沥","沴","涖","溧","濿","瀝","爏","犡","猁","珕","瑮","瓅","瓑","瓥","疬","痢","癧","盭","睙","砅","砺","砾","磿","礪","礫","礰","禲","秝","立","笠","篥","粒","粝","糲","脷","苈","茘","荔","莅","莉","蒚","蒞","藶","蚸","蛎","蛠","蜧","蝷","蠇","蠣","詈","讈","赲","轢","轣","轹","酈","鉝","隶","隷","雳","靂","靋","鬁","鳨","鴗","鷅","麜","𫵷","𬍛"],yīn:["侌","凐","喑","噾","囙","因","垔","堙","姻","婣","愔","慇","栶","氤","洇","溵","濦","瘖","禋","秵","筃","絪","緸","茵","蒑","蔭","裀","諲","銦","铟","闉","阥","阴","陰","陻","隂","霒","霠","鞇","音","韾","駰","骃","齗","𬘡","𬤇","𬮱"],mǐ:["侎","孊","弭","敉","洣","渳","灖","米","粎","羋","脒","芈","葞","蔝","銤"],zhū:["侏","株","槠","橥","櫧","櫫","洙","潴","瀦","猪","珠","硃","秼","絑","茱","蕏","蛛","蝫","蠩","袾","誅","諸","诛","诸","豬","跦","邾","銖","铢","駯","鮢","鯺","鴸","鼄"],ān:["侒","偣","媕","安","峖","庵","桉","氨","盦","盫","腤","菴","萻","葊","蓭","誝","諳","谙","鞌","鞍","韽","馣","鮟","鵪","鶕","鹌","𩽾"],lù:["侓","僇","勎","勠","圥","坴","塶","娽","峍","廘","彔","录","戮","摝","椂","樚","淕","淥","渌","漉","潞","琭","璐","甪","盝","睩","硉","祿","禄","稑","穋","箓","簏","簬","簵","簶","籙","粶","蔍","蕗","虂","螰","賂","赂","趢","路","踛","蹗","輅","轆","辂","辘","逯","醁","錄","録","錴","鏴","陸","騄","騼","鯥","鴼","鵦","鵱","鷺","鹭","鹿","麓","𫘧"],móu:["侔","劺","恈","眸","蛑","謀","谋","踎","鍪","鴾","麰"],ér:["侕","儿","児","兒","峏","栭","洏","粫","而","胹","荋","袻","輀","轜","陑","隭","髵","鮞","鲕","鴯","鸸"],"dòng tǒng tóng":["侗"],chà:["侘","奼","姹","岔","汊","詫","诧"],chì:["侙","傺","勅","勑","叱","啻","彳","恜","慗","憏","懘","抶","敕","斥","杘","湁","灻","炽","烾","熾","痓","痸","瘛","翄","翅","翤","翨","腟","赤","趩","遫","鉓","雴","飭","饬","鶒","鷘"],"gòng gōng":["供","共"],zhōu:["侜","周","喌","州","徟","洲","淍","炿","烐","珘","矪","舟","謅","譸","诌","賙","赒","輈","輖","辀","週","郮","銂","霌","駲","騆","鵃","鸼"],rú:["侞","儒","嚅","如","嬬","孺","帤","曘","桇","渪","濡","筎","茹","蕠","薷","蝡","蠕","袽","襦","邚","醹","銣","铷","顬","颥","鱬","鴑","鴽"],"jiàn cún":["侟"],xiá:["侠","俠","匣","峡","峽","敮","暇","柙","炠","烚","狎","狭","狹","珨","瑕","硖","硤","碬","祫","筪","縖","翈","舝","舺","蕸","赮","轄","辖","遐","鍜","鎋","陜","陿","霞","騢","魻","鶷","黠"],lǚ:["侣","侶","儢","吕","呂","屡","屢","履","挔","捛","旅","梠","焒","祣","稆","穭","絽","縷","缕","膂","膐","褛","褸","郘","鋁","铝"],ta:["侤"],"jiǎo yáo":["侥","僥","徺"],zhēn:["侦","偵","寊","帧","帪","幀","搸","斟","桢","楨","榛","樼","殝","浈","湞","潧","澵","獉","珍","珎","瑧","甄","眞","真","砧","碪","祯","禎","禛","箴","胗","臻","葴","蒖","蓁","薽","貞","贞","轃","遉","酙","針","鉁","錱","鍼","针","鱵"],"cè zè zhāi":["侧","側"],kuài:["侩","儈","凷","哙","噲","圦","块","塊","巜","廥","快","旝","欳","狯","獪","筷","糩","脍","膾","郐","鄶","鱠","鲙"],chái:["侪","儕","喍","柴","犲","祡","豺"],nóng:["侬","儂","农","哝","噥","檂","欁","浓","濃","燶","禯","秾","穠","脓","膿","蕽","襛","譨","農","辳","醲","鬞","𬪩"],jǐn:["侭","儘","卺","厪","巹","槿","漌","瑾","紧","緊","菫","蓳","謹","谨","錦","锦","饉","馑"],"hóu hòu":["侯","矦"],jiǒng:["侰","僒","冏","囧","泂","澃","炯","烱","煚","煛","熲","燛","窘","綗","褧","迥","逈","顈","颎","䌹"],"chěng tǐng":["侱"],"zhèn zhēn":["侲","揕"],zuò:["侳","做","唑","坐","岝","岞","座","祚","糳","胙","葃","葄","蓙","袏","阼"],qīn:["侵","兓","媇","嵚","嶔","欽","衾","誛","钦","顉","駸","骎","鮼"],jú:["侷","啹","婅","局","巈","椈","橘","泦","淗","湨","焗","犑","狊","粷","菊","蘜","趜","跼","蹫","輂","郹","閰","駶","驧","鵙","鵴","鶪","鼰","鼳","䴗"],"shù dōu":["侸"],tǐng:["侹","圢","娗","挺","涏","烶","珽","脡","艇","誔","頲","颋"],shèn:["侺","愼","慎","昚","涁","渗","滲","瘆","瘮","眘","祳","肾","胂","脤","腎","蜃","蜄","鋠"],"tuì tuó":["侻"],nán:["侽","喃","娚","抩","暔","枏","柟","楠","男","畘","莮","萳","遖"],xiāo:["侾","哓","嘵","嚻","囂","婋","宯","宵","庨","彇","揱","枭","枵","梟","櫹","歊","毊","消","潇","瀟","灱","灲","烋","焇","猇","獢","痚","痟","硝","硣","窙","箫","簘","簫","綃","绡","翛","膮","萧","蕭","虈","虓","蟂","蟏","蟰","蠨","踃","逍","銷","销","霄","颵","驍","骁","髇","髐","魈","鴞","鴵","鷍","鸮"],"biàn pián":["便","緶","缏"],tuǐ:["俀","腿","蹆","骽"],xì:["係","匸","卌","呬","墍","屃","屓","屭","忥","怬","恄","椞","潝","潟","澙","熂","犔","磶","禊","細","綌","縘","细","绤","舃","舄","蕮","虩","衋","覤","赩","趇","郤","釳","阋","隙","隟","霼","餼","饩","鬩","黖"],cù:["促","媨","憱","猝","瘄","瘯","簇","縬","脨","蔟","誎","趗","踧","踿","蹙","蹴","蹵","醋","顣","鼀"],é:["俄","囮","娥","峉","峨","峩","涐","珴","皒","睋","磀","莪","訛","誐","譌","讹","迗","鈋","鋨","锇","頟","額","额","魤","鵝","鵞","鹅"],qiú:["俅","叴","唒","囚","崷","巯","巰","扏","梂","殏","毬","求","汓","泅","浗","湭","煪","犰","玌","球","璆","皳","盚","紌","絿","肍","芁","莍","虬","虯","蛷","裘","觓","觩","訄","訅","賕","赇","逎","逑","遒","酋","釚","釻","銶","頄","鮂","鯄","鰽","鼽","𨱇"],xú:["俆","徐","禑"],"guàng kuāng":["俇"],kù:["俈","喾","嚳","库","庫","廤","瘔","絝","绔","袴","裤","褲","酷"],wù:["俉","务","務","勿","卼","坞","塢","奦","婺","寤","屼","岉","嵨","忢","悞","悟","悮","戊","扤","晤","杌","溩","焐","熃","物","痦","矹","窹","粅","蘁","誤","误","鋈","阢","隖","雾","霚","霧","靰","騖","骛","鶩","鹜","鼿","齀"],jùn:["俊","儁","呁","埈","寯","峻","懏","捃","攟","晙","棞","燇","珺","畯","竣","箟","蜠","賐","郡","陖","餕","馂","駿","骏","鵔","鵕","鵘","䐃"],liáng:["俍","墚","梁","椋","樑","粮","粱","糧","良","輬","辌","𫟅"],zǔ:["俎","唨","爼","祖","組","组","詛","诅","鎺","阻","靻"],"qiào xiào":["俏"],yǒng:["俑","勇","勈","咏","埇","塎","嵱","彮","怺","恿","悀","惥","愑","愹","慂","柡","栐","永","泳","湧","甬","蛹","詠","踊","踴","鯒","鲬"],hùn:["俒","倱","圂","尡","慁","掍","溷","焝","睴","觨","諢","诨"],jìng:["俓","傹","境","妌","婙","婧","弪","弳","径","徑","敬","曔","桱","梷","浄","瀞","獍","痉","痙","竞","竟","竫","競","竸","胫","脛","莖","誩","踁","迳","逕","鏡","镜","靖","静","靜","鵛"],sàn:["俕","閐"],pěi:["俖"],sú:["俗"],xī:["俙","僖","兮","凞","卥","厀","吸","唏","唽","嘻","噏","嚱","夕","奚","嬆","嬉","屖","嵠","巇","希","徆","徯","息","悉","悕","惁","惜","昔","晞","晰","晳","曦","析","桸","榽","樨","橀","欷","氥","汐","浠","淅","渓","溪","烯","焁","焈","焟","熄","熈","熙","熹","熺","熻","燨","爔","牺","犀","犠","犧","琋","瘜","皙","睎","瞦","矽","硒","磎","礂","稀","穸","窸","粞","糦","緆","繥","羲","翕","翖","肸","肹","膝","舾","莃","菥","蒠","蜥","螅","蟋","蠵","西","觹","觽","觿","譆","谿","豀","豨","豯","貕","赥","邜","鄎","酅","醯","釸","錫","鏭","鐊","鑴","锡","隵","餏","饎","饻","鯑","鵗","鸂","鼷"],lǐ:["俚","娌","峢","峲","李","欚","浬","澧","理","礼","禮","粴","裏","裡","豊","逦","邐","醴","鋰","锂","鯉","鱧","鱱","鲤","鳢"],bǎo:["保","堢","媬","宝","寚","寳","寶","珤","緥","葆","藵","褓","賲","靌","飹","飽","饱","駂","鳵","鴇","鸨"],"yú shù yù":["俞"],"sì qí":["俟"],"xìn shēn":["信"],xiū:["俢","修","咻","庥","樇","烌","羞","脙","脩","臹","貅","銝","鎀","飍","饈","馐","髤","髹","鮴","鱃","鵂","鸺","䗛"],dì:["俤","偙","僀","埊","墑","墬","娣","帝","怟","旳","梊","焍","玓","甋","眱","睇","碲","祶","禘","第","締","缔","腣","菂","蒂","蔕","蝃","蝭","螮","諦","谛","踶","递","逓","遞","遰","鉪","𤧛","䗖"],chóu:["俦","儔","嬦","惆","愁","懤","栦","燽","畴","疇","皗","稠","筹","籌","絒","綢","绸","菗","詶","讎","讐","踌","躊","酧","酬","醻","雔","雠","雦"],zhì:["俧","偫","儨","制","劕","垁","娡","寘","帙","帜","幟","庢","庤","廌","彘","徏","徝","志","忮","懥","懫","挃","挚","掷","摯","擲","旘","晊","智","栉","桎","梽","櫍","櫛","治","洷","滍","滞","滯","潌","瀄","炙","熫","狾","猘","璏","瓆","痔","痣","礩","祑","秩","秷","稚","稺","穉","窒","紩","緻","置","翐","膣","至","致","芖","蛭","袟","袠","製","覟","觗","觯","觶","誌","豑","豒","貭","質","贄","质","贽","跱","踬","躓","輊","轾","郅","銍","鋕","鑕","铚","锧","陟","隲","雉","駤","騭","騺","驇","骘","鯯","鴙","鷙","鸷","𬃊"],"liǎ liǎng":["俩"],jiǎn:["俭","倹","儉","减","剪","堿","弿","彅","戩","戬","拣","挸","捡","揀","撿","枧","柬","梘","检","検","檢","減","湕","瀽","瑐","睑","瞼","硷","碱","礆","笕","筧","简","簡","絸","繭","翦","茧","藆","蠒","裥","襇","襉","襺","詃","謇","謭","譾","谫","趼","蹇","鐗","鬋","鰎","鹸","鹻","鹼"],huò:["俰","咟","嚯","嚿","奯","彠","惑","或","擭","旤","曤","檴","沎","湱","瀖","獲","癨","眓","矐","祸","禍","穫","窢","耯","臛","艧","获","蒦","藿","蠖","謋","貨","货","鍃","鑊","镬","雘","霍","靃","韄","㸌"],"jù jū":["俱","据","鋸","锯"],xiào:["俲","傚","効","咲","哮","啸","嘋","嘨","嘯","孝","效","斅","斆","歗","涍","熽","笑","詨","誟"],pái:["俳","徘","牌","犤","猅","簰","簲","輫"],biào:["俵","鰾","鳔"],"chù tì":["俶"],fèi:["俷","剕","厞","吠","屝","废","廃","廢","昲","曊","櫠","沸","濷","狒","癈","肺","萉","費","费","鐨","镄","陫","靅","鼣"],fèng:["俸","凤","奉","湗","焨","煈","賵","赗","鳯","鳳","鴌"],ǎn:["俺","唵","埯","揞","罯","銨","铵"],bèi:["俻","倍","偝","偹","備","僃","备","悖","惫","愂","憊","昁","梖","焙","牬","犕","狈","狽","珼","琲","碚","禙","糒","苝","蓓","蛽","褙","貝","贝","軰","輩","辈","邶","郥","鄁","鋇","鐾","钡","鞁","鞴","𬇙"],yù:["俼","儥","喅","喩","喻","域","堉","妪","嫗","寓","峪","嶎","庽","彧","御","愈","慾","戫","昱","棛","棜","棫","櫲","欎","欝","欲","毓","浴","淯","滪","潏","澦","灪","焴","煜","燏","燠","爩","狱","獄","玉","琙","瘉","癒","砡","硢","硲","礇","礖","礜","禦","秗","稢","稶","篽","籞","籲","粖","緎","罭","聿","肀","艈","芋","芌","茟","蒮","蓣","蓹","蕷","蘌","蜟","蜮","袬","裕","誉","諭","譽","谕","豫","軉","輍","逳","遇","遹","郁","醧","鈺","鋊","錥","鐭","钰","閾","阈","雤","霱","預","预","飫","饇","饫","馭","驈","驭","鬰","鬱","鬻","魊","鱊","鳿","鴥","鴧","鴪","鵒","鷸","鸒","鹆","鹬"],xīn:["俽","噺","妡","嬜","廞","心","忄","忻","惞","新","昕","杺","欣","歆","炘","盺","薪","訢","辛","邤","鈊","鋅","鑫","锌","馨","馫","䜣","𫷷"],"hǔ chí":["俿"],jiù:["倃","僦","匓","匛","匶","厩","咎","就","廄","廏","廐","慦","捄","救","旧","柩","柾","桕","欍","殧","疚","臼","舅","舊","鯦","鷲","鹫","麔","齨","㠇"],yáo:["倄","傜","嗂","垚","堯","姚","媱","尧","尭","峣","嶢","嶤","徭","揺","搖","摇","摿","暚","榣","烑","爻","猺","珧","瑤","瑶","磘","窑","窯","窰","肴","蘨","謠","謡","谣","軺","轺","遙","遥","邎","顤","颻","飖","餆","餚","鰩","鱙","鳐"],"cuì zú":["倅"],"liǎng liǎ":["倆"],wǎn:["倇","唍","婉","惋","挽","晚","晥","晩","晼","梚","椀","琬","畹","皖","盌","碗","綩","綰","绾","脘","萖","踠","輓","鋔"],zǒng:["倊","偬","傯","嵸","总","惣","捴","搃","摠","燪","総","緫","縂","總","蓗"],guān:["倌","关","官","棺","瘝","癏","窤","蒄","関","闗","關","鰥","鱞","鳏"],tiǎn:["倎","唺","忝","悿","晪","殄","淟","睓","腆","舔","覥","觍","賟","錪","餂"],mén:["們","扪","捫","璊","菛","虋","鍆","钔","門","閅","门","𫞩"],"dǎo dào":["倒"],"tán tàn":["倓","埮"],"juè jué":["倔"],chuí:["倕","垂","埀","捶","搥","桘","棰","槌","箠","腄","菙","錘","鎚","锤","陲","顀"],xìng:["倖","姓","婞","嬹","幸","性","悻","杏","涬","緈","臖","荇","莕","葕"],péng:["倗","傰","塜","塳","弸","憉","捀","朋","棚","椖","樥","硼","稝","竼","篷","纄","膨","芃","蓬","蘕","蟚","蟛","袶","輣","錋","鑝","韸","韼","騯","髼","鬅","鬔","鵬","鹏"],"tǎng cháng":["倘"],hòu:["候","厚","后","垕","堠","後","洉","茩","豞","逅","郈","鮜","鱟","鲎","鲘"],tì:["倜","剃","嚏","嚔","屉","屜","悌","悐","惕","惖","戻","掦","替","朑","歒","殢","涕","瓋","笹","籊","薙","褅","逖","逷","髰","鬀","鬄"],gàn:["倝","凎","幹","榦","檊","淦","灨","盰","紺","绀","詌","贑","赣","骭","㽏"],"liàng jìng":["倞","靓"],suī:["倠","哸","夊","滖","濉","眭","睢","芕","荽","荾","虽","雖","鞖"],"chàng chāng":["倡"],jié:["倢","偼","傑","刦","刧","刼","劫","劼","卩","卪","婕","媫","孑","岊","崨","嵥","嶻","巀","幯","截","捷","掶","擮","昅","杢","杰","桀","桝","楬","楶","榤","洁","滐","潔","狤","睫","礍","竭","節","羯","莭","蓵","蛣","蜐","蠘","蠞","蠽","衱","袺","訐","詰","誱","讦","踕","迼","鉣","鍻","镼","頡","鮚","鲒","㛃"],"kǒng kōng":["倥"],juàn:["倦","劵","奆","慻","桊","淃","狷","獧","眷","睊","睠","絭","絹","绢","罥","羂","腃","蔨","鄄","餋"],zōng:["倧","堫","宗","嵏","嵕","惾","朡","棕","椶","熧","猣","磫","緃","翪","腙","葼","蝬","豵","踨","踪","蹤","鍐","鑁","騌","騣","骔","鬃","鬉","鬷","鯮","鯼"],ní:["倪","坭","埿","尼","屔","怩","淣","猊","籾","聣","蚭","蜺","觬","貎","跜","輗","郳","鈮","铌","霓","馜","鯢","鲵","麑","齯","𫐐","𫠜"],zhuō:["倬","拙","捉","桌","梲","棁","棳","槕","涿","窧","鐯","䦃"],"wō wēi":["倭"],luǒ:["倮","剆","曪","瘰","癳","臝","蓏","蠃","裸","躶"],sōng:["倯","凇","娀","崧","嵩","庺","憽","松","枀","枩","柗","梥","檧","淞","濍","硹","菘","鬆"],lèng:["倰","堎","愣","睖","踜"],zì:["倳","剚","字","恣","渍","漬","牸","眥","眦","胔","胾","自","茡","荢"],bèn:["倴","坌","捹","撪","渀","笨","逩"],cǎi:["倸","啋","婇","彩","採","棌","毝","睬","綵","跴","踩"],zhài:["债","債","寨","瘵","砦"],yē:["倻","吔","噎","擨","暍","椰","歋","潱","蠮"],shà:["倽","唼","喢","歃","箑","翜","翣","萐","閯","霎"],qīng:["倾","傾","卿","圊","寈","氢","氫","淸","清","蜻","軽","輕","轻","郬","錆","鑋","靑","青","鯖"],yīng:["偀","嘤","噟","嚶","婴","媖","嫈","嬰","孆","孾","愥","撄","攖","朠","桜","樱","櫻","渶","煐","珱","瑛","璎","瓔","甇","甖","碤","礯","緓","纓","绬","缨","罂","罃","罌","膺","英","莺","蘡","蝧","蠳","褮","譻","賏","軈","鑍","锳","霙","韺","鴬","鶑","鶧","鶯","鷪","鷹","鸎","鸚","鹦","鹰","䓨"],"chēng chèn":["偁","爯"],ruǎn:["偄","朊","瑌","瓀","碝","礝","腝","軟","輭","软","阮"],"zhòng tóng":["偅"],chǔn:["偆","惷","睶","萶","蠢","賰"],"jiǎ jià":["假"],"jì jié":["偈"],"bǐng bìng":["偋"],ruò:["偌","叒","嵶","弱","楉","焫","爇","箬","篛","蒻","鄀","鰙","鰯","鶸"],tí:["偍","厗","啼","嗁","崹","漽","瑅","睼","禵","稊","緹","缇","罤","蕛","褆","謕","趧","蹄","蹏","醍","鍗","題","题","騠","鮷","鯷","鳀","鵜","鷤","鹈","𫘨"],wēi:["偎","危","喴","威","媙","嶶","巍","微","愄","揋","揻","椳","楲","溦","烓","煨","燰","癓","縅","葨","葳","薇","蜲","蝛","覣","詴","逶","隇","隈","霺","鰃","鰄","鳂"],piān:["偏","囨","媥","楄","犏","篇","翩","鍂"],yàn:["偐","厌","厭","唁","喭","嚈","嚥","堰","妟","姲","嬊","嬿","宴","彥","彦","敥","晏","暥","曕","曣","滟","灎","灔","灧","灩","焔","焰","焱","熖","燄","牪","猒","砚","硯","艳","艶","艷","覎","觃","觾","諺","讌","讞","谚","谳","豓","豔","贋","贗","赝","軅","酀","酽","醼","釅","雁","餍","饜","騐","験","騴","驗","驠","验","鬳","鳫","鴈","鴳","鷃","鷰","齞"],"tǎng dàng":["偒"],è:["偔","匎","卾","厄","呝","咢","噩","垩","堊","堮","岋","崿","廅","悪","愕","戹","扼","搤","搹","擜","櫮","歞","歺","湂","琧","砈","砐","硆","腭","苊","萼","蕚","蚅","蝁","覨","諤","讍","谔","豟","軛","軶","轭","遌","遏","遻","鄂","鈪","鍔","鑩","锷","阨","阸","頞","顎","颚","餓","餩","饿","鰐","鰪","鱷","鳄","鶚","鹗","齃","齶","𫫇","𥔲"],xié:["偕","勰","协","協","嗋","垥","奊","恊","愶","拹","携","撷","擕","擷","攜","斜","旪","熁","燲","綊","緳","縀","缬","翓","胁","脅","脇","脋","膎","蝢","衺","襭","諧","讗","谐","鞋","鞵","龤","㙦"],chě:["偖","扯","撦"],shěng:["偗","渻","眚"],chā:["偛","嗏","扠","挿","插","揷","疀","臿","艖","銟","鍤","锸","餷"],huáng:["偟","凰","喤","堭","墴","媓","崲","徨","惶","楻","湟","煌","獚","瑝","璜","癀","皇","磺","穔","篁","簧","艎","葟","蝗","蟥","諻","趪","遑","鍠","鐄","锽","隍","韹","餭","騜","鰉","鱑","鳇","鷬","黃","黄","𨱑"],yǎo:["偠","咬","婹","宎","岆","杳","柼","榚","溔","狕","窅","窈","舀","苭","闄","騕","鷕","齩"],"chǒu qiào":["偢"],yóu:["偤","尤","庮","怣","沋","油","浟","游","犹","猶","猷","由","疣","秞","肬","莜","莸","蕕","蚰","蝣","訧","輏","輶","逰","遊","邮","郵","鈾","铀","駀","魷","鮋","鱿","鲉","𬨎"],xū:["偦","墟","媭","嬃","楈","欨","歔","燸","疞","盱","綇","縃","繻","胥","蕦","虗","虚","虛","蝑","裇","訏","許","諝","譃","谞","鑐","需","須","须","顼","驉","鬚","魆","魖","𬣙","𦈡"],zhā:["偧","哳","抯","挓","揸","摣","樝","渣","皶","觰","譇","齄","齇"],cī:["偨","疵","蠀","趀","骴","髊","齹"],bī:["偪","屄","楅","毴","豍","逼","鰏","鲾","鵖"],xún:["偱","噚","寻","尋","峋","巡","廵","循","恂","揗","攳","旬","杊","栒","桪","樳","洵","浔","潯","燅","燖","珣","璕","畃","紃","荀","蟳","詢","询","鄩","鱏","鱘","鲟","𬘓","𬩽","𬍤","𬊈"],"cāi sī":["偲"],duān:["偳","媏","端","褍","鍴"],ǒu:["偶","吘","嘔","耦","腢","蕅","藕","𬉼","𠙶"],tōu:["偷","偸","鍮"],"zán zá zǎ":["偺"],"lǚ lóu":["偻","僂"],fèn:["偾","僨","奋","奮","弅","忿","愤","憤","瀵","瞓","秎","粪","糞","膹","鱝","鲼"],"kuǐ guī":["傀"],sǒu:["傁","叜","叟","嗾","櫢","瞍","薮","藪"],"zhì sī tí":["傂"],sù:["傃","僳","嗉","塐","塑","夙","嫊","愫","憟","榡","樎","樕","殐","泝","涑","溯","溸","潚","潥","玊","珟","璛","簌","粛","粟","素","縤","肃","肅","膆","蔌","藗","觫","訴","謖","诉","谡","趚","蹜","速","遡","遬","鋉","餗","驌","骕","鱐","鷫","鹔","𫗧"],xiā:["傄","煆","瞎","虲","谺","颬","鰕"],"yuàn yuán":["傆","媛"],rǒng:["傇","冗","宂","氄","軵"],nù:["傉","怒"],yùn:["傊","孕","恽","惲","愠","慍","枟","腪","蕴","薀","藴","蘊","褞","貟","运","運","郓","鄆","酝","醖","醞","韗","韞","韵","韻","餫"],"gòu jiǎng":["傋"],mà:["傌","嘜","榪","睰","祃","禡","罵","閁","駡","骂","鬕"],bàng:["傍","塝","棒","玤","稖","艕","蒡","蜯","謗","谤","鎊","镑"],diān:["傎","厧","嵮","巅","巓","巔","掂","攧","敁","槇","滇","癫","癲","蹎","顚","顛","颠","齻"],táng:["傏","唐","啺","坣","堂","塘","搪","棠","榶","溏","漟","煻","瑭","磄","禟","篖","糃","糖","糛","膅","膛","蓎","螗","螳","赯","踼","鄌","醣","鎕","隚","餹","饄","鶶","䣘"],hào:["傐","哠","恏","昊","昦","晧","暠","暤","暭","曍","浩","淏","澔","灏","灝","皓","皜","皞","皡","皥","耗","聕","薃","號","鄗","顥","颢","鰝"],"xī xì":["傒"],shān:["傓","删","刪","剼","圸","山","挻","搧","柵","檆","潸","澘","煽","狦","珊","笘","縿","羴","羶","脠","舢","芟","衫","跚","軕","邖","閊","鯅"],"qiàn jiān":["傔"],"què jué":["傕","埆"],"cāng chen":["傖"],róng:["傛","媶","嫆","嬫","容","峵","嵘","嶸","戎","搈","曧","栄","榕","榮","榵","毧","溶","瀜","烿","熔","狨","瑢","穁","絨","绒","羢","肜","茙","茸","荣","蓉","蝾","融","螎","蠑","褣","鎔","镕","駥"],"tà tàn":["傝"],suō:["傞","唆","嗍","嗦","娑","摍","桫","梭","睃","簑","簔","羧","莏","蓑","趖","鮻"],dǎi:["傣","歹"],zài:["傤","儎","再","在","扗","洅","載","酨"],gǔ:["傦","古","啒","尳","愲","榖","榾","汩","淈","濲","瀔","牯","皷","皼","盬","瞽","穀","罟","羖","股","脵","臌","薣","蛊","蠱","詁","诂","轂","逧","鈷","钴","餶","馉","鼓","鼔","𦙶"],bīn:["傧","宾","彬","斌","椕","滨","濒","濱","濵","瀕","繽","缤","虨","豩","豳","賓","賔","邠","鑌","镔","霦","顮"],chǔ:["储","儲","杵","椘","楚","楮","檚","濋","璴","础","礎","禇","處","齭","齼","𬺓"],nuó:["傩","儺","挪","梛","橠"],"cān càn":["傪"],lěi:["傫","儡","厽","垒","塁","壘","壨","櫐","灅","癗","矋","磊","礨","耒","蕌","蕾","藟","蘽","蠝","誄","讄","诔","鑸","鸓"],cuī:["催","凗","墔","崔","嵟","慛","摧","榱","獕","磪","鏙"],yōng:["傭","嗈","墉","壅","嫞","庸","廱","慵","拥","擁","滽","灉","牅","痈","癕","癰","臃","邕","郺","鄘","鏞","镛","雍","雝","饔","鱅","鳙","鷛"],"zāo cáo":["傮"],sǒng:["傱","嵷","怂","悚","愯","慫","竦","耸","聳","駷","㧐"],ào:["傲","坳","垇","墺","奡","嫯","岙","岰","嶴","懊","擙","澳","鏊","驁","骜"],"qī còu":["傶"],chuǎng:["傸","磢","闖","闯"],shǎ:["傻","儍"],hàn:["傼","垾","悍","憾","扞","捍","撖","撼","旱","晘","暵","汉","涆","漢","瀚","焊","猂","皔","睅","翰","莟","菡","蛿","蜭","螒","譀","輚","釬","銲","鋎","雗","頷","顄","颔","駻","鶾"],zhāng:["傽","嫜","张","張","彰","慞","暲","樟","漳","獐","璋","章","粻","蔁","蟑","遧","鄣","鏱","餦","騿","鱆","麞"],"yān yàn":["傿","墕","嬮"],"piào biāo":["僄","骠"],liàn:["僆","堜","媡","恋","戀","楝","殓","殮","湅","潋","澰","瀲","炼","煉","瑓","練","纞","练","萰","錬","鍊","鏈","链","鰊","𬶠"],màn:["㵘","僈","墁","幔","慢","曼","漫","澷","熳","獌","縵","缦","蔄","蘰","鄤","鏝","镘","𬜬"],"tàn tǎn":["僋"],yíng:["僌","営","塋","嬴","攍","楹","櫿","溁","溋","滢","潆","濙","濚","濴","瀅","瀛","瀠","瀯","灐","灜","熒","營","瑩","盁","盈","禜","籝","籯","縈","茔","荧","莹","萤","营","萦","萾","蓥","藀","蛍","蝇","蝿","螢","蠅","謍","贏","赢","迎","鎣"],dòng:["働","冻","凍","动","動","姛","戙","挏","栋","棟","湩","硐","胨","胴","腖","迵","霘","駧"],zhuàn:["僎","啭","囀","堟","撰","灷","瑑","篆","腞","蒃","襈","譔","饌","馔"],xiàng:["像","勨","向","嚮","姠","嶑","曏","橡","珦","缿","蟓","衖","襐","象","鐌","項","项","鱌"],shàn:["僐","善","墠","墡","嬗","擅","敾","椫","樿","歚","汕","灗","疝","磰","繕","缮","膳","蟮","蟺","訕","謆","譱","讪","贍","赡","赸","鄯","鐥","饍","騸","骟","鱓","鱔","鳝","𫮃"],"tuí tuǐ":["僓"],zǔn:["僔","噂","撙","譐"],pú:["僕","匍","圤","墣","濮","獛","璞","瞨","穙","莆","菐","菩","葡","蒱","蒲","贌","酺","鏷","镤"],láo:["僗","劳","労","勞","哰","崂","嶗","憥","朥","浶","牢","痨","癆","窂","簩","醪","鐒","铹","顟","髝","𫭼"],chǎng:["僘","厰","廠","敞","昶","氅","鋹","𬬮"],guāng:["僙","光","咣","垙","姯","洸","灮","炗","炚","炛","烡","珖","胱","茪","輄","銧","黆","𨐈"],liáo:["僚","嘹","嫽","寥","寮","尞","屪","嵺","嶚","嶛","廫","憀","敹","暸","橑","獠","璙","疗","療","竂","簝","繚","缭","聊","膋","膫","藔","蟟","豂","賿","蹘","辽","遼","飉","髎","鷯","鹩"],dèng:["僜","凳","墱","嶝","櫈","瞪","磴","覴","邓","鄧","隥"],"chán zhàn zhuàn":["僝"],bō:["僠","嶓","拨","撥","播","波","溊","玻","癶","盋","砵","碆","礡","缽","菠","袰","蹳","鉢","钵","餑","饽","驋","鱍","𬭛"],huì:["僡","匯","卉","喙","嘒","嚖","圚","嬒","寭","屶","屷","彗","彙","彚","徻","恚","恵","惠","慧","憓","懳","晦","暳","槥","橞","檅","櫘","汇","泋","滙","潓","烩","燴","獩","璤","瞺","硊","秽","穢","篲","絵","繪","绘","翙","翽","荟","蔧","蕙","薈","薉","蟪","詯","誨","諱","譓","譿","讳","诲","賄","贿","鐬","闠","阓","靧","頮","顪","颒","餯","𬤝","𬭬"],chuǎn:["僢","喘","舛","荈","踳"],"tiě jiàn":["僣"],sēng:["僧","鬙"],xiàn:["僩","僴","哯","垷","塪","姭","娊","宪","岘","峴","憲","撊","晛","橌","橺","涀","瀗","献","獻","现","現","県","睍","粯","糮","絤","綫","線","线","缐","羡","羨","腺","臔","臽","苋","莧","誢","豏","鋧","錎","限","陥","陷","霰","餡","馅","麲","鼸","𬀪","𪾢"],"yù jú":["僪"],"è wū":["僫"],"tóng zhuàng":["僮"],lǐn:["僯","凛","凜","廩","廪","懍","懔","撛","檁","檩","澟","癛","癝"],gù:["僱","凅","固","堌","崓","崮","故","梏","棝","牿","痼","祻","錮","锢","雇","顧","顾","鯝","鲴"],jiāng:["僵","壃","姜","橿","殭","江","畕","疅","礓","繮","缰","翞","茳","葁","薑","螀","螿","豇","韁","鱂","鳉"],mǐn:["僶","冺","刡","勄","悯","惽","愍","慜","憫","抿","敃","敏","敯","泯","潣","皿","笢","笽","簢","蠠","閔","閩","闵","闽","鰵","鳘","黽"],jìn:["僸","凚","噤","嚍","墐","壗","妗","嬧","搢","晉","晋","枃","殣","浕","浸","溍","濅","濜","烬","煡","燼","琎","瑨","璶","盡","祲","縉","缙","荩","藎","覲","觐","賮","贐","赆","近","进","進","靳","齽"],"jià jie":["價"],qiào:["僺","峭","帩","撬","殻","窍","竅","誚","诮","躈","陗","鞩","韒","髚"],pì:["僻","媲","嫓","屁","澼","甓","疈","譬","闢","鷿","鸊","䴙"],sài:["僿","簺","賽","赛"],"chán tǎn shàn":["儃"],"dāng dàng":["儅","当","闣"],xuān:["儇","喧","塇","媗","宣","愃","愋","揎","昍","暄","煊","煖","瑄","睻","矎","禤","箮","翧","翾","萱","萲","蓒","蕿","藼","蘐","蝖","蠉","諠","諼","譞","谖","軒","轩","鍹","駽","鰚","𫓶","𫍽"],"dān dàn":["儋","擔","瘅"],càn:["儏","澯","灿","燦","璨","粲","薒","謲"],"bīn bìn":["儐"],"án àn":["儑"],tái:["儓","坮","嬯","抬","擡","檯","炱","炲","籉","臺","薹","跆","邰","颱","鮐","鲐"],lán:["儖","兰","囒","婪","岚","嵐","幱","拦","攔","斓","斕","栏","欄","欗","澜","瀾","灆","灡","燣","燷","璼","篮","籃","籣","繿","葻","蓝","藍","蘫","蘭","褴","襕","襤","襴","襽","譋","讕","谰","躝","鑭","镧","闌","阑","韊","𬒗"],"nǐ yì ài yí":["儗"],méng:["儚","幪","曚","朦","橗","檬","氋","溕","濛","甍","甿","盟","礞","艨","莔","萌","蕄","虻","蝱","鄳","鄸","霿","靀","顭","饛","鯍","鸏","鹲","𫑡","㠓"],níng:["儜","凝","咛","嚀","嬣","柠","橣","檸","狞","獰","聍","聹","薴","鑏","鬡","鸋"],qióng:["儝","卭","宆","惸","憌","桏","橩","焪","焭","煢","熍","琼","瓊","睘","穷","穹","窮","竆","笻","筇","舼","茕","藑","藭","蛩","蛬","赹","跫","邛","銎","䓖"],liè:["儠","冽","列","劣","劽","埒","埓","姴","峛","巤","挒","捩","栵","洌","浖","烈","烮","煭","犣","猎","猟","獵","聗","脟","茢","蛚","趔","躐","迾","颲","鬛","鬣","鮤","鱲","鴷","䴕","𫚭"],kuǎng:["儣","夼","懭"],bào:["儤","勽","報","忁","报","抱","曓","爆","犦","菢","虣","蚫","豹","鉋","鑤","铇","骲","髱","鮑","鲍"],biāo:["儦","墂","幖","彪","标","標","滮","瀌","熛","爂","猋","瘭","磦","膘","臕","謤","贆","鏢","鑣","镖","镳","颮","颷","飆","飇","飈","飊","飑","飙","飚","驫","骉","髟"],zǎn:["儧","儹","噆","攅","昝","趱","趲"],háo:["儫","嗥","嘷","噑","嚎","壕","椃","毜","毫","濠","獆","獔","竓","籇","蚝","蠔","譹","豪"],qìng:["儬","凊","庆","慶","櫦","濪","碃","磬","罄","靘"],chèn:["儭","嚫","榇","櫬","疢","衬","襯","讖","谶","趁","趂","齓","齔","龀"],téng:["儯","幐","滕","漛","疼","籐","籘","縢","腾","藤","虅","螣","誊","謄","邆","駦","騰","驣","鰧","䲢"],"lǒng lóng lòng":["儱"],"chán chàn":["儳"],"ráng xiāng":["儴","勷"],"huì xié":["儶"],luó:["儸","攞","椤","欏","猡","玀","箩","籮","罗","羅","脶","腡","萝","蘿","螺","覼","逻","邏","鏍","鑼","锣","镙","饠","騾","驘","骡","鸁"],léi:["儽","嫘","檑","欙","瓃","畾","縲","纍","纝","缧","罍","羸","蔂","蘲","虆","轠","鐳","鑘","镭","雷","靁","鱩","鼺"],"nàng nāng":["儾"],"wù wū":["兀"],yǔn:["允","喗","夽","抎","殒","殞","狁","磒","荺","賱","鈗","阭","陨","隕","霣","馻","齫","齳"],zān:["兂","橵","簪","簮","糌","鐕","鐟","鵤"],yuán:["元","円","原","厡","厵","园","圆","圎","園","圓","垣","塬","媴","嫄","援","榞","榬","橼","櫞","沅","湲","源","溒","爰","猨","猿","笎","緣","縁","缘","羱","茒","薗","蝝","蝯","螈","袁","褤","謜","轅","辕","邍","邧","酛","鈨","鎱","騵","魭","鶢","鶰","黿","鼋","𫘪"],xiōng:["兄","兇","凶","匂","匈","哅","忷","恟","汹","洶","胷","胸","芎","訩","詾","讻"],chōng:["充","嘃","忡","憃","憧","摏","沖","浺","珫","罿","翀","舂","艟","茺","衝","蹖","㳘"],zhào:["兆","垗","旐","曌","枛","櫂","照","燳","狣","瞾","笊","罀","罩","羄","肁","肇","肈","詔","诏","赵","趙","鮡","𬶐"],"duì ruì yuè":["兊","兌","兑"],kè:["克","刻","勀","勊","堁","娔","客","恪","愙","氪","溘","碦","緙","缂","艐","衉","課","课","錁","锞","騍","骒"],tù:["兎","兔","堍","迌","鵵"],dǎng:["党","攩","欓","譡","讜","谠","黨","𣗋"],dōu:["兜","兠","唗","橷","篼","蔸"],huǎng:["兤","奛","幌","怳","恍","晄","炾","熀","縨","詤","謊","谎"],rù:["入","嗕","媷","扖","杁","洳","溽","縟","缛","蓐","褥","鳰"],nèi:["內","氝","氞","錗"],"yú shù":["兪"],"liù lù":["六"],han:["兯","爳"],tiān:["兲","天","婖","添","酟","靔","靝","黇"],"xīng xìng":["兴"],diǎn:["典","嚸","奌","婰","敟","椣","点","碘","蒧","蕇","踮","點"],"zī cí":["兹"],jiān:["兼","冿","囏","坚","堅","奸","姦","姧","尖","幵","惤","戋","戔","搛","椾","樫","櫼","歼","殱","殲","湔","瀐","瀸","煎","熞","熸","牋","瑊","睷","礛","礷","笺","箋","緘","縑","缄","缣","肩","艰","艱","菅","菺","葌","蒹","蔪","蕑","蕳","虃","譼","豜","鑯","雃","鞯","韀","韉","餰","馢","鰔","鰜","鰹","鲣","鳒","鵑","鵳","鶼","鹣","麉"],shòu:["兽","受","售","壽","夀","寿","授","狩","獣","獸","痩","瘦","綬","绶","膄"],jì:["兾","冀","剂","剤","劑","勣","坖","垍","塈","妓","季","寂","寄","廭","彑","徛","忌","悸","惎","懻","技","旡","既","旣","暨","暩","曁","梞","檕","檵","洎","漃","漈","瀱","痵","癠","禝","稩","稷","穄","穊","穧","紀","継","績","繋","繼","继","绩","罽","臮","芰","茍","茤","葪","蓟","蔇","薊","蘎","蘮","蘻","裚","襀","覬","觊","計","記","誋","计","记","跡","跽","蹟","迹","际","際","霁","霽","驥","骥","髻","鬾","魝","魥","鯚","鯽","鰶","鰿","鱀","鱭","鲚","鲫","鵋","鷑","齌","𪟝","𬶨","𬶭"],jiōng:["冂","冋","坰","埛","扃","蘏","蘔","駉","駫","𬳶"],mào:["冃","冐","媢","帽","愗","懋","暓","柕","楙","毷","瑁","皃","眊","瞀","耄","茂","萺","蝐","袤","覒","貌","貿","贸","鄚","鄮"],rǎn:["冄","冉","姌","媣","染","珃","苒","蒅","䎃"],"nèi nà":["内"],gāng:["冈","冮","刚","剛","堈","堽","岡","掆","摃","棡","牨","犅","疘","綱","纲","缸","罁","罡","肛","釭","鎠","㭎"],cè:["冊","册","厕","厠","夨","廁","恻","惻","憡","敇","测","測","笧","策","筞","筴","箣","荝","萗","萴","蓛"],guǎ:["冎","剐","剮","叧","寡"],"mào mò":["冒"],gòu:["冓","啂","坸","垢","够","夠","媾","彀","搆","撀","构","構","煹","覯","觏","訽","詬","诟","購","购","遘","雊"],xǔ:["冔","喣","暊","栩","珝","盨","糈","詡","諿","诩","鄦","醑"],mì:["冖","冪","嘧","塓","宻","密","峚","幂","幎","幦","怽","榓","樒","櫁","汨","淧","滵","漞","濗","熐","羃","蔤","蜜","覓","覔","覛","觅","謐","谧","鼏"],"yóu yín":["冘"],xiě:["写","冩","藛"],jūn:["军","君","均","桾","汮","皲","皸","皹","碅","莙","蚐","袀","覠","軍","鈞","銁","銞","鍕","钧","頵","鮶","鲪","麏"],mí:["冞","擟","瀰","爢","猕","獼","祢","禰","縻","蒾","藌","蘪","蘼","袮","詸","謎","迷","醚","醾","醿","釄","镾","鸍","麊","麋","麛"],"guān guàn":["冠","覌","観","觀","观"],měng:["冡","勐","懵","掹","猛","獴","艋","蜢","蠓","錳","锰","鯭","鼆"],zhǒng:["冢","塚","尰","歱","煄","瘇","肿","腫","踵"],zuì:["冣","嶵","晬","最","栬","槜","檇","檌","祽","絊","罪","蕞","辠","酔","酻","醉","錊"],yuān:["冤","剈","囦","嬽","寃","棩","淵","渁","渆","渊","渕","灁","眢","肙","葾","蒬","蜎","蜵","駌","鳶","鴛","鵷","鸢","鸳","鹓","鼘","鼝"],míng:["冥","名","明","暝","朙","榠","洺","溟","猽","眀","眳","瞑","茗","螟","覭","詺","鄍","銘","铭","鳴","鸣"],kòu:["冦","叩","宼","寇","扣","敂","滱","窛","筘","簆","蔲","蔻","釦","鷇"],tài:["冭","太","夳","忲","态","態","汰","汱","泰","溙","肽","舦","酞","鈦","钛"],"féng píng":["冯","馮"],"chōng chòng":["冲"],kuàng:["况","圹","壙","岲","懬","旷","昿","曠","框","況","爌","眖","眶","矿","砿","礦","穬","絋","絖","纊","纩","貺","贶","軦","邝","鄺","鉱","鋛","鑛","黋"],lěng:["冷"],pàn:["冸","判","叛","沜","泮","溿","炍","牉","畔","盼","聁","袢","襻","詊","鋬","鑻","頖","鵥"],fā:["冹","彂","沷","発","發"],xiǎn:["冼","尟","尠","崄","嶮","幰","攇","显","櫶","毨","灦","烍","燹","狝","猃","獫","獮","玁","禒","筅","箲","藓","蘚","蚬","蜆","譣","赻","跣","鍌","险","険","險","韅","顕","顯","㬎"],qià:["冾","圶","帢","恰","殎","洽","硈","胢","髂"],"jìng chēng":["净","凈","淨"],sōu:["凁","嗖","廀","廋","捜","搜","摉","溲","獀","艘","蒐","螋","鄋","醙","鎪","锼","颼","飕","餿","馊","騪"],měi:["凂","媄","媺","嬍","嵄","挴","毎","每","浼","渼","燘","美","躾","鎂","镁","黣"],tú:["凃","図","图","圖","圗","塗","屠","峹","嵞","庩","廜","徒","悇","揬","涂","瘏","筡","腯","荼","蒤","跿","途","酴","鈯","鍎","馟","駼","鵌","鶟","鷋","鷵","𬳿"],zhǔn:["准","凖","埻","準","𬘯"],"liáng liàng":["凉","涼","量"],diāo:["凋","刁","刟","叼","奝","弴","彫","汈","琱","碉","簓","虭","蛁","貂","錭","雕","鮉","鯛","鲷","鵰","鼦"],còu:["凑","湊","腠","輳","辏"],ái:["凒","啀","嘊","捱","溰","癌","皑","皚"],duó:["凙","剫","夺","奪","痥","踱","鈬","鐸","铎"],dú:["凟","匵","嬻","椟","櫝","殰","涜","牍","牘","犊","犢","独","獨","瓄","皾","裻","読","讀","讟","豄","贕","錖","鑟","韇","韣","韥","騳","髑","黩","黷"],"jǐ jī":["几"],fán:["凡","凢","凣","匥","墦","杋","柉","棥","樊","瀿","烦","煩","燔","璠","矾","礬","笲","籵","緐","羳","舤","舧","薠","蘩","蠜","襎","蹯","釩","鐇","鐢","钒","鷭","𫔍","𬸪"],jū:["凥","匊","娵","婮","居","崌","抅","挶","掬","梮","椐","檋","毩","毱","泃","涺","狙","琚","疽","砠","罝","腒","艍","蜛","裾","諊","跔","踘","躹","陱","雎","鞠","鞫","駒","驹","鮈","鴡","鶋","𬶋"],"chù chǔ":["処","处"],zhǐ:["凪","劧","咫","址","坧","帋","恉","扺","指","旨","枳","止","汦","沚","洔","淽","疻","砋","祉","秖","紙","纸","芷","藢","衹","襧","訨","趾","軹","轵","酯","阯","黹"],píng:["凭","凴","呯","坪","塀","岼","帡","帲","幈","平","慿","憑","枰","洴","焩","玶","瓶","甁","竮","箳","簈","缾","荓","萍","蓱","蚲","蛢","評","评","軿","輧","郱","鮃","鲆"],kǎi:["凯","凱","剀","剴","垲","塏","恺","愷","慨","暟","蒈","輆","鍇","鎧","铠","锴","闓","闿","颽"],gān:["凲","坩","尲","尴","尶","尷","柑","泔","漧","玕","甘","疳","矸","竿","筸","粓","肝","苷","迀","酐","魐"],"kǎn qiǎn":["凵"],tū:["凸","堗","嶀","捸","涋","湥","痜","禿","秃","突","葖","鋵","鵚","鼵","㻬"],"āo wā":["凹"],chū:["出","初","岀","摴","榋","樗","貙","齣","䢺","䝙"],dàng:["凼","圵","垱","壋","档","檔","氹","璗","瓽","盪","瞊","砀","碭","礑","簜","荡","菪","蕩","蘯","趤","逿","雼","𬍡"],hán:["函","凾","含","圅","娢","寒","崡","晗","梒","浛","涵","澏","焓","琀","甝","筨","蜬","邗","邯","鋡","韓","韩"],záo:["凿","鑿"],dāo:["刀","刂","忉","氘","舠","螩","釖","魛","鱽"],chuāng:["刅","摐","牎","牕","疮","瘡","窓","窗","窻"],"fēn fèn":["分"],"qiè qiē":["切"],kān:["刊","勘","堪","戡","栞","龕","龛"],cǔn:["刌","忖"],chú:["刍","厨","幮","廚","橱","櫉","櫥","滁","犓","篨","耡","芻","蒢","蒭","蜍","蟵","豠","趎","蹰","躇","躕","鉏","鋤","锄","除","雏","雛","鶵"],"huà huá":["划"],lí:["刕","剓","剺","劙","厘","喱","嚟","囄","嫠","孷","廲","悡","梨","梸","棃","漓","灕","犁","犂","狸","琍","璃","瓈","盠","睝","离","穲","竰","筣","篱","籬","糎","縭","缡","罹","艃","荲","菞","蓠","蔾","藜","蘺","蜊","蟍","蟸","蠫","褵","謧","貍","醨","鋫","錅","鏫","鑗","離","驪","骊","鯏","鯬","鱺","鲡","鵹","鸝","鹂","黎","黧","㰀"],yuè:["刖","嬳","岄","岳","嶽","恱","悅","悦","戉","抈","捳","月","樾","瀹","爚","玥","礿","禴","篗","籆","籥","籰","粤","粵","蘥","蚎","蚏","説","越","跀","跃","躍","軏","鈅","鉞","鑰","钺","閱","閲","阅","鸑","鸙","黦","龠","𫐄","𬸚"],liú:["刘","劉","嚠","媹","嵧","旈","旒","榴","橊","流","浏","瀏","琉","瑠","瑬","璢","畄","留","畱","疁","瘤","癅","硫","蒥","蓅","蟉","裗","鎏","鏐","鐂","镠","飀","飅","飗","駠","駵","騮","驑","骝","鰡","鶹","鹠","麍"],zé:["则","則","啧","嘖","嫧","帻","幘","択","樍","歵","沢","泎","溭","皟","瞔","矠","礋","箦","簀","舴","蔶","蠌","襗","謮","賾","赜","迮","鸅","齚","齰"],"chuàng chuāng":["创","創"],qù:["刞","厺","去","閴","闃","阒","麮","鼁"],"bié biè":["別","别"],"páo bào":["刨"],"chǎn chàn":["刬","剗","幝"],guā:["刮","劀","桰","歄","煱","瓜","胍","踻","颪","颳","騧","鴰","鸹"],gēng:["刯","庚","椩","浭","焿","畊","絚","羮","羹","耕","菮","賡","赓","鶊","鹒"],dào:["到","噵","悼","椡","檤","燾","瓙","盗","盜","稲","稻","纛","翿","艔","菿","衜","衟","軇","道"],chuàng:["刱","剏","剙","怆","愴"],kū:["刳","哭","圐","堀","枯","桍","矻","窟","跍","郀","骷","鮬"],duò:["刴","剁","墯","尮","惰","憜","挅","桗","舵","跥","跺","陊","陏","飿","饳","鵽"],"shuā shuà":["刷"],"quàn xuàn":["券"],"chà shā":["刹","剎"],"cì cī":["刺"],guì:["刽","刿","劊","劌","撌","攰","昋","桂","椢","槶","樻","櫃","猤","禬","筀","蓕","襘","貴","贵","跪","鐀","鑎","鞼","鱖","鱥"],lóu:["剅","娄","婁","廔","楼","樓","溇","漊","熡","耧","耬","艛","蒌","蔞","蝼","螻","謱","軁","遱","鞻","髅","髏","𪣻"],cuò:["剉","剒","厝","夎","挫","措","棤","莝","莡","蓌","逪","銼","錯","锉","错"],"xiāo xuē":["削"],"kēi kè":["剋","尅"],"là lá":["剌"],tī:["剔","梯","踢","銻","锑","鷈","鷉","䏲","䴘"],pōu:["剖"],wān:["剜","塆","壪","帵","弯","彎","湾","潫","灣","睕","蜿","豌"],"bāo bō":["剝","剥"],duō:["剟","咄","哆","嚉","多","夛","掇","毲","畓","裰","㙍"],qíng:["剠","勍","夝","情","擎","晴","暒","棾","樈","檠","氰","甠","硘","葝","黥"],"yǎn shàn":["剡"],"dū zhuó":["剢"],yān:["剦","嫣","崦","嶖","恹","懕","懨","樮","淊","淹","漹","烟","焉","焑","煙","珚","篶","胭","臙","菸","鄢","醃","閹","阉","黫"],huō:["剨","劐","吙","攉","秴","耠","锪","騞","𬴃"],shèng:["剩","剰","勝","圣","墭","嵊","晠","榺","橳","琞","聖","蕂","貹","賸"],"duān zhì":["剬"],wū:["剭","呜","嗚","圬","屋","巫","弙","杇","歍","汙","汚","污","洿","烏","窏","箼","螐","誈","誣","诬","邬","鄔","鎢","钨","鰞","鴮"],gē:["割","哥","圪","彁","戈","戓","戨","歌","滒","犵","肐","袼","謌","鎶","鴚","鴿","鸽"],"dá zhá":["剳"],chuán:["剶","暷","椽","篅","舡","舩","船","輲","遄"],"tuán zhuān":["剸","漙","篿"],"lù jiū":["剹"],pēng:["剻","匉","嘭","怦","恲","抨","梈","烹","砰","軯","駍"],piāo:["剽","勡","慓","旚","犥","翲","螵","飃","飄","飘","魒"],kōu:["剾","彄","抠","摳","眍","瞘","芤","𫸩"],"jiǎo chāo":["剿","劋","勦","摷"],qiāo:["劁","勪","墝","幧","敲","橇","毃","燆","硗","磽","繑","趬","跷","踍","蹺","蹻","郻","鄡","鄥","鍫","鍬","鐰","锹","頝"],"huá huà":["劃"],"zhā zhá":["劄"],"pī pǐ":["劈","悂"],tāng:["劏","嘡","羰","薚","蝪","蹚","鞺","鼞"],chán:["劖","嚵","壥","婵","嬋","巉","廛","棎","毚","湹","潹","潺","澶","瀍","瀺","煘","獑","磛","緾","纏","纒","缠","艬","蝉","蟐","蟬","蟾","誗","讒","谗","躔","鄽","酁","鋋","鑱","镵","饞","馋"],zuān:["劗","躜","躦","鉆","鑚"],mó:["劘","嫫","嬤","嬷","尛","摹","擵","橅","糢","膜","藦","蘑","謨","謩","谟","饃","饝","馍","髍","魔","魹"],zhú:["劚","斸","曯","欘","灟","炢","烛","燭","爥","瘃","竹","笁","笜","舳","茿","蓫","蠋","蠾","躅","逐","逫","钃","鱁"],quàn:["劝","勧","勸","牶","韏"],"jìn jìng":["劤","劲","勁"],kēng:["劥","坑","牼","硁","硜","誙","銵","鍞","鏗","铿","阬"],"xié liè":["劦"],"zhù chú":["助"],nǔ:["努","弩","砮","胬"],shào:["劭","卲","哨","潲","紹","綤","绍","袑","邵"],miǎo:["劰","杪","淼","渺","眇","秒","篎","緲","缈","藐","邈"],kǒu:["劶","口"],wā:["劸","娲","媧","屲","挖","攨","洼","溛","漥","瓾","畖","穵","窊","窪","蛙","韈","鼃"],kuāng:["劻","匡","匩","哐","恇","洭","筐","筺","誆","诓","軭","邼"],hé:["劾","咊","啝","姀","峆","敆","曷","柇","楁","毼","河","涸","渮","澕","熆","皬","盇","盉","盍","盒","禾","篕","籺","粭","翮","菏","萂","覈","訸","詥","郃","釛","鉌","鑉","閡","闔","阂","阖","鞨","頜","餄","饸","魺","鹖","麧","齕","龁","龢","𬌗"],gào:["勂","吿","告","峼","祮","祰","禞","筶","誥","诰","郜","鋯","锆"],"bó bèi":["勃"],láng:["勆","嫏","廊","斏","桹","榔","樃","欴","狼","琅","瑯","硠","稂","艆","蓈","蜋","螂","躴","郒","郞","鋃","鎯","锒"],xūn:["勋","勛","勲","勳","嚑","坃","埙","塤","壎","壦","曛","燻","獯","矄","纁","臐","薫","薰","蘍","醺","𫄸"],"juàn juān":["勌","瓹"],"lè lēi":["勒"],kài:["勓","炌","烗","鎎"],"wěng yǎng":["勜"],qín:["勤","嗪","噙","嶜","庈","懃","懄","捦","擒","斳","檎","澿","珡","琴","琹","瘽","禽","秦","耹","芩","芹","菦","螓","蠄","鈙","鈫","雂","靲","鳹","鵭"],jiàng:["勥","匞","匠","嵹","弜","弶","摾","櫤","洚","滰","犟","糡","糨","絳","绛","謽","酱","醤","醬"],fān:["勫","嬏","帆","幡","忛","憣","旙","旛","繙","翻","藩","轓","颿","飜","鱕"],juān:["勬","姢","娟","捐","涓","蠲","裐","鎸","鐫","镌","鹃"],"tóng dòng":["勭","烔","燑","狪"],lǜ:["勴","垏","嵂","律","慮","氯","滤","濾","爈","箻","綠","繂","膟","葎","虑","鑢"],chè:["勶","坼","彻","徹","掣","撤","澈","烢","爡","瞮","硩","聅","迠","頙","㬚"],sháo:["勺","玿","韶"],"gōu gòu":["勾"],cōng:["匆","囪","囱","忩","怱","悤","暰","樬","漗","瑽","璁","瞛","篵","繱","聡","聦","聪","聰","苁","茐","葱","蓯","蔥","蟌","鍯","鏓","鏦","騘","驄","骢"],"táo yáo":["匋","陶"],páo:["匏","咆","垉","庖","爮","狍","袍","褜","軳","鞄","麅"],dá:["匒","妲","怛","炟","燵","畣","笪","羍","荙","薘","蟽","詚","达","迏","迖","迚","逹","達","鐽","靼","鞑","韃","龖","龘","𫟼"],"huà huā":["化"],"běi bèi":["北"],nǎo:["匘","垴","堖","嫐","恼","悩","惱","瑙","碯","脑","脳","腦"],"chí shi":["匙"],fāng:["匚","堏","方","淓","牥","芳","邡","鈁","錺","钫","鴋"],zā:["匝","咂","帀","沞","臜","臢","迊","鉔","魳"],qiè:["匧","厒","妾","怯","悏","惬","愜","挈","穕","窃","竊","笡","箧","篋","籡","踥","鍥","锲","鯜"],"zāng cáng":["匨"],fěi:["匪","奜","悱","棐","榧","篚","翡","蕜","誹","诽"],"kuì guì":["匮","匱"],suǎn:["匴"],pǐ:["匹","噽","嚭","圮","庀","痞","癖","脴","苉","銢","鴄"],"qū ōu":["区","區"],"kē qià":["匼"],"yǎn yàn":["匽","棪"],biǎn:["匾","惼","揙","碥","稨","窆","藊","褊","貶","贬","鴘"],nì:["匿","堄","嫟","嬺","惄","愵","昵","暱","氼","眤","睨","縌","胒","腻","膩","逆","𨺙"],niàn:["卄","唸","埝","廿","念","惗","艌"],sà:["卅","櫒","脎","萨","蕯","薩","鈒","隡","颯","飒","馺"],zú:["卆","哫","崪","族","箤","足","踤","镞"],shēng:["升","呏","声","斘","昇","曻","枡","殅","泩","湦","焺","牲","珄","生","甥","竔","笙","聲","鉎","鍟","阩","陞","陹","鵿","鼪"],wàn:["卍","卐","忨","杤","瞣","脕","腕","萬","蟃","贎","輐","錽","𬇕"],"huá huà huā":["华","華"],bēi:["卑","悲","揹","杯","桮","盃","碑","藣","鵯","鹎"],"zú cù":["卒"],"dān shàn chán":["单","單"],"nán nā":["南"],"shuài lǜ":["卛"],"bǔ bo pú":["卜"],"kuàng guàn":["卝"],biàn:["卞","变","変","峅","弁","徧","忭","抃","昪","汳","汴","玣","艑","苄","覍","諚","變","辡","辧","辨","辩","辫","辮","辯","遍","釆","𨚕"],bǔ:["卟","哺","捕","补","補","鸔","𬷕"],"zhàn zhān":["占","覱"],"kǎ qiǎ":["卡"],lú:["卢","嚧","垆","壚","庐","廬","曥","枦","栌","櫨","泸","瀘","炉","爐","獹","玈","瓐","盧","矑","籚","纑","罏","胪","臚","舮","舻","艫","芦","蘆","蠦","轤","轳","鈩","鑪","顱","颅","馿","髗","魲","鱸","鲈","鸕","鸬","黸","𬬻"],lǔ:["卤","塷","掳","擄","樐","橹","櫓","氌","滷","澛","瀂","硵","磠","穞","艣","艪","蓾","虏","虜","鏀","鐪","鑥","镥","魯","鲁","鹵"],guà:["卦","啩","挂","掛","罣","褂","詿","诖"],"áng yǎng":["卬"],yìn:["印","垽","堷","廕","慭","憖","憗","懚","洕","湚","猌","癊","胤","茚","酳","鮣","䲟"],què:["却","卻","塙","崅","悫","愨","慤","搉","榷","燩","琷","皵","确","確","礭","闋","阕","鵲","鹊","𬒈"],luǎn:["卵"],"juàn juǎn":["卷","巻"],"chǎng ān hàn":["厂"],"wěi yán":["厃"],tīng:["厅","厛","听","庁","廰","廳","汀","烃","烴","綎","耓","聴","聼","聽","鞓","𬘩"],"zhé zhái":["厇"],"hàn àn":["厈","屽"],yǎ:["厊","唖","庌","痖","瘂","蕥"],shè:["厍","厙","弽","慑","慴","懾","摂","欇","涉","涻","渉","滠","灄","社","舎","蔎","蠂","設","设","赦","騇","麝"],dǐ:["厎","呧","坘","弤","抵","拞","掋","牴","砥","菧","觝","詆","诋","軧","邸","阺","骶","鯳"],"zhǎ zhǎi":["厏"],páng:["厐","嫎","庞","徬","舽","螃","逄","鰟","鳑","龎","龐"],"zhì shī":["厔"],máng:["厖","吂","哤","娏","忙","恾","杗","杧","汒","浝","牻","痝","盲","硭","笀","芒","茫","蘉","邙","釯","鋩","铓","駹"],zuī:["厜","樶","纗","蟕"],"shà xià":["厦","廈"],áo:["厫","嗷","嗸","廒","敖","滶","獒","獓","璈","翱","翶","翺","聱","蔜","螯","謷","謸","遨","鏖","隞","鰲","鳌","鷔","鼇"],"lán qiān":["厱"],"sī mǒu":["厶"],"gōng hóng":["厷"],"lín miǎo":["厸"],"qiú róu":["厹"],dū:["厾","嘟","督","醏"],"xiàn xuán":["县","縣"],"cān shēn cēn sān":["参","參","叄","叅"],"ài yǐ":["叆"],"chā chà chǎ chá":["叉"],shuāng:["双","孀","孇","欆","礵","艭","雙","霜","騻","驦","骦","鷞","鸘","鹴"],shōu:["収","收"],guái:["叏"],bá:["叐","妭","抜","拔","炦","癹","胈","茇","菝","詙","跋","軷","魃","鼥"],"fā fà":["发"],"zhuó yǐ lì jué":["叕"],qǔ:["取","娶","竬","蝺","詓","齲","龋"],"jiǎ xiá":["叚","徦"],"wèi yù":["叞","尉","蔚"],dié:["叠","垤","堞","峌","幉","恎","惵","戜","曡","殜","氎","牃","牒","瓞","畳","疂","疉","疊","碟","絰","绖","耊","耋","胅","艓","苵","蜨","蝶","褋","詄","諜","谍","跮","蹀","迭","镻","鰈","鲽","鴩","𫶇"],ruì:["叡","枘","汭","瑞","睿","芮","蚋","蜹","銳","鋭","锐"],"jù gōu":["句"],lìng:["另","呤","炩","蘦"],"dāo dáo tāo":["叨"],"zhī zhǐ":["只"],jiào:["叫","呌","嘂","嘦","噍","嬓","斍","斠","滘","漖","獥","珓","皭","窖","藠","訆","譥","趭","較","轎","轿","较","酵","醮","釂"],"zhào shào":["召"],"kě kè":["可"],"tái tāi":["台","苔"],pǒ:["叵","尀","笸","箥","鉕","钷","駊"],"yè xié":["叶"],"hào háo":["号"],tàn:["叹","嘆","探","歎","湠","炭","碳","舕"],"hōng hóng":["叿"],miē:["吀","咩","哶","孭"],"xū yū yù":["吁"],chī:["吃","哧","喫","嗤","噄","妛","媸","彨","彲","摛","攡","殦","瓻","痴","癡","眵","瞝","笞","粚","胵","蚩","螭","訵","魑","鴟","鵄","鸱","黐","齝","𫄨"],"xuān sòng":["吅"],yāo:["吆","喓","夭","妖","幺","楆","殀","祅","腰","葽","訞","邀","鴁","鴢","㙘"],zǐ:["吇","姉","姊","子","杍","梓","榟","橴","滓","矷","秭","笫","籽","紫","耔","虸","訿","釨"],"hé gě":["合","鲄"],"cùn dòu":["吋"],"tóng tòng":["同"],"tǔ tù":["吐","唋"],"zhà zhā":["吒","奓"],"xià hè":["吓"],"ā yā":["吖"],"ma má mǎ":["吗"],lìn:["吝","恡","悋","橉","焛","甐","膦","蔺","藺","賃","赁","蹸","躏","躙","躪","轥","閵"],tūn:["吞","暾","朜","焞"],"bǐ pǐ":["吡"],qìn:["吢","吣","唚","抋","揿","搇","撳","沁","瀙","菣","藽"],"jiè gè":["吤"],"fǒu pǐ":["否"],"ba bā":["吧"],dūn:["吨","噸","墩","墪","惇","撉","撴","犜","獤","礅","蜳","蹾","驐"],fēn:["吩","帉","昐","朆","梤","棻","氛","竕","紛","纷","翂","芬","衯","訜","躮","酚","鈖","雰","餴","饙","馚"],"é huā":["吪"],"kēng háng":["吭","妔"],shǔn:["吮"],"zhī zī":["吱"],"yǐn shěn":["吲"],wú:["吳","吴","呉","墲","峿","梧","橆","毋","洖","浯","無","珸","璑","祦","芜","茣","莁","蕪","蜈","蟱","譕","郚","鋙","铻","鯃","鵐","鷡","鹀","鼯"],"chǎo chāo":["吵"],"nà nè":["吶"],"xuè chuò jué":["吷"],chuī:["吹","炊","龡"],"dōu rú":["吺"],hǒu:["吼","犼"],"hōng hǒu ōu":["吽"],"wú yù":["吾"],"ya yā":["呀"],"è e":["呃"],dāi:["呆","懛","獃"],"mèn qǐ":["呇"],hōng:["呍","嚝","揈","灴","烘","焢","硡","薨","訇","谾","軣","輷","轟","轰","鍧"],nà:["呐","捺","笝","納","纳","肭","蒳","衲","豽","貀","軜","郍","鈉","钠","靹","魶"],"tūn tiān":["呑"],"fǔ ḿ":["呒","嘸"],"dāi tǎi":["呔"],"ǒu ōu òu":["呕"],"bài bei":["呗"],"yuán yún yùn":["员","員"],guō:["呙","啯","嘓","埚","堝","墎","崞","彉","彍","懖","猓","瘑","聒","蝈","蟈","郭","鈛","鍋","锅"],"huá qì":["呚"],"qiàng qiāng":["呛","跄"],shī:["呞","失","尸","屍","师","師","施","浉","湤","湿","溮","溼","濕","狮","獅","瑡","絁","葹","蒒","蓍","虱","蝨","褷","襹","詩","诗","邿","釃","鉇","鍦","鯴","鰤","鲺","鳲","鳾","鶳","鸤","䴓","𫚕"],juǎn:["呟","埍","臇","菤","錈","锩"],pěn:["呠","翸"],"wěn mǐn":["呡"],"ne ní":["呢"],"ḿ m̀ móu":["呣"],rán:["呥","嘫","然","燃","繎","肰","蚦","蚺","衻","袇","袡","髥","髯"],"tiè chè":["呫"],"qì zhī":["呮"],"zǐ cī":["呰"],"guā gū guǎ":["呱"],"cī zī":["呲"],"hǒu xǔ gòu":["呴"],"hē ā á ǎ à a":["呵"],náo:["呶","夒","峱","嶩","巎","挠","撓","猱","硇","蛲","蟯","詉","譊","鐃","铙"],"xiā gā":["呷"],pēi:["呸","怌","肧","胚","衃","醅"],"háo xiāo":["呺"],mìng:["命","掵"],"dá dàn":["呾"],"zuǐ jǔ":["咀"],"xián gān":["咁"],pǒu:["咅","哣","犃"],"yǎng yāng":["咉"],"zǎ zé zhā":["咋"],"hé hè huó huò hú":["和"],hāi:["咍"],dā:["咑","哒","噠","墶","搭","撘","耷","褡","鎝","𨱏"],"kǎ kā":["咔"],gū:["咕","唂","唃","姑","嫴","孤","巬","巭","柧","橭","沽","泒","稒","笟","箍","箛","篐","罛","苽","菇","菰","蓇","觚","軱","軲","轱","辜","酤","鈲","鮕","鴣","鸪"],"kā gā":["咖"],zuo:["咗"],lóng:["咙","嚨","嶐","巃","巄","昽","曨","朧","栊","槞","櫳","湰","滝","漋","爖","珑","瓏","癃","眬","矓","砻","礱","礲","窿","竜","聋","聾","胧","茏","蘢","蠪","蠬","襱","豅","鏧","鑨","霳","靇","驡","鸗","龍","龒","龙"],"xiàn xián":["咞"],qì:["咠","唭","噐","器","夡","弃","憇","憩","暣","棄","欫","气","気","氣","汔","汽","泣","湆","湇","炁","甈","盵","矵","碛","碶","磜","磧","罊","芞","葺","藒","蟿","訖","讫","迄","鐑"],"xì dié":["咥"],"liē liě lié lie":["咧"],zī:["咨","嗞","姕","姿","孜","孳","孶","崰","嵫","栥","椔","淄","湽","滋","澬","玆","禌","秶","粢","紎","緇","緕","纃","缁","茊","茲","葘","諮","谘","貲","資","赀","资","赼","趑","趦","輜","輺","辎","鄑","鈭","錙","鍿","鎡","锱","镃","頾","頿","髭","鯔","鰦","鲻","鶅","鼒","齍","齜","龇"],mī:["咪"],"jī xī qià":["咭"],"gē luò kǎ lo":["咯"],"shù xún":["咰"],"zán zá zǎ zan":["咱"],"hāi ké":["咳"],huī:["咴","噅","噕","婎","媈","幑","徽","恢","拻","挥","揮","晖","暉","楎","洃","瀈","灰","灳","烣","睳","禈","翚","翬","蘳","袆","褘","詼","诙","豗","輝","辉","鰴","麾","㧑"],"huài shì":["咶"],táo:["咷","啕","桃","檮","洮","淘","祹","綯","绹","萄","蜪","裪","迯","逃","醄","鋾","鞀","鞉","饀","駣","騊","鼗","𫘦"],xián:["咸","啣","娴","娹","婱","嫌","嫺","嫻","弦","挦","撏","涎","湺","澖","甉","痫","癇","癎","絃","胘","舷","藖","蚿","蛝","衔","衘","誸","諴","賢","贒","贤","輱","醎","銜","鑦","閑","闲","鷳","鷴","鷼","鹇","鹹","麙","𫍯"],"è àn":["咹"],"xuān xuǎn":["咺","烜"],"wāi hé wǒ guǎ guō":["咼"],"yàn yè yān":["咽"],āi:["哀","哎","埃","溾","銰","鎄","锿"],pǐn:["品","榀"],shěn:["哂","婶","嬸","审","宷","審","弞","曋","渖","瀋","瞫","矤","矧","覾","訠","諗","讅","谂","谉","邥","頣","魫"],"hǒng hōng hòng":["哄"],"wā wa":["哇"],"hā hǎ hà":["哈"],zāi:["哉","栽","渽","溨","災","灾","烖","睵","賳"],"dì diè":["哋"],pài:["哌","沠","派","渒","湃","蒎","鎃"],"gén hěn":["哏"],"yǎ yā":["哑","雅"],"yuě huì":["哕","噦"],nián:["哖","年","秊","秥","鮎","鯰","鲇","鲶","鵇","黏"],"huá huā":["哗","嘩"],"jì jiē zhāi":["哜","嚌"],mōu:["哞"],"yō yo":["哟","喲"],lòng:["哢","梇","贚"],"ò ó é":["哦"],"lī lǐ li":["哩"],"nǎ na nǎi né něi":["哪"],hè:["哬","垎","壑","寉","惒","焃","煂","燺","爀","癋","碋","翯","褐","謞","賀","贺","赫","靍","靎","靏","鶴","鸖","鹤"],"bō pò bā":["哱"],zhé:["哲","啠","喆","嚞","埑","悊","摺","晢","晣","歽","矺","砓","磔","籷","粍","虴","蛰","蟄","袩","詟","謫","謺","讁","讋","谪","輒","輙","轍","辄","辙","鮿"],"liàng láng":["哴"],"liè lǜ":["哷"],hān:["哻","憨","蚶","谽","酣","頇","顸","馠","魽","鼾"],"hēng hng":["哼"],gěng:["哽","埂","峺","挭","梗","綆","绠","耿","莄","郠","骾","鯁","鲠","𬒔"],"chuò yuè":["哾"],"gě jiā":["哿"],"bei bài":["唄"],"hán hàn":["唅"],chún:["唇","浱","湻","滣","漘","犉","純","纯","脣","莼","蒓","蓴","醇","醕","錞","陙","鯙","鶉","鹑","𬭚"],"ài āi":["唉"],"jiá qiǎn":["唊"],"yán dàn xián":["唌"],chē:["唓","砗","硨","莗","蛼"],"wú ńg ń":["唔"],zào:["唕","唣","噪","慥","梍","灶","煰","燥","皁","皂","竃","竈","簉","艁","譟","趮","躁","造","𥖨"],dí:["唙","啇","嘀","嚁","嫡","廸","敌","敵","梑","涤","滌","狄","笛","籴","糴","苖","荻","蔋","蔐","藡","覿","觌","豴","迪","靮","頔","馰","髢","鸐","𬱖"],"gòng hǒng gǒng":["唝","嗊"],dóu:["唞"],"lào láo":["唠","嘮","憦"],huàn:["唤","喚","奂","奐","宦","嵈","幻","患","愌","换","換","擐","攌","梙","槵","浣","涣","渙","漶","澣","烉","焕","煥","瑍","痪","瘓","睆","肒","藧","豢","轘","逭","鯇","鯶","鰀","鲩"],léng:["唥","塄","楞","碐","薐"],"wō wěi":["唩"],fěng:["唪","覂","諷","讽"],"yín jìn":["唫"],"hǔ xià":["唬"],wéi:["唯","围","圍","壝","峗","峞","嵬","帏","帷","幃","惟","桅","沩","洈","涠","湋","溈","潍","潙","潿","濰","犩","矀","維","维","蓶","覹","违","違","鄬","醀","鍏","闈","闱","韋","韦","鮠","𣲗","𬶏"],shuā:["唰"],chàng:["唱","怅","悵","暢","焻","畅","畼","誯","韔","鬯"],"ér wā":["唲"],qiàng:["唴","炝","熗","羻"],yō:["唷"],yū:["唹","淤","瘀","盓","箊","紆","纡","込","迂","迃","陓"],lài:["唻","濑","瀨","瀬","癞","癩","睐","睞","籁","籟","藾","賚","賴","赉","赖","頼","顂","鵣"],tuò:["唾","嶞","柝","毤","毻","箨","籜","萚","蘀","跅"],"zhōu zhāo tiào":["啁"],kěn:["啃","垦","墾","恳","懇","肎","肯","肻","豤","錹"],"zhuó zhào":["啅","濯"],"hēng hèng":["啈","悙"],"lín lán":["啉"],"a ā á ǎ à":["啊"],qiāng:["啌","嗴","嶈","戕","摤","斨","枪","槍","溬","牄","猐","獇","羌","羗","腔","蜣","謒","鏘","锖","锵"],"tūn zhūn xiāng duǐ":["啍"],wèn:["問","妏","揾","搵","璺","问","顐"],"cuì qi":["啐"],"dié shà jié tì":["啑"],"yuē wā":["啘"],"zǐ cǐ":["啙"],"bǐ tú":["啚"],"chuò chuài":["啜"],"yǎ yā è":["啞"],fēi:["啡","婓","婔","扉","暃","渄","猆","緋","绯","裶","霏","非","靟","飛","飝","飞","餥","馡","騑","騛","鯡","鲱","𬴂"],pí:["啤","壀","枇","毗","毘","焷","琵","疲","皮","篺","罴","羆","脾","腗","膍","蚍","蚽","蜱","螷","蠯","豼","貔","郫","鈹","阰","陴","隦","魮","鮍","鲏","鵧","鼙"],shá:["啥"],"lā la":["啦"],"yīng qíng":["啨"],pā:["啪","妑","舥","葩","趴"],"zhě shì":["啫"],sè:["啬","嗇","懎","擌","栜","歮","涩","渋","澀","澁","濇","濏","瀒","瑟","璱","瘷","穑","穡","穯","繬","譅","轖","銫","鏼","铯","飋"],niè:["啮","嗫","噛","嚙","囁","囓","圼","孼","孽","嵲","嶭","巕","帇","敜","枿","槷","櫱","涅","湼","痆","篞","籋","糱","糵","聂","聶","臬","臲","蘖","蠥","讘","踂","踗","踙","蹑","躡","錜","鎳","鑈","鑷","钀","镊","镍","闑","陧","隉","顳","颞","齧","𫔶"],"luō luó luo":["啰","囉"],"tān chǎn tuō":["啴"],bo:["啵","蔔"],dìng:["啶","定","椗","矴","碇","碠","磸","聢","腚","萣","蝊","訂","订","錠","锭","顁","飣","饤"],lāng:["啷"],"án ān":["啽"],kā:["喀","擖"],"yóng yú":["喁"],"lā lá lǎ":["喇"],jiē:["喈","喼","嗟","堦","媘","接","掲","擑","湝","煯","疖","痎","癤","皆","秸","稭","脻","蝔","街","謯","阶","階","鞂","鶛"],hóu:["喉","帿","猴","瘊","睺","篌","糇","翭","葔","鄇","鍭","餱","骺","鯸","𬭤"],"dié zhá":["喋"],wāi:["喎","歪","竵"],"nuò rě":["喏"],"xù huò guó":["喐"],zán:["喒"],"wō ō":["喔"],hú:["喖","嘝","囫","壶","壷","壺","媩","弧","搰","斛","楜","槲","湖","瀫","焀","煳","狐","猢","瑚","瓳","箶","絗","縠","胡","葫","蔛","蝴","螜","衚","觳","醐","鍸","頶","餬","鬍","魱","鰗","鵠","鶘","鶦","鹕"],"huàn yuán xuǎn hé":["喛"],xǐ:["喜","囍","壐","屣","徙","憙","枲","橲","歖","漇","玺","璽","矖","禧","縰","葈","葸","蓰","蟢","謑","蹝","躧","鈢","鉨","鉩","鱚","𬭳","𬶮"],"hē hè yè":["喝"],kuì:["喟","嘳","媿","嬇","愦","愧","憒","篑","簣","籄","聩","聭","聵","膭","蕢","謉","餽","饋","馈"],"zhǒng chuáng":["喠"],"wéi wèi":["喡","為","爲"],"duó zhà":["喥"],"sāng sàng":["喪"],"qiáo jiāo":["喬"],"pèn bēn":["喯"],"cān sūn qī":["喰"],"zhā chā":["喳"],miāo:["喵"],"pēn pèn":["喷"],kuí:["喹","夔","奎","巙","戣","揆","晆","暌","楏","楑","櫆","犪","睽","葵","藈","蘷","虁","蝰","躨","逵","鄈","鍨","鍷","頯","馗","騤","骙","魁"],"lou lóu":["喽"],"zào qiāo":["喿"],"hè xiāo xiào hù":["嗃"],"á shà":["嗄"],xiù:["嗅","岫","峀","溴","珛","琇","璓","秀","綉","繍","繡","绣","螑","袖","褎","褏","銹","鏥","鏽","锈","齅"],"qiāng qiàng":["嗆","戗","戧","蹌","蹡"],"ài yì":["嗌","艾"],"má mǎ ma":["嗎"],"kè kē":["嗑"],"dā tà":["嗒","鎉"],sǎng:["嗓","搡","磉","褬","鎟","顙","颡"],chēn:["嗔","抻","琛","瞋","諃","謓","賝","郴","𬘭"],"wā gǔ":["嗗"],"pǎng bēng":["嗙"],"xián qiǎn qiān":["嗛"],lào:["嗠","嫪","橯","涝","澇","耢","耮","躼","軂","酪"],wēng:["嗡","翁","聬","螉","鎓","鶲","鹟","𬭩"],wà:["嗢","腽","膃","袜","襪","韤"],"hēi hāi":["嗨"],hē:["嗬","欱","蠚","訶","诃"],zi:["嗭"],sǎi:["嗮"],"ǹg ńg ňg":["嗯"],gě:["嗰","舸"],ná:["嗱","拏","拿","鎿","镎"],diǎ:["嗲"],"ài ǎi āi":["嗳"],tōng:["嗵","樋","炵","蓪"],"zuī suī":["嗺"],"zhē zhè zhù zhe":["嗻"],mò:["嗼","圽","塻","墨","妺","嫼","寞","帞","昩","末","枺","歿","殁","沫","漠","爅","獏","瘼","皌","眽","眿","瞐","瞙","砞","礳","秣","絈","纆","耱","茉","莈","蓦","蛨","蟔","貃","貊","貘","銆","鏌","镆","陌","靺","驀","魩","默","黙","𬙊"],sòu:["嗽","瘶"],tǎn:["嗿","坦","忐","憳","憻","暺","毯","璮","菼","袒","襢","醓","鉭","钽"],"jiào dǎo":["嘄"],"kǎi gě":["嘅"],"shān càn":["嘇"],cáo:["嘈","嶆","曹","曺","槽","漕","艚","蓸","螬","褿","鏪","𥕢"],piào:["嘌","徱","蔈","驃"],"lóu lou":["嘍"],gǎ:["尕","玍"],"gǔ jiǎ":["嘏"],"jiāo xiāo":["嘐"],"xū shī":["嘘","噓"],pó:["嘙","嚩","婆","櫇","皤","鄱"],"dē dēi":["嘚"],"ma má":["嘛"],"lē lei":["嘞"],"gā gá gǎ":["嘠"],sāi:["嘥","噻","毢","腮","顋","鰓"],"zuō chuài":["嘬"],"cháo zhāo":["嘲","朝","鼂"],zuǐ:["嘴","噿","嶊","璻"],"qiáo qiào":["嘺","翹","谯"],"chù xù shòu":["嘼"],"tān chǎn":["嘽"],"dàn tán":["嘾","弾","彈","惔","澹"],"hēi mò":["嘿"],ě:["噁","砨","頋","騀","鵈"],"fān bo":["噃"],chuáng:["噇","床","牀"],"cù zā hé":["噈"],"tūn kuò":["噋"],"cēng chēng":["噌"],dēng:["噔","嬁","灯","燈","璒","登","竳","簦","艠","豋"],pū:["噗","扑","撲","攴","攵","潽","炇","陠"],juē:["噘","屩","屫","撧"],lū:["噜","嚕","撸","擼","謢"],zhān:["噡","岾","惉","旃","旜","枬","栴","毡","氈","氊","沾","瞻","薝","蛅","詀","詹","譫","谵","趈","邅","閚","霑","飦","饘","驙","魙","鱣","鸇","鹯","𫗴"],ō:["噢"],"zhòu zhuó":["噣"],"jiào qiào chī":["噭"],yuàn:["噮","妴","怨","愿","掾","瑗","禐","苑","衏","裫","褑","院","願"],"ǎi ài āi":["噯"],"yōng yǒng":["噰","澭"],"jué xué":["噱"],"pēn pèn fèn":["噴"],gá:["噶","尜","釓","錷","钆"],"xīn hěn hèn":["噷"],dāng:["噹","澢","珰","璫","筜","簹","艡","蟷","裆","襠"],làn:["嚂","滥","濫","烂","燗","爁","爛","爤","瓓","糷","钄"],tà:["嚃","嚺","崉","挞","搨","撻","榻","橽","毾","涾","澾","濌","禢","粏","誻","譶","蹋","蹹","躂","躢","遝","錔","闒","闥","闼","阘","鞜","鞳"],"huō huò ǒ":["嚄"],hāo:["嚆","茠","蒿","薅"],"hè xià":["嚇"],"xiù pì":["嚊"],"zhōu chóu":["嚋","盩","诪"],mē:["嚒"],"chā cā":["嚓"],"bó pào bào":["嚗"],"me mèi mò":["嚜"],"xié hái":["嚡"],"áo xiāo":["嚣"],mō:["嚤","摸"],pín:["嚬","娦","嫔","嬪","玭","矉","薲","蠙","貧","贫","顰","颦","𬞟"],mè:["嚰","濹"],"rǎng rāng":["嚷"],lá:["嚹","旯"],"jiáo jué jiào":["嚼"],chuò:["嚽","娖","擉","歠","涰","磭","踀","輟","辍","辵","辶","酫","鑡","餟","齪","龊"],"huān huàn":["嚾"],"zá cà":["囃"],chài:["囆","虿","蠆","袃","訍"],"náng nāng":["囊"],"zá zàn cān":["囋"],sū:["囌","櫯","甦","稣","穌","窣","蘇","蘓","酥","鯂"],zèng:["囎","熷","甑","贈","赠","鋥","锃"],"zá niè yàn":["囐"],nāng:["囔"],"luó luō luo":["囖"],"wéi guó":["囗"],huí:["囘","回","囬","廻","廽","恛","洄","痐","茴","蚘","蛔","蛕","蜖","迴","逥","鮰"],nín:["囜","您","脌"],"jiǎn nān":["囝"],nān:["囡"],tuán:["团","団","團","慱","抟","摶","檲","糰","鏄","鷒","鷻"],"tún dùn":["囤","坉"],guó:["囯","囶","囻","国","圀","國","帼","幗","慖","摑","漍","聝","腘","膕","蔮","虢","馘","𬇹"],kùn:["困","涃","睏"],"wéi tōng":["囲"],qūn:["囷","夋","逡"],rì:["囸","日","衵","鈤","馹","驲"],tāi:["囼","孡","胎"],pǔ:["圃","圑","擈","普","暜","樸","檏","氆","浦","溥","烳","諩","譜","谱","蹼","鐠","镨"],"quān juàn juān":["圈","圏"],"chuí chuán":["圌"],tuǎn:["圕","畽","疃"],lüè:["圙","掠","略","畧","稤","鋝","鋢","锊","䂮"],"huán yuán":["圜"],luán:["圝","圞","奱","娈","孌","孪","孿","峦","巒","挛","攣","曫","栾","欒","滦","灤","癴","癵","羉","脔","臠","虊","銮","鑾","鵉","鸞","鸾"],tǔ:["土","圡","釷","钍"],"xū wéi":["圩"],"dì de":["地","嶳"],"qiān sú":["圱"],zhèn:["圳","塦","挋","振","朕","栚","甽","眹","紖","絼","纼","誫","賑","赈","鋴","鎭","鎮","镇","阵","陣","震","鴆","鸩"],"chǎng cháng":["场","場","塲"],"qí yín":["圻"],jiá:["圿","忦","恝","戞","扴","脥","荚","莢","蛱","蛺","裌","跲","郏","郟","鋏","铗","頬","頰","颊","鴶","鵊"],"zhǐ zhì":["坁"],bǎn:["坂","岅","昄","板","版","瓪","粄","舨","蝂","鈑","钣","阪","魬"],qǐn:["坅","寑","寝","寢","昑","梫","笉","螼","赾","鋟","锓"],"méi fén":["坆"],"rǒng kēng":["坈"],"fāng fáng":["坊"],"fèn bèn":["坋"],tān:["坍","怹","摊","擹","攤","滩","灘","瘫","癱","舑","貪","贪"],"huài pēi pī péi":["坏"],"dì làn":["坔"],tán:["坛","墰","墵","壇","壜","婒","憛","昙","曇","榃","檀","潭","燂","痰","磹","罈","罎","藫","談","譚","譠","谈","谭","貚","郯","醰","錟","顃"],bà:["坝","垻","壩","弝","欛","灞","爸","矲","覇","霸","鮁","鲅"],fén:["坟","墳","妢","岎","幩","枌","棼","汾","焚","燌","燓","羒","羵","蒶","蕡","蚠","蚡","豮","豶","轒","鐼","隫","馩","魵","黂","鼖","鼢","𣸣"],zhuì:["坠","墜","惴","甀","畷","礈","綴","縋","缀","缒","腏","膇","諈","贅","赘","醊","錣","鑆"],pō:["坡","岥","泼","溌","潑","釙","鏺","钋","頗","颇","䥽"],"pǎn bàn":["坢"],kūn:["坤","堃","堒","崐","崑","昆","晜","潉","焜","熴","猑","琨","瑻","菎","蜫","裈","裩","褌","醌","錕","锟","騉","髠","髡","髨","鯤","鲲","鵾","鶤","鹍"],diàn:["坫","垫","墊","壂","奠","婝","店","惦","扂","橂","殿","淀","澱","玷","琔","电","癜","簟","蜔","鈿","電","靛","驔"],"mù mǔ":["坶"],"kē kě":["坷","軻"],xuè:["坹","岤","桖","瀥","狘","瞲","謔","谑","趐"],"dǐ chí":["坻","柢"],lā:["垃","柆","菈","邋"],lǒng:["垄","垅","壟","壠","拢","攏","竉","陇","隴","𬕂"],mín:["垊","姄","岷","崏","捪","旻","旼","民","珉","琘","琝","瑉","痻","盿","砇","緍","緡","缗","罠","苠","鈱","錉","鍲","鴖"],"dòng tóng":["垌","峒","洞"],cí:["垐","嬨","慈","柌","濨","珁","瓷","甆","磁","礠","祠","糍","茨","詞","词","辝","辞","辤","辭","雌","飺","餈","鴜","鶿","鷀","鹚"],duī:["垖","堆","塠","痽","磓","鐓","鐜","鴭"],"duò duǒ":["垛"],"duǒ duò":["垜","挆"],chá:["垞","察","嵖","搽","槎","檫","猹","茬","茶","詧","靫","𥻗"],shǎng:["垧","晌","樉","賞","贘","赏","鋿","鏛","鑜"],shǒu:["垨","守","手","扌","艏","首"],da:["垯","繨","跶"],háng:["垳","斻","杭","筕","絎","绗","航","苀","蚢","裄","貥","迒","頏","颃","魧"],"ān ǎn":["垵"],xīng:["垶","惺","星","曐","煋","猩","瑆","皨","篂","腥","興","觪","觲","謃","騂","骍","鮏","鯹"],"yuàn huán":["垸"],bāng:["垹","帮","幇","幚","幫","捠","梆","浜","邦","邫","鞤","𠳐"],"póu fú":["垺"],cén:["埁","岑","涔"],"běng fēng":["埄"],"dì fáng":["埅"],"xiá jiā":["埉"],"mái mán":["埋"],làng:["埌","崀","浪","蒗","閬","㫰"],"shān yán":["埏"],"qín jīn":["埐"],"pǔ bù":["埔"],huā:["埖","婲","椛","硴","糀","花","蒊","蘤","誮","錵"],"suì sù":["埣"],"pí pì":["埤"],"qīng zhēng":["埥","鲭"],"wǎn wān":["埦"],lǔn:["埨","稐","𫭢"],"zhēng chéng":["埩"],kōng:["埪","崆","箜","躻","錓","鵼"],"cǎi cài":["埰","寀","采"],"chù tòu":["埱"],běng:["埲","琫","菶","鞛"],"kǎn xiàn":["埳"],"yì shì":["埶","醳"],péi:["培","毰","裴","裵","賠","赔","錇","锫","阫","陪"],"sào sǎo":["埽"],"jǐn qīn jìn":["堇"],"péng bèng":["堋"],"qiàn zàn jiàn":["堑"],àn:["堓","屵","岸","按","暗","案","胺","荌","豻","貋","錌","闇","隌","黯"],"duò huī":["堕","墮"],huán:["堚","寏","寰","峘","桓","洹","澴","獂","环","環","糫","繯","缳","羦","荁","萈","萑","豲","鍰","鐶","锾","镮","闤","阛","雈","鬟","鹮","𬘫","𤩽"],"bǎo bǔ pù":["堡"],"máo móu wǔ":["堥"],ruán:["堧","壖","撋"],"ài è yè":["堨"],gèng:["堩","暅"],méi:["堳","塺","媒","嵋","徾","攗","枚","栂","梅","楣","楳","槑","湄","湈","煤","猸","玫","珻","瑂","眉","睂","禖","脄","脢","腜","苺","莓","葿","郿","酶","鎇","镅","霉","鶥","鹛","黴"],dǔ:["堵","琽","睹","笃","篤","覩","賭","赌"],féng:["堸","綘","艂","逢"],hèng:["堼"],chūn:["堾","媋","旾","春","暙","杶","椿","槆","橁","櫄","瑃","箺","萅","蝽","輴","鰆","鶞","䲠"],jiǎng:["塂","奖","奨","奬","桨","槳","獎","耩","膙","蒋","蔣","講","讲","顜"],huāng:["塃","巟","慌","肓","荒","衁"],duàn:["塅","断","斷","椴","段","毈","煅","瑖","碫","簖","籪","緞","缎","腶","葮","躖","鍛","锻"],tǎ:["塔","墖","獭","獺","鮙","鰨","鳎"],wěng:["塕","奣","嵡","攚","暡","瞈","蓊"],"sāi sài sè":["塞"],zàng:["塟","弉","臓","臟","葬","蔵","銺"],tián:["塡","屇","恬","沺","湉","璳","甛","甜","田","畋","畑","碵","磌","胋","闐","阗","鴫","鷆","鷏"],zhèng:["塣","幁","政","証","諍","證","证","诤","郑","鄭","靕","鴊"],"tián zhèn":["填"],wēn:["塭","昷","榲","殟","温","溫","瑥","瘟","蕰","豱","輼","轀","辒","鎾","饂","鰛","鰮","鳁"],liù:["塯","廇","磟","翏","雡","霤","餾","鬸","鷚","鹨"],hǎi:["塰","海","烸","酼","醢"],lǎng:["塱","朖","朗","朤","烺","蓢","㮾"],bèng:["塴","揼","泵","甏","綳","蹦","迸","逬","鏰","镚"],chén:["塵","宸","尘","忱","敐","敶","晨","曟","栕","樄","沉","煁","瘎","臣","茞","莀","莐","蔯","薼","螴","訦","諶","軙","辰","迧","鈂","陈","陳","霃","鷐","麎"],"ōu qiū":["塸"],"qiàn jiàn":["塹"],"zhuān tuán":["塼"],shuǎng:["塽","慡","漺","爽","縔","鏯"],shú:["塾","婌","孰","璹","秫","贖","赎"],lǒu:["塿","嵝","嶁","甊","篓","簍"],chí:["墀","弛","持","池","漦","竾","筂","箎","篪","茌","荎","蚳","謘","貾","赿","踟","迟","迡","遅","遟","遲","鍉","馳","驰"],shù:["墅","庶","庻","怷","恕","戍","束","树","樹","沭","漱","潄","濖","竖","竪","絉","腧","荗","蒁","虪","術","裋","豎","述","鉥","錰","鏣","霔","鶐","𬬸"],"dì zhì":["墆","疐"],kàn:["墈","崁","瞰","矙","磡","衎","鬫"],chěn:["墋","夦","硶","碜","磣","贂","趻","踸","鍖"],"zhǐ zhuó":["墌"],qiǎng:["墏","繈","繦","羥","襁"],zēng:["増","增","憎","璔","矰","磳","罾","譄","鄫","鱛","䎖"],qiáng:["墙","墻","嫱","嬙","樯","檣","漒","牆","艢","蔃","蔷","蘠"],"kuài tuí":["墤"],"tuǎn dǒng":["墥"],"qiáo què":["墧"],"zūn dūn":["墫"],"qiāo áo":["墽"],"yì tú":["墿"],"xué bó jué":["壆"],lǎn:["壈","嬾","孄","孏","懒","懶","揽","擥","攬","榄","欖","浨","漤","灠","纜","缆","罱","覧","覽","览","醂","顲"],huài:["壊","壞","蘾"],rǎng:["壌","壤","攘","爙"],"làn xiàn":["壏"],dǎo:["壔","导","導","岛","島","嶋","嶌","嶹","捣","搗","擣","槝","祷","禂","禱","蹈","陦","隝","隯"],ruǐ:["壡","桵","橤","繠","蕊","蕋","蘂","蘃"],san:["壭"],zhuàng:["壮","壯","壵","撞","焋","状","狀"],"ké qiào":["壳","殼"],kǔn:["壸","壼","悃","捆","梱","硱","祵","稇","稛","綑","裍","閫","閸","阃"],mǎng:["壾","漭","茻","莽","莾","蠎"],cún:["壿","存"],"zhǐ zhōng":["夂"],"gǔ yíng":["夃"],"jiàng xiáng":["夅","降"],"páng féng fēng":["夆"],zhāi:["夈","捚","摘","斋","斎","榸","粂","齋"],"xuàn xiòng":["夐"],wài:["外","顡"],"wǎn yuàn wān yuān":["夗"],"mǎo wǎn":["夘"],mèng:["夢","夣","孟","梦","癦","霥"],"dà dài":["大"],"fū fú":["夫","姇","枎","粰"],guài:["夬","怪","恠"],yāng:["央","姎","抰","殃","泱","秧","胦","鉠","鍈","雵","鴦","鸯"],"hāng bèn":["夯"],gǎo:["夰","搞","杲","槀","槁","檺","稁","稾","稿","縞","缟","菒","藁","藳"],"tāo běn":["夲"],"tóu tou":["头"],"yǎn tāo":["夵"],"kuā kuà":["夸","誇"],"jiá jiā gā xiá":["夹"],huà:["夻","婳","嫿","嬅","崋","摦","杹","枠","桦","槬","樺","澅","画","畫","畵","繣","舙","話","諙","譮","话","黊"],"jiā jiá gā xiá":["夾"],ēn:["奀","恩","蒽"],"dī tì":["奃"],"yǎn yān":["奄","渰"],pào:["奅","疱","皰","砲","礟","礮","靤","麭"],nài:["奈","柰","渿","耐","萘","褦","錼","鼐"],"quān juàn":["奍","弮","棬"],zòu:["奏","揍"],"qì qiè xiè":["契"],kāi:["奒","开","揩","鐦","锎","開"],"bēn bèn":["奔","泍"],tào:["套"],"zàng zhuǎng":["奘"],běn:["奙","本","楍","畚","翉","苯"],"xùn zhuì":["奞"],shē:["奢","檨","猞","畭","畲","賒","賖","赊","輋","𪨶"],"hǎ pò tǎi":["奤"],"ào yù":["奥","奧","澚"],yūn:["奫","氲","氳","蒀","蒕","蝹","贇","赟","𫖳"],"duǒ chě":["奲"],"nǚ rǔ":["女"],nú:["奴","孥","笯","駑","驽"],"dīng dǐng tiǎn":["奵"],"tā jiě":["她"],nuán:["奻"],"hǎo hào":["好"],fàn:["奿","嬎","梵","汎","泛","滼","瀪","犯","畈","盕","笵","範","范","訉","販","贩","軬","輽","飯","飰","饭"],shuò:["妁","搠","朔","槊","烁","爍","矟","蒴","鎙","鑠","铄"],"fēi pèi":["妃"],wàng:["妄","忘","旺","望","朢"],zhuāng:["妆","妝","娤","庄","庒","桩","梉","樁","粧","糚","荘","莊","装","裝"],mā:["妈","媽"],"fū yōu":["妋"],"hài jiè":["妎"],dù:["妒","妬","杜","殬","渡","秺","芏","荰","螙","蠧","蠹","鍍","镀","靯","𬭊"],miào:["妙","庙","庿","廟","玅","竗"],"fǒu pēi pī":["妚"],"yuè jué":["妜"],niū:["妞"],"nà nàn":["妠"],tuǒ:["妥","嫷","庹","椭","楕","橢","鬌","鰖","鵎"],"wàn yuán":["妧"],fáng:["妨","房","肪","防","魴","鲂"],nī:["妮"],zhóu:["妯","碡"],zhāo:["妱","巶","招","昭","釗","鉊","鍣","钊","駋","𬬿"],"nǎi nǐ":["妳"],tǒu:["妵","敨","紏","蘣","黈"],"xián xuán xù":["妶"],"zhí yì":["妷","秇"],ē:["妸","妿","婀","屙"],mèi:["妹","媚","寐","抺","旀","昧","沬","煝","痗","眛","睸","祙","篃","蝞","袂","跊","鬽","魅"],"qī qì":["妻"],"xū xǔ":["姁","稰"],"shān shàn":["姍","姗","苫","釤","钐"],mán:["姏","慲","樠","蛮","蠻","謾","饅","馒","鬗","鬘","鰻","鳗"],jiě:["姐","媎","檞","毑","飷"],"wěi wēi":["委"],pīn:["姘","拼","礗","穦","馪","驞"],"huá huó":["姡"],"jiāo xiáo":["姣"],"gòu dù":["姤"],"lǎo mǔ":["姥"],"nián niàn":["姩"],zhěn:["姫","屒","弫","抮","昣","枕","畛","疹","眕","稹","縝","縥","缜","聄","萙","袗","裖","覙","診","诊","軫","轸","辴","駗","鬒"],héng:["姮","恆","恒","烆","珩","胻","蘅","衡","鑅","鴴","鵆","鸻"],"jūn xún":["姰"],"kuā hù":["姱"],"è yà":["姶"],"xiān shēn":["姺"],wá:["娃"],"ráo rǎo":["娆","嬈"],"shào shāo":["娋"],xiē:["娎","揳","楔","歇","蝎","蠍"],"wǔ méi mǔ":["娒"],"chuò lài":["娕"],niáng:["娘","嬢","孃"],"nà nuó":["娜","𦰡"],"pōu bǐ":["娝"],"něi suī":["娞"],tuì:["娧","煺","蛻","蜕","退","駾"],mǎn:["娨","屘","満","满","滿","螨","蟎","襔","鏋"],"wú wù yú":["娪"],"xī āi":["娭"],"zhuì shuì":["娷"],"dōng dòng":["娻"],"ǎi ái è":["娾"],"ē ě":["娿"],mián:["婂","嬵","宀","杣","棉","檰","櫋","眠","矈","矊","矏","綿","緜","绵","芇","蝒"],"pǒu péi bù":["婄"],biǎo:["婊","脿","表","裱","褾","諘","錶"],"fù fàn":["婏"],wǒ:["婐","婑","我"],"ní nǐ":["婗","棿"],"quán juàn":["婘","惓"],hūn:["婚","昏","昬","棔","涽","睧","睯","碈","荤","葷","蔒","轋","閽","阍"],"qiān jǐn":["婜"],"wān wà":["婠"],"lái lài":["婡","徕","徠"],"zhōu chōu":["婤"],"chuò nào":["婥"],"nüè àn":["婩"],"hùn kūn":["婫"],"dàng yáng":["婸"],nàn:["婻"],"ruò chuò":["婼"],jiǎ:["婽","岬","斚","斝","榎","槚","檟","玾","甲","胛","鉀","钾"],"tōu yú":["婾","媮"],"yù yú":["媀"],"wéi wěi":["媁"],"dì tí":["媂","珶","苐"],róu:["媃","揉","柔","渘","煣","瑈","瓇","禸","粈","糅","脜","腬","葇","蝚","蹂","輮","鍒","鞣","騥","鰇","鶔","𫐓"],"ruǎn nèn":["媆"],miáo:["媌","嫹","描","瞄","苗","鶓","鹋"],"yí pèi":["媐"],"mián miǎn":["媔"],"tí shì":["媞","惿"],"duò tuó":["媠","沲"],ǎo:["媪","媼","艹","芺","袄","襖","镺"],"chú zòu":["媰"],yìng:["媵","映","暎","硬","膡","鱦"],"qín shēn":["嫀"],jià:["嫁","幏","架","榢","稼","駕","驾"],sǎo:["嫂"],"zhēn zhěn":["嫃"],"jiē suǒ":["嫅"],"míng mǐng":["嫇"],niǎo:["嫋","嬝","嬲","茑","蔦","袅","裊","褭","鸟"],tāo:["嫍","幍","弢","慆","掏","搯","槄","涛","滔","濤","瑫","絛","縚","縧","绦","詜","謟","轁","鞱","韜","韬","飸","饕"],biáo:["嫑"],"piáo piāo":["嫖","薸"],xuán:["嫙","悬","懸","暶","檈","漩","玄","璇","璿","痃","蜁","𫠊"],"màn mān":["嫚"],kāng:["嫝","嵻","康","慷","槺","漮","砊","穅","糠","躿","鏮","鱇","𡐓","𩾌"],"hān nǎn":["嫨"],nèn:["嫩","嫰"],zhē:["嫬","遮"],"mā má":["嫲"],piè:["嫳"],zhǎn:["嫸","展","搌","斩","斬","琖","盏","盞","輾","醆","颭","飐"],"xiān yǎn jìn":["嬐"],liǎn:["嬚","敛","斂","琏","璉","羷","脸","臉","蔹","蘝","蘞","裣","襝","鄻"],"qióng huán xuān":["嬛"],dǒng:["嬞","懂","箽","董","蕫","諌"],cān:["嬠","湌","爘","飡","餐","驂","骖"],tiǎo:["嬥","宨","晀","朓","窱","脁"],bí:["嬶","荸","鼻"],liǔ:["嬼","柳","栁","桞","桺","橮","熮","珋","綹","绺","罶","羀","鋶","锍"],"qiān xiān":["孅","欦"],"xié huī":["孈"],"huān quán":["孉"],"lí lì":["孋","麗"],"zhú chuò":["孎"],kǒng:["孔","恐"],"mā zī":["孖"],"sūn xùn":["孙","孫"],"bèi bó":["孛","誖"],"yòu niū":["孧"],zhuǎn:["孨","竱","轉"],hái:["孩","骸"],nāo:["孬"],"chán càn":["孱"],bò:["孹","檗","蘗","譒"],nái:["孻","腉"],"níng nìng":["宁","寍","寗","寜","寧","甯"],zhái:["宅"],"tū jiā":["宊"],sòng:["宋","訟","誦","讼","诵","送","鎹","頌","颂","餸"],ròu:["宍","肉","譳"],zhūn:["宒","窀","衠","諄","谆","迍"],"mì fú":["宓"],"dàng tàn":["宕"],"wǎn yuān":["宛"],chǒng:["宠","寵"],qún:["宭","峮","帬","羣","群","裙","裠"],zǎi:["宰","崽"],"bǎo shí":["宲"],"jiā jia jie":["家"],"huāng huǎng":["宺"],kuān:["宽","寛","寬","臗","鑧","髋","髖"],"sù xiǔ xiù":["宿"],"jié zǎn":["寁"],"bìng bǐng":["寎"],"jìn qǐn":["寖"],"lóu jù":["寠"],"xiě xiè":["寫"],"qīn qìn":["寴"],cùn:["寸","籿"],duì:["对","対","對","怼","憝","懟","濧","瀩","碓","祋","綐","薱","譈","譵","轛","队","陮"],"lüè luó":["寽"],"shè yè yì":["射"],"jiāng jiàng qiāng":["将"],"jiāng jiàng":["將","浆","漿","畺"],zūn:["尊","嶟","樽","罇","遵","鐏","鱒","鳟","鶎","鷷","𨱔"],"shù zhù":["尌","澍"],xiǎo:["小","晓","暁","曉","皛","皢","筱","筿","篠","謏","𫍲"],"jié jí":["尐","诘","鞊"],"shǎo shào":["少"],ěr:["尒","尓","尔","栮","毦","洱","爾","珥","耳","薾","衈","趰","迩","邇","鉺","铒","餌","饵","駬"],"wāng yóu":["尢"],wāng:["尣","尩","尪","尫","汪"],liào:["尥","尦","廖","撂","料","炓","窷","鐐","镣","𪤗"],"méng máng lóng páng":["尨"],gà:["尬","魀"],"kuì kuǐ":["尯"],tuí:["尵","弚","穨","蘈","蹪","隤","頹","頺","頽","颓","魋","𬯎"],yǐn:["尹","嶾","引","朄","檃","檼","櫽","淾","濥","瘾","癮","粌","蘟","蚓","螾","讔","赺","趛","輑","鈏","靷"],"chǐ chě":["尺"],kāo:["尻","髛"],"jìn jǐn":["尽"],"wěi yǐ":["尾"],"niào suī":["尿"],céng:["层","層","嶒","驓"],diǎo:["屌"],"píng bǐng bīng":["屏"],lòu:["屚","漏","瘘","瘺","瘻","鏤","镂","陋"],"shǔ zhǔ":["属","屬"],"xiè tì":["屟"],"chè cǎo":["屮"],"tún zhūn":["屯"],"nì jǐ":["屰"],"hóng lóng":["屸"],"qǐ kǎi":["岂","豈"],áng:["岇","昂","昻"],"gǎng gāng":["岗","崗"],kě:["岢","敤","渇","渴","炣"],gǒu:["岣","狗","玽","笱","耇","耈","耉","苟","豿"],tiáo:["岧","岹","樤","祒","笤","芀","萔","蓚","蓨","蜩","迢","鋚","鎥","鞗","髫","鯈","鰷","鲦","齠","龆"],"qū jū":["岨"],lǐng:["岭","嶺","領","领"],pò:["岶","敀","洦","湐","烞","珀","破","砶","粕","蒪","魄"],"bā kè":["峇"],luò:["峈","摞","洛","洜","犖","珞","笿","纙","荦","詻","雒","駱","骆","鵅"],"fù niè":["峊"],ěn:["峎"],"zhì shì":["峙","崻"],qiǎ:["峠","跒","酠","鞐"],"qiáo jiào":["峤","癄"],"xié yé":["峫"],bū:["峬","庯","晡","誧","逋","鈽","錻","钸","餔","鵏"],chóng:["崇","崈","爞","虫","蝩","蟲","褈","隀"],"zú cuì":["崒","椊"],"líng léng":["崚"],"dòng dōng":["崠"],xiáo:["崤","洨","淆","訤","誵"],"pí bǐ":["崥","芘"],"zhǎn chán":["崭","嶃","嶄"],"wǎi wēi":["崴"],"yáng dàng":["崵"],"shì dié":["崼"],yào:["崾","曜","熎","燿","矅","穾","窔","筄","耀","艞","药","葯","薬","藥","袎","覞","詏","讑","靿","鷂","鹞","鼼"],"kān zhàn":["嵁"],"hán dǎng":["嵅"],"qiàn kàn":["嵌"],"wù máo":["嵍"],"kě jié":["嵑","嶱"],"wēi wěi":["嵔"],kē:["嵙","柯","棵","榼","樖","牁","牱","犐","珂","疴","瞌","磕","礚","科","稞","窠","萪","薖","蚵","蝌","趷","轲","醘","鈳","钶","頦","顆","颗","髁"],"dàng táng":["嵣"],"róng yíng":["嵤","爃"],"ái kǎi":["嵦"],"kāo qiāo":["嵪"],cuó:["嵯","嵳","痤","矬","蒫","蔖","虘","鹺","鹾"],"qiǎn qīn":["嵰"],"dì dié":["嵽"],cēn:["嵾"],dǐng:["嵿","艼","薡","鐤","頂","顶","鼎","鼑"],"áo ào":["嶅"],"pǐ pèi":["嶏"],"jiào qiáo":["嶠","潐"],"jué guì":["嶡","鳜"],"zhān shàn":["嶦","鳣"],"xiè jiè":["嶰"],"guī xī juàn":["嶲"],rū:["嶿"],"lì liè":["巁","棙","爄","綟"],"xī guī juàn":["巂"],"yíng hōng":["巆"],yǐng:["巊","廮","影","摬","梬","潁","瘿","癭","矨","穎","郢","鐛","頴","颍","颕","颖"],chǎo:["巐","炒","煼","眧","麨"],cuán:["巑","櫕","欑"],chuān:["巛","川","氚","瑏","穿"],"jīng xíng":["巠"],cháo:["巢","巣","晁","漅","潮","牊","窲","罺","謿","轈","鄛","鼌"],qiǎo:["巧","愀","髜"],gǒng:["巩","廾","拱","拲","栱","汞","珙","輁","鞏"],"chà chā chāi cī":["差"],"xiàng hàng":["巷"],shuài:["帅","帥","蟀"],pà:["帊","帕","怕","袙"],"tǎng nú":["帑"],"mò wà":["帓"],"tiē tiě tiè":["帖"],zhǒu:["帚","晭","疛","睭","箒","肘","菷","鯞"],"juǎn juàn":["帣"],shuì:["帨","涗","涚","睡","稅","税","裞"],"chóu dào":["帱","幬"],"jiǎn jiān sàn":["帴"],"shà qiè":["帹"],"qí jì":["帺","荠"],"shān qiāo shēn":["幓"],"zhuàng chuáng":["幢"],"chān chàn":["幨"],miè:["幭","懱","搣","滅","灭","烕","礣","篾","蔑","薎","蠛","衊","鑖","鱴","鴓"],"gān gàn":["干"],"bìng bīng":["并","幷"],"jī jǐ":["幾"],"guǎng ān":["广"],guǎng:["広","廣","犷","獷"],me:["庅"],"dùn tún":["庉"],"bài tīng":["庍"],"yìng yīng":["应"],"dǐ de":["底"],"dù duó":["度"],"máng méng páng":["庬"],"bìng píng":["庰"],chěng:["庱","悜","睈","逞","騁","骋"],"jī cuò":["庴"],qǐng:["庼","廎","檾","漀","苘","請","謦","请","頃","顷"],"guī wěi huì":["廆"],"jǐn qín":["廑"],kuò:["廓","扩","拡","擴","濶","筈","萿","葀","蛞","闊","阔","霩","鞟","鞹","韕","頢","鬠"],"qiáng sè":["廧","薔"],"yǐn yìn":["廴","隐","隠","隱","飮","飲","饮"],"pò pǎi":["廹","迫"],"nòng lòng":["弄"],"dì tì tuí":["弟"],"jué zhāng":["弡"],"mí mǐ":["弥","彌","靡"],chāo:["弨","怊","抄","欩","訬","超","鈔","钞"],yi:["弬"],shāo:["弰","旓","烧","焼","燒","筲","艄","萷","蕱","輎","髾","鮹"],"xuān yuān":["弲"],"qiáng qiǎng jiàng":["強","强"],"tán dàn":["弹","醈"],biè:["彆"],"qiáng jiàng qiǎng":["彊"],"jì xuě":["彐"],tuàn:["彖","褖"],yuē:["彟","曰","曱","矱"],"shān xiǎn":["彡"],wén:["彣","文","炆","珳","瘒","繧","聞","芠","蚉","蚊","螡","蟁","閺","閿","闅","闦","闻","阌","雯","馼","駇","魰","鳼","鴍","鼤","𫘜"],"péng bāng":["彭"],"piāo piào":["彯"],"zhuó bó":["彴"],"tuǒ yí":["彵"],"páng fǎng":["彷"],wǎng:["彺","往","徃","惘","枉","棢","網","网","罒","罓","罔","罖","菵","蛧","蝄","誷","輞","辋","魍"],cú:["徂","殂"],"dài dāi":["待"],huái:["徊","怀","懐","懷","槐","淮","耲","蘹","褢","褱","踝"],"wā wàng jiā":["徍"],"chěng zhèng":["徎"],"dé děi de":["得"],"cóng zòng":["從"],"shì tǐ":["徥"],"tí chí":["徲","鶗","鶙"],dé:["徳","德","恴","悳","惪","淂","鍀","锝"],"zhǐ zhēng":["徴","徵"],bié:["徶","癿","莂","蛂","襒","蹩"],"chōng zhǒng":["徸"],"jiǎo jiào":["徼","笅","筊"],"lòng lǒng":["徿"],"qú jù":["忂","渠","瞿","螶"],"dìng tìng":["忊"],gǎi:["忋","改"],rěn:["忍","栠","栣","秹","稔","綛","荏","荵","躵"],chàn:["忏","懴","懺","硟","羼","韂","顫"],tè:["忑","慝","特","蟘","鋱","铽"],"tè tēi tuī":["忒"],"gān hàn":["忓","攼"],"yì qì":["忔"],"tài shì":["忕"],"xī liě":["忚"],"yīng yìng":["応","應","譍"],"mǐn wěn mín":["忞","忟"],"sōng zhōng":["忪"],"yù shū":["忬","悆"],"qí shì":["忯","耆"],"tún zhūn dùn":["忳"],"qián qín":["忴","扲"],hún:["忶","浑","渾","餛","馄","魂","鼲"],niǔ:["忸","扭","炄","狃","紐","纽","莥","鈕","钮","靵"],"kuáng wǎng":["忹"],"kāng hàng":["忼"],"kài xì":["忾","愾"],òu:["怄","慪"],"bǎo bào":["怉"],"mín mén":["怋"],"zuò zhà":["怍"],zěn:["怎"],yàng:["怏","恙","样","様","樣","漾","羕","詇"],"kòu jù":["怐"],"náo niú":["怓"],"zhēng zhèng":["怔","掙","钲","铮"],"tiē zhān":["怗"],"hù gù":["怘"],"cū jù zū":["怚"],"sī sāi":["思"],"yóu chóu":["怞"],"tū dié":["怢"],"yōu yào":["怮"],xuàn:["怰","昡","楦","泫","渲","炫","琄","眩","碹","絢","縼","繏","绚","蔙","衒","袨","贙","鉉","鏇","铉","镟","颴"],"xù xuè":["怴"],"bì pī":["怶"],"xī shù":["怸"],"nèn nín":["恁"],"tiāo yáo":["恌"],"xī qī xù":["恓"],"xiào jiǎo":["恔"],"hū kuā":["恗"],nǜ:["恧","朒","衂","衄"],hèn:["恨"],"dòng tōng":["恫"],"quán zhuān":["恮"],"è wù ě wū":["恶","惡"],tòng:["恸","慟","憅","痛","衕"],"yuān juàn":["悁"],"qiāo qiǎo":["悄"],"jiè kè":["悈"],"hào jiào":["悎"],huǐ:["悔","檓","毀","毁","毇","燬","譭"],"mán mèn":["悗","鞔"],"yī yì":["悘","衣"],quān:["悛","箞","鐉","𨟠"],"kuī lǐ":["悝"],"yì niàn":["悥"],"mèn mēn":["悶"],guàn:["悹","悺","惯","慣","掼","摜","樌","欟","泴","涫","潅","灌","爟","瓘","盥","礶","祼","罆","罐","貫","贯","躀","遦","鏆","鑵","鱹","鸛","鹳"],"kōng kǒng":["悾"],"lǔn lùn":["惀"],guǒ:["惈","果","椁","槨","粿","綶","菓","蜾","裹","褁","輠","餜","馃"],"yuān wǎn":["惌","箢"],"lán lín":["惏"],"yù xù":["惐","淢"],"chuò chuì":["惙"],"hūn mèn":["惛"],"chǎng tǎng":["惝"],"suǒ ruǐ":["惢"],cǎn:["惨","慘","憯","黪","黲","䅟"],cán:["惭","慙","慚","残","殘","蚕","蝅","蠶","蠺"],"dàn dá":["惮","憚"],rě:["惹"],"yú tōu":["愉"],"kài qì":["愒"],"dàng táng shāng yáng":["愓"],"chén xìn dān":["愖"],"kè qià":["愘"],nuò:["愞","懦","懧","掿","搦","榒","稬","穤","糑","糥","糯","諾","诺","蹃","逽","鍩","锘"],gǎn:["感","擀","敢","桿","橄","澉","澸","皯","秆","稈","笴","芉","衦","赶","趕","鱤","鳡"],"còng sōng":["愡"],"sāi sī sǐ":["愢"],"gōng gòng hǒng":["愩","慐"],"shuò sù":["愬","洬"],"yáo yào":["愮"],huàng:["愰","曂","榥","滉","皝","皩","鎤","㿠"],zhěng:["愸","抍","拯","整","晸"],cǎo:["愺","艸","草","騲"],"xì xié":["慀"],"cǎo sāo":["慅"],"xù chù":["慉"],"qiè qiàn":["慊"],"cáo cóng":["慒"],"ào áo":["慠"],"lián liǎn":["慩","梿","槤","櫣"],"jìn qín jǐn":["慬"],"dì chì":["慸"],"zhí zhé":["慹"],"lóu lǚ":["慺","鷜"],còng:["憁","謥"],"zhī zhì":["憄","知","織","织"],chēng:["憆","摚","撐","撑","晿","柽","棦","橕","檉","泟","浾","琤","瞠","碀","緽","罉","蛏","蟶","赪","赬","鏿","鐣","阷","靗","頳","饓"],biē:["憋","虌","鱉","鳖","鼈","龞"],"chéng dèng zhèng":["憕"],"xǐ xī":["憘"],"duì dùn tūn":["憞"],"xiāo jiāo":["憢"],"xián xiàn":["憪"],"liáo liǎo":["憭","燎","爎","爒"],shéng:["憴","縄","繉","繩","绳","譝"],"náo nǎo náng":["憹"],"jǐng jìng":["憼"],"jǐ jiǎo":["憿"],"xuān huān":["懁"],"cǎo sāo sào":["懆"],mèn:["懑","懣","暪","焖","燜"],"mèng méng měng":["懜"],"ài yì nǐ":["懝"],"méng měng":["懞","瞢","矒"],"qí jī jì":["懠"],mǒ:["懡"],"lán xiàn":["懢"],"yōu yǒu":["懮"],"liú liǔ":["懰","藰"],ràng:["懹","譲","讓","让"],huān:["懽","欢","歓","歡","獾","讙","貛","酄","驩","鴅","鵍"],nǎn:["戁","揇","湳","煵","腩","蝻","赧"],"mí mó":["戂"],"gàng zhuàng":["戅","戆"],"zhuàng gàng":["戇"],"xū qu":["戌"],"xì hū":["戏","戯","戲"],"jiá gā":["戛"],zéi:["戝","蠈","賊","贼","鰂","鱡","鲗"],děng:["戥","等"],"hū xì":["戱"],chuō:["戳","踔","逴"],"biǎn piān":["扁"],"shǎng jiōng":["扄"],"shàn shān":["扇"],cái:["才","材","纔","裁","財","财"],"zhā zā zhá":["扎"],"lè lì cái":["扐"],"bā pá":["扒"],"dǎ dá":["打"],rēng:["扔"],"fǎn fú":["払"],"diǎo dí yuē lì":["扚"],"káng gāng":["扛"],"yū wū":["扜"],"yū wū kū":["扝"],"tuō chǐ yǐ":["扡"],"gǔ jié xì gē":["扢"],dèn:["扥","扽"],"sǎo sào":["扫","掃"],rǎo:["扰","擾","隢"],"xī chā qì":["扱"],"bān pān":["扳"],"bā ào":["扷"],"xī zhé":["扸"],"zhì sǔn kǎn":["扻"],zhǎo:["找","沼","瑵"],"kuáng wǎng zài":["抂"],"hú gǔ":["抇","鹄","鹘"],"bǎ bà":["把"],"dǎn shěn":["抌"],"nè nì ruì nà":["抐"],zhuā:["抓","檛","簻","膼","髽"],póu:["抔","裒"],"zhé shé zhē":["折"],"póu pōu fū":["抙","捊"],pāo:["抛","拋","脬","萢"],"ǎo ào niù":["抝"],"lūn lún":["抡","掄"],"qiǎng qiāng chēng":["抢"],"zhǐ zhǎi":["抧"],"bù pū":["抪","柨"],"yǎo tāo":["抭"],"hē hè qiā":["抲"],"nǐ ní":["抳"],"pī pēi":["抷"],"mǒ mò mā":["抹"],chōu:["抽","犨","犫","瘳","篘"],"jiā yá":["拁"],"fú bì":["拂","畐","鶝"],zhǎ:["拃","眨","砟","鮺","鲝"],"dān dàn dǎn":["担"],"chāi cā":["拆"],niān:["拈","蔫"],"lā lá lǎ là":["拉"],"bàn pàn":["拌"],pāi:["拍"],līn:["拎"],guǎi:["拐","枴","柺"],"tuò tà zhí":["拓"],"ào ǎo niù":["拗"],"jū gōu":["拘"],"pīn pàn fān":["拚"],"bài bái":["拜"],bài:["拝","敗","稗","粺","薭","贁","败","韛"],qiá:["拤"],"nǐng níng nìng":["拧"],"zé zhái":["择","擇"],hén:["拫","痕","鞎"],"kuò guā":["括"],"jié jiá":["拮"],nǐn:["拰"],shuān:["拴","栓","閂","闩"],"cún zùn":["拵"],"zā zǎn":["拶","桚"],kǎo:["拷","攷","栲","烤","考"],"yí chǐ hài":["拸"],"cè sè chuò":["拺"],"zhuài zhuāi yè":["拽"],"shí shè":["拾"],bāi:["挀","掰"],"kuò guāng":["挄"],nòng:["挊","挵","齈"],"jiào jiāo":["挍","敎","教"],"kuà kū":["挎"],"ná rú":["挐"],"tiāo tiǎo":["挑"],"dié shè":["挕"],liě:["挘","毟"],"yà yǎ":["挜","掗"],"wō zhuā":["挝"],"xié jiā":["挟","挾"],"dǎng dàng":["挡","擋"],"zhèng zhēng":["挣","正","症"],"āi ái":["挨"],"tuō shuì":["挩","捝"],"tǐ tì":["挮"],"suō shā":["挱"],"sā shā suō":["挲"],"kēng qiān":["挳","摼"],"bàng péng":["挷"],"ruó ruá":["挼"],"jiǎo kù":["捁"],"wǔ wú":["捂"],tǒng:["捅","桶","筒","筩","統","綂","统","㛚"],"huò chì":["捇"],"tú shū chá":["捈"],"lǚ luō":["捋"],"shāo shào":["捎","稍"],niē:["捏","揑"],"shù sǒng sōu":["捒"],"yé yú":["捓"],"jué zhuó":["捔"],"bù pú zhì":["捗"],zùn:["捘","銌"],lāo:["捞","撈","粩"],sǔn:["损","損","榫","笋","筍","箰","鎨","隼"],"wàn wǎn wān yù":["捥"],pěng:["捧","淎","皏"],shě:["捨"],"fǔ fù bǔ":["捬"],dáo:["捯"],"luò luǒ wǒ":["捰"],"juǎn quán":["捲"],"chēn tiǎn":["捵"],"niǎn niē":["捻"],"ruó wěi ré":["捼"],zuó:["捽","昨","秨","稓","筰","莋","鈼"],"wò xiá":["捾"],"qìng qiàn":["掅"],"póu pǒu":["掊"],qiā:["掐","葜"],"pái pǎi":["排"],"qiān wàn":["掔"],"yè yē":["掖"],"niè nǐ yì":["掜"],"huò xù":["掝"],"yàn shàn yǎn":["掞"],"zhěng dìng":["掟"],kòng:["控","鞚"],tuī:["推","蓷","藬"],"zōu zhōu chōu":["掫"],tiàn:["掭","舚"],kèn:["掯","裉","褃"],pá:["掱","杷","潖","爬","琶","筢"],"guó guāi":["掴"],"dǎn shàn":["掸","撣"],"chān xiān càn shǎn":["掺"],sāo:["掻","搔","溞","繅","缫","螦","騒","騷","鰠","鱢","鳋"],pèng:["掽","椪","槰","碰","踫"],"zhēng kēng":["揁"],"jiū yóu":["揂"],"jiān jiǎn":["揃","籛"],"pì chè":["揊"],"sāi zǒng cāi":["揌"],"tí dī dǐ":["提"],"zǒng sōng":["揔"],"huáng yóng":["揘"],"zǎn zuàn":["揝"],"xū jū":["揟"],"ké qiā":["揢"],"chuāi chuǎi chuài tuán zhuī":["揣"],"dì tì":["揥"],"lá là":["揦"],là:["揧","楋","溂","瓎","瘌","翋","臘","蝋","蝲","蠟","辢","辣","鑞","镴","鬎","鯻","𬶟"],"jiē qì":["揭"],"chòng dǒng":["揰"],"dié shé yè":["揲"],"jiàn qián jiǎn":["揵"],yé:["揶","爷","爺","瑘","鋣","鎁","铘"],chān:["搀","摻","攙","裧","襜","覘","觇","辿","鋓"],"gē gé":["搁","擱"],"lǒu lōu":["搂","摟"],"chōu zǒu":["搊"],chuāi:["搋"],sūn:["搎","槂","狲","猻","荪","蓀","蕵","薞","飧","飱"],"róng náng nǎng":["搑"],"péng bàng":["搒"],cuō:["搓","瑳","磋","蹉","遳","醝"],"kē è":["搕"],"nù nuò nòu":["搙"],"lā xié xiàn":["搚"],qiǔ:["搝","糗"],"xiǎn xiān":["搟"],"jié zhé":["搩"],"pán bān pó":["搫"],bān:["搬","攽","斑","斒","班","瘢","癍","肦","螁","螌","褩","辬","頒","颁","𨭉"],"zhì nái":["搱"],"wā wǎ wà":["搲"],huá:["搳","撶","滑","猾","蕐","螖","譁","鏵","铧","驊","骅","鷨"],"qiāng qiǎng chēng":["搶"],"tián shēn":["搷"],"ná nuò":["搻"],èn:["摁"],"shè niè":["摄","攝"],bìn:["摈","擯","殡","殯","膑","臏","髌","髕","髩","鬂","鬓","鬢"],"shā sà shǎi":["摋"],"chǎn sùn":["摌"],"jiū liú liáo jiǎo náo":["摎"],"féng pěng":["摓"],shuāi:["摔"],"dì tú zhí":["摕"],"qì jì chá":["摖"],"sōu sǒng":["摗"],"liǎn liàn":["摙"],"gài xì":["摡"],"hù chū":["摢"],tàng:["摥","烫","燙","鐋"],"nái zhì":["摨"],"mó mā":["摩"],"jiāng qiàng":["摪"],"áo qiáo":["摮"],"niè chè":["摰"],"mán màn":["摱"],"chàn cán":["摲"],"sè mí sù":["摵"],"biāo biào":["摽"],"juē jué":["撅"],piē:["撆","暼","氕","瞥"],"piě piē":["撇"],"zǎn zān zēn qián":["撍"],"sā sǎ":["撒"],hòng:["撔","訌","讧","闀","鬨"],"héng guàng":["撗"],niǎn:["撚","撵","攆","涊","焾","碾","簐","蹍","蹨","躎","輦","辇"],"chéng zhěng":["撜"],"huī wéi":["撝"],cāo:["撡","操","糙"],"xiāo sōu":["撨"],"liáo liāo":["撩"],"cuō zuǒ":["撮"],"wěi tuǒ":["撱"],cuān:["撺","攛","汆","蹿","躥","鑹","镩"],"qiào yāo jī":["撽"],"zhuā wō":["撾"],"lèi léi":["擂"],nǎng:["擃","攮","曩","灢"],"qíng jǐng":["擏"],kuǎi:["擓","蒯","㧟"],"pǐ bò":["擗"],"bò bāi":["擘"],"jù jǐ":["據"],mēng:["擝"],"sǒu sòu":["擞"],xǐng:["擤","箵","醒"],cā:["擦"],"níng nǐng nìng":["擰"],"zhì jié":["擳"],"là liè":["擸","爉"],"sòu sǒu":["擻"],"lì luò yuè":["擽"],"tī zhāi zhì":["擿"],pān:["攀","潘","眅","萠"],lèi:["攂","泪","涙","淚","禷","类","纇","蘱","酹","銇","錑","頛","頪","類","颣"],"cā sǎ":["攃"],"jùn pèi":["攈"],"lì luò":["攊","躒"],"là lài":["攋","櫴"],"lú luó":["攎"],"zǎn cuán":["攒"],"xiān jiān":["攕"],"mí mǐ mó":["攠"],"zǎn cuán zàn zuān":["攢"],zuàn:["攥"],"lì shài":["攦"],"lì luǒ":["攭"],"guǐ guì":["攱"],"jī qī yǐ":["攲"],fàng:["放"],"wù móu":["敄"],"chù shōu":["敊"],"gé guó è":["敋"],"duó duì":["敓","敚"],"duō què":["敠","敪"],"sàn sǎn":["散"],"dūn duì":["敦","镦"],"qī yǐ jī":["敧"],"xiào xué":["敩"],"shù shǔ shuò":["数","數"],"ái zhú":["敱","敳"],"xiòng xuàn":["敻"],"zhuó zhú":["斀"],"yì dù":["斁"],"lí tái":["斄"],"fěi fēi":["斐"],"yǔ zhōng":["斔"],"dòu dǒu":["斗"],"wò guǎn":["斡"],"tǒu tiǎo":["斢"],dòu:["斣","梪","浢","痘","窦","竇","脰","荳","豆","逗","郖","酘","閗","闘","餖","饾","鬥","鬦","鬪","鬬","鬭"],"yín zhì":["斦"],"chǎn jiè":["斺"],"wū yū yú":["於"],"yóu liú":["斿"],"páng bàng":["旁"],"máo mào":["旄"],"pī bì":["旇"],"xuán xuàn":["旋"],"wú mó":["无"],zǎo:["早","枣","栆","棗","澡","璪","薻","藻","蚤"],gā:["旮"],"gàn hàn":["旰"],"tái yīng":["旲"],"xū xù":["旴"],"tūn zhùn":["旽"],"wù wǔ":["旿"],"pò pèi":["昢"],zòng:["昮","猔","疭","瘲","粽","糉","糭","縦"],ǎi:["昹","毐","矮","蔼","藹","譪","躷","霭","靄"],"huàng huǎng":["晃"],xuǎn:["晅","癣","癬","选","選"],"xù kuā":["晇"],hǒng:["晎"],shài:["晒","曬"],"yūn yùn":["晕","煴"],"shèng chéng":["晟","椉","盛"],"jǐng yǐng":["景"],shǎn:["晱","熌","睒","覢","閃","闪","陕","陝"],"qǐ dù":["晵"],"ǎn àn yǎn":["晻"],"wǎng wàng":["暀"],zàn:["暂","暫","瓉","瓒","瓚","禶","襸","讃","讚","賛","贊","赞","蹔","鄼","錾","鏨","饡"],"yùn yūn":["暈"],"mín mǐn":["暋"],"dǔ shǔ":["暏"],shǔ:["暑","曙","潻","癙","糬","署","薥","薯","藷","蜀","蠴","襡","襩","鱪","鱰","黍","鼠","鼡"],"jiǎn lán":["暕"],nuǎn:["暖","煗","餪"],"bào pù":["暴"],"xī xǐ":["暿"],"pù bào":["曝","瀑"],"qū qǔ":["紶"],"qǔ qū":["曲"],"gèng gēng":["更"],"hū hù":["曶","雽"],"zēng céng":["曽","橧"],"céng zēng":["曾","竲"],"cǎn qián jiàn":["朁"],"qiè hé":["朅"],"bì pí":["朇","禆","笓","裨"],"yǒu yòu":["有"],"bān fén":["朌","鳻"],"fú fù":["服","洑"],"fěi kū":["朏","胐"],"qú xù chǔn":["朐"],"juān zuī":["朘"],"huāng máng wáng":["朚"],"qī jī":["期"],"tóng chuáng":["朣","橦"],zhá:["札","牐","箚","蚻","譗","鍘","铡","閘","闸"],"zhú shù shú":["朮"],"shù shú zhú":["术"],"zhū shú":["朱"],"pǔ pò pō piáo":["朴"],"dāo tiáo mù":["朷"],"guǐ qiú":["朹"],xiǔ:["朽","滫","潃","糔"],"chéng chēng":["朾"],zá:["杂","沯","砸","襍","雑","雜","雥","韴"],"yú wū":["杅"],"gān gǎn":["杆"],"chā chà":["杈"],"shān shā":["杉"],cūn:["村","皴","竴","膥","踆","邨"],"rèn ér":["杒","梕"],"sháo biāo":["杓"],"dì duò":["杕","枤"],"gū gài":["杚"],"yí zhì lí duò":["杝"],"gàng gāng":["杠"],"tiáo tiāo":["条","條"],"mà mǎ":["杩"],"sì zhǐ xǐ":["杫"],"yuán wán":["杬","蚖"],"bèi fèi":["杮"],"shū duì":["杸"],"niǔ chǒu":["杻"],"wò yuè":["枂","臒"],máo:["枆","毛","氂","渵","牦","矛","罞","茅","茆","蝥","蟊","軞","酕","鉾","錨","锚","髦","鶜"],"pī mì":["枈"],àng:["枊","盎","醠"],"fāng bìng":["枋"],"hù dǐ":["枑"],xín:["枔","襑","鐔","鬵"],"yāo yǎo":["枖"],"ě è":["枙"],"zhī qí":["枝"],"cōng zōng":["枞","樅"],"xiān zhēn":["枮"],"tái sì":["枱"],"gǒu jǔ gōu":["枸"],"bāo fú":["枹"],"yì xiè":["枻","栧"],"tuó duò":["柁","馱","駄","驮"],"yí duò lí":["柂"],"nǐ chì":["柅"],"pán bàn":["柈","跘"],"yǎng yàng yāng yīng":["柍"],"fù fū fǔ":["柎"],"bǎi bó bò":["柏"],mǒu:["某"],"sháo shào":["柖"],zhè:["柘","樜","浙","淛","蔗","蟅","這","鷓","鹧","䗪"],"yòu yóu":["柚","櫾"],"guì jǔ":["柜"],"zhà zuò":["柞"],"dié zhì":["柣","眰"],"zhā zǔ zū":["柤"],"chá zhā":["查","査"],"āo ào":["柪","軪"],"bā fú pèi bó biē":["柭"],"duò zuó wù":["柮"],"bì bié":["柲"],"zhù chù":["柷"],"bēi pēi":["柸"],"shì fèi":["柹"],"shān zhà shi cè":["栅"],"lì yuè":["栎","櫟"],"qì qiè":["栔","砌"],"qī xī":["栖","蹊"],"guā kuò":["栝"],"bīng bēn":["栟"],"xiào jiào":["校"],"jiàn zùn":["栫","袸"],"yǒu yù":["栯"],"hé hú":["核"],gēn:["根","跟"],"zhī yì":["栺"],"gé gē":["格"],"héng háng":["桁"],"guàng guāng":["桄"],"yí tí":["桋","荑"],sāng:["桑","桒","槡"],"jú jié":["桔"],"yú móu":["桙"],"ráo náo":["桡","橈"],"guì huì":["桧","檜"],"chén zhèn":["桭"],"tīng yíng":["桯"],"bó po":["桲"],"bèn fàn":["桳"],"fēng fèng":["桻","葑"],"sù yìn":["梀"],"tǐng tìng":["梃"],"xuān juān xié":["梋"],"tú chá":["梌"],"āo yòu":["梎"],kuǎn:["梡","欵","款","歀"],"shāo sào":["梢"],"qín chén cén":["梣"],"lí sì qǐ":["梩"],"chān yán":["梴"],"bīn bīng":["梹","槟","檳"],"táo chóu dào":["梼"],"cōng sōng":["棇"],"gùn hùn":["棍"],"dé zhé":["棏"],"pái bèi pèi":["棑"],"bàng pǒu bèi bēi":["棓"],"dì dài tì":["棣"],sēn:["森","椮","槮","襂"],"rěn shěn":["棯"],"léng lēng líng":["棱"],"fú sù":["棴"],"zōu sǒu":["棷"],zōu:["棸","箃","緅","諏","诹","邹","郰","鄒","鄹","陬","騶","驺","鯫","鲰","黀","齱","齺"],"zhào zhuō":["棹"],"chēn shēn":["棽"],"jiē qiè":["椄"],"yǐ yī":["椅"],"chóu zhòu diāo":["椆"],"qiāng kōng":["椌"],"zhuī chuí":["椎"],"bēi pí":["椑"],mēn:["椚"],"quān juàn quán":["椦"],"duǒ chuán":["椯"],"wěi huī":["椲"],"jiǎ jiā":["椵"],"hán jiān":["椷"],"shèn zhēn":["椹"],"yàn yà":["椻"],"zhā chá":["楂"],"guō kuǎ":["楇"],"jí zhì":["楖"],"kǔ hù":["楛"],"yóu yǒu":["楢"],"sǒng cōng":["楤"],"yuán xuàn":["楥"],"yǎng yàng yīng":["楧"],pián:["楩","胼","腁","賆","蹁","駢","騈","骈","骿","㛹"],"dié yè":["楪"],"dùn shǔn":["楯"],"còu zòu":["楱"],"dì dǐ shì":["楴"],"kǎi jiē":["楷"],"róu ròu":["楺"],"lè yuè":["楽"],"wēn yùn":["榅","鞰"],lǘ:["榈","櫚","氀","膢","藘","閭","闾","驢","驴"],shén:["榊","神","鉮","鰰","𬬹"],"bī pi":["榌"],"zhǎn niǎn zhèn":["榐"],"fú fù bó":["榑"],"jiàn jìn":["榗"],"bǎng bàng":["榜"],"shā xiè":["榝","樧"],nòu:["槈","耨","鎒","鐞"],"qiǎn lián xiàn":["槏"],gàng:["槓","焵","焹","筻","鿍"],gāo:["槔","槹","橰","櫜","睾","篙","糕","羔","臯","韟","餻","高","髙","鷎","鷱","鼛"],"diān zhěn zhēn":["槙"],"kǎn jiàn":["槛"],"xí dié":["槢"],"jī guī":["槣"],"róng yōng":["槦"],"tuán shuàn quán":["槫"],"qì sè":["槭"],"cuī zhǐ":["槯"],"yǒu chǎo":["槱"],"màn wàn":["槾"],"lí chī":["樆"],"léi lěi":["樏","櫑","礌"],"cháo jiǎo chāo":["樔"],"chēng táng":["樘"],"jiū liáo":["樛"],"mó mú":["模"],"niǎo mù":["樢"],"héng hèng":["横","橫"],xuě:["樰","膤","艝","轌","雪","鱈","鳕"],"fá fèi":["橃"],rùn:["橍","润","潤","膶","閏","閠","闰"],"zhǎn jiǎn":["橏"],shùn:["橓","瞚","瞬","舜","蕣","順","顺","鬊"],"tuí dūn":["橔"],"táng chēng":["橖"],"sù qiū":["橚"],"tán diàn":["橝"],"fén fèn fèi":["橨"],"rǎn yān":["橪"],"cū chu":["橻"],"shū qiāo":["橾"],"píng bò":["檘"],"zhái shì tú":["檡"],"biǎo biāo":["檦"],"qiān lián":["檶"],"nǐ mí":["檷"],"jiàn kǎn":["檻"],"nòu ruǎn rú":["檽"],"jī jì":["櫅","禨"],"huǎng guǒ gǔ":["櫎"],"lǜ chū":["櫖"],"miè mèi":["櫗"],ōu:["櫙","欧","歐","殴","毆","瓯","甌","膒","藲","謳","讴","鏂","鴎","鷗","鸥"],"zhù zhuó":["櫡"],"jué jì":["櫭"],"huái guī":["櫰"],"chán zhàn":["欃"],"wéi zuì":["欈"],cáng:["欌","鑶"],"yù yì":["欥"],"chù qù xì":["欪"],"kài ài":["欬"],"yì yīn":["欭"],"xì kài":["欯"],"shuò sòu":["欶"],"ǎi ēi éi ěi èi ê̄ ế ê̌ ề":["欸"],"qī yī":["欹"],"chuā xū":["欻"],"chǐ chuài":["欼"],"kǎn qiàn":["欿"],"kǎn kè":["歁"],"chuǎn chuán":["歂"],"yīn yān":["歅"],"jìn qūn":["歏"],pēn:["歕"],"xū chuā":["歘"],"xī shè":["歙"],"liǎn hān":["歛"],"zhì chí":["歭"],"sè shà":["歰"],sǐ:["死"],"wěn mò":["歾"],piǎo:["殍","皫","瞟","醥","顠"],"qíng jìng":["殑"],"fǒu bó":["殕"],"zhí shi":["殖"],"yè yān yàn":["殗"],"hūn mèi":["殙"],chòu:["殠","臰","遚"],"kuì huì":["殨","溃","潰"],cuàn:["殩","熶","爨","窜","竄","篡","簒"],"yīn yān yǐn":["殷"],"qìng kēng shēng":["殸"],"yáo xiáo xiào":["殽"],"gū gǔ":["毂","蛄"],"guàn wān":["毌"],"dú dài":["毒"],"xún xùn":["毥"],mú:["毪","氁"],"dòu nuò":["毭"],"sāi suī":["毸"],lu:["氇"],sào:["氉","瘙","矂","髞"],"shì zhī":["氏"],"dī dǐ":["氐"],"máng méng":["氓"],"yáng rì":["氜"],shuǐ:["水","氵","氺","閖"],"zhěng chéng zhèng":["氶"],tǔn:["氽"],"fán fàn":["氾"],"guǐ jiǔ":["氿"],"bīn pà pā":["汃"],"zhuó què":["汋"],"dà tài":["汏"],pìn:["汖","牝","聘"],"hàn hán":["汗","馯"],tu:["汢"],"tāng shāng":["汤","湯"],"zhī jì":["汥"],"gàn hán cén":["汵"],"wèn mén":["汶"],"fāng pāng":["汸"],"hǔ huǎng":["汻"],"niú yóu":["汼"],hàng:["沆"],"shěn chén":["沈"],"dùn zhuàn":["沌"],"nǜ niǔ":["沑"],"méi mò":["沒","没"],"tà dá":["沓"],"mì wù":["沕"],"hóng pāng":["沗"],"shā shà":["沙"],"zhuǐ zǐ":["沝"],"ōu òu":["沤","漚"],"jǔ jù":["沮"],"tuō duó":["沰"],"mǐ lì":["沵"],"yí chí":["沶"],"xiè yì":["泄"],"bó pō":["泊"],"mì bì":["泌","秘"],"chù shè":["泏"],"yōu yòu āo":["泑"],"pēng píng":["泙","硑"],"pào pāo":["泡"],"ní nì":["泥","秜"],"yuè sà":["泧"],"jué xuè":["泬","疦"],"lóng shuāng":["泷","瀧"],"luò pō":["泺","濼"],"zé shì":["泽","澤"],"sǎ xǐ":["洒"],"sè qì zì":["洓"],"xǐ xiǎn":["洗"],"kǎo kào":["洘"],"àn yàn è":["洝"],"lěi lèi":["洡"],"qiè jié":["洯"],"qiǎn jiān":["浅"],"jì jǐ":["济","済","濟","纪"],"hǔ xǔ":["浒","滸"],"jùn xùn":["浚","濬"],"yǐng chéng yíng":["浧"],"liàn lì":["浰"],"féng hóng":["浲","溄"],"jiǒng jiōng":["浻"],"suī něi":["浽"],"yǒng chōng":["涌"],"tūn yūn":["涒"],"wō guō":["涡","渦"],hēng:["涥","脝"],"zhǎng zhàng":["涨","漲"],"shòu tāo":["涭"],shuàn:["涮","腨"],"kōng náng":["涳"],"wò wǎn yuān":["涴"],"tuō tuò":["涶"],wō:["涹","猧","窝","窩","莴","萵","蜗","蝸","踒"],"qiè jí":["淁"],"guǒ guàn":["淉"],"lín lìn":["淋","獜","疄"],"tǎng chǎng":["淌"],"nào chuò zhuō":["淖"],"péng píng":["淜"],féi:["淝","肥","腓","蜰"],"pì pèi":["淠"],"niǎn shěn":["淰"],"biāo hǔ":["淲"],"chún zhūn":["淳"],"hùn hún":["混"],qiǎn:["淺","繾","缱","肷","膁","蜸","譴","谴","遣","鑓"],"wèn mín":["渂"],"rè ruò luò":["渃"],"dú dòu":["渎","瀆","读"],"jiàn jiān":["渐","溅","漸","濺"],"miǎn shéng":["渑","澠"],"nuǎn nuán":["渜"],"qiú wù":["渞"],"tíng tīng":["渟"],"dì tí dī":["渧"],"gǎng jiǎng":["港"],"hōng qìng":["渹"],tuān:["湍","煓"],"huì mǐn xū":["湏"],"xǔ xù":["湑"],pén:["湓","瓫","盆","葐"],"mǐn hūn":["湣"],"tuàn nuǎn":["湪"],"qiū jiǎo":["湫","湬"],"yān yīn":["湮"],"bàn pán":["湴"],"zhuāng hún":["湷"],"yàn guì":["溎"],"lián liǎn nián xián xiàn":["溓"],"dá tǎ":["溚","鿎"],"liū liù":["溜","澑","蹓"],lùn:["溣"],mǎ:["溤","犸","獁","玛","瑪","码","碼","遤","鎷","馬","马","鰢","鷌"],"zhēn qín":["溱"],"nì niào":["溺"],"chù xù":["滀","畜"],"wěng wēng":["滃"],"hào xuè":["滈"],"qì xì xiē":["滊"],"xíng yíng":["滎"],"zé hào":["滜"],"piāo piào piǎo":["漂"],"cóng sǒng":["漎"],"féng péng":["漨"],"luò tà":["漯"],"pēng bēn":["漰"],"chóng shuāng":["漴"],"huǒ kuò huò":["漷"],"liáo liú":["漻"],"cuǐ cuī":["漼"],"cóng zǒng":["潀"],"cóng zōng":["潈"],"pì piē":["潎"],"dàng xiàng":["潒"],"huáng guāng":["潢"],"liáo lào lǎo":["潦"],"cōng zòng":["潨"],"zhí zhì":["潪"],"tān shàn":["潬"],"tú zhā":["潳"],"sàn sǎ":["潵"],hēi:["潶","黑","黒","𬭶"],"chéng dèng":["澄","瀓"],"cūn cún":["澊"],"péng pēng":["澎"],"hòng gǒng":["澒","銾"],"wàn màn":["澫"],"kuài huì":["澮"],"guō wō":["濄"],"pēn fén":["濆"],"jí shà":["濈"],"huì huò":["濊"],"dǐng tìng":["濎"],"mǐ nǐ":["濔"],"bì pì":["濞"],"cuì zuǐ":["濢"],"hù huò":["濩"],"ǎi kài kè":["濭"],"wěi duì":["濻","瀢"],"zàn cuán":["濽","灒"],"yǎng yàng":["瀁"],"wǎng wāng":["瀇"],"mò miè":["瀎","眜"],suǐ:["瀡","膸","髓"],"huái wāi":["瀤"],"zùn jiàn":["瀳"],"yīng yǐng yìng":["瀴"],"ráng ràng":["瀼"],shuàng:["灀"],"zhuó jiào zé":["灂"],sǎ:["灑","訯","靸"],"luán luàn":["灓"],"dǎng tǎng":["灙"],"xún quán quàn":["灥"],"huǒ biāo":["灬"],"zhà yù":["灹"],"fén bèn":["炃"],"jiǒng guì":["炅"],"pàng fēng":["炐"],quē:["炔","缺","缼","蒛"],biān:["炞","煸","甂","砭","笾","箯","籩","編","编","蝙","邉","邊","鍽","鞭","鯾","鯿","鳊"],"zhāo zhào":["炤"],"zhuō chù":["炪"],"pào páo bāo":["炮"],"páo fǒu":["炰"],"shǎn qián shān":["炶"],"zhà zhá":["炸"],"jiǎo yào":["烄"],quǎn:["烇","犬","犭","畎","綣","绻","虇"],"yàng yáng":["烊"],"lào luò":["烙"],"huí huǐ":["烠"],rè:["热","熱"],"fú páo":["烰"],"xiè chè":["烲","焎"],"yàn shān":["烻"],"hūn xūn":["焄"],kào:["焅","犒","銬","铐","靠","鮳","鯌","鲓","㸆"],"juān yè":["焆"],"jùn qū":["焌"],"tāo dào":["焘"],"chǎo jù":["焣"],"wò ài":["焥"],"zǒng cōng":["焧"],"xī yì":["焬"],"xìn xīn":["焮"],"chāo zhuō":["焯"],"xiǒng yīng":["焸","焽"],kuǐ:["煃","跬","蹞","頍","𫠆"],"huī yùn xūn":["煇"],"jiǎo qiāo":["煍"],"qián shǎn shān":["煔"],"xī yí":["煕"],"shà shā":["煞"],"yè zhá":["煠"],"yáng yàng":["煬"],"ēn yūn":["煾"],"yūn yǔn":["熅"],"hè xiāo":["熇"],xióng:["熊","熋","雄"],"xūn xùn":["熏","爋"],gòng:["熕","貢","贡"],liū:["熘"],"cōng zǒng":["熜"],"lù āo":["熝"],"shú shóu":["熟"],"fēng péng":["熢"],"cuǐ suī":["熣"],tēng:["熥","膯","鼟"],"yùn yù":["熨"],"áo āo":["熬"],"hàn rǎn":["熯"],"ōu ǒu":["熰"],"huáng huǎng":["熿"],"chǎn dǎn chàn":["燀"],"jiāo zhuó qiáo jué":["燋"],"yàn yān":["燕"],"tài liè":["燤"],āo:["爊"],"yàn xún":["爓"],"jué jiào":["爝","覐","覚","覺","觉"],"lǎn làn":["爦"],"zhuǎ zhǎo":["爪"],"zhǎo zhuǎ":["爫"],"fù fǔ":["父"],diē:["爹","褺","跌"],zāng:["牂","羘","臧","賍","賘","贓","贜","赃","髒"],"piàn piān":["片"],"biān miàn":["牑"],bǎng:["牓","綁","绑"],"yǒu yōng":["牗"],"chēng chèng":["牚","竀"],niú:["牛","牜"],"jiū lè":["牞"],"mù móu":["牟"],māng:["牤"],"gē qiú":["牫"],"yòu chōu":["牰"],"tè zhí":["犆"],bēn:["犇","錛","锛"],"jiān qián":["犍","玪"],má:["犘","痲","蔴","蟇","麻"],"máo lí":["犛"],"bá quǎn":["犮"],"zhuó bào":["犳"],"àn hān":["犴"],"kàng gǎng":["犺"],"pèi fèi":["犻"],"fān huān":["犿"],kuáng:["狂","狅","誑","诳","軖","軠","鵟","𫛭"],"yí quán chí":["狋"],"xīng shēng":["狌"],"tuó yí":["狏"],kǔ:["狜","苦"],"huán huān":["狟"],"hé mò":["狢"],"tà shì":["狧"],"máng dòu":["狵"],"xī shǐ":["狶"],suān:["狻","痠","酸"],"bài pí":["猈"],"jiān yàn":["猏","豣"],"yī yǐ":["猗"],"yá wèi":["猚"],cāi:["猜"],"māo máo":["猫","貓"],"chuàn chuān":["猭"],"tuān tuàn":["猯","貒"],"yà jiá qiè":["猰"],"hè xiē gé hài":["猲"],"biān piàn":["猵","獱"],"bó pò":["猼"],"háo gāo":["獋"],"fén fèn":["獖"],"yào xiāo":["獟"],"shuò xī":["獡"],"gé liè xiē":["獦"],"nòu rú":["獳"],"náo nǎo yōu":["獶"],ráng:["獽","瓤","禳","穣","穰","蘘","躟","鬤"],"náo yōu":["獿"],"lǜ shuài":["率"],"wáng wàng":["王"],"yáng chàng":["玚"],"mín wén":["玟"],"bīn fēn":["玢"],"mén yǔn":["玧"],"qiāng cāng":["玱","瑲","篬"],"án gān":["玵"],"xuán xián":["玹"],"cī cǐ":["玼","跐"],"yí tāi":["珆"],"zǔ jù":["珇"],fà:["珐","琺","蕟","髪","髮"],"yín kèn":["珢"],"huī hún":["珲"],"xuán qióng":["琁"],"fú fū":["琈"],"bǐng pín":["琕"],"cuì sè":["琗"],"yù wéi":["琟"],"tiǎn tiàn":["琠"],"zhuó zuó":["琢"],"běng pěi":["琣"],guǎn:["琯","璭","痯","筦","管","舘","輨","錧","館","馆","鳤"],"hún huī":["琿"],"xié jiē":["瑎"],"chàng dàng yáng":["瑒"],"tiàn zhèn":["瑱"],"bīn pián":["瑸","璸"],"tú shū":["瑹"],cuǐ:["璀","皠","趡"],"zǎo suǒ":["璅"],"jué qióng":["璚"],"lú fū":["璷"],"jì zī":["璾"],suí:["瓍","綏","绥","遀","随","隨","髄"],"mí xǐ":["瓕"],"qióng wěi wèi":["瓗"],"huán yè yà":["瓛"],"bó páo":["瓟"],"zhí hú":["瓡"],piáo:["瓢","闝"],"wǎ wà":["瓦"],"xiáng hóng":["瓨"],wèng:["瓮","甕","罋","蕹","齆"],"shèn shén":["甚"],ruí:["甤","緌","蕤"],yòng:["用","砽","苚","蒏","醟","㶲"],shuǎi:["甩"],béng:["甭","甮"],"yóu zhá":["甴"],"diàn tián shèng":["甸"],"tǐng dīng":["町","甼"],"zāi zī":["甾"],"bì qí":["畁"],"dá fú":["畗"],"cè jì":["畟"],"zāi zī tián":["畠"],"zhì chóu shì":["畤"],"fān pān":["畨","番"],"shē yú":["畬"],"dāng dàng dǎng":["當"],"jiāng qiáng":["疆"],"pǐ yǎ shū":["疋"],"jié qiè":["疌"],"yí nǐ":["疑"],nè:["疒","眲","訥","讷"],"gē yì":["疙"],"nüè yào":["疟","瘧"],"lì lài":["疠","癘"],"yǎ xiā":["疨"],xuē:["疶","蒆","薛","辥","辪","靴","鞾"],"dǎn da":["疸"],"fá biǎn":["疺"],"fèi féi":["疿","痱"],"shān diàn":["痁"],"téng chóng":["痋"],"tōng tóng":["痌"],"wěi yòu yù":["痏"],"tān shǐ":["痑"],"pū pù":["痡","鋪"],"bēng péng":["痭"],"má lìn":["痳"],"tiǎn diàn":["痶"],"ān yè è":["痷"],"kē ē":["痾"],"zhì chì":["瘈"],"jiǎ xiá xiā":["瘕"],"lěi huì":["瘣"],"chài cuó":["瘥"],"diān chēn":["瘨"],"da dá":["瘩"],"biě biē":["瘪"],qué:["瘸"],"dàn dān":["癉"],"guì wēi":["癐"],"nòng nóng":["癑"],"biē biě":["癟"],"bō bǒ":["癷"],bái:["白"],"jí bī":["皀"],"de dì dí dī":["的"],"pā bà":["皅"],"gāo háo":["皋"],"gāo yáo":["皐"],"lì luò bō":["皪"],"zhā cǔ":["皻"],"zhāo zhǎn dǎn":["皽"],"jiān jiàn":["监","監","鋻","间","鞬"],"gài gě hé":["盖"],"máng wàng":["盳"],yuǎn:["盶","逺","遠"],"tián xián":["盷"],"xiāng xiàng":["相"],dǔn:["盹","趸","躉"],"xì pǎn":["盻"],"shěng xǐng":["省"],"yún hùn":["眃"],"miǎn miàn":["眄"],"kàn kān":["看"],"yìng yāng yǎng":["眏"],"yǎo āo ǎo":["眑"],"jū xū kōu":["眗"],"yí chì":["眙"],"dié tì":["眣"],"bǐng fǎng":["眪"],"pàng pán":["眫"],"mī mí":["眯","瞇"],"xuàn shùn xún":["眴"],tiào:["眺","粜","糶","覜","趒"],"zhe zhuó zháo zhāo":["着"],"qiáo shào xiāo":["睄"],"cuó zhuài":["睉"],gùn:["睔","謴"],"suì zuì":["睟"],"pì bì":["睥","稫","辟"],"yì zé gāo":["睪"],"xǐng xìng":["睲"],"guì wèi kuì":["瞆"],"kòu jì":["瞉"],"qióng huán":["瞏"],"mán mén":["瞒","瞞"],"diāo dōu":["瞗"],"lou lóu lǘ":["瞜"],"shùn rún":["瞤"],"liào liǎo":["瞭","钌"],"jiàn xián":["瞯"],"wǔ mí":["瞴"],"guì kuì":["瞶"],"nǐng chēng":["矃"],"huò yuè":["矆"],"mēng méng":["矇"],"kuàng guō":["矌"],"guàn quán":["矔"],"mǎn mán":["矕"],"jīn guān qín":["矜"],"jīn qín guān":["矝"],"yù xù jué":["矞"],"jiǎo jiáo":["矫","矯"],duǎn:["短"],"shí dàn":["石"],"gāng qiāng kòng":["矼"],"huā xū":["砉"],"pīn bīn fēn":["砏"],"yán yàn":["研","硏"],"luǒ kē":["砢"],"fú fèi":["砩","笰"],"zhǔ zhù":["砫"],"lá lì lā":["砬"],"kuāng guāng":["硄"],"gè luò":["硌"],"shuò shí":["硕","碩"],"wèi wéi ái":["硙"],"què kè kù":["硞"],"mǎng bàng":["硥"],"luò lòng":["硦"],"yǒng tóng":["硧"],nüè:["硸","虐"],"kēng kěng":["硻"],"yān yǎn":["硽"],"zhuì chuí duǒ":["硾"],"kōng kòng":["硿"],"zòng cóng":["碂"],"jiān zhàn":["碊"],"lù liù":["碌","陆"],"què xī":["碏"],"lún lǔn lùn":["碖"],"náo gāng":["碙"],"jié yà":["碣"],"wèi wěi":["碨"],"tí dī":["碮"],"chá chā":["碴"],"qiāo què":["碻"],"sù xiè":["碿"],"liú liù":["磂","遛","鎦","馏"],"sī tí":["磃"],"bàng páng":["磅"],"huá kě gū":["磆"],"wěi kuǐ":["磈"],"xiá qià yà":["磍"],"lián qiān":["磏"],"wèi ái gài":["磑"],"lá lā":["磖"],"áo qiāo":["磝"],"pēng pèng":["磞","閛"],"yīn yǐn":["磤"],"lěi léi":["磥"],"mó mò":["磨"],"qì zhú":["磩"],"láo luò":["磱"],"pán bō":["磻"],"jí shé":["磼"],"hé qiāo qiào":["礉"],"kè huò":["礊"],"què hú":["礐"],"è qì":["礘"],cǎ:["礤","礸"],"xián xín":["礥"],"léi lěi lèi":["礧"],"yán yǎn":["礹"],"qí zhǐ":["祇","蚔"],"bēng fāng":["祊"],"bì mì":["祕"],suàn:["祘","笇","筭","算","蒜"],"piào piāo":["票"],"jì zhài":["祭"],"shuì lèi":["祱"],"jìn jīn":["禁"],"chán shàn":["禅"],"yáng shāng":["禓"],"zhī zhǐ tí":["禔"],"shàn chán":["禪"],"yú yù ǒu":["禺"],"zǐ zì":["秄"],"chá ná":["秅"],"zhǒng zhòng chóng":["种"],"hào mào":["秏"],"kù kū":["秙"],zū:["租","葅"],chèng:["秤","穪"],"huó kuò":["秮","秳"],"chēng chèn chèng":["称","稱"],"shì zhì":["秲","銴"],"fù pū":["秿"],"xùn zè":["稄"],"tú shǔ":["稌"],"zhùn zhǔn":["稕"],"jī qí":["稘","綨","觭"],"léng líng":["稜"],"zuì zú sū":["稡"],"xì qiè":["稧","郄"],"zhǒng zhòng":["種"],"zōng zǒng":["稯"],"xián jiān liàn":["稴"],"zī jiū":["稵"],"jī qǐ":["稽"],ròng:["穃"],"shān cǎn cēn":["穇"],"mén méi":["穈"],"jǐ jì":["穖"],"xiāo rào":["穘"],"zhuō bó":["穛"],"tóng zhǒng zhòng":["穜"],zuō:["穝"],"biāo pāo":["穮","藨"],"zhuō jué":["穱"],"cuán zàn":["穳"],"kōng kòng kǒng":["空"],"yū yǔ":["穻"],zhǎi:["窄","鉙"],báo:["窇","雹"],"kū zhú":["窋"],"jiào liáo liù":["窌"],"wā guī":["窐"],"tiǎo yáo":["窕"],"xūn yìn":["窨"],"yà yē":["窫"],"tián diān yǎn":["窴"],"chāo kē":["窼"],"kuǎn cuàn":["窽","窾"],"chù qì":["竐"],"qǔ kǒu":["竘"],"jìng zhěn":["竧"],"kǎn kàn":["竷"],"zhú dǔ":["竺"],"lè jīn":["竻"],"zhuì ruì":["笍"],"háng hàng":["笐"],"cén jìn hán":["笒"],"dā xiá nà":["笚"],"zé zuó":["笮"],"lóng lǒng":["笼","篭","籠","躘","龓"],"zhù zhú":["筑","築"],"dá dā":["答","荅"],shāi:["筛","篩","簁","籭"],"yún jūn":["筠"],"láng làng":["筤","郎","阆"],"zhì zhǐ":["筫"],o:["筽"],"póu bù fú pú":["箁"],"pái bēi":["箄"],gè:["箇","虼","鉻","铬"],"tái chí":["箈"],"guǎi dài":["箉"],"zhào dào":["箌"],"jīng qìng":["箐"],"lín lǐn":["箖"],"jùn qūn":["箘"],"shī yí":["箷","釶"],"yuē yào chuò":["箹"],"xiāo shuò qiào":["箾"],"gōng gǎn lǒng":["篢"],"páng péng":["篣"],"zhuó huò":["篧"],"jiǎn jiān":["篯"],"dí zhú":["篴"],"zān cēn cǎn":["篸"],"zhuàn suǎn zuàn":["篹"],"piǎo biāo":["篻"],"guó guì":["簂"],"cè jí":["簎"],"mì miè":["簚"],"shāi sī":["簛"],"sǔn zhuàn":["簨"],"gàn gǎn":["簳"],"bò bǒ":["簸"],"bó bù":["簿"],shi:["籂"],"zhēn jiān":["籈"],"zhuàn zuǎn":["籑"],"fān pān biān":["籓"],"sǒu shǔ":["籔"],zuǎn:["籫","繤","纂","纉","纘","缵"],nǚ:["籹","釹","钕"],"shā chǎo":["粆"],"kāng jīng":["粇"],fěn:["粉","黺"],cū:["粗","觕","麁","麄","麤"],"nián zhān":["粘"],"cè sè":["粣"],"zhōu yù":["粥"],"shēn sǎn":["糁"],"biān biǎn":["糄","萹"],miàn:["糆","面","靣","麪","麫","麵","麺"],"hú hū hù":["糊"],"gǔ gòu":["糓"],"mí méi":["糜"],"sǎn shēn":["糝","糣"],zāo:["糟","蹧","遭","醩"],"mì sī":["糸"],"jiū jiǔ":["糺"],"xì jì":["系","繫"],"zhēng zhěng":["糽"],"chà chǎ":["紁","衩"],"yuē yāo":["約","约"],"hóng gōng":["紅","红"],"hé gē":["紇","纥"],"wén wèn":["紋","纹"],fóu:["紑"],"jì jié jiè":["紒"],"pī pí bǐ":["紕","纰"],"jīn jìn":["紟"],"zhā zā":["紥","紮"],hā:["紦"],"fū fù":["紨"],"chōu chóu":["紬"],"lèi léi lěi":["累"],"bō bì":["紴"],"tiǎn zhěn":["紾"],"jiōng jiǒng":["絅"],"jié jiē":["結","结","节"],"guà kuā":["絓"],"bǎi mò":["絔"],"gēng huán":["絙"],"jié xié":["絜"],"quán shuān":["絟"],"gǎi ǎi":["絠"],"luò lào":["絡","络"],"bīng bēng pēng":["絣"],"gěi jǐ":["給","给"],"tóng tōng dòng":["絧"],"tiào diào dào":["絩"],"lěi lèi léi":["絫"],"gāi hài":["絯"],"chī zhǐ":["絺"],"wèn miǎn mán wàn":["絻"],"huán huàn wàn":["綄"],"qīn xiān":["綅"],"tì tí":["綈"],"yán xiàn":["綖"],"zōng zèng zòng":["綜"],"chēn lín":["綝"],"zhǔn zhùn":["綧"],"qiàn qīng zhēng":["綪"],"qìng qǐ":["綮"],"lún guān":["綸","纶"],"chuò chāo":["綽","绰"],"tián tǎn chān":["緂"],"lǜ lù":["緑","绿"],"ruǎn ruàn":["緛"],"jí qī":["緝"],"zhòng chóng":["緟","重"],"miáo máo":["緢"],"xiè yè":["緤"],huǎn:["緩","缓","㬊"],"gēng gèng":["緪","縆"],"tōu xū shū":["緰"],"zōng zòng":["緵","繌"],"yùn gǔn":["緷"],"guā wō":["緺"],"yùn yūn wēn":["緼","縕"],"bāng bàng":["縍"],"gǔ hú":["縎","鶻"],"cī cuò suǒ":["縒"],"cuī shuāi":["縗"],"róng rǒng ròng":["縙"],"zài zēng":["縡"],cài:["縩","菜","蔡"],"féng fèng":["縫"],"suō sù":["縮","缩"],"yǎn yǐn":["縯","酓"],"zòng zǒng":["縱","纵"],"zhuàn juàn":["縳"],"mò mù":["縸","莫"],"piǎo piāo":["縹","缥"],"fán pó":["繁"],"bēng bèng":["繃"],"móu miù miào liǎo":["繆"],"yáo yóu zhòu":["繇"],"zēng zèng":["繒","缯"],"jú jué":["繘"],"chuō chuò":["繛"],"zūn zǔn":["繜"],rào:["繞","绕","遶"],"chǎn chán":["繟"],"huì huí":["繢","缋","藱"],"qiāo sāo zǎo":["繰"],"jiǎo zhuó":["繳","缴"],"dàn tán chán":["繵"],nǒng:["繷"],"pú fú":["纀"],"yào lì":["纅"],"rǎng xiāng":["纕"],"lí sǎ xǐ lǐ":["纚"],"xiān qiàn":["纤"],"jīng jìng":["经"],"tí tì":["绨"],"bēng běng bèng":["绷"],"zōng zèng":["综"],"jī qī":["缉"],"wēn yùn yūn":["缊"],"fèng féng":["缝"],"shuāi cuī suī":["缞"],"miù móu liáo miào mù":["缪"],"qiāo sāo":["缲"],fǒu:["缶","缹","缻","雬","鴀"],"bà ba pí":["罢","罷"],"guà guǎi":["罫"],"yáng xiáng":["羊","羏"],"měi gāo":["羙"],"yì xī":["羛"],"qiǎng qiān":["羟"],"qiāng kòng":["羫"],"qián xián yán":["羬"],nóu:["羺"],"hóng gòng":["羾"],"pī bì pō":["翍"],"qú yù":["翑"],ké:["翗"],"qiào qiáo":["翘"],"zhái dí":["翟"],"dào zhōu":["翢"],"hóu qú":["翵"],shuǎ:["耍"],"ruǎn nuò":["耎"],"ér nài":["耏"],"zhuān duān":["耑"],"pá bà":["耙"],"chí sì":["耛"],"qù chú":["耝"],"lún lǔn":["耣"],"jí jiè":["耤"],"tāng tǎng":["耥"],pǎng:["耪","覫"],"zhá zé":["耫"],"yē yé":["耶"],"yún yíng":["耺"],"wà tuǐ zhuó":["聉"],"ér nǜ":["聏"],"tiē zhé":["聑"],"dǐ zhì":["聜"],qié:["聺"],"nǐ jiàn":["聻"],"lèi lē":["肋"],cào:["肏","襙","鄵","鼜"],"bó dí":["肑"],"xiào xiāo":["肖"],"dù dǔ":["肚"],chāi:["肞","釵","钗"],"hán qín hàn":["肣"],"pàng pán pàn":["肨","胖"],"zhūn chún":["肫"],āng:["肮","骯"],"yù yō":["育"],"pí bǐ bì":["肶"],"fèi bì":["胇"],"bèi bēi":["背"],"fèi zǐ":["胏"],"píng pēng":["胓","苹"],"fū fú zhǒu":["胕"],"shèng shēng":["胜"],kuà:["胯","跨","骻"],"gǎi hǎi":["胲"],"gē gé gā":["胳"],"néng nài":["能"],"guī kuì":["胿"],"mài mò":["脉"],"zāng zàng":["脏"],"jiǎo jué":["脚","角"],cuǒ:["脞"],"de te":["脦"],"zuī juān":["脧"],něi:["脮","腇","餒","馁","鮾","鯘"],"pú fǔ":["脯"],niào:["脲"],shuí:["脽"],guò:["腂","過","鐹"],"là xī":["腊"],"yān ā":["腌"],"gāo gào":["膏"],"lù biāo":["膔"],chuái:["膗"],"zhuān chuán chún zhuǎn":["膞"],chuài:["膪","踹"],"fán pán":["膰"],"wǔ hū":["膴"],"shān dàn":["膻"],tún:["臀","臋","蛌","豘","豚","軘","霕","飩","饨","魨","鲀","黗"],"bì bei":["臂"],"là gé":["臈"],"sào sāo":["臊"],nào:["臑","閙","闹","鬧"],"ní luán":["臡"],"qiān xián":["臤"],"guàng jiǒng":["臦"],"guǎng jiǒng":["臩"],"chòu xiù":["臭"],"mián biān":["臱"],"dié zhí":["臷"],"zhī jìn":["臸"],"shè shě":["舍"],pù:["舖","舗"],"bān bō pán":["般"],kuā:["舿"],"gèn gěn":["艮"],"sè shǎi":["色"],"fú bó":["艴"],"jiāo qiú":["艽"],"chāi chā":["芆"],"sháo què":["芍"],"hù xià":["芐"],"zì zǐ":["芓"],"huì hū":["芔"],"tún chūn":["芚"],"jiè gài":["芥"],"xù zhù":["芧"],"yuán yán":["芫"],"xīn xìn":["芯"],"lún huā":["芲"],"wù hū":["芴"],"gōu gǒu":["芶"],"mào máo":["芼"],"fèi fú":["芾"],"chán yín":["苂"],qiē:["苆"],"sū sù":["苏"],"tiáo sháo":["苕"],"lì jī":["苙"],"kē hē":["苛"],"jù qǔ":["苣"],"ruò rě":["若"],"zhù níng":["苧"],"pā bó":["苩"],xiú:["苬"],"zhǎ zuó":["苲"],"jū chá":["苴"],nié:["苶"],"shēng ruí":["苼"],"qié jiā":["茄"],"zǐ cí":["茈"],"qiàn xī":["茜"],chǎi:["茝"],"fá pèi":["茷"],ráo:["荛","蕘","襓","饒","饶"],"yíng xíng":["荥"],"qián xún":["荨","蕁"],"yìn yīn":["荫"],"hé hè":["荷"],"shā suō":["莎"],"péng fēng":["莑"],"shēn xīn":["莘"],"wǎn guān guǎn":["莞"],"yóu sù":["莤"],"shāo xiāo":["莦","蛸"],"làng liáng":["莨"],"piǎo fú":["莩"],"wèn wǎn miǎn":["莬"],"shì shí":["莳","蒔"],"tù tú":["莵"],"xiān liǎn":["莶","薟"],"wǎn yù":["菀"],"zōu chù":["菆"],"lù lǜ":["菉"],"jūn jùn":["菌"],"niè rěn":["菍"],"zī zì zāi":["菑"],"tú tù":["菟"],"jiē shà":["菨"],"qiáo zhǎo":["菬"],"tái zhī chí":["菭"],"fēi fěi":["菲","蜚"],"qín qīn jīn":["菳"],"zū jù":["菹","蒩"],"lǐn má":["菻"],"tián tiàn":["菾"],tiē:["萜","貼","贴"],"luò là lào luō":["落"],"zhù zhuó zhe":["著"],"shèn rèn":["葚"],"gě gé":["葛"],"jùn suǒ":["葰"],"kuì kuài":["蒉"],"rú ná":["蒘"],"méng mēng měng":["蒙"],"yuán huán":["蒝"],"xú shú":["蒣"],"xí xì":["蒵"],"mì míng":["蓂"],"sōu sǒu":["蓃"],"gài gě hé hài":["蓋"],"yǎo zhuó":["蓔"],"diào tiáo dí":["蓧"],"xū qiū fū":["蓲"],"zí jú":["蓻"],"liǎo lù":["蓼"],xu:["蓿"],"hàn hǎn":["蔊"],"màn wàn mán":["蔓"],"pó bò":["蔢"],"fān fán bō":["蕃"],"hóng hòng":["蕻"],"yù ào":["薁","隩"],"xí xiào":["薂"],"báo bó bò":["薄"],"cí zī":["薋"],"wàn luàn":["薍"],"kǎo hāo":["薧"],"yuǎn wěi":["薳"],"zhòu chóu":["薵"],"wō mái":["薶"],"xiāo hào":["藃"],"yù xù xū":["藇"],"jiè jí":["藉"],"diào zhuó":["藋"],"cáng zàng":["藏"],lǎ:["藞"],"chú zhū":["藸"],"pín píng":["蘋"],"gān hán":["虷"],"hóng jiàng":["虹"],"huī huǐ":["虺"],"xiā há":["虾"],"mǎ mà mā":["蚂"],"fāng bàng":["蚄"],"bàng bèng":["蚌"],"jué quē":["蚗"],"qín qián":["蚙"],"gōng zhōng":["蚣"],"fǔ fù":["蚥"],"dài dé":["蚮"],"gǒu qú xù":["蚼"],"bǒ pí":["蚾"],"shé yí":["蛇"],tiě:["蛈","鉄","銕","鐡","鐵","铁","驖"],"gé luò":["蛒"],"máng bàng":["蛖"],"yì xǔ":["蛡"],"há gé":["蛤"],"qiè ní":["蛪"],"é yǐ":["蛾"],"zhē zhé":["蜇"],"là zhà":["蜡"],suò:["蜶","逤"],"yóu qiú":["蝤"],"xiā hā":["蝦"],"xī qī":["螇"],"bī pí":["螕"],"nài něng":["螚"],"hé xiá":["螛"],"guì huǐ":["螝"],"mǎ mā mà":["螞"],"shì zhē":["螫"],"zhì dié":["螲"],"jiàn chán":["螹"],"ma má mò":["蟆"],"mǎng měng":["蟒"],"biē bié":["蟞"],"bēn fèi":["蟦"],"láo liáo":["蟧"],"yín xún":["蟫"],"lí lǐ":["蠡"],"xuè xiě":["血"],"xíng háng hàng héng":["行"],"shuāi cuī":["衰"],"tuó tuō":["袉"],"lǐng líng":["袊"],"bào páo pào":["袌"],"jù jiē":["袓"],"hè kè":["袔"],"yí yì":["袘","貤"],"nà jué":["袦"],"bèi pī":["被"],"chǐ nuǒ":["袲"],"chǐ qǐ duǒ nuǒ":["袳"],"jiá qiā jié":["袷"],"bó mò":["袹"],"guī guà":["袿"],"liè liě":["裂"],"chéng chěng":["裎"],"jiē gé":["裓"],"dāo chóu":["裯"],"shang cháng":["裳"],"yuān gǔn":["裷"],"yǎn ān":["裺"],"tì xī":["裼"],"fù fú":["褔"],"chǔ zhǔ":["褚"],"tuì tùn":["褪"],lǎi:["襰"],"yào yāo":["要"],"qín tán":["覃"],"jiàn xiàn":["見","见"],piǎn:["覑","諞","谝","貵","𡎚"],"piē miè":["覕"],"yíng yǐng":["覮"],"qù qū":["覰","覷","觑"],"jiàn biǎn":["覵"],"luó luǎn":["覶"],"zī zuǐ":["觜"],"huà xiè":["觟"],"jiě jiè xiè":["解","觧"],"xué hù":["觷"],"lì lù":["觻"],tǎo:["討","讨"],zhùn:["訰"],"zī zǐ":["訾"],"yí dài":["詒","诒"],xiòng:["詗","诇"],"diào tiǎo":["誂"],"yí chǐ chì":["誃"],"lǎng làng":["誏"],"ēi éi ěi èi xī":["誒","诶"],shuà:["誜"],"yǔ yù":["語","语","雨"],"shuō shuì yuè":["說","说"],"shuí shéi":["誰","谁"],"qū juè":["誳"],"chī lài":["誺"],"nì ná":["誽"],"diào tiáo":["調"],"pǐ bēi":["諀"],"jì jī":["諅"],"zé zuò zhǎ cuò":["諎"],"chù jí":["諔"],"háo xià":["諕"],"lùn lún":["論","论"],"shì dì":["諟"],"huà guā":["諣"],"xǐ shāi āi":["諰"],"nán nàn":["諵","難"],miù:["謬","谬"],zèn:["譖","谮"],"shí zhì":["識","识"],"juàn xuān":["讂"],"yí tuī":["讉"],zhán:["讝"],"xǔ hǔ":["许"],"xiáng yáng":["详"],"tiáo diào zhōu":["调"],"chén shèn":["谌"],"mí mèi":["谜"],"màn mán":["谩"],"gǔ yù":["谷"],"huō huò huá":["豁"],"zhì zhài":["豸"],"huān huán":["貆"],"kěn kūn":["貇"],"mò hé":["貈"],"mò hé háo":["貉"],"jù lóu":["貗"],"zé zhài":["責","责"],"dài tè":["貸"],"bì bēn":["賁"],"jiǎ gǔ jià":["賈"],"xiōng mín":["賯"],càng:["賶"],"zhuàn zuàn":["賺","赚"],"wàn zhuàn":["贃"],"gàn gòng zhuàng":["贛"],"yuán yùn":["贠"],"bēn bì":["贲"],"jiǎ gǔ":["贾"],zǒu:["走","赱","鯐"],"dié tú":["趃"],"jū qiè":["趄"],"qū cù":["趋","趨"],"jí jié":["趌"],"guā huó":["趏"],"què qì jí":["趞"],"tàng tāng":["趟"],"chuō zhuó":["趠"],"qù cù":["趣"],"yuè tì":["趯"],"bō bào":["趵"],"kuà wù":["趶"],"guì jué":["趹"],"fāng fàng páng":["趽"],"páo bà":["跁"],"qí qǐ":["跂"],"jiàn chén":["跈"],"pǎo páo":["跑"],"diǎn diē tiē":["跕"],"jū jù qiè":["跙"],bǒ:["跛"],"luò lì":["跞"],"dài duò duō chí":["跢"],zhuǎi:["跩"],"bèng pián":["跰"],"tiào táo":["跳"],"shū chōu":["跾"],"liàng liáng":["踉"],"tà tā":["踏"],chǎ:["蹅","鑔","镲"],"dí zhí":["蹢"],"dēng dèng":["蹬","鐙","镫"],cèng:["蹭"],"dūn cún":["蹲"],"juě jué":["蹶"],liāo:["蹽"],"xiè sǎ":["躠"],tǐ:["躰","軆","骵"],"yà zhá gá":["轧","軋"],"xìn xiàn":["軐"],"fàn guǐ":["軓"],"zhuàn zhuǎn":["転"],"zhóu zhòu":["軸","轴"],bú:["轐","醭","鳪"],"zhuǎn zhuàn zhuǎi":["转"],"zǎi zài":["载"],"niǎn zhǎn":["辗"],"biān bian":["边"],"dào biān":["辺"],"yǐ yí":["迆","迤","迱"],"guò guo guō":["过"],"wàng kuāng":["迋"],"hái huán":["还"],"zhè zhèi":["这"],"yuǎn yuàn":["远"],"zhì lì":["迣"],"zhù wǎng":["迬"],"zhuī duī":["追"],"shì kuò":["适"],tòu:["透"],"tōng tòng":["通"],guàng:["逛"],"dǎi dài":["逮"],"suì suí":["遂"],"tí dì":["遆"],"yí wèi":["遗"],"shì dí zhé":["適"],cà:["遪"],"huán hái":["還"],"lí chí":["邌"],"kàng háng":["邟"],"nà nèi nā":["那"],"xié yá yé yú xú":["邪"],"gāi hái":["郂"],"huán xún":["郇"],"chī xī":["郗"],hǎo:["郝"],"lì zhí":["郦"],"xiáo ǎo":["郩"],"dōu dū":["都"],liǎo:["曢","鄝","镽"],"zàn cuán cuó":["酂","酇"],"dīng dǐng":["酊"],"cù zuò":["酢"],"fā pō":["酦"],"shāi shī":["酾"],niàng:["酿","醸"],"qiú chōu":["醔"],"pō fā":["醗","醱"],"chǎn chěn":["醦"],"yàn liǎn xiān":["醶"],"niàng niáng":["釀"],"lǐ li":["里"],"lí xǐ xī":["釐"],"liǎo liào":["釕"],"dīng dìng":["釘","钉"],"qiǎo jiǎo":["釥"],"yú huá":["釪"],"huá wū":["釫"],"rì rèn jiàn":["釰","釼"],"dì dài":["釱"],"pī zhāo":["釽"],"yá yé":["釾"],"bǎ pá":["鈀","钯"],"tā tuó":["鉈","铊"],běi:["鉳"],"bǐng píng":["鉼"],"hā kē":["鉿","铪"],chòng:["銃","铳"],"xiǎng jiōng":["銄"],"yù sì":["銉"],"xù huì":["銊"],"rén rěn":["銋"],"shàn shuò":["銏"],"chì lì":["銐"],"xiǎn xǐ":["銑","铣"],"hóu xiàng":["銗"],"diào tiáo yáo":["銚"],"xiān kuò tiǎn guā":["銛","銽","铦"],"zhé niè":["銸"],"zhōng yōng":["銿"],"tōu tù dòu":["鋀"],"méi méng":["鋂"],"wàn jiǎn":["鋄","鎫"],"tǐng dìng":["鋌","铤"],"juān jiān cuān":["鋑"],"sī tuó":["鋖"],"juān xuān juàn":["鋗"],"wú huá wū":["鋘"],"zhuó chuò":["鋜"],"xíng xìng jīng":["鋞"],"jū jú":["鋦","锔"],"zuì niè":["鋷"],"yuān yuǎn wǎn wān":["鋺"],"gāng gàng":["鋼","钢"],zhuī:["錐","锥","騅","骓","鵻"],ā:["錒","锕"],"cuō chā":["鎈"],"suǒ sè":["鎍"],"yáo zú":["鎐"],"yè tà gé":["鎑"],"qiāng chēng":["鎗"],"gé lì":["鎘","镉","鬲"],"bī pī bì":["鎞"],"gǎo hào":["鎬"],"zú chuò":["鏃"],"xiū xiù":["鏅"],"shòu sōu":["鏉"],"dí dī":["鏑","镝"],"qiāo sǎn càn":["鏒"],"lù áo":["鏕"],"tāng táng":["鏜"],"jiàn zàn":["鏩"],"huì suì ruì":["鏸"],"qiǎng qiāng":["鏹","镪"],"sǎn xiàn sà":["鏾"],"jiǎn jiàn":["鐧","锏"],"dāng chēng":["鐺","铛"],"zuān zuàn":["鑽"],"sà xì":["钑"],"yào yuè":["钥"],"tǒu dǒu":["钭"],"zuàn zuān":["钻"],"qiān yán":["铅"],"pí pī":["铍"],"yáo diào tiáo":["铫"],"tāng tàng":["铴"],"pù pū":["铺"],"tán xiān":["锬"],"liù liú":["镏"],"hào gǎo":["镐"],"táng tāng":["镗"],"tán chán xín":["镡"],"huò shǎn":["閄"],"hàn bì":["閈","闬"],"kāng kàng":["閌","闶"],"xián jiàn jiān jiǎn":["閒"],"xiā xiǎ":["閕"],"xiǎ kě":["閜"],"biàn guān":["閞"],"hé gé":["閤","颌"],"hòng xiàng":["閧"],"sē xī":["閪"],"tíng tǐng":["閮"],"è yān":["閼","阏"],"hòng juǎn xiàng":["闂"],"bǎn pàn":["闆"],"dū shé":["闍","阇"],"què quē":["闕"],"tāng táng chāng":["闛"],"kàn hǎn":["闞","阚"],"xì sè tà":["闟"],"mēn mèn":["闷"],"quē què":["阙"],"yán diàn":["阽"],"ā ē":["阿"],"bēi pō pí":["陂"],"yàn yǎn":["隁"],"yú yáo shù":["隃"],"lóng lōng":["隆"],"duì zhuì":["隊"],"suí duò":["隋"],"gāi qí ái":["隑"],"huī duò":["隓","隳"],"wěi kuí":["隗"],"lì dài":["隸"],"zhuī cuī wéi":["隹"],"hè hú":["隺","鶮"],"jùn juàn":["隽","雋"],"nán nàn nuó":["难"],"què qiāo qiǎo":["雀"],"guàn huán":["雚"],"guī xī":["雟"],"sè xí":["雭"],án:["雸"],"wù méng":["雺"],tèng:["霯"],"lù lòu":["露"],mái:["霾"],"jìng liàng":["靚"],"gé jí":["革"],bǎ:["靶"],"yāng yàng":["鞅"],"gé tà sǎ":["鞈"],"biān yìng":["鞕"],"qiào shāo":["鞘"],"juān xuān":["鞙"],"shàng zhǎng":["鞝"],"pí bǐng bì bēi":["鞞"],la:["鞡"],"xiè dié":["鞢"],ēng:["鞥"],"móu mù":["鞪"],"bì bǐng":["鞸"],"mèi wà":["韎"],rǒu:["韖"],"shè xiè":["韘"],"yùn wēn":["韫"],"dùn dú":["頓","顿"],duǐ:["頧"],luō:["頱"],"bīn pín":["頻"],yóng:["顒","颙","鰫"],mān:["顢","颟"],"jǐng gěng":["颈"],"jié xié jiá":["颉"],"kē ké":["颏"],"pín bīn":["频"],"chàn zhàn":["颤"],"fēng fěng":["風","风"],"biāo diū":["颩"],"bá fú":["颰"],"sāo sōu":["颾"],"liù liáo":["飂"],"shí sì yì":["食"],"yǎng juàn":["飬"],"zhù tǒu":["飳"],"yí sì":["飴"],"zuò zé zhā":["飵"],tiè:["飻","餮"],"xiǎng náng":["饟"],"táng xíng":["饧"],"gē le":["饹"],"chā zha":["馇"],"náng nǎng":["馕"],"yūn wò":["馧"],"zhī shì":["馶"],"xìn jìn":["馸"],"kuài jué":["駃"],zǎng:["駔","驵"],"tái dài":["駘"],"xún xuān":["駨"],"liáng láng":["駺"],piàn:["騗","騙","骗","魸"],"dài tái":["骀"],"sāo sǎo":["骚"],"gǔ gū":["骨"],"bèi mó":["骳"],"xiāo qiāo":["骹"],"bǎng pǎng":["髈"],"bó jué":["髉"],"bì pǒ":["髲"],"máo méng":["髳"],"kuò yuè":["髺"],"bā bà":["魞","鲃"],"jì cǐ":["鮆"],"bó bà":["鮊"],"zhǎ zhà":["鮓","鲊"],"chóu dài":["鮘"],"luò gé":["鮥"],"guī xié wā kuí":["鮭"],"xiān xiǎn":["鮮","鲜"],"pū bū":["鯆"],"yì sī":["鯣"],"bà bó":["鲌"],"guī xié":["鲑"],"sāi xǐ":["鳃"],"niǎo diǎo":["鳥"],"diāo zhāo":["鳭"],"gān hàn yàn":["鳱"],"fū guī":["鳺"],"jiān qiān zhān":["鳽"],"hé jiè":["鶡"],"piān biǎn":["鶣"],"chuàn zhì":["鶨"],"cāng qiāng":["鶬"],"sǔn xùn":["鶽"],"biāo páo":["麃"],"zhù cū":["麆"],"jūn qún":["麇","麕"],chi:["麶"],"mó me":["麼"],"mó me ma":["麽"],"mí mǒ":["麿"],"dàn shèn":["黮"],"zhěn yān":["黰"],"dǎn zhǎn":["黵"],"miǎn mǐn měng":["黾"],hōu:["齁"],nàng:["齉"],"qí jì zī zhāi":["齐"],"yín kěn yǎn":["龂"],"yín kěn":["龈"],"gōng wò":["龏"],"guī jūn qiū":["龜","龟"],"kuí wā":["䖯"],lōu:["䁖"],"ōu qū":["𫭟"],"lóu lǘ":["𦝼"],"gǎ gā gá":["嘎"],"wā guà":["坬"],"zhǐ dǐ":["茋"],"gǒng hóng":["硔"],"yáo xiào":["滧"]},Rd=new wP;Object.keys(LI).forEach(e=>{const t=LI[e];for(let n of t)Rd.set(n,e)});const NI={这个:"zhè ge",成为:"chéng wéi",认为:"rèn wéi",作为:"zuò wéi",部分:"bù fen",要求:"yāo qiú",应该:"yīng gāi",增长:"zēng zhǎng",提供:"tí gōng",觉得:"jué de",任务:"rèn wu",那个:"nà ge",称为:"chēng wéi",为主:"wéi zhǔ",了解:"liǎo jiě",处理:"chǔ lǐ",皇上:"huáng shang",只要:"zhǐ yào",大量:"dà liàng",力量:"lì liàng",几乎:"jī hū",干部:"gàn bù",目的:"mù dì",行为:"xíng wéi",只见:"zhǐ jiàn",认识:"rèn shi",市长:"shì zhǎng",师父:"shī fu",调查:"diào chá",重新:"chóng xīn",分为:"fēn wéi",知识:"zhī shi",导弹:"dǎo dàn",质量:"zhì liàng",行款:"háng kuǎn",行列:"háng liè",行话:"háng huà",行业:"háng yè",隔行:"gé háng",在行:"zài háng",行家:"háng jia",内行:"nèi háng",外行:"wài háng",同行:"tóng háng",本行:"běn háng",行伍:"háng wǔ",洋行:"yáng háng",银行:"yín háng",商行:"shāng háng",支行:"zhī háng",总行:"zǒng háng",行情:"háng qíng",懂行:"dǒng háng",行规:"háng guī",行当:"háng dang",行货:"háng huò",太行:"tài háng",入行:"rù háng",中行:"zhōng háng",农行:"nóng háng",工行:"gōng háng",建行:"jiàn háng",各行:"gè háng",行号:"háng hào",行高:"háng gāo",行首:"háng shǒu",行尾:"háng wěi",行末:"háng mò",行长:"háng zhǎng",行距:"háng jù",换行:"huàn háng",行会:"háng huì",行辈:"háng bèi",行道:"háng dào",道行:"dào heng",参与:"cān yù",充分:"chōng fèn",尽管:"jǐn guǎn",生长:"shēng zhǎng",数量:"shù liàng",应当:"yīng dāng",院长:"yuàn zhǎng",强调:"qiáng diào",只能:"zhǐ néng",音乐:"yīn yuè",以为:"yǐ wéi",处于:"chǔ yú",部长:"bù zhǎng",蒙古:"měng gǔ",只有:"zhǐ yǒu",适当:"shì dàng",只好:"zhǐ hǎo",成长:"chéng zhǎng",高兴:"gāo xìng",不了:"bù liǎo",产量:"chǎn liàng",胖子:"pàng zi",显得:"xiǎn de",只是:"zhǐ shì",似的:"shì de",率领:"shuài lǐng",改为:"gǎi wéi",不禁:"bù jīn",成分:"chéng fèn",答应:"dā ying",少年:"shào nián",兴趣:"xìng qù",太监:"tài jian",休息:"xiū xi",校长:"xiào zhǎng",更新:"gēng xīn",合同:"hé tong",喝道:"hè dào",重庆:"chóng qìng",重建:"chóng jiàn",使得:"shǐ de",审查:"shěn chá",累计:"lěi jì",给予:"jǐ yǔ",极为:"jí wéi",冠军:"guàn jūn",仿佛:"fǎng fú",头发:"tóu fa",投降:"tóu xiáng",家长:"jiā zhǎng",仔细:"zǐ xì",要是:"yào shi",将领:"jiàng lǐng",含量:"hán liàng",更为:"gèng wéi",积累:"jī lěi",地处:"dì chǔ",县长:"xiàn zhǎng",少女:"shào nǚ",路上:"lù shang",只怕:"zhǐ pà",能量:"néng liàng",储量:"chǔ liàng",供应:"gōng yìng",挑战:"tiǎo zhàn",西藏:"xī zàng",记得:"jì de",总量:"zǒng liàng",当真:"dàng zhēn",将士:"jiàng shì",差别:"chā bié",较为:"jiào wéi",长老:"zhǎng lǎo",大夫:"dài fu",差异:"chā yì",懂得:"dǒng de",尽量:"jǐn liàng",模样:"mú yàng",的确:"dí què",为首:"wéi shǒu",便宜:"pián yi",更名:"gēng míng",石头:"shí tou",州长:"zhōu zhǎng",为止:"wéi zhǐ",漂亮:"piào liang",炮弹:"pào dàn",藏族:"zàng zú",角色:"jué sè",当作:"dàng zuò",尽快:"jǐn kuài",人为:"rén wéi",重复:"chóng fù",胡同:"hú tòng",差距:"chā jù",弟兄:"dì xiong",大将:"dà jiàng",睡觉:"shuì jiào",一觉:"yí jiào",团长:"tuán zhǎng",队长:"duì zhǎng",区长:"qū zhǎng",难得:"nán dé",丫头:"yā tou",会长:"huì zhǎng",弟弟:"dì di",王爷:"wáng ye",重量:"zhòng liàng",誉为:"yù wéi",家伙:"jiā huo",华山:"huà shān",椅子:"yǐ zi",流量:"liú liàng",长大:"zhǎng dà",勉强:"miǎn qiǎng",会计:"kuài jì",过分:"guò fèn",济南:"jǐ nán",调动:"diào dòng",燕京:"yān jīng",少将:"shào jiàng",中毒:"zhòng dú",晓得:"xiǎo de",变更:"biàn gēng",打更:"dǎ gēng",认得:"rèn de",苹果:"píng guǒ",念头:"niàn tou",挣扎:"zhēng zhá",三藏:"sān zàng",剥削:"bō xuē",丞相:"chéng xiàng",少量:"shǎo liàng",寻思:"xún si",夺得:"duó dé",干线:"gàn xiàn",呼吁:"hū yù",处罚:"chǔ fá",长官:"zhǎng guān",柏林:"bó lín",亲戚:"qīn qi",身分:"shēn fèn",胳膊:"gē bo",着手:"zhuó shǒu",炸弹:"zhà dàn",咳嗽:"ké sou",叶子:"yè zi",外长:"wài zhǎng",供给:"gōng jǐ",师长:"shī zhǎng",变量:"biàn liàng",应有:"yīng yǒu",下载:"xià zài",乐器:"yuè qì",间接:"jiàn jiē",底下:"dǐ xià",打扮:"dǎ bàn",子弹:"zǐ dàn",弹药:"dàn yào",热量:"rè liàng",削弱:"xuē ruò",骨干:"gǔ gàn",容量:"róng liàng",模糊:"mó hu",转动:"zhuàn dòng",称呼:"chēng hu",科长:"kē zhǎng",处置:"chǔ zhì",着重:"zhuó zhòng",着急:"zháo jí",强迫:"qiǎng pò",庭长:"tíng zhǎng",首相:"shǒu xiàng",喇嘛:"lǎ ma",镇长:"zhèn zhǎng",只管:"zhǐ guǎn",重重:"chóng chóng",免得:"miǎn de",着实:"zhuó shí",度假:"dù jià",真相:"zhēn xiàng",相貌:"xiàng mào",处分:"chǔ fèn",委屈:"wěi qu",为期:"wéi qī",伯伯:"bó bo",伯子:"bǎi zi",圈子:"quān zi",见识:"jiàn shi",笼罩:"lǒng zhào",与会:"yù huì",都督:"dū du",都市:"dū shì",成都:"chéng dū",首都:"shǒu dū",帝都:"dì dū",王都:"wáng dū",东都:"dōng dū",都护:"dū hù",都城:"dū chéng",建都:"jiàn dū",迁都:"qiān dū",故都:"gù dū",定都:"dìng dū",中都:"zhōng dū",六安:"lù ān",宰相:"zǎi xiàng",较量:"jiào liàng",对称:"duì chèn",总长:"zǒng zhǎng",相公:"xiàng gong",空白:"kòng bái",打量:"dǎ liang",水分:"shuǐ fèn",舌头:"shé tou",没收:"mò shōu",行李:"xíng li",判处:"pàn chǔ",散文:"sǎn wén",处境:"chǔ jìng",孙子:"sūn zi",拳头:"quán tou",打发:"dǎ fā",组长:"zǔ zhǎng",骨头:"gǔ tou",宁可:"nìng kě",更换:"gēng huàn",薄弱:"bó ruò",还原:"huán yuán",重修:"chóng xiū",重来:"chóng lái",只顾:"zhǐ gù",爱好:"ài hào",馒头:"mán tou",军长:"jūn zhǎng",首长:"shǒu zhǎng",厂长:"chǎng zhǎng",司长:"sī zhǎng",长子:"zhǎng zǐ",强劲:"qiáng jìng",恰当:"qià dàng",头儿:"tóu er",站长:"zhàn zhǎng",折腾:"zhē teng",相处:"xiāng chǔ",统率:"tǒng shuài",中将:"zhōng jiàng",命中:"mìng zhòng",名将:"míng jiàng",木头:"mù tou",动弹:"dòng tan",地壳:"dì qiào",干活:"gàn huó",少爷:"shào ye",水量:"shuǐ liàng",补给:"bǔ jǐ",尾巴:"wěi ba",来得:"lái de",好奇:"hào qí",钥匙:"yào shi",当做:"dàng zuò",沉着:"chén zhuó",哑巴:"yǎ ba",车子:"chē zi",上将:"shàng jiàng",恶心:"ě xīn",担子:"dàn zi",应届:"yīng jiè",主角:"zhǔ jué",运转:"yùn zhuǎn",兄长:"xiōng zhǎng",格式:"gé shì",正月:"zhēng yuè",营长:"yíng zhǎng",当成:"dàng chéng",女婿:"nǚ xu",咽喉:"yān hóu",重阳:"chóng yáng",化为:"huà wéi",吐蕃:"tǔ bō",钻进:"zuān jìn",乐队:"yuè duì",亮相:"liàng xiàng",被子:"bèi zi",舍得:"shě de",杉木:"shā mù",击中:"jī zhòng",排长:"pái zhǎng",假期:"jià qī",分量:"fèn liàng",数次:"shù cì",提防:"dī fáng",吆喝:"yāo he",查处:"chá chǔ",量子:"liàng zǐ",里头:"lǐ tou",调研:"diào yán",伺候:"cì hou",重申:"chóng shēn",枕头:"zhěn tou",拚命:"pīn mìng",社长:"shè zhǎng",归还:"guī huán",批量:"pī liàng",畜牧:"xù mù",点着:"diǎn zháo",甚为:"shèn wéi",小将:"xiǎo jiàng",着眼:"zhuó yǎn",处死:"chǔ sǐ",厌恶:"yàn wù",鼓乐:"gǔ yuè",树干:"shù gàn",秘鲁:"bì lǔ",大方:"dà fāng",外头:"wài tou",班长:"bān zhǎng",星宿:"xīng xiù",宁愿:"nìng yuàn",钦差:"qīn chāi",为数:"wéi shù",勾当:"gòu dàng",削减:"xuē jiǎn",间谍:"jiàn dié",埋怨:"mán yuàn",结实:"jiē shi",计量:"jì liáng",淹没:"yān mò",村长:"cūn zhǎng",连长:"lián zhǎng",自给:"zì jǐ",武将:"wǔ jiàng",温差:"wēn chā",直奔:"zhí bèn",供求:"gōng qiú",剂量:"jì liàng",道长:"dào zhǎng",泄露:"xiè lòu",王八:"wáng ba",切割:"qiē gē",间隔:"jiàn gé",一晃:"yì huǎng",长假:"cháng jià",令狐:"líng hú",为害:"wéi hài",句子:"jù zi",偿还:"cháng huán",疙瘩:"gē da",燕山:"yān shān",堵塞:"dǔ sè",夺冠:"duó guàn",扎实:"zhā shi",电荷:"diàn hè",看守:"kān shǒu",复辟:"fù bì",郁闷:"yù mèn",尽早:"jǐn zǎo",切断:"qiē duàn",指头:"zhǐ tou",为生:"wéi shēng",畜生:"chù sheng",切除:"qiē chú",着力:"zhuó lì",着想:"zhuó xiǎng",级差:"jí chā",投奔:"tóu bèn",棍子:"gùn zi",含糊:"hán hu",少妇:"shào fù",兴致:"xìng zhì",纳闷:"nà mèn",干流:"gàn liú",卷起:"juǎn qǐ",扇子:"shàn zi",更改:"gēng gǎi",笼络:"lǒng luò",喇叭:"lǎ ba",载荷:"zài hè",妥当:"tuǒ dàng",为难:"wéi nán",着陆:"zhuó lù",燕子:"yàn zi",干吗:"gàn má",白发:"bái fà",总得:"zǒng děi",夹击:"jiā jī",曝光:"bào guāng",曲调:"qǔ diào",相机:"xiàng jī",叫化:"jiào huà",角逐:"jué zhú",啊哟:"ā yō",载重:"zài zhòng",长辈:"zhǎng bèi",出差:"chū chāi",垛口:"duǒ kǒu",撇开:"piē kāi",厅长:"tīng zhǎng",组分:"zǔ fèn",误差:"wù chā",家当:"jiā dàng",传记:"zhuàn jì",个子:"gè zi",铺设:"pū shè",干事:"gàn shì",杆菌:"gǎn jūn",定量:"dìng liàng",运载:"yùn zài",会儿:"huì er",酋长:"qiú zhǎng",重返:"chóng fǎn",差额:"chā é",露面:"lòu miàn",钻研:"zuān yán",大城:"dài chéng",上当:"shàng dàng",销量:"xiāo liàng",作坊:"zuō fang",照相:"zhào xiàng",哎呀:"āi yā",调集:"diào jí",看中:"kàn zhòng",议长:"yì zhǎng",风筝:"fēng zheng",辟邪:"bì xié",空隙:"kòng xì",更迭:"gēng dié",偏差:"piān chā",声调:"shēng diào",适量:"shì liàng",屯子:"tún zi",无量:"wú liàng",空地:"kòng dì",调度:"diào dù",散射:"sǎn shè",创伤:"chuāng shāng",海参:"hǎi shēn",满载:"mǎn zài",重叠:"chóng dié",落差:"luò chā",单调:"dān diào",老将:"lǎo jiàng",人参:"rén shēn",间断:"jiàn duàn",重现:"chóng xiàn",夹杂:"jiā zá",调用:"diào yòng",萝卜:"luó bo",附着:"fù zhuó",应声:"yìng shēng",主将:"zhǔ jiàng",罪过:"zuì guo",咀嚼:"jǔ jué",为政:"wéi zhèng",过量:"guò liàng",乐曲:"yuè qǔ",负荷:"fù hè",枪弹:"qiāng dàn",悄然:"qiǎo rán",处方:"chǔ fāng",悄声:"qiǎo shēng",曲子:"qǔ zi",情调:"qíng diào",挑衅:"tiǎo xìn",代为:"dài wéi",了结:"liǎo jié",打中:"dǎ zhòng",酒吧:"jiǔ bā",懒得:"lǎn de",增量:"zēng liàng",衣着:"yī zhuó",部将:"bù jiàng",要塞:"yào sài",茶几:"chá jī",杠杆:"gàng gǎn",出没:"chū mò",鲜有:"xiǎn yǒu",间隙:"jiàn xì",重担:"zhòng dàn",重演:"chóng yǎn",重试:"chóng shì",应酬:"yìng chou",只当:"zhǐ dāng",毋宁:"wú nìng",包扎:"bāo zā",前头:"qián tou",卷烟:"juǎn yān",非得:"fēi děi",弹道:"dàn dào",杆子:"gān zi",门将:"mén jiàng",后头:"hòu tou",喝彩:"hè cǎi",暖和:"nuǎn huo",累积:"lěi jī",调遣:"diào qiǎn",倔强:"jué jiàng",宝藏:"bǎo zàng",丧事:"sāng shì",约莫:"yuē mo",纤夫:"qiàn fū",更替:"gēng tì",装载:"zhuāng zài",背包:"bēi bāo",帖子:"tiě zi",松散:"sōng sǎn",呼喝:"hū hè",可恶:"kě wù",自转:"zì zhuàn",供电:"gōng diàn",反省:"fǎn xǐng",坦率:"tǎn shuài",苏打:"sū dá",本分:"běn fèn",落得:"luò de",鄙薄:"bǐ bó",相间:"xiāng jiàn",单薄:"dān bó",混蛋:"hún dàn",贞观:"zhēn guān",附和:"fù hè",能耐:"néng nài",吓唬:"xià hu",未了:"wèi liǎo",引着:"yǐn zháo",抽调:"chōu diào",沙子:"shā zi",席卷:"xí juǎn",标的:"biāo dì",别扭:"biè niu",思量:"sī liang",喝采:"hè cǎi",论语:"lún yǔ",盖子:"gài zi",分外:"fèn wài",弄堂:"lòng táng",乐舞:"yuè wǔ",雨量:"yǔ liàng",毛发:"máo fà",差遣:"chāi qiǎn",背负:"bēi fù",转速:"zhuàn sù",声乐:"shēng yuè",夹攻:"jiā gōng",供水:"gōng shuǐ",主干:"zhǔ gàn",惩处:"chéng chǔ",长相:"zhǎng xiàng",公差:"gōng chāi",榴弹:"liú dàn",省得:"shěng de",条子:"tiáo zi",重围:"chóng wéi",阻塞:"zǔ sè",劲风:"jìng fēng",纠葛:"jiū gé",颠簸:"diān bǒ",点中:"diǎn zhòng",重创:"zhòng chuāng",姥姥:"lǎo lao",迷糊:"mí hu",公家:"gōng jia",几率:"jī lǜ",苦闷:"kǔ mèn",度量:"dù liàng",差错:"chā cuò",暑假:"shǔ jià",参差:"cēn cī",搭载:"dā zài",助长:"zhù zhǎng",相称:"xiāng chèn",红晕:"hóng yùn",舍命:"shě mìng",喜好:"xǐ hào",列传:"liè zhuàn",劲敌:"jìng dí",蛤蟆:"há ma",请假:"qǐng jià",钉子:"dīng zi",沉没:"chén mò",高丽:"gāo lí",休假:"xiū jià",无为:"wú wéi",巴结:"bā jie",了得:"liǎo dé",变相:"biàn xiàng",核弹:"hé dàn",亲家:"qìng jia",承载:"chéng zài",喝问:"hè wèn",还击:"huán jī",交还:"jiāo huán",将令:"jiàng lìng",单于:"chán yú",空缺:"kòng quē",绿林:"lù lín",胆量:"dǎn liàng",执着:"zhí zhuó",低调:"dī diào",闭塞:"bì sè",轻薄:"qīng bó",得当:"dé dàng",占卜:"zhān bǔ",扫帚:"sào zhou",龟兹:"qiū cí",年长:"nián zhǎng",外传:"wài zhuàn",头子:"tóu zi",裁缝:"cái feng",礼乐:"lǐ yuè",血泊:"xuè pō",散乱:"sǎn luàn",动量:"dòng liàng",倒腾:"dǎo teng",取舍:"qǔ shě",咱家:"zán jiā",长发:"cháng fà",爪哇:"zhǎo wā",弹壳:"dàn ké",省悟:"xǐng wù",嚷嚷:"rāng rang",连累:"lián lèi",应得:"yīng dé",族长:"zú zhǎng",柜子:"guì zi",擂鼓:"léi gǔ",眩晕:"xuàn yùn",调配:"tiáo pèi",躯干:"qū gàn",差役:"chāi yì",坎坷:"kǎn kě",少儿:"shào ér",乐团:"yuè tuán",养分:"yǎng fèn",退还:"tuì huán",格调:"gé diào",语调:"yǔ diào",音调:"yīn diào",乐府:"yuè fǔ",古朴:"gǔ pǔ",打点:"dǎ diǎn",差使:"chāi shǐ",匀称:"yún chèn",瘦削:"shòu xuē",膏药:"gāo yao",吞没:"tūn mò",调任:"diào rèn",散居:"sǎn jū",上头:"shàng tóu",风靡:"fēng mǐ",放假:"fàng jià",估量:"gū liang",失当:"shī dàng",中弹:"zhòng dàn",妄为:"wàng wéi",长者:"zhǎng zhě",起哄:"qǐ hòng",末了:"mò liǎo",相声:"xiàng sheng",校正:"jiào zhèng",劝降:"quàn xiáng",矢量:"shǐ liàng",沉闷:"chén mèn",给与:"jǐ yǔ",解法:"jiě fǎ",塞外:"sài wài",将校:"jiàng xiào",嗜好:"shì hào",没落:"mò luò",朴刀:"pō dāo",片子:"piān zi",切削:"qiē xiāo",弹丸:"dàn wán",稀薄:"xī bó",亏得:"kuī dé",间歇:"jiàn xiē",翘首:"qiáo shǒu",色调:"sè diào",处决:"chǔ jué",表率:"biǎo shuài",尺子:"chǐ zi",招降:"zhāo xiáng",称职:"chèn zhí",斗篷:"dǒu peng",铺子:"pù zi",底子:"dǐ zi",负载:"fù zài",干警:"gàn jǐng",倒数:"dào shǔ",将官:"jiàng guān",锄头:"chú tou",归降:"guī xiáng",疟疾:"nüè ji",唠叨:"láo dao",限量:"xiàn liàng",屏息:"bǐng xī",重逢:"chóng féng",器乐:"qì yuè",氢弹:"qīng dàn",脖颈:"bó gěng",妃子:"fēi zi",处事:"chǔ shì",参量:"cān liàng",轻率:"qīng shuài",缥缈:"piāo miǎo",中奖:"zhòng jiǎng",才干:"cái gàn",施舍:"shī shě",卷子:"juàn zi",游说:"yóu shuì",巷子:"xiàng zi",膀胱:"páng guāng",切勿:"qiè wù",看管:"kān guǎn",风头:"fēng tou",精干:"jīng gàn",高差:"gāo chā",恐吓:"kǒng hè",扁担:"biǎn dàn",给养:"jǐ yǎng",格子:"gé zi",供需:"gōng xū",反差:"fǎn chā",飞弹:"fēi dàn",微薄:"wēi bó",发型:"fà xíng",即兴:"jí xìng",攒动:"cuán dòng",间或:"jiàn huò",浅薄:"qiǎn bó",乐章:"yuè zhāng",顺差:"shùn chā",调子:"diào zi",相位:"xiàng wèi",转子:"zhuàn zǐ",劲旅:"jìng lǚ",咔嚓:"kā chā",了事:"liǎo shì",转悠:"zhuàn you",当铺:"dàng pù",爪子:"zhuǎ zi",单子:"dān zi",好战:"hào zhàn",燕麦:"yàn mài",只许:"zhǐ xǔ",干练:"gàn liàn",女将:"nǚ jiàng",酒量:"jiǔ liàng",划船:"huá chuán",伎俩:"jì liǎng",挑拨:"tiǎo bō",少校:"shào xiào",着落:"zhuó luò",憎恶:"zēng wù",刻薄:"kè bó",要挟:"yāo xié",用处:"yòng chu",还手:"huán shǒu",模具:"mú jù",执著:"zhí zhuó",喝令:"hè lìng",保长:"bǎo zhǎng",吸着:"xī zhe",症结:"zhēng jié",公转:"gōng zhuàn",校勘:"jiào kān",重提:"chóng tí",扫兴:"sǎo xìng",铺盖:"pū gài",长史:"zhǎng shǐ",差价:"chā jià",压根:"yà gēn",怔住:"zhèng zhù",应允:"yīng yǔn",切入:"qiē rù",战将:"zhàn jiàng",年少:"nián shào",舍身:"shě shēn",执拗:"zhí niù",处世:"chǔ shì",中风:"zhòng fēng",等量:"děng liàng",放量:"fàng liàng",腔调:"qiāng diào",老少:"lǎo shào",没入:"mò rù",瓜葛:"guā gé",将帅:"jiàng shuài",车载:"chē zài",窝囊:"wō nang",长进:"zhǎng jìn",可汗:"kè hán",并州:"bīng zhōu",供销:"gōng xiāo",切片:"qiē piàn",差事:"chāi shì",知会:"zhī hui",鹰爪:"yīng zhǎo",处女:"chǔ nǚ",切磋:"qiē cuō",日头:"rì tou",押解:"yā jiè",滋长:"zī zhǎng",道观:"dào guàn",脚色:"jué sè",当量:"dāng liàng",婆家:"pó jia",缘分:"yuán fèn",空闲:"kòng xián",好色:"hào sè",怒喝:"nù hè",笼统:"lǒng tǒng",边塞:"biān sài",何曾:"hé céng",重合:"chóng hé",零散:"líng sǎn",轰隆:"hōng lōng",化子:"huà zi",内蒙:"nèi měng",数落:"shǔ luò",逆差:"nì chā",牟利:"móu lì",栅栏:"zhà lan",中标:"zhòng biāo",调档:"diào dàng",佝偻:"gōu lóu",场子:"chǎng zi",甲壳:"jiǎ qiào",重温:"chóng wēn",炮制:"páo zhì",返还:"fǎn huán",自传:"zì zhuàn",高调:"gāo diào",殷红:"yān hóng",固着:"gù zhuó",强求:"qiǎng qiú",本相:"běn xiàng",骄横:"jiāo hèng",草率:"cǎo shuài",气闷:"qì mèn",着色:"zhuó sè",宁肯:"nìng kěn",兴头:"xìng tou",拘泥:"jū nì",夹角:"jiā jiǎo",发髻:"fà jì",猛将:"měng jiàng",约摸:"yuē mo",拖累:"tuō lěi",呢绒:"ní róng",钻探:"zuān tàn",夹层:"jiā céng",落魄:"luò pò",巷道:"hàng dào",运量:"yùn liàng",解闷:"jiě mèn",空儿:"kòng er",估摸:"gū mo",好客:"hào kè",钻孔:"zuān kǒng",糊弄:"hù nòng",荥阳:"xíng yáng",烦闷:"fán mèn",仓卒:"cāng cù",分叉:"fēn chà",厂子:"chǎng zi",小调:"xiǎo diào",少阳:"shào yáng",受降:"shòu xiáng",染坊:"rǎn fáng",胳臂:"gē bei",将门:"jiàng mén",模板:"mú bǎn",配给:"pèi jǐ",为伍:"wéi wǔ",跟头:"gēn tou",划算:"huá suàn",累赘:"léi zhui",哄笑:"hōng xiào",晕眩:"yūn xuàn",干掉:"gàn diào",缝制:"féng zhì",难处:"nán chù",着意:"zhuó yì",蛮横:"mán hèng",奇数:"jī shù",短发:"duǎn fà",生还:"shēng huán",还清:"huán qīng",看护:"kān hù",直率:"zhí shuài",奏乐:"zòu yuè",载客:"zài kè",专横:"zhuān hèng",湮没:"yān mò",空格:"kòng gé",铺垫:"pū diàn",良将:"liáng jiàng",哗啦:"huā lā",散漫:"sǎn màn",脱发:"tuō fà",送还:"sòng huán",埋没:"mái mò",累及:"lěi jí",薄雾:"bó wù",调离:"diào lí",舌苔:"shé tāi",机长:"jī zhǎng",栓塞:"shuān sè",配角:"pèi jué",切口:"qiē kǒu",创口:"chuāng kǒu",哈欠:"hā qian",实弹:"shí dàn",铺平:"pū píng",哈达:"hǎ dá",懒散:"lǎn sǎn",实干:"shí gàn",填空:"tián kòng",刁钻:"diāo zuān",乐师:"yuè shī",量变:"liàng biàn",诱降:"yòu xiáng",搪塞:"táng sè",征调:"zhēng diào",夹道:"jiā dào",干咳:"gān ké",止咳:"zhǐ ké",乐工:"yuè gōng",划过:"huá guò",着火:"zháo huǒ",更正:"gēng zhèng",给付:"jǐ fù",空子:"kòng zi",哪吒:"né zhā",正着:"zhèng zháo",刷子:"shuā zi",丧葬:"sāng zàng",夹带:"jiā dài",安分:"ān fèn",中意:"zhòng yì",长孙:"zhǎng sūn",校订:"jiào dìng",卷曲:"juǎn qū",载运:"zài yùn",投弹:"tóu dàn",柞蚕:"zuò cán",份量:"fèn liàng",调换:"diào huàn",了然:"liǎo rán",咧嘴:"liě zuǐ",典当:"diǎn dàng",寒假:"hán jià",长兄:"zhǎng xiōng",给水:"jǐ shuǐ",须发:"xū fà",枝干:"zhī gàn",属相:"shǔ xiàng",哄抢:"hōng qiǎng",刻划:"kè huà",塞子:"sāi zi",单干:"dān gàn",还乡:"huán xiāng",兆头:"zhào tou",寺观:"sì guàn",督率:"dū shuài",啊哈:"ā ha",割舍:"gē shě",抹布:"mā bù",好恶:"hào wù",下处:"xià chǔ",消长:"xiāo zhǎng",离间:"lí jiàn",准头:"zhǔn tou",校对:"jiào duì",什物:"shí wù",番禺:"pān yú",佛爷:"fó ye",吗啡:"mǎ fēi",盐分:"yán fèn",虎将:"hǔ jiàng",薄荷:"bò he",独处:"dú chǔ",空位:"kòng wèi",铺路:"pū lù",乌拉:"wū lā",调回:"diào huí",来头:"lái tou",闲散:"xián sǎn",胶卷:"jiāo juǎn",冒失:"mào shi",干劲:"gàn jìn",弦乐:"xián yuè",相国:"xiàng guó",丹参:"dān shēn",助兴:"zhù xìng",铺开:"pū kāi",次长:"cì zhǎng",发卡:"fà qiǎ",拮据:"jié jū",刹车:"shā chē",生发:"shēng fà",重播:"chóng bō",缝合:"féng hé",音量:"yīn liàng",少尉:"shào wèi",冲压:"chòng yā",苍劲:"cāng jìng",厚薄:"hòu báo",威吓:"wēi hè",外相:"wài xiàng",呼号:"hū háo",着迷:"zháo mí",挑担:"tiāo dàn",纹路:"wén lù",还俗:"huán sú",强横:"qiáng hèng",着数:"zhāo shù",降顺:"xiáng shùn",挑明:"tiǎo míng",眯缝:"mī feng",分内:"fèn nèi",更衣:"gēng yī",软和:"ruǎn huo",尽兴:"jìn xìng",号子:"hào zi",爪牙:"zhǎo yá",败将:"bài jiàng",猜中:"cāi zhòng",结扎:"jié zā",没空:"méi kòng",夹缝:"jiā fèng",拾掇:"shí duo",掺和:"chān huo",簸箕:"bò ji",电量:"diàn liàng",荷载:"hè zǎi",调式:"diào shì",处身:"chǔ shēn",打手:"dǎ shǒu",弹弓:"dàn gōng",横蛮:"hèng mán",能干:"néng gàn",校点:"jiào diǎn",加载:"jiā zài",干校:"gàn xiào",哄传:"hōng chuán",校注:"jiào zhù",淤塞:"yū sè",马扎:"mǎ zhá",月氏:"yuè zhī",高干:"gāo gàn",经传:"jīng zhuàn",曾孙:"zēng sūn",好斗:"hào dòu",关卡:"guān qiǎ",逃奔:"táo bèn",磨蹭:"mó ceng",牟取:"móu qǔ",颤栗:"zhàn lì",蚂蚱:"mà zha",撮合:"cuō he",趔趄:"liè qie",摔打:"shuāi dǎ",台子:"tái zi",分得:"fēn de",粘着:"nián zhuó",采邑:"cài yì",散装:"sǎn zhuāng",婀娜:"ē nuó",兴味:"xìng wèi",行头:"xíng tou",气量:"qì liàng",调运:"diào yùn",处治:"chǔ zhì",乐音:"yuè yīn",充塞:"chōng sè",恫吓:"dòng hè",论调:"lùn diào",相中:"xiāng zhòng",民乐:"mín yuè",炮仗:"pào zhang",丧服:"sāng fú",骁将:"xiāo jiàng",量刑:"liàng xíng",缝补:"féng bǔ",财会:"cái kuài",大干:"dà gàn",历数:"lì shǔ",校场:"jiào chǎng",塞北:"sài běi",识相:"shí xiàng",辱没:"rǔ mò",鲜亮:"xiān liàng",语塞:"yǔ sè",露脸:"lòu liǎn",凉快:"liáng kuai",腰杆:"yāo gǎn",溜达:"liū da",嘎嘎:"gā gā",公干:"gōng gàn",桔梗:"jié gěng",挑逗:"tiǎo dòu",看门:"kān mén",乐歌:"yuè gē",拓片:"tà piàn",挑动:"tiǎo dòng",准将:"zhǔn jiàng",遒劲:"qiú jìng",磨坊:"mò fáng",逶迤:"wēi yí",搅和:"jiǎo huo",摩挲:"mó suō",作弄:"zuò nòng",苗头:"miáo tou",打颤:"dǎ zhàn",大藏:"dà zàng",畜牲:"chù shēng",勾搭:"gōu da",树荫:"shù yīn",树杈:"shù chà",铁杆:"tiě gǎn",将相:"jiàng xiàng",份子:"fèn zi",视差:"shì chā",绿荫:"lǜ yīn",枪杆:"qiāng gǎn",缝纫:"féng rèn",愁闷:"chóu mèn",点将:"diǎn jiàng",华佗:"huà tuó",劲射:"jìng shè",箱笼:"xiāng lǒng",终了:"zhōng liǎo",鬓发:"bìn fà",结巴:"jiē ba",苦干:"kǔ gàn",看家:"kān jiā",正旦:"zhēng dàn",中肯:"zhòng kěn",厦门:"xià mén",东莞:"dōng guǎn",食量:"shí liàng",宫调:"gōng diào",间作:"jiàn zuò",弹片:"dàn piàn",差池:"chā chí",漂白:"piǎo bái",杠子:"gàng zi",调处:"tiáo chǔ",好动:"hào dòng",转炉:"zhuàn lú",屏气:"bǐng qì",夹板:"jiā bǎn",哀乐:"āi yuè",干道:"gàn dào",苦处:"kǔ chù",劈柴:"pǐ chái",长势:"zhǎng shì",天华:"tiān huá",共处:"gòng chǔ",校验:"jiào yàn",出塞:"chū sài",磨盘:"mò pán",萎靡:"wěi mǐ",奔丧:"bēn sāng",唱和:"chàng hè",大调:"dà diào",非分:"fēi fèn",钻营:"zuān yíng",夹子:"jiā zi",超载:"chāo zài",更始:"gēng shǐ",铃铛:"líng dang",披散:"pī sàn",发还:"fā huán",转轮:"zhuàn lún",横财:"hèng cái",泡桐:"pāo tóng",抛撒:"pāo sǎ",天呀:"tiān yā",糊糊:"hū hu",躯壳:"qū qiào",通量:"tōng liàng",奉还:"fèng huán",午觉:"wǔ jiào",闷棍:"mèn gùn",浪头:"làng tou",砚台:"yàn tái",油坊:"yóu fáng",学长:"xué zhǎng",过载:"guò zài",笔调:"bǐ diào",衣被:"yī bèi",畜产:"xù chǎn",调阅:"diào yuè",蛮干:"mán gàn",曾祖:"zēng zǔ",提干:"tí gàn",变调:"biàn diào",覆没:"fù mò",模子:"mú zi",乐律:"yuè lǜ",称心:"chèn xīn",木杆:"mù gān",重印:"chóng yìn",自省:"zì xǐng",提调:"tí diào",看相:"kàn xiàng",芋头:"yù tou",下切:"xià qiē",塞上:"sài shàng",铺张:"pū zhāng",藤蔓:"téng wàn",薄幸:"bó xìng",解数:"xiè shù",褪去:"tuì qù",霰弹:"xiàn dàn",柚木:"yóu mù",痕量:"hén liàng",雅乐:"yǎ yuè",号哭:"háo kū",诈降:"zhà xiáng",猪圈:"zhū juàn",咋舌:"zé shé",铣床:"xǐ chuáng",防弹:"fáng dàn",健将:"jiàn jiàng",丽水:"lí shuǐ",削发:"xuē fà",空当:"kòng dāng",多相:"duō xiàng",鲜见:"xiǎn jiàn",划桨:"huá jiǎng",载波:"zài bō",跳蚤:"tiào zao",俏皮:"qiào pí",吧嗒:"bā dā",结发:"jié fà",了断:"liǎo duàn",同调:"tóng diào",石磨:"shí mò",时差:"shí chā",鼻塞:"bí sè",挑子:"tiāo zi",推磨:"tuī mò",武侯:"wǔ hóu",抹煞:"mǒ shā",调转:"diào zhuǎn",籍没:"jí mò",还债:"huán zhài",调演:"diào yǎn",分划:"fēn huá",奇偶:"jī ǒu",断喝:"duàn hè",闷雷:"mèn léi",狼藉:"láng jí",饭量:"fàn liàng",还礼:"huán lǐ",转调:"zhuǎn diào",星相:"xīng xiàng",手相:"shǒu xiàng",配乐:"pèi yuè",盖头:"gài tou",连杆:"lián gǎn",簿记:"bù jì",刀把:"dāo bà",量词:"liàng cí",名角:"míng jué",步调:"bù diào",校本:"jiào běn",账簿:"zhàng bù",隽永:"juàn yǒng",稍为:"shāo wéi",易传:"yì zhuàn",乐谱:"yuè pǔ",牵累:"qiān lěi",答理:"dā li",喝斥:"hè chì",吟哦:"yín é",干渠:"gàn qú",海量:"hǎi liàng",精当:"jīng dàng",着床:"zhuó chuáng",月相:"yuè xiàng",庶几:"shù jī",宫观:"gōng guàn",论处:"lùn chǔ",征辟:"zhēng bì",厚朴:"hòu pò",介壳:"jiè qiào",吭哧:"kēng chī",咯血:"kǎ xiě",铺陈:"pū chén",重生:"chóng shēng",乐理:"yuè lǐ",哀号:"āi háo",藏历:"zàng lì",刚劲:"gāng jìng",削平:"xuē píng",浓荫:"nóng yīn",城垛:"chéng duǒ",当差:"dāng chāi",正传:"zhèng zhuàn",并处:"bìng chǔ",创面:"chuāng miàn",旦角:"dàn jué",薄礼:"bó lǐ",晃荡:"huàng dang",臊子:"sào zi",家什:"jiā shí",闷头:"mēn tóu",美发:"měi fà",度数:"dù shu",着凉:"zháo liáng",闯将:"chuǎng jiàng",几案:"jī àn",姘头:"pīn tou",差数:"chā shù",散碎:"sǎn suì",壅塞:"yōng sè",寒颤:"hán zhàn",牵强:"qiān qiǎng",无间:"wú jiàn",轮转:"lún zhuàn",号叫:"háo jiào",铺排:"pū pái",降伏:"xiáng fú",轧钢:"zhá gāng",东阿:"dōng ē",病假:"bìng jià",累加:"lěi jiā",梗塞:"gěng sè",弹夹:"dàn jiā",钻心:"zuān xīn",晃眼:"huǎng yǎn",魔爪:"mó zhǎo",标量:"biāo liàng",憋闷:"biē mèn",猜度:"cāi duó",处士:"chǔ shì",官差:"guān chāi",讨还:"tǎo huán",长门:"cháng mén",馏分:"liú fēn",里弄:"lǐ lòng",色相:"sè xiàng",雅兴:"yǎ xìng",角力:"jué lì",弹坑:"dàn kēng",枝杈:"zhī chà",夹具:"jiā jù",处刑:"chǔ xíng",悍将:"hàn jiàng",好学:"hào xué",好好:"hǎo hǎo",银发:"yín fà",扫把:"sào bǎ",法相:"fǎ xiàng",贵干:"guì gàn",供气:"gōng qì",空余:"kòng yú",捆扎:"kǔn zā",瘠薄:"jí bó",浆糊:"jiàng hu",嘎吱:"gā zhī",调令:"diào lìng",法帖:"fǎ tiè",淋病:"lìn bìng",调派:"diào pài",转盘:"zhuàn pán",供稿:"gōng gǎo",差官:"chāi guān",忧闷:"yōu mèn",教长:"jiào zhǎng",重唱:"chóng chàng",酒兴:"jiǔ xìng",乐坛:"yuè tán",花呢:"huā ní",叱喝:"chì hè",膀臂:"bǎng bì",得空:"dé kòng",转圈:"zhuàn quān",横暴:"hèng bào",哄抬:"hōng tái",引吭:"yǐn háng",载货:"zài huò",中计:"zhòng jì",官长:"guān zhǎng",相面:"xiàng miàn",看头:"kàn tou",盼头:"pàn tou",意兴:"yì xìng",军乐:"jūn yuè",累次:"lěi cì",骨嘟:"gǔ dū",燕赵:"yān zhào",报丧:"bào sāng",弥撒:"mí sa",挨斗:"ái dòu",扁舟:"piān zhōu",丑角:"chǒu jué",吊丧:"diào sāng",强将:"qiáng jiàng",重奏:"chóng zòu",发辫:"fà biàn",着魔:"zháo mó",着法:"zhāo fǎ",盛放:"shèng fàng",填塞:"tián sè",凶横:"xiōng hèng",稽首:"qǐ shǒu",碑帖:"bēi tiè",冲量:"chōng liàng",发菜:"fà cài",假发:"jiǎ fà",翻卷:"fān juǎn",小量:"xiǎo liàng",胶着:"jiāo zhuó",里子:"lǐ zi",调调:"diào diao",散兵:"sǎn bīng",高挑:"gāo tiǎo",播撒:"bō sǎ",夹心:"jiā xīn",扇动:"shān dòng",叨扰:"tāo rǎo",霓裳:"ní cháng",捻子:"niǎn zi",弥缝:"mí féng",撒布:"sǎ bù",场院:"cháng yuàn",省亲:"xǐng qīn",提拉:"tí lā",惯量:"guàn liàng",强逼:"qiáng bī",强征:"qiáng zhēng",晕车:"yùn chē",数道:"shù dào",带累:"dài lèi",拓本:"tà běn",嫌恶:"xián wù",宿将:"sù jiàng",龟裂:"jūn liè",缠夹:"chán jiā",发式:"fà shì",隔扇:"gé shàn",天分:"tiān fèn",癖好:"pǐ hào",四通:"sì tōng",白术:"bái zhú",划伤:"huá shāng",角斗:"jué dòu",听差:"tīng chāi",岁差:"suì chā",丧礼:"sāng lǐ",脉脉:"mò mò",削瘦:"xuē shòu",撒播:"sǎ bō",莎草:"suō cǎo",犍为:"qián wéi",调头:"diào tóu",龙卷:"lóng juǎn",外调:"wài diào",字帖:"zì tiè",卷发:"juǎn fà",揣度:"chuǎi duó",洋相:"yáng xiàng",散光:"sǎn guāng",骨碌:"gū lu",薄命:"bó mìng",笼头:"lóng tóu",咽炎:"yān yán",碌碡:"liù zhou",片儿:"piàn er",纤手:"qiàn shǒu",散体:"sǎn tǐ",内省:"nèi xǐng",强留:"qiáng liú",解送:"jiè sòng",反间:"fǎn jiàn",少壮:"shào zhuàng",留空:"liú kōng",告假:"gào jià",咳血:"ké xuè",薄暮:"bó mù",铺轨:"pū guǐ",磨削:"mó xuē",治丧:"zhì sāng",叉子:"chā zi",哄动:"hōng dòng",蛾子:"é zi",出落:"chū luò",股长:"gǔ zhǎng",贵处:"guì chù",还魂:"huán hún",例假:"lì jià",刹住:"shā zhù",身量:"shēn liàng",同好:"tóng hào",模量:"mó liàng",更生:"gēng shēng",服丧:"fú sāng",率直:"shuài zhí",字模:"zì mú",散架:"sǎn jià",答腔:"dā qiāng",交恶:"jiāo wù",薄情:"bó qíng",眼泡:"yǎn pāo",袅娜:"niǎo nuó",草垛:"cǎo duò",冲劲:"chòng jìn",呢喃:"ní nán",切中:"qiè zhòng",挑灯:"tiǎo dēng",还愿:"huán yuàn",激将:"jī jiàng",更鼓:"gēng gǔ",没药:"mò yào",败兴:"bài xìng",切面:"qiē miàn",散户:"sǎn hù",累进:"lěi jìn",背带:"bēi dài",秤杆:"chèng gǎn",碾坊:"niǎn fáng",簿子:"bù zi",扳手:"bān shǒu",铅山:"yán shān",儒将:"rú jiàng",重光:"chóng guāng",剪发:"jiǎn fà",长上:"zhǎng shàng",小传:"xiǎo zhuàn",压轴:"yā zhòu",弱冠:"ruò guàn",花卷:"huā juǎn",横祸:"hèng huò",夹克:"jiā kè",光晕:"guāng yùn",披靡:"pī mǐ",对调:"duì diào",夹持:"jiā chí",空额:"kòng é",平调:"píng diào",铺床:"pū chuáng",丧钟:"sāng zhōng",作乐:"zuò lè",少府:"shào fǔ",数数:"shuò shuò",奔头:"bèn tou",进给:"jìn jǐ",率性:"shuài xìng",乐子:"lè zi",绑扎:"bǎng zā",挑唆:"tiǎo suō",漂洗:"piǎo xǐ",夹墙:"jiā qiáng",咳喘:"ké chuǎn",乜斜:"miē xie",错处:"cuò chù",闷酒:"mèn jiǔ",时调:"shí diào",重孙:"chóng sūn",经幢:"jīng chuáng",圩场:"xū chǎng",调门:"diào mén",花头:"huā tóu",划拉:"huá la",套色:"tào shǎi",粗率:"cū shuài",相率:"xiāng shuài",款识:"kuǎn zhì",吁请:"yù qǐng",荫蔽:"yīn bì",文蛤:"wén gé",嘀嗒:"dī dā",调取:"diào qǔ",交差:"jiāo chāi",落子:"luò zǐ",相册:"xiàng cè",絮叨:"xù dao",落发:"luò fà",异相:"yì xiàng",浸没:"jìn mò",角抵:"jué dǐ",卸载:"xiè zài",春卷:"chūn juǎn",扎挣:"zhá zheng",畜养:"xù yǎng",吡咯:"bǐ luò",垛子:"duò zi",恶少:"è shào",发际:"fà jì",红苕:"hóng sháo",糨糊:"jiàng hu",哭丧:"kū sāng",稍息:"shào xī",晕船:"yùn chuán",校样:"jiào yàng",外差:"wài chā",脚爪:"jiǎo zhǎo",铺展:"pū zhǎn",芫荽:"yán sui",夹紧:"jiā jǐn",尿泡:"suī pào",丧乱:"sāng luàn",凶相:"xiōng xiàng",华发:"huá fà",打场:"dǎ cháng",云量:"yún liàng",正切:"zhèng qiē",划拳:"huá quán",划艇:"huá tǐng",评传:"píng zhuàn",拉纤:"lā qiàn",句读:"jù dòu",散剂:"sǎn jì",骨殖:"gǔ shi",塞音:"sè yīn",铺叙:"pū xù",阏氏:"yān zhī",冷颤:"lěng zhàn",煞住:"shā zhù",少男:"shào nán",管乐:"guǎn yuè",号啕:"háo táo",纳降:"nà xiáng",拥塞:"yōng sè",万乘:"wàn shèng",杆儿:"gǎn ér",葛藤:"gé téng",簿籍:"bù jí",皮夹:"pí jiā",校准:"jiào zhǔn",允当:"yǔn dàng",器量:"qì liàng",选调:"xuǎn diào",扮相:"bàn xiàng",干才:"gàn cái",基干:"jī gàn",割切:"gē qiē",国乐:"guó yuè",卡壳:"qiǎ ké",辟谷:"bì gǔ",磨房:"mò fáng",咿呀:"yī yā",芥末:"jiè mo",薄技:"bó jì",产假:"chǎn jià",诗兴:"shī xìng",重出:"chóng chū",转椅:"zhuàn yǐ",酌量:"zhuó liang",簿册:"bù cè",藏青:"zàng qīng",的士:"dī shì",调人:"diào rén",解元:"jiè yuán",茎干:"jīng gàn",巨量:"jù liàng",榔头:"láng tou",率真:"shuài zhēn",喷香:"pèn xiāng",锁钥:"suǒ yuè",虾蟆:"há má",相图:"xiàng tú",兴会:"xìng huì",灶头:"zào tóu",重婚:"chóng hūn",钻洞:"zuān dòng",忖度:"cǔn duó",党参:"dǎng shēn",调温:"diào wēn",杆塔:"gān tǎ",葛布:"gé bù",拱券:"gǒng xuàn",夹生:"jiā shēng",露馅:"lòu xiàn",恰切:"qià qiè",散见:"sǎn jiàn",哨卡:"shào qiǎ",烫发:"tàng fà",体量:"tǐ liàng",挺括:"tǐng kuò",系带:"jì dài",相士:"xiàng shì",羊圈:"yáng juàn",转矩:"zhuàn jǔ",吧台:"bā tái",苍术:"cāng zhú",菲薄:"fěi bó",蛤蚧:"gé jiè",蛤蜊:"gé lí",瓜蔓:"guā wàn",怪相:"guài xiàng",临帖:"lín tiè",女红:"nǚ gōng",刨床:"bào chuáng",翘楚:"qiáo chǔ",数九:"shǔ jiǔ",谈兴:"tán xìng",雄劲:"xióng jìng",扎染:"zā rǎn",遮荫:"zhē yīn",周正:"zhōu zhèng",赚头:"zhuàn tou",扒手:"pá shǒu",搀和:"chān huo",诚朴:"chéng pǔ",肚量:"dù liàng",干结:"gān jié",工尺:"gōng chě",家累:"jiā lěi",曲水:"qū shuǐ",沙参:"shā shēn",挑花:"tiǎo huā",阿门:"ā mén",背篓:"bēi lǒu",瘪三:"biē sān",裁处:"cái chǔ",创痛:"chuāng tòng",福相:"fú xiàng",更动:"gēng dòng",豪兴:"háo xìng",还阳:"huán yáng",还嘴:"huán zuǐ",借调:"jiè diào",卷云:"juǎn yún",流弹:"liú dàn",想头:"xiǎng tou",削价:"xuē jià",校阅:"jiào yuè",雅量:"yǎ liàng",别传:"bié zhuàn",薄酒:"bó jiǔ",春假:"chūn jià",发妻:"fà qī",哗哗:"huā huā",宽绰:"kuān chuo",了悟:"liǎo wù",切花:"qiē huā",审度:"shěn duó",应许:"yīng xǔ",转台:"zhuàn tái",仔猪:"zǐ zhū",裁量:"cái liáng",藏戏:"zàng xì",乘兴:"chéng xìng",绸缪:"chóu móu",摧折:"cuī zhé",调经:"tiáo jīng",调职:"diào zhí",缝缀:"féng zhuì",骨朵:"gū duǒ",核儿:"hú er",恒量:"héng liàng",还价:"huán jià",浑朴:"hún pǔ",苦差:"kǔ chāi",面糊:"miàn hù",煞车:"shā chē",省视:"xǐng shì",什锦:"shí jǐn",信差:"xìn chāi",余切:"yú qiē",攒眉:"cuán méi",炸糕:"zhá gāo",钻杆:"zuàn gǎn",扒灰:"pá huī",拌和:"bàn huò",长调:"cháng diào",大溜:"dà liù",抖搂:"dǒu lōu",飞转:"fēi zhuàn",干仗:"gàn zhàng",好胜:"hào shèng",画片:"huà piàn",搅混:"jiǎo hún",螺杆:"luó gǎn",木模:"mù mú",怒号:"nù háo",频数:"pín shù",无宁:"wú níng",遗少:"yí shào",邮差:"yóu chāi",占卦:"zhān guà",占星:"zhān xīng",重审:"chóng shěn",自量:"zì liàng",调防:"diào fáng",发廊:"fà láng",反调:"fǎn diào",缝子:"fèng zi",更夫:"gēng fū",骨子:"gǔ zi",光杆:"guāng gǎn",夹棍:"jiā gùn",居丧:"jū sāng",巨贾:"jù gǔ",看押:"kān yā",空转:"kōng zhuàn",量力:"liàng lì",炮烙:"páo luò",赔还:"péi huán",扑扇:"pū shān",散记:"sǎn jì",散件:"sǎn jiàn",删削:"shān xuē",射干:"shè gàn",条几:"tiáo jī",偷空:"tōu kòng",削壁:"xuē bì",校核:"jiào hé",阴干:"yīn gān",择菜:"zhái cài",重九:"chóng jiǔ",主调:"zhǔ diào",自禁:"zì jīn",吧唧:"bā jī",便溺:"biàn niào",词调:"cí diào",叨咕:"dáo gu",落枕:"lào zhěn",铺砌:"pū qì",刷白:"shuà bái",委靡:"wěi mǐ",系泊:"xì bó",相马:"xiàng mǎ",熨帖:"yù tiē",转筋:"zhuàn jīn",棒喝:"bàng hè",傧相:"bīn xiàng",镐头:"gǎo tóu",间苗:"jiàn miáo",乐池:"yuè chí",卖相:"mài xiàng",屏弃:"bǐng qì",铅弹:"qiān dàn",切变:"qiē biàn",请调:"qǐng diào",群氓:"qún méng",散板:"sǎn bǎn",省察:"xǐng chá",事假:"shì jià",纤绳:"qiàn shéng",重影:"chóng yǐng",耕种:"gēng zhòng",种地:"zhòng dì",种菜:"zhòng cài",栽种:"zāi zhòng",接种:"jiē zhòng",垦种:"kěn zhòng",种殖:"zhòng zhí",种瓜:"zhòng guā",种豆:"zhòng dòu",种树:"zhòng shù",睡着:"shuì zháo",笼子:"lóng zi",重启:"chóng qǐ",重整:"chóng zhěng",重弹:"chóng tán",重足:"chóng zú",重山:"chóng shān",重游:"chóng yóu",重峦:"chóng luán",爷爷:"yé ye",奶奶:"nǎi nai",姥爷:"lǎo ye",爸爸:"bà ba",妈妈:"mā ma",婶婶:"shěn shen",舅舅:"jiù jiu",姑姑:"gū gu",叔叔:"shū shu",姨夫:"yí fu",舅母:"jiù mu",姑父:"gū fu",姐夫:"jiě fu",婆婆:"pó po",公公:"gōng gong",舅子:"jiù zi",姐姐:"jiě jie",哥哥:"gē ge",妹妹:"mèi mei",妹夫:"mèi fu",姨子:"yí zi",宝宝:"bǎo bao",娃娃:"wá wa",孩子:"hái zi",日子:"rì zi",样子:"yàng zi",狮子:"shī zi",身子:"shēn zi",架子:"jià zi",嫂子:"sǎo zi",鼻子:"bí zi",亭子:"tíng zi",折子:"zhé zi",面子:"miàn zi",脖子:"bó zi",辈子:"bèi zi",帽子:"mào zi",拍子:"pāi zi",柱子:"zhù zi",辫子:"biàn zi",鸽子:"gē zi",房子:"fáng zi",丸子:"wán zi",摊子:"tān zi",牌子:"pái zi",胡子:"hú zi",鬼子:"guǐ zi",矮子:"ǎi zi",鸭子:"yā zi",小子:"xiǎo zi",影子:"yǐng zi",屋子:"wū zi",对子:"duì zi",点子:"diǎn zi",本子:"běn zi",种子:"zhǒng zi",儿子:"ér zi",兔子:"tù zi",骗子:"piàn zi",院子:"yuàn zi",猴子:"hóu zi",嗓子:"sǎng zi",侄子:"zhí zi",柿子:"shì zi",钳子:"qián zi",虱子:"shī zi",瓶子:"píng zi",豹子:"bào zi",筷子:"kuài zi",篮子:"lán zi",绳子:"shéng zi",嘴巴:"zuǐ ba",耳朵:"ěr duo",茄子:"qié zi",蚌埠:"bèng bù",崆峒:"kōng tóng",琵琶:"pí pa",蘑菇:"mó gu",葫芦:"hú lu",狐狸:"hú li",桔子:"jú zi",盒子:"hé zi",桌子:"zhuō zi",竹子:"zhú zi",师傅:"shī fu",衣服:"yī fu",袜子:"wà zi",杯子:"bēi zi",刺猬:"cì wei",麦子:"mài zi",队伍:"duì wu",知了:"zhī liǎo",鱼儿:"yú er",馄饨:"hún tun",灯笼:"dēng long",庄稼:"zhuāng jia",聪明:"cōng ming",镜子:"jìng zi",银子:"yín zi",盘子:"pán zi",了却:"liǎo què",力气:"lì qi",席子:"xí zi",林子:"lín zi",朝霞:"zhāo xiá",朝夕:"zhāo xī",朝气:"zhāo qì",翅膀:"chì bǎng",省长:"shěng zhǎng",臧否:"zāng pǐ",否泰:"pǐ tài",变得:"biàn de",丈夫:"zhàng fu",豆腐:"dòu fu",笔杆:"bǐ gǎn",枞阳:"zōng yáng",行人:"xíng rén",打着:"dǎ zhe",第一:"dì yī",万一:"wàn yī",之一:"zhī yī",得之:"dé zhī",统一:"tǒng yī",唯一:"wéi yī",专一:"zhuān yī",单一:"dān yī",如一:"rú yī",其一:"qí yī",合一:"hé yī",逐一:"zhú yī",周一:"zhōu yī",初一:"chū yī",研一:"yán yī",归一:"guī yī",假一:"jiǎ yī",闻一:"wén yī",了了:"liǎo liǎo",公了:"gōng liǎo",私了:"sī liǎo",一月:"yī yuè",一号:"yī hào",一级:"yī jí",一等:"yī děng",一哥:"yī gē",月一:"yuè yī",一一:"yī yī",二一:"èr yī",三一:"sān yī",四一:"sì yī",五一:"wǔ yī",六一:"liù yī",七一:"qī yī",八一:"bā yī",九一:"jiǔ yī","一〇":"yī líng",一零:"yī líng",一二:"yī èr",一三:"yī sān",一四:"yī sì",一五:"yī wǔ",一六:"yī liù",一七:"yī qī",一八:"yī bā",一九:"yī jiǔ",一又:"yī yòu",一饼:"yī bǐng",一楼:"yī lóu",为例:"wéi lì",为准:"wéi zhǔn",沧海:"cāng hǎi",难为:"nán wéi",责难:"zé nàn",患难:"huàn nàn",磨难:"mó nàn",大难:"dà nàn",刁难:"diāo nàn",殉难:"xùn nàn",落难:"luò nàn",罹难:"lí nàn",灾难:"zāi nàn",难民:"nàn mín",苦难:"kǔ nàn",危难:"wēi nàn",发难:"fā nàn",逃难:"táo nàn",避难:"bì nàn",遇难:"yù nàn",阻难:"zǔ nàn",厄难:"è nàn",徇难:"xùn nàn",空难:"kōng nàn",喜欢:"xǐ huan",朝朝:"zhāo zhāo",不行:"bù xíng",轧轧:"yà yà",弯曲:"wān qū",扭曲:"niǔ qū",曲直:"qū zhí",委曲:"wěi qū",酒曲:"jiǔ qū",曲径:"qū jìng",曲解:"qū jiě",歪曲:"wāi qū",曲线:"qū xiàn",曲阜:"qū fù",九曲:"jiǔ qū",曲折:"qū zhé",曲肱:"qū gōng",曲意:"qū yì",仡佬:"gē lǎo"},lle=Object.keys(NI).map(e=>({zh:e,pinyin:NI[e],probability:2e-8,length:2,priority:Vl.Normal,dict:Symbol("dict2")})),DI={为什么:"wèi shén me",实际上:"shí jì shang",检察长:"jiǎn chá zhǎng",干什么:"gàn shén me",这会儿:"zhè huì er",尽可能:"jǐn kě néng",董事长:"dǒng shì zhǎng",了不起:"liǎo bù qǐ",参谋长:"cān móu zhǎng",朝鲜族:"cháo xiǎn zú",海内外:"hǎi nèi wài",禁不住:"jīn bú zhù",柏拉图:"bó lā tú",不在乎:"bú zài hu",洛杉矶:"luò shān jī",有点儿:"yǒu diǎn er",迫击炮:"pǎi jī pào",不得了:"bù dé liǎo",马尾松:"mǎ wěi sōng",运输量:"yùn shū liàng",发脾气:"fā pí qi",士大夫:"shì dà fū",鸭绿江:"yā lù jiāng",压根儿:"yà gēn er",对得起:"duì de qǐ",那会儿:"nà huì er",自个儿:"zì gě er",物理量:"wù lǐ liàng",怎么着:"zěn me zhāo",明晃晃:"míng huǎng huǎng",节假日:"jié jià rì",心里话:"xīn lǐ huà",发行量:"fā xíng liàng",兴冲冲:"xìng chōng chōng",分子量:"fēn zǐ liàng",国子监:"guó zǐ jiàn",老大难:"lǎo dà nán",党内外:"dǎng nèi wài",这么着:"zhè me zhāo",少奶奶:"shào nǎi nai",暗地里:"àn dì lǐ",更年期:"gēng nián qī",工作量:"gōng zuò liàng",背地里:"bèi dì lǐ",山里红:"shān li hóng",好好儿:"hǎo hāo er",交响乐:"jiāo xiǎng yuè",好意思:"hǎo yì si",吐谷浑:"tǔ yù hún",没意思:"méi yì si",理发师:"lǐ fà shī",塔什干:"tǎ shí gān",充其量:"chōng qí liàng",靠得住:"kào de zhù",车行道:"chē xíng dào",人行道:"rén xíng dào",中郎将:"zhōng láng jiàng",照明弹:"zhào míng dàn",烟幕弹:"yān mù dàn",没奈何:"mò nài hé",乱哄哄:"luàn hōng hōng",惠更斯:"huì gēng sī",载重量:"zài zhòng liàng",瞧得起:"qiáo de qǐ",纪传体:"jì zhuàn tǐ",阿房宫:"ē páng gōng",卷心菜:"juǎn xīn cài",戏班子:"xì bān zi",过得去:"guò de qù",花岗石:"huā gāng shí",外甥女:"wài sheng nǚ",团团转:"tuán tuán zhuàn",大堡礁:"dà bǎo jiāo",燃烧弹:"rán shāo dàn",劳什子:"láo shí zi",摇滚乐:"yáo gǔn yuè",夹竹桃:"jiā zhú táo",闹哄哄:"nào hōng hōng",三连冠:"sān lián guàn",重头戏:"zhòng tóu xì",二人转:"èr rén zhuàn",节骨眼:"jiē gǔ yǎn",知识面:"zhī shi miàn",护士长:"hù shi zhǎng",信号弹:"xìn hào dàn",干电池:"gān diàn chí",枪杆子:"qiāng gǎn zi",哭丧棒:"kū sāng bàng",鼻咽癌:"bí yān ái",瓦岗军:"wǎ gāng jūn",买得起:"mǎi de qǐ",癞蛤蟆:"lài há ma",脊梁骨:"jǐ liang gǔ",子母弹:"zǐ mǔ dàn",开小差:"kāi xiǎo chāi",女强人:"nǚ qiáng rén",英雄传:"yīng xióng zhuàn",爵士乐:"jué shì yuè",说笑话:"shuō xiào hua",碰头会:"pèng tóu huì",玻璃钢:"bō li gāng",曳光弹:"yè guāng dàn",少林拳:"shào lín quán",咏叹调:"yǒng tàn diào",少先队:"shào xiān duì",灵长目:"líng zhǎng mù",对着干:"duì zhe gàn",蒙蒙亮:"méng méng liàng",软骨头:"ruǎn gǔ tou",铺盖卷:"pū gài juǎn",和稀泥:"huò xī ní",背黑锅:"bēi hēi guō",红彤彤:"hóng tōng tōng",武侯祠:"wǔ hóu cí",打哆嗦:"dǎ duō suo",户口簿:"hù kǒu bù",马尾藻:"mǎ wěi zǎo",夜猫子:"yè māo zi",打手势:"dǎ shǒu shì",龙王爷:"lóng wáng yé",气头上:"qì tóu shang",糊涂虫:"hú tu chóng",笔杆子:"bǐ gǎn zi",占便宜:"zhàn pián yi",打主意:"dǎ zhǔ yì",多弹头:"duō dàn tóu",露一手:"lòu yì shǒu",堰塞湖:"yàn sè hú",保得住:"bǎo de zhù",趵突泉:"bào tū quán",奥得河:"ào de hé",司务长:"sī wù zhǎng",禁不起:"jīn bù qǐ",什刹海:"shí chà hǎi",莲花落:"lián huā lào",见世面:"jiàn shì miàn",豁出去:"huō chū qù",电位差:"diàn wèi chā",挨个儿:"āi gè er",那阵儿:"nà zhèn er",肺活量:"fèi huó liàng",大师傅:"dà shī fu",掷弹筒:"zhì dàn tǒng",打呼噜:"dǎ hū lu",广渠门:"ān qú mén",未见得:"wèi jiàn dé",大婶儿:"dà shěn er",谈得来:"tán de lái",脚丫子:"jiǎo yā zi",空包弹:"kōng bāo dàn",窝里斗:"wō li dòu",弹着点:"dàn zhuó diǎn",个头儿:"gè tóu er",看得起:"kàn de qǐ",糊涂账:"hú tu zhàng",大猩猩:"dà xīng xing",禁得起:"jīn de qǐ",法相宗:"fǎ xiàng zōng",可怜相:"kě lián xiàng",吃得下:"chī de xià",汉堡包:"hàn bǎo bāo",闹嚷嚷:"nào rāng rāng",数来宝:"shǔ lái bǎo",合得来:"hé de lái",干性油:"gān xìng yóu",闷葫芦:"mèn hú lu",呱呱叫:"guā guā jiào",西洋参:"xī yáng shēn",林荫道:"lín yīn dào",拉家常:"lā jiā cháng",卷铺盖:"juǎn pū gài",过得硬:"guò de yìng",飞将军:"fēi jiāng jūn",挑大梁:"tiǎo dà liáng",哈巴狗:"hǎ ba gǒu",过家家:"guò jiā jiā",催泪弹:"cuī lèi dàn",雨夹雪:"yǔ jiā xuě",敲竹杠:"qiāo zhú gàng",列车长:"liè chē zhǎng",华达呢:"huá dá ní",犯得着:"fàn de zháo",土疙瘩:"tǔ gē da",煞风景:"shā fēng jǐng",轻量级:"qīng liàng jí",羞答答:"xiū dā dā",石子儿:"shí zǐ er",达姆弹:"dá mǔ dàn",科教片:"kē jiào piān",侃大山:"kǎn dà shān",丁点儿:"dīng diǎn er",吃得消:"chī de xiāo",捋虎须:"luō hǔ xū",高丽参:"gāo lí shēn",众生相:"zhòng shēng xiàng",咽峡炎:"yān xiá yán",禁得住:"jīn de zhù",吃得开:"chī de kāi",柞丝绸:"zuò sī chóu",应声虫:"yìng shēng chóng",数得着:"shǔ de zháo",傻劲儿:"shǎ jìn er",铅玻璃:"qiān bō li",可的松:"kě dì sōng",划得来:"huá de lái",晕乎乎:"yūn hū hū",屎壳郎:"shǐ ke làng",尥蹶子:"liào juě zi",藏红花:"zàng hóng huā",闷罐车:"mèn guàn chē",卡脖子:"qiǎ bó zi",红澄澄:"hóng deng deng",赶得及:"gǎn de jí",当间儿:"dāng jiàn er",露马脚:"lòu mǎ jiǎo",鸡内金:"jī nèi jīn",犯得上:"fàn de shàng",钉齿耙:"dīng chǐ bà",饱和点:"bǎo hé diǎn",龙爪槐:"lóng zhǎo huái",喝倒彩:"hè dào cǎi",定冠词:"dìng guàn cí",担担面:"dàn dan miàn",吃得住:"chī de zhù",爪尖儿:"zhuǎ jiān er",支着儿:"zhī zhāo er",折跟头:"zhē gēn tou",阴着儿:"yīn zhāo er",烟卷儿:"yān juǎn er",宣传弹:"xuān chuán dàn",信皮儿:"xìn pí er",弦切角:"xián qiē jiǎo",缩砂密:"sù shā mì",说得来:"shuō de lái",水漂儿:"shuǐ piāo er",耍笔杆:"shuǎ bǐ gǎn",数得上:"shǔ de shàng",数不着:"shǔ bù zháo",数不清:"shǔ bù qīng",什件儿:"shí jiàn er",生死簿:"shēng sǐ bù",扇风机:"shān fēng jī",撒呓挣:"sā yì zheng",日记簿:"rì jì bù",热得快:"rè de kuài",亲家公:"qìng jia gōng",奇函数:"jī hán shù",拍纸簿:"pāi zhǐ bù",努劲儿:"nǔ jìn er",泥娃娃:"ní wá wa",内切圆:"nèi qiē yuán",哪会儿:"nǎ huì er",闷头儿:"mēn tóu er",没谱儿:"méi pǔ er",铆劲儿:"mǎo jìn er",溜肩膀:"liū jiān bǎng",了望台:"liào wàng tái",老来少:"lǎo lái shào",坤角儿:"kūn jué er",考勤簿:"kǎo qín bù",卷笔刀:"juǎn bǐ dāo",进给量:"jìn jǐ liàng",划不来:"huá bù lái",汗褂儿:"hàn guà er",鼓囊囊:"gǔ nāng nāng",够劲儿:"gòu jìn er",公切线:"gōng qiē xiàn",搁得住:"gé de zhù",赶浪头:"gǎn làng tóu",赶得上:"gǎn de shàng",干酵母:"gān jiào mǔ",嘎渣儿:"gā zhā er",嘎嘣脆:"gā bēng cuì",对得住:"duì de zhù",逗闷子:"dòu mèn zi",顶呱呱:"dǐng guā guā",滴溜儿:"dī liù er",大轴子:"dà zhòu zi",打板子:"dǎ bǎn zi",寸劲儿:"cùn jìn er",醋劲儿:"cù jìn er",揣手儿:"chuāi shǒu er",冲劲儿:"chòng jìn er",吃得来:"chī de lái",不更事:"bù gēng shì",奔头儿:"bèn tou er",百夫长:"bǎi fū zhǎng",娃娃亲:"wá wa qīn",死劲儿:"sǐ jìn er",骨朵儿:"gū duǒ er",功劳簿:"gōng láo bù",都江堰:"dū jiāng yàn",一担水:"yí dàn shuǐ",否极泰:"pǐ jí tài",泰来否:"tài lái pǐ",咳特灵:"ké tè líng",开户行:"kāi hù háng",郦食其:"lì yì jī",花事了:"huā shì liǎo",一更更:"yì gēng gēng",一重山:"yì chóng shān",风一更:"fēng yì gēng",雪一更:"xuě yì gēng",归一码:"guī yì mǎ",星期一:"xīng qī yī",礼拜一:"lǐ bài yī",一季度:"yī jì dù",一月一:"yī yuè yī",一字马:"yī zì mǎ",一是一:"yī shì yī",一次方:"yī cì fāng",一阳指:"yī yáng zhǐ",一字决:"yī zì jué",一年级:"yī nián jí",一不做:"yī bú zuò",屈戌儿:"qū qu ér",难为水:"nán wéi shuǐ",难为情:"nán wéi qíng",行一行:"xíng yì háng",别别的:"biè bié de",干哪行:"gàn nǎ háng",干一行:"gàn yì háng",曲别针:"qū bié zhēn"},ale=Object.keys(DI).map(e=>({zh:e,pinyin:DI[e],probability:2e-8,length:3,priority:Vl.Normal,dict:Symbol("dict3")})),FI={成吉思汗:"chéng jí sī hán",四通八达:"sì tōng bā dá",一模一样:"yì mú yí yàng",青藏高原:"qīng zàng gāo yuán",阿弥陀佛:"ē mí tuó fó",解放思想:"jiè fàng sī xiǎng",所作所为:"suǒ zuò suǒ wéi",迷迷糊糊:"mí mí hu hū",荷枪实弹:"hè qiāng shí dàn",兴高采烈:"xìng gāo cǎi liè",无能为力:"wú néng wéi lì",布鲁塞尔:"bù lǔ sài ěr",为所欲为:"wéi suǒ yù wéi",克什米尔:"kè shí mǐ ěr",没完没了:"méi wán méi liǎo",不为人知:"bù wéi rén zhī",结结巴巴:"jiē jiē bā bā",前仆后继:"qián pū hòu jì",铺天盖地:"pū tiān gài dì",直截了当:"zhí jié liǎo dàng",供不应求:"gōng bú yìng qiú",御史大夫:"yù shǐ dà fū",不为瓦全:"bù wéi wǎ quán",不可收拾:"bù kě shōu shi",胡作非为:"hú zuò fēi wéi",分毫不差:"fēn háo bú chà",模模糊糊:"mó mó hu hū",不足为奇:"bù zú wéi qí",悄无声息:"qiǎo wú shēng xī",了如指掌:"liǎo rú zhǐ zhǎng",深恶痛绝:"shēn wù tòng jué",高高兴兴:"gāo gāo xìng xìng",唉声叹气:"āi shēng tàn qì",汉藏语系:"hàn zàng yǔ xì",处心积虑:"chǔ xīn jī lǜ",泣不成声:"qì bù chéng shēng",半夜三更:"bàn yè sān gēng",失魂落魄:"shī hún luò pò",二十八宿:"èr shí bā xiù",转来转去:"zhuàn lái zhuàn qù",数以万计:"shǔ yǐ wàn jì",相依为命:"xiāng yī wéi mìng",恋恋不舍:"liàn liàn bù shě",屈指可数:"qū zhǐ kě shǔ",神出鬼没:"shén chū guǐ mò",结结实实:"jiē jiē shí shí",有的放矢:"yǒu dì fàng shǐ",叽哩咕噜:"jī lǐ gū lū",调兵遣将:"diào bīng qiǎn jiàng",载歌载舞:"zài gē zài wǔ",转危为安:"zhuǎn wēi wéi ān",踏踏实实:"tā tā shi shí",桑给巴尔:"sāng jǐ bā ěr",装模作样:"zhuāng mú zuò yàng",见义勇为:"jiàn yì yǒng wéi",相差无几:"xiāng chā wú jǐ",叹为观止:"tàn wéi guān zhǐ",闷闷不乐:"mèn mèn bú lè",喜怒哀乐:"xǐ nù āi lè",鲜为人知:"xiǎn wéi rén zhī",张牙舞爪:"zhāng yá wǔ zhǎo",为非作歹:"wéi fēi zuò dǎi",含糊其辞:"hán hú qí cí",疲于奔命:"pí yú bēn mìng",勉为其难:"miǎn wéi qí nán",依依不舍:"yī yī bù shě",顶头上司:"dǐng tóu shàng si",不着边际:"bù zhuó biān jì",大模大样:"dà mú dà yàng",寻欢作乐:"xún huān zuò lè",一走了之:"yì zǒu liǎo zhī",字里行间:"zì lǐ háng jiān",含含糊糊:"hán hán hu hū",恰如其分:"qià rú qí fèn",破涕为笑:"pò tì wéi xiào",深更半夜:"shēn gēng bàn yè",千差万别:"qiān chā wàn bié",数不胜数:"shǔ bú shèng shǔ",据为己有:"jù wéi jǐ yǒu",天旋地转:"tiān xuán dì zhuàn",养尊处优:"yǎng zūn chǔ yōu",玻璃纤维:"bō li xiān wéi",吵吵闹闹:"chāo chao nào nào",晕头转向:"yūn tóu zhuàn xiàng",土生土长:"tǔ shēng tǔ zhǎng",宁死不屈:"nìng sǐ bù qū",不省人事:"bù xǐng rén shì",尽力而为:"jìn lì ér wéi",精明强干:"jīng míng qiáng gàn",唠唠叨叨:"láo lao dāo dāo",叽叽喳喳:"jī ji zhā zhā",功不可没:"gōng bù kě mò",锲而不舍:"qiè ér bù shě",排忧解难:"pái yōu jiě nàn",稀里糊涂:"xī li hú tú",各有所长:"gè yǒu suǒ cháng",的的确确:"dí dí què què",哄堂大笑:"hōng táng dà xiào",听而不闻:"tīng ér bù wén",刀耕火种:"dāo gēng huǒ zhòng",内分泌腺:"nèi fèn mì xiàn",化险为夷:"huà xiǎn wéi yí",百发百中:"bǎi fā bǎi zhòng",重见天日:"chóng jiàn tiān rì",反败为胜:"fǎn bài wéi shèng",一了百了:"yì liǎo bǎi liǎo",大大咧咧:"dà da liē liē",心急火燎:"xīn jí huǒ liǎo",粗心大意:"cū xīn dà yi",鸡皮疙瘩:"jī pí gē da",夷为平地:"yí wéi píng dì",日积月累:"rì jī yuè lěi",设身处地:"shè shēn chǔ dì",投其所好:"tóu qí suǒ hào",间不容发:"jiān bù róng fà",人满为患:"rén mǎn wéi huàn",穷追不舍:"qióng zhuī bù shě",为时已晚:"wéi shí yǐ wǎn",如数家珍:"rú shǔ jiā zhēn",心里有数:"xīn lǐ yǒu shù",以牙还牙:"yǐ yá huán yá",神不守舍:"shén bù shǒu shě",孟什维克:"mèng shí wéi kè",各自为战:"gè zì wéi zhàn",怨声载道:"yuàn shēng zài dào",救苦救难:"jiù kǔ jiù nàn",好好先生:"hǎo hǎo xiān sheng",怪模怪样:"guài mú guài yàng",抛头露面:"pāo tóu lù miàn",游手好闲:"yóu shǒu hào xián",无所不为:"wú suǒ bù wéi",调虎离山:"diào hǔ lí shān",步步为营:"bù bù wéi yíng",好大喜功:"hào dà xǐ gōng",众矢之的:"zhòng shǐ zhī dì",长生不死:"cháng shēng bù sǐ",蔚为壮观:"wèi wéi zhuàng guān",不可胜数:"bù kě shèng shǔ",鬼使神差:"guǐ shǐ shén chāi",洁身自好:"jié shēn zì hào",敢作敢为:"gǎn zuò gǎn wéi",茅塞顿开:"máo sè dùn kāi",走马换将:"zǒu mǎ huàn jiàng",为时过早:"wéi shí guò zǎo",为人师表:"wéi rén shī biǎo",阴差阳错:"yīn chā yáng cuò",油腔滑调:"yóu qiāng huá diào",重蹈覆辙:"chóng dǎo fù zhé",骂骂咧咧:"mà ma liē liē",絮絮叨叨:"xù xù dāo dāo",如履薄冰:"rú lǚ bó bīng",损兵折将:"sǔn bīng zhé jiàng",拐弯抹角:"guǎi wān mò jiǎo",像模像样:"xiàng mú xiàng yàng",供过于求:"gōng guò yú qiú",开花结果:"kāi huā jiē guǒ",仔仔细细:"zǐ zǐ xì xì",川藏公路:"chuān zàng gōng lù",河北梆子:"hé běi bāng zi",长年累月:"cháng nián lěi yuè",正儿八经:"zhèng er bā jīng",不识抬举:"bù shí tái ju",重振旗鼓:"chóng zhèn qí gǔ",气息奄奄:"qì xī yān yān",紧追不舍:"jǐn zhuī bù shě",服服帖帖:"fú fu tiē tiē",强词夺理:"qiǎng cí duó lǐ",噼里啪啦:"pī li pā lā",人才济济:"rén cái jǐ jǐ",发人深省:"fā rén shēn xǐng",不足为凭:"bù zú wéi píng",为富不仁:"wéi fù bù rén",连篇累牍:"lián piān lěi dú",呼天抢地:"hū tiān qiāng dì",落落大方:"luò luò dà fāng",自吹自擂:"zì chuī zì léi",乐善好施:"lè shàn hào shī",以攻为守:"yǐ gōng wéi shǒu",磨磨蹭蹭:"mó mó cèng cèng",削铁如泥:"xuē tiě rú ní",助纣为虐:"zhù zhòu wéi nüè",以退为进:"yǐ tuì wéi jìn",嘁嘁喳喳:"qī qī chā chā",枪林弹雨:"qiāng lín dàn yǔ",令人发指:"lìng rén fà zhǐ",转败为胜:"zhuǎn bài wéi shèng",转弯抹角:"zhuǎn wān mò jiǎo",在劫难逃:"zài jié nán táo",正当防卫:"zhèng dàng fáng wèi",不足为怪:"bù zú wéi guài",难兄难弟:"nàn xiōng nàn dì",咿咿呀呀:"yī yī yā yā",弹尽粮绝:"dàn jìn liáng jué",阿谀奉承:"ē yú fèng chéng",稀里哗啦:"xī li huā lā",返老还童:"fǎn lǎo huán tóng",好高骛远:"hào gāo wù yuǎn",鹿死谁手:"lù sǐ shéi shǒu",差强人意:"chā qiáng rén yì",大吹大擂:"dà chuī dà léi",成家立业:"chéng jiā lì yè",自怨自艾:"zì yuàn zì yì",负债累累:"fù zhài lěi lěi",古为今用:"gǔ wéi jīn yòng",入土为安:"rù tǔ wéi ān",下不为例:"xià bù wéi lì",一哄而上:"yì hōng ér shàng",没头苍蝇:"méi tóu cāng ying",天差地远:"tiān chā dì yuǎn",风卷残云:"fēng juǎn cán yún",多灾多难:"duō zāi duō nàn",乳臭未干:"rǔ xiù wèi gān",行家里手:"háng jiā lǐ shǒu",狼狈为奸:"láng bèi wéi jiān",处变不惊:"chǔ biàn bù jīng",一唱一和:"yí chàng yí hè",一念之差:"yí niàn zhī chā",金蝉脱壳:"jīn chán tuō qiào",滴滴答答:"dī dī dā dā",硕果累累:"shuò guǒ léi léi",好整以暇:"hào zhěng yǐ xiá",红得发紫:"hóng de fā zǐ",传为美谈:"chuán wéi měi tán",富商大贾:"fù shāng dà gǔ",四海为家:"sì hǎi wéi jiā",了若指掌:"liǎo ruò zhǐ zhǎng",大有可为:"dà yǒu kě wéi",出头露面:"chū tóu lù miàn",鼓鼓囊囊:"gǔ gu nāng nāng",窗明几净:"chuāng míng jī jìng",泰然处之:"tài rán chǔ zhī",怒发冲冠:"nù fà chōng guān",有机玻璃:"yǒu jī bō li",骨头架子:"gǔ tou jià zi",义薄云天:"yì bó yún tiān",一丁点儿:"yī dīng diǎn er",时来运转:"shí lái yùn zhuǎn",陈词滥调:"chén cí làn diào",化整为零:"huà zhěng wéi líng",火烧火燎:"huǒ shāo huǒ liǎo",干脆利索:"gàn cuì lì suǒ",吊儿郎当:"diào er láng dāng",广种薄收:"guǎng zhòng bó shōu",种瓜得瓜:"zhòng guā dé guā",种豆得豆:"zhòng dòu dé dòu",难舍难分:"nán shě nán fēn",歃血为盟:"shà xuè wéi méng",奋发有为:"fèn fā yǒu wéi",阴错阳差:"yīn cuò yáng chā",东躲西藏:"dōng duǒ xī cáng",烟熏火燎:"yān xūn huǒ liǎo",钻牛角尖:"zuān niú jiǎo jiān",乔装打扮:"qiáo zhuāng dǎ bàn",改弦更张:"gǎi xián gēng zhāng",河南梆子:"hé nán bāng zi",好吃懒做:"hào chī lǎn zuò",何乐不为:"hé lè bù wéi",大出风头:"dà chū fēng tóu",攻城掠地:"gōng chéng lüè dì",漂漂亮亮:"piào piào liang liang",折衷主义:"zhé zhōng zhǔ yì",大马哈鱼:"dà mǎ hǎ yú",绿树成荫:"lǜ shù chéng yīn",率先垂范:"shuài xiān chuí fàn",家长里短:"jiā cháng lǐ duǎn",宽大为怀:"kuān dà wéi huái",左膀右臂:"zuǒ bǎng yòu bì",一笑了之:"yí xiào liǎo zhī",天下为公:"tiān xià wéi gōng",还我河山:"huán wǒ hé shān",何足为奇:"hé zú wéi qí",好自为之:"hǎo zì wéi zhī",风姿绰约:"fēng zī chuò yuē",大雨滂沱:"dà yǔ pāng tuó",传为佳话:"chuán wéi jiā huà",吃里扒外:"chī lǐ pá wài",重操旧业:"chóng cāo jiù yè",小家子气:"xiǎo jiā zi qì",少不更事:"shào bù gēng shì",难分难舍:"nán fēn nán shě",添砖加瓦:"tiān zhuān jiā wǎ",是非分明:"shì fēi fēn míng",舍我其谁:"shě wǒ qí shuí",偏听偏信:"piān tīng piān xìn",量入为出:"liàng rù wéi chū",降龙伏虎:"xiáng lóng fú hǔ",钢化玻璃:"gāng huà bō li",正中下怀:"zhèng zhòng xià huái",以身许国:"yǐ shēn xǔ guó",一语中的:"yì yǔ zhòng dì",丧魂落魄:"sàng hún luò pò",三座大山:"sān zuò dà shān",济济一堂:"jǐ jǐ yì táng",好事之徒:"hào shì zhī tú",干净利索:"gàn jìng lì suǒ",出将入相:"chū jiàng rù xiàng",袅袅娜娜:"niǎo niǎo nuó nuó",狐狸尾巴:"hú li wěi ba",好逸恶劳:"hào yì wù láo",大而无当:"dà ér wú dàng",打马虎眼:"dǎ mǎ hu yǎn",板上钉钉:"bǎn shàng dìng dīng",吆五喝六:"yāo wǔ hè liù",虾兵蟹将:"xiā bīng xiè jiàng",水调歌头:"shuǐ diào gē tóu",数典忘祖:"shǔ diǎn wàng zǔ",人事不省:"rén shì bù xǐng",曲高和寡:"qǔ gāo hè guǎ",屡教不改:"lǚ jiào bù gǎi",互为因果:"hù wéi yīn guǒ",互为表里:"hù wéi biǎo lǐ",厚此薄彼:"hòu cǐ bó bǐ",过关斩将:"guò guān zhǎn jiàng",疙疙瘩瘩:"gē ge dā dā",大腹便便:"dà fù pián pián",走为上策:"zǒu wéi shàng cè",冤家对头:"yuān jia duì tóu",有隙可乘:"yǒu xì kě chèng",一鳞半爪:"yì lín bàn zhǎo",片言只语:"piàn yán zhǐ yǔ",开花结实:"kāi huā jié shí",经年累月:"jīng nián lěi yuè",含糊其词:"hán hú qí cí",寡廉鲜耻:"guǎ lián xiǎn chǐ",成年累月:"chéng nián lěi yuè",不徇私情:"bú xùn sī qíng",不当人子:"bù dāng rén zǐ",膀大腰圆:"bǎng dà yāo yuán",指腹为婚:"zhǐ fù wéi hūn",这么点儿:"zhè me diǎn er",意兴索然:"yì xīng suǒ rán",绣花枕头:"xiù huā zhěn tou",无的放矢:"wú dì fàng shǐ",望闻问切:"wàng wén wèn qiè",舍己为人:"shě jǐ wèi rén",穷年累月:"qióng nián lěi yuè",排难解纷:"pái nàn jiě fēn",处之泰然:"chǔ zhī tài rán",指鹿为马:"zhǐ lù wéi mǎ",危如累卵:"wēi rú lěi luǎn",天兵天将:"tiān bīng tiān jiàng",舍近求远:"shě jìn qiú yuǎn",南腔北调:"nán qiāng běi diào",苦中作乐:"kǔ zhōng zuò lè",厚积薄发:"hòu jī bó fā",臭味相投:"xiù wèi xiāng tóu",长幼有序:"zhǎng yòu yǒu xù",逼良为娼:"bī liáng wéi chāng",悲悲切切:"bēi bēi qiè qiē",败军之将:"bài jūn zhī jiàng",欺行霸市:"qī háng bà shì",削足适履:"xuē zú shì lǚ",先睹为快:"xiān dǔ wéi kuài",啼饥号寒:"tí jī háo hán",疏不间亲:"shū bú jiàn qīn",神差鬼使:"shén chāi guǐ shǐ",敲敲打打:"qiāo qiāo dǎ dǎ",平铺直叙:"píng pū zhí xù",没头没尾:"méi tóu mò wěi",寥寥可数:"liáo liáo kě shǔ",哼哈二将:"hēng hā èr jiàng",鹤发童颜:"hè fà tóng yán",各奔前程:"gè bèn qián chéng",弹无虚发:"dàn wú xū fā",大人先生:"dà rén xiān sheng",与民更始:"yǔ mín gēng shǐ",树碑立传:"shù bēi lì zhuàn",是非得失:"shì fēi dé shī",实逼处此:"shí bī chǔ cǐ",塞翁失马:"sài wēng shī mǎ",日薄西山:"rì bó xī shān",切身体会:"qiè shēn tǐ huì",片言只字:"piàn yán zhǐ zì",跑马卖解:"pǎo mǎ mài xiè",宁折不弯:"nìng zhé bù wān",零零散散:"líng líng sǎn sǎn",量体裁衣:"liàng tǐ cái yī",连中三元:"lián zhòng sān yuán",礼崩乐坏:"lǐ bēng yuè huài",不为已甚:"bù wéi yǐ shèn",转悲为喜:"zhuǎn bēi wéi xǐ",以眼还眼:"yǐ yǎn huán yǎn",蔚为大观:"wèi wéi dà guān",未为不可:"wèi wéi bù kě",童颜鹤发:"tóng yán hè fà",朋比为奸:"péng bǐ wéi jiān",莫此为甚:"mò cǐ wéi shèn",夹枪带棒:"jiā qiāng dài bàng",富商巨贾:"fù shāng jù jiǎ",淡然处之:"dàn rán chǔ zhī",箪食壶浆:"dān shí hú jiāng",创巨痛深:"chuāng jù tòng shēn",草长莺飞:"cǎo zhǎng yīng fēi",坐视不救:"zuò shī bú jiù",以己度人:"yǐ jǐ duó rén",随行就市:"suí háng jiù shì",文以载道:"wén yǐ zài dào",文不对题:"wén bú duì tí",铁板钉钉:"tiě bǎn dìng dīng",身体发肤:"shēn tǐ fà fū",缺吃少穿:"quē chī shǎo chuān",目无尊长:"mù wú zūn zhǎng",吉人天相:"jí rén tiān xiàng",毁家纾难:"huǐ jiā shū nàn",钢筋铁骨:"gāng jīn tiě gǔ",丢卒保车:"diū zú bǎo jū",丢三落四:"diū sān là sì",闭目塞听:"bì mù sè tīng",削尖脑袋:"xuē jiān nǎo dài",为非作恶:"wéi fēi zuò è",人才难得:"rén cái nán dé",情非得已:"qíng fēi dé yǐ",切中要害:"qiè zhòng yào hài",火急火燎:"huǒ jí huǒ liǎo",画地为牢:"huà dì wéi láo",好酒贪杯:"hào jiǔ tān bēi",长歌当哭:"cháng gē dàng kū",载沉载浮:"zài chén zài fú",遇难呈祥:"yù nàn chéng xiáng",榆木疙瘩:"yú mù gē da",以邻为壑:"yǐ lín wéi hè",洋为中用:"yáng wéi zhōng yòng",言为心声:"yán wéi xīn shēng",言必有中:"yán bì yǒu zhòng",图穷匕见:"tú qióng bǐ xiàn",滂沱大雨:"páng tuó dà yǔ",目不暇给:"mù bù xiá jǐ",量才录用:"liàng cái lù yòng",教学相长:"jiào xué xiāng zhǎng",悔不当初:"huǐ bù dāng chū",呼幺喝六:"hū yāo hè liù",不足为训:"bù zú wéi xùn",不拘形迹:"bù jū xíng jī",傍若无人:"páng ruò wú rén",罪责难逃:"zuì zé nán táo",自我吹嘘:"zì wǒ chuī xū",转祸为福:"zhuǎn huò wéi fú",勇冠三军:"yǒng guàn sān jūn",易地而处:"yì dì ér chǔ",卸磨杀驴:"xiè mò shā lǘ",玩儿不转:"wán ér bú zhuàn",天道好还:"tiān dào hǎo huán",身单力薄:"shēn dān lì bó",撒豆成兵:"sǎ dòu chéng bīng",片纸只字:"piàn zhǐ zhī zì",宁缺毋滥:"nìng quē wú làn",没没无闻:"mò mò wú wén",量力而为:"liàng lì ér wéi",历历可数:"lì lì kě shǔ",口碑载道:"kǒu bēi zài dào",君子好逑:"jūn zǐ hǎo qiú",好为人师:"hào wéi rén shī",豪商巨贾:"háo shāng jù jiǎ",各有所好:"gè yǒu suǒ hào",度德量力:"duó dé liàng lì",指天为誓:"zhǐ tiān wéi shì",逸兴遄飞:"yì xìng chuán fēi",心宽体胖:"xīn kuān tǐ pán",为德不卒:"wéi dé bù zú",天下为家:"tiān xià wéi jiā",视为畏途:"shì wéi wèi tú",三灾八难:"sān zāi bā nàn",沐猴而冠:"mù hóu ér guàn",哩哩啦啦:"lī li lā lā",见缝就钻:"jiàn fèng jiù zuān",夹层玻璃:"jiā céng bō li",急公好义:"jí gōng hào yì",积年累月:"jī nián lěi yuè",划地为牢:"huá dì wéi láo",更名改姓:"gēng míng gǎi xìng",奉为圭臬:"fèng wéi guī niè",多难兴邦:"duō nàn xīng bāng",不破不立:"bú pò bú lì",坐地自划:"zuò dì zì huá",坐不重席:"zuò bù chóng xí",坐不窥堂:"zuò bù kuī táng",作嫁衣裳:"zuò jià yī shang",左枝右梧:"zuǒ zhī yòu wú",左宜右有:"zuǒ yí yòu yǒu",钻头觅缝:"zuān tóu mì fèng",钻天打洞:"zuān tiān dǎ dòng",钻皮出羽:"zuān pí chū yǔ",钻火得冰:"zuān huǒ dé bīng",钻洞觅缝:"zuàn dòng mì féng",钻冰求火:"zuān bīng qiú huǒ",子为父隐:"zǐ wéi fù yǐn",擢发难数:"zhuó fà nán shǔ",着人先鞭:"zhuó rén xiān biān",斫雕为朴:"zhuó diāo wéi pǔ",锥处囊中:"zhuī chǔ náng zhōng",椎心饮泣:"chuí xīn yǐn qì",椎心泣血:"chuí xīn qì xuè",椎牛飨士:"chuí niú xiǎng shì",椎牛歃血:"chuí niú shà xuè",椎牛发冢:"chuí niú fà zhǒng",椎埋屠狗:"chuí mái tú gǒu",椎埋狗窃:"chuí mái gǒu qiè",壮发冲冠:"zhuàng fā chōng guàn",庄严宝相:"zhuāng yán bǎo xiàng",转愁为喜:"zhuǎn chóu wéi xǐ",转嗔为喜:"zhuǎn chēn wéi xǐ",拽巷啰街:"zhuài xiàng luó jiē",拽耙扶犁:"zhuāi pá fú lí",拽布拖麻:"zhuài bù tuō má",箸长碗短:"zhù cháng wǎn duǎn",铸剑为犁:"zhù jiàn wéi lí",杼柚其空:"zhù yòu qí kōng",杼柚空虚:"zhù yòu kōng xū",助天为虐:"zhù tiān wéi nüè",属垣有耳:"zhǔ yuán yǒu ěr",属毛离里:"zhǔ máo lí lǐ",属辞比事:"zhǔ cí bǐ shì",逐物不还:"zhú wù bù huán",铢量寸度:"zhū liáng cùn duó",铢两悉称:"zhū liǎng xī chèn",侏儒观戏:"zhū rú guān xì",朱轓皁盖:"zhū fān zào gài",昼度夜思:"zhòu duó yè sī",诪张为幻:"zhōu zhāng wéi huàn",重明继焰:"chóng míng jì yàn",众啄同音:"zhòng zhuó tóng yīn",众毛攒裘:"zhòng máo cuán qiú",众好众恶:"zhòng hào zhòng wù",擿埴索涂:"zhāi zhí suǒ tú",稚齿婑媠:"zhì chǐ wǒ tuó",至当不易:"zhì dàng bú yì",指皂为白:"zhǐ zào wéi bái",指雁为羹:"zhǐ yàn wéi gēng",指树为姓:"zhǐ shù wéi xìng",指山说磨:"zhǐ shān shuō mò",止戈为武:"zhǐ gē wéi wǔ",枝干相持:"zhī gàn xiāng chí",枝大于本:"zh dà yú běn",支吾其词:"zhī wú qí cí",正身率下:"zhèng shēn shuài xià",正冠李下:"zhèng guàn lǐ xià",整冠纳履:"zhěng guān nà lǚ",整躬率物:"zhěng gōng shuài wù",整顿干坤:"zhěng dùn gàn kūn",针头削铁:"zhēn tóu xuē tiě",贞松劲柏:"zhēn sōng jìng bǎi",赭衣塞路:"zhě yī sè lù",折箭为誓:"shé jiàn wéi shì",折而族之:"zhé ér zú zhī",昭德塞违:"zhāo dé sè wéi",章句小儒:"zhāng jù xiǎo rú",湛恩汪濊:"zhàn ēn wāng huì",占风望气:"zhān fēng wàng qì",斩将搴旗:"zhǎn jiàng qiān qí",曾母投杼:"zēng mǔ tóu zhù",曾参杀人:"zēng shēn shā rén",造谣中伤:"zào yáo zhòng shāng",早占勿药:"zǎo zhān wù yào",凿龟数策:"záo guī shǔ cè",攒三聚五:"cuán sān jù wǔ",攒眉蹙额:"cuán mei cù é",攒零合整:"cuán líng hé zhěng",攒锋聚镝:"cuán fēng jù dí",载笑载言:"zài xiào zài yán",载酒问字:"zài jiǔ wèn zì",殒身不恤:"yǔn shēn bú xù",云舒霞卷:"yún shū xiá juǎn",月中折桂:"yuè zhōng shé guì",月落参横:"yuè luò shēn héng",鬻驽窃价:"yù nú qiè jià",鬻鸡为凤:"yù jī wéi fèng",遇难成祥:"yù nàn chéng xiáng",郁郁累累:"yù yù lěi lěi",玉卮无当:"yù zhī wú dàng",语笑喧阗:"yǔ xiào xuān tián",与世沉浮:"yǔ shì chén fú",与时消息:"yǔ shí xiāo xi",逾墙钻隙:"yú qiáng zuān xì",渔夺侵牟:"yú duó qīn móu",杅穿皮蠹:"yú chuān pí dù",余勇可贾:"yú yǒng kě gǔ",予智予雄:"yú zhì yú xióng",予取予求:"yú qǔ yú qiú",于家为国:"yú jiā wéi guó",有借无还:"yǒu jiè wú huán",有加无已:"yǒu jiā wú yǐ",有国难投:"yǒu guó nán tóu",游必有方:"yóu bì yǒu fāng",油干灯尽:"yóu gàn dēng jìn",尤云殢雨:"yóu yún tì yǔ",庸中皦皦:"yōng zhōng jiǎo jiǎo",郢书燕说:"yǐng shū yān shuō",营蝇斐锦:"yíng yíng fēi jǐn",鹰心雁爪:"yīng xīn yàn zhǎo",莺吟燕儛:"yīng yín yàn wǔ",应天顺时:"yīng tiān shùn shí",印累绶若:"yìn léi shòu ruò",隐占身体:"yǐn zhàn shēn tǐ",饮犊上流:"yìn dú shàng liú",引绳切墨:"yǐn shéng qiē mò",龈齿弹舌:"yín chǐ dàn shé",因缘为市:"yīn yuán wéi shì",因树为屋:"yīn shù wéi wū",溢美溢恶:"yì měi yì wù",抑塞磊落:"yì sè lěi luò",倚闾望切:"yǐ lǘ wàng qiē",以意为之:"yǐ yì wéi zhī",以言为讳:"yǐ yán wéi huì",以疏间亲:"yǐ shū jiàn qīn",以水济水:"yǐ shuǐ jǐ shuǐ",以书为御:"yǐ shū wéi yù",以守为攻:"yǐ shǒu wéi gōng",以升量石:"yǐ shēng liáng dàn",以慎为键:"yǐ shèn wéi jiàn",以筌为鱼:"yǐ quán wéi yú",以利累形:"yǐ lì lěi xíng",以毁为罚:"yǐ huǐ wéi fá",以黑为白:"yǐ hēi wéi bái",以规为瑱:"yǐ guī wéi tiàn",以古为鉴:"yǐ gǔ wéi jiàn",以宫笑角:"yǐ gōng xiào jué",以法为教:"yǐ fǎ wéi jiào",以大恶细:"yǐ dà wù xì",遗世忘累:"yí shì wàng lěi",遗寝载怀:"yí qǐn zài huái",移的就箭:"yí dì jiù jiàn",依头缕当:"yī tóu lǚ dàng",衣租食税:"yì zū shí shuì",衣轻乘肥:"yì qīng chéng féi",衣裳之会:"yī shang zhī huì",衣单食薄:"yī dān shí bó",一还一报:"yì huán yí bào",叶公好龙:"yè gōng hào lóng",野调无腔:"yě diào wú qiāng",瑶池女使:"yáo chí nǚ shǐ",幺麽小丑:"yāo mó xiǎo chǒu",养精畜锐:"yǎng jīng xù ruì",卬首信眉:"áng shǒu shēn méi",洋洋纚纚:"yáng yáng sǎ sǎ",羊羔美酒:"yáng gāo měi jiǔ",扬风扢雅:"yáng fēng jié yǎ",燕昭市骏:"yān zhāo shì jùn",燕昭好马:"yān zhāo hǎo mǎ",燕石妄珍:"yān shí wàng zhēn",燕骏千金:"yān jùn qiān jīn",燕金募秀:"yān jīn mù xiù",燕驾越毂:"yān jià yuè gǔ",燕歌赵舞:"yān gē zhào wǔ",燕岱之石:"yān dài zhī shí",燕处危巢:"yàn chǔ wēi cháo",掞藻飞声:"shàn zǎo fēi shēng",偃革为轩:"yǎn gé wéi xuān",妍蚩好恶:"yán chī hǎo è",压良为贱:"yā liáng wéi jiàn",搀行夺市:"chān háng duó shì",泣数行下:"qì shù háng xià",当行出色:"dāng háng chū sè",秀出班行:"xiù chū bān háng",儿女成行:"ér nǚ chéng háng",大行大市:"dà háng dà shì",寻行数墨:"xún háng shǔ mò",埙篪相和:"xūn chí xiāng hè",血债累累:"xuè zhài lěi lěi",炫玉贾石:"xuàn yù gǔ shí",炫石为玉:"xuàn shí wéi yù",悬石程书:"xuán dàn chéng shū",悬狟素飡:"xuán huán sù cān",悬龟系鱼:"xuán guī xì yú",揎拳捋袖:"xuān quán luō xiù",轩鹤冠猴:"xuān hè guàn hóu",畜妻养子:"xù qī yǎng zǐ",羞人答答:"xiū rén dā dā",修鳞养爪:"xiū lín yǎng zhǎo",熊据虎跱:"xióng jù hǔ zhì",兄死弟及:"xiōng sǐ dì jí",腥闻在上:"xīng wén zài shàng",兴文匽武:"xīng wén yǎn wǔ",兴观群怨:"xìng guān qún yuàn",兴高彩烈:"xìng gāo cǎi liè",心手相应:"xīn shǒu xiāng yìng",心口相应:"xīn kǒu xiāng yīng",挟势弄权:"xié shì nòng quán",胁肩累足:"xié jiān lěi zú",校短量长:"jiào duǎn liáng cháng",小眼薄皮:"xiǎo yǎn bó pí",硝云弹雨:"xiāo yún dàn yǔ",鸮鸣鼠暴:"xiāo míng shǔ bào",削株掘根:"xuē zhū jué gēn",削铁无声:"xuē tiě wú shēng",削职为民:"xuē zhí wéi mín",削木为吏:"xuē mù wéi lì",想望风褱:"xiǎng wàng fēng huái",香培玉琢:"xiang pei yu zhuó",相鼠有皮:"xiàng shǔ yǒu pí",相时而动:"xiàng shí ér dòng",相切相磋:"xiāng qiē xiāng cuō",相女配夫:"xiàng nǚ pèi fū",相门有相:"xiàng mén yǒu xiàng",挦章撦句:"xián zhāng chě jù",先我着鞭:"xiān wǒ zhuó biān",习焉不察:"xí yān bù chá",歙漆阿胶:"shè qī ē jiāo",晰毛辨发:"xī máo biàn fà",悉索薄赋:"xī suǒ bó fù",雾鳞云爪:"wù lín yún zhǎo",物稀为贵:"wù xī wéi guì",碔砆混玉:"wǔ fū hùn yù",武断专横:"wǔ duàn zhuān héng",五石六鹢:"wǔ shí liù yì",五色相宣:"wǔ sè xiāng xuān",五侯七贵:"wǔ hóu qī guì",五侯蜡烛:"wǔ hòu là zhú",五羖大夫:"wǔ gǔ dà fū",吾自有处:"wú zì yǒu chǔ",无下箸处:"wú xià zhù chǔ",无伤无臭:"wú shāng wú xiù",无能为役:"wú néng wéi yì",无寇暴死:"wú kòu bào sǐ",无孔不钻:"wú kǒng bú zuàn",无间可乘:"wú jiān kě chéng",无间冬夏:"wú jiān dōng xià",无恶不为:"wú è bù wéi",无动为大:"wú dòng wéi dà",诬良为盗:"wū liáng wéi dào",握拳透爪:"wò quán tòu zhǎo",文武差事:"wén wǔ chāi shì",委委佗佗:"wēi wēi tuó tuó",惟日为岁:"wéi rì wéi suì",帷薄不修:"wéi bó bù xiū",为善最乐:"wéi shàn zuì lè",为山止篑:"wéi shān zhǐ kuì",为仁不富:"wéi rén bú fù",为裘为箕:"wéi qiú wéi jī",为民父母:"wéi mín fù mǔ",为虺弗摧:"wéi huǐ fú cuī",为好成歉:"wéi hǎo chéng qiàn",为鬼为蜮:"wéi guǐ wéi yù",望风响应:"wàng fēng xiǎng yīng",望尘僄声:"wàng chén piào shēng",往渚还汀:"wǎng zhǔ huán tīng",王贡弹冠:"wáng gòng dàn guàn",亡国大夫:"wáng guó dà fū",万贯家私:"wàn guàn jiā sī",晚食当肉:"wǎn shí dàng ròu",晚节不保:"wǎn jié bù bǎo",玩岁愒时:"wán suì kài shí",蛙蟆胜负:"wā má shèng fù",吞言咽理:"tūn yán yàn lǐ",颓垣断堑:"tuí yuán duàn qiàn",推干就湿:"tuī gàn jiù shī",剸繁决剧:"tuán fán jué jù",团头聚面:"tuán tóu jù miàn",兔丝燕麦:"tù sī yàn mài",兔头麞脑:"tù tóu zhāng nǎo",兔葵燕麦:"tù kuí yàn mài",吐哺握发:"tǔ bǔ wò fà",投传而去:"tóu zhuàn ér qù",头没杯案:"tóu mò bēi àn",头昏脑闷:"tóu hūn nǎo mèn",头会箕敛:"tóu kuài jī liǎn",头出头没:"tóu chū tóu mò",痛自创艾:"tòng zì chuāng yì",同恶相助:"tóng wù xiāng zhù",同恶相恤:"tóng wù xiāng xù",痌瘝在抱:"tōng guān zài bào",通文调武:"tōng wén diào wǔ",停留长智:"tíng liú zhǎng zhì",铁树开华:"tiě shù kāi huā",条贯部分:"tiáo guàn bù fēn",挑牙料唇:"tiǎo yá liào chún",挑么挑六:"tiāo yāo tiāo liù",挑唇料嘴:"tiǎo chún liào zuǐ",恬不为意:"tián bù wéi yì",恬不为怪:"tián bù wéi guài",天下为笼:"tiān xià wéi lóng",天台路迷:"tiān tái lù mí",天年不遂:"tiān nián bú suì",探囊胠箧:"tàn náng qū qiè",谭言微中:"tán yán wēi zhòng",谈言微中:"tán yán wēi zhòng",狧穅及米:"shì kāng jí mǐ",随物应机:"suí wù yīng jī",搜岩采干:"sōu yán cǎi gàn",宋斤鲁削:"sòng jīn lǔ xuē",松筠之节:"sōng yún zhī jié",四亭八当:"sì tíng bā dàng",四马攒蹄:"sì mǎ cuán tí",四不拗六:"sì bú niù liù",思所逐之:"sī suǒ zhú zhī",丝恩发怨:"sī ēn fà yuàn",硕望宿德:"shuò wàng xiǔ dé",铄古切今:"shuò gǔ qiē jīn",顺风而呼:"shùn fēng ér hū",顺风吹火:"shùn fēng chuī huǒ",水中著盐:"shuǐ zhōng zhuó yán",双柑斗酒:"shuāng gān dǒu jiǔ",数米而炊:"shǔ mǐ ér chuī",数米量柴:"shǔ mǐ liáng chái",数理逻辑:"shù lǐ luó ji",数黑论黄:"shǔ hēi lùn huáng",数白论黄:"shǔ bái lùn huáng",束缊还妇:"shù yūn huán fù",束蒲为脯:"shù pú wéi pú",束椽为柱:"shù chuán wéi zhù",书缺有间:"shū quē yǒu jiàn",手足重茧:"shǒu zú chóng jiǎn",手足异处:"shǒu zú yì chǔ",手脚干净:"shǒu jiǎo gàn jìng",手不应心:"shǒu bù yīng xīn",螫手解腕:"shì shǒu jiě wàn",释知遗形:"shì zhī yí xíng",适时应务:"shì shí yīng wù",适情率意:"shì qíng shuài yì",适当其冲:"shì dāng qí chōng",视为知己:"shì wéi zhī jǐ",使羊将狼:"shǐ yáng jiàng láng",食为民天:"shí wéi mín tiān",拾掇无遗:"shí duō wú yí",实与有力:"shí yù yǒu lì",石英玻璃:"shí yīng bō li",石室金匮:"shí shì jīn guì",什袭珍藏:"shí xí zhēn cáng",什伍东西:"shí wǔ dōng xī",什围伍攻:"shí wéi wǔ gōng",十魔九难:"shí mó jiǔ nàn",诗书发冢:"shī shū fà zhǒng",虱处裈中:"shī chǔ kūn zhōng",师直为壮:"shī zhí wéi zhuàng",尸居龙见:"shī jū lóng xiàn",圣经贤传:"shèng jīng xián zhuàn",圣君贤相:"shèng jūn xián xiàng",生拖死拽:"shēng tuō sǐ zhuài",审己度人:"shěn jǐ duó rén",神武挂冠:"shén wǔ guà guàn",神龙失埶:"shén lóng shī shì",深文曲折:"shēn wén qǔ shé",深厉浅揭:"shēn lì qiǎn qì",深谷为陵:"shēn gǔ wéi líng",深恶痛疾:"shēn wù tòng jí",深仇宿怨:"shēn chóu xiǔ yuàn",舍己为公:"shě jǐ wèi gōng",舍短取长:"shě duǎn qǔ cháng",舍策追羊:"shě cè zhuī yáng",蛇蝎为心:"shé xiē wéi xīn",少成若性:"shào chéng ruò xìng",上当学乖:"shàng dàng xué guāi",赏不当功:"shǎng bù dāng gōng",善自为谋:"shàn zì wéi móu",善为说辞:"shàn wéi shuō cí",善善恶恶:"shàn shàn wù è",善财难舍:"shàn cái nán shě",苫眼铺眉:"shān yǎn pū méi",讪牙闲嗑:"shàn yá xián kē",山阴乘兴:"shān yīn chéng xīng",山殽野湋:"shān yáo yě wéi",山溜穿石:"shān liù chuān shí",山节藻棁:"shān jié zǎo zhuō",杀鸡为黍:"shā jī wéi shǔ",色厉胆薄:"sè lì dǎn bó",桑荫未移:"sāng yīn wèi yí",桑荫不徙:"sāng yīn bù xǐ",桑土绸缪:"sāng tǔ chóu miù",桑户棬枢:"sāng hù juàn shū",三战三北:"sān zhàn sān běi",三瓦两舍:"sān wǎ liǎng shě",三人为众:"sān rén wèi zhòng",三差两错:"sān chā liǎng cuò",塞井焚舍:"sāi jǐng fén shě",洒心更始:"sǎ xīn gèng shǐ",洒扫应对:"sǎ sǎo yìng duì",软红香土:"ruǎn hóng xiāng tǔ",入吾彀中:"rù wú gòu zhōng",入铁主簿:"rù tiě zhǔ bù",入理切情:"rù lǐ qiē qíng",汝成人耶:"rǔ chéng rén yé",如水投石:"rú shuǐ tóu shí",如切如磋:"rú qiē rú cuō",如登春台:"rú dēng chūn tái",肉薄骨并:"ròu bó gǔ bìng",柔情绰态:"róu qíng chuò tài",戎马劻勷:"róng mǎ kuāng ráng",日中为市:"rì zhōng wéi shì",日月参辰:"rì yuè shēn chén",日省月修:"rì xǐng yuè xiū",日削月割:"rì xuē yuè gē",日省月试:"rì xǐng yuè shì",任达不拘:"rèn dá bù jū",人言藉藉:"rén yán jí jí",人模狗样:"rén mú gǒu yàng",人莫予毒:"rén mò yú dú",热熬翻饼:"rè áo fān bǐng",圈牢养物:"juàn láo yǎng wù",取予有节:"qǔ yǔ yǒu jié",诎要桡腘:"qū yāo ráo guó",穷形尽相:"qióng xíng jìn xiàng",情凄意切:"qíng qī yì qiè",情见势屈:"qíng xiàn shì qū",情见乎辞:"qíng xiàn hū cí",清都绛阙:"qīng dōu jiàng què",倾肠倒肚:"qīng cháng dào dǔ",青紫被体:"qīng zǐ pī tǐ",青林黑塞:"qīng lín hēi sài",螓首蛾眉:"qín shǒu é méi",琴瑟之好:"qín sè zhī hào",且住为佳:"qiě zhù wéi jiā",切树倒根:"qiē shù dǎo gēn",切理餍心:"qiē lǐ yàn xīn",切近的当:"qiē jìn de dāng",翘足引领:"qiáo zú yǐn lǐng",巧发奇中:"qiǎo fā qí zhòng",强嘴拗舌:"jiàng zuǐ niù shé",强直自遂:"qiáng zhí zì suí",强死强活:"qiǎng sǐ qiǎng huó",强食自爱:"qiǎng shí zì ài",强食靡角:"qiǎng shí mí jiǎo",强弓劲弩:"qiáng gōng jìng nǔ",强聒不舍:"qiǎng guō bù shě",强凫变鹤:"qiáng fú biàn hè",强而后可:"qiǎng ér hòu kě",强得易贫:"qiǎng dé yì pín",遣兴陶情:"qiǎn xìng táo qíng",牵羊担酒:"qiān yáng dān jiǔ",千了百当:"qiān liǎo bǎi dàng",泣下如雨:"qì xià rú yǔ",起偃为竖:"qǐ yǎn wéi shù",岂弟君子:"kǎi tì jūn zǐ",綦溪利跂:"qí xī lì qí",棋输先著:"qí shū xiān zhuó",齐王舍牛:"qí wáng shě niú",欺天诳地:"qī tiān kuáng dì",普天率土:"pǔ tiān shuài tǔ",铺胸纳地:"pū xiōng nà dì",铺锦列绣:"pū jǐn liè xiù",破家为国:"pò jiā wèi guó",破觚为圜:"pò gū wéi yuán",萍飘蓬转:"píng piāo péng zhuàn",帡天极地:"píng tiān jí dì",屏声息气:"bǐng shēng xī qì",凭几据杖:"píng jī jù zhàng",贫嘴薄舌:"pín zuǐ bó shé",片语只辞:"piàn yǔ zhī cí",披发文身:"pī fà wén shēn",烹龙炮凤:"pēng lóng páo fèng",炰鳖脍鲤:"fǒu biē kuài lǐ",庞眉皓发:"páng méi hào fà",攀花折柳:"pān huā zhé liǔ",攀蟾折桂:"pān chán shé guì",女大难留:"nǚ dà nán liú",弄玉吹箫:"nòng yù chuī xiāo",弄管调弦:"nòng guǎn tiáo xián",弄粉调朱:"nòng fěn diào zhū",浓抹淡妆:"nóng mò dàn zhuāng",捻土为香:"niǎn tǔ wéi xiāng",年谊世好:"nián yì shì hǎo",年华垂暮:"nián huá chuí mù",儗不于伦:"nǐ bù yú lún",泥而不滓:"ní ér bù zǐ",能者为师:"néng zhě wéi shī",能不称官:"néng bú chèn guān",挠直为曲:"náo zhí wéi qū",难进易退:"nán jìn yì tuì",难得糊涂:"nán dé hú tú",南蛮鴂舌:"nán mán jué shé",南贩北贾:"nán fàn běi gǔ",牧猪奴戏:"mù zhū nú xì",目眢心忳:"mù yuān xīn tún",目挑心招:"mù tiǎo xīn zhāo",目量意营:"mù liàng yì yíng",木头木脑:"mù tóu mù nǎo",木干鸟栖:"mù gàn niǎo qī",侔色揣称:"móu sè chuǎi chèn",莫予毒也:"mò yú dú yě",抹粉施脂:"mò fěn shī zhī",磨砻镌切:"mó lóng juān qiē",磨棱刓角:"mó léng wán jiǎo",摸门不着:"mō mén bù zháo",摸不着边:"mō bù zhuó biān",命中注定:"mìng zhōng zhù dìng",鸣鹤之应:"míng hè zhī yìng",明效大验:"míng xiào dà yàn",名我固当:"míng wǒ gù dāng",邈处欿视:"miǎo chǔ kǎn shì",黾穴鸲巢:"měng xué qú cháo",绵里薄材:"mián lǐ bó cái",靡有孑遗:"mǐ yǒu jié yí",靡衣偷食:"mǐ yī tōu shí",迷恋骸骨:"mí liàn hái gǔ",扪参历井:"mén shēn lì jǐng",门单户薄:"mén dān hù bó",昧旦晨兴:"mèi dàn chén xīng",冒名接脚:"mào míng jiē jiǎo",毛遂堕井:"máo suí duò jǐng",毛发倒竖:"máo fā dǎo shù",卖文为生:"mài wén wéi shēng",卖李钻核:"mài lǐ zuān hé",买椟还珠:"mǎi dú huán zhū",埋三怨四:"mán sān yuàn sì",马入华山:"mǎ rù huá shān",落魄江湖:"luò pò jiāng hú",落落难合:"luò luò nán hé",落草为寇:"luò cǎo wéi kòu",罗织构陷:"luó zhī gòu xiàn",鸾凤和鸣:"luán fèng hè míng",率由旧章:"shuài yóu jiù zhāng",率土同庆:"shuài tǔ tóng qìng",率兽食人:"shuài shòu shí rén",率土归心:"shuài tǔ guī xīn",率马以骥:"shuài mǎ yǐ jì",率尔成章:"shuài ěr chéng zhāng",鲁斤燕削:"lǔ jīn yàn xuē",漏尽更阑:"lòu jìn gēng lán",笼鸟槛猿:"lóng niǎo jiàn yuán",笼鸟池鱼:"lóng niǎo chí yú",龙游曲沼:"lóng yóu qū zhǎo",龙血玄黄:"lóng xuè xuán huáng",龙雕凤咀:"lóng diāo fèng jǔ",六尺之讬:"liù chǐ zhī tuō",令原之戚:"líng yuán zhī qī",令人捧腹:"lìng rén pěng fù",陵劲淬砺:"líng jìng cuì lì",临敌易将:"lín dí yì jiàng",裂裳衣疮:"liè shang yī chuāng",裂冠毁冕:"liè guàn huǐ miǎn",了无惧色:"liǎo wú jù sè",了身达命:"liǎo shēn dá mìng",了然无闻:"liǎo rán wú wén",了不可见:"liǎo bù kě jiàn",了不长进:"liǎo bù zhǎng jìn",燎发摧枯:"liǎo fà cuī kū",审时度势:"shěn shí duó shì",量小力微:"liàng xiǎo lì wēi",相时度力:"xiāng shí duó lì",量枘制凿:"liàng ruì zhì záo",量如江海:"liàng rú jiāng hǎi",量金买赋:"liàng jīn mǎi fù",量己审分:"liàng jǐ shěn fēn",敛骨吹魂:"liǎn gǔ chuī hún",詈夷为跖:"lì yí wéi zhí",利令志惛:"lì lìng zhì hūn",李广不侯:"lǐ guǎng bú hòu",礼为情貌:"lǐ wéi qíng mào",礼让为国:"lǐ ràng wéi guó",犁生骍角:"lí shēng xīng jiǎo",离本徼末:"lí běn jiǎo mò",楞眉横眼:"léng méi hèng yǎn",擂天倒地:"léi tiān dǎo dì",累足成步:"lěi zú chéng bù",累瓦结绳:"lěi wǎ jié shéng",累土至山:"lěi tǔ zhì shān",累土聚沙:"lěi tǔ jù shā",累卵之危:"lěi luǎn zhī wēi",累累如珠:"lěi lěi rú zhū",累块积苏:"lěi kuài jī sū",乐山乐水:"lè shān lè shuǐ",潦原浸天:"lǎo yuán jìn tiān",老师宿儒:"lǎo shī xiǔ rú",牢什古子:"láo shí gǔ zi",琅嬛福地:"láng huán fú dì",揆情度理:"kuí qíng duó lǐ",旷日累时:"kuàng rì lěi shí",匡救弥缝:"kuāng jiù mí fèng",枯树生华:"kū shù shēng huā",口轻舌薄:"kǒu qīng shé bó",口角生风:"kǒu jiǎo shēng fēng",口角春风:"kǒu jiǎo chūn fēng",口角风情:"kǒu jiǎo fēng qíng",口干舌焦:"kǒu gān shé jiāo",口腹之累:"kǒu fù zhī lěi",空腹便便:"kōng fù pián pián",嗑牙料嘴:"kē yá liào zuǐ",刻木为鹄:"kè mù wéi hú",咳珠唾玉:"ké zhū tuò yù",咳唾成珠:"ké tuò chéng zhū",抗颜为师:"kàng yán wéi shī",开华结果:"kāi huā jié guǒ",峻阪盐车:"jùn bǎn yán chē",嚼铁咀金:"jiáo tiě jǔ jīn",嚼墨喷纸:"jué mò pēn zhǐ",倔头强脑:"juè tóu jiàng nǎo",倔头倔脑:"juè tóu juè nǎo",倦鸟知还:"juàn niǎo zhī huán",卷席而葬:"juǎn xí ér zàng",卷甲倍道:"juǎn jiǎ bèi dào",聚米为山:"jù mǐ wéi shān",举手相庆:"jǔ shǒu xiāng qìng",举世混浊:"jǔ shì hún zhuó",鞠为茂草:"jū wéi mào cǎo",拘神遣将:"jū shén qiǎn jiàng",居下讪上:"jū xià shàn shàng",久要不忘:"jiǔ yāo bú wàng",九转功成:"jiǔ zhuǎn gōng chéng",九蒸三熯:"jiǔ zhēng sān hàn",敬业乐群:"jìng yè lè qún",井底虾蟆:"jǐng dǐ xiā má",旌旗卷舒:"jīng qí juǎn shū",荆棘载途:"jīng jí zài tú",禁舍开塞:"jìn shě kāi sāi",祲威盛容:"jìn wēi shèng róng",进退消长:"jìn tuì xiāo cháng",进退应矩:"jìn tuì yīng jǔ",进退触籓:"jìn tuì chù fān",进退跋疐:"jìn tuì bá zhì",尽多尽少:"jǐn duō jǐn shǎo",锦囊还矢:"jǐn náng huán shǐ",矜己自饰:"jīn jǐ zì shì",矜功负气:"jīn gōng fù qì",津关险塞:"jīn guān xiǎn sài",金吾不禁:"jīn wú bú jìn",金翅擘海:"jīn chì bāi hǎi",解衣衣人:"jiě yī yī rén",解人难得:"jiě rén nán dé",解铃系铃:"jiě líng xì líng",解发佯狂:"jiě fà yáng kuáng",诘屈磝碻:"jié qū áo qiāo",教猱升木:"jiāo náo shēng mù",较瘦量肥:"jiào shòu liàng féi",角立杰出:"jiǎo lì jié chū",焦沙烂石:"jiāo shā làn shí",骄儿騃女:"jiāo ér sì nǚ",浇风薄俗:"jiāo fēng bó sú",降妖捉怪:"xiáng yāo zhuō guài",将取固予:"jiāng qǔ gù yǔ",将门有将:"jiàng mén yǒu jiàng",将夺固与:"jiāng duó gù yǔ",槛花笼鹤:"jiàn huā lóng hè",鉴影度形:"jiàn yǐng duó xíng",渐不可长:"jiàn bù kě zhǎng",见素抱朴:"xiàn sù bào pǔ",见弃于人:"jiàn qì yú rén",简丝数米:"jiǎn sī shǔ mǐ",俭不中礼:"jiǎn bú zhòng lǐ",间见层出:"jiàn xiàn céng chū",尖嘴薄舌:"jiān zuǐ bó shé",甲冠天下:"jiǎ guàn tiān xià",葭莩之亲:"jiā fú zhī qīn",家累千金:"jiā lèi qiān jīn",家给人足:"jiā jǐ rén zú",家道从容:"jiā dào cóng róng",夹袋人物:"jiā dài rén wù",霁风朗月:"jì fēng lǎng yuè",寄兴寓情:"jì xìng yù qíng",计深虑远:"jì shēn lǜ yuǎn",计功量罪:"jì gōng liàng zuì",掎裳连襼:"jǐ shang lián yì",虮虱相吊:"jǐ shī xiāng diào",疾不可为:"jí bù kě wéi",极深研几:"jí shēn yán jī",及宾有鱼:"jí bīn yǒu yú",激薄停浇:"jī bó tíng jiāo",积素累旧:"jī sù lěi jiù",积时累日:"jī shí lěi rì",积露为波:"jī lù wéi bō",积德累功:"jī dé lěi gōng",积谗糜骨:"jī chán méi gǔ",击排冒没:"jī pái mào mò",祸为福先:"huò wéi fú xiān",祸福相依:"huò fú xiāng yī",获隽公车:"huò jùn gōng chē",混应滥应:"hùn yīng làn yīng",毁舟为杕:"huǐ zhōu wéi duò",毁钟为铎:"huǐ zhōng wéi duó",毁冠裂裳:"huǐ guān liè cháng",晦盲否塞:"huì máng pǐ sè",回船转舵:"huí chuán zhuàn duò",潢池盗弄:"huáng chí dào nòng",黄冠草履:"huáng guàn cǎo lǚ",黄发儿齿:"huáng fà ér chǐ",黄发垂髫:"huáng fà chuí tiáo",还珠返璧:"huán zhū fǎn bì",还年驻色:"huán nián zhù sè",还年却老:"huán nián què lǎo",坏裳为裤:"huài shang wéi kù",画荻和丸:"huà dí huò wán",化枭为鸠:"huà xiāo wéi jiū",化腐为奇:"huà fǔ wéi qí",化鸱为凤:"huà chī wéi fèng",花不棱登:"huā bu lēng dēng",户限为穿:"hù xiàn wéi chuān",呼卢喝雉:"hū lú hè zhì",呼来喝去:"hū lái hè qù",呼不给吸:"hū bù jǐ xī",厚味腊毒:"hòu wèi xī dú",厚德载物:"hòu dé zài wù",鸿渐于干:"hóng jiàn yú gàn",洪炉燎发:"hóng lú liáo fà",红绳系足:"hóng shéng jì zú",红不棱登:"hóng bu lēng dēng",横抢硬夺:"hèng qiǎng yìng duó",横恩滥赏:"hèng ēn làn shǎng",恨海难填:"hèn hǎi nán tián",鹤发鸡皮:"hè fà jī pí",涸思干虑:"hé sī gān lǜ",河涸海干:"hé hé hǎi gān",和颜说色:"hé yán yuè sè",合从连衡:"hé zòng lián héng",浩浩汤汤:"hào hào shāng shāng",好勇斗狠:"hào yǒng dòu hěn",好问则裕:"hào wèn zé yù",好为事端:"hào wéi shì duān",好问决疑:"hào wèn jué yí",好生之德:"hào shēng zhī dé",好奇尚异:"hǎo qí shàng yì",好恶不同:"hǎo è bù tóng",好丹非素:"hào dān fēi sù",豪干暴取:"háo gàn bào qǔ",毫发不爽:"háo fà bù shuǎng",寒酸落魄:"hán suān luò pò",含英咀华:"hán yīng jǔ huá",含糊不明:"hán hú bù míng",过为已甚:"guò wéi yǐ shèn",桂折兰摧:"guì shé lán cuī",规旋矩折:"guī xuán jǔ shé",广文先生:"guǎng wén xiān sheng",广陵散绝:"guǎng líng sǎn jué",冠山戴粒:"guàn shān dài lì",冠屦倒施:"guàn jù dǎo shī",挂席为门:"guà xí wéi mén",寡见鲜闻:"guǎ jiàn xiǎn wén",瓜葛相连:"guā gé xiāng lián",鼓吻奋爪:"gǔ wěn fèn zhǎo",古调单弹:"gǔ diào dān tán",古调不弹:"gǔ diào bù tán",姑射神人:"gū yè shén rén",苟合取容:"gǒu hé qǔ róng",狗续侯冠:"gǒu xù hòu guàn",钩爪锯牙:"gōu zhǎo jù yá",共枝别干:"gòng zhī bié gàn",共为唇齿:"gòng wéi chún chǐ",拱手而降:"gǒng shǒu ér xiáng",拱肩缩背:"gǒng jiān suō bèi",功薄蝉翼:"gōng bó chán yì",弓调马服:"gōng diào mǎ fú",更姓改物:"gēng xìng gǎi wù",更仆难数:"gēng pú nán shǔ",更令明号:"gēng lìng míng hào",更待干罢:"gèng dài gàn bà",更唱迭和:"gēng chàng dié hé",更长梦短:"gēng cháng mèng duǎn",各色名样:"gè sè míng yàng",格格不纳:"gé gé bú nà",格格不吐:"gé gé bù tǔ",告朔饩羊:"gù shuò xì yáng",膏车秣马:"gào chē mò mǎ",高义薄云:"gāo yì bó yún",岗头泽底:"gāng tóu zé dǐ",敢为敢做:"gǎn wéi gǎn zuò",甘分随时:"gān fèn suí shí",甘处下流:"gān chǔ xià liú",干啼湿哭:"gàn tí shī kū",干名犯义:"gàn míng fàn yì",干将莫邪:"gān jiāng mò yé",干城之将:"gān chéng zhī jiàng",腹载五车:"fù zài wǔ chē",父债子还:"fù zhài zǐ huán",父为子隐:"fù wéi zǐ yǐn",辅世长民:"fǔ shì zhǎng mín",福为祸始:"fú wéi huò shǐ",符号逻辑:"fú hào luó jí",浮收勒折:"fú shōu lè shé",肤受之愬:"fū shòu zhī sù",否终则泰:"pǐ zhōng zé tài",佛头著粪:"fó tóu zhuó fèn",奉为楷模:"fèng wéi kǎi mó",凤靡鸾吪:"fèng mǐ luán é",封豨修蛇:"fēng xī xiū shé",风影敷衍:"fēng yǐng fū yǎn",丰屋蔀家:"fēng wū bù jiā",粪土不如:"fèn tǔ bù rú",分风劈流:"fēn fēng pǐ liú",沸沸汤汤:"fèi fèi shāng shāng",菲食薄衣:"fěi shí bó yī",飞将数奇:"fēi jiàng shù qí",放辟邪侈:"fàng pì xié chǐ",方领圆冠:"fāng lǐng yuán guàn",犯而不校:"fàn ér bú jiào",返本还源:"fǎn běn huán yuán",反劳为逸:"fǎn láo wéi yì",法轮常转:"fǎ lún cháng zhuàn",罚不当罪:"fá bù dāng zuì",发引千钧:"fà yǐn qiān jūn",发奸擿伏:"fā jiān tī fú",发短心长:"fà duǎn xīn cháng",二竖为虐:"èr shù wéi nüè",儿女心肠:"ér nǚ xīn cháng",儿女亲家:"ér nǚ qìng jiā",遏恶扬善:"è wù yáng shàn",饿殍枕藉:"è piǎo zhěn jí",饿殍载道:"è piǎo zài dào",恶醉强酒:"wù zuì qiǎng jiǔ",恶意中伤:"è yì zhòng shāng",恶湿居下:"wù shī jū xià",恶居下流:"wù jū xià liú",恶不去善:"wù bú qù shàn",扼吭夺食:"è háng duó shí",扼襟控咽:"è jīn kòng yān",峨峨汤汤:"é é shāng shāng",屙金溺银:"ē jīn niào yín",朵颐大嚼:"duǒ yí dà jiáo",夺人所好:"duó rén suǒ hào",多言数穷:"duō yán shuò qióng",多文为富:"duō wén wéi fù",多端寡要:"duō duān guǎ yào",多财善贾:"duō cái shàn gǔ",遁世无闷:"dùn shì wú mèn",遁迹黄冠:"dùn jì huáng guàn",堆案盈几:"duī àn yíng jī",断还归宗:"duàn huán guī zōng",短见薄识:"duǎn jiàn bó shí",蠹居棊处:"dù jū qí chǔ",度己以绳:"duó jǐ yǐ shéng",杜默为诗:"dù mò wéi shī",杜鹃啼血:"dù juān tí xuè",笃近举远:"dǔ jìn jǔ yuǎn",独有千秋:"dú yǒu qiān qiū",读书得间:"dú shū dé jiàn",斗转参横:"dǒu zhuǎn shēn héng",兜肚连肠:"dōu dǔ lián cháng",洞见症结:"dòng jiàn zhèng jié",恫疑虚喝:"dòng yí xū hè",动中窾要:"dòng zhōng kuǎn yào",东鸣西应:"dōng míng xī yīng",东鳞西爪:"dōng lín xī zhǎo",东量西折:"dōng liàng xī shé",东家西舍:"dōng jiā xī shè",东扯西拽:"dōng chě xī zhuāi",鼎铛有耳:"dǐng chēng yǒu ěr",鼎铛玉石:"dǐng chēng yù shí",钉头磷磷:"dīng tóu lín lín",跌宕不羁:"diē dàng bù jī",跌弹斑鸠:"diē dàn bān jiū",雕心雁爪:"diāo xīn yàn zhǎo",颠倒衣裳:"diān dǎo yī cháng",德薄能鲜:"dé bó néng xiǎn",得马折足:"dé mǎ shé zú",蹈其覆辙:"dǎo qí fù zhé",捣虚撇抗:"dǎo xū piē kàng",倒载干戈:"dào zài gān gē",倒裳索领:"dào cháng suǒ lǐng",倒果为因:"dào guǒ wéi yīn",叨在知己:"tāo zài zhī jǐ",叨陪末座:"tāo péi mò zuò",党豺为虐:"dǎng chái wéi nüè",当轴处中:"dāng zhóu chǔ zhōng",当着不着:"dāng zhuó bù zhuó",当务始终:"dāng wù shǐ zhōng",淡汝浓抹:"dàn rǔ nóng mǒ",弹丸脱手:"tán wán tuō shǒu",弹铗无鱼:"dàn jiá wú yú",箪食瓢饮:"dān sì piáo yǐn",大璞不完:"dà pú bù wán",大明法度:"dà míng fǎ dù",大车以载:"dà chē yǐ zài",打闷葫芦:"dǎ mèn hú lu",沓来踵至:"tà lái zhǒng zhì",厝火燎原:"cuò huǒ liǎo yuán",撮科打哄:"cuō kē dǎ hòng",寸积铢累:"cùn jī zhū lěi",啛啛喳喳:"cuì cuì chā chā",摧折豪强:"cuī zhé háo qiáng",摧刚为柔:"cuī gāng wéi róu",从俗就简:"cóng sú jiù jiǎn",此发彼应:"cǐ fā bǐ yīng",此唱彼和:"cǐ chàng bǐ hè",慈悲为本:"cí bēi wéi běn",纯属骗局:"chún shǔ piàn jú",春笋怒发:"chūn sǔn nù fā",垂头搨翼:"chuí tóu tà yì",传为笑谈:"chuán wéi xiào tán",传风扇火:"chuán fēng shān huǒ",穿红着绿:"chuān hóng zhuó lǜ",触处机来:"chù chǔ jī lái",处尊居显:"chǔ zūn jū xiǎn",处堂燕雀:"chǔ táng yàn què",处实效功:"chǔ shí xiào gōng",处高临深:"chǔ gāo lín shēn",出入无间:"chū rù wú jiān",出门应辙:"chū mén yīng zhé",出处语默:"chū chǔ yǔ mò",出处殊途:"chū chǔ shū tú",出处进退:"chū chǔ jìn tuì",愁山闷海:"chóu shān mèn hǎi",冲冠眦裂:"chōng guàn zì liè",齿牙为祸:"chǐ yá wéi huò",尺二冤家:"chǐ èr yuān jia",尺短寸长:"chǐ duǎn cùn cháng",尺寸之功:"chǐ cùn zhī gōng",城北徐公:"chéng běi xú gōng",成败兴废:"chéng bài xīng fèi",趁水和泥:"chèn shuǐ huò ní",称雨道晴:"chēng yǔ dào qíng",称体载衣:"chēng tǐ zài yī",称体裁衣:"chèn tǐ cái yī",称家有无:"chèn jiā yǒu wú",称德度功:"chēng dé duó gōng",沉吟章句:"chén yín zhāng jù",沉吟不决:"chén yín bù jué",沉疴宿疾:"chén kē sù jí",扯纤拉烟:"chě qiàn lā yān",扯顺风旗:"chě shùn fēng qí",车载船装:"chē zǎi chuán zhuāng",朝升暮合:"zhāo shēng mù gě",朝攀暮折:"zhāo pān mù shé",超今冠古:"chāo jīn guàn gǔ",倡而不和:"chàng ér bú hè",畅所欲为:"chàng suǒ yù wéi",苌弘碧血:"cháng hóng bì xiě",长幼尊卑:"zhǎng yòu zūn bēi",长绳系日:"cháng shéng jì rì",长年三老:"zhǎng nián sān lǎo",长春不老:"cháng chūn bù lǎo",长傲饰非:"zhǎng ào shì fēi",昌亭旅食:"chāng tíng lǚ shí",禅絮沾泥:"chán xù zhān ní",差三错四:"chā sān cuò sì",层台累榭:"céng tái lěi xiè",层见迭出:"céng xiàn dié chū",藏踪蹑迹:"cáng zōng niè jì",苍蝇见血:"cāng yíng jiàn xiě",餐松啖柏:"cān sōng dàn bó",骖风驷霞:"cān fēng sì xiá",参伍错综:"cēn wǔ cuò zōng",参辰卯酉:"shēn chén mǎo yǒu",材优干济:"cái yōu gān jǐ",材薄质衰:"cái bó zhì shuāi",才大难用:"cái dà nán yòng",才薄智浅:"cái bó zhì qiǎn",不足为意:"bù zú wéi yì",不足为据:"bù zú wéi jù",不足为法:"bù zú wéi fǎ",不足齿数:"bù zú chǐ shǔ",不着疼热:"bù zhuó téng rè",不知薡蕫:"bù zhī dǐng dǒng",不越雷池:"bú yuè léi chí",不相为谋:"bù xiāng wéi móu",不贪为宝:"bù tān wéi bǎo",不了而了:"bù liǎo ér liǎo",不可揆度:"bù kě kuí duó",不遑启处:"bù huáng qǐ chǔ",不当不正:"bù dāng bú zhèng",不差什么:"bú chà shén me",不差累黍:"bù chā lěi shǔ",擘两分星:"bò liǎng fēn xīng",簸土扬沙:"bǒ tǔ yáng shā",薄物细故:"bó wù xì gù",薄寒中人:"bó hán zhòng rén",博文约礼:"bó wén yuē lǐ",播糠眯目:"bō kāng mí mù",剥皮抽筋:"bō pí chōu jīn",剥肤椎髓:"bō fū chuí suǐ",波属云委:"bō zhǔ yún wěi",波骇云属:"bō hài yún zhǔ",兵微将寡:"bīng wēi jiàng guǎ",兵强将勇:"bīng qiáng jiàng yǒng",兵多将广:"bīng duō jiàng guǎng",兵不由将:"bīng bù yóu jiàng",冰解的破:"bīng jiě dì pò",彬彬济济:"bīn bīn jǐ jǐ",摽梅之年:"biào méi zhī nián",表里为奸:"biǎo lǐ wéi jiān",飙发电举:"biāo fā diàn jǔ",变贪厉薄:"biàn tān lì bó",敝盖不弃:"bì gài bú qì",秕言谬说:"bǐ yán miù shuō",比物属事:"bǐ wù zhǔ shì",被山带河:"pī shān dài hé",被甲枕戈:"pī jiǎ zhěn gē",被甲据鞍:"pī jiǎ jù ān",被褐怀玉:"pī hè huái yù",被发缨冠:"pī fà yīng guàn",背曲腰躬:"bèi qǔ yāo gōng",北窗高卧:"běi chuāng gāo wò",北辰星拱:"běi chén xīng gǒng",北鄙之音:"běi bǐ zhī yīn",卑宫菲食:"bēi gōng fěi shí",暴衣露冠:"pù yī lù guàn",暴腮龙门:"pù sāi lóng mén",暴露文学:"bào lù wén xué",暴虎冯河:"bào hǔ píng hé",抱蔓摘瓜:"bào wàn zhāi guā",抱法处势:"bào fǎ chǔ shì",褒贬与夺:"bāo biǎn yǔ duó",帮闲钻懒:"bāng xián zuān lǎn",拜将封侯:"bài jiàng fēng hóu",百兽率舞:"bǎi shòu shuài wǔ",百孔千创:"bǎi kǒng qiān chuāng",白衣卿相:"bái yī qīng xiàng",白首为郎:"bái shǒu wéi láng",白首相知:"bái shǒu xiāng zhī",把玩无厌:"bǎ wán wú yàn",拔锅卷席:"bá guō juǎn xí",拔本塞源:"bá běn sè yuán",傲不可长:"ào bù kě zhǎng",熬更守夜:"áo gēng shǒu yè",安时处顺:"ān shí chǔ shùn",安身为乐:"ān shēn wéi lè",安老怀少:"ān lǎo huái shào",安步当车:"ān bù dàng chē",爱人好士:"ài rén hào shì",矮人观场:"ǎi rén guān chǎng",捱风缉缝:"ái fēng jī fèng",挨山塞海:"āi shān sè hǎi",阿家阿翁:"ā jiā ā wēng",阿党相为:"ē dǎng xiāng wéi",追亡逐北:"zhuī wáng zhú běi",竹篮打水:"zhú lán dá shuǐ",知疼着热:"zhī téng zháo rè",语不惊人:"yǔ bù jīng rén",于今为烈:"yú jīn wéi liè",一日三省:"yí rì sān xǐng",穴居野处:"xué jū yě chǔ",五脊六兽:"wǔ jǐ liù shòu",无声无臭:"wú shēng wú xiù",谓予不信:"wèi yú bú xìn",舍身为国:"shě shēn wéi guó",杀妻求将:"shā qī qiú jiàng",强作解人:"qiǎng zuò jiě rén",气冲斗牛:"qì chōng dǒu niú",临深履薄:"lín shēn lǚ bó",钧天广乐:"jūn tiān guǎng yuè",艰难竭蹶:"jiān nán jié jué",夹七夹八:"jiā qī jiā bā",混混噩噩:"hún hún è è",厚古薄今:"hòu gǔ bó jīn",鬼怕恶人:"guǐ pà è rén",伽马射线:"gā mǎ shè xiàn",佛头着粪:"fó tóu zhuó fèn",奉为至宝:"fèng wéi zhì bǎo",登坛拜将:"dēng tán bài jiàng",晨昏定省:"chén hūn dìng xǐng",察察为明:"chá chá wéi míng",博闻强识:"bó wén qiáng zhì",避难就易:"bì nán jiù yì",了无生机:"liǎo wú shēng jī",有一说一:"yǒu yī shuō yī",独一无二:"dú yī wú èr",说一不二:"shuō yī bù èr",举一反三:"jǔ yī fǎn sān",数一数二:"shǔ yī shǔ èr",杀一儆百:"shā yī jǐng bǎi",丁一卯二:"dīng yī mǎo èr",丁一确二:"dīng yī què èr",不一而止:"bù yī ér zhǐ",无一幸免:"wú yī xìng miǎn",表里不一:"biǎo lǐ bù yī",良莠不一:"liáng yǒu bù yī",心口不一:"xīn kǒu bù yī",言行不一:"yán xíng bù yī",政令不一:"zhèng lìng bù yī",参差不一:"cēn cī bù yī",纷纷不一:"fēn fēn bù yī",毁誉不一:"huǐ yù bù yī",不一而三:"bù yī ér sān",百不一遇:"bǎi bù yī yù",言行抱一:"yán xíng bào yī",瑜百瑕一:"yú bǎi xiá yī",背城借一:"bèi chéng jiè yī",凭城借一:"píng chéng jiè yī",劝百讽一:"quàn bǎi fěng yī",群居和一:"qún jū hé yī",百不获一:"bǎi bù huò yī",百不失一:"bǎi bù shī yī",百无失一:"bǎi wú shī yī",万不失一:"wàn bù shī yī",万无失一:"wàn wú shī yī",合而为一:"hé ér wéi yī",合两为一:"hé liǎng wéi yī",合二为一:"hé èr wéi yī",天下为一:"tiān xià wéi yī",相与为一:"xiāng yǔ wéi yī",较若画一:"jiào ruò huà yī",较如画一:"jiào rú huà yī",斠若画一:"jiào ruò huà yī",言行若一:"yán xíng ruò yī",始终若一:"shǐ zhōng ruò yī",终始若一:"zhōng shǐ ruò yī",惟精惟一:"wéi jīng wéi yī",众多非一:"zhòng duō fēi yī",不能赞一:"bù néng zàn yī",问一答十:"wèn yī dá shí",一不扭众:"yī bù niǔ zhòng",一以贯之:"yī yǐ guàn zhī",一以当百:"yī yǐ dāng bǎi",百不当一:"bǎi bù dāng yī",十不当一:"shí bù dāng yī",以一警百:"yǐ yī jǐng bǎi",以一奉百:"yǐ yī fèng bǎi",以一持万:"yǐ yī chí wàn",以一知万:"yǐ yī zhī wàn",百里挑一:"bǎi lǐ tiāo yī",整齐划一:"zhěng qí huà yī",一来二去:"yī lái èr qù",一路公交:"yī lù gōng jiāo",一路汽车:"yī lù qì chē",一路巴士:"yī lù bā shì",朝朝朝落:"zhāo cháo zhāo luò",曲意逢迎:"qū yì féng yíng",一行不行:"yì háng bù xíng",行行不行:"háng háng bù xíng"},ule=Object.keys(FI).map(e=>({zh:e,pinyin:FI[e],probability:2e-8,length:4,priority:Vl.Normal,dict:Symbol("dict4")})),BI={巴尔干半岛:"bā ěr gàn bàn dǎo",巴尔喀什湖:"bā ěr kā shí hú",不幸而言中:"bú xìng ér yán zhòng",布尔什维克:"bù ěr shí wéi kè",何乐而不为:"hé lè ér bù wéi",苛政猛于虎:"kē zhèng měng yú hǔ",蒙得维的亚:"méng dé wéi dì yà",民以食为天:"mín yǐ shí wéi tiān",事后诸葛亮:"shì hòu zhū gě liàng",物以稀为贵:"wù yǐ xī wéi guì",先下手为强:"xiān xià shǒu wéi qiáng",行行出状元:"háng háng chū zhuàng yuan",亚得里亚海:"yà dé lǐ yà hǎi",眼不见为净:"yǎn bú jiàn wéi jìng",竹筒倒豆子:"zhú tǒng dào dòu zi"},cle=Object.keys(BI).map(e=>({zh:e,pinyin:BI[e],probability:2e-8,length:5,priority:Vl.Normal,dict:Symbol("dict5")}));function RI(e,t){return e&&(e.decimalt.probability)?e:t}function OI(e){e.probability<1e-300&&(e.probability*=1e300,e.decimal+=1)}function dle(e){return e.priority===Vl.Custom?-(e.length*e.length*100):e.priority===Vl.Surname?-(e.length*e.length*10):0}function fle(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{probability:1,decimal:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={probability:o.probability*r.probability,decimal:r.decimal+dle(o),patterns:r.patterns,concatPattern:o};OI(u),n[a]=RI(n[a],u),o=e[--i]}const l={probability:1e-13*r.probability,decimal:0,patterns:r.patterns};OI(l),n[s]=RI(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function $I(e,t){return e&&e.count<=t.count?e:t}function hle(e){return e.priority===Vl.Custom?-(e.length*e.length*1e5):e.priority===Vl.Surname?-(e.length*e.length*100):1}function ple(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{count:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={count:hle(o)+r.count,patterns:r.patterns,concatPattern:o};n[a]=$I(n[a],u),o=e[--i]}const l={count:1+r.count,patterns:r.patterns};n[s]=$I(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function mle(e,t){return!(t.index+t.length<=e.index||t.priority>e.priority||t.priority===e.priority&&t.length>e.length)}function gle(e){const t=[];for(let n=e.length-1;n>=0;){const{index:i}=e[n];let o=n-1;for(;o>=0&&mle(e[n],e[o]);)o--;(o<0||e[o].index+e[o].length<=i)&&t.push(e[n]),n=o}return t.reverse()}var PI;(function(e){e[e.ReverseMaxMatch=1]="ReverseMaxMatch",e[e.MaxProbability=2]="MaxProbability",e[e.MinTokenization=3]="MinTokenization"})(PI||(PI={}));class zI{constructor(t,n="",i=""){this.children=new Map,this.fail=null,this.patterns=[],this.parent=t,this.prefix=n,this.key=i}}class vle{constructor(){this.dictMap=new Map,this.queues=[],this.root=new zI(null)}build(t){this.buildTrie(t),this.buildFailPointer()}buildTrie(t){for(let n of t){const i=Hw(n.zh);let o=this.root;for(let s=0;s{t=t.concat(i)}),this.queues=[];t.length>n;){let i=t[n++],o=i.parent&&i.parent.fail,s=i.key;for(;o&&!o.children.has(s);)o=o.fail;o?i.fail=o.children.get(s):i.fail=this.root}}addPatternToDictMap(t){this.dictMap.has(t.dict)||this.dictMap.set(t.dict,new Set),this.dictMap.get(t.dict).add(t)}addNodeToQueues(t){this.queues[$a(t.prefix)]||(this.queues[$a(t.prefix)]=[]),this.queues[$a(t.prefix)].push(t)}insertPattern(t,n){for(let i=t.length-1;i>=0;i--){const o=t[i];if(n.priority===o.priority&&n.probability>=o.probability)t[i+1]=o;else if(n.priority>o.priority)t[i+1]=o;else{t[i+1]=n;return}}t[0]=n}removeDict(t){this.dictMap.has(t)&&(this.dictMap.get(t).forEach(i=>{i.node.patterns=i.node.patterns.filter(o=>o!==i)}),this.dictMap.delete(t))}match(t,n){let i=this.root,o=[];const s=Hw(t);for(let r=0;rn==="off"?c.priority!==Vl.Surname:n==="head"?c.length-1-r===0:!0);a&&o.push(Object.assign(Object.assign({},a),{index:r-a.length+1}));let u=i.fail;for(;u!==null;){const c=u.patterns.find(d=>n==="off"?d.priority!==Vl.Surname:n==="head"?d.length-1-r===0:!0);c&&o.push(Object.assign(Object.assign({},c),{index:r-c.length+1})),u=u.fail}}}return o}search(t,n,i=2){const o=this.match(t,n);return i===1?gle(o):i===3?ple(o,$a(t)):fle(o,$a(t))}}const yle=[...cle,...ule,...ale,...lle,...ile,...rle],AP=new vle;AP.build(yle);const kle=new wP,ble=()=>kle,wle=[];function Cle(){return wle}const og=e=>{const t=Rd.get(e);return t?t.split(" ")[0]:e},Ale=e=>{const t=[],n=Cle();for(let i=0;i{const s=o?Ale(e):e,r=AP.search(s,n,i);let l=0;const a=Hw(e);for(let u=0;ue.replace(/(ā|á|ǎ|à)/g,"a").replace(/(ō|ó|ǒ|ò)/g,"o").replace(/(ē|é|ě|è)/g,"e").replace(/(ī|í|ǐ|ì)/g,"i").replace(/(ū|ú|ǔ|ù)/g,"u").replace(/(ǖ|ǘ|ǚ|ǜ)/g,"ü").replace(/(n̄|ń|ň|ǹ)/g,"n").replace(/(m̄|ḿ|m̌|m̀)/g,"m").replace(/(ê̄|ế|ê̌|ề)/g,"ê"),xP=(e,t="off")=>{const n=ble();let i=Rd.get(e)?Rd.get(e).split(" "):[];if(n.get(e))i=n.get(e).split(" ");else if(t!=="off"){const o=Ww[e];o&&(i=[o].concat(i.filter(s=>s!==o)))}return i},Sle=(e,t="off")=>{let n=xP(e,t);return n.length>0?n.map(i=>({origin:e,result:i,isZh:!0,originPinyin:i})):[{origin:e,result:e,isZh:!1,originPinyin:e}]},R9=(e,t)=>{const n=e.split(" "),i=[],o=[];for(let s of n)for(let r of Yre)if(s.startsWith(r)){let l=s.slice(r.length);Jre.indexOf(r)!==-1&&Xre.indexOf(l)!==-1&&(l=ele[l]),i.push(r),o.push(l);break}return t==="standard"&&i.forEach((s,r)=>{(s==="y"||s==="w")&&(i[r]="")}),{final:o.join(" "),initial:i.join(" ")}},Iy=e=>{const{final:t}=R9(e);let n="",i="",o="";return tle.indexOf(Ak(t))!==-1?(n=t[0],i=t[1],o=t.slice(2)):(i=t[0]||"",o=t.slice(1)||""),{head:n,body:i,tail:o}},xk=e=>{const t=/(ā|ō|ē|ī|ū|ǖ|n̄|m̄|ê̄)/,n=/(á|ó|é|í|ú|ǘ|ń|ḿ|ế)/,i=/(ǎ|ǒ|ě|ǐ|ǔ|ǚ|ň|m̌|ê̌)/,o=/(à|ò|è|ì|ù|ǜ|ǹ|m̀|ề)/,s=/(a|o|e|i|u|ü|ê)/,r=/(n|m)$/,l=[];return e.split(" ").forEach(u=>{t.test(u)?l.push("1"):n.test(u)?l.push("2"):i.test(u)?l.push("3"):o.test(u)?l.push("4"):s.test(u)||r.test(u)?l.push("0"):l.push("")}),l.join(" ")},_le=(e,t)=>{const n=Ak(e).split(" "),i=xk(t).split(" "),o=[];return n.forEach((s,r)=>{o.push(`${s}${i[r]}`)}),o.join(" ")},SP=(e,t)=>{const n=[];return e.split(" ").forEach(o=>{n.push(t?o[0]:o)}),n.join(" ")};function Mle(e,t,n){if(sle.indexOf(e)===-1)return og(e);if(t===n&&t&&og(t)!==t)return Ak(og(e));if(n&&!ole[e].includes(n)){const i=og(n);if(i!==n){const o=xk(i),s=CP[e];for(let r in s)if(s[r].indexOf(Number(o))!==-1)return r}}}function Ile(e,t){if(e==="了"&&(!t||!Rd.get(t)))return"liǎo"}function Tle(e,t){if(e==="々")return!t||!Rd.get(t)?"tóng":Rd.get(t).split(" ")[0]}function jI(e,t,n){return Tle(e,t)||Ile(e,t)||Mle(e,t,n)||og(e)}const Ele=e=>typeof e!="string"?(console.error("The first param of pinyin is error: "+e+' is not assignable to type "string".'),!1):!0;function E3(e,t){return t instanceof RegExp?t.test(e):!0}const Lle=(e,t)=>{let n=t.nonZh;if(n==="removed")return e.filter(i=>i.isZh||!E3(i.origin,t.nonZhScope));if(n==="consecutive"){for(let i=e.length-2;i>=0;i--){const o=e[i],s=e[i+1];!o.isZh&&!s.isZh&&E3(o.origin,t.nonZhScope)&&E3(s.origin,t.nonZhScope)&&(o.origin+=s.origin,o.result+=s.result,s.delete=!0)}return e.filter(i=>!i.delete)}else return e},HI=(e,t)=>$a(e)===1&&t.multiple?Sle(e,t.surname):!1,Nle=(e,t)=>{switch(t.pattern){case"pinyin":break;case"num":e.forEach(n=>{n.result=n.isZh?xk(n.result):""});break;case"initial":e.forEach(n=>{n.result=n.isZh?R9(n.result,t.initialPattern).initial:""});break;case"final":e.forEach(n=>{n.result=n.isZh?R9(n.result,t.initialPattern).final:""});break;case"first":e.forEach(n=>{n.result=SP(n.result,n.isZh)});break;case"finalHead":e.forEach(n=>{n.result=n.isZh?Iy(n.result).head:""});break;case"finalBody":e.forEach(n=>{n.result=n.isZh?Iy(n.result).body:""});break;case"finalTail":e.forEach(n=>{n.result=n.isZh?Iy(n.result).tail:""});break}},Dle=(e,t)=>{switch(t.toneType){case"symbol":break;case"none":e.forEach(n=>{n.isZh&&(n.result=Ak(n.result))});break;case"num":{e.forEach(n=>{n.isZh&&(n.result=_le(n.result,n.originPinyin))});break}}},Fle=(e,t)=>{t.v&&e.forEach(n=>{n.isZh&&(n.result=n.result.replace(/ü/g,typeof t.v=="string"?t.v:"v"))})},Ble=(e,t,n)=>{if(t.multiple&&$a(n)===1){let i="";e=e.filter(o=>{const s=o.result!==i;return i=o.result,s})}return t.type==="array"?e.map(i=>i.result):t.type==="all"?e.map(i=>{const o=i.isZh?i.result:"",{initial:s,final:r}=R9(o,t.initialPattern),{head:l,body:a,tail:u}=Iy(o);let c=[];return o!==""&&(c=[o].concat(xP(i.origin,t.surname).filter(d=>d!==o))),{origin:i.origin,pinyin:o,initial:s,final:r,first:SP(i.result,i.isZh),finalHead:l,finalBody:a,finalTail:u,num:Number(xk(i.originPinyin)),isZh:i.isZh,polyphonic:c,inZhRange:!!Rd.get(i.origin),result:i.result}}):e.map(i=>i.result).join(t.separator)},Rle=(e,t)=>(t===!1&&e.forEach(n=>{n.origin==="一"?n.result=n.originPinyin="yī":n.origin==="不"&&(n.result=n.originPinyin="bù")}),e),Ole={pattern:"pinyin",toneType:"symbol",type:"string",multiple:!1,mode:"normal",removeNonZh:!1,nonZh:"spaced",v:!1,separator:" ",toneSandhi:!0,segmentit:2};function O9(e,t){if(t=Object.assign(Object.assign({},Ole),t||{}),!Ele(e))return e;if(e==="")return t.type==="array"||t.type==="all"?[]:"";t.surname===void 0&&(t.mode==="surname"?t.surname="all":t.surname="off"),t.type==="all"&&(t.pattern="pinyin"),t.pattern==="num"&&(t.toneType="none"),t.removeNonZh&&(t.nonZh="removed");let i=Array($a(e)),{list:o}=xle(e,i,t.surname,t.segmentit,t.traditional);return o=Rle(o,t.toneSandhi),o=Lle(o,t),HI(e,t)&&(o=HI(e,t)),Nle(o,t),Dle(o,t),Fle(o,t),Ble(o,t,e)}var qw;(function(e){e[e.AllSegment=1]="AllSegment",e[e.AllArray=2]="AllArray",e[e.AllString=3]="AllString",e[e.PinyinSegment=4]="PinyinSegment",e[e.PinyinArray=5]="PinyinArray",e[e.PinyinString=6]="PinyinString",e[e.ZhSegment=7]="ZhSegment",e[e.ZhArray=8]="ZhArray",e[e.ZhString=9]="ZhString"})(qw||(qw={}));qw.AllSegment;const _P=[{name:"/new",desc:"commands.new.desc",noArgs:!0},{name:"/clear",desc:"commands.clear.desc",noArgs:!0},{name:"/login",desc:"commands.login.desc",noArgs:!0},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc"},{name:"/goal",desc:"commands.goal.desc"},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc",noArgs:!0},{name:"/fork",desc:"commands.fork.desc",noArgs:!0},{name:"/export",desc:"commands.export.desc",noArgs:!0},{name:"/status",desc:"commands.status.desc",noArgs:!0}];function WI(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const vc="skill:";function $le(e,t){const n=e.find(r=>r.name===t);if(n!==void 0)return n;const i=`/${vc}${t.slice(1)}`,o=e.find(r=>r.name===i);if(o!==void 0)return o;if(!t.startsWith(`/${vc}`))return;const s=t.slice(1+vc.length);if(!(s.length===0||s.includes(" ")))return e.find(r=>r.isSkill===!0&&F6(r.name)===s)}function F6(e){const t=e.startsWith("/")?e.slice(1):e;return t.startsWith(vc)?t.slice(vc.length):t}function Ple(e,t,n){for(const i of[`/${vc}${t}`,`/${t}`]){if(e===i)return;if(e.startsWith(`${i} `))return e.slice(i.length+1).trim()||void 0}return(n??"").trim()||void 0}function MP(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${vc}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[..._P,...t]}const qI=new Map;function IP(e){let t=qI.get(e);if(!t){const n=O9(e,{toneType:"none",type:"array"}),i=O9(e,{pattern:"first",toneType:"none",type:"array"});t=zle(e,n,i),qI.set(e,t)}return t}const UI={full:[],first:[],offsets:[],literal:[]};function zle(e,t,n){if(t.length!==n.length)return UI;const i=[],o=[];let s=0;for(let r=0;r0&&e.slice(s,s+l.length).toLowerCase()===l.toLowerCase()?(o.push(!0),s+=l.length):(o.push(!1),s+=Array.from(e.slice(s))[0]?.length??0)}return i.push(s),s!==e.length?UI:{full:t,first:n,offsets:i,literal:o}}function Uw(e,t,n,i){const o=e[t];let s=0,r=-1,l=-1,a=0,u=0;for(let f=0;f=0)return Uw(i,"first",o,o+t.length);const s=i.full.join("").indexOf(t);if(!(s<0))return Uw(i,"full",s,s+t.length)}function Ule(e,t,n){const i=e.trim().replace(/^\//,"").toLowerCase();if(i==="")return{};const o=Wle(t,i),s=qle(n,i);return{name:o?[o]:void 0,desc:s?[s]:void 0}}const Vle={keys:[{name:"name",weight:3},{name:"desc",weight:1},{name:"pinyinFull",weight:1},{name:"pinyinFirst",weight:1}],includeScore:!0,includeMatches:!0,ignoreLocation:!0,threshold:.4};function Kle(e,t){const n=e.toLowerCase(),i=t.toLowerCase();return n===i?0:n.startsWith(i)?1:2}function KI(e){const t=[...e].sort((i,o)=>i[0]-o[0]),n=[];for(const i of t){const o=n[n.length-1];o&&i[0]<=o[1]?o[1]=Math.max(o[1],i[1]):n.push([...i])}return n}function Zle(e,t){const n=[],i=[];for(const o of t??[])for(const[s,r]of o.indices)if(o.key==="name")n.push([s+1,r+2]);else if(o.key==="desc")i.push([s,r+1]);else if(o.key==="pinyinFirst"||o.key==="pinyinFull"){const l=Uw(IP(e.desc),o.key==="pinyinFirst"?"first":"full",s,r+1);l&&i.push(l)}return{name:n.length>0?KI(n):void 0,desc:i.length>0?KI(i):void 0}}function Gle(e,t=_P,n=i=>i.desc){const i=e.trim().replace(/^\//,"");if(i==="")return t.map(s=>({item:s,ranges:{}}));const o=t.map((s,r)=>{const l=n(s),a=jle(l);return{index:r,item:s,name:s.name.replace(/^\//,""),desc:l,pinyinFull:a.full,pinyinFirst:a.first}});return new Kre(o,Vle).search(i).map(({item:s,score:r,matches:l})=>({doc:s,score:r??1,rank:Kle(s.name,i),ranges:Zle(s,l)})).sort((s,r)=>s.rank!==r.rank?s.rank-r.rank:s.score!==r.score?s.score-r.score:s.doc.index-r.doc.index).map(({doc:s,ranges:r})=>({item:s.item,ranges:r}))}const xn={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",planArmed:"kimi-web.plan-armed",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",fontScale:"kimi-web.font-scale",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceSort:"kimi-web.workspace-sort",workspaceRecencyFloor:"kimi-web.workspace-recency-floor",pinnedSessions:"kimi-web.pinned-sessions",pinnedCollapsed:"kimi-web.pinned-collapsed",workspaceNameOverrides:"kimi-web.workspace-name-overrides",notifyEnabled:"kimi-web.notify-enabled",notifySound:"kimi-web.notify-sound",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInDefaultTarget:"kimi-web.open-in.default-target",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",sidebarViewMode:"kimi-web.sidebar-view-mode",mobileSwitcherViewMode:"kimi-web.mobile-switcher-view-mode",sidebarPinnedHeight:"kimi-web.sidebar-pinned-height",shortcutOverrides:"kimi-web.shortcut-overrides",dockIconChoice:"kimi-web.dock-icon-choice",updateSkippedVersion:"kimi-web.update-skipped-version",canarySkippedVersion:"kimi-web.canary-skipped-version",planMode:"kimi-web.plan-mode",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking",accent:"kimi-web.accent",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete"},ad="__new__";function ZI(e){return`kimi-web.draft.${e&&e.length>0?e:ad}`}function GI(e){return`kimi-web.attachment-draft.${e&&e.length>0?e:ad}`}function QI(e){return`kimi-web.draft-atts.${e&&e.length>0?e:ad}`}function ps(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ds(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function xr(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Tc(e){const t=ps(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Ec(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function B6(){const e=ps(xn.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[i,o]of Object.entries(t))o===!0&&(n[i]=!0);return n}catch{return{}}}function R6(e){const n={...B6()};for(const[i,o]of Object.entries(e))o?n[i]=!0:delete n[i];ds(xn.unread,JSON.stringify(n))}function Qle(){const e=Tc(xn.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function L3(e){Ec(xn.collapsedWorkspaces,Array.from(e))}function Yle(){return Tc(xn.pinnedCollapsed)===!0}function Vw(e){Ec(xn.pinnedCollapsed,e)}function Jle(){return ps(xn.sidebarViewMode)==="flat"?"flat":"grouped"}function Xle(e){ds(xn.sidebarViewMode,e)}function eae(){return ps(xn.mobileSwitcherViewMode)==="grouped"?"grouped":"flat"}function tae(e){ds(xn.mobileSwitcherViewMode,e)}function nae(){const e=Tc(xn.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function EP(e){Ec(xn.workspaceOrder,Array.from(e))}function iae(){return ps(xn.workspaceSort)==="recent"?"recent":"manual"}function oae(e){ds(xn.workspaceSort,e)}function sae(){const e=Tc(xn.workspaceRecencyFloor);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="number"&&Number.isFinite(i)&&(t[n]=i);return t}function LP(e){Ec(xn.workspaceRecencyFloor,e)}function NP(){const e=Tc(xn.pinnedSessions);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function N3(e){Ec(xn.pinnedSessions,Array.from(e))}function A2(){const e=Tc(xn.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="string"&&(t[n]=i);return t}function YI(e){Ec(xn.workspaceNameOverrides,e)}function rae(e,t,n,i,o){const s=n-o-(t.right+i),r=t.left-i-o,l=e>s&&r>s,a=Math.min(e,l?r:s);return{left:l?t.left-i-a:t.right+i,maxWidth:a,flipped:l}}let lae=0;function aae(e,t){const n=++lae;return e.pendingSwarmBySession[t]=n,n}function Kw(e,t,n){return n===void 0||e.pendingSwarmBySession[t]!==n?!1:(delete e.pendingSwarmBySession[t],!0)}function Zw(e,t,n){e.pendingSwarmBySession[t]===void 0&&(e.swarmModeBySession[t]=n)}function JI(e,t){const n=new Set(e.map(u=>u.id)),i=t.filter(u=>u.kind==="subagent"&&!n.has(u.id));if(i.length===0)return e;const o=new Map(e.map(u=>[u.id,u])),s=new Map(e.filter(u=>u.kind==="subagent"&&u.agentId!==void 0).map(u=>[u.agentId,u])),r=new Set,l=i.map(u=>{const c=u.backgroundTaskId!==void 0?o.get(u.backgroundTaskId):void 0,d=s.get(u.agentId??u.id),f=(d?.status==="running"&&c?.status!=="running"?d:c)??d;if(f===void 0)return u;r.add(f.id);const h=u.status==="running"&&f.status!=="running";return{...u,status:u.status==="running"?f.status:u.status,subagentPhase:h?f.status==="completed"?"completed":"failed":u.subagentPhase,completedAt:f.completedAt??u.completedAt,completedAtEstimated:f.completedAt!==void 0?void 0:u.completedAtEstimated,outputPreview:f.outputPreview??u.outputPreview,outputBytes:f.outputBytes??u.outputBytes,model:u.model??f.model,thinkingEffort:u.thinkingEffort??f.thinkingEffort,backgroundTaskId:f.id}});return[...e.filter(u=>!r.has(u.id)),...l]}function uae(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function cae(e,t=uae()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyF"||e.key.toLowerCase()==="f")&&!e.defaultPrevented}const dae=new Map([["ς","σ"],["ß","ss"],["ſ","s"],["ff","ff"],["fi","fi"],["fl","fl"],["ffi","ffi"],["ffl","ffl"],["ſt","st"],["st","st"],["ʼn","ʼn"],["µ","μ"],["K","k"],["Å","å"],["Ω","ω"]]);function fae(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function hae(e,t){if(t==="preserve")return{text:e,map:Array.from({length:e.length},(r,l)=>l)};const n=t==="collapse"?/[\t\n\f\r ]/:/[\t ]/;let i="";const o=[];let s=!1;for(let r=0;rXI(c.text)),i="\0";let o="";const s=[];for(let c=0;c0&&e[c].gapBefore&&(o+=i),s[c]=o.length,o+=n[c].folded;const r=gae(XI(t).folded);if(r===null)return;const l=new RegExp(r,"g");function a(c){let d=0,f=s.length-1,h=0;for(;d<=f;){const m=d+f>>1;s[m]<=c?(h=m,d=m+1):f=m-1}return h}let u;for(;;){const c=l.exec(o);if(c===null)return;const d=c.index,f=d+c[0].length-1,h=a(d),m=a(f),g=n[h].map[d-s[h]],v=n[m].map[f-s[m]],y={startSeg:h,startOffset:g.start,endSeg:m,endOffset:v.start+v.length};u!==void 0&&u.startSeg===y.startSeg&&u.startOffset===y.startOffset&&u.endSeg===y.endSeg&&u.endOffset===y.endOffset||(u=y,yield y)}}const mae=/[.*+?^${}()|[\]\\]/g;function gae(e){const t=[];let n=0;for(;n=wae)return{ranges:a,truncated:!0};a.push(f)}}return{ranges:a,truncated:!1}}const DP="kimi-transcript-search",Gw="kimi-transcript-search-current";function FP(){return globalThis.CSS?.highlights??null}function D3(e,t){const n=FP(),i=globalThis.Highlight;if(!n||!i)return;if(e.length===0){Qw();return}const o=new i;for(const r of e)o.add(r);n.set(DP,o);const s=e[t];if(s!==void 0){const r=new i;r.add(s),n.set(Gw,r)}else n.delete(Gw)}function Qw(){const e=FP();e?.delete(DP),e?.delete(Gw)}let BP=null;function Aae(e){e!==null&&(BP=e)}let tT=0,x2=null;async function Yw(e){const t=++tT,n=(async()=>{const o=await e();t===tT&&Aae(o)})(),i=(async()=>{await n,x2!==null&&x2.seq>t&&await x2.promise})();return x2={seq:t,promise:i},i}let RP=null;function xae(e){RP=e}const Sae=5e3;function _ae(e){return Promise.race([e(),new Promise(t=>{setTimeout(()=>t(null),Sae)})])}function S2(){return`${BP==="global"?"https://www.kimi.ai":"https://www.kimi.com"}/code?from=${qh?"kimi_code_desktop":"kimi_code_web"}`}function pv(){const e=RP;if(e===null){window.open(S2(),"_blank","noopener");return}const t=()=>_ae(e);if(qh){Yw(t).then(()=>{window.open(S2(),"_blank","noopener")});return}const n=window.open("","_blank");if(n===null){window.open(S2(),"_blank","noopener");return}try{n.opener=null}catch{}Yw(t).then(()=>{try{n.location.href=S2()}catch{}})}function Mae(e,t,n){if(e.length===0)return null;const i=new Set(e),o=t.filter(r=>i.has(r)),s=e.filter(r=>!t.includes(r));return s.length===0&&o.length===t.length?null:t.length===0&&n!==void 0?s.toSorted((r,l)=>(n.get(l)??Number.NEGATIVE_INFINITY)-(n.get(r)??Number.NEGATIVE_INFINITY)):[...s,...o]}function Iae(e,t){const n=new Map(t.map((i,o)=>[i,o]));return e.toSorted((i,o)=>(n.get(i.id)??-1)-(n.get(o.id)??-1))}function Tae(e,t,n,i="before"){const o=e.indexOf(t),s=e.indexOf(n);if(o===-1||s===-1||o===s)return e;const r=[...e];r.splice(o,1);const l=o(t.get(i.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}function Lae(e,t){let n=!1;const i={...e};for(const[o,s]of t)s>(i[o]??Number.NEGATIVE_INFINITY)&&(i[o]=s,n=!0);return{next:i,changed:n}}function Nae(e,t){const n=new Map;for(const i of e){if(i.parentSessionId||i.archived)continue;const o=new Date(i.updatedAt).getTime();if(Number.isNaN(o))continue;const s=t(i);o>(n.get(s)??Number.NEGATIVE_INFINITY)&&n.set(s,o)}return n}function Dae(e,t){const n=new Map;for(const i of e){const o=t[i.id]??Number.NEGATIVE_INFINITY,s=i.lastOpenedAt?Date.parse(i.lastOpenedAt):Number.NaN,r=Number.isNaN(s)?Number.NEGATIVE_INFINITY:s;n.set(i.id,Math.max(o,r))}return n}function Fae(e,t){const n=Object.keys(e);if(!n.some(o=>!t.has(o)))return{next:e,changed:!1};const i={};for(const o of n)t.has(o)&&(i[o]=e[o]);return{next:i,changed:!0}}const Bae=5;function Rae(e,t,n,i=Bae){if(e.length<=i)return e;const o=e.slice(0,i);if(t&&!o.some(s=>s.id===t)){const s=e.find(r=>r.id===t);s&&(o[i-1]=s)}return o}const Oae={class:"error-boundary-title"},$ae=rt({__name:"ErrorBoundary",props:{closable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const n=t,{t:i}=Ut(),o=V(!1);rO(()=>{o.value=!0});function s(){o.value=!1}return(r,l)=>o.value?(k(),L("div",{key:1,class:Re(["error-boundary",{fullscreen:e.fullscreen}]),role:"alert"},[e.closable?(k(),de(p(an),{key:0,class:"error-boundary-close",size:"sm",label:p(i)("common.close"),tooltip:p(i)("common.close"),onClick:l[0]||(l[0]=a=>n("close"))},{default:ue(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(Ce),{class:"error-boundary-icon",name:"alert-triangle",size:"lg"}),A("p",Oae,F(p(i)("common.errorBoundaryTitle")),1),U(p(rn),{size:"sm",onClick:s},{default:ue(()=>[Oe(F(p(i)("common.errorBoundaryRetry")),1)]),_:1})],2)):Wn(r.$slots,"default",{key:0},void 0,!0)}}),OP=St($ae,[["__scopeId","data-v-3c47f494"]]);var Pae=Object.create,O6=Object.defineProperty,zae=Object.getOwnPropertyDescriptor,$P=Object.getOwnPropertyNames,jae=Object.getPrototypeOf,Hae=Object.prototype.hasOwnProperty,PP=(e,t)=>function(){return t||(0,e[$P(e)[0]])((t={exports:{}}).exports,t),t.exports},Wae=e=>{let t={};for(var n in e)O6(t,n,{get:e[n],enumerable:!0});return t},qae=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=$P(t),s=0,r=o.length,l;st[a]).bind(null,l),enumerable:!(i=zae(t,l))||i.enumerable});return e},zP=(e,t,n)=>(n=e!=null?Pae(jae(e)):{},qae(O6(n,"default",{value:e,enumerable:!0}),e));function Uae(e,t,n,i){const o=Number(e[t].meta.id+1).toString();let s="";return typeof i.docId=="string"&&(s=`-${i.docId}-`),s+o}function Vae(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Kae(e,t,n,i,o){const s=o.rules.footnote_anchor_name(e,t,n,i,o),r=o.rules.footnote_caption(e,t,n,i,o);let l=s;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`${r}`}function Zae(e,t,n){return(n.xhtmlOut?`
        -`:`
        -`)+`
        -
          -`}function Gae(){return`
        -
        -`}function Qae(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
      1. `}function Yae(){return`
      2. -`}function Jae(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),` ↩︎`}function Xae(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Kae,e.renderer.rules.footnote_block_open=Zae,e.renderer.rules.footnote_block_close=Gae,e.renderer.rules.footnote_open=Qae,e.renderer.rules.footnote_close=Yae,e.renderer.rules.footnote_anchor=Jae,e.renderer.rules.footnote_caption=Vae,e.renderer.rules.footnote_anchor_name=Uae;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const v=l.bMarks[a],y=l.tShift[a],b=l.sCount[a],w=l.parentType,C=h,T=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let N=T;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let w=0;w?@[\]^_`{|}~-])/g;function iue(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,v){v=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},v),g.core.ruler.after("inline","github-task-lists",function(y){for(var b=y.tokens,w=0,C=2;C=0;b--)if(g[b].level===y)return b;return-1}function o(g,v){return d(g[v])&&f(g[v-1])&&h(g[v-2])&&m(g[v])}function s(g,v,y,b){var w=y.idPrefix+v;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(w,b)),g.children.push(a(b)),g.children.unshift(r(g,w,y,b)),y.divWrap&&(g.children.unshift(u(y,b)),g.children.push(c(b)))}function r(g,v,y,b){var w=new b("checkbox_input","input",0);return w.attrs=[["type","checkbox"],["id",v]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&w.attrs.push(["checked","true"]),y.disabled===!0&&w.attrs.push(["disabled","true"]),w}function l(g,v){var y=new v("label_open","label",1);return y.attrs=[["for",g]],y}function a(g){return new g("label_close","label",-1)}function u(g,v){var y=new v("checkbox_open","div",0);return y.attrs=[["class",g.divClass]],y}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const rue=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function lue(e){return e>=55296&&e<=57343||e>1114111?65533:rue.get(e)??e}function aue(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=To.ZERO&&e<=To.NINE}function cue(e){return e>=To.UPPER_A&&e<=To.UPPER_F||e>=To.LOWER_A&&e<=To.LOWER_F}function due(e){return e>=To.UPPER_A&&e<=To.UPPER_Z||e>=To.LOWER_A&&e<=To.LOWER_Z||Jw(e)}function fue(e){return e===To.EQUALS||due(e)}var Ps;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ps||(Ps={}));var ud;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ud||(ud={}));var hue=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=Ps.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=ud.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=Ps.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ps.EntityStart:return e.charCodeAt(t)===To.NUM?(this.state=Ps.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ps.NamedEntity,this.stateNamedEntity(e,t));case Ps.NumericStart:return this.stateNumericStart(e,t);case Ps.NumericDecimal:return this.stateNumericDecimal(e,t);case Ps.NumericHex:return this.stateNumericHex(e,t);case Ps.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|nT)===To.LOWER_X?(this.state=Ps.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ps.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&Fr.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&Fr.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===To.SEMI&&o!==0&&(i&Fr.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=mue(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===ud.Attribute&&(o===0||fue(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&Fr.VALUE_LENGTH)>>14,o!==0){if(s===To.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ud.Strict&&(i&Fr.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&Fr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(Fr.VALUE_LENGTH|Fr.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case Ps.NamedEntity:return this.result!==0&&(this.decodeMode!==ud.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ps.NumericDecimal:return this.emitNumericEntity(0,2);case Ps.NumericHex:return this.emitNumericEntity(0,3);case Ps.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ps.EntityStart:return 0}}};function pue(e){let t="";const n=new hue(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function mue(e,t,n,i){const o=(t&Fr.BRANCH_LENGTH)>>7,s=t&Fr.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const gue=pue(uue);function $6(e,t=ud.Legacy){return gue(e,t)}var vue=zP(sue());const iT={};function yue(e){let t=iT[e];if(t)return t;t=iT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}Sk.defaultChars=";/?:@&=+$,#";Sk.componentChars="";var Xw=Sk;const oT={};function kue(e){let t=oT[e];if(t)return t;t=oT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=kue(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}_k.defaultChars=";/?:@&=+$,-_.!~*'()#";_k.componentChars="-_.!~*'()";var jP=_k;function P6(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function $9(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const bue=/^([a-z0-9.+-]+:)/i,wue=/:[0-9]*$/,Cue=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Aue=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` -`," "]),xue=["'"].concat(Aue),sT=["%","/","?",";","#"].concat(xue),rT=["/","?","#"],Sue=255,lT=/^[+a-z0-9A-Z_-]{0,63}$/,_ue=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,aT={javascript:!0,"javascript:":!0},uT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Mue(e,t){if(e&&e instanceof $9)return e;const n=new $9;return n.parse(e,t),n}$9.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Cue.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=bue.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&aT[r])&&(s=s.substr(2),this.slashes=!0)),!aT[r]&&(o||r&&!uT[r])){let u=-1;for(let m=0;m127?b+="x":b+=y[w];if(!b.match(lT)){const w=m.slice(0,g),C=m.slice(g+1),T=y.match(_ue);T&&(w.push(T[1]),C.unshift(T[2])),C.length&&(s=C.join(".")+s),this.hostname=w.join(".");break}}}}this.hostname.length>Sue&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),uT[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};$9.prototype.parseHost=function(e){let t=wue.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var z6=Mue,HP=Wae({decode:()=>Xw,encode:()=>jP,format:()=>P6,parse:()=>z6}),Iue=Object.defineProperty,WP=e=>{let t={};for(var n in e)Iue(t,n,{get:e[n],enumerable:!0});return t},Ts=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Tue=WP({arrayReplaceAt:()=>Rue,assign:()=>Fue,countLines:()=>Po,escapeHtml:()=>Uue,escapeRE:()=>Kue,fromCodePoint:()=>_0,has:()=>Due,isMdAsciiPunct:()=>j9,isPunctChar:()=>z9,isPunctCode:()=>eC,isSpace:()=>Bue,isString:()=>Lue,isValidEntityCode:()=>Ik,isWhiteSpace:()=>S0,lib:()=>Zue,mdurl:()=>HP,normalizeReference:()=>Mk,ucmicro:()=>P9,unescapeAll:()=>M0,unescapeMd:()=>zue});const P9={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Eue(e){return Object.prototype.toString.call(e)}function Lue(e){return Eue(e)==="[object String]"}const Nue=Object.prototype.hasOwnProperty;function Due(e,t){return Nue.call(e,t)}function Fue(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function Bue(e){return e===9||e===32}function S0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function z9(e){return P9.P.test(e)||P9.S.test(e)}const cT=new Map;function eC(e){if(j9(e))return!0;if(e>=0&&e<128)return!1;const t=cT.get(e);if(t!==void 0)return t;const n=z9(String.fromCharCode(e));return cT.set(e,n),n}function j9(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Mk(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Rue(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Ik(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function _0(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const qP=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Oue=new RegExp(`${qP.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),$ue=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Pue(e,t){if(t.charCodeAt(0)===35&&$ue.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Ik(i)?_0(i):e}const n=$6(e);return n!==e?n:e}function zue(e){return e.includes("\\")?e.replace(qP,"$1"):e}function M0(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Oue,(t,n,i)=>n||Pue(t,i))}const jue=/[&<>"]/,Hue=/[&<>"]/g,Wue={"&":"&","<":"<",">":">",'"':"""};function que(e){return Wue[e]}function Uue(e){return jue.test(e)?e.replace(Hue,que):e}const Vue=/[.?*+^$[\]\\(){}|-]/g;function Kue(e){return e.replace(Vue,"\\$&")}const Zue={mdurl:HP,ucmicro:P9};function Po(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` -`,n+1))!==-1;)t++;return t}const Gue=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Que=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Yue=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,j6=["references","footnotes","abbreviations","abbr","abbrs"],H6=Symbol.for("markdown-it-ts.global-state"),W6=Object.prototype.hasOwnProperty;function dT(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function ja(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ad(e){if(Array.isArray(e))return e.map(t=>Ad(t));if(ja(e)){const t={};for(const n of Object.keys(e))t[n]=Ad(e[n]);return t}return e}function H9(e){return Array.isArray(e)?e.map((t,n)=>String(n)):ja(e)?Object.keys(e):[]}function tC(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!tC(o[r],UP(i.value,r)):!0)}}function Sc(e){const t=q6(e);if(t){for(const n of j6){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Xue(e,n,i);continue}i.existed?e[n]=Jue(e[n],i.value):delete e[n]}delete e[H6]}}function F3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const nC=Symbol.for("markdown-it-ts.diagnostics");function gv(e,t){if(e)try{const n=e[nC];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[nC]=i,i}catch{return}}function tc(e){return gv(e,!1)}function tce(e){if(e)try{const t=e[nC];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Br(e){tce(e)}function Rm(e,t){const n=gv(e,!0);n&&(n.stockFast=t)}function ns(e,t){const n=gv(e,!0);n&&(n.strategy=t)}function B3(e,t){const n=gv(e,!0);n&&(n.chunk=t)}function VP(e,t){const n=gv(e,!0);n&&(n.unbounded=t)}const nce=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ice=/[\0-\x1F\x7F-\x9F]/,oce=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,sce=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var rce=class{src_Any=nce.source;src_Cc=ice.source;src_Z=sce.source;src_P=oce.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},R3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},lce={"http:":R3,"https:":R3,"ftp:":R3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},ace="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",uce="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function cce(){const e=uce.split("|");return ace.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var dce={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:cce(),urlAuth:!1,maxLength:1e4},fT=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},KP=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...dce,...n},this.__schemas__={...lce},this.re=t||new rce,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const b=a;a=void 0;const w=this.testSchemaAt(e,b.schema,b.lastIndex);if(w){g={schema:b.schema,index:b.index,lastIndex:b.lastIndex+w};break}}let v=g;if((!v||l&&(l.indexv.lastIndex))&&(v=l),(!v||r&&(r.indexv.lastIndex))&&(v=r),!v)break;v===l?l=void 0:v===r&&(r=void 0);const y=new fT(e,v.schema,v.index,v.lastIndex);y.schema?this.__schemas__[y.schema].normalize(y,this):this.normalize(y),t.push(y),f=v.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new fT(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},fce=PP({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,v=Math.floor,y=String.fromCharCode;function b(z){throw new RangeError(m[z])}function w(z,$){const B=[];let P=z.length;for(;P--;)B[P]=$(z[P]);return B}function C(z,$){const B=z.split("@");let P="";B.length>1&&(P=B[0]+"@",z=B[1]),z=z.replace(h,".");const H=w(z.split("."),$).join(".");return P+H}function T(z){const $=[];let B=0;const P=z.length;for(;B=55296&&H<=56319&&BString.fromCodePoint(...z),I=function(z){return z>=48&&z<58?26+(z-48):z>=65&&z<91?z-65:z>=97&&z<123?z-97:36},S=function(z,$){return z+22+75*(z<26)-(($!=0)<<5)},_=function(z,$,B){let P=0;for(z=B?v(z/700):z>>1,z+=v(z/$);z>g*26>>1;P+=36)z=v(z/g);return v(P+(g+1)*z/(z+38))},x=function(z){const $=[],B=z.length;let P=0,H=128,j=72,G=z.lastIndexOf("-");G<0&&(G=0);for(let ne=0;ne=128&&b("not-basic"),$.push(z.charCodeAt(ne));for(let ne=G>0?G+1:0;ne=B&&b("invalid-input");const ve=I(z.charCodeAt(ne++));ve>=36&&b("invalid-input"),ve>v((2147483647-P)/te)&&b("overflow"),P+=ve*te;const ce=X<=j?1:X>=j+26?26:X-j;if(vev(2147483647/se)&&b("overflow"),te*=se}const Q=$.length+1;j=_(P-W,Q,W==0),v(P/Q)>2147483647-H&&b("overflow"),H+=v(P/Q),P%=Q,$.splice(P++,0,H)}return String.fromCodePoint(...$)},E=function(z){const $=[];z=T(z);const B=z.length;let P=128,H=0,j=72;for(const W of z)W<128&&$.push(y(W));const G=$.length;let ne=G;for(G&&$.push("-");ne=P&&tev((2147483647-H)/Q)&&b("overflow"),H+=(W-P)*Q,P=W;for(const te of z)if(te2147483647&&b("overflow"),te===P){let X=H;for(let ve=36;;ve+=36){const ce=ve<=j?1:ve>=j+26?26:ve-j;if(X32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=M0(e.slice(t,o)),s.pos=o,s.ok=!0),s}var GP=K6;const Ty=-2;function hce(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=hce(l,t,a,n);if(f!==Ty)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function gce(e,t,n){const i=Tk(e,t);i<0?Q6(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var vce=WP({attrGet:()=>mce,attrIndex:()=>Tk,attrJoin:()=>gce,attrPush:()=>Q6,attrSet:()=>pce,parseLinkDestination:()=>K6,parseLinkLabel:()=>Z6,parseLinkTitle:()=>G6});function yce(e){return e.includes("\r")||e.includes("\0")}function YP(e){return typeof e=="string"?e:e.toString()}function kce(e){if(e.inlineMode){const t=new Ts("inline","",0);t.content=YP(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const bce=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,wce=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Cce(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(wce.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(bce.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var JP=Cce;function Ace(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var XP=Ace;function hT(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function xce(e){const t=e.tokens_meta,n=e.tokens_meta.length;hT(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?ez:tz,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function Mce(e){const t=e.tokens_meta,n=e.tokens_meta.length;pT(e,e.delimiters);for(let i=0;i=48&&e<=57}function Ice(e){const t=e|32;return Y6(e)||t>=97&&t<=102}function iz(e){const t=e|32;return t>=97&&t<=122}function Tce(e){return iz(e)||Y6(e)}function Ece(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function Lce(e,t,n){let i=t+1;if(i>=n||!iz(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return nz(o)!==o?o:null}function Nce(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=Ece(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=Ik(s)?_0(s):_0(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=Lce(e.src,n,i);if(o){const s=nz(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var oz=Nce;const sz=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),oC=new Array(128),rz=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);oC[e]=`\\${t}`,rz[e]=sz[e]?t:oC[e]}function mT(e,t,n){e.pending&&e.pushPending();const i=new Ts("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function Dce(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return mT(e,s<256&&sz[s]?r:l,l),e.pos=n+1,!0}var lz=Dce;function Fce(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,uz="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Rce=new RegExp(`^(?:${az}|${uz}||<\\?[\\s\\S]*?\\?>|]*>|)`),Oce=new RegExp(`^(?:${az}|${uz})`);function cz(e){return e===32||e===9||e===10||e===12||e===13}function $ce(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||cz(t)}function Pce(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function jce(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!zce(s))return!1;const r=o.slice(i).match(Rce);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,$ce(l)&&e.linkLevel++,Pce(l)&&e.linkLevel--}return e.pos+=l.length,!0}var dz=jce;function Hce(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=W9(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=GP(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[Mk(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const v=e.push("image","img",0);v.attrs=[["src",c],["alt",""]],v.children=g,v.content=i,a&&v.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var fz=Hce;function O3(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[Mk(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var hz=Wce;function pz(e){const t=e|32;return t>=97&&t<=122}function qce(e){return e>=48&&e<=57}function Uce(e){return pz(e)||qce(e)||e===43||e===45||e===46}function Vce(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&Uce(e.charCodeAt(t));)t--;return t++,t>=e.length||!pz(e.charCodeAt(t))?null:e.slice(t)}function Kce(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=Vce(e.pending);if(!o)return!1;const s=Kce(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Zce(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||vT(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function Xce(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function yz(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:J6(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function o1(e,t,n,i,o,s){const r=yz(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Xce(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=J6()}function ede(e){const t=yz(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},kz=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Ts("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Ts(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Ts(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function kT(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return gz(e,t);case 33:return fz(e,t);case 38:return oz(e,t);case 42:case 95:return iC.tokenize(e,t);case 58:return e.md.options.linkify&&mz(e,t);case 60:return JP(e,t)||dz(e,t);case 91:return hz(e,t);case 92:return lz(e,t);case 96:return XP(e,t);case 126:return sC.tokenize(e,t);default:return vz(e,t)}}function bz(e){return!tde.test(e)}var nde=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new yT,this.ruler2=new yT,this.ruler.push("text",vz),this.ruler.push("linkify",mz),this.ruler.push("newline",gz),this.ruler.push("escape",lz),this.ruler.push("backticks",XP),this.ruler.push("strikethrough",sC.tokenize),this.ruler.push("emphasis",iC.tokenize),this.ruler.push("link",hz),this.ruler.push("image",fz),this.ruler.push("autolink",JP),this.ruler.push("html_inline",dz),this.ruler.push("entity",oz),this.ruler2.push("balance_pairs",Sce),this.ruler2.push("strikethrough",sC.postProcess),this.ruler2.push("emphasis",iC.postProcess),this.ruler2.push("fragments_join",Bce),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=kT(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&bz(e)){const a=new Ts("text","",0);a.content=e,i.push(a);return}const o=new kz(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&bz(s.content)){const r=new Ts("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const ode=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,sde=/[0-9a-z]/i;function rde(e){return/^\s]/i.test(e)}function lde(e){return/^<\/a\s*>/i.test(e)}function ade(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(rde(l.content)&&s>0&&s--,lde(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>ade(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const T=new Ts("text","",0);T.content=a.slice(f,y),T.level=d,c.push(T)}const b=new Ts("link_open","a",1);b.attrs=[["href",g]],b.level=d++,b.markup="linkify",b.info="auto",c.push(b);const w=new Ts("text","",0);w.content=v,w.level=d,c.push(w);const C=new Ts("link_close","a",-1);C.level=--d,C.markup="linkify",C.info="auto",c.push(C),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(pde,gde)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function yde(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&wz.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function kde(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");hde.test(i)&&vde(n.children||[]),wz.test(i)&&yde(n.children||[])}}var bde=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const wde=/['"]/,bT=/['"]/g,wT="’";function _2(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Cde(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=y,h=b),!f&&!h){m&&(r.content=_2(r.content,d.index,wT));continue}if(h)for(n=i.length-1;n>=0;n--){let T=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!wde.test(i)||!n.children||Cde(n.children,e)}}function xde(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],v=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let w=!1,C;for(C=t;C=d)break;if(o.charCodeAt(c++)===62&&!_){let E=a[C]+1,M,R;o.charCodeAt(c)===32?(c++,E++,R=!1,M=!0):o.charCodeAt(c)===9?(M=!0,(u[C]+E)%4===3?(c++,E++,R=!1):R=!0):M=!1;let q=E;for(h.push(s[C]),s[C]=c;c=d,m.push(u[C]),u[C]=a[C]+1+(M?1:0),g.push(a[C]),a[C]=q-E,v.push(l[C]),l[C]=c-s[C];continue}if(w)break;let x=!1;for(let E=0,M=y.length;E";const I=[t,0];N.map=I,e.md.block.tokenize(e,t,C);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=f,e.parentType=b,I[1]=e.line;for(let _=0;_=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} -`,s.map=[t,e.line],!0}function Ede(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&xT(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",CT[d],1);h.markup=AT[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",CT[d],-1);return g.markup=AT[d],!0}function Nde(e){switch(e){case 9:case 32:return!0}return!1}function Dde(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Oce.source}\\s*$`),/^$/,!1]];function Fde(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var _z=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,v=this.bsCount,y=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};_z.prototype.Token=Ts;function Rde(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:Rde(n,i,o)}const _T=["","h1","h2"];function Ode(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=Mz(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=T)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(C),h===45||h===61)){let I=C+1,S=I;for(;I=T){f=h===61?1:2;break}if(S-C>1)continue}if(a[m]<0||c&&!Iz(e,m,o,C,T))continue;let N=!1;for(let I=0,S=i.length;IC;){const N=o.charCodeAt(T-1);if(N!==9&&N!==32)break;T--}g=o.slice(C,T)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const v=h===61?"=":"-",y=e.push("heading_open",_T[f],1);y.markup=v,y.map=[t,e.line];const b=e.push("inline","",0);b.content=g,b.map=[t,e.line-1],b.children=[];const w=e.push("heading_close",_T[f],-1);return w.markup=v,e.parentType=d,!0}function Tz(e){switch(e){case 9:case 32:return!0}return!1}function MT(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,v=e.eMarks,y=e.sCount,b=e.bsCount,w=m[l]+g[l];if(w>=v[l])return!1;const C=h.charCodeAt(w);if(C>=48&&C<=57){if(f=IT(e,l),f<0||(c=!0,r=w,d=$de(e,l,f),u&&d!==1))return!1}else if(C===42||C===45||C===43){if(f=MT(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=v[l])return!1;if(i)return!0;const T=h.charCodeAt(f-1),N=String.fromCharCode(T);if(c){const M=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(M.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const I=[l,0];e.tokens[e.tokens.length-1].map=I,e.tokens[e.tokens.length-1].markup=N;let S=!1;const _=e.tokens.length-1,x=e.md.block.ruler.getRulesForState(e,"list"),E=e.parentType;for(e.parentType="list";l=o?z=1:z=R-M,z>4&&(z=1);const $=M+z,B=e.push("list_item_open","li",1);B.markup=N;const P=[l,0];B.map=P,c&&(B.info=f-r-1===1?Pde[h.charCodeAt(r)-48]:h.slice(r,f-1));const H=e.tight,j=e.tShift[l],G=e.sCount[l],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=$,e.tight=!0,e.tShift[l]=q-m[l],e.sCount[l]=R,q>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ne,e.tShift[l]=j,e.sCount[l]=G,e.tight=H,e.push("list_item_close","li",-1).markup=N,l=e.line,P[1]=l,l>=n||e.sCount[l]=4)break;let W=!1;for(let Q=0,te=x.length;Q3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const w=r[f]+l[f],C=a[f];if(w=C||TT(s.charCodeAt(w+1)))break}else if(T>=48&&T<=57&&w+1=C){N=-1;break}const I=s.charCodeAt(N++);if(I>=48&&I<=57){if(N-w>=10){N=-1;break}continue}if((I===41||I===46)&&(N>=C||TT(s.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const v=r[f]+l[f],y=a[f];if(d&&!Iz(e,f,s,v,y))continue;let b=!1;for(let w=0,C=i.length;w=4||e.src.charCodeAt(o)!==91)return!1;function a(w){const C=e.lineMax;if(w>=C||e.isEmpty(w))return null;let T=!1;if(e.sCount[w]-e.blkIndent>3&&(T=!0),e.sCount[w]<0&&(T=!0),!T){const S=e.parentType;e.parentType="reference";let _=!1;for(let x=0,E=l.length;x"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:y,href:f}),e.line=r),!0):!1}function $3(e){switch(e){case 9:case 32:return!0}return!1}const qde=65536;function P3(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Ude(e,t){if(e.lineFlags)return(e.lineFlags[t]&Dg.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!$3(l)||r===45&&$3(l)||!Ude(e,t))return!1;for(;s=4)return!1;u=ET(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let C=0;C=4||(u=ET(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=d-u.length,w>qde))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=b=[t+2,0]}const T=e.push("tr_open","tr",1);T.map=[o,o+1];for(let N=0;Nr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return o1(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const I2=[["table",Vde,["paragraph","reference"]],["code",Tde],["fence",Ede,["paragraph","reference","blockquote","list"]],["blockquote",Ide,["paragraph","reference","blockquote","list"]],["hr",Dde,["paragraph","reference","blockquote","list"]],["list",jde,["paragraph","reference","blockquote"]],["reference",Wde],["html_block",Fde,["paragraph","reference","blockquote"]],["heading",Lde,["paragraph","reference","blockquote"]],["lheading",Ode],["paragraph",Hde]];var Zde=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Kde;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new _z(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Ez=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};Ez.prototype.Token=Ts;const LT=[["normalize",fde],["block",kce],["inline",ide],["linkify",ude],["replacements",kde],["smartquotes",Ade],["text_join",xde]],Gde={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Qde={parseLinkLabel:Z6,parseLinkDestination:K6,parseLinkTitle:G6};function Yde(){return{...Gde}}function Jde(){return{...Qde}}var Xde=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Zde,this.inline=new nde,this.ruler=new bde;for(let e=0;e@[\]\\^_`{}~]/;function q9(e){return!efe.test(e)}function sg(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function Ey(e,t,n){for(let i=t;i3)return q9(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!q9(c))return!1;const d=nfe[s],f=ife[s],h=ga("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(X6(c,o,1));const m=ga("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function sfe(e,t,n){const i=ga("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(X6(t,n,1)),e.push(ga("paragraph_close","p",-1,0))}function rfe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function W3(e,t){for(;t=1e5?DT:H3,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,FT=/[&<>"]/g,hfe=/&/g,pfe=/[<>"]/g,mfe={"&":"&","<":"<",">":">",'"':"""};function q3(e){return mfe[e]||e}function Ui(e){if(e.length===0)return"";if(e.length<32)return ffe.test(e)?e.replace(FT,q3):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(hfe,"&"):t?e.replace(FT,q3):e.replace(pfe,q3)}const gfe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),vfe=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Lz(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(gfe,(t,n,i)=>{if(n)return n;if(vfe.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return Ik(s)?_0(s):"�"}const o=$6(t);return o!==t?o:t})}const yfe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,kfe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,bfe=/"/g;function Pp(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function U9(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!U9(e,t,Pp(e,t))}function BT(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=e7(e.slice(s,r));return a===null?null:`${a} -`}function RT(e,t,n){return t+1" -`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
      3. ${e[t]}
      4. -`}function Sfe(e,t,n){const i=t+2;if(n===i+1)return xfe(e,i);const o=e7(e.slice(t+2,n));return o===null?null:`
      5. ${o}
      6. -`}function _fe(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
        ",i.lang=s,i.open=d),{html:`${d}${Ui(c)}
        -`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n -`;C -`,l=y,a=b}let w=T2(e,v);for(;w${v}

        -`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=Ly(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Nfe(r,o.maxChunks)),Ny(t,r))return B3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),i1(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return B3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),i1(n,s,()=>{for(let u=0;u=3&&(c?c.marker===w&&T>=c.length&&(c=null):c={marker:w,length:T})}}const v=m-f;o+=v,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=v);const y=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(y)d(m);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),w=Math.max(t.maxChunkChars,8e3);(a>=b||u>=w)&&d(m)}f=m}return n&&d(e.length),i}function Ny(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Lfe(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Hc(e){return e.length===0?0:Po(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Pfe(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function jfe(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return Pfe(e,n+1,e.length-1)?!zfe(e,t):!1}function Hfe(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??Rfe:e.options.fullChunkSizeChars??Ffe),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Ofe:e.options.fullChunkSizeLines??Bfe);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var vv=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Hc(this.pending);if(this.pending.length=i||n>=o}function Oz(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Dz))return"yes";const i=e.options.autoUnboundedThresholdLines??Fz;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new vv(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){Bz(s,l)}});if(o&&U6(n,o),r.feed(t),r.flushForce(n),o&&(V6(n),i.fallbackOnGlobalState===!1)){const l=tc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const s1=(e,t,n)=>en?n:e;function $z(e){return e.experimental?{...e,...e.experimental}:e}const PT=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],zT=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function Pz(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Kfe(e,t=Math.max(0,e/40|0),n={}){const i=$z(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:s1(Math.ceil(e/s),8e3,64e3),maxChunkLines:s1(Math.ceil(t/s),150,700),maxChunks:s1(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function jT(e,t=Math.max(0,e/40|0),n={}){const i=$z(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:s1(Math.ceil(e/s),8e3,64e3),maxChunkLines:s1(Math.ceil(t/s),150,700),maxChunks:s1(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var Zfe={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},Gfe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Qfe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Ek(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Dy(e,t){if(Ek(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const HT=e=>Ek(e)?e:Promise.resolve(e);function Bg(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Ui(e)}}function Od(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Bg(t[0])}="${Ui(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} -`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
        ${t}
        -`}return`
        ${t}
        -`}function I0(e){return!e.attrs||e.attrs.length===0?`${Ui(e.content)}`:`${Ui(e.content)}`}function rC(e){const t=Ui(e.content);return e.attrs?`${t} -`:`
        ${t}
        -`}function Yfe(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

        `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function WT(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function Jfe(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function qT(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function K9(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const Xfe={langPrefix:"language-",xhtmlOut:!1,breaks:!1},E2=Object.prototype.hasOwnProperty,Ai={code_inline(e,t){return I0(e[t])},code_block(e,t){return rC(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?Lz(s.info).trim():"",{langName:l,langAttrs:a}=zz(r),u=n.highlight,c=Ui(s.content);if(!u)return Rg(s,c,r,l,n);const d=u(s.content,l,a);return Ek(d)?d.then(f=>Rg(s,f||c,r,l,n)):Rg(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],K9(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
        -`:`
        -`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
        -`:`
        -`:` -`},text(e,t){return Ui(e[t].content)},text_special(e,t){return Ui(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function UT(e,t,n){const i=e.info?Lz(e.info).trim():"",{langName:o,langAttrs:s}=zz(i),r=t.highlight,l=Ui(e.content);if(!r)return Rg(e,l,i,o,t);const a=r(e.content,o,s);if(Ek(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Rg(e,a||l,i,o,t)}function U3(e,t,n,i){switch(e.type){case"text":return t.text===Ai.text?e.content.length===0?"":Ui(e.content):null;case"text_special":return t.text_special===Ai.text_special?e.content.length===0?"":Ui(e.content):null;case"softbreak":return t.softbreak===Ai.softbreak?i:null;case"hardbreak":return t.hardbreak===Ai.hardbreak?n:null;case"html_inline":return t.html_inline===Ai.html_inline?e.content:null;case"code_inline":return t.code_inline===Ai.code_inline?I0(e):null;default:return null}}function ehe(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===Ai.text)return s.content.length===0?"":Ui(s.content);break;case"text_special":if(o.text_special===Ai.text_special)return s.content.length===0?"":Ui(s.content);break;case"softbreak":if(o.softbreak===Ai.softbreak)return t.breaks?t.xhtmlOut?`
        -`:`
        -`:` -`;break;case"hardbreak":if(o.hardbreak===Ai.hardbreak)return t.xhtmlOut?`
        -`:`
        -`;break;case"html_inline":if(o.html_inline===Ai.html_inline)return s.content;break;case"code_inline":if(o.code_inline===Ai.code_inline)return I0(s);break}const r=o[s.type];if(!r)return K9(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:Dy(l,s.type)}var the=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Ai}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,v="";for(let y=0;y0&&e[y-1].hidden?` -`:"";if(w==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&y+3${this.renderInlineTokens(S.children||[],i,o)}`,y+=3;continue}}if(y+2 -`,y+=2;continue}}}if(w==="inline"){const I=b.children||[];if(I.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
        -`:`
        -`,m=i.breaks?h:` -`,g=!0);const S=I[0];switch(S.type){case"text":if(l===Ai.text){v+=Ui(S.content);continue}break;case"text_special":if(a===Ai.text_special){v+=Ui(S.content);continue}break;case"softbreak":if(u===Ai.softbreak){v+=m;continue}break;case"hardbreak":if(c===Ai.hardbreak){v+=h;continue}break;case"html_inline":if(d===Ai.html_inline){v+=S.content;continue}break;case"code_inline":if(f===Ai.code_inline){v+=I0(S);continue}break}}v+=this.renderInlineTokens(I,i,o);continue}const T=s[w];if(!T){const I=b.attrs;if(!b.hidden){if(!I||I.length===0)switch(w){case"hr":v+=r?`


        -`:`
        -`;continue;case"heading_open":v+=`<${b.tag}>`;continue;case"heading_close":v+=` -`;continue;case"paragraph_open":v+=`${C}

        `;continue;case"paragraph_close":v+=`

        -`;continue;case"list_item_open":{const S=e[y+1];v+=C+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"
      7. ":`
      8. -`);continue}case"list_item_close":v+=`
      9. -`;continue;case"bullet_list_open":v+=`${C}
          -`;continue;case"bullet_list_close":v+=`
        -`;continue;case"blockquote_open":v+=C+(e[y+1]&&e[y+1].nesting===-1&&e[y+1].tag==="blockquote"?"
        ":`
        -`);continue;case"blockquote_close":v+=`
        -`;continue;case"ordered_list_open":v+=`${C}
          -`;continue;case"ordered_list_close":v+=`
        -`;continue;case"table_open":v+=`${C} -`;continue;case"table_close":v+=`
        -`;continue;case"thead_open":v+=`${C} -`;continue;case"thead_close":v+=` -`;continue;case"tbody_open":v+=`${C} -`;continue;case"tbody_close":v+=` -`;continue;case"tr_open":v+=`${C} -`;continue;case"tr_close":v+=` -`;continue;case"td_open":v+=`${C}`;continue;case"td_close":v+=` -`;continue;case"th_open":v+=`${C}`;continue;case"th_close":v+=` -`;continue}else if(I.length===1){const S=I[0];if(w==="ordered_list_open"&&S[0]==="start"){v+=`${C}
          -`;continue}if(w==="td_open"&&S[0]==="style"){v+=`${C}`;continue}if(w==="th_open"&&S[0]==="style"){v+=`${C}`;continue}}}v+=this.renderToken(e,y,i);continue}if(w==="code_block"&&T===Ai.code_block){v+=rC(b);continue}if(w==="fence"&&T===Ai.fence){v+=UT(b,i);continue}if(w==="html_block"&&T===Ai.html_block){v+=b.content;continue}const N=T(e,y,i,o,this);typeof N=="string"?v+=N:v+=Dy(N,b.type)}return v}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` -`:"",c=a?`> -`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(E2.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),E2.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(E2.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(E2.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...Xfe,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===Ai.code_block)return rC(t);if(s==="html_block"&&o.html_block===Ai.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):K9(t,r.xhtmlOut===!0);if(s==="fence"&&a===Ai.fence)return UT(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:Dy(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return ehe(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
          -`:`
          -`,r=t.breaks?s:` -`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,v=i.em_close,y=i.strong_open,b=i.strong_close;let w="";for(let C=0;C`;if(u===Ai.softbreak&&C+3`,C+=1;continue}if(T.type==="em_open"&&!g&&!v&&C+2${_}`,C+=2;continue}}}if(T.type==="strong_open"&&!y&&!b&&C+2${_}`,C+=2;continue}}}switch(T.type){case"text":if(l===Ai.text){const S=T.content.length===0?"":Ui(T.content);if(d===Ai.html_inline&&C+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=ce,!Z&&se!==void 0&&(pe=Po(e),Z=pe>=se)),Z){const K=this.parseFullDocument(e,R,n,pe,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!tc(R)?.unbounded}),K.tokens}else if(P){const K=(ye,Ae,Me)=>yeMe?Me:ye;pe===void 0&&(pe=Po(e));const re=te&&!Q?jT(e.length,pe,n.options):null,we=re?.maxChunkChars??(H?K(Math.ceil(e.length/j),8e3,64e3):G??1e4),be=re?.maxChunkLines??(H?K(Math.ceil(pe/j),150,700):ne??200),ke=re?.maxChunks??(H?K(Math.ceil(e.length/64e3),j,32):W),oe=e.length>0&&e.charCodeAt(e.length-1)===10,le=B&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&re?.strategy!=="plain";if(($||le)&&(e.length>=we*2||pe>=be*2)&&oe){const ye=V9(n,e,R,{maxChunkChars:we,maxChunkLines:be,fenceAware:re?.fenceAware??X,maxChunks:ke});return this.cache={src:e,tokens:ye,env:R,lineCount:pe,lastSegment:void 0,globalStateReason:ol(e)},this.updateCacheLineCount(this.cache,pe),this.recordChunkedParseResult(R,$?"explicit-initial-large-doc":"default-initial-large-doc"),ye}}const ae=this.parseFullDocument(e,R,n,pe);return pe=ae.lineCount,this.cache={src:e,tokens:ae.tokens,env:R,lineCount:pe,lastSegment:void 0,globalStateReason:ol(e)},this.updateCacheLineCount(this.cache,pe),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!tc(R)?.unbounded}),ae.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ns(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=ol(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):ol(e),a=r||l;if(a){const R=i??o.env;Sc(R);const q=ol(e),z=this.parseFullDocument(e,R,n),$=z.tokens,B=z.lineCount;return this.cache={src:e,tokens:$,env:R,lineCount:B,lastSegment:void 0,globalStateReason:q},this.updateCacheLineCount(this.cache,B),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(R,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!tc(R)?.unbounded}),$}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?q=8:c.length>1e3?q=6:c.length>200&&(q=4),q=Math.min(q,R);let z=null;const $=n.options?.streamContextParseStrategy??"chars",B=n.options?.streamContextParseMinChars??200,P=n.options?.streamContextParseMinLines??2;let H;const j=()=>(H===void 0&&(H=Po(c)),H),G=this.canDirectlyParseAppend(o),ne=G&&this.shouldUseUnboundedAppend(e,o,c);let W=!1;if(!G)switch($){case"lines":W=j()>=P;break;case"constructs":if(c.length>=B){W=!0;break}if(ohe(c)){W=!0;break}W=j()>=P;break;case"chars":default:W=c.length>=B}if(q>0&&W){const X=this.getTailLines(o.src,q)+c;try{const ve=this.core.parse(X,o.env,n).tokens,ce=ve.findIndex(se=>se.map&&typeof se.map[1]=="number"&&se.map[1]>q);if(ce!==-1){const se=ve.slice(ce),pe=R-q;pe!==0&&this.shiftTokenLines(se,pe),z={tokens:se}}}catch{z=null}}else z=null;if(!z){const X=R;if(ne)z={tokens:Fg(n,c,o.env,{mode:"stream"})},X>0&&this.shiftTokenLines(z.tokens,X);else{const ve=this.core.parse(c,o.env,n);X>0&&this.shiftTokenLines(ve.tokens,X),z=ve}}let Q=0;if(o.tokens.length>0&&z.tokens.length>0){const X=o.tokens[o.tokens.length-1],ve=z.tokens[0];try{X.type==="inline"&&ve.type==="inline"&&(ve.children&&ve.children.length>0&&(X.children||(X.children=[]),this.appendTokens(X.children,ve.children)),X.content=(X.content||"")+(ve.content||""),Q=1)}catch{Q=0}}const te=o.tokens.length;if(z.tokens.length>Q){const X=o.tokens,ve=z.tokens,ce=Math.min(X.length,ve.length-Q);let se=0;for(let pe=ce;pe>0;pe--){let Z=!0;for(let ae=0;ae0&&(Q+=se),ve.length>Q&&this.appendTokens(o.tokens,ve,Q)}if(o.src=e,o.globalStateReason=null,o.lineCount=R+(H??j()),o.tokens.length>te){const X=this.getLastSegment(o.tokens,e,te,o.tokens.length,e.length-c.length,R);X?o.lastSegment=X:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ne&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ns(o.env,{area:"stream",path:ne?"stream-unbounded-append":"stream-append",reason:ne?"large-delta":"safe-append",unbounded:ne}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ns(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,v=!h&&!c&&m,y=g||v,b=n.options?.streamChunkAdaptive!==!1,w=n.options?.streamChunkTargetChunks??8,C=n.options?.streamChunkSizeChars,T=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,_=n.options?.streamChunkFenceAware??!0;let x=c&&o.lineCount!==void 0?o.lineCount+Po(c):void 0;if(y){x===void 0&&(x=Po(e));const R=(j,G,ne)=>jne?ne:j,q=S&&!I?jT(e.length,x,n.options):null,z=q?.maxChunkChars??(b?R(Math.ceil(e.length/w),8e3,64e3):C??1e4),$=q?.maxChunkLines??(b?R(Math.ceil(x/w),150,700):T??200),B=q?.maxChunks??(b?R(Math.ceil(e.length/64e3),w,32):N),P=e.length>0&&e.charCodeAt(e.length-1)===10,H=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&q?.strategy!=="plain";if((g||H)&&(e.length>=z*2||x>=$*2)&&P){const j=V9(n,e,d,{maxChunkChars:z,maxChunkLines:$,fenceAware:q?.fenceAware??_,maxChunks:B});return this.cache={src:e,tokens:j,env:d,lineCount:x,lastSegment:void 0,globalStateReason:ol(e)},this.updateCacheLineCount(this.cache,x),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),j}}const E=this.parseFullDocument(e,d,n,x),M=E.tokens;return x=E.lineCount,this.cache={src:e,tokens:M,env:d,lineCount:x,lastSegment:void 0,globalStateReason:ol(e)},this.updateCacheLineCount(this.cache,x),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!tc(d)?.unbounded}),M}recordChunkedParseResult(e,t){const n=tc(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",ns(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!tc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ns(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=ol(e);mv(t)&&Sc(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?Oz(n,e.length,i):"no";if(r==="yes"){const a=Fg(n,e,t);return ns(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?Po(e):0)}}let l=i;if(r==="need-lines"&&(l=Po(e),Rz(n,e.length,l))){const a=Fg(n,e,t);return ns(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Po(e):0),{tokens:i1(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:Po(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` -`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` -`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+Po(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` -`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??ihe}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;oV3?n.slice(n.length-V3):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` -`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` -`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+Po(s);t.lineCount=g;const v=this.getDocLineCount(e,g);return r.map&&(r.map[1]=v),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const v=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,y=t.lineCount??Po(t.src);t.tokens.splice(v,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const b=y+Po(s);t.lineCount=b;const w=this.getDocLineCount(e,b);if(r.map&&(r.map[1]=w),h.tbodyOpenIndex>=0){const C=t.tokens[h.tbodyOpenIndex];C?.map&&(C.map[1]=w)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:w,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` -`);if(t<0)return null;const n=e.indexOf(` -`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=Po(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const KT={default:Gfe,zero:Qfe,commonmark:Zfe};function ahe(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function uhe(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function ZT(e){return e.experimental?{...e,...e.experimental}:e}function aa(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function GT(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=GT(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=GT(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=QT(s?.options,o,"fullChunkedFallback"),u=QT(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Xde;let m=null;const g=()=>(m||(m=new nhe(n)),m);let v=null;const y=()=>(v||(v=new lhe(h)),v);let b=null;const w=()=>(b||(b=new KP({fuzzyLink:!0})),b),C=S=>!c&&!!d&&!uhe(S,d),T=(S,_)=>i==="default"&&!c&&m===null&&f!==null&&S.parse===f&&C(S)&&!S.stream.enabled&&_<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.xhtmlOut===!1&&S.options.breaks===!1&&S.options.langPrefix==="language-"&&S.options.linkify===!1&&S.options.typographer===!1&&S.options.highlight===null,N=(S,_)=>i==="default"&&!c&&C(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&_<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,I={core:h,block:h.block,inline:h.inline,get linkify(){const S=w();return Object.defineProperty(this,"linkify",{value:S,writable:!0,configurable:!0}),S},get renderer(){const S=g();return Object.defineProperty(this,"renderer",{value:S,writable:!0,configurable:!0}),S},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return C(this)},set(S){const _=ZT(S);return this.options={...this.options,..._},(aa(S,"fullChunkSizeChars")||aa(S,"fullChunkSizeLines")||aa(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(aa(S,"streamChunkSizeChars")||aa(S,"streamChunkSizeLines")||aa(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),aa(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),aa(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(_),typeof _.stream=="boolean"&&(this.stream.enabled=_.stream,v&&(v.reset(),v.resetStats())),this},configure(S){const _=typeof S=="string"?KT[S]:S;if(!_)throw new Error("Wrong `markdown-it` preset, can't be empty");if(_.options&&this.set(_.options),_.components){const x=_.components;x.core?.rules&&this.core.ruler.enableOnly(x.core.rules),x.block?.rules&&this.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&this.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&this.inline.ruler2.enableOnly(x.inline2.rules)}return this},enable(S,_){const x=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const R of E){if(!R)continue;const q=R.enable(x,!0);for(let z=0;z!M.has(q));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},disable(S,_){const x=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const R of E){if(!R)continue;const q=R.disable(x,!0);for(let z=0;z!M.has(q));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},use(S,..._){const x=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!x)throw new TypeError("MarkdownIt.use: plugin must be a function");const E=[this,..._],M=S;return c=!0,x.apply(M,E),this},render(S,_){let x;if(T(this,S.length)){_!==void 0&&(Br(_),x=F3("render"));const R=x?pp():0,q=x?$T(S,x):OT(S);if(x&&(x.attemptMs=pp()-R,q===null&&(x.fallbackReason="unsupported-stock-subset"),Rm(_,x)),q!==null)return _!==void 0&&ns(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),q}const E=_??{},M=this.parse(S,E);return x&&Rm(E,x),g().render(M,this.options,E)},async renderAsync(S,_){let x;if(T(this,S.length)){_!==void 0&&(Br(_),x=F3("render"));const R=x?pp():0,q=x?$T(S,x):OT(S);if(x&&(x.attemptMs=pp()-R,q===null&&(x.fallbackReason="unsupported-stock-subset"),Rm(_,x)),q!==null)return _!==void 0&&ns(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),q}const E=_??{},M=this.parse(S,E);return x&&Rm(E,x),g().renderAsync(M,this.options,E)},renderIterable(S,_={}){const x=this.parseIterable(S,_);return g().render(x,this.options,_)},async renderAsyncIterable(S,_={}){const x=await this.parseAsyncIterable(S,_);return g().renderAsync(x,this.options,_)},renderInline(S,_={}){const x=this.parseInline(S,_);return g().render(x,this.options,_)},validateLink:Az,normalizeLink:xz,normalizeLinkText:Sz,utils:Tue,helpers:{...vce},parse(S,_){if(typeof S!="string")throw new TypeError("Input data should be a String");if(_!==void 0&&Br(_),N(this,S.length)){const R=_===void 0?void 0:F3("parse"),q=R?pp():0,z=dfe(S,R);if(R&&(R.attemptMs=pp()-q,z===null&&(R.fallbackReason="unsupported-stock-subset"),Rm(_,R)),z!==null)return _!==void 0&&ns(_,{area:"parse",path:"stock-fast",reason:"stock-subset"}),z}const x=_??{};let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&C(this)){const R=Oz(this,S.length);if(R==="yes"){const q=Fg(this,S,x);return ns(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),q}R==="need-lines"&&(E=Po(S))}if(!this.stream.enabled){const R=S.length,q=this.options.autoTuneChunks!==!1,z=r,$=!a&&C(this),B=!!this.options.fullChunkedFallback,P=$&&R>=2e5;let H;(B||P||E!==void 0)&&(H=E??Po(S));const j=(B||P)&&q&&!z?Kfe(R,H,this.options):null;if(B||P){const G=H??0;if(B?R>=(this.options.fullChunkThresholdChars??2e4)||G>=(this.options.fullChunkThresholdLines??400):P){if(j&&j.strategy!=="plain"){const ne=V9(this,S,x,{maxChunkChars:j.maxChunkChars,maxChunkLines:j.maxChunkLines,fenceAware:j.fenceAware,maxChunks:j.maxChunks});return _&&YT(_,B?"explicit-full-chunk":"default-large-string"),ne}if(B){const ne=(Z,ae,K)=>ZK?K:Z,W=this.options.fullChunkAdaptive!==!1,Q=this.options.fullChunkTargetChunks??8,te=ne(Math.ceil(R/Q),8e3,64e3),X=ne(Math.ceil(G/Q),150,700),ve=W?te:this.options.fullChunkSizeChars??1e4,ce=W?X:this.options.fullChunkSizeLines??200,se=W?ne(Math.ceil(R/64e3),Q,32):this.options.fullChunkMaxChunks,pe=V9(this,S,x,{maxChunkChars:ve,maxChunkLines:ce,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:se});return _&&YT(_,"explicit-full-chunk"),pe}}}if(E!==void 0&&C(this)&&Rz(this,R,H??E)){const G=Fg(this,S,x);return ns(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),G}}const M=ol(S);return ns(_,{area:"parse",path:"plain",reason:"default-plain"}),i1(x,M,()=>h.parse(S,x,this).tokens)},parseIterable(S,_={}){return Br(_),Wfe(this,S,_)},parseAsyncIterable(S,_={}){return Br(_),qfe(this,S,_)},parseIterableToSink(S,_,x={}){return Br(x),Ufe(this,S,_,x)},parseAsyncIterableToSink(S,_,x={}){return Br(x),Vfe(this,S,_,x)},parseInline(S,_={}){if(typeof S!="string")throw new TypeError("Input data should be a String");Br(_),mv(_)&&Sc(_);const x=h.createState(S,_,this);return x.inlineMode=!0,h.process(x),x.tokens}};if(I.stream={enabled:!!n.stream,parse(S,_){return I.stream.enabled?y().parse(S,_,I):I.parse(S,_??{})},reset(){y().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},s?.components){const S=s.components;S.core?.rules&&I.core.ruler.enableOnly(S.core.rules),S.block?.rules&&I.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&I.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&I.inline.ruler2.enableOnly(S.inline2.rules)}return d=ahe(I),f=I.parse,I}var dhe=che;const Hz=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],fhe=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],Wz=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],hhe=["svg","g","path"],phe=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],mhe=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],ghe=["action","data","href","src","srcset","poster","xlink:href","formaction"],vhe=["script"],yhe=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],$d=new Set(Hz),qz=new Set(Wz),T0=new Set([...Hz,...fhe,...Wz,...hhe]),Uz=new Set([...T0,...phe]),khe=new Set(mhe),bhe=new Set(ghe),yv=new Set(vhe),Vz=new Set(yhe);function Kz(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const whe={amp:"&",bsol:"\\",colon:":",newline:` -`,sol:"/",tab:" "};function Zz(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return whe[String(o??"").toLowerCase()]??t})}const L2=new Set(["http","https","mailto","tel"]),Che=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),If=new Set(["http","https"]);function Gz(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const Ahe=/^https?:\/\//i;function xhe(e){if(!Ahe.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function She(e,t,n){if(!Og(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function Og(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function _he(e,t){return t==="href"||t==="xlink:href"?Og(e,t)?L2:If:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?If:(Og(e,t),L2)}function ph(e,t={}){if(xhe(e))return!1;const n=Kz(Zz(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=Gz(n);return s?s==="file"?!She(n,i,o):Og(i,o)?Che.has(s):!_he(i,o).has(s):!1}function Mhe(e){const t=Zz(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Gz(Kz(t).toLowerCase());return n==="http"||n==="https"}function Ihe(e,t={}){const n=String(e??"").trim();return n?ph(n,t)?"":n:""}function JT(e){return Ihe(e,{tagName:"img",attrName:"src"})}function The(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,v){return f[h].nesting===1&&f[h].attrJoin("class",t),v.renderToken(f,h,m,g,v)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let v,y=!1,b=f.bMarks[h]+f.tShift[h],w=f.eMarks[h];if(l!==f.src.charCodeAt(b))return!1;for(v=b+1;v<=w&&r[(v-b)%a]===f.src[v];v++);const C=Math.floor((v-b)/a);if(C=m||(b=f.bMarks[I]+f.tShift[I],w=f.eMarks[I],b=4)){for(v=b+1;v<=w&&r[(v-b)%a]===f.src[v];v++);if(!(Math.floor((v-b)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&Qz(o.children,t,n)}}function Lhe(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(The,t,{render(n,i){return n[i].nesting===1?`
          `:`
          -`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let N=0,I=-1;for(let S=0;S0&&(h=g.slice(0,I))}h||(f=d||void 0)}if(o)return!0;const v=!!s.env.__markstreamFinal;let y=n+1,b=!1;for(;y<=i;){const N=s.bMarks[y]+s.tShift[y],I=s.eMarks[y];if(s.src.slice(N,I).trim()===":::"){b=!0;break}y++}b||(y=i);const w=s.push("vmr_container_open","div",1);if(w.attrSet("class",`vmr-container vmr-container-${c}`),w.map=[n,b?y:i],w.meta={...w.meta??{},unclosed:!b&&!v},f&&w.attrSet("data-args",f),h)try{const N=JSON.parse(h);for(const[I,S]of Object.entries(N)){const _=S!=null&&typeof S=="object";w.attrSet(`data-${I}`,_?JSON.stringify(S):String(S))}}catch{const N=Ehe(h);if(N)for(const[I,S]of Object.entries(N)){const _=S!=null&&typeof S=="object";w.attrSet(`data-${I}`,_?JSON.stringify(S):String(S))}else w.attrSet("data-attrs",h)}const C=[];for(let N=n+1;NN.trim().length>0)){let N=C.join(` -`);N.endsWith(` -`)||(N+=` -`),N.endsWith(` - -`)||(N+=` -`);const I=s.tokens[s.tokens.length-1];I&&(I.raw=N);const S=[];s.md.block.parse(N,s.md,s.env,S),Qz(S,n+1,n+1+C.length),s.tokens.push(...S)}const T=s.push("vmr_container_close","div",-1);return b||(T.hidden=!0,T.map=[i,i]),s.line=b?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ga(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wo(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function Lk(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const Nhe=/^[a-z][a-z0-9_-]*$/;function XT(e){return Nhe.test(String(e??"").trim().toLowerCase())}function Ca(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return XT(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":XT(o)?o:""}function Uh(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=Ca(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function Dhe(...e){const t=new Set,n=[];for(const i of e)for(const o of Uh(i))t.has(o)||(t.add(o),n.push(o));return n}function Fhe(e){const t=Uh(e);return{key:t.join(","),tags:t}}function Yz(e){return Ca(e)}function Bhe(e,t){const n=String(e??""),i=Ca(t);if(!i)return!1;const o=Ga(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Jz(e,t){const n=Ca(t);return!!n&&!T0.has(n)&&!Bhe(e,n)}function Rhe(e,t){const n=String(e??""),i=Ca(t);if(!i)return n;const o=Ga(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const Xz=$d,Ohe=T0,ej=new Set(qz);ej.delete("details");const $he=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,Phe=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,lC=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,zhe=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Z9(e){return(e.match(lC)?.[1]??"").toLowerCase()}function t7(e){return/^\s*<\s*\//.test(e)}function n7(e,t){return Xz.has(t)||/\/\s*>\s*$/.test(e)}function jhe(e,t){let n=0;for(let i=0;i0&&n--;continue}n7(o,s)||n++}}return n}function eE(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Ga(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function Whe(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ga(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function G9(e){const t=e;return String(t.raw??t.content??t.markup??"")}function qhe(e){const t=e;return t.meta||(t.meta={}),t.meta}function K3(e,t,n){const i=qhe(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function Uhe(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ga(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` -`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Ga(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const v=g??(h.type==="html_inline"?Z9(m):"");if(!(v&&t.has(v))){r(m);return}const y=t7(m),b=!y&&n7(m,v);if(y){if(!i.length||i[i.length-1].tag!==v){r(m);return}u(m);return}if(r(m),b){K3(h,m,"");return}i.push({tag:v,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,v=!0;for(const y of h.children){const b=G9(y),w=y.type==="html_inline"?Z9(b):"",C=w&&t.has(w);let T=b;if(v&&m&&b&&(i.length||C)){const N=m.indexOf(b,g);if(N!==-1)a(m.slice(g,N)),T=m.slice(N,N+b.length),g=N+b.length;else{if(i.length&&!C)continue;v=!1}}f(y,T,w)}v&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=G9(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` -`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)K3(h.token,h.raw,h.inner)}function Vhe(e){return/^\s*<\s*[!?]/.test(e)}function Khe(e){const t=new Set(Ohe);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function tE(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Zhe(e,t){let n=null;for(const s of e.matchAll($he)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();tE(l,t)&&Wo(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const w of g){const C=Ca(String(w??""));C&&m.add(C)}const v=Khe(Array.from(m)),y=new Set(Yhe);for(const w of m)y.add(w);return{autoCloseInlineTagSet:y,commonHtmlTags:v,customTagSet:m,shouldMergeHtmlBlockTag:w=>m.has(w)||!v.has(w)||ej.has(w)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const v={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},v,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[v]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const v of h){const y=v;if(y.type!=="inline"||!Array.isArray(y.children))continue;const b=String(y.content??""),w=y.children.length?y.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(w)try{const C=Qhe(w,m);if(y.children=C.children,C.pendingBuffer){const T=b.lastIndexOf(C.pendingBuffer);if(T!==-1){const N=b.slice(0,T);y.content=N,typeof y.raw=="string"&&(y.raw=N)}}}catch(C){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",C)}}Uhe(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:v}=i(f),y=[];for(let b=0;b0){const[T,N]=y[y.length-1];if(b!==N){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(b,1),b--;continue}const I=String(w.content??w.raw??"");if(I){const S=h[N],_=`${String(S.content||"")} -${I}`,x=Wo(_),E=x===-1?null:eE(_,T,x+1);if(E){const M=_.slice(0,E.end),R=_.slice(E.end);S.content=M,S.loading=!1,h.splice(b,1),y.pop();const q=d(S,R)?[]:u(R,c(h,b,"paragraph"));q.length&&h.splice(b,0,...q),b--;continue}S.content=_,S.loading!==!1&&(S.loading=!0)}h.splice(b,1),b--;continue}}const C=o(w);if(C){if(Vhe(C))continue;const T=(C.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(C);if(!T||!v(T))continue;if(s(w,C),!N)T&&!new RegExp(`^\\s*<\\s*${T}\\b[^>]*\\/\\s*>`,"i").test(C)&&Whe(C,T)>0&&y.push([T,b]);else if(y.length>0&&T&&y[y.length-1][0]===T){const[,I]=y[y.length-1],S=h[I];S.content=`${String(S.content||"")} -${C}`,S.loading=!1,y.pop(),h.splice(b,1),b--}continue}else if(y.length>0){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(b,1),b--;continue}const T=w.content||"",N=new RegExp(`<\\s*\\/\\s*${y[y.length-1][0]}\\s*>`,"i").test(T);if(T){const[,I]=y[y.length-1],S=h[I];S.content=`${S.content||""} -${T}`,S.loading!==!1&&(S.loading=!N)}N&&y.pop(),h.splice(b,1),b--}else continue}if(g.size>0){const b=new Map,w=new Map,C=I=>{let S=b.get(I);return S||(S=new RegExp(`<\\s*${I}\\b`,"i"),b.set(I,S)),S},T=I=>{let S=w.get(I);return S||(S=new RegExp(`<\\s*\\/\\s*${I}\\s*>`,"i"),w.set(I,S)),S},N=[];for(let I=0;I0){const E=N[N.length-1],M=h[E.index],R=S.type==="html_block"?T(E.tag).exec(_):null;if(R){const $=R.index+R[0].length,B=_.slice(0,$),P=_.slice($);M.content=`${String(M.content??"")} -${B}`,Array.isArray(M.children)&&M.children.push({type:"html_inline",content:``,raw:``}),N.pop();const H=d(M,P)?[]:u(P,c(h,I,"paragraph"));H.length?h.splice(I,1,...H):(h.splice(I,1),I--);continue}if(S.type!=="inline")continue;const q=Array.isArray(S.children)?S.children:[],z=jhe(q,E.tag);if(z!==-1){const $=q.slice(0,z+1),B=q.slice(z+1),P=$.map(H=>String(H?.content??H?.raw??"")).join("");if(M.content=`${String(M.content??"")} -${P}`,Array.isArray(M.children)&&M.children.push(...$),B.length){const H=B.map(j=>String(j.content??j.raw??"")).join("");if(H.trim()){const j=H.replace(/^\s+/,"");if(d(M,H))h.splice(I,1),I--;else if(j.startsWith("<"))h.splice(I,1,{type:"html_block",content:j});else{const G=u(H,c(h,I,"paragraph"));h.splice(I,1,...G)}}else h.splice(I,1),I--}else h.splice(I,1),I--;N.pop();continue}M.content=`${String(M.content??"")} -${_}`,Array.isArray(M.children)&&M.children.push(...q),h.splice(I,1),I--;continue}if(S.type!=="inline")continue;const x=Array.isArray(S.children)?S.children:[];for(const E of g)if((x.length?Hhe(x,E):C(E).test(_)&&!T(E).test(_)?1:0)>0){N.push({tag:E,index:I});break}}}{let b=0;for(let w=0;w0?b--:(h.splice(w,1),w--))}}for(let b=0;b/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){w.loading=!1;continue}if(g.has(S)){const z=String(w.content??""),$=Wo(z),B=$===-1?null:eE(z,S,$+1);w.loading=B?!1:w.loading!==void 0?w.loading:!0;const P=B?.start??-1,H=B?B.end-B.start:0;if(P!==-1){const j=z.slice(0,P+H);let G="";$!==-1&&$]+)))?/g;let x;for(;(x=_.exec(w.content||""))!==null;)x[1],x[2]||x[3]||x[4];const E=String(w.content??""),M=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(E),R=M?M.index:-1,q=M?M[0].length:0;if(R!==-1){const z=E.slice(0,R+q),$=(E.slice(R+q)||"").replace(/^\s+/,"");w.children=[{type:"html_block",content:z,tag:S,loading:!1}],w.content=z,w.raw=z,$&&h.splice(b+1,0,$.startsWith("<")?{type:"html_block",content:$}:{type:"text",content:$,raw:$})}else w.children=[{type:"html_block",content:w.content,tag:S,loading:!0}];continue}if(!w||w.type!=="inline")continue;if(w.children.length===2&&w.children[0].type==="html_inline"){const S=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),_=w.children[1],x=String(_?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(_?.type==="html_inline"&&x===S)continue;m.has(S)?(w.children[0].loading=!0,w.children[0].tag=S,w.children.push({type:"html_inline",tag:S,loading:!0,content:``})):w.children=[{type:"html_block",loading:!0,tag:S,content:String(w.children[0]?.content??"")+String(w.children[1]?.content??"")}];continue}else if(w.children.length===3&&w.children[0].type==="html_inline"&&w.children[2].type==="html_inline"){const S=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(S))continue;w.children=[{type:"html_block",loading:!1,tag:S,content:w.children.map(_=>_.content).join("")}];continue}if(!w.content?.startsWith("<")||w.children?.length!==1)continue;const C=String(w.content),T=w,N=T.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(C)&&(T.children.length=0);continue}const I=String(N.content??C).match(zhe)?.[1]?.toLowerCase()??"";if(I){if(/\/\s*>\s*$/.test(C)||Xz.has(I)){T.children=[{type:"html_inline",content:C}];continue}T.children.length=0}}})}function Xhe(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function epe(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!Xhe(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const tj=/\.([a-z0-9]{1,15})$/i,tpe=/[_()[\]{}<>]/u,npe=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,ipe=/[?#@]/u,ope=/[\\/]/u,spe=/^[\p{L}\p{N}./\\-]+$/u,rpe=/^[A-Za-z0-9-]{1,63}$/u,lpe=/^xn--[a-z0-9-]{2,59}$/i,ape=/^(?:[A-Z]{1,6}|\d{1,8})$/u,upe=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,cpe=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,dpe=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,fpe=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,hpe=2e3,ppe=512,mpe={},gpe=new Set(["ai","md","py","rs","sh","zip"]),nj=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),vpe=new Set([...nj,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),ype=new Set(["com","dev","io","page","site"]),kpe=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),bpe=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),eh=new Map;function nE(e,t){if(!e||e.length>ppe)return t;for(eh.set(e,t);eh.size>hpe;){const n=eh.keys().next().value;if(!n)break;eh.delete(n)}return t}function E0(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Z3(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return E0(n)?n:void 0}function iE(e,t){if(!E0(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function oE(e){const t=kv(e);return E0(t)?t:void 0}function wpe(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function sE(e,t){if(!E0(t))return;const n=String(e??"").trim().split(/\s+/u).map(wpe).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>Q9(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>Q9(o,{marketTicker:!0}))&&(i.marketTicker=!0),E0(i)?i:void 0}function of(e,t=!1){let n;return{options(i){return t||i==null?iE(e,n):iE(e,Z3(oE(i),sE(i,n)))},remember(i){const o=oE(i);n=t?Z3(n,o):Z3(o,sE(i,n))},reset(){n=void 0}}}function rE(e){return rpe.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function Cpe(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return rE(n)||lpe.test(n)?t.every(rE):!1}function ij(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function Ape(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function xpe(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function oj(e,t,n){const i=Ape(t);return ij(e)&&xpe(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function Spe(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function kv(e){const t=String(e??""),n=eh.get(t);return n?(eh.delete(t),eh.set(t,n),n):Spe(t)?nE(t,{explicitFilename:cpe.test(t),filename:dpe.test(t),marketTicker:fpe.test(t)}):nE(t,mpe)}function _pe(e){return Cpe(e.split(/[\\/]/)[0]??"")}function Mpe(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function Ipe(e){if(tpe.test(e)||!spe.test(e))return!0;if(ope.test(e))return!_pe(e);const t=e.replace(tj,"");return ij(t)?!0:t.split(".").filter(Boolean).some(Mpe)}function Tpe(e,t,n){if(!(n?vpe:nj).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?upe:ape).test(i)}function Q9(e,t={}){if(!e||npe.test(e)||ipe.test(e))return!1;const n=e.match(tj);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return Tpe(e,i,t.marketTicker===!0)?!0:bpe.has(i)?!gpe.has(i)||t.filename?!0:Ipe(e):!!(t.explicitFilename&&ype.has(i)||t.filename&&kpe.has(i))}const sj=new WeakMap,rj=new WeakSet;function aC(e,t){return sj.set(e,t),e}function Epe(e){return sj.get(e)}function Lpe(e){rj.add(e)}function Npe(e){return e===void 0||rj.has(e)}const lE=["!"];function aE(e){return e==="linkify"||e==="autolink"?e:"recovery"}function tl(e){return{type:"text",content:e,raw:e}}function Tf(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Ef(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Wc(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return aC({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function Dpe(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(tl(t))}}function uE(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function Bpe(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function cE(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?dE(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=kv(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=dE(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const v=g.content[h],y=g.content.slice(0,h);let b=g.content.slice(h);for(let T=m+1;T0&&(e.splice(m+1,w),a=m+1);let C=c;if(v==="!"&&f!==-1)C=c.slice(0,f);else if(b){const T=encodeURI(b);if(T&&c.endsWith(T))C=c.slice(0,c.length-T.length);else{const N=v?encodeURI(v):"",I=N?c.indexOf(N):-1;I!==-1&&(C=c.slice(0,I))}}C!==c&&Bpe(l,C),b&&e.splice(a+1,0,tl(b));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Wc(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(tl(h)),e.splice(r-4,8,...a)}else a.push(aC({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(y=>y[0]==="href")?.[1]||"",d=u.find(y=>y[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const y=m[1].length;Tf(g,y)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let y=r+1;yv[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Wc(d,f,m)),Ef(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];Tf(d,2),d.push(Wc(u,c,!1)),Ef(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v{const n=t;try{const i=Qpe(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function fE(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function hE(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function pE(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function lj(e,t){if(!e.startsWith("|")||e.includes(` -`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function G3(e){return lj(e)!==null}function aj(e){return/^:?-+:?$/.test(e.trim())}function Upe(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(aj)}function Vpe(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Kpe(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(aj)&&Vpe(n)}function Zpe(e){return e==="|"||e==="|:"}function Gpe(e){const t=lj(e);return t!==null&&t.every(n=>!n.includes(":"))}function Qpe(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` -`)[0]??"",[a="",u="",...c]=r.split(` -`),d=!t&&!r.includes(` -`)&&/\r?\n$/.test(n)&&G3(r);if(!t&&(r.includes(` -`)&&c.length===0&&G3(a)&&Kpe(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>pE(m)),h=[...fE(),...f,...hE()];i.splice(o-1,3,...h)}else if(r.includes(` -`)&&c.length===0&&G3(a)&&Upe(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>pE(m)),h=[...fE(),...f,...hE()];i.splice(o-1,3,...h)}else r.includes(` -`)&&c.length===0&&Gpe(a)&&Zpe(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Ype(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var Jpe=Ype;const Xpe=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Y9=Xpe.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),e1e=/\\[a-z]+/i,uj="(?:\\\\|\\u0008)",t1e=new RegExp(String.raw`${uj}(?:${Y9})\s*\{[^}]+\}`,"i"),n1e=new RegExp(String.raw`(?:${uj})?(?:${Y9})\s*\{`,"i"),i1e=/\\(?:text|frac|left|right|times)/,o1e=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,s1e=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,r1e=/[A-Z]+\s*\([^)]+\)/i,l1e=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,a1e=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,u1e=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,c1e={"\b":"\\b","\v":"\\v","\f":"\\f"};function d1e(e){let t="";for(const n of e)t+=c1e[n]??n;return t}function cd(e){if(!e)return!1;const t=d1e(e),n=t.trim();if(u1e.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=e1e.test(t),o=t1e.test(t),s=n1e.test(t),r=i1e.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=o1e.test(t)&&!s1e.test(t),u=r1e.test(t),c=l1e.test(n),d=a1e.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const cj="__markstreamMathPluginApplied",uC=80,dj=2e4,mE=dj+4096;function i7(e){return!!e[cj]}function f1e(e){e[cj]=!0}const fj=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],h1e=["cdot","mathbf{","partial","mu_{"],hj=fj.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pj="[ \r\b\f\v]",p1e=new RegExp(`([^\\\\])(${h1e.map(e=>e).join("|")})+`,"g"),m1e=/span\{([^}]+)\}/,g1e=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,v1e=/(^|[^\\])\\\r?\n/g,y1e=/(^|[^\\])\\$/g,k1e=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,b1e=new RegExp(`(${pj})|(${hj})\\b`,"g"),gE=new Map,vE=new Map;function w1e(e){if(!e)return b1e;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=gE.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${pj})|(${o})\\b`,"g");return gE.set(n,s),s}function C1e(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=vE.get(i);if(o)return o;const s=e?[Y9,hj].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Y9].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return vE.set(i,r),r}const yE={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function kE(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function A1e(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&k1e.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function bE(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function qc(e,t){const n=t?.commands??fj,i=t?.escapeExclamation??!0,o=t?.commands==null,s=w1e(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&yE[c]!==void 0)return`\\${yE[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=A1e(r));let l=r;const a=C1e(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(m1e,"span\\{$1\\}").replace(g1e,"\\operatorname{span}\\{$1\\}"),l=l.replace(v1e,`$1\\\\ -`),l=l.replace(y1e,"$1\\\\"),l=l.replace(p1e,"$1\\$2"),l}function wE(e){const t=e.trim();return!(!cd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function mj(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function cC(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=J9(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}bv(e,a)||s++,r=a+Math.max(1,t.length)}return s}function o7(e,t,n){const i=N0(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!N0(i.slice(0,o)).trim()||bv(i,o))return-1;const s=mj(i);if(J9(s,o))return-1;const r=CE(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>CE(i,n,0,o,s))return-1;return o}function L0(e){return e===" "||e===" "}function N0(e){let t=e.length;for(;t>0&&L0(e[t-1]);)t--;return e.slice(0,t)}function AE(e){let t=0;for(let n=0;n=48&&t<=57}function S1e(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function _1e(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function M1e(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(_1e)}function I1e(e){let t=0;if(!xE(e[t]))return!1;for(;xE(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:L0(e[t+1])}function gj(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&L0(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&L0(t[1])||I1e(t)||S1e(t)||M1e(t))}function SE(e,t){return e?t?`${e} -${t}`:e:t}function dC(e){const t=String(e??"").trim();return t?cd(t):!1}function _E(e){let t=0;for(let n=0;nuC){h=!0;break}const g=o[m],v=Tp(g,c);if(v!==-1){const y=SE(f,g.slice(0,v));if(!dC(y)){h=!0;break}const b=g.slice(v+c.length),w=b.trim()?`suffix:${_E(b)}`:"nosuffix";return["closed",u,i+l,d,i+m,v,_E(y),w].join(":")}if(gj(g)){h=!0;break}if(f=SE(f,g),f.length>dj){h=!0;break}}if(!h&&dC(f))return["pending",u,i+l,d].join(":")}}return null}function Y3(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function E1e(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function J3(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function L1e(e,t){f1e(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(b,w)=>{let C=w;for(;C=3&&(!C||/\s/.test(C))){const T=a.push("text","",0);return T.content=a.src.slice(a.pos,b),a.pos=b,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,v=m;const y=m;for(const[b,w]of f){const C=a.src,T=mj(C),N=x1e(C,c);let I=!1;b==="$$"&&g!==y&&(g=y);let S=-1,_=-1,x=0;const E=M=>{if((M==="undefined"||M==null)&&(M=""),M==="\\"){a.pos=a.pos+M.length,g=a.pos;return}if(M==="\\)"||M==="\\("){const z=a.push("text_special","",0);z.content=M==="\\)"?")":"(",z.markup=M,a.pos=a.pos+M.length,g=a.pos;return}if(!M)return;if(b==="$$"&&M.includes("$")){let z=0;for(;z0&&M[$-1]==="$"||$+10){const B=M.slice(0,R),P=a.push("text","",0);P.content=B,a.pos=a.pos+B.length,g=a.pos}const z=M.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(z){const[,B,P]=z,H=P.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),j=H?H[1]:P,G=H&&H[2]?H[2]:null,ne=a.push("image","img",0);ne.attrs=[["src",j],["alt",B]],G&&ne.attrs.push(["title",G]),ne.content=B,ne.children=[{type:"text",content:B,tag:""}],a.pos=a.pos+z[0].length,g=a.pos;const W=M.slice(R+z[0].length);W&&E(W);return}const $=a.push("text","",0);$.content=M,a.pos=a.pos+M.length,g=a.pos;return}const q=a.push("text","",0);q.content=M,a.pos=a.pos+M.length,g=a.pos};for(;!(g>=C.length);){const M=C.indexOf(b,g);if(M===-1)break;if(bv(C,M)){g=M+Math.max(1,b.length);continue}const R=J9(T,M);if(R){g=R[1];continue}const q=J9(N,M);if(q){g=q[1];continue}if(M===S&&g===_){if(x++,x>2){g=M+Math.max(1,b.length);continue}}else x=0,S=M,_=g;if(b==="("&&M>0){let W=M-1;for(;W>=0&&C[W]===" ";)W--;if(W>=0&&C[W]==="]"){g=M+b.length;continue}}if(b==="$"&&M>0&&C[M-1]==="$"){g=M+1;continue}if(b==="$"&&M=C.length);){const R=cC(C,M);if(R===-1)break;if(R+10&&C[R-1]==="$"){M=R+1;continue}const q=Q3(C,R+1);if(q===-1)break;const z=C.slice(R+1,q),$=z.includes("`"),B=!z||!z.trim(),P=C[q+1],H=Y3(z,P),j=J3(z);if(!$&&!B&&!H&&!j){const G=C.slice(g,R);G&&E(G);const ne=a.push("math_inline","math",0);ne.content=qc(z,t),ne.markup="$",ne.raw=`$${z}$`,ne.loading=!1,g=q+1,M=q+1}else E("$"),M=R+1}M{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),v=!1,y="",b="",w=!1,C="",T=!1;for(const[G,ne]of h)if(g.startsWith(G))if(G.includes("[")){const W=G==="\\["?g.slice(G.length):"";if(G==="\\["&&Tp(W,ne)===-1&&!/^\s*!\[/.test(W)&&!W.includes("`")&&cd(W)){v=!0,y=G,b=ne;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":b,x=S>=0?S:Tp(g,b,I);if(!w&&x>y.length){const G=g.slice(N+y.length,x),ne=c.push("math_block","math",0);ne.content=qc(G),ne.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",ne.map=[l,l+1],ne.raw=`${y}${G}${_}`,ne.block=!0,ne.loading=!1,c.line=l+1;const W=g.slice(x+_.length);return W.trim()&&n(c,W,l),!0}let E=l,M="",R=!1,q="",z=l;const $=w?g:g===y?"":g.slice(y.length),B=!f&&y==="\\["?"]":"",P=Tp($,b);if(P!==-1){const G=P;M=$.slice(0,G),q=$.slice(G+b.length),z=w?l+1:l,R=!0,E=z}else for($&&!w&&(M=$),E=l+1;E{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function N1e(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
          ${e.utils.escapeHtml(String(o.content??""))}
          `})}const D1e=/^\s]/i,F1e=/^<\/a\s*>/i;function B1e(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");D1e.test(r)&&i>0&&i--,F1e.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function R1e(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>B1e(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function O1e(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function $1e(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new dhe({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!ph(l,{tagName:"a",attrName:"href"});Lpe(r),s.set({validateLink:r})}return O1e(s),R1e(s),(e.enableMath??!0)&&L1e(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&Lhe(s),e.enableFixIndentedCodeBlock!==!1&&epe(s),Rpe(s),zpe(s),$pe(s),qpe(s),N1e(s),Jhe(s,{customHtmlTags:e.customHtmlTags}),s}function mh(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>mh(n))),t}function P1e(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function z1e(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function j1e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function N2(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function ME(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function IE(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function U1e(e,t){const n=[],i=[],o=[],s=[],r=e.split(W1e),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!kj.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(IE(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(IE(g,a))}else{ME(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&ME(n,i,o,s);const d=n.join(` -`),f=i.join(` -`);return{original:t&&l&&d?`${d} -`:d,updated:t&&l&&f?`${f} -`:f}}function s7(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=H1e(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=U1e(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function V1e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function K1e(){return{type:"hardbreak",raw:`\\ -`}}function Z1e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||$d.has(e)}function G1e(e){if(!e||e.length===0)return TE();const t=e8.get(e);if(t)return t;const n=e.map(Ca).filter(Boolean);if(!n.length){const o=TE();return e8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:Bk({customHtmlTags:e})};return e8.set(e,i),i}function Aj(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function Q1e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function X9(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function Y1e(e,t,n){const i=e.slice();return X9(i,"href")||i.push(["href",t]),n!=null&&!X9(i,"title")&&i.push(["title",n]),i}function fC(e){return e.map(Aj).join("")}function Fy(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:Fy(i.children)});continue}t.push(i)}return t}function J1e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(T.toLowerCase())||(g+=T),y=!0,v=!0}const b=[],w=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let C;for(;(C=w.exec(l))!==null;){const T=C[1],N=C[2]||C[3]||C[4]||"";b.push([T,N])}if(u?.has(a)){const T=Q1e(e);return[{type:a,tag:a,attrs:b,content:T?T.inner:h.innerTokens.length?fC(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:T?.raw??g,loading:e.loading||v,autoClosed:y},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:g,children:m,raw:g,loading:v,autoClosed:y},h.nextIndex]}function xj(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>xj(t)).join(""):String(e.content??"")}function eme(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>xj(t)).join("")}function EE(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=eme(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function tme(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function nme(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function ome(e,t,n){const i=e.slice();return e4(i,"href")||i.push(["href",t]),n!=null&&!e4(i,"title")&&i.push(["title",n]),i}function D2(e,t,n){const i=e[t],o=ime(i.attrs),s=String(e4(o,"href")??""),r=e4(o,"title"),l=r==null?null:String(r),a=ome(o,s,l);let u=t+1;const c=[];let d=!0;for(;uv.type==="strong_open")){const v=String(h.content??""),y=String(h.raw??v),b=mh(h);b.content=v.slice(0,-2),b.raw=y.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=b}const m=Eo(f,void 0,void 0,n),g=m.map(v=>{const y=v;return"content"in v?String(y.content??""):String(y.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,vme=/\p{P}/u,yme=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,kme=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,bme=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,wme=/:\/\//,hC=1,Sj=2,Cme=4,Ame=8,_j=16,Qc=32,By=64,rg=128,Mj=256,xme=512,lg=1024,Sme=1982;function F2(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Pd(e){return!!e&&mme.test(e)}function zd(e){return!!e&&(gme.test(e)||vme.test(e))}function Tj(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&yme.test(e)}function Ej(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&kme.test(e)}function Mme(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||Pd(i)?!1:!(zd(i)&&!Tj(i,n)&&n&&!Pd(n)&&!zd(n))}function Ime(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||Pd(n)?!1:!(zd(n)&&!Ej(n,i)&&i&&!Pd(i)&&!zd(i))}function Tme(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||Pd(i)?!1:!(zd(i)&&!Tj(i,n)&&n&&!Pd(n)&&!zd(n))}function Lme(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||Pd(n)?!1:!(zd(n)&&!Ej(n,i)&&i&&!Pd(i)&&!zd(i))}function Nme(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const Rme=/[\p{L}\p{N}]/u,Ome=/^[\p{L}\p{N}]+$/u;function pC(e){return e?Rme.test(e):!1}function Lj(e){return e?Ome.test(e):!1}function $g(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function jme(e){return e?bme.test(e)||wme.test(e):!1}function Hme(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Eo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=kv(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(Z,ae){const K=e.length===1?t:String(ae.content??""),re=[],we=$me(Z);if(we!==-1){T(Z.slice(0,we),Z.slice(0,we));const ke=Z.slice(we);return ke&&(E({type:"text",content:ke,raw:ke}),c--),c++,!0}if(dme.test(Z)){const ke=Z.indexOf("~~");ke!==-1&&re.push({type:"strikethrough",index:ke})}if(fme.test(Z)){const ke=Z.indexOf("**");ke!==-1&&re.push({type:"strong",index:ke})}if(/[^*]*\*[^*]+/.test(Z)){const ke=K?Ij(K,0):Z.indexOf("*");if(K&&ke===-1)return!1;ke!==-1&&re.push({type:"emphasis",index:ke})}re.sort((ke,oe)=>ke.index!==oe.index?ke.index-oe.index:ke.type===oe.type?0:ke.type==="strong"?-1:oe.type==="strong"?1:0);const be=re[0];if(!be)return!1;if(be.type==="strikethrough"){const ke=be.index,oe=ke>-1?Z.slice(0,ke):"";if(oe&&T(oe,oe),ke===-1)return c++,!0;const le=Z.indexOf("~~",ke+2),ye=le===-1?Z.slice(ke+2):Z.slice(ke+2,le),Ae=le===-1?"":Z.slice(le+2),{node:Me}=NE([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ye,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),C(Me),Ae&&(E({type:"text",content:Ae,raw:Ae}),c--),c++,!0}if(be.type==="strong"){const ke=be.index,oe=ke>-1?Z.slice(0,ke):"";if(oe&&T(oe,oe),ke===-1)return c++,!0;if(t&&ke===0){let ie=!1,Ee=0;for(;Ee=2)return T(Z,Z),c++,!0}}if(t&&(Z.match(/\*/g)||[]).length>_me(t))return T(Z.slice(oe.length),Z.slice(oe.length)),c++,!0;const le=$g(Z,ke);if(le.len>=3){const ie=zme(Z,ke+le.len);if(ie!==-1){const Ee=Z.slice(ke+le.len,ie);if(Pme(Ee)){const{node:qe}=Om([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ee,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),C(qe);const ze=Z.slice(ie+3);return ze&&(E({type:"text",content:ze,raw:ze}),c--),c++,!0}}}if(!Eme(Z,ke)){const ie=Z.slice(ke,ke+le.len);T(ie,ie);const Ee=Z.slice(ke+le.len);return Ee&&(E({type:"text",content:Ee,raw:Ee}),c--),c++,!0}const ye=Nme(Z,ke+2);let Ae="",Me="";if(ye.index!==-1){Ae=Z.slice(ke+2,ye.index),Me=Z.slice(ye.index+2);const ie=ye.index,Ee=$g(Z,ie);if(le.intraword&&Ee.intraword&&!Lj(Ae)||!Ae&&le.len>=4&&le.intraword)return T(Z.slice(oe.length),Z.slice(oe.length)),c++,!0}else{if(d||ye.sawInvalidClose||le.intraword)return T(Z.slice(oe.length),Z.slice(oe.length)),c++,!0;Ae=Z.slice(ke+2),Me=""}if(!Ae&&/^\*+$/.test(Me))return T(Z,Z),c++,!0;const{node:fe}=Om([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:Ae,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),C(fe),Me&&(E({type:"text",content:Me,raw:Me}),c--),c++,!0}if(be.type==="emphasis"){let ke=be.index;ke===-1&&(ke=0);const oe=Z.slice(0,ke);if(oe&&T(oe,oe),!Mme(Z,ke)){T(Z[ke],Z[ke]);const ie=Z.slice(ke+1);return ie&&(E({type:"text",content:ie,raw:ie}),c--),c++,!0}const le=$g(Z,ke),ye=Tme(K,Z,ke+1),Ae=ye.index,Me=e[c+1];if(i?.final&&Me?.type==="em_open"&&Ae!==-1&&Z.slice(ke+1,Ae).trim()!==Z.slice(ke+1,Ae)||Ae===-1&&(ye.sawInvalidClose||i?.final||le.intraword||!pC(Z[ke+1])))return T(Z.slice(ke),Z.slice(ke)),c++,!0;const{node:fe}=N2([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ae>-1?Z.slice(ke+1,Ae):Z.slice(ke+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),C(fe),Ae!==-1&&Ae{for(let fe=0;fe=0&&Me[Ee]==="\\";Ee--)ie++;if(ie%2===0)return fe}return-1})(Z);if(re===-1)return!1;let we=1;for(let Me=re+1;Mebe?.type==="math_inline")||!hme.test(Z))return null;const K=ae.parseInline(Z,{__markstreamFinal:!!i?.final});if(!Array.isArray(K)||K.length===0)return null;const re=(K.find(be=>be?.type==="inline")?.children??[]).filter(be=>!(be?.type==="text"&&String(be.content??"")===""));if(!re.length||!re.some(be=>be?.type!=="text")||re.length===1&&re[0]?.type==="text"&&String(re[0].content??"")===Z)return null;const we=Eo(re,Z,n,i);return we.length?we:null}function b(Z){m(),a.push(Z)}function w(Z){m();const ae=mh(Z);a.push(ae)}function C(Z){b(Z)}function T(Z,ae){u?(u.content+=Z,u.raw+=ae??Z):(u={type:"text",content:String(Z??""),raw:String(ae??Z??"")},a.push(u))}function N(Z,ae){if(!Z)return;const K=Eo([{...ae,type:"text",content:Z,raw:Z}],Z,n,i);if(K.length===1&&K[0]?.type==="text"){const re=K[0];T(String(re.content??""),String(re.raw??re.content??""));return}for(const re of K)C(re)}function I(Z,ae){return String(Z.markup??"").startsWith(ae)}function S(Z){if(!u||Z.loading!==!0||Z.markup!=="\\(\\)")return;const ae=e[c-1];!ae||ae.type!=="text"||!I(ae,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function _(Z){return Z.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function x(Z,ae,K=F2(Z)){let re=Z;const we=String(ae.content??"");return(K&hC)!==0&&re.endsWith("\\")&&!I(ae,"\\\\")&&!we.endsWith("\\\\")&&(re=re.slice(0,-1)),(K&lg)!==0&&re.endsWith("(")&&!I(ae,"\\(")&&!we.endsWith("\\(")&&(re=re.slice(0,-1)),(K&Sj)!==0&&/\*+$/.test(re)&&!I(ae,"\\*")&&!we.endsWith("\\*")&&(re=re.replace(/\*+$/,"")),re}for(;c=0;ie--){const Ee=a[ie];if(Ee.type!=="text")break;le=ie,ye=String(Ee.content??"")+ye}lele==="href")?.[1],oe=String(ke??"");if(t&&oe){const le=t.indexOf("](");if(le!==-1){const ye=t.indexOf(")",le+2);ye===-1?K.loading=!0:K.loading&&t.slice(le+2,ye).includes(oe)&&(K.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(K.href)&&j(K,ae-1)||B(K)||b(K)}function z(Z){if(Z.markup!=="linkify")return!1;const{node:ae,nextIndex:K}=D2(e,c,i);return H(ae,K)?(c=K,!0):!1}function $(Z){m(),C(sme(Z)),c++}function B(Z){if(Z.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const K=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!K)return!1;const re=Z,we=String(re.href??""),be=String(re.text??""),ke=String(K[2]??""),oe=we.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!we||!(be===we||be===oe||jme(be)))return!1;const le=String(K[1]??"");return le?(ae.content=le,ae.raw=le):a.pop(),b({...Z,text:ke,children:[{type:"text",content:ke,raw:ke}],raw:`[${ke}](${we}${re.title?` "${re.title}"`:""})`}),!0}function P(Z){if(Z.type!=="link")return!1;const ae=Z,K=String(ae.href??"");return K?H({href:K,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},c+1):!1}function H(Z,ae){const K=a[a.length-1];if(K?.type!=="image"||K.src||!K.loading||!String(K.raw??"").endsWith("]("))return!1;const re=e[ae],we=String(re?.content??"");if(re?.type!=="text"||!we.startsWith(")"))return!1;a.pop(),u=null;const be=String(K.alt??"");b({type:"image",src:Z.href,alt:be,title:Z.title,raw:`![${be}](${Z.href}${Z.title?` "${Z.title}"`:""})`,loading:!!Z.loading});const ke=we.slice(1),oe=mh(re);return oe.content=ke,oe.raw=ke,h()[ae]=oe,!0}function j(Z,ae=c-1){if(Z.type!=="link")return!1;const K=a[a.length-1],re=e[ae];if(!K||K.type!=="text"||re?.type!=="text")return!1;const we=String(K.content??""),be=String(re.content??"");if(!we.endsWith("!")||!be.endsWith("!")||I(re,"\\!"))return!1;const ke=we.slice(0,-1);ke?(K.content=ke,K.raw=ke,u=K):(a.pop(),u=null);const oe=Z,le=String(oe.text??oe.children?.map(Me=>String(Me?.content??Me?.raw??"")).join("")??""),ye=String(oe.href??""),Ae=oe.title==null||oe.title===""?null:String(oe.title);return b({type:"image",src:ye,alt:le,title:Ae,raw:`![${le}](${ye}${Ae?` "${Ae}"`:""})`,loading:!!oe.loading}),!0}function G(Z,ae="",K=null){const re=String(Z.alt??Z.raw??"");return{type:"link",href:ae,title:K,text:re,children:[Z],raw:`[${re}](${ae}${K?` "${K}"`:""})`,loading:!0}}function ne(Z){const ae=Z.startsWith("![")?Z:`![${Z}`,K=ae.slice(2),re=K.indexOf("](");return{type:"image",src:"",alt:re===-1?K.replace(/\]$/,""):K.slice(0,re),title:null,raw:ae,loading:!0}}function W(Z){const ae=Z.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&Bme(t,ae,"["))return!1;const K=Z.slice(0,ae);return K&&T(K,K),b(G(ne(Z.slice(ae+1)))),c++,!0}function Q(Z){if(i?.final)return!1;const ae=e[c-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||I(ae,"\\["))return!1;const K=a[a.length-1];if(K?.type==="text"&&K.content.endsWith("[")){const re=K.content.slice(0,-1);re?(K.content=re,K.raw=re,u=K):(a.pop(),u=null)}return b(G(EE(Z))),c++,!0}function te(Z){if(Z.type!=="link")return!1;const ae=Z,K=String(ae.raw??""),re=String(ae.text??"");if(!K.startsWith("[![")&&!re.startsWith("!["))return!1;const we=ae.title==null||ae.title===""?null:String(ae.title);return b(G({type:"image",src:String(ae.href??""),alt:re.replace(/^!\[/,"").replace(/\]$/,""),title:we,raw:K.startsWith("[![")?K.slice(1):K,loading:!0})),!0}function X(Z){if(!Z.startsWith("]("))return!1;const ae=e[c-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&I(ae,"\\["))return!1;const K=a[a.length-1];if(K?.type!=="image"&&K?.type!=="link")return!1;const re=K,we=K?.type==="link"&&Array.isArray(re.children)&&re.children.length===1&&re.children[0]?.type==="image"?a.pop():null,be=we?we.children[0]:a.pop();if(!be||be.type!=="image")return!1;const ke=e[c+1];let oe=String(we?.href??""),le=we?.title==null?null:String(we.title),ye=!0;if(ke?.type==="link_open"){const{node:Me,nextIndex:fe}=D2(e,c+1,i);oe=Me.href,le=Me.title,ye=!0,c=fe}else{if(oe=Z.slice(2),oe.includes('"')){const Me=oe.split('"');oe=String(Me[0]??"").trim(),le=Me[1]==null?null:String(Me[1]).trim()}c++}const Ae=G(be,oe,le);return Ae.loading=ye,b(Ae),!0}function ve(){const Z=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&Z?.type==="text"&&String(Z.content??"").endsWith("[")&&I(Z,"\\[")}function ce(Z,ae){const K=Z.indexOf("[");if(K===-1)return!1;let re=Z.slice(0,K);const we=Z.indexOf("](",K);if(we!==-1){const be=e[c+2];let ke=Z.slice(K+1,we);if(ke.includes("[")){const ie=ke.indexOf("[");re+=Z.slice(0,K+ie+1);const Ee=K+ie+1;ke=Z.slice(Ee+1,we)}const oe=e[c+1];if(Z.endsWith("](")&&oe?.type==="link_open"&&be){const ie=e[c+4];let Ee=4,qe=!0;if(ie?.type==="text"){const ht=String(ie.content??"");if(ht.startsWith(")")){qe=!1;const gt=ht.slice(1);if(gt){const _t=mh(ie);_t.content=gt,_t.raw=gt,h()[c+4]=_t}else Ee++}else ht==="."&&Ee++}N(re,ae);const ze=String(be.content??"");return i?.validateLink&&!i.validateLink(ze)?T(ke,ke):b({type:"link",href:ze,title:null,text:ke,children:[{type:"text",content:ke,raw:ke}],loading:qe}),c+=Ee,!0}const le=Z.indexOf(")",we),ye=le!==-1?Z.slice(we+2,le):"",Ae=le===-1;let Me=re.match(/\*+$/);if(Me&&(re=re.replace(/\*+$/,"")),N(re,ae),Me||(Me=ke.match(/^\*+/)),!d&&Me){const ie=Me[0].length;ke=ke.replace(/^\*+/,"").replace(/\*+$/,"");const Ee=[];if(ie===1?Ee.push({type:"em_open",tag:"em",nesting:1}):ie===2?Ee.push({type:"strong_open",tag:"strong",nesting:1}):ie===3&&(Ee.push({type:"strong_open",tag:"strong",nesting:1}),Ee.push({type:"em_open",tag:"em",nesting:1})),Ee.push({type:"link",href:ye,title:null,text:ke,children:[{type:"text",content:ke,raw:ke}],loading:Ae}),ie===1){Ee.push({type:"em_close",tag:"em",nesting:-1});const{node:qe}=N2(Ee,0,i);C(qe)}else if(ie===2){Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:qe}=Om(Ee,0,void 0,i);C(qe)}else if(ie===3){Ee.push({type:"em_close",tag:"em",nesting:-1}),Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:qe}=Om(Ee,0,void 0,i);C(qe)}else{const{node:qe}=N2(Ee,0,i);C(qe)}}else i?.validateLink&&!i.validateLink(ye)?T(ke,ke):b({type:"link",href:ye,title:null,text:ke,children:[{type:"text",content:ke,raw:ke}],loading:Ae});const fe=le!==-1?Z.slice(le+1):"";return fe&&(E({type:"text",content:fe,raw:fe}),c--),c++,!0}return!1}function se(Z){const ae=Z.indexOf("![");if(ae===-1)return!1;const K=Z.slice(0,ae);return K&&!u?u={type:"text",content:K,raw:K}:K&&u&&(u.content+=K),u&&(a.push(u),u=null),b(ne(Z.slice(ae))),c++,!0}function pe(Z){if(!(Z?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=Z.slice(1).match(/[^\s\]]/);if(ae===null)return c++,!0;if(ae&&/x/i.test(ae[0])){const K=ae[0]==="x"||ae[0]==="X";return b({type:"checkbox_input",checked:K,raw:K?"[x]":"[ ]"}),c++,!0}return!1}return a}function l7(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function DE(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` -`&&r++,{startLine:s,endLine:r}}function D0(e,t,n,i){const o=Wme(e,t,n);return l7(o.startLine,o.endLine,i)}function qme(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:l7(i,o,t)}function Si(e,t,n){if(!n?.includeSourceMap)return e;const i=qme(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function Ume(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=l7(s,Math.max(r,l),i)),e}function Vme(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Kme(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Zme(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function G1(e,t,n){const i=e[t],o=[],s=of(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Si(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` -`)};return n?.includeSourceMap&&Si(l,i,n),[l,r+1]}function Gme(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=of(i,!0);let a=t+1;for(;au.raw).join(` -`)} -:::`},a+1]}const Qme=new Set(["warning","info","note","tip","danger","caution"]);function Yme(e){let t=0;for(;t=0;g--){const v=f[g];if(v.type==="text"&&/:+/.test(v.content)){h=g;break}}const m={type:"paragraph",children:Eo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Si(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=G1(e,u,a.options());n?.includeSourceMap&&Si(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=Q1(e,u,a.options());n?.includeSourceMap&&Si(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=Nk(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} -${l.map(d=>d.raw).join(` -`)} -:::`},u+1]}const Xme=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function ege(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Xme.exec(String(i.info??""));return o?Gme(e,t,o,n):null}const a7={parseContainer:(e,t,n)=>Jme(e,t,n),matchAdmonition:ege};function Q1(e,t,n){const i=[],o=of(n,!0);let s=t+1;for(;sl.raw).join(` -`)};return n?.includeSourceMap&&Si(r,e[t],n),[r,s+1]}function tge(e){if(e.info?.startsWith("diff"))return s7(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function nge(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=of(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` -`)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` -`)},o+1]}function ige(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=of(n,!0);let l=t+1;for(;la.raw).join(` -`)}`},l+1]}function oge(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:Eo(a.children||[],u,void 0,n),raw:u}}function sge(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function Nj(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!v.includes(">");else if(u)u=!v.includes("?>");else if(v.startsWith("");else if(v.startsWith("");else if(v.startsWith("");else{const y=o(v);if(y)if(y.closing){for(let b=r.length-1;b>=0;b--)if(r[b]===y.tag){r.length=b;break}}else y.selfClosing||s(y.after,y.tag)||r.push(y.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function qge(e,t,n){if(!n?.length)return!1;const i=new Set(Uh(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const v=c.indexOf(">",d);if(v===-1)return null;let y=v-1;for(;y>=0&&s(c[y]);)y--;return{closing:f,tag:m,selfClosing:!f&&c[y]==="/",after:c.slice(v+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=Y1(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let v=a.length-1;v>=0;v--)if(a[v]===g.tag){a.length=v;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function Uge(e,t){const n=wge.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` -`,o),r=e.slice(o,s===-1?e.length:s);return!Y1(r.endsWith("\r")?r.slice(0,-1):r)||Hj(e,o)||Wge(e,o)||qge(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function m7(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!ku(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!ku(e,l)){const a=m7(e,s,"`"),u=Wj(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!ku(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!ku(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function Vge(e,t){if(!i7(t))return e;const n=t,i=$E.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?qj(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:Fk(e).state;$E.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` -`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return cd(l)&&!c?e:e.slice(0,r)}function Kge(e,t,n,i,o){const s=d7(e),r=f7(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&h7(e)==null&&r8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&r8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return HE(e,t,n,i,o)}else return HE(e,t,n,i,o);return!1}function Fk(e,t=$ge(),n=null,i=!1,o=0){const s=zg(t);let r=zg(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);Kge(h,s,o+u,n,i)&&(a=!0),d?(r=zg(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function qj(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:zg(e.committedContext),context:zg(e.context),lineBuffer:e.lineBuffer+t}}:Fk(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function Zge(e,t){if(!i7(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=Dk.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?qj(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):Fk(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!Hge(o.source,r)&&!zge(t)){o.source=t,o.explicitBracketMath=a;return}const c=T1e(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),Pge(e,t,c,a)}function Gge(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function Uj(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function Qge(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function VE(e){return{type:"paragraph",children:e,raw:e.map(e0e).join("")}}function KE(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function ZE(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=Dge(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(VE(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(VE(u)),a}function t0e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function jg(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function n0e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ga(t)}\s*>\s*$`,"i").test(n)}const a8=new Set(["iframe","script","style","textarea","title"]);function wv(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}const h=Wo(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let v=g.slice(1).trimStart();const y=v.startsWith("/");y&&(v=v.slice(1).trimStart());const b=v.match(/^([A-Z][\w:-]*)/i);return b?.[1]?{closing:y,end:m,selfClosing:/\/\s*>$/.test(g),tag:b[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Ga(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const v=o(g.index);return v?{start:g.index,end:v.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(a8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} -`}function GE(e){return e.replace(/\r\n/g,` -`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function s0e(e,t,n){return n?e.includes(n,t)?!0:GE(e.slice(Math.max(0,t))).includes(GE(n)):!1}function r0e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function Kj(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const a0e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),u0e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function c0e(e){return/\n\s*\n/.test(e)||u0e.test(e)}function d0e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>a0e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!c0e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function f0e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=wv(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function h0e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=OE.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:r1(u,t,n));return OE.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function p0e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||Vz.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=Wo(l);if(a===-1)return o;const u=wv(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=Kj(n,i),m=d?null:f0e(f),g=m?h0e(m,t,h,i):r1(f,t,h);return d0e(f,g)?{...o,children:g}:o})}function m0e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function r1(e,t,n){return e.trim()?Gj(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function g0e(e,t,n){const i=r1(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function v0e(e,t,n){const i=Nj({content:e}),o=Wo(e),s=Vj(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=g0e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function y0e(e,t,n){const i=Wo(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=wv(o,"summary",0);if(!s)return r1(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...r1(r,t,n),v0e(s.raw,t,n),...r1(l,t,n)]}function Zj(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const j=Vj(f,"details");return j!==-1?f.slice(0,j):f})():f,[w]=Zj(y?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),C=y0e(b,n,Kj(i,o)),T=g===-1?"":String(e[g].raw??jg(e[g])??""),N=y||g!==-1&&v?.closed===!0,I=T.replace(/[\t\r\n ]+$/,""),S=N?(()=>{const j=(v?.raw??"").lastIndexOf(I);return j===-1?t.length:h+j})():t.length,_=Wo(f),x=y&&_!==-1?h+_+1:h+f.length,E=t.slice(x,S===-1?t.length:S),M=n.parse(E,{__markstreamFinal:o}),R=n.renderer.render(M,n.options,{__markstreamFinal:o}),q=S+I.length,z=N?Math.max(S+T.length,r0e(t,q)):t.length,$=N?t.slice(S,z):T,B=N?t.slice(h,z):t.slice(h),P=y&&_!==-1?f.slice(0,_+1):f,H={...u,tag:"details",attrs:Lk(f.slice(0,_+1)),raw:B,content:`${P}${R}${$}`,children:[...C,...w],loading:!o&&!N};if(i.includeSourceMap&&(H.sourceMap=D0(t,h,N?z:t.length,i)),r.push(H),l=N?z:t.length,g===-1&&!y)break;g!==-1&&(a=g)}return[r,l]}function k0e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&_.end<=d.end){o.splice(N,1);continue}break}T=S+I.length,o.splice(N,1)}}return o}function b0e(e){const t=l=>l===" "||l===" "||l===` -`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const v=g.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122},c=g=>{const v=g.charCodeAt(0);return v>=48&&v<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||v==='"'||v==="'"||v==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>Hj(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` -`||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` -`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function YE(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let v=0;v=4)return!0;continue}if(y===" ")return!0;break}return!1},r=m=>{let g=!1,v=!1;for(let y=0;y")return y}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const v=m.replace(/^[ \t]+/,"");if(!v||v.startsWith(">")||v.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(v))return-1;let y=!1,b=0;for(;b=T.length){y=!0,b++;continue}const I=T[N];if(I==="!"||I==="?"){y=!0,b+=C+1;continue}if(I==="/"){y=!0,b+=C+1;continue}const S=N;for(;N"&&x!=="/"){y=!0,b++;continue}const E=new RegExp(String.raw`<\s*\/\s*${_}\s*>`,"i"),M=/\/\s*>$/.test(T),R=E.test(m.slice(b+C+1)),q=E.test(e.slice(g+b+C+1)),z=/[\r\n]/.test(e.slice(g+b+C+1));if(y&&n.has(_)&&!M&&!R&&(q||z))return b;y=!0,b+=C+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",y=g?v?m-1:m:e.length,b=e.slice(h,y),w=g?v?`\r -`:` -`:"",C=l(b);let T=b;if(!u&&!C){const N=a(b,h);if(N!==-1){const I=w||` -`;T=`${b.slice(0,N).replace(/[ \t]+$/,"")}${I}${I}${b.slice(N).replace(/^[ \t]+/,"")}`}}f+=T,f+=w,C&&(u?C.markerChar===c&&C.markerLen>=d&&/^\s*$/.test(C.rest)&&(u=!1,c="",d=0):(u=!0,c=C.markerChar,d=C.markerLen)),h=g?m+1:e.length}return f}function C0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let v=g+1;for(;v=d.length||d[v]!=="/"){g=d.indexOf("<",g+1);continue}for(v++;vd.length){g=d.indexOf("<",g+1);continue}let y=!0;for(let w=0;w="A"&&C<="Z"?String.fromCharCode(C.charCodeAt(0)+32):C)!==m[w]){y=!1;break}}if(!y){g=d.indexOf("<",g+1);continue}let b=v+m.length;if(b")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=a(m),u+=f?`\r -`:` -`,c=d+1}return u}function A0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,v=e.slice(d,g),y=h?m?`\r -`:` -`:"",b=o(v),w=b?.prefix??"",C=b?.content??v,T=s(C);T&&(l?T.markerChar===a&&T.markerLen>=u&&/^\s*$/.test(T.rest)&&(l=!1,a="",u=0):(l=!0,a=T.markerChar,u=T.markerLen));let N=C;if(!l&&N.includes("{if(E.replace(/^[\t ]+/,"").startsWith("|"))return S;const M=E.slice(0,x).replace(/^[\t ]+/,"");if(M.length>0){const R=_.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",q=M.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!R||!q||R!==q)return S}return`${_} - -`});if(w){const I=w+N.split(` -`).join(` -${w}`);c+=I}else c+=N;c+=y,d=h?f+1:e.length}return c}function x0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(M=>String(M??"").toLowerCase()));if(!n.size)return e;const i=M=>M===" "||M===" ",o=M=>{if(!M)return!1;if(M[0]===" ")return!0;let R=0;for(let q=0;q=4)return!0;continue}if(z===" ")return!0;break}return!1},s=M=>{const R=M.charCodeAt(0);return R>=65&&R<=90||R>=97&&R<=122||R>=48&&R<=57||M==="_"||M==="-"||M===":"},r=M=>{let R=0;for(;R{let R=0,q=!1,z=0;for(;R=M.length||M[R]!==">")break;for(q=!0,R++;Rr(M).startsWith("<"),u=M=>{for(let R=0;R{if(o(M))return"";const R=r(M);if(!R.startsWith("<"))return"";let q=1;for(;q=R.length||R[q]==="/"||R[q]==="!"||R[q]==="?")return"";const z=q;for(;q"&&B!=="/"?"":$},d=M=>{if(o(M))return null;const R=r(M);if(!R.startsWith("<"))return null;let q=1;for(;q=R.length)return null;const z=R[q]==="/";if(z)for(q++;q"&&H!=="/")return null;if(z)return{type:"close",name:P};if(/\/\s*>\s*$/.test(R))return{type:"open",name:P,complete:!0};const j=R.indexOf(">",q);if(j!==-1){const G=R.slice(j+1);if(new RegExp(`<\\s*\\/\\s*${P}\\s*>`,"i").test(G))return{type:"open",name:P,complete:!0}}return{type:"open",name:P,complete:!1}},f=M=>{if(o(M))return null;const R=r(M).replace(/[ \t]+$/,"");if(!R.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(R))return null;const q=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(q?.[1])return q[1].toLowerCase();const z=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!z?.[1]||!z[2])return null;const $=z[1].toLowerCase();return $===z[2].toLowerCase()?$:null};let h=!1,m="",g=0;const v=M=>{let R=0;for(;Rv(M),b=M=>{const R=r(M);return R?o(M)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(R):!1},w=(M,R,q)=>{let z=M,$=0;for(;zz&&e[B-1]==="\r",j=P?H?B-1:B:e.length,G=e.slice(z,j),ne=l(G),W=ne?.key??"";if($>0&&R&&W!==R)break;const Q=ne?.content??G,te=d(Q);if(te?.name===q){if(te.type==="open")te.complete||$++;else if($>0&&($--,$===0))return!1}else if($>0&&(u(Q)||b(Q)))return!0;if(P)z=B+1;else break}return!1};let C="",T=0,N=!0,I=!1,S=!1,_=` -`;const x=[];let E="";for(;TT&&e[M-1]==="\r",z=R?q?M-1:M:e.length,$=e.slice(T,z),B=R?q?`\r -`:` -`:"",P=l($),H=P?.key??"",j=P?.content??$,G=y(j);G&&(h?G.markerChar===m&&G.markerLen>=g&&/^\s*$/.test(G.rest)&&(h=!1,m="",g=0):(h=!0,m=G.markerChar,g=G.markerLen));const ne=x.length>0;if(!h&&!ne){const Q=c(j),te=!!Q&&!N&&I&&S&&w(T,H,Q);Q&&!N&&(!I||te)&&(H&&E&&H===E?C+=`${H}${_}`:H||(C+=_))}if(C+=$,C+=B,B&&(_=B),!h){const Q=d(j);if(Q){if(Q.type==="open")Q.complete||x.push(Q.name);else for(let te=x.length-1;te>=0;te--)if(x[te]===Q.name){x.length=te;break}}}const W=u(j);N=W,I=!W&&a(j),S=!W&&!!f(j),E=H,T=R?M+1:e.length}return C}function S0e(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=p7(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function u8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=S0e(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` -`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` -`)?` -`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` -`)),o=Uge(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=Uh(i.customHtmlTags);if(r.length&&(o=w0e(o,r),o=C0e(o,r),o=x0e(o,r),o=A0e(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=b0e(o)),o}function _0e(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=gC.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-Cge-Age),u=u8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:u8(t,n,e,i)}else l=u8(t,n,e,i);return n||(l=Vge(l,e)),gC.set(o,{source:t,safeMarkdown:l,mode:s}),l}function Gj(e,t,n={}){const i=Rj(n),o=i?Ba():0,s=!!n.final,r=(e??"").toString();Rge(t,n)&&(t.stream.reset(),Oge(t),gC.delete(t));const l=_0e(t,r,s,n);i&&xd(i,"safeMarkdownMs",Ba()-o);const a=t0e(l);if(a){if(n.includeSourceMap){const T={...n,__sourceLineMapper:YE(r,l)};a[0].sourceMap=D0(l,0,l.length,T)}const w=n.preTransformTokens,C=n.postTransformTokens;if(c7(t,n)||typeof w=="function"||typeof C=="function"){const T=UE(t,l,{__markstreamFinal:s},n),N=typeof w=="function"&&w(T)||T;typeof C=="function"&&C(N)}return PE(a,n,i,o)}const u=i?Ba():0,c=UE(t,l,{__markstreamFinal:s},n);if(i&&xd(i,"tokenizeMs",Ba()-u),!c||!Array.isArray(c))return PE([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,v=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),y={...n,validateLink:v,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?YE(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let b=Nge(t,l,h,y,i);if(f&&typeof f=="function"){const w=f(h);if(Array.isArray(w)){const C=w[0],T=C?.type;C&&typeof T=="string"?b=Ep(w,{...y,__customHtmlBlockCursor:0},i):b=w}}if(m0e(b)){const w=i?Ba():0;b=k0e(b,s,l,y),b=Zj(b,l,t,y,s)[0],b=p0e(b,t,y,s),i&&xd(i,"htmlBlockPassesMs",Ba()-w)}if(s){const w=new WeakSet,C=T=>{if(!T||typeof T!="object"||w.has(T))return;if(w.add(T),Array.isArray(T)){for(const I of T)C(I);return}const N=T;N.type==="html_block"&&N.loading===!0&&(N.loading=!1);for(const I of Object.values(N))C(I)};C(b)}return b=$j(b,n),n.debug&&console.log("Parsed Markdown Tree Structure:",b),Oj(b,i,o)}function JE(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=of(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)Si(d,a,t);for(const d of c)lu(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&Si(d,a,t);const f=ZE(d,t);if(f){s&&KE(f,d);for(const h of f)lu(h,a,t);n.push(...f)}else lu(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const M0e=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,Hg=/\d/u,I0e=/[,.!?;:,。;、!?:]/u,T0e=/\d\p{Script=Han}{1,3}$/u;function E0e(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&E0e(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,F0e=new Set([...yv,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),B0e=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function XE(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function R0e(e){return typeof e=="string"?e:e==null?"":String(e)}function Qj(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function dd(e){return R0e(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Yj(e){return dd(e).replace(/`/g,"`")}function Rk(e){return String(e??"").trim().toLowerCase()}function g7(e,t="safe"){const n=Rk(e);return n?t==="escape"?!0:t==="trusted"?yv.has(n):!B0e.has(n):!1}function Jj(e,t="safe"){const n=Rk(e);return n?t==="escape"?!0:t==="trusted"?yv.has(n):F0e.has(n):!1}function eL(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${Yj(i)}"`).join("")}function Xj(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(D0e);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function O0e(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||ph(o,{tagName:t,attrName:"srcset"})})}function eH(e,t,n,i){return khe.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?O0e(t,i):!!(bhe.has(e)&&t&&ph(t,{tagName:i,attrName:e}))}function Zf(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function tH(e,t,n,i=!1){if(t!=="safe"||Rk(n)!=="a")return e;const o=Zf(e,"href");if(i&&(!o||!e[o])){const a=Zf(e,"target"),u=Zf(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Zf(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Zf(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function tL(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Qj(r)||eH(l,s,t,n)||(i[r]=s)}return tH(i,t,n,!!Zf(e,"href"))}function nH(e,t){const n=e.toLowerCase();return Uz.has(n)?!1:XE(t,n)||XE(t,e)}function v7(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Qj(r)||eH(l,s,t,n)||(i[r]=s)}return tH(i,t,n,!!Zf(e,"href"))}function Wg(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function Ry(e,t="safe",n){const i=v7(Wg(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function $0e(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function P0e(e){const t={};for(const[n,i]of Object.entries(e))t[n]=$0e(i,n);return t}function c8(e){return e.trim().length>0}function iH(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);c8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=Xj(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);c8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||$d.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function z0e(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=Xj(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||$d.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function j0e(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${dd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${dd(i)}`:` ${dd(i)}="${Yj(o)}"`).join("");return e.type==="self_closing"?`<${dd(t)}${n} />`:`<${dd(t)}${n}>`}function H0e(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of iH(e))if((n.type==="tag_open"||n.type==="self_closing")&&nH(n.tagName??"",t))return!0;return!1}function l1(e,t="safe"){if(!e)return"";if(t==="escape")return dd(e);const n=z0e(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(dd(r.content??""));continue}const l=Rk(r.tagName);if(!l)continue;if(Jj(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&g7(l,t)){o.push(j0e(r));continue}if(r.type==="self_closing"){o.push(`<${l}${eL(tL(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${eL(tL(r.attrs??{},t,l))}>`),$d.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const W0e=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],nL="http://www.w3.org/2000/svg",q0e=new Set(["script","style","iframe","object","embed","link","meta"]),U0e=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),V0e=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),K0e=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Z0e=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function G0e(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Q0e(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Y0e(e){const t=e.nodeName.toLowerCase();return t==="use"?G0e(e):t==="image"?Q0e(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Z0e.has(t)}function J0e(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function X0e(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?ph(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ph(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":ph(s,{tagName:i,attrName:o})?"":s:""}function eve(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function sH(e){const t=oH(e),n=t.toLowerCase();let i=0;for(;in.test(t))||sH(t)}function tve(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function R2(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function rH(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!q0e.has(i)){if(i==="br"){t.push(` -`);return}for(const o of Array.from(n.childNodes))rH(o,t)}}function nve(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];rH(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=R2(t.getAttribute("width")),s=R2(t.getAttribute("height")),r=R2(t.getAttribute("x")),l=R2(t.getAttribute("y")),a=e.ownerDocument.createElementNS(nL,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(nL,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function ive(e){nve(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!U0e.has(i)){n.remove();continue}if(i==="style"&&iL(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&iL(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(V0e.has(r)&&s.value){const l=X0e(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(K0e.has(r)&&s.value&&sH(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=J0e(s.value);l!==s.value&&n.setAttribute(s.name,l)}}tve(n)}}function n9t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return ive(n),ove(n)?null:n}catch{return null}}function ove(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){Y0e(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const O2=[];function d8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function sve(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function rve(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function oL(e=`editor-${Date.now()}`,t={}){const n=$1e(t),i=n;i.__markstreamRegisteredPluginCount=O2.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||O2.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...v]=m;typeof g=="function"&&n.use(g,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(O2.length)for(const h of O2)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(N0e),n.use(oue),n.use(tue);const r=vue,l=r.default??r;n.use(l),n.use(eue),n.use(Xae),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,v=!!m.env?.__markstreamFinal,y=g.split(/\r?\n/);for(const b of m.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const w=b.map[0],C=b.map[1],T=b.markup,N=T[0],I=T.length,S=y[Math.max(0,C-1)]??"";let _=0;for(;_w+1&&x>=I&&E===S.length,R=b;R.meta=R.meta??{},R.meta.unclosed=!M,R.meta.closed=!!M}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],v=String(g.info??"").trim(),y=String(g.content??""),b=btoa(unescape(encodeURIComponent(y))),w=sve(v),C=d8(w),T=rve(`editor-${e}-${m}-${w}`),N=d8(s("common.copy"));return`
          -
          - ${d8(w.toUpperCase())} - -
          -
          -
          `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const v=a.exec(g.src.slice(g.pos));if(!v)return!1;const y=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(y))return!1;const b=g.src.slice(g.pos+v[0].length);if(b.startsWith("](")||b.startsWith("(")||c(b))return!1;if(!m){const w=v[1],C=g.push("reference","span",0);C.content=w,C.markup=v[0],C.raw=v[0]}return g.pos+=v[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const v=String(h[m].content??"");return`${v}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const lve="modulepreload",ave=function(e){return"/"+e},sL={},Jo=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(u=>{if(u=ave(u),u in sL)return;sL[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":lve,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};function uve({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function lH({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:uve({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const cve={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function dve(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function aH(e){const t=dve(e);return cve[t]??t}function fve(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>aH(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function hve(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function pve(e){return hve(e)?.join("\0")??""}function mve(e,t){return`${pve(e)}\0\0${fve(t)?.join("\0")??""}`}function mp(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function rL(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var gve=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=lL();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=lL();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,v=bve(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(v-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const y=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=kve(this.source.slice(this.visible.length),y,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=mp(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,mp(i,1e3,1)),this.normalizedTargetLatencyMs=mp(o,900,1),this.normalizedCatchUpLatencyMs=mp(s,350,1),this.normalizedCatchUpThreshold=rL(r,600),this.normalizedStartDelayMs=rL(a,80),this.maxCommitFps=Math.trunc(mp(l,30,1)),this.maxCharsPerCommit=Math.trunc(mp(u,80,1)),this.flushOnFinish=c,this.segmenter=yve(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function vve(e={},t){const n=new gve(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function yve(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function kve(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function lL(){return typeof performance<"u"?performance.now():Date.now()}function bve(e,t,n){return Math.min(n,Math.max(t,e))}var wve=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const yC=Symbol.for("markstream-vue:node-lifecycle");function i9t(){}const y7=new Map;let uH="material";const zp=new Map,aL=new Map;let kC=null;function Cve(e){y7.set(e.id,e)}function Ave(e){const t=y7.get(uH);if(!t)return;const n=t.core[e];if(n)return n;const i=zp.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!zp.has(t.id)&&Sve(t)}function xve(){var e,t;return(t=(e=y7.get(uH))==null?void 0:e.fallback)!=null?t:""}function Sve(e){return wve(this,null,function*(){var t,n,i;if(zp.has(e.id))return(t=zp.get(e.id))!=null?t:null;let o=aL.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(zp.set(e.id,s),kC?.(),s)).catch(()=>(zp.set(e.id,null),null)),aL.set(e.id,o)),o})}const uL='',cL='',_ve={id:"material",core:{"":cL,plain:'',text:cL,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:uL,csharp:uL,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>Jo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Mve=Ya(0);kC=()=>{Mve.value++},Cve(_ve);const Ive={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Ok(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=Ive[n])!=null?t:n}function o9t(e){const t=Ok(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function s9t(e){return Ave(Ok(e))||xve()}const dL={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var $k=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let $r=null,th=!1,nh=null,Pk=b7;function Cv(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function k7(){try{const e=globalThis;return Cv(e?.katex)}catch{return null}}function b7(){return $k(null,null,function*(){const e=k7();if(e)return e;const t=yield Jo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Jo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Cv(t)})}function cH(e){const t=Promise.resolve(e).then(n=>{var i;return nh===t&&n?($r=(i=Cv(n))!=null?i:n,$r):null}).catch(()=>null).finally(()=>{nh===t&&(nh=null)});return nh=t,th=!0,t}function Tve(e){Pk=e,$r=null,th=!1,nh=null}function Eve(e){Tve(b7)}function dH(){return typeof Pk=="function"}function r9t(){var e;const t=Pk;if(!t||t===b7)return null;if($r)return $r;const n=k7();if(n)return $r=n,$r;if(th)return null;try{const i=t();return i?typeof i?.then=="function"?(cH(i),null):($r=(e=Cv(i))!=null?e:i,$r):null}catch{return null}}function fH(){return $k(this,null,function*(){var e;const t=k7();if(t)return $r=t,$r;if($r)return $r;if(nh)return nh;if(th)return null;const n=Pk;if(!n)return th=!0,null;try{const i=n();if(typeof i?.then=="function")return cH(i);if(i)return $r=(e=Cv(i))!=null?e:i,th=!0,$r}catch{}return th=!0,null})}function hH(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Oy=null,$f=null;const Rr=new Map,cc=new Map;let F0=5;const gh=new Set;function qg(){if(Rr.size{const{id:n,html:i,error:o}=t.data,s=Rr.get(n);if(s)if(Rr.delete(n),clearTimeout(s.timeoutId),s.cleanup(),qg(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(cc.set(a,i),cc.size>200){const u=cc.keys().next().value;cc.delete(u)}}s.aborted||s.resolve(i)}},Oy.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of Rr.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));Rr.clear(),Lve()}}function Dve(e,t=!0,n=2e3,i){return $k(this,null,function*(){performance.now();const o=hH(e);if(!dH()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if($f)return Promise.reject($f);const s=`${t?"d":"i"}:${o}`,r=cc.get(s);if(r)return qg(),Promise.resolve(r);const l=Oy||($f=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$f.name="WorkerInitError",$f.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject($f);if(Rr.size>=F0){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Rr.size,a.max=F0,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=Rr.get(c);if(!g)return;Rr.delete(c),g.cleanup();const v=new Error("Worker render timed out");v.name="WorkerTimeout",v.code="WORKER_TIMEOUT",g.aborted||g.reject(v),qg()},n);d=()=>{const g=Rr.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const v=new Error("Aborted");v.name="AbortError",u(v)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;Rr.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const v=Rr.get(c);Rr.delete(c),clearTimeout(f),v?.cleanup(),v?.reject(g),qg()}})})}function l9t(e,t=!0,n){const i=`${t?"d":"i"}:${hH(e)}`;if(cc.set(i,n),cc.size>200){const o=cc.keys().next().value;cc.delete(o)}}const Fve="WORKER_BUSY";function Bve(e=2e3,t){return Rr.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),gh.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},gh.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>qg()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const $m={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function a9t(e){return $k(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!dH()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:$m.timeout,u=(s=i.waitTimeout)!=null?s:$m.waitTimeout,c=(r=i.backoffMs)!=null?r:$m.backoffMs,d=(l=i.maxRetries)!=null?l:$m.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):$m.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield Dve(t,n,a,h)}catch(g){if(g?.code!==Fve||m>=f)throw g;if(m++,yield Bve(u,h).catch(()=>{}),h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}c>0&&(yield new Promise(v=>globalThis.setTimeout(v,c*m)))}}})}function jp(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function Rve(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function t4(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=Rve(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function n4(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function pH(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function i4(e,t=360,n=500){return pH(e,t,n)}function o4(e,t=360,n=500){return pH(e,t,n)}var Ove=Object.defineProperty,$ve=Object.defineProperties,Pve=Object.getOwnPropertyDescriptors,fL=Object.getOwnPropertySymbols,zve=Object.prototype.hasOwnProperty,jve=Object.prototype.propertyIsEnumerable,hL=(e,t,n)=>t in e?Ove(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mH=(e,t)=>{for(var n in t||(t={}))zve.call(t,n)&&hL(e,n,t[n]);if(fL)for(var n of fL(t))jve.call(t,n)&&hL(e,n,t[n]);return e},pL=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const s4=()=>Jo(()=>import("./mermaid.core-XMN3hSDH.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Yu=null,Hp=s4,ug=null,bC=!1,wC=!1,cg=0;function Hve(e){Hp=e,cg++,Yu=null,ug=null,bC=!1,wC=!1}function Wve(e){Hve(s4)}function mL(){return typeof Hp=="function"}function gL(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=mH({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},$ve(n,Pve(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function vL(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=mH({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function u9t(){return pL(this,null,function*(){if(Yu)return Yu;const e=(function(){try{const i=globalThis;return gL(i?.mermaid)}catch{return null}})();if(e)return Yu=e,vL(Yu),Yu;const t=Hp,n=cg;return t?t===s4&&bC?null:ug||(ug=pL(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===s4)return n===cg&&t===Hp&&(bC=!0,(function(s){wC||(wC=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===cg&&t===Hp&&(ug=null)}return n!==cg||t!==Hp?null:i?(Yu=gL(i),vL(Yu),Yu):null}),ug):null})}let du=null,Pf=null;const Ra=new Map,zf=new Map;function f8(e){for(const t of Ra.values())t.reject(e);Ra.clear(),zf.clear()}let yL=5,kL=!1;const qve="WORKER_BUSY",bL="MERMAID_DISABLED";function Uve(e){if(du&&du!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",f8(n)}du=e,Pf=null;const t=e;du.onmessage=n=>{if(du!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=Ra.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},du.onerror=n=>{var i,o;if(du===t)if(Ra.size!==0){try{kL?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}f8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},du.onmessageerror=n=>{var i,o;if(du===t)if(Ra.size!==0){try{kL?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}f8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function gH(e,t,n,i){if(!mL()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=bL,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=zf.get(o);return s||(s=(function(r,l,a=1400){if(!mL()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=bL,Promise.reject(c)}if(Pf)return Promise.reject(Pf);const u=du||(Pf=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Pf.name="WorkerInitError",Pf.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Pf);if(Ra.size>=yL){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=qve,c.inFlight=Ra.size,c.max=yL,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Ra.delete(f))},v={resolve:y=>{g(),c(y)},reject:y=>{g(),d(y)}};Ra.set(f,v);try{u.postMessage({id:f,action:r,payload:l})}catch(y){return Ra.delete(f),void d(y)}h=globalThis.setTimeout(()=>{const y=new Error("Worker call timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT";const b=Ra.get(f);b&&b.reject(y)},a)})})(e,t,n),zf.set(o,s),s.then(()=>{zf.get(o)===s&&zf.delete(o)},()=>{zf.get(o)===s&&zf.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function c9t(e,t,n=1400,i){return gH("canParse",{code:e,theme:t},n,i)}function d9t(e,t,n=1400,i){return gH("findPrefix",{code:e,theme:t},n,i)}var Vve=Object.defineProperty,Kve=Object.defineProperties,Zve=Object.getOwnPropertyDescriptors,wL=Object.getOwnPropertySymbols,Gve=Object.prototype.hasOwnProperty,Qve=Object.prototype.propertyIsEnumerable,CL=(e,t,n)=>t in e?Vve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nt=(e,t)=>{for(var n in t||(t={}))Gve.call(t,n)&&CL(e,n,t[n]);if(wL)for(var n of wL(t))Qve.call(t,n)&&CL(e,n,t[n]);return e},Fn=(e,t)=>Kve(e,Zve(t)),ro=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const Yve="__global__",h8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",CC=(()=>{const e=globalThis;if(e[h8])return e[h8];const t={scopedCustomComponents:{},revision:Ya(0)};return e[h8]=t,t})(),AL=CC.revision,Jve=Symbol("markstreamCustomComponents"),Xve=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function Av(e){return Xve.has(String(e).trim().toLowerCase())}function e2e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function p8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([Ca(n),Ca(e2e(n))]))!o||Av(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function ms(e){const t=Yt(Jve,null);return D(()=>{var n;return AL.value,(function(i,o={}){return AL.value,Nt(Nt(Nt({},p8(CC.scopedCustomComponents[Yve]||{})),p8(o)),p8((function(s){return s&&CC.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const t2e=["aria-label"],n2e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},i2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},Ri=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},$l=Ri(rt({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),L("svg",i2e,[...n[1]||(n[1]=[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),A("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),L("svg",n2e,[...n[0]||(n[0]=[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,t2e))}),[["__scopeId","data-v-be21ab83"]]);$l.install=e=>{e.component($l.__name,$l)};const o2e={class:"emoji-node"},dl=Ri(rt({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",o2e,F(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);dl.install=e=>{e.component(dl.__name,dl)};const s2e=["id"],r2e=["title"],Pl=Ri(rt({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),L("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[A("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+F(e.node.id)+"]",9,r2e)],8,s2e))}}),[["__scopeId","data-v-c1463a29"]]);Pl.install=e=>{e.component(Pl.__name,Pl)};const vH=(()=>{try{return!1}catch{}return!1})();function m8(e){vH&&console.warn(e)}function xL(e,t="safe",n){return v7(e,t,n)}function yH(e){return P0e(e)}function g8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function w7(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=Ry((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),g8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),g8(r.value)]):Object.entries(o).map(([r,l])=>[r,g8(l)]):null,t,n);var o;if(!i)return;const s=yH(Wg(i));return Object.keys(s).length>0?s:void 0}function SL(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Pm(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function v8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return nH(d,f)})(e,i);if(yv.has(e.toLowerCase())||!l&&Jj(e,s))return null;if(!l&&g7(e,s))return r?[SL(e,t,!0)]:[SL(e,t),...n,``];const a=v7(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=yH(a);return Tn(d,Fn(Nt({},f),{key:c}),n.length>0?n:void 0)}return Tn(e,Fn(Nt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function kH(e,t){return H0e(e,t)}function r4(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=v8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Pm(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=v8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?Pm(u[u.length-1].children,g):Pm(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&m8(`Auto-closing unclosed tag: <${m.tagName}>`)}else m8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=v8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?Pm(u[u.length-1].children,f):Pm(c,f),m8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(iH(e),t,n)}catch(o){return i=o,vH&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const l2e=["innerHTML"],zl=Ri(rt({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Yt("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=ms(()=>t.customId),s=rt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:l1(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=r4(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!kH(l,o.value))return{mode:"html",content:l1(l,i.value)};const a=r4(l,o.value,i.value);return a===null?{mode:"html",content:l1(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),L("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[U(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),L("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},F(r.value.content),3)):(k(),L("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,l2e))}}),[["__scopeId","data-v-d17f12b0"]]);zl.install=e=>{e.component(zl.__name,zl)};const a2e={class:"inline-code"},u2e={key:0},Ar=Ri(rt({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=q1(),i=Yt("markstreamFade",void 0),o=Yt("markstreamTextStreamState",void 0),s=Yt("markstreamStreamVersion",void 0),r=D(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=D(()=>!l.value),c=D(()=>{var b;const w=(b=n["index-key"])!=null?b:n.indexKey;return w==null||w===""?"":String(w)}),d=V(t.node.code),f=V(""),h=V(0);let m;function g(){m?.(),m=void 0}function v(){g(),f.value&&(d.value=d.value+f.value,f.value="")}We([()=>t.node.code,c,l],([b])=>{const w=String(b??""),C=c.value,T=lH({nextContent:w,persistedContent:C?o?.get(C):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=T.settledContent,f.value=T.streamedDelta,T.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const N=s.value;m=We(()=>s.value,I=>{I!==N&&v()},{flush:"sync"})})()):f.value||g(),C&&o?.set(C,w)},{immediate:!0}),Gd(g);const y=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,w)=>(k(),L("code",a2e,[u.value?(k(),L(De,{key:0},[Oe(F(a.value),1)],64)):(k(),L(De,{key:1},[d.value?(k(),L("span",u2e,F(d.value),1)):ee("",!0),f.value?(k(),L("span",{key:1,class:Re(["inline-code-stream-delta",[y.value]]),onAnimationend:v},F(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Ar.install=e=>{e.component(Ar.__name,Ar)};const AC=V(!1),_L=V(""),ML=V("top"),Ug=V(null),Vg=V(null),xC=V(null),SC=V(null),IL=V(null);let $y=null,Py=null,_C=0;function bH(){$y&&(clearTimeout($y),$y=null),Py&&(clearTimeout(Py),Py=null)}let $2=!1,P2=null,TL=!1;function c2e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++_C;bH();const l=()=>ro(null,null,function*(){var a,u;if(yield(function(){return ro(this,null,function*(){if(!$2&&!TL&&typeof document<"u"){P2!=null||(P2=ro(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([Jo(()=>import("./vue.runtime.esm-bundler-BMAq9omn.js"),[]),Jo(()=>import("./Tooltip-BI78FOq1.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:AC.value,"anchor-el":Ug.value,content:_L.value,placement:ML.value,id:Vg.value,originX:xC.value,originY:SC.value,isDark:(m=IL.value)!=null?m:void 0})}}).mount(h),$2=!0}));try{yield P2}catch(c){$2=!1,P2=null,TL=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),$2&&r===_C){Vg.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ug.value=e,_L.value=t,ML.value=n,xC.value=(a=o?.x)!=null?a:null,SC.value=(u=o?.y)!=null?u:null,IL.value=typeof s=="boolean"?s:null,AC.value=!0;try{e.setAttribute("aria-describedby",Vg.value)}catch{}}});i?l():$y=setTimeout(l,80)}function d2e(e=!1){_C+=1,bH();const t=()=>{if(Ug.value&&Vg.value)try{Ug.value.removeAttribute("aria-describedby")}catch{}AC.value=!1,Ug.value=null,Vg.value=null,xC.value=null,SC.value=null};e?t():Py=setTimeout(t,120)}const f2e={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},h2e=Symbol("markstreamI18nFallback");function wH(e,t){var n;return(n=t?.[e])!=null?n:f2e[e]}const MC=(e,t)=>{var n;return(n=wH(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function EL(e,t){return{t(n){const i=wH(n,t);if(e.te&&i!=null&&!e.te(n))return MC(n,t);const o=e.t(n);return o===n&&i!=null?MC(n,t):o}}}function p2e(){const e=(function(){var n,i,o;try{const s=hs(),r=h2e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=hs(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return EL(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return EL({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>MC(n,e)}}const CH=Symbol("ViewportPriority"),AH=Symbol("ViewportPriorityOptions"),xH=Symbol("OffscreenHeavyNodeDeferral"),m2e=D(()=>!1),Eh="400px";function C7(){return Yt(AH,void 0)}function A7(){return Yt(xH,m2e)}function g2e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?V(t):t,r=o?(n=window.requestIdleCallback)!=null?n:I=>window.setTimeout(()=>I({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:I=>window.clearTimeout(I):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(I){if(!I)return"viewport";let S=a.get(I);return S||(S=u++,a.set(I,S)),String(S)}function v(){if(h!=null){try{l?.(h)}catch{}h=null}}function y(I){if(I){const S=c.get(I);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(I)}}d.size||f.size||v()}function b(I){const S=d.get(I);if(!S)return;const _=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{_?.io.unobserve(I)}catch{}_?.targets.delete(I),d.delete(I),f.delete(I),y(S.bucketKey)}function w(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const I=f.values().next().value;I&&(f.delete(I),b(I),f.size&&w())},{timeout:1200}))}function C(I,S){if(!o||typeof IntersectionObserver>"u")return null;const _=(function(z,$){var B,P,H;return{root:(B=e?.(z??null))!=null?B:null,rootMargin:(P=$?.rootMargin)!=null?P:Eh,threshold:(H=$?.threshold)!=null?H:0}})(I,S),x=[g((E=_).root),E.rootMargin,E.threshold].join("\0");var E;const M=c.get(x);if(M)return{key:x,bucket:M};let R;try{R=new IntersectionObserver(z=>{for(const $ of z)($.isIntersecting||$.intersectionRatio>0)&&b($.target)},{root:_.root,rootMargin:_.rootMargin,threshold:_.threshold})}catch{return null}const q={io:R,targets:new Map};return c.set(x,q),{key:x,bucket:q}}function T(){if(o&&s.value)for(const[I,S]of Array.from(d.entries())){const _=C(I,S.opts);if(!_){b(I);continue}if(_.key===S.bucketKey)continue;const x=S.bucketKey,E=c.get(x);try{E?.io.unobserve(I)}catch{}E?.targets.delete(I),S.bucketKey=_.key,_.bucket.targets.set(I,S),_.bucket.io.observe(I),y(x)}}We(s,I=>{if(!I){for(const S of Array.from(d.keys()))b(S);v()}},{flush:"sync"});const N=(I,S)=>{const _=V(!1);let x,E=!1;const M=new Promise($=>{x=()=>{E||(E=!0,$())}}),R=()=>{const $=d.get(I);if(!$)return f.delete(I),void y();const B=c.get($.bucketKey);try{B?.io.unobserve(I)}catch{}B?.targets.delete(I),d.delete(I),f.delete(I),y($.bucketKey)};if(!o||!s.value)return _.value=!0,x(),{isVisible:_,whenVisible:M,destroy:R};const q=C(I,S);if(!q)return _.value=!0,x(),{isVisible:_,whenVisible:M,destroy:R};const z={resolve:x,visible:_,bucketKey:q.key,opts:S};return d.set(I,z),q.bucket.targets.set(I,z),q.bucket.io.observe(I),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,T()})),S?.allowIdle!==!1&&(f.add(I),w()),{isVisible:_,whenVisible:M,destroy:R}};return N.refresh=T,ii(CH,N),N}function x7(){var e,t;const n=Yt(CH,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=V(!1);let v,y=!1;const b=new Promise(T=>{v=()=>{y||(y=!0,T())}}),w=()=>{const T=i.get(h);if(!T)return s.delete(h),void(s.size||u());const N=o.get(T.bucketKey);try{N?.io.unobserve(h)}catch{}i.delete(h),N?.targets.delete(h),s.delete(h),c(T.bucketKey),s.size||u()},C=(T=>{var N,I;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(R=>{var q,z;return[(q=R?.rootMargin)!=null?q:Eh,(z=R?.threshold)!=null?z:0].join("\0")})(T),_=o.get(S);if(_)return{key:S,bucket:_};const x=(N=T?.rootMargin)!=null?N:Eh;let E;try{E=new IntersectionObserver(R=>{for(const q of R)(q.isIntersecting||q.intersectionRatio>0)&&d(q.target)},{root:null,rootMargin:x,threshold:(I=T?.threshold)!=null?I:0})}catch{return null}const M={io:E,targets:new Set};return o.set(S,M),{key:S,bucket:M}})(m);return C?(i.set(h,{resolve:v,visible:g,bucketKey:C.key}),C.bucket.targets.add(h),C.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:b,destroy:w}):(g.value=!0,v(),{isVisible:g,whenVisible:b,destroy:w})}}function v2e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const y2e=["data-markstream-viewport-pending"],k2e=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],b2e={key:1,class:"image-placeholder"},w2e={key:1,class:"image-node__raw-text"},C2e={key:2,class:"image-shimmer-overlay"},A2e={key:1,class:"image-node__raw-text"},x2e={key:3,class:"image-error"},Sd=Ri(rt({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=V(!1),a=V(!1),u=V(""),c=V("primary"),d=V(null),f=q1(),h=Yt(yC,null),m=x7(),g=C7(),v=A7(),y=D(()=>JT(s.node.src)),b=D(()=>JT(s.fallbackSrc)),w=(o=(i=(n=hs())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),C=typeof window<"u"&&w?.getAttribute("src")===(y.value||b.value),T=V(typeof window>"u"||C||!v.value),N=Ya(null);let I="",S=null;const _=D(()=>u.value),x=D(()=>!s.lazy),E=D(()=>typeof window<"u"&&v.value&&!C),M=D(()=>!E.value||T.value),R=D(()=>M.value?_.value:""),q=D(()=>{var ce,se;return(se=(ce=g?.value.heavyBlockMargin)!=null?ce:g?.value.rootMargin)!=null?se:Eh}),z=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),$=D(()=>c.value==="failed"),B=D(()=>(!x.value||E.value&&!T.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),P=D(()=>v2e(s,f));function H(ce=P.value){ce&&d.value&&h?.reportHeight(ce,d.value.offsetHeight)}function j(ce=P.value){ce&&ft(()=>{H(ce)})}function G(){S&&(clearTimeout(S),S=null)}function ne(){const ce=P.value;ce&&I!==ce&&(I&&h?.markSettled(I),G(),I=ce,h?.markPending(ce),typeof window<"u"&&(S=window.setTimeout(()=>{I===ce&&(j(ce),W())},8e3)))}function W(){return ro(this,null,function*(){const ce=I;ce&&(G(),I="",yield ft(),H(ce),h?.markSettled(ce))})}function Q(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void j();c.value="failed",a.value=!0,r("error",u.value),j()}function te(){l.value=!0,a.value=!1,r("load",_.value),j()}function X(ce){ce.preventDefault(),l.value&&!a.value&&r("click",[ce,_.value])}const{t:ve}=p2e();return We([y,b,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||y.value?(u.value=y.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&We([d,E],([ce,se],pe,Z)=>{var ae;if((ae=N.value)==null||ae.destroy(),N.value=null,!se||T.value)return void(T.value=!0);if(!ce)return void(T.value=!1);let K=!0;const re=m(ce,{rootMargin:q.value,allowIdle:!1});N.value=re,T.value=re.isVisible.value,re.whenVisible.then(()=>{K&&N.value===re&&(T.value=!0)}),Z(()=>{K=!1,re.destroy(),N.value===re&&(N.value=null)})},{immediate:!0}),We([z,l,a,_,()=>s.lazy,M],([ce,se,pe,Z,ae,K])=>ce&&Z&&!pe&&K?se?(W(),void j()):ae?(ne(),void j()):void(se||pe||ne()):(W(),void j()),{flush:"post",immediate:!0}),Xn(()=>{var ce;(ce=N.value)==null||ce.destroy(),N.value=null,(function(){const se=I;se&&(G(),I="",h?.markSettled(se))})()}),(ce,se)=>{var pe,Z,ae,K,re;return k(),L("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":E.value&&!T.value?"true":void 0},[z.value?(k(),L("img",{key:0,src:R.value||void 0,alt:String((Z=(pe=s.node.alt)!=null?pe:s.node.title)!=null?Z:""),title:String((K=(ae=s.node.title)!=null?ae:s.node.alt)!=null?K:""),class:Re(["image-node__img",{"is-loading":!x.value&&!l.value,"is-loaded":x.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:x.value?"high":void 0,decoding:x.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(re=s.node.alt)!=null?re:p(ve)("image.preview"),onError:Q,onLoad:te,onClick:X},null,42,k2e)):ee("",!0),e.node.loading&&!a.value?(k(),L("span",b2e,[s.usePlaceholder?Wn(ce.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[0]||(se[0]=A("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",w2e,F(e.node.raw),1))])):ee("",!0),B.value&&!e.node.loading?(k(),L("span",C2e,[s.usePlaceholder?Wn(ce.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[1]||(se[1]=A("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",A2e,F(e.node.raw),1))])):ee("",!0),$.value?(k(),L("span",x2e,[Wn(ce.$slots,"error",{node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[2]||(se[2]=A("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[A("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),A("span",null,F(p(ve)("image.loadError")),1)],!0)])):ee("",!0)],8,y2e)}}}),[["__scopeId","data-v-046e82ac"]]);Sd.install=e=>{e.component(Sd.__name,Sd)};const S2e={key:2},zu=rt({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ms(()=>t.customId),i=Yt("markstreamHtmlPolicy",void 0),o=Yt("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const v=(m=o?.value)!=null?m:{};return Fn(Nt({},v),{customId:(g=t.customId)!=null?g:v.customId,htmlPolicy:s.value})}),l=Cu({loader:()=>Promise.resolve().then(()=>B7),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!Av(String(t.node.type)))),c=D(()=>u.value?w7(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(k(),de(zo(a.value),di({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ue(()=>[d.value?(k(),de(p(l),di({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),de(p(l),di({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),de(zo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),L("span",S2e,F(h.value),1)):ee("",!0)}}),LL=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function _2e(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Fn(Nt(Nt({},LL),n),{enabled:(t=n.enabled)==null||t})}return Nt({},LL)}function S7(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function SH(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function NL(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function M2e(e){var t;return e.diff===!0||NL(e.language)||NL(SH(String((t=e.raw)!=null?t:"")))}function I2e(e,t,n){const i=(function(o){const s=SH(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const T2e=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],E2e={key:0,translate:"no",class:"markstream-pre__diff-code"},L2e={class:"markstream-pre__diff-pane-content"},N2e={class:"markstream-pre__diff-number","aria-hidden":"true"},D2e={class:"markstream-pre__diff-content"},F2e={class:"markstream-pre__diff-content-inner"},B2e={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},R2e=["textContent"],O2e=["textContent"],sl=rt({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(X,ve){const ce=String(X??"");return ve?ce:ce.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var X,ve,ce;const se=String((ve=(X=t.node)==null?void 0:X.language)!=null?ve:"");return String((ce=String(se).split(/\s+/g)[0])!=null?ce:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var X;return t.loading===!0||((X=t.node)==null?void 0:X.loading)===!0}),r=D(()=>{var X;return n((X=t.node)==null?void 0:X.code,s.value)});let l="",a=1;const u=D(()=>(function(X){let ve=0,ce=1;X.startsWith(l)&&(ve=l.length,ce=a,ve>0&&X[ve-1]==="\r"&&X[ve]===` -`&&ve++);for(let se=ve;ser.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const X=u.value;X{var X;return t.showLineNumbers===!0&&((X=t.node)==null?void 0:X.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),v=D(()=>{const X=Number(t.reservedHeightPx);if(!Number.isFinite(X)||X<=0)return;const ve=`${Math.ceil(X)}px`;return s.value?{maxHeight:ve,overflow:"auto"}:{height:ve,minHeight:ve,maxHeight:ve,overflow:"auto"}}),y=["diff ","index ","--- ","+++ ","@@ "];function b(X){return String(X??"").trim().length===0}function w(X,ve="context",ce={}){const se=b(X);return{code:X,kind:se&&ve!=="hunk"&&ve!=="spacer"&&!ce.preserveBlankKind?"context":ve,empty:se}}function C(X){const ve=n(X,s.value);return ve?ve.split(/\r\n|\n|\r/):[]}function T(X,ve){return!b(X[ve])||vey.some(ce=>ve.startsWith(ce)))}function _(X,ve){return ve||!X.startsWith(" ")||X.startsWith(" ")?X:` ${X}`}function x(X,ve){const ce=X.length,se=ve.length,pe=[];let Z=0;for(;Z=Z&&re>=Z&&X[K]===ve[re];)ae.unshift({originalIndex:K,modifiedIndex:re}),K--,re--;const we=K-Z+1,be=re-Z+1;if(we<=0||be<=0||s.value||(we+1)*(be+1)>15e5)return pe.concat(ae);const ke=be+1,oe=new Uint32Array((we+1)*(be+1));for(let Me=we-1;Me>=0;Me--)for(let fe=be-1;fe>=0;fe--){const ie=Me*ke+fe;if(X[Z+Me]===ve[Z+fe])oe[ie]=oe[(Me+1)*ke+fe+1]+1;else{const Ee=oe[(Me+1)*ke+fe],qe=oe[Me*ke+fe+1];oe[ie]=Ee>=qe?Ee:qe}}const le=[];let ye=0,Ae=0;for(;ye=oe[ye*ke+Ae+1]?ye++:Ae++;return pe.concat(le,ae)}function E(X){var ve;const ce=(function(){var re,we;const be=t.diffHideUnchangedRegions;if(be==null||be===!1)return null;const ke=be===!0?{}:be;return ke.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((re=ke.contextLineCount)!=null?re:2)),minimumLineCount:Math.max(1,Math.floor((we=ke.minimumLineCount)!=null?we:4))}})();if(!ce||X.length<1||X.length>2||X.length===2&&X[0].lines.length!==X[1].lines.length)return X;const se=X[0].lines,pe=(ve=X[1])==null?void 0:ve.lines,Z=re=>se[re].kind==="context"&&(pe===void 0||pe[re].kind==="context"&&se[re].code===pe[re].code),ae=[];let K=0;for(;K=ce.minimumLineCount){const be=re+(re===0?0:ce.contextLineCount),ke=we-(we===se.length?0:ce.contextLineCount);ke-be>=ce.minimumLineCount&&ae.push({start:be,end:ke})}K===re&&K++}return ae.length?X.map((re,we)=>{const be=[];let ke=0;for(const oe of ae)be.push(...re.lines.slice(ke,oe.start)),be.push({code:we===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${re.key}-collapsed-${oe.start}-${oe.end}`,number:""}),ke=oe.end;return be.push(...re.lines.slice(ke)),Fn(Nt({},re),{lines:be})}):X}const M=D(()=>{var X,ve,ce,se;if(!m.value)return[];const pe=(function(we){const be=we.some(oe=>N(oe)),ke=we.some(oe=>I(oe));return be&&ke||(function(){var oe,le,ye,Ae;if(i.value==="diff")return!0;const Me=(Ae=(ye=String((le=(oe=t.node)==null?void 0:oe.raw)!=null?le:"").split(/\r?\n/,1)[0])==null?void 0:ye.trim())!=null?Ae:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Me)})()&&(be||ke)})(c.value),Z=(function(){var we,be;return((we=t.node)==null?void 0:we.originalCode)!=null||((be=t.node)==null?void 0:be.updatedCode)!=null})();if(g.value){const we=Z?(function(be,ke){const oe=C(be),le=C(ke),ye=x(oe,le);if(ye.length>0){const qe=[];let ze=0,ht=0;for(const gt of ye){for(;ze=Me&&ie>=Me&&oe[fe]===le[ie];)Ee.unshift(Fn(Nt({},w(le[ie])),{key:`inline-suffix-${ie}`,number:ie+1})),fe--,ie--;for(let qe=Me;qe<=fe;qe++)Ae.push(Fn(Nt({},w(oe[qe],"removed",{preserveBlankKind:T(oe,qe)})),{key:`inline-removed-source-${qe}`,number:qe+1}));for(let qe=Me;qe<=ie;qe++)Ae.push(Fn(Nt({},w(le[qe],"added",{preserveBlankKind:T(le,qe)})),{key:`inline-added-source-${qe}`,number:qe+1}));return Ae.concat(Ee)})((X=t.node)==null?void 0:X.originalCode,(ve=t.node)==null?void 0:ve.updatedCode):(function(be){const ke=[];let oe=1,le=1;const ye=S(be);for(const[Ae,Me]of be.entries())if(Me.startsWith("@@")){const fe=Me.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);fe&&(oe=Number(fe[1]),le=Number(fe[2])),ke.push(Fn(Nt({},w(Me,"hunk")),{key:`inline-hunk-${Ae}`,number:""}))}else if(N(Me))ke.push(Fn(Nt({},w(_(Me.slice(1),ye),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Ae}`,number:oe++}));else if(I(Me))ke.push(Fn(Nt({},w(_(Me.slice(1),ye),"added",{preserveBlankKind:!0})),{key:`inline-added-${Ae}`,number:le++}));else{const fe=ye&&Me.startsWith(" ")?Me.slice(1):Me;ke.push(Fn(Nt({},w(fe)),{key:`inline-context-${Ae}`,number:le})),oe++,le++}return ke})(c.value);return E([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:we}])}if(!pe&&Z)return(function(we,be){const ke=C(we),oe=C(be),le=x(ke,oe),ye=[],Ae=[];let Me=0,fe=0,ie=0;const Ee=(qe,ze)=>{const ht=Math.max(qe-Me,ze-fe);for(let gt=0;gtFn(Nt({},we),{key:`original-${be}`,number:be+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:K.map((we,be)=>Fn(Nt({},we),{key:`modified-${be}`,number:be+1}))}])}),R=D(()=>{var X,ve;if(t.showLineNumbers!==!0)return;let ce=m.value?1:u.value;if(m.value){ce=Math.max(ce,C((X=t.node)==null?void 0:X.originalCode).length,C((ve=t.node)==null?void 0:ve.updatedCode).length);for(const pe of M.value)for(const Z of pe.lines)typeof Z.number=="number"&&(ce=Math.max(ce,Z.number))}const se=`${Math.max(2,String(ce).length)}ch`;return{"--markstream-pre-line-number-width":se,"--markstream-pre-diff-line-number-width":se,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),q=D(()=>M.value.some(X=>X.lines.some(ve=>ve.kind==="collapsed"))),z=D(()=>{const X=i.value;return X?`Code block: ${X}`:"Code block"}),$=V(null),B=V([]);let P=null,H=!1,j=null;function G(X){const ve=Number.parseFloat(String(X??""));return Number.isFinite(ve)&&ve>0?ve:0}function ne(X,ve){var ce;if(!X)return ve;if(X.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const se=X.querySelector(".markstream-pre__diff-content"),pe=se?.getBoundingClientRect(),Z=(ce=pe?.height)!=null?ce:0;return Math.max(ve,Math.ceil(Z))}function W(){H||typeof window>"u"||(P!=null&&window.cancelAnimationFrame(P),P=window.requestAnimationFrame(()=>{P=null,H||(function(){var X,ve;P=null;const ce=$.value;if(!ce||!m.value||g.value||!ce.classList.contains("is-wrap"))return void(B.value.length&&(B.value=[]));const se=(function(be){const ke=window.getComputedStyle(be),oe=G(ke.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const le=G(ke.lineHeight);return le>0?le:18})(ce),pe=Array.from(ce.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),Z=Array.from(ce.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),ae=Math.max(pe.length,Z.length),K=[];for(let be=0;be{const oe=we[ke];return oe&&Math.abs(be.rowHeight-oe.rowHeight)<=.5&&Math.abs(be.originalHeight-oe.originalHeight)<=.5&&Math.abs(be.modifiedHeight-oe.modifiedHeight)<=.5})||(B.value=K)})()}))}function Q(X){j?.disconnect(),j=null,X&&m.value&&!g.value&&typeof ResizeObserver<"u"&&(j=new ResizeObserver(()=>{W()}),j.observe(X))}function te(X,ve){const ce=B.value[X];if(!ce)return;const se=ve==="original"?ce.originalHeight:ce.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ce.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(se)}px`}}return We($,X=>{Q(X),ft(()=>W())},{flush:"post"}),We([m,g,M],()=>{Q($.value),ft(()=>W())},{flush:"post",immediate:!0}),Xn(()=>{H=!0,P!=null&&(window.cancelAnimationFrame(P),P=null),j?.disconnect(),j=null}),(X,ve)=>(k(),L("pre",{ref_key:"preRef",ref:$,style:sn([v.value,R.value]),class:Re([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":q.value}]),"aria-busy":s.value,"aria-label":z.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),L("code",E2e,[(k(!0),L(De,null,Ct(M.value,ce=>(k(),L("span",{key:ce.key,class:Re(["markstream-pre__diff-pane",ce.className])},[A("span",L2e,[(k(!0),L(De,null,Ct(ce.lines,(se,pe)=>(k(),L("span",{key:se.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${se.kind}`,{"markstream-pre__diff-line--empty":se.empty}]]),style:sn(te(pe,ce.key))},[ve[0]||(ve[0]=A("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),A("span",N2e,F(se.number),1),A("span",D2e,[A("span",F2e,F(se.code),1)])],6))),128))])],2))),128))])):(k(),L(De,{key:1},[t.showLineNumbers?(k(),L("span",B2e,[A("span",{class:"markstream-pre__line-numbers-text",textContent:F(h.value)},null,8,R2e)])):ee("",!0),A("code",{translate:"no",class:"markstream-pre__code",textContent:F(r.value)},null,8,O2e)],64))],14,T2e))}});sl.install=e=>{e.component(sl.__name,sl)};const qo=Ri(rt({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=q1(),i=Yt("markstreamFade",void 0),o=Yt("markstreamTextStreamState",void 0),s=Yt("markstreamStreamVersion",void 0),r=D(()=>{const T=n.fade;return T===""||T===!0||T==="true"||T!==!1&&T!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var T;const N=(T=n["index-key"])!=null?T:n.indexKey;return N==null||N===""?"":String(N)}),u=V(t.node.content),c=V(""),d=V(0),f=V(t.node.content);let h;const m=V(null),g=V(null);let v="",y=null;function b(){h?.(),h=void 0}function w(){b(),c.value&&(u.value=u.value+c.value,c.value="")}We([u,m,g],function(){var T,N;const I=m.value;if(!I)return;const S=String((T=u.value)!=null?T:""),_=g.value;return y||(y=I.firstChild,v=(N=y?.data)!=null?N:""),S.startsWith(v)?!y&&S?(I.textContent=S,y=I.firstChild,void(v=S)):void(S.length>v.length&&_&&(_.appendChild(document.createTextNode(S.slice(v.length))),v=S)):(I.textContent=S,y=I.firstChild,_&&(_.textContent=""),void(v=S))},{immediate:!0}),We([()=>t.node.content,a,l],([T])=>{const N=String(T??""),I=a.value,S=lH({nextContent:N,persistedContent:I?o?.get(I):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=S.settledContent,c.value=S.streamedDelta,S.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const _=s.value;h=We(()=>s.value,x=>{x!==_&&w()},{flush:"sync"})})()):c.value||b(),I&&o?.set(I,N)},{immediate:!0}),Gd(b);const C=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(T,N)=>(k(),L("span",{class:Re([[e.node.center?"text-node-center":""],"text-node"])},[ai(A("span",{ref_key:"settledTextEl",ref:m},F(f.value),513),[[Qo,u.value!==""]]),ai(A("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Qo,u.value!==""]]),c.value?(k(),L("span",{key:0,class:Re(["text-node-stream-delta",[C.value]]),onAnimationend:w},F(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function dg(e,t,n){return rt({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=x7(),u=C7(),c=A7(),d=typeof window<"u"&&((l=(r=hs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=V(typeof window>"u"||d||!c.value),h=Ya(null);let m=null;function g(v){const y=v&&"$el"in v?v.$el:v;h.value=y instanceof HTMLElement?y:null}return typeof window<"u"&&We([h,c],([v,y],b,w)=>{if(m?.destroy(),m=null,!y||f.value)return void(f.value=!0);if(!v)return;let C=!0;const T=a(v,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=T,f.value=T.isVisible.value,T.whenVisible.then(()=>{C&&m===T&&(f.value=!0)}),w(()=>{C=!1,T.destroy(),m===T&&(m=null)})},{immediate:!0}),Xn(()=>{m?.destroy(),m=null}),()=>Tn(f.value?t:n,Fn(Nt({},o),{ref:g}),s)}})}qo.install=e=>{e.component(qo.__name,qo)};const l4=rt({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=Ok(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=dL[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):dL[""]),f=M2e(n.node),h=I2e(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:S7(m??{},typeof window>"u"?0:window.innerWidth)),v=m?.diffAppearance,y=v==="dark"||v!=="light"&&n.isDark===!0,b=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,w=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),C=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,T=f?0:8,N=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:T,I=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:T,S=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",_=Nt(Nt({fontSize:`${b}px`,lineHeight:`${w}px`,tabSize:C,paddingTop:`${N}px`,paddingBottom:`${I}px`,"--markstream-pre-line-number-top":`${N}px`},f?{"--markstream-pre-diff-line-height":`${w}px`}:{}),S?{"--markstream-code-font-family":S}:{}),x=()=>Tn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Tn("svg",{class:"action-icon",width:"14",height:"14"})]),E=n.isShowPreview!==!1&&(c==="html"||c==="svg"),M=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||E&&n.showPreviewButton!==!1,R=z=>{if(z!=null)return typeof z=="number"?`${z}px`:String(z)},q=Nt(Nt(Nt({"--markstream-code-layout-character-width":"1ch"},R(n.minWidth)?{minWidth:R(n.minWidth)}:{}),R(n.maxWidth)?{maxWidth:R(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Tn("div",Fn(Nt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":y,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[q,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Tn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Tn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[Tn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),Tn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[Tn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?Tn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),Tn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Tn("div",{class:"code-diff-stats","aria-hidden":"true"},[Tn("span",{class:"code-diff-stat removed"},"-0"),Tn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:x(),n.showCollapseButton===!1?null:x(),M?Tn("div",{class:"relative"},[x()]):null])]),Tn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Tn(sl,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?_2e(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:_,"data-markstream-code-loading":"1"})]),Tn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Tn("div",{class:"loading-skeleton"},[Tn("div",{class:"skeleton-line"}),Tn("div",{class:"skeleton-line"}),Tn("div",{class:"skeleton-line short"})])]),Tn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),y8=dg("ViewportDeferredCodeBlockNode",Cu({loader:()=>ro(null,null,function*(){try{return(yield Jo(()=>import("./CodeBlockNode-DiXk8vTC.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),sl}}),loadingComponent:l4,delay:0,suspensible:!1}),l4),Ja=Cu(()=>ro(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return Tn(qo,Fn(Nt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield fH(),(yield Jo(()=>import("./index7-Dw6CHuX-.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return Tn(qo,Fn(Nt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),_H=Cu(()=>ro(null,null,function*(){try{return yield fH(),(yield Jo(()=>import("./index6-CPKEqG-u.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return Tn(qo,Fn(Nt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),Hr=Ri(rt({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),L("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},F(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Hr.install=e=>{e.component(Hr.__name,Hr)};const $2e={class:"superscript-node"},fl=Ri(rt({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,footnote_reference:Pl,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,emoji:dl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("sup",$2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);fl.install=e=>{e.component(fl.__name,fl)};const P2e={class:"subscript-node"},hl=Ri(rt({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,footnote_reference:Pl,strikethrough:qr,highlight:jl,insert:pl,superscript:fl,emoji:dl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("sub",P2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);hl.install=e=>{e.component(hl.__name,hl)};const z2e={class:"strong-node"},Wr=Ri(rt({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,emphasis:Vr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("strong",z2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Wr.install=e=>{e.component(Wr.__name,Wr)};const j2e={class:"strikethrough-node"},qr=Ri(rt({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("del",j2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);qr.install=e=>{e.component(qr.__name,qr)};const H2e=["href","title","aria-label","aria-hidden","target","rel"],W2e=["aria-hidden"],q2e={class:"link-text-wrapper relative inline-flex"},U2e={class:"leading-[normal] link-text"},Ur=Ri(rt({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Yt("markstreamShowTooltips",void 0),i=D(()=>{const y=n?.value;return typeof y=="boolean"?y:t.showTooltip}),o=D(()=>{var y,b,w,C,T;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",I=(y=t.animationOpacity)!=null?y:.35,S=Math.max(.12,Math.min(.5*I,I)),_={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":N,"--underline-opacity":String(I),"--underline-rest-opacity":String(S),"--underline-duration":`${(w=t.animationDuration)!=null?w:1.6}s`,"--underline-timing":(C=t.animationTiming)!=null?C:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(T=t.animationIteration)!=null?T:"infinite"};return t.color&&(_["--link-color"]=t.color),_}),s=ms(()=>t.customId),r=D(()=>Nt({text:qo,strong:Wr,strikethrough:qr,emphasis:Vr,image:Sd,html_inline:zl,inline_code:Ar},s.value)),l=q1(),a=D(()=>{var y,b;const w=(y=t.node)==null?void 0:y.attrs;if(!w||typeof w!="object")return{};const C={};if(Array.isArray(w))for(const T of w)Array.isArray(T)&&T[0]&&(C[String(T[0])]=String((b=T[1])!=null?b:""));else for(const[T,N]of Object.entries(w))T&&N!=null&&N!==!1&&(C[T]=N===!0?"":String(N));return xL(C,"safe","a")}),u=D(()=>Nt(Nt({},l),a.value)),c=D(()=>{var y,b;return xL({href:String((b=(y=t.node)==null?void 0:y.href)!=null?b:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const y=u.value.target;return(typeof y=="string"?y.trim():String(y??"").trim())||(Mhe(c.value)?"_blank":void 0)}),f=D(()=>{var y;return String((y=d.value)!=null?y:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const y=u.value.rel,b=new Set((typeof y=="string"?y:String(y??"")).split(/\s+/).filter(Boolean)),w=new Set(Array.from(b).filter(C=>C.toLowerCase()!=="opener"));return f.value&&(w.add("noopener"),w.add("noreferrer")),w.size>0?Array.from(w).join(" "):void 0}),m=D(()=>{const y=Nt({},u.value);return delete y.title,delete y.href,delete y.target,delete y.rel,y});function g(){i.value&&d2e()}const v=D(()=>{var y,b;const w=(y=t.node)==null?void 0:y.title;return typeof w=="string"&&w.trim().length>0?w:String((b=c.value)!=null?b:"")});return(y,b)=>{var w,C;return e.node.loading?(k(),L("span",di({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[A("span",q2e,[A("span",U2e,[U(p(qo),{class:"leading-[normal] link-text",node:{type:"text",content:String((w=e.node.text)!=null?w:""),raw:String((C=e.node.text)!=null?C:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=A("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,W2e)):(k(),L("a",di({key:0,class:"link-node",href:c.value,title:i.value?"":v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:b[0]||(b[0]=T=>(function(N){var I,S,_,x;if(!i.value)return;const E=N,M=E?.clientX!=null&&E?.clientY!=null?{x:E.clientX,y:E.clientY}:void 0,R=((I=t.node)==null?void 0:I.title)||((S=c.value)!=null&&S.includes("xn--")&&((x=(_=t.node)==null?void 0:_.text)!=null&&x.includes("://"))?t.node.text:c.value)||"";c2e(N.currentTarget,R,"top",!1,M)})(T)),onMouseleave:g}),[(k(!0),L(De,null,Ct(e.node.children,(T,N)=>(k(),de(p(zu),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:T,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,H2e))}}}),[["__scopeId","data-v-367e6ca4"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const V2e={class:"insert-node"},pl=Ri(rt({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:jl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("ins",V2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);pl.install=e=>{e.component(pl.__name,pl)};const K2e={class:"highlight-node"},jl=Ri(rt({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,emphasis:Vr,strikethrough:qr,insert:pl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("mark",K2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);jl.install=e=>{e.component(jl.__name,jl)};const Z2e={class:"emphasis-node"},Vr=Ri(rt({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,html_inline:zl,strong:Wr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,footnote_reference:Pl,math_inline:Ja,reference:Hr},n.value));return(o,s)=>(k(),L("em",Z2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(zu),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Vr.install=e=>{e.component(Vr.__name,Vr)};const G2e={class:"hard-break"},_d=Ri(rt({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("br",G2e))}),[["__scopeId","data-v-50c58f70"]]);_d.install=e=>{e.component(_d.__name,_d)};const B0=rt({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Et({checkbox:$l,checkbox_input:$l,emoji:dl,emphasis:Vr,hardbreak:_d,highlight:jl,inline_code:Ar,insert:pl,link:Ur,reference:Hr,strikethrough:qr,strong:Wr,subscript:hl,superscript:fl,text:qo}),i=ms(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Nt(Nt({},n),s):n});return(s,r)=>(k(!0),L(De,null,Ct(e.nodes,(l,a)=>(k(),de(p(zu),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function IC(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(IC)}function a4(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(IC))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(IC)?o:null}function Lh(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Q2e=["cite"],Y2e={key:0,dir:"auto",class:"paragraph-node"},J2e=["custom-id"],zy=Ri(rt({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ms(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>a4(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:Lh(s.value));return ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade)),(l,a)=>(k(),L("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),L("p",Y2e,[r.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(r.value),9,J2e)):(k(),de(p(B0),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),de(p(ml),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Q2e))}}),[["__scopeId","data-v-abfecebc"]]);zy.install=e=>{e.component(zy.__name,zy)};const X2e={class:"definition-list"},eye={class:"definition-term"},tye={class:"definition-desc"},jy=Ri(rt({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("dl",X2e,[(k(!0),L(De,null,Ct(t.node.items,(o,s)=>(k(),L(De,{key:s},[A("dt",eye,[U(p(ml),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),A("dd",tye,[U(p(ml),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);jy.install=e=>{e.component(jy.__name,jy)};const nye=["href","title"],Kg=Ri(rt({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),L("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,nye))}}),[["__scopeId","data-v-e1eb37b6"]]);Kg.install=e=>{e.component(Kg.__name,Kg)};const iye=["id"],oye={class:"flex-1"},Hy=rt({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[A("div",oye,[U(p(ml),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,iye))}});Hy.install=e=>{e.component(Hy.__name,Hy)};const sye=["custom-id"],TC=Ri(rt({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ms(()=>t.customId),i=Yt("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:Lh(t.node.children)),s=D(()=>Nt({text:qo,inline_code:Ar,link:Ur,image:Sd,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,checkbox:$l,checkbox_input:$l,footnote_reference:Pl,hardbreak:_d,math_inline:Ja,reference:Hr},n.value));return(r,l)=>(k(),de(zo(`h${e.node.level}`),di({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ue(()=>[o.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(o.value),9,sye)):(k(!0),L(De,{key:1},Ct(e.node.children,(a,u)=>(k(),de(p(zu),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),zk=TC;zk.install=e=>{e.component(TC.__name,TC)};const rye={key:0,dir:"auto",class:"paragraph-node"},lye=["custom-id"],aye={dir:"auto",class:"paragraph-node"},uye=["custom-id"],a1=Ri(rt({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=ms(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return a4((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const v=m.slice(1);if(!v.every(b=>b?.type==="list"))return null;const y=a4([g]);return y?{paragraphChildren:y,nestedLists:v}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?Lh(r.value):null),c=D(()=>{var h;return a()?Lh((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,v;return k(),L("li",di({class:"list-item",dir:"auto"},f.value),[r.value?(k(),L("p",rye,[u.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(u.value),9,lye)):(k(),de(p(B0),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(k(),L(De,{key:1},[A("p",aye,[c.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(c.value),9,uye)):(k(),de(p(B0),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),L(De,null,Ct(l.value.nestedLists,(y,b)=>(k(),de(p(ml),{key:b,nodes:[y],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=w=>h.$emit("copy",w))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),de(p(ml),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(v=(g=n.value)==null?void 0:g.children)!=null?v:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=y=>h.$emit("copy",y))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);a1.install=e=>{e.component(a1.__name,a1)};const u1=Ri(rt({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ms(()=>e.customId),n=D(()=>t.value.list_item||a1);return(i,o)=>(k(),de(zo(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ue(()=>[(k(!0),L(De,null,Ct(e.node.items,(s,r)=>{var l;return k(),de(zo(n.value),di({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);u1.install=e=>{e.component(u1.__name,u1)};const cye={key:2,class:"html-block-node__raw"},dye=["innerHTML"],fye={key:1,class:"html-block-node__placeholder"},Zg=Ri(rt({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Yt("markstreamHtmlPolicy",void 0),i=Yt("markstreamNestedRendererProps",void 0),o=D(()=>{var M,R;return(R=(M=t.htmlPolicy)!=null?M:n?.value)!=null?R:"safe"}),s=D(()=>{var M,R;const q=(M=i?.value)!=null?M:{};return Fn(Nt({},q),{customId:(R=t.customId)!=null?R:q.customId,htmlPolicy:o.value})}),r=Cu({loader:()=>Promise.resolve().then(()=>B7),suspensible:!1}),l=D(()=>{const M=Ry(t.node.attrs,o.value);if(!M)return;const R=Wg(M);return Object.keys(R).length>0?R:void 0}),a=D(()=>{const M=String(t.node.tag||"").trim(),R=Ry(t.node.attrs,o.value,M);if(!R)return;const q=Wg(R);return Object.keys(q).length>0?q:void 0}),u=ms(()=>t.customId),c=rt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=V(null),f=V(typeof window>"u"),h=V(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),v=D(()=>{var M;if(g.value.trim().toLowerCase()!=="details"||(M=t.node.attrs)!=null&&M.some(([q])=>String(q).toLowerCase()==="open"))return null;const R=m.value[0];return R?.type==="html_block"&&String(R.tag||"").toLowerCase()==="summary"?R:null}),y=D(()=>{var M;return Lh((M=v.value)==null?void 0:M.children)}),b=D(()=>{const M=v.value;if(!M)return;const R=Ry(M.attrs,o.value,"summary");if(!R)return;const q=Wg(R);return Object.keys(q).length>0?q:void 0}),w=D(()=>y.value==null?m.value:m.value.slice(1)),C=D(()=>{const M=g.value.trim().toLowerCase();return Vz.has(M)||g7(M,o.value)}),T=D(()=>m.value.length>0&&!!t.node.tag&&!C.value),N=D(()=>{var M,R,q;if(T.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(M=h.value)!=null?M:""};const z=(R=h.value)!=null?R:t.node.content;if(!z)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:l1(z,o.value)};if(t.node.loading){const B=r4(z,u.value,o.value);return B===null?{mode:"text",content:(q=t.node.raw)!=null?q:z}:{mode:"dynamic",nodes:B}}if(!kH(z,u.value))return{mode:"html",content:l1(z,o.value)};const $=r4(z,u.value,o.value);return $===null?{mode:"html",content:l1(z,o.value)}:{mode:"dynamic",nodes:$}}),I=x7(),S=C7(),_=A7(),x=Ya(null),E=!!t.node.loading;return typeof window<"u"?(We([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([M],R,q)=>{var z,$,B,P;if(($=(z=x.value)==null?void 0:z.destroy)==null||$.call(z),x.value=null,!E)return f.value=!0,void(h.value=t.node.content);if(!M)return void(f.value=!1);let H=!0;const j=(P=(B=S?.value.heavyBlockMargin)!=null?B:S?.value.rootMargin)!=null?P:Eh,G=I(M,{rootMargin:j,allowIdle:!_.value});x.value=G,f.value=f.value||G.isVisible.value,G.whenVisible.then(()=>{H&&x.value===G&&(f.value=!0)}),q(()=>{H=!1,G.destroy(),x.value===G&&(x.value=null)})},{immediate:!0}),We(()=>t.node.content,M=>{E&&!f.value||(h.value=M)})):f.value=!0,Xn(()=>{var M,R;(R=(M=x.value)==null?void 0:M.destroy)==null||R.call(M),x.value=null}),(M,R)=>(k(),de(zo(T.value?g.value:"div"),di({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(_)&&!f.value?"true":void 0},T.value?a.value:void 0),{default:ue(()=>[f.value?(k(),L(De,{key:0},[N.value.mode==="structured"?(k(),L(De,{key:0},[y.value!==null?(k(),L(De,{key:0},[A("summary",VG(NO(b.value)),F(y.value),17),w.value.length?(k(),de(p(r),di({key:0},s.value,{nodes:w.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(k(),de(p(r),di({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):N.value.mode==="dynamic"?(k(),de(p(c),{key:1,nodes:N.value.nodes},null,8,["nodes"])):N.value.mode==="text"?(k(),L("pre",cye,F(N.value.content),1)):(k(),L("div",di({key:3},l.value,{innerHTML:N.value.content}),null,16,dye))],64)):(k(),L("div",fye,[Wn(M.$slots,"placeholder",{node:e.node},()=>[R[0]||(R[0]=A("span",{class:"html-block-node__placeholder-bar"},null,-1)),R[1]||(R[1]=A("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),R[2]||(R[2]=A("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Zg.install=e=>{e.component(Zg.__name,Zg)};const hye={dir:"auto",class:"paragraph-node"},pye=["custom-id"],vh=Ri(rt({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ms(()=>t.customId),i=Yt("markstreamHtmlPolicy",void 0),o=Yt("markstreamFade",void 0),s=Yt("markstreamParseOptions",void 0),r=Yt("markstreamCustomMarkdownIt",void 0),l=Yt("markstreamNestedRendererProps",void 0),a=D(()=>{var S;return(S=i?.value)!=null?S:"safe"}),u=D(()=>{var S;return(S=t.parseOptions)!=null?S:s?.value}),c=D(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=D(()=>{var S,_;return(_=t.customHtmlTags)!=null?_:(S=l?.value)==null?void 0:S.customHtmlTags}),f=D(()=>{var S,_;const x=(S=l?.value)!=null?S:{};return Fn(Nt({},x),{customId:(_=t.customId)!=null?_:x.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=Cu({loader:()=>Promise.resolve().then(()=>B7),suspensible:!1});function m(S){var _;return S.type==="text"&&String((_=S.content)!=null?_:"").trim()===""}const g=D(()=>t.node.children.filter(S=>!m(S))),v=D(()=>g.value.length>0&&g.value.every(S=>S.type==="image"||(function(_){var x;const E=(function(M){return M.type==="link"&&Array.isArray(M.children)?M.children.filter(R=>!m(R)):[]})(_);return E.length===1&&((x=E[0])==null?void 0:x.type)==="image"})(S))),y=D(()=>new Set(Uh(d.value))),b=D(()=>{if(!v.value||g.value.length<=1)return t.node.children;const S=[];for(let _=0;_0,M=t.node.children.slice(_+1).some(R=>!m(R));E&&M&&S.push(Fn(Nt({},x),{content:" ",raw:" "}))}return S}),w=D(()=>o?.value===!1&&!n.value.text),C=D(()=>w.value?Lh(b.value):null);function T(S,_){return{node:S,"index-key":`${t.indexKey}-${_}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=D(()=>Nt({inline_code:Ar,image:Sd,link:Ur,hardbreak:_d,emphasis:Vr,strong:Wr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,html_inline:zl,html_block:Zg,emoji:dl,checkbox:$l,math_inline:Ja,checkbox_input:$l,reference:Hr,footnote_anchor:Kg,footnote_reference:Pl,text:qo},n.value)),I=D(()=>b.value.map((S,_)=>{var x;const E=(function(M){var R,q,z,$;if(M.type==="html_block"||M.type==="html_inline"){const B=String((R=M.tag)!=null?R:"").trim().toLowerCase()||Yz(M.content);if(B&&!y.value.has(B)&&Jz((q=M.content)!=null?q:M.raw,B)){const P=String(($=(z=M.content)!=null?z:M.raw)!=null?$:"");return{child:{type:"text",content:P,raw:P},component:qo,isCustomComponent:!1}}}return{child:M,component:N.value[M.type],isCustomComponent:!!(n.value[M.type]&&!Av(String(M.type)))}})(S);return Fn(Nt({},E),{index:_,key:`${t.indexKey||"paragraph"}-${_}`,customAttrs:E.isCustomComponent?w7(E.child,a.value):void 0,hasSlotChildren:Array.isArray(E.child.children)&&E.child.children.length>0,slotContent:String((x=E.child.content)!=null?x:""),originalChild:S})}));return(S,_)=>(k(),L("p",hye,[C.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(C.value),9,pye)):(k(!0),L(De,{key:1},Ct(I.value,x=>{return k(),L(De,{key:x.key},[v.value&&m(x.originalChild)?(k(),L(De,{key:0},[Oe(F((E=x.originalChild,String((M=E.content)!=null?M:""))),1)],64)):x.isCustomComponent?(k(),de(zo(x.component),di({key:1,ref_for:!0},x.customAttrs,{node:x.child,loading:x.child.loading,"index-key":x.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ue(()=>[x.hasSlotChildren?(k(),de(p(h),di({key:0,ref_for:!0},f.value,{nodes:x.child.children,"index-key":x.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):x.slotContent?(k(),de(p(h),di({key:1,ref_for:!0},f.value,{content:x.slotContent,final:!x.child.loading,"index-key":`${x.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),de(zo(x.component),di({key:2,ref_for:!0},T(x.child,x.index)),null,16))],64);var E,M}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);vh.install=e=>{e.component(vh.__name,vh)};const mye={class:"table-node-wrapper"},gye=["aria-busy"],vye={key:0},yye=["custom-id"],kye=["aria-label","onPointerdown"],bye=["custom-id"],wye={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Gg=Ri(rt({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var y;return(y=t.node.loading)!=null&&y}),i=D(()=>{var y;return(y=t.node.rows)!=null?y:[]}),o=V(null),s=V([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(y=>Number.isFinite(y)&&y>0)),u=D(()=>a.value?s.value.map(y=>y>0?{width:`${y}px`}:void 0):[]);ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade));const c=ms(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(y){const b=t.fade===!1&&!d.value,w=!f.value,C=h.get(y);if(C?.children===y.children&&C.textFastPath===b&&C.paragraphFastPath===w)return C.info;const T=a4(y.children,w,!0),N={simpleChildren:T,plainText:T&&b?Lh(T):null};return h.set(y,{children:y.children,textFastPath:b,paragraphFastPath:w,info:N}),N}function g(y){if(!r)return;y.preventDefault();const b=r.startWidth+r.nextStartWidth,w=Math.min(48,Math.floor(b/2)),C=Math.max(w,Math.min(b-w,Math.round(r.startWidth+y.clientX-r.startX))),T=[...r.widths];T[r.index]=C,T[r.index+1]=b-C,s.value=T}function v(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),r=null)}return We(l,()=>{v(),s.value=[]}),Xn(v),(y,b)=>(k(),L("div",mye,[A("table",{ref_key:"tableRef",ref:o,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),L("colgroup",vye,[(k(!0),L(De,null,Ct(e.node.header.cells,(w,C)=>(k(),L("col",{key:C,style:sn(u.value[C])},null,4))),128))])):ee("",!0),A("thead",null,[A("tr",null,[(k(!0),L(De,null,Ct(e.node.header.cells,(w,C)=>(k(),L("th",{key:C,dir:"auto",class:Re([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"])},[m(w).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(m(w).plainText),9,yye)):m(w).simpleChildren?(k(),de(p(B0),{key:1,nodes:m(w).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${C}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(ml),{key:2,nodes:w.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=T=>y.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),C(function(N,I){if(I.button!==0)return;const S=(function(){var E;const M=(E=o.value)==null?void 0:E.querySelectorAll("thead th");return Array.from(M??[],R=>Math.round(R.getBoundingClientRect().width))})(),_=S[N],x=S[N+1];_&&x&&(I.preventDefault(),r={index:N,startX:I.clientX,startWidth:_,nextStartWidth:x,widths:S},s.value=S,window.addEventListener("pointermove",g),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v))})(C,T)},null,40,kye)):ee("",!0)],2))),128))])]),A("tbody",null,[(k(!0),L(De,null,Ct(i.value,(w,C)=>(k(),L("tr",{key:C},[(k(!0),L(De,null,Ct(w.cells,(T,N)=>(k(),L("td",{key:N,class:Re([T.align==="right"?"text-right":T.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(T).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(m(T).plainText),9,bye)):m(T).simpleChildren?(k(),de(p(B0),{key:1,nodes:m(T).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${C}-${N}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(ml),{key:2,nodes:T.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=I=>y.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,gye),U(mo,{name:"table-node-fade"},{default:ue(()=>[n.value?(k(),L("div",wye,[Wn(y.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=A("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=A("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Gg.install=e=>{e.component(Gg.__name,Gg)};const Cye={class:"hr-node"},Wy=Ri({},[["render",function(e,t){return k(),L("hr",Cye)}],["__scopeId","data-v-39b2349c"]]);Wy.install=e=>{e.component(Wy.__name,Wy)};const Aye={class:"unknown-node"},EC=rt({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),L("div",Aye,F(e.node.raw),1))}),qy=Ri(rt({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=ms(()=>t.customId),o=D(()=>Nt({text:qo,paragraph:vh,heading:zk,inline_code:Ar,link:Ur,image:Sd,strong:Wr,emphasis:Vr,strikethrough:qr,insert:pl,subscript:hl,superscript:fl,checkbox:$l,checkbox_input:$l,hardbreak:_d,math_inline:Ja,reference:Hr,list:u1,math_block:_H,table:Gg},i.value));return(s,r)=>(k(),L("div",di({class:n.value},e.node.attrs),[(k(!0),L(De,null,Ct(e.node.children,(l,a)=>{return k(),de(zo((u=l.type,o.value[u]||EC)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);qy.install=e=>{e.component(qy.__name,qy)};const xye=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],DL=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function Sye(e){if(e<=255)return xye[e];let t=0,n=DL.length-1;for(;t<=n;){const i=t+n>>1,o=DL[i];if(eo[1]))return o[2];t=i+1}}return"L"}const _ye=/[ \t\n\r\f]+/g,Mye=/[\t\n\r\f]| {2,}|^ | $/;let k8=null;const Iye=new RegExp("\\p{Script=Arabic}","u"),jd=new RegExp("\\p{M}","u"),_7=new RegExp("\\p{Nd}","u");function FL(e){return Iye.test(e)}function BL(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function xu(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(BL(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(BL(n))return!0}}return!1}const Tye=new Set([" "," ","⁠","\uFEFF"]),Eye=new Set(["-","‐","–","—"]);function MH(e,t){return!((function(n){const i=Qg(n);return i!==null&&Tye.has(i)})(e)||t&&((function(n){const i=Qg(n);return i!==null&&(M7.has(i)||Nh.has(i))})(e)||(function(n){const i=Qg(n);return i!==null&&Eye.has(i)})(e)))}const M7=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),jk=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),I7=new Set(["'","’"]),Nh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Lye=new Set([":",".","،","؛"]),Nye=new Set(["၏"]),Dye=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Fye(e){if(T7(e))return!0;let t=!1;for(const n of e)if(Nh.has(n)||c4(n))t=!0;else if(!t||!jd.test(n))return!1;return t}function Bye(e){for(const t of e)if(!M7.has(t)&&!Nh.has(t))return!1;return e.length>0}function Rye(e){if(T7(e))return!0;for(const t of e)if(!(jk.has(t)||I7.has(t)||jd.test(t)||c4(t)))return!1;return e.length>0}function T7(e){let t=!1;for(const n of e)if(n!=="\\"&&!jd.test(n)){if(!(jk.has(n)||Nh.has(n)||I7.has(n)))return!1;t=!0}return t}function u4(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function Qg(e){if(e.length===0)return null;const t=u4(e,e.length);return e.slice(t)}const Oye=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function c4(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,Oye)}function $ye(e){const t=(function(n){for(const i of n)if(!jd.test(i))return i;return null})(e);return t!==null&&_7.test(t)}function Pye(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(jd.test(i))n--;else{if(!jk.has(i)&&!I7.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function zye(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function RL(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function OL(e,t){return e&&t!==null&&Lye.has(t)}function jye(e){const t=Qg(e);return t!==null&&Nye.has(t)}function Hye(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function LC(e){let t=e.length;for(;t>0;){const n=u4(e,t),i=e.slice(n,t);if(Dye.has(i))return!0;if(!Nh.has(i))return!1;t=n}return!1}function Wye(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const qye=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Na(e){return e.length===1?e[0]:e.join("")}function Uye(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Na(n)}function Vye(e,t,n,i){if(!qye.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=Wye(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:Na(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:Na(r),isWordLike:a,kind:s,start:l}),o}function b8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Kye=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Zye(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Kye.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Xye.has(e)&&!Jye.test(e)&&Yye.test(e)}function $L(e){let t=!1;for(const n of e)if(!jd.test(n)){if(!IH(n))return!1;t=!0}return t}function e9e(e,t,n,i){const o=!t&&$L(e),s=!i&&$L(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=u4(c,d),h=c.slice(f,d);if(!jd.test(h))return h;d=f}return null})(a);return u!==null&&c4(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=u4(a,u),d=a.slice(c,u);if(!jd.test(d))return IH(d)||c4(d);u=c}return!1})(e);return!!(o||s||l)&&!xu(e)&&!xu(n)&&(t||o||r)&&(i||s)}function PL(e){for(const t of e)if(_7.test(t))return!0;return!1}function Uy(e){if(e.length===0)return!1;for(const t of e)if(!_7.test(t)&&!Qye.has(t))return!1;return!0}function t9e(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(k8===null&&(k8=new Intl.Segmenter(void 0,{granularity:"word"})),k8);let g=0;const v=[],y=[],b=[],w=[],C=[],T=[],N=[],I=[],S=[],_=[],x=[],E=[];for(const $ of m.segment(a))for(const B of Vye($.segment,(d=$.isWordLike)!=null&&d,$.index,c)){let P=function(){T[X]!==null&&(y[X]=[RL(v,T,N,X)],T[X]=null),y[X].push(B.text),b[X]=b[X]||B.isWordLike,I[X]=I[X]||G,S[X]=S[X]||ne,_[X]=Q,x[X]=te,E[X]=OL(S[X],W)};const H=B.kind==="text",j=zye(B.text,B.isWordLike,B.kind),G=xu(B.text),ne=FL(B.text),W=Qg(B.text),Q=LC(B.text),te=jye(B.text),X=g-1;u.carryCJKAfterClosingQuote&&H&&g>0&&w[X]==="text"&&G&&I[X]&&_[X]||H&&g>0&&w[X]==="text"&&Bye(B.text)&&I[X]||H&&g>0&&w[X]==="text"&&x[X]?P():H&&g>0&&w[X]==="text"&&B.isWordLike&&ne&&E[X]?(P(),b[X]=!0):j!==null&&g>0&&w[X]==="text"&&T[X]===j?N[X]=((f=N[X])!=null?f:1)+1:H&&!B.isWordLike&&g>0&&w[X]==="text"&&!I[X]&&(Fye(B.text)||B.text==="-"&&b[X])?P():(v[g]=B.text,y[g]=[B.text],b[g]=B.isWordLike,w[g]=B.kind,C[g]=B.start,T[g]=j,N[g]=j===null?0:1,I[g]=G,S[g]=ne,_[g]=Q,x[g]=te,E[g]=OL(ne,W),g++)}for(let $=0;$null);let R=-1;for(let $=g-1;$>=0;$--){const B=v[$];if(B.length!==0){if(w[$]==="text"&&!b[$]&&R>=0&&w[R]==="text"&&(Rye(B)||B==="-"&&$ye(v[R]))){const P=(h=M[R])!=null?h:[];P.push(B),M[R]=P,C[R]=C[$],v[$]="";continue}R=$}}for(let $=0;$G+1){B.push(Na(te)),P.push(ve),H.push("text"),j.push($.starts[G]),G=X;continue}}B.push(ne),P.push(Q),H.push(W),j.push($.starts[G]),G++}return{len:B.length,texts:B,isWordLike:P,kinds:H,starts:j}})((function($){const B=[],P=[],H=[],j=[];for(let G=0;G<$.len;G++){const ne=$.texts[G];if($.kinds[G]==="text"&&ne.includes("-")){const W=ne.split("-");let Q=W.length>1;for(let te=0;te=$.len||b8($.kinds[W]))continue;const Q=[],te=$.starts[W];let X=W;for(;X<$.len&&!b8($.kinds[X]);)Q.push($.texts[X]),X++;Q.length>0&&(B.push(Na(Q)),P.push(!0),H.push("text"),j.push(te),G=X-1)}return{len:B.length,texts:B,isWordLike:P,kinds:H,starts:j}})((function($){const B=$.texts.slice(),P=$.isWordLike.slice(),H=$.kinds.slice(),j=$.starts.slice();for(let ne=0;ne<$.len;ne++){if(H[ne]!=="text"||!Zye($,ne))continue;const W=[B[ne]];let Q=ne+1;for(;Q<$.len&&!b8(H[Q]);){W.push(B[Q]),P[ne]=!0;const te=B[Q].includes("?");if(H[Q]="text",B[Q]="",Q++,te)break}B[ne]=Na(W)}let G=0;for(let ne=0;ne=0&&!MH(u.texts[w-1],c)&&b(w),g<0&&(g=w),v=v||xu(C))}return b(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Nt({normalized:s,chunks:t9e(l,o)},l)}let gp=null;const zL=new Map;let vp=null;const i9e=new RegExp("\\p{Emoji_Presentation}","u"),o9e=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let w8=null;const jL=new Map;function NC(){if(gp!==null)return gp;if(typeof OffscreenCanvas<"u")return gp=new OffscreenCanvas(1,1).getContext("2d"),gp;if(typeof document<"u")return gp=document.createElement("canvas").getContext("2d"),gp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Uc(e,t){let n=t.get(e);return n===void 0&&(n={width:NC().measureText(e).width,containsCJK:xu(e)},t.set(e,n)),n}function d4(){if(vp!==null)return vp;if(typeof navigator>"u")return vp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},vp;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return vp={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},vp}function TH(){return w8===null&&(w8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),w8}function s9e(e){return i9e.test(e)||e.includes("️")}function Lf(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=TH();for(const a of l.segment(s))s9e(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function r9e(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function HL(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function WL(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function E7(e,t){return t===0?0:e+t}function u9e(e,t,n,i,o){return E7(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function qL(e,t,n,i){return E7(i,t==="tab"?0:e.lineEndFitAdvances[n])}function UL(e,t,n,i,o){return E7(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function c9e(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function d9e(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function z2(e,t,n){let i=t;for(;iP){if(be!==null&&oe>K){X(ae,oe,le),ye=oe,ke=z2(be,ke,ye+1),oe=-1,le=0;continue}X(),ce(ae,ye,Ae)}else j+=Ae,ne=ae,W=ye+1;else ce(ae,ye,Ae);const Me=ye+1;be!==null&&be[ke]===Me&&(oe=Me,le=j,ke++),ye++}G&&ne===ae&&W===we.length&&(ne=ae+1,W=0)}let Z=0;for(;Z=q.length)));){const ae=q[Z],K=HL(z[Z]);if(G)if(j+ae>P){if(K){se(Z,ae),X(Z+1,0,j-ae),Z++;continue}if(Q>=0){if(ne>Q||ne===Q&&W>0){X();continue}X(Q,0,te);continue}if(ae>P&&$[Z]!==null){X(),pe(Z,0),Z++;continue}X()}else se(Z,ae),K&&(Q=Z+1,te=j-ae),Z++;else ae>P&&$[Z]!==null?pe(Z,0):ve(Z,ae),K&&(Q=Z+1,te=j-ae),Z++}return G&&X(),H})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=d4(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,v=0,y=-1,b=0,w=null;function C(){y=-1,b=0,w=null}function T(M=g,R=v,q){f++,h=0,m=!1,C()}function N(M,R){m=!0,g=M+1,v=0,h=R}function I(M,R,q){m=!0,g=M,v=R+1,h=q}function S(M,R){m?(h+=R,g=M+1,v=0):N(M,R)}function _(M,R,q,z,$,B){if(!R)return;const P=qL(n,M,q,$);UL(n,M,q,$,z),y=q+1,b=h-B+P,w=M}function x(M,R){var q;const z=r[M],$=(q=l[M])!=null?q:null;let B=$===null?-1:z2($,0,R+1),P=-1,H=R;for(;Hd){if($!==null&&P>R){T(M,P),H=P,B=z2($,B,H+1),P=-1;continue}T(),I(M,H,j)}else h=W,g=M,v=H+1}else I(M,H,j);const G=H+1;$!==null&&$[B]===G&&(P=G,B++),H++}m&&g===M&&v===z.length&&(g=M+1,v=0)}function E(M){f++,C()}for(let M=0;M=R.endSegmentIndex)));){const z=s[q],$=HL(z),B=a9e(n,m,q),P=z==="tab"?l9e(h+B,n.tabStopAdvance):o[q],H=B+P,j=u9e(n,z,q,B,P);if(z!=="soft-hyphen")if(m){if(h+j>d){const G=h+qL(n,z,q,B);if(UL(n,z,q,B,P),w==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){T(y,0);continue}if($&&G<=d){S(q,H),T(q+1,0),q++;continue}if(y>=0&&b<=d){if(g>y||g===y&&v>0){T();continue}const ne=y;T(ne,0),q=ne;continue}if(j>d&&r[q]!==null){T(),x(q,0),q++;continue}T();continue}S(q,H),_(z,$,q,P,B,H),q++}else j>d&&r[q]!==null?x(q,0):N(q,P),_(z,$,q,P,B,H),q++;else m&&(g=q+1,v=0,y=q+1,b=h+a,w=z),q++}m&&(R.consumedEndSegmentIndex,T(R.consumedEndSegmentIndex,0))}return f})(e,t)}let C8=null;function L7(){return C8===null&&(C8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),C8}function h9e(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=LC(d),l=jk.has(d)}function c(d,f){i.push(d),s=s||f;const h=LC(d);r=d.length===1&&Nh.has(d)&&r||h,l=!1}for(const d of L7().segment(e)){const f=d.segment,h=xu(f);i.length!==0?l||M7.has(f)||Nh.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function p9e(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!MH(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||xu(a.text)}return r(t.length),i}function VL(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=L7();for(const o of i.segment(e))n++;return n}function m9e(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function g9e(e,t,n,i,o){const s=d4(),{cache:r,emojiCorrection:l}=(function(E,M){NC().font=E;const R=(function($){let B=zL.get($);return B||(B=new Map,zL.set($,B)),B})(E),q=(function($){const B=$.match(/(\d+(?:\.\d+)?)\s*px/);return B?parseFloat(B[1]):16})(E),z=M?(function($,B){let P=jL.get($);if(P!==void 0)return P;const H=NC();H.font=$;const j=H.measureText("😀").width;if(P=0,j>B+.5&&typeof document<"u"&&document.body!==null){const G=document.createElement("span");G.style.font=$,G.style.display="inline-block",G.style.visibility="hidden",G.style.position="absolute",G.textContent="😀",document.body.appendChild(G);const ne=G.getBoundingClientRect().width;document.body.removeChild(G),j-ne>.5&&(P=j-ne)}return jL.set($,P),P})(E,q):0;return{cache:R,fontSize:q,emojiCorrection:z}})(t,(a=e.normalized,o9e.test(a)));var a;const u=Lf("-",Uc("-",r),l)+(o===0?0:2*o),c=8*Lf(" ",Uc(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=null,b=[],w=[],C=[],T=null,N=Array.from({length:e.len});function I(E,M,R,q,z,$,B,P,H){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(v=!1),f.push(M),h.push(R),m.push(q),g.push(z),b.push(B),w.push(P),d&&C.push(H)}function S(E,M,R,q,z){const $=Uc(E,r),B=d?VL(E,M):0,P=(function(ne,W,Q){return W>1?ne+(W-1)*Q:ne})(Lf(E,$,l),B,o),H=M==="space"||M==="preserved-space"||M==="zero-width-break"?0:P,j=H===0?0:H+(B>0?o:0),G=M==="space"||M==="zero-width-break"?0:P;if(z&&q&&E.length>1){let ne="sum-graphemes";o!==0?ne="segment-prefixes":Uy(E)?ne="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ne="segment-prefixes");const W=(function(te,X,ve,ce,se){if(X.breakableFitAdvances!==void 0&&X.breakableFitMode===se)return X.breakableFitAdvances;X.breakableFitMode=se;const pe=TH(),Z=[];for(const we of pe.segment(te))Z.push(we.segment);if(Z.length<=1)return X.breakableFitAdvances=null,X.breakableFitAdvances;if(se==="sum-graphemes"){const we=[];for(const be of Z){const ke=Uc(be,ve);we.push(Lf(be,ke,ce))}return X.breakableFitAdvances=we,X.breakableFitAdvances}if(se==="pair-context"||Z.length>96){const we=[];let be=null,ke=0;for(const oe of Z){const le=Lf(oe,Uc(oe,ve),ce);if(be===null)we.push(le);else{const ye=be+oe,Ae=Uc(ye,ve);we.push(Lf(ye,Ae,ce)-ke)}be=oe,ke=le}return X.breakableFitAdvances=we,X.breakableFitAdvances}const ae=[];let K="",re=0;for(const we of Z){K+=we;const be=Lf(K,Uc(K,ve),ce);ae.push(be-re),re=be}return X.breakableFitAdvances=ae,X.breakableFitAdvances})(E,$,r,l,ne),Q=W===null||i==="keep-all"?null:(function(te){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(te))return null;const X=[];let ve=0;for(const ce of L7().segment(te))ve++,m9e(ce.segment)&&X.push(ve);return X.length===0?null:X})(E);return void I(E,P,j,G,M,R,W,Q,B)}I(E,P,j,G,M,R,null,null,B)}for(let E=0;E=55296&&te<=56319&&Q+1<$){const se=z.charCodeAt(Q+1);se>=56320&&se<=57343&&(X=se-56320+(te-55296<<10)+65536,ve=2)}const ce=Sye(X);ce!=="R"&&ce!=="AL"&&ce!=="AN"||(P=!0);for(let se=0;se=0&&B[te]==="ET";te--)B[te]="EN";for(te=Q+1;te<$&&B[te]==="ET";te++)B[te]="EN"}for(let Q=0;Q<$;Q++){const te=B[Q];te!=="WS"&&te!=="ES"&&te!=="ET"&&te!=="CS"||(B[Q]="ON")}W=ne;for(let Q=0;Q<$;Q++){const te=B[Q];te==="EN"?B[Q]=W==="L"?"L":"EN":te!=="R"&&te!=="L"||(W=te)}for(let Q=0;Q<$;Q++){if(B[Q]!=="ON")continue;let te=Q+1;for(;te<$&&B[te]==="ON";)te++;const X=(Q>0?B[Q-1]:ne)!=="L"?"R":"L";if(X===((te<$?B[te]:ne)!=="L"?"R":"L"))for(let ve=Q;ve{const e=globalThis;if(e[A8])return e[A8];const t={configs:{},controllers:{},revision:Ya(0),preparedCache:new Map,blockEstimateCache:new Map};return e[A8]=t,t})();let zm=null;const x8=As.revision;function KL(e){var t;return e&&(t=As.configs[e])!=null?t:null}function ZL(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function y9e(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function S8(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!y9e(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` -`)}return o.length>0?o:null}function _8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(zm!=null)return zm;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return zm=!!((s=r.getContext)!=null&&s.call(r,"2d")),zm}catch{return zm=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=As.blockEstimateCache.get(r);if(l)return As.blockEstimateCache.delete(r),As.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const v=`${g}\0${m}\0${h}`,y=As.preparedCache.get(v);if(y)return As.preparedCache.delete(v),As.preparedCache.set(v,y),y.prepared;const b=(function(w,C,T){return(function(N,I,S,_){var x,E;const M=(x=_?.wordBreak)!=null?x:"normal",R=(E=_?.letterSpacing)!=null?E:0;return g9e(n9e(N,d4(),_?.whiteSpace,M),I,!1,M,R)})(w,C,0,T)})(h,m,{whiteSpace:g});for(As.preparedCache.set(v,{prepared:b});As.preparedCache.size>240;){const w=As.preparedCache.keys().next().value;if(!w)break;As.preparedCache.delete(w)}return b})(e,n.font,a),c=(function(h,m,g){const v=f9e(h,m);return{lineCount:v,height:v*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(As.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});As.blockEstimateCache.size>4e3;){const h=As.blockEstimateCache.keys().next().value;if(!h)break;As.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function EH(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=S8(e.children);return s&&n.paragraph?_8(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=S8(e.children),l=n.headings[s];return r&&l?_8(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=S8((o=s[0])==null?void 0:o.children);return r?_8(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=EH(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function jm(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Nf(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function M8(e,t,n=0){return e.diff?S7(t??{},n)?(function(i){const o=Nf(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!v9e.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return jm(Nf(i.originalCode))+jm(Nf(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(jm(Nf(o)),jm(Nf(s)));const r=Nf(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):jm(Nf(e.code,e.loading===!0))}function k9e(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function I8(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=ZL(i.lineHeight,1.5*ZL(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:k9e(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const b9e=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function GL(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))b9e.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function QL(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function YL(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function JL(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const LH=Symbol("MarkstreamMathBlockMinHeightCache");function f9t(){return Yt(LH,null)}const w9e=new Set(["text","inline_code","emoji","footnote_reference"]),C9e=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function Hm(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function Df(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function NH(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(w9e.has(i))return!0;if(!C9e.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(NH)}function DC(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(DC).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function DH(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(DH)})}function A9e(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function x9e(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const v=e,y=String((n=v.type)!=null?n:""),b=Number.isFinite(t)&&t>0?t:640;switch(y){case"heading":return(function(w){var C;const T=Number((C=w.level)!=null?C:w.depth);return T>=4?20:T===3?30:T===2?32:44})(v);case"paragraph":return(function(w,C){const T=String(w??"");if(!T)return 28;const N=Math.max(18,Math.floor(Math.max(320,C)/8)),I=T.split(/\r?\n/).length,S=Math.ceil(T.length/N);return Math.max(1,I,S)<=1?28:Df(T,C,34)})(String((o=(i=v.raw)!=null?i:v.content)!=null?o:""),b);case"list":return(function(w,C){var T;const N=Array.isArray(w.items)?w.items:[];if(!N.length)return 48;const I=Math.max(48,30*N.length+12);let S=12;for(const E of N)S+=A9e(DC(E)||String((T=E.raw)!=null?T:""),C);const _=Math.max(0,S-I);if(N.length>20){const E=Math.round(2.4*N.length);return Math.round(I+Math.max(E,Math.min(_,3*N.length)))}if(_<=0)return I;const x=N.length>8?8*N.length:_;return Math.round(I+Math.min(_,x))})(v,b);case"list_item":return Df(String((r=(s=v.raw)!=null?s:v.content)!=null?r:""),b,34);case"blockquote":return Df(String((a=(l=v.raw)!=null?l:v.content)!=null?a:""),b,56);case"table":return(function(w,C){const T=[...w.header?[w.header]:[],...Array.isArray(w.rows)?w.rows:[]];if(!T.length){const N=Array.isArray(w.children)?w.children.length:3;return Math.max(120,38*N+48)}return Math.max(120,Math.round(4+T.reduce((N,I)=>N+(function(S,_){const x=Math.max(1,S.length),E=Math.max(80,(_-32)/x),M=Math.max(10,Math.floor(E/8)),R=Math.max(1,...S.map(q=>{var z;const $=DC(q)||String((z=q?.raw)!=null?z:"");return Math.ceil($.length/M)||1}));return 54+34*Math.max(0,R-1)+(x<=3&&S.some(DH)?14:0)})((function(S){var _;return Array.isArray(S?.cells)&&(_=S.cells)!=null?_:[]})(I),C),0)))})(v,b);case"code_block":{const w=String((u=v.language)!=null?u:"").trim().toLowerCase(),C=String((d=(c=v.code)!=null?c:v.raw)!=null?d:"");return w==="mermaid"?i4(t4(C)):w==="infographic"?o4(n4(C)):Df(C,b,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(w,C){var T,N,I;const S=w.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((T=S[1])!=null?T:"")?Df(((I=(N=w.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:N[1])==null?void 0:I.replace(/<[^>]*>/g,"").trim())||"Details",C,28,28):Df(w,C,96)})(String((h=(f=v.raw)!=null?f:v.content)!=null?h:""),b);case"thematic_break":return 24;default:return Df(String((g=(m=v.raw)!=null?m:v.content)!=null?g:""),b,40)}}function XL(e,t,n){return Math.min(Math.max(e,t),n)}const S9e=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],_9e=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],M9e=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),FH=["raw","content","code","originalCode","updatedCode"],eN=new WeakMap,tN=new WeakMap;let I9e=1;function La(){return typeof performance<"u"?performance.now():Date.now()}function nN(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Fl(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=eN.get(t);return n||(n=I9e++,eN.set(t,n)),String(n)}function iN(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:Fl(t),customMarkdownIt:Fl(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:Fl(e.validateLink),preTransformTokens:Fl(e.preTransformTokens),postTransformTokens:Fl(e.postTransformTokens),postTransformNodes:Fl(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function oN(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` -`,t-1)+1;return e.slice(n,t).trim()}function sN(e){const t=BH(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function BH(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function RH(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function N7(e){const t=String(e??"");return`${t.length}:${RH(t)}`}function FC(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?N7(r):`${r.length}:${RH(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Fl(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${Fl(i)}`;const s=Fl(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>FC(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${FC(r[u],t,n+1)}`).join(";")}`}return typeof e}function f4(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function OH(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>f4(i)?Hd(i,t,n+1):OH(i,t,n+1)).join(",")}`:f4(e)?Hd(e,t,n):FC(e,t,n)}function T9e(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!FH.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${N7(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${Fl(o)}`:M9e.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${OH(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${Fl(o)}`:""}).filter(Boolean).join(";")}function E9e(e){return FH.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${N7(n)}`:""}).filter(Boolean).join(";")}function Hd(e,t=new WeakMap,n=0){const i=tN.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${Fl(o)}`;const r=Fl(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Hd(m,u,c+1)).join("|"):"";return[a.type,E9e(d),T9e(d,u,c),f.length,h].join(":")})(e,t,n);return tN.set(o,l),l}function $H(e,t){return Hd(e)===Hd(t)}function D7(e,t,n){const i=La(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=La()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function rN(e,t,n){return D7(t,n,()=>Hd(e))}function PH(e,t,n){return rN(e,n,"stabilizeSignatureMs")===rN(t,n,"stabilizeSignatureMs")}function j2(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function lN(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function aN(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function L9e(e,t){return e.length===t.length&&e===t}function F7(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=F7(e,t)}),i??PH(e,t,n)}function F9e(e,t){const n={};for(const i of S9e){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function B9e(e,t){var n;const i=oL(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=V(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let q="",z=0,$=!1,B=!1,P=!1,H=!1;function j(){q="",z=0,$=!1,B=!1,P=!1,H=!1}function G(ne){let W=!1;for(let Q=0;Q{if(!ne||!W.startsWith(ne)||W.length<=ne.length)return j(),[!0,0];let Q=0;q!==ne&&(j(),G(ne),Q=ne.length);const te=W.slice(ne.length),X=G(te);return q=W,[X,Q+te.length]}})();let h,m=0,g=0,v=La(),y=-1,b=0;function w(q){y=Number.isInteger(q)?q:0,b+=1}function C(){h&&(clearTimeout(h),h=void 0)}function T(){C();const q=t.renderContent.value;r.value!==q&&(r.value=q),v=La()}We([t.renderContent,t.effectiveFinal,s],([q,z,$])=>{r.value!==q&&(!$||z||(function(B,P){if(!B&&P||P.length<=80||P.length\s*|`{3,}|~{3,})/.test(H))||H.endsWith(` -`)&&!(function(j){const G=oN(j);if(sN(G))return!1;const ne=BH(G);return ne.length>=2&&ne.some(W=>W.trim())})(P))})(r.value,q)?T():(function(){if(g+=1,h)return;const B=Math.max(0,(function(P){const H=P.parseCoalesceMs;return typeof H=="number"&&Number.isFinite(H)&&H>=0?H:80})(e)-(La()-v));B<=0?T():h=setTimeout(T,B)})())},{flush:"sync",immediate:!0}),Gd(C);const N=D(()=>{var q,z,$,B;return Dhe(e.customHtmlTags,(q=e.parseOptions)==null?void 0:q.customHtmlTags,(B=($=(z=t.customComponentsMap)==null?void 0:z.value)!=null?$:{},Object.entries(B).map(([P,H])=>{const j=Ca(P);return H==null||!j||Av(j)||Uz.has(j)||yv.has(j)?"":j}).filter(Boolean)))}),I=D(()=>{const{key:q,tags:z}=Fhe(N.value);if(!q)return i;const $=o.get(q);if($)return $;const B=oL(t.instanceMsgId,{customHtmlTags:z});return o.set(q,B),B}),S=D(()=>{const q=I.value;if(!e.customMarkdownIt)return q;const z=e.customMarkdownIt(q);return q.__markstreamHasCustomParserExtensions=!0,z.__markstreamHasCustomParserExtensions=!0,z}),_=D(()=>{var q,z;const $=(q=e.parseOptions)!=null?q:{},B=t.effectiveFinal.value,P=N.value,H=B!=null,j=P.length>0;return H||j||$.streamParse==null?Nt(Nt(Fn(Nt({},$),{streamParse:(z=$.streamParse)==null||z}),H?{final:B}:{}),j?{customHtmlTags:P}:{}):$}),x=D(()=>{var q;return new Set(((q=_.value.customHtmlTags)!=null?q:[]).map(z=>String(z).trim().toLowerCase()).filter(Boolean))}),E=D(()=>iN(_.value,S.value,e.customMarkdownIt,{includeFinal:!0})),M=D(()=>iN(_.value,S.value,e.customMarkdownIt,{includeFinal:!1}));We([E,M],([q,z],[$,B])=>{$&&(q===$&&z===B||(T(),z!==B&&(l=[],c="")))},{flush:"sync"});const R=D(()=>{var q,z,$,B,P,H,j,G,ne,W,Q;if((q=e.nodes)!=null&&q.length)return l=[],c="",w(0),Et(e.nodes.slice());const te=r.value;if(!te)return l=[],c="",w(-1),[];const X=t.debugPerformanceEnabled.value,ve=X?La():0,ce=S.value,se=E.value,pe=M.value;a&&se!==a&&(function(ze){var ht,gt;(gt=(ht=ze.stream)==null?void 0:ht.reset)==null||gt.call(ht)})(ce),u&&pe!==u&&(l=[],c="");const Z=Object.keys(($=(z=t.customComponentsMap)==null?void 0:z.value)!=null?$:{}).length>0||typeof _.value.postTransformNodes=="function";Z!==d&&(l=[],c="");const ae=!Z&&l.length>0&&te.startsWith(c)&&pe===u,K=X?nN(ce):null,re=X?{}:void 0,we=aN(ce),be=!we&&!Z,ke=Nt(Nt(Fn(Nt({},_.value),{__reuseStableTopLevelNodes:be}),we?{__disableStreamParse:!0}:{}),re?{__timing:re}:{}),oe=Gj(te,ce,ke),le=X?La():0,ye=X?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Ae,Me=X?j2(oe.length):void 0,fe=0,ie=0,Ee=0;if(ae){const ze=X?La():0,[ht,gt]=(function($t){var jt,Ht;const[Te,Fe]=$t.scanGlobalReferenceAppend($t.previousContent,$t.content),Ve=$t.parseOptions;return[$t.previousDirtyStartIndex>0&&Ve.final!==!0&&!$t.customMarkdownIt&&!aN($t.md)&&!Te&&typeof Ve.preTransformTokens!="function"&&typeof Ve.postTransformTokens!="function"&&typeof Ve.postTransformNodes!="function"&&((Ht=(jt=Ve.customHtmlTags)==null?void 0:jt.length)!=null?Ht:0)===0?$t.previousDirtyStartIndex:0,Fe]})({content:te,previousContent:c,previousDirtyStartIndex:y,parseOptions:_.value,customMarkdownIt:e.customMarkdownIt,md:ce,scanGlobalReferenceAppend:f});Ee=gt;const _t=ht<=0;if(ye){const $t=(function(jt,Ht,Te,Fe={}){var Ve;if(!Ht.length)return{nodes:jt,metrics:j2(jt.length)};const lt=(Ve=Fe.scanStartIndex)!=null?Ve:0,Ft=Fe.reuseDirtyTail!==!1,Lt=(function(nn,it,dt,At=0){const un=Math.min(nn.length,it.length);for(let Qt=Math.min(un,Math.max(0,At));QtHd(ze[_t]))})(Ae,ye,ie):(function(ze,ht=0){for(let gt=Math.max(0,ht);gt((P=K?.total)!=null?P:0);t.logPerf(ht?"parse(stream)":"parse(sync)",Nt(Nt(Nt({rendererId:t.instanceMsgId,ms:Math.round(La()-ve),nodes:Ae.length,contentLength:te.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:qe,referenceDefinitionScanChars:Ee,signatureMs:(H=ye?.signatureMs)!=null?H:0,stabilizeSignatureMs:(j=ye?.stabilizeSignatureMs)!=null?j:0,primeSignatureMs:(G=ye?.primeSignatureMs)!=null?G:0,signatureCallCount:(ne=ye?.signatureCallCount)!=null?ne:0,stabilizeSignatureCallCount:(W=ye?.stabilizeSignatureCallCount)!=null?W:0,primeSignatureCallCount:(Q=ye?.primeSignatureCallCount)!=null?Q:0,stabilizeMs:fe},Me??{}),re?Object.fromEntries(_9e.map(gt=>{var _t;return[gt,(_t=re[gt])!=null?_t:0]})):{}),ze?{streamMode:ze.lastMode,streamDelta:F9e(ze,K),streamStats:ze}:{}))}return Et(Ae)});return{effectiveCustomHtmlTags:N,effectiveCustomHtmlTagsSet:x,mdBase:I,mdInstance:S,mergedParseOptions:_,getParsedNodesDirtyStartIndex:()=>y,getParsedNodesRevision:()=>b,parsedNodes:R}}function R9e(e){const{isClient:t}=e,n=V(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const v=n.value,y=v.has(f);if(h){if(y)return;const w=new Set(v);return w.add(f),void(n.value=w)}if(!y)return;const b=new Set(v);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return av()&&Gd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const $9e={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},uN=/auto|scroll|overlay/i;function P9e(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return uN.test(t)||uN.test(n)}function z9e(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const j9e={class:"m-0 p-0"},H9e=["data-probe"],W9e=Ri(rt(Fn(Nt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),L("div",{class:"height-estimation-probes",style:sn({width:`${e.width}px`}),"aria-hidden":"true"},[A("div",{ref:s=>e.setParagraphWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[U(p(vh),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),A("div",{ref:s=>e.setListItemWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[A("ul",j9e,[U(p(a1),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),A("div",{ref:s=>e.setListWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[U(p(u1),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),L(De,null,Ct(6,s=>A("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[U(p(zk),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,H9e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),cN=rt({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return o4((i=jp(e.estimatedPreviewHeightPx))!=null?i:n4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Tn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Tn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Tn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Tn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Tn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Tn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Tn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Tn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Tn("div",{class:"absolute inset-0"},[Tn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),dN=rt({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return i4((i=jp(e.estimatedPreviewHeightPx))!=null?i:t4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Tn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Tn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Tn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Tn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Tn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Tn("span",{class:"action-icon block"})])))]):null,Tn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Tn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Tn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),q9e={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function $s(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const U9e=["data-custom-id"],V9e=["data-node-index","data-node-type"],fN="typewriter-simple-cursor-target",zH=Ri(rt(Fn(Nt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s(O){if(!(typeof Event<"u"&&O instanceof Event))return typeof O=="string"&&o("copy-code",O),void o("copy",O)}const r=hs(),l=Yt("markstreamNestedRendererProps",void 0);function a(O){const J=r?.vnode.props;return!!J&&(Object.prototype.hasOwnProperty.call(J,O)||Object.prototype.hasOwnProperty.call(J,String(O).replace(/[A-Z]/g,he=>`-${he.toLowerCase()}`)))}function u(O){var J,he;const me=i[O];return a(O)?me:(he=(J=l?.value)==null?void 0:J[O])!=null?he:me}const c=D(()=>{return(O=u("mode"))==="chat"||O==="minimal"||O==="docs"?O:"docs";var O}),d=D(()=>JL(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return(O={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":O.codeRenderer==="pre"||O.codeRenderer==="shiki"||O.codeRenderer==="monaco"?O.codeRenderer:O.renderCodeBlocksAsPre===!1||O.mode==="docs"?"monaco":"pre";var O}),g=D(()=>q9e[c.value]),v=D(()=>{var O;return(O=u("showTooltips"))!=null?O:g.value.showTooltips}),y=D(()=>{var O;return(O=u("fade"))!=null?O:g.value.fade}),b=D(()=>{var O;return(O=u("batchRendering"))!=null?O:g.value.batchRendering}),w=D(()=>{var O;return(O=u("initialRenderBatchSize"))!=null?O:g.value.initialRenderBatchSize}),C=D(()=>{var O;return(O=u("renderBatchSize"))!=null?O:g.value.renderBatchSize}),T=D(()=>{var O;return(O=u("renderBatchDelay"))!=null?O:g.value.renderBatchDelay}),N=D(()=>{var O;return(O=u("renderBatchBudgetMs"))!=null?O:g.value.renderBatchBudgetMs}),I=D(()=>{var O;return(O=u("renderBatchIdleTimeoutMs"))!=null?O:g.value.renderBatchIdleTimeoutMs}),S=D(()=>{var O;return(O=u("deferNodesUntilVisible"))!=null?O:g.value.deferNodesUntilVisible}),_=D(()=>{var O;return(O=u("maxLiveNodes"))!=null?O:g.value.maxLiveNodes}),x=D(()=>{var O;return(O=u("liveNodeBuffer"))!=null?O:g.value.liveNodeBuffer}),E=D(()=>{var O;return(O=u("nodeVirtual"))!=null?O:g.value.nodeVirtual}),M={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return v.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return y.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return w.value},get renderBatchSize(){return C.value},get renderBatchDelay(){return T.value},get renderBatchBudgetMs(){return N.value},get renderBatchIdleTimeoutMs(){return I.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return _.value},get liveNodeBuffer(){return x.value},get nodeVirtual(){return E.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function R(O){o("height-change",O)}function q(O){o("virtual-state-change",O)}function z(O){o("anchor-change",O)}const $=V(),B=V(null),P=V(null),H=V(null),j=ao({1:null,2:null,3:null,4:null,5:null,6:null}),G=V(!1),ne=new Map,W=V(0),Q=V(0),te=V({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function X(O,J){return typeof O!="string"?J:O.trim()||J}function ve(O){const J=Number(O);return Number.isFinite(J)&&J>0?Math.max(1,Math.trunc(J)):640}const ce=D(()=>{var O;const J=(O=M.viewportPriorityOptions)!=null?O:{},he=X(J.rootMargin,Eh);return{rootMargin:he,heavyBlockMargin:X(J.heavyBlockMargin,he),maxTargets:ve(J.maxTargets)}}),se=D(()=>{var O;return(O=ce.value.rootMargin)!=null?O:Eh}),pe=D(()=>{var O;return(O=ce.value.maxTargets)!=null?O:640});function Z(){var O,J;if(((O=i.virtualScroll)==null?void 0:O.enabled)!==!0)return null;const he=(J=i.virtualScroll)==null?void 0:J.scrollRoot;return ae(typeof he=="function"?he():he)}function ae(O){return O?typeof HTMLElement<"u"&&O instanceof HTMLElement?O:typeof O=="object"&&"value"in O?ae(O.value):typeof O=="object"&&"$el"in O?ae(O.$el):null:null}ii(AH,ce);const{isClient:K,renderAsFragment:re,debugPerformanceEnabled:we,resolvedShowTooltips:be,resolvedHtmlPolicy:ke,inheritedSmoothStreaming:oe,ownsTypewriterCursor:le}=(function(O){const J=typeof window<"u",he=q1(),me=Yt("markstreamHtmlPolicy",void 0),Le=Yt("markstreamTypewriterCursor",void 0),$e=Yt("markstreamSmoothStreaming",void 0),Ze=D(()=>O.renderAsFragment===!0),et=D(()=>!!(O.debugPerformance&&J&&typeof console<"u")),mt=D(()=>{var pt;if(typeof O.showTooltips=="boolean")return O.showTooltips;const Ge=(pt=he.showTooltips)!=null?pt:he["show-tooltips"];return Ge===""||Ge===!0||Ge==="true"||Ge!==!1&&Ge!=="false"&&void 0}),tt=D(()=>{var pt,Ge;return(Ge=(pt=O.htmlPolicy)!=null?pt:me?.value)!=null?Ge:"safe"}),ut=D(()=>Le?.value!==!0);return{isClient:J,renderAsFragment:Ze,debugPerformanceEnabled:et,resolvedShowTooltips:mt,resolvedHtmlPolicy:tt,inheritedSmoothStreaming:$e,inheritedTypewriterCursor:Le,ownsTypewriterCursor:ut}})(M),{resolveViewportRoot:ye,resolveScrollContainer:Ae,isReverseFlexScrollRoot:Me,getNormalizedScrollTop:fe,getOffsetTopWithinRoot:ie}=(function(O,J){function he(){var et,mt;return(mt=(et=J.scrollRoot)==null?void 0:et.call(J))!=null?mt:null}function me(et){if(typeof window>"u")return null;const mt=he();if(mt)return mt;const tt=et??O.value;if(!tt)return null;const ut=tt.ownerDocument||document,pt=ut.scrollingElement||ut.documentElement;let Ge=tt;for(;Ge&&Ge!==ut.body&&Ge!==pt;){if(P9e(window.getComputedStyle(Ge))&&z9e(Ge))return Ge;Ge=Ge.parentElement}return null}function Le(et){if(!J.isClient)return!1;try{const mt=window.getComputedStyle(et);return!!(mt.display||"").toLowerCase().includes("flex")&&(mt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function $e(et,mt,tt){var ut,pt;if(tt)return Ze(mt);const Ge=et.scrollTop;if(!Le(et))return Ge;const ct=Ge<0?-Ge:Ge;return Math.max(0,((ut=et.scrollHeight)!=null?ut:0)-((pt=et.clientHeight)!=null?pt:0))-ct}function Ze(et){var mt,tt,ut,pt,Ge;const ct=Number((mt=et.scrollingElement)==null?void 0:mt.scrollTop),xt=Number((ut=(tt=et.documentElement)==null?void 0:tt.scrollTop)!=null?ut:0),vt=Number((Ge=(pt=et.body)==null?void 0:pt.scrollTop)!=null?Ge:0);return Math.max(0,Number.isFinite(ct)?ct:0,Number.isFinite(xt)?xt:0,Number.isFinite(vt)?vt:0)}return{resolveViewportRoot:me,resolveScrollContainer:function(et){var mt,tt,ut,pt;const Ge=he();if(Ge)return Ge;const ct=me((mt=et??O.value)!=null?mt:null);if(ct)return ct;const xt=(pt=(ut=et?.ownerDocument)!=null?ut:(tt=O.value)==null?void 0:tt.ownerDocument)!=null?pt:typeof document<"u"?document:null;return xt?.scrollingElement||xt?.documentElement||null},isReverseFlexScrollRoot:Le,getNormalizedScrollTop:$e,getOffsetTopWithinRoot:function(et,mt){const tt=mt.ownerDocument||et.ownerDocument||document;if((function(ct,xt){return ct===xt.documentElement||ct===xt.body||ct===xt.scrollingElement})(mt,tt))return et.getBoundingClientRect().top+Ze(tt);const ut=mt.getBoundingClientRect(),pt=et.getBoundingClientRect(),Ge=$e(mt,tt,!1);return pt.top-ut.top+Ge}}})($,{isClient:K,scrollRoot:Z});ii("markstreamShowTooltips",be),ii("markstreamHtmlPolicy",ke),ii("markstreamTypewriter",f),ii("markstreamFade",D(()=>M.fade!==!1)),ii("markstreamTypewriterCursor",D(()=>!0)),ii("markstreamTextStreamState",ne),ii("markstreamStreamVersion",W),ii("markstreamParseOptions",D(()=>M.parseOptions)),ii("markstreamCustomMarkdownIt",D(()=>M.customMarkdownIt));const{smoothStreamingEnabled:Ee,renderContent:qe,requestedFinal:ze,effectiveFinal:ht}=(function(O,J){const he=O9e(Nt(Nt({},$9e),O.smoothStreamingOptions)),me=D(()=>{var Ge,ct,xt;return O.smoothStreaming!==!1&&!((Ge=O.nodes)!=null&&Ge.length)&&(O.smoothStreaming===!0||!((ct=J.inheritedSmoothStreaming)!=null&&ct.value))&&(O.smoothStreaming===!0||JL(O.typewriter)!=="off"||((xt=O.maxLiveNodes)!=null?xt:0)<=0)}),Le=V(!J.isClient||O.smoothStreaming===!0);kn(()=>{Le.value=!0});const $e=D(()=>Le.value&&me.value),Ze=D(()=>{var Ge;return $e.value?he.visible.value:(Ge=O.content)!=null?Ge:""}),et=D(()=>{var Ge,ct;const xt=(Ge=O.parseOptions)!=null?Ge:{};return(ct=O.final)!=null?ct:xt.final}),mt=D(()=>{const Ge=et.value;return $e.value&&Ge!=null?!!Ge&&he.caughtUp.value:Ge});let tt=0,ut=!1;function pt(){tt=0,ut=!1}return We([()=>O.content,()=>O.nodes,$e,et],([Ge,ct,xt,vt])=>{if(ct?.length)return pt(),void he.reset("");const Wt=Ge??"";if(!xt)return pt(),he.reset(Wt),void(vt&&he.finish({flush:!0}));const It=he.source.value;if(Wt){if(Wt!==It)if(Wt.startsWith(It)){const en=Wt.slice(It.length),cn=he.pendingChars.value;en.length<=8?(tt++,ut||tt>=2&&cn<=8?(ut=!0,he.reset(Wt)):he.enqueue(en)):(pt(),he.enqueue(en))}else pt(),he.reset(Wt)}else pt(),he.reset("");vt&&he.finish()},{immediate:!0}),{smoothStream:he,smoothStreamingEligible:me,smoothStreamingEnabled:$e,renderContent:Ze,requestedFinal:et,effectiveFinal:mt}})(M,{isClient:K,inheritedSmoothStreaming:oe}),gt=ze.value===!0;ii("markstreamSmoothStreaming",Ee);const _t=V(!1),$t=V(!1),jt=V(!1);let Ht="",Te=!1,Fe=null;function Ve(){K&&Fe!=null&&(window.clearTimeout(Fe),Fe=null)}function lt(){_t.value=!1,Ve()}function Ft(O,J){if(!we.value)return;const he=(function(){if(!we.value)return null;const me=it(Lt),Le=it(Vt),$e=Math.max(nn,Le);if(me<=0&&$e<=0)return null;const Ze={total:me,maxPerFrame:$e,byLabel:(et=Lt,Object.fromEntries(Array.from(et.entries()).sort((mt,tt)=>tt[1]-mt[1]||mt[0].localeCompare(tt[0]))))};var et;return Lt.clear(),Vt.clear(),nn=0,Ze})();console.info(`[markstream-vue][perf] ${O}`,he?Fn(Nt({},J),{layoutReads:he}):J)}We([()=>M.indexKey,()=>M.customId],()=>{var O,J;lt(),$t.value=!1,jt.value=!((O=i.nodes)!=null&&O.length)&&ze.value!==!0&&!!i.content,Ht=(J=qe.value)!=null?J:"",Te=Ht.length>0},{flush:"sync"}),We([()=>i.content,()=>i.nodes,ze],([O,J,he])=>{!J?.length&&he!==!0&&O&&(jt.value=!0)},{flush:"sync",immediate:!0}),We([qe,()=>i.nodes,ze],([O,J,he])=>{const me=O??"";return J?.length||he===!0?(lt(),$t.value=!1,Ht=me,void(Te=!0)):(me.length>0&&(jt.value=!0),Te?(Ht&&me.length>Ht.length&&me.startsWith(Ht)?(_t.value=!0,$t.value=!0,K&&(Ve(),Fe=window.setTimeout(()=>{var Le;Fe=null,ht.value===!0||(Le=i.nodes)!=null&&Le.length||(sp(),_t.value=!1,qu())},1200))):(me.length"u")return null;const $e=window;if($e.__markstreamLayoutReadPerformance)return $e.__markstreamLayoutReadPerformance;const Ze={total:0,maxPerFrame:0,byLabel:{}};return $e.__markstreamLayoutReadPerformance=Ze,Ze})();Le&&(Le.total=Number(Le.total||0)+1,Le.byLabel[me]=Number(Le.byLabel[me]||0)+1,Le.currentFrameTotal=Number(Le.currentFrameTotal||0)+1,Le.frameScheduled||(Le.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>At(Le),0):queueMicrotask(()=>At(Le)):window.requestAnimationFrame(()=>At(Le))))})(O),qt||(qt=!0,K&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(dt):typeof queueMicrotask!="function"?setTimeout(dt,0):queueMicrotask(dt)))}function Qt(O,J){return un(O),J()}const ei=M.customId?`renderer-${M.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,mi=(function(O){const J=new Map;return{scope:O,cache:J,clear:()=>J.clear()}})(ei),Hi=ei;ii(LH,mi);const wi=ms(()=>M.customId),{effectiveCustomHtmlTagsSet:Vo,mergedParseOptions:ot,parsedNodes:Ue,getParsedNodesDirtyStartIndex:st,getParsedNodesRevision:In}=B9e(M,{instanceMsgId:ei,renderContent:qe,effectiveFinal:ht,smoothStreamingEnabled:Ee,debugPerformanceEnabled:we,customComponentsMap:wi,logPerf:Ft});We(Ue,()=>{_t.value||mi.clear(),W.value+=1},{immediate:!0});const kt=D(()=>({customId:M.customId,customHtmlTags:ot.value.customHtmlTags,parseOptions:M.parseOptions,customMarkdownIt:M.customMarkdownIt,htmlPolicy:ke.value,viewportPriority:M.viewportPriority,viewportPriorityOptions:ce.value,mode:c.value,domMode:M.domMode,codeRenderer:m.value,codeBlockStream:M.codeBlockStream,codeBlockDarkTheme:M.codeBlockDarkTheme,codeBlockLightTheme:M.codeBlockLightTheme,codeBlockMonacoOptions:M.codeBlockMonacoOptions,renderCodeBlocksAsPre:M.renderCodeBlocksAsPre,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockProps:M.codeBlockProps,mermaidProps:M.mermaidProps,d2Props:M.d2Props,infographicProps:M.infographicProps,showTooltips:be.value,themes:M.themes,langs:M.langs,isDark:M.isDark,typewriter:f.value,smoothStreamingOptions:M.smoothStreamingOptions,parseCoalesceMs:M.parseCoalesceMs,fade:M.fade}));ii("markstreamNestedRendererProps",kt);const ui=D(()=>Ue.value),_o=D(()=>Ue.value.length),co=V(null),Ns=V(null),Ds=V(null),Fs=V(null),Fo=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Ei=!Fo&&M.customId?KL(M.customId):null,ur=D(()=>Ei?(x8.value,KL(M.customId)):null),Mo=D(()=>{var O;return!!(!re.value&&M.customId&&!Fo&&((O=ur.value)!=null&&O.enabled))}),go=D(()=>!!(K&&Mo.value)),fo=D(()=>{var O;return!!(!re.value&&((O=i.virtualScroll)!=null&&O.enabled))}),Ir=D(()=>fo.value),Bo=V(!1);kn(()=>{Bo.value=!0});const qn=D(()=>!!(K&&fo.value));ii("markstreamHostScrollManaged",qn);const to=D(()=>!!(Bo.value&&qn.value)),fi=D(()=>go.value||qn.value),Zi=D(()=>go.value||to.value),no=D(()=>{var O;return fi.value&&((O=ur.value)==null?void 0:O.textEstimation)!==!1});function Ko(){const O=Q.value||Qt("getMeasuredContainerWidth.clientWidth",()=>{var J;return((J=$.value)==null?void 0:J.clientWidth)||0});return Number.isFinite(O)&&O>0?O:0}const ri=D(()=>{const O=Ko();return O>0?Math.max(1,Math.round(O)):640}),Li=D(()=>{var O,J;return!(ht.value!==!0||fo.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(O=i.nodes)!=null&&O.length||jt.value||!(((J=M.maxLiveNodes)!=null?J:0)<=0))}),Mi=D(()=>{var O;return Li.value?50:Math.max(1,(O=M.maxLiveNodes)!=null?O:320)}),Ni=D(()=>{var O;return Li.value?16:Math.max(0,(O=M.liveNodeBuffer)!=null?O:60)}),_n=D(()=>{var O;return!re.value&&M.nodeVirtual!==!1&&!(((O=M.maxLiveNodes)!=null?O:0)<=0&&!Li.value)&&(M.nodeVirtual===!0?Ue.value.length>0:Ue.value.length>Mi.value)}),gs=D(()=>_n.value||go.value||qn.value),qs=D(()=>M.viewportPriority!==!1),Xo=D(()=>!!qs.value&&!G.value);var Us;Us=D(()=>qs.value),ii(xH,Us);const vo=D(()=>{var O;return!(re.value||M.deferNodesUntilVisible===!1||((O=M.maxLiveNodes)!=null?O:0)<=0||_n.value||Ue.value.length>900||M.viewportPriority===!1)}),Ji=g2e(O=>{var J;return ye((J=O??$.value)!=null?J:null)},qs),{requestFrame:Oi,cancelFrame:$i,hasIdleCallback:je,isTestEnv:Se}=(function(O){const J=O.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,he=O.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,me=O.isClient&&typeof window.requestIdleCallback=="function",Le=(function(){var $e;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ze=($e=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:$e.value;return Ze?.env})();return{requestFrame:J,cancelFrame:he,hasIdleCallback:me,isTestEnv:Le?.NODE_ENV==="test"}})({isClient:K}),Pe=D(()=>ht.value===!0&&!fo.value),{resolvedBatchSize:on,resolvedInitialBatch:Zn,batchingEnabled:Gn,incrementalRenderingActive:Xi,renderedCount:ti,previousRenderContext:vs,adaptiveBatchSize:ys,previousBatchConfig:Je}=(function(O,J){var he;const me=D(()=>{var pt;const Ge=Math.trunc((pt=O.renderBatchSize)!=null?pt:80);return Number.isFinite(Ge)?Math.max(0,Ge):0}),Le=D(()=>{var pt;const Ge=Math.trunc((pt=O.initialRenderBatchSize)!=null?pt:me.value);return Number.isFinite(Ge)?Math.max(0,Ge):me.value}),$e=D(()=>!J.renderAsFragment.value&&O.batchRendering!==!1&&me.value>0&&J.isClient&&!J.isTestEnv),Ze=V(0),et=V({key:O.indexKey,total:0}),mt=V(Math.max(1,me.value||1)),tt=D(()=>{var pt,Ge,ct;return $e.value&&!((pt=J.continuousStreaming)!=null&&pt.value)&&!((Ge=J.forceFullRenderFinalContent)!=null&&Ge.value)&&((ct=O.maxLiveNodes)!=null?ct:0)<=0}),ut=V({batchSize:me.value,initial:Le.value,delay:(he=O.renderBatchDelay)!=null?he:16,enabled:tt.value});return{resolvedBatchSize:me,resolvedInitialBatch:Le,batchingEnabled:$e,incrementalRenderingActive:tt,renderedCount:Ze,previousRenderContext:et,adaptiveBatchSize:mt,previousBatchConfig:ut}})(M,{isClient:K,isTestEnv:Se,renderAsFragment:re,forceFullRenderFinalContent:Pe,continuousStreaming:D(()=>$t.value&&ht.value!==!0)}),Ye=D(()=>{var O;return!re.value&&M.batchRendering!==!1&&on.value>0&&!Se&&((O=M.maxLiveNodes)!=null?O:0)<=0&&!Pe.value}),wt=D(()=>Ye.value),Bt=D(()=>fi.value||wt.value),Bn=D(()=>{var O;return Bt.value&&((O=ur.value)==null?void 0:O.codeBlockEstimation)!==!1}),ci=new Map,Ro=new Map,yo=new WeakMap;let ni=null;const Oo=new WeakMap,gi=new Map,cr=[];let $o=[],ko=[],Bs=-1;const Vs=Ya(cr),ks=new Set,Al=V(0);let Yr=0;const Zl=V(0),_a=D(()=>(Zl.value,Array.from(ci.entries()).sort((O,J)=>O[0]-J[0]))),Gl=V(null),Zo=V(null);let Tr,dr=null,tu=0,xl=null;function bo(){Tr.markFallbackHeightPrefixDirty()}function Sl(O){return Tr.getFallbackNodeHeight(O)}function Rs(O,J){return Tr.estimateHeightRange(O,J)}function bs(O){return Tr.estimateIndexForOffset(O)}const{activeRestoreAnchor:ho,getRelativeScrollTopWithinContainer:_l,setRelativeScrollTopWithinContainer:Ml,resolveAnchorOffset:Ql,clearRestoreReconcile:Il,scheduleRestoreReconcile:fr,captureRestoreAnchor:nu,restoreAnchor:Yl,getAnchorDrift:ju}=(function(O){const{isClient:J,containerRef:he,parsedNodeCount:me,requestFrame:Le,cancelFrame:$e,resolveScrollContainer:Ze,getNormalizedScrollTop:et,getOffsetTopWithinRoot:mt,isReverseFlexScrollRoot:tt,estimateIndexForOffset:ut,estimateHeightRange:pt,getFallbackNodeHeight:Ge,clamp:ct}=O,xt=V(null);let vt=null,Wt=[];function It(){const An=Ze(),zn=he.value;if(!An||!zn)return null;const Jn=An.ownerDocument||zn.ownerDocument||document;if(An===Jn.documentElement||An===Jn.body||An===Jn.scrollingElement){const Wi=zn.getBoundingClientRect();return Math.max(0,-Wi.top)}return Math.max(0,et(An,Jn,!1)-mt(zn,An))}function en(An){var zn;const Jn=Ze(),Wi=he.value;if(!Jn||!Wi)return;const Qs=Math.max(0,An),Os=Jn.ownerDocument||Wi.ownerDocument||document,Ta=Os.defaultView||(typeof window<"u"?window:null);if(Jn===Os.documentElement||Jn===Os.body||Jn===Os.scrollingElement){const ou=et(Jn,Os,!0)+Wi.getBoundingClientRect().top;return void((zn=Ta?.scrollTo)==null||zn.call(Ta,0,Math.max(0,ou+Qs)))}QL(Jn,Os,mt(Wi,Jn)+Qs,{isReverseFlexScrollRoot:ou=>{var Im;return(Im=tt?.(ou))!=null&&Im},getNormalizedScrollTop:et})}function cn(An){const zn=me.value,Jn=ct(An.nodeIndex,0,Math.max(0,zn-1));return pt(0,Jn)+Math.max(0,An.offsetWithinNodePx)}function Cn(){if(vt!=null&&($e?.(vt),vt=null),J)for(const An of Wt)window.clearTimeout(An);Wt=[]}function vn(An){const zn=cn(An),Jn=It();Jn!=null&&Math.abs(Jn-zn)<=.5||en(zn)}return{activeRestoreAnchor:xt,getRelativeScrollTopWithinContainer:It,setRelativeScrollTopWithinContainer:en,resolveAnchorOffset:cn,clearRestoreReconcile:Cn,applyRestoreAnchor:vn,scheduleRestoreReconcile:function(){xt.value&&J&&vt==null&&(vt=Le?Le(()=>{vt=null,xt.value&&vn(xt.value)}):null,vt==null&&xt.value&&vn(xt.value))},captureRestoreAnchor:function(){const An=It(),zn=me.value;if(An==null||zn<=0)return null;const Jn=ct(ut(An+1),0,zn-1),Wi=pt(0,Jn),Qs=Ge(Jn);return{nodeIndex:Jn,offsetWithinNodePx:ct(An-Wi,0,Math.max(0,Qs-1))}},restoreAnchor:function(An){const zn=me.value;if(xt.value={nodeIndex:ct(An.nodeIndex,0,Math.max(0,zn-1)),offsetWithinNodePx:Math.max(0,An.offsetWithinNodePx)},Cn(),vn(xt.value),J)for(const Jn of[0,120,280,480])Wt.push(window.setTimeout(()=>{xt.value&&vn(xt.value)},Jn))},getAnchorDrift:function(An){const zn=It();return zn==null?null:zn-cn(An)}}})({isClient:K,containerRef:$,parsedNodeCount:_o,requestFrame:Oi,cancelFrame:$i,resolveScrollContainer:()=>Gl.value||Ae(),getNormalizedScrollTop:fe,getOffsetTopWithinRoot:ie,isReverseFlexScrollRoot:Me,estimateIndexForOffset:bs,estimateHeightRange:Rs,getFallbackNodeHeight:Sl,clamp:Gs}),{nodeHeights:Y,heightStats:ge,heightTreeSize:Be,heightSumTree:He,heightKnownTree:Qe,averageNodeHeight:Xe,resetHeightMeasurements:yt,pruneHeightMeasurements:Rt,rebuildHeightTrees:Kt,recordNodeHeight:wn,removeNodeHeights:Sn,exportHeightCache:Un,importHeightCache:mn,fenwickRangeSum:fn}=(function(O={}){const J=ao({}),he=ao({total:0,count:0}),me=V(0),Le=V([]),$e=V([]);function Ze(){for(const Ge of Object.keys(J))delete J[Number(Ge)];he.total=0,he.count=0,me.value=0,Le.value=[],$e.value=[]}function et(Ge,ct,xt){for(let vt=ct+1;vt0;vt-=vt&-vt)xt+=Ge[vt];return xt}function tt(Ge){me.value=Ge;const ct=new Array(Ge+1).fill(0),xt=new Array(Ge+1).fill(0);for(const[vt,Wt]of Object.entries(J)){const It=Number(vt),en=Number(Wt);!Number.isFinite(It)||It<0||It>=Ge||!Number.isFinite(en)||en<=0||(et(ct,It,en),et(xt,It,1))}Le.value=ct,$e.value=xt}function ut(Ge){if(!Number.isInteger(Ge)||Ge<0)return!1;const ct=J[Ge];if(!Number.isFinite(ct)||ct<=0)return!1;if(delete J[Ge],he.total=Math.max(0,he.total-ct),he.count=Math.max(0,he.count-1),me.value>Ge){const xt=Le.value,vt=$e.value;xt.length&&vt.length&&(et(xt,Ge,-ct),et(vt,Ge,-1))}return!0}const pt=D(()=>he.count>0?Math.max(12,he.total/he.count):32);return{nodeHeights:J,heightStats:he,heightTreeSize:me,heightSumTree:Le,heightKnownTree:$e,averageNodeHeight:pt,resetHeightMeasurements:Ze,pruneHeightMeasurements:function(Ge){if(Ge<=0)return void Ze();let ct=0,xt=0;for(const[vt,Wt]of Object.entries(J)){const It=Number(vt),en=Number(Wt);!Number.isFinite(It)||It<0||It>=Ge||!Number.isFinite(en)||en<=0?delete J[It]:(ct+=en,xt++)}he.total=ct,he.count=xt},rebuildHeightTrees:tt,recordNodeHeight:function(Ge,ct,xt={}){(function(vt,Wt,It={}){var en;if(!Number.isFinite(Wt)||Wt<=0)return!1;const cn=J[vt];if(cn&&(It.allowShrink===!1&&Wtvt){const Cn=Le.value,vn=$e.value;if(Cn.length&&vn.length)if(cn){const An=Wt-cn;An!==0&&et(Cn,vt,An)}else et(Cn,vt,Wt),et(vn,vt,1)}It.notify!==!1&&((en=O.onHeightRecorded)==null||en.call(O))})(Ge,ct,Fn(Nt({},xt),{notify:!0}))},removeNodeHeight:function(Ge,ct={}){var xt;const vt=ut(Ge);return vt&&ct.notify!==!1&&((xt=O.onHeightRecorded)==null||xt.call(O)),vt},removeNodeHeights:function(Ge,ct={}){var xt;let vt=0;for(const Wt of Ge)ut(Number(Wt))&&vt++;return vt>0&&ct.notify!==!1&&((xt=O.onHeightRecorded)==null||xt.call(O)),vt},exportHeightCache:function(){return Object.entries(J).map(([Ge,ct])=>({index:Number(Ge),height:Number(ct)})).filter(Ge=>Number.isFinite(Ge.index)&&Ge.index>=0&&Number.isFinite(Ge.height)&&Ge.height>0).sort((Ge,ct)=>Ge.index-ct.index)},importHeightCache:function(Ge,ct={}){var xt;if(!Array.isArray(Ge))return;const vt=me.value;let Wt=!1;if(ct.mode!=="merge"){const It=Object.keys(J);if(It.length>0){for(const en of It)delete J[Number(en)];Wt=!0}}for(const It of Ge){const en=Number(It.index),cn=Number(It.height);if(!Number.isInteger(en)||en<0||vt>0&&en>=vt||!Number.isFinite(cn)||cn<=0)continue;const Cn=J[en];Cn&&Math.abs(Cn-cn)<=1||(J[en]=cn,Wt=!0)}Wt&&((function(){let It=0,en=0;const cn=me.value;for(const[Cn,vn]of Object.entries(J)){const An=Number(Cn),zn=Number(vn);!Number.isFinite(An)||An<0||cn>0&&An>=cn||!Number.isFinite(zn)||zn<=0?delete J[An]:(It+=zn,en++)}he.total=It,he.count=en})(),vt>0&&tt(vt),(xt=O.onHeightRecorded)==null||xt.call(O))},fenwickRangeSum:function(Ge,ct,xt){if(xt<=ct)return 0;const vt=mt(Ge,xt-1);return ct<=0?vt:vt-mt(Ge,ct-1)}}})({onHeightRecorded:()=>{bo(),qn.value&&Cm(),ho.value&&fr(),Zo.value&&np(),oo("node-resize")}});function Qn(O){Number.isInteger(O)&&O>=0&&ks.add(O)}function On(O){for(const J of O)Qn(Number(J))}function Ci(O){Yr++;let J=!0;try{const he=O();return J=he!==!1,he}finally{Yr--,Yr===0&&J&&Al.value++}}function io(){$o=[],ko=[],Bs=-1,ks.clear(),Vs.value=cr}function hr(){io(),Ci(()=>yt()),gi.clear()}function Fc(O){!Number.isInteger(O)||O<0||O>=Ue.value.length||gi.set(O,dm(O))}function Jl(O,J,he={}){const me=Y[O];Qn(O),wn(O,J,he);const Le=Y[O];return Object.is(me,Le)?(ks.delete(O),!1):(Le&&Le>0?Fc(O):me&&gi.delete(O),!0)}function Tl(O,J){const he=Qt("getNodeLayoutHeight.slot.offsetHeight",()=>{var me,Le;return(Le=(me=ci.get(O))==null?void 0:me.offsetHeight)!=null?Le:0});return he>0?he:Qt("getNodeLayoutHeight.content.offsetHeight",()=>J.offsetHeight)}function Ie(O,J={}){J.mode!=="merge"?io():On(O.map(he=>he.index)),Ci(()=>mn(O,J)),Wb()}const Ne=D(()=>vo.value&&Xo.value),nt=D(()=>{var O;return!re.value&&M.batchRendering!==!1&&on.value>0&&((O=M.maxLiveNodes)!=null?O:0)<=0}),Pt=D(()=>!re.value&>&&ht.value===!0&&!_n.value&&!fo.value&&!Mo.value&&!Ne.value&&!nt.value),ln=D(()=>!!Ji&&Ne.value),Dn=D(()=>_n.value||qn.value),{focusIndex:Yn,liveRange:jn,updateLiveRange:po}=(function(O,J){const{parsedNodeCount:he,virtualizationEnabled:me,maxLiveNodesResolved:Le,liveNodeBufferResolved:$e,clamp:Ze}=J,et=$e??D(()=>{var ut;return Math.max(0,(ut=O.liveNodeBuffer)!=null?ut:60)}),mt=V(0),tt=ao({start:0,end:0});return{liveNodeBufferResolved:et,focusIndex:mt,liveRange:tt,updateLiveRange:function(){const ut=he.value;if(!me.value||ut===0)return tt.start=0,void(tt.end=ut);const pt=Math.min(Le.value,ut),Ge=et.value,ct=Ze(mt.value-Ge,0,Math.max(0,ut-pt));tt.start=ct,tt.end=Math.min(ut,ct+pt)}}})(M,{parsedNodeCount:_o,virtualizationEnabled:_n,maxLiveNodesResolved:Mi,liveNodeBufferResolved:Ni,clamp:Gs}),ws=new Map,Xl=new Map,Ma=new Map,pf=[],ea=new Map,iu=new Set,am=V(0);let mf=!1;const Hu=D(()=>(am.value,iu.size)),Er=new Map,Ks=new Map,jv=V(0),Gh=D(()=>{jv.value;let O=0;for(const J of Er.values())O+=Math.max(0,J);return O});let Lr=null;const gf=D(()=>{if(!_n.value)return Ue.value.length;const O=Ni.value,J=Math.max(jn.end+O,Zn.value),he=Math.min(Ue.value.length,J);return Math.max(ti.value,he)});function _e(){mf||(mf=!0,queueMicrotask(()=>{mf=!1,am.value+=1}))}function at(O,J,he="node-resize"){if(!K||typeof window>"u")return null;const me=window.setTimeout(()=>{iu.delete(me)&&_e();try{J()}finally{oo(he)}},Math.max(0,O));return iu.add(me),_e(),me}function Ke(O){K&&O!=null&&(iu.delete(O)&&_e(),window.clearTimeout(O))}function bt(){if(K&&typeof window<"u")for(const O of iu)window.clearTimeout(O);iu.size&&(iu.clear(),_e()),pf.length=0,Ma.clear()}function Jt(O){B.value=O}function gn(O){P.value=O}function En(O){H.value=O}const{cancelScheduledFocusSync:Vn,scheduleFocusSync:pn}=(function(O){const{isClient:J,containerRef:he,virtualizationEnabled:me,requestFrame:Le,cancelFrame:$e,syncFocusToScroll:Ze}=O;let et=null;function mt(){var ut,pt,Ge;return(Ge=(pt=(ut=he.value)==null?void 0:ut.ownerDocument)==null?void 0:pt.defaultView)!=null?Ge:typeof window<"u"?window:null}function tt(){if(!et)return;const ut=mt();et.viaTimeout?ut?ut.clearTimeout(et.id):clearTimeout(et.id):$e?.(et.id),et=null}return{cancelScheduledFocusSync:tt,scheduleFocusSync:function(ut={}){if(!me.value)return;if(!J)return void Ze(!0);if(ut.immediate)return tt(),void Ze(!0);if(et)return;const pt=()=>{et=null,Ze()};if(Le)return void(et={id:Le(pt),viaTimeout:!1});const Ge=mt();et={id:Ge?Ge.setTimeout(pt,16):setTimeout(pt,16),viaTimeout:!0}}}})({isClient:K,containerRef:$,virtualizationEnabled:_n,requestFrame:Oi,cancelFrame:$i,syncFocusToScroll:function(O=!1){var J;if(!_n.value)return;const he=Gl.value||Ae();if(!he)return;const me=he.ownerDocument||((J=$.value)==null?void 0:J.ownerDocument)||document,Le=me?.defaultView||(typeof window<"u"?window:null),$e=he===me?.documentElement||he===me?.body,Ze=Ue.value.length;if(Ze<=0)return;if(!$e&&Ze>0&&Me(he)){const vt=Qt("syncFocusToScroll.clientHeight",()=>he.clientHeight||0),Wt=Qt("syncFocusToScroll.scrollTop",()=>he.scrollTop),It=Wt<0?-Wt:Wt;return void Hv(Gs((et=Math.max(0,It)+.5*Math.max(0,vt),Tr.estimateIndexForOffsetFromEnd(et)),0,Math.max(0,Ze-1)),O)}var et;const mt=(function(vt,Wt,It,en){const cn=$.value;if(!cn)return null;const Cn=en?0:Qt("syncFocusToScroll.model.root.getBoundingClientRect",()=>vt.getBoundingClientRect().top),vn=Qt("syncFocusToScroll.model.container.getBoundingClientRect",()=>cn.getBoundingClientRect().top),An=Math.max(0,Cn-vn),zn=en?Qt("syncFocusToScroll.model.viewport.clientHeight",()=>{var Jn,Wi,Qs,Os;return(Os=(Qs=(Wi=It?.innerHeight)!=null?Wi:(Jn=Wt.documentElement)==null?void 0:Jn.clientHeight)!=null?Qs:vt.clientHeight)!=null?Os:0}):Qt("syncFocusToScroll.model.root.clientHeight",()=>vt.clientHeight);return Gs(bs(An+.5*Math.max(0,zn)),0,Math.max(0,Ue.value.length-1))})(he,me,Le,$e);if(mt!=null)return void Hv(mt,O);const tt=$e?null:Qt("syncFocusToScroll.root.getBoundingClientRect",()=>he.getBoundingClientRect()),ut=$e?0:tt.top,pt=$e?Qt("syncFocusToScroll.viewport.clientHeight",()=>{var vt,Wt;return(Wt=(vt=Le?.innerHeight)!=null?vt:he.clientHeight)!=null?Wt:0}):tt.bottom,Ge=_a.value;let ct=null,xt=null;for(const[vt,Wt]of Ge){if(!Wt)continue;const It=Qt("syncFocusToScroll.slot.getBoundingClientRect",()=>Wt.getBoundingClientRect());It.bottom<=ut||It.top>=pt||(ct==null&&(ct=vt),xt=vt)}if(ct==null||xt==null){const vt=$.value;if(!vt)return;const Wt=$e?{top:0}:Qt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>he.getBoundingClientRect()),It=Qt("syncFocusToScroll.fallback.scrollTop",()=>fe(he,me,$e)),en=$e?(()=>{const Cn=Qt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>vt.getBoundingClientRect()),vn=($e?0:Wt.top)-Cn.top;return Math.max(0,vn)})():(()=>{const Cn=ie(vt,he);return Math.max(0,It-Cn)})(),cn=$e?Qt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Cn,vn,An,zn;return(zn=(An=(vn=Le?.innerHeight)!=null?vn:(Cn=me?.documentElement)==null?void 0:Cn.clientHeight)!=null?An:he.clientHeight)!=null?zn:0}):Qt("syncFocusToScroll.fallback.root.clientHeight",()=>he.clientHeight);return void Hv(Gs(bs(en+.5*Math.max(0,cn)),0,Math.max(0,Ue.value.length-1)),!0)}Hv(Math.round((ct+xt)/2),O)}}),{visibleNodeIndices:eo,nodeVisibilityHandles:Cs,nodeVisibilityWatchStops:Zs,nodeVisibilityFallbackTimers:Ia,clearVisibilityFallback:ta,markNodeVisible:Jr,cleanupNodeVisibility:GZ,destroyNodeVisibilityState:bb}=R9e({isClient:K,shouldTrackVisibleNodeIndices:()=>Ne.value,shouldCleanupNodeVisibility:()=>_n.value,onNodeMarkedVisible:O=>{_n.value?pn():Yn.value=Gs(O,0,Math.max(0,Ue.value.length-1))},onNodeVisibilityCleaned:O=>{ci.delete(O)&&t_()}}),{cleanupScrollListener:IS,setupScrollListener:QZ}=(function(O){const{isClient:J,virtualizationEnabled:he,listenerEnabled:me,scrollRootElement:Le,resolveScrollContainer:$e,scheduleFocusSync:Ze,onScroll:et}=O;let mt=null,tt=null;function ut(){mt&&(mt(),mt=null),tt=null,Le.value=null}function pt(Ge){const ct=O.getScrollTop?O.getScrollTop(Ge):Ge.scrollTop;return Math.max(0,Number.isFinite(ct)?Math.abs(ct):0)}return{cleanupScrollListener:ut,setupScrollListener:function(){if(!J)return;if(!((Ge=me?.value)!=null?Ge:he.value))return void ut();var Ge;const ct=$e();if(!ct)return void ut();if(Le.value===ct&&mt)return;ut(),tt=pt(ct);const xt=()=>{if(et?.(),he.value){const vt=(function(Wt){const It=pt(Wt),en=tt;tt=It;const cn=Math.max(480,.75*(Wt.clientHeight||0));return en==null?It>cn?{immediate:!0}:void 0:Math.abs(It-en)>cn?{immediate:!0}:void 0})(ct);vt?Ze(vt):Ze()}};ct.addEventListener("scroll",xt,{passive:!0}),Le.value=ct,mt=()=>{ct.removeEventListener("scroll",xt)}}}})({isClient:K,virtualizationEnabled:_n,listenerEnabled:Dn,scrollRootElement:Gl,resolveScrollContainer:Ae,scheduleFocusSync:pn,onScroll:function(){const O=Zo.value;if(!O)return;const J=cm();if(!J||(function(me){if(gm()>=tu)return xl=null,!1;const Le=xl;if(Le==null)return!0;const $e=Math.abs(me.scrollTop-Le)<=2;return $e||(xl=null),$e})(J))return;const he=WS(J);he!=null?(he<-32||Math.abs(Math.max(0,he)-Math.max(0,O.distanceFromBottomPx))>32)&&tp("restore"):tp("restore")},getScrollTop:O=>{var J;const he=O.ownerDocument||((J=$.value)==null?void 0:J.ownerDocument)||document,me=O===he.documentElement||O===he.body||O===he.scrollingElement;return Qt("scrollListener.getScrollTop",()=>fe(O,he,me))}});function Hv(O,J=!1){const he=Gs(O,0,Math.max(0,Ue.value.length-1));!J&&Math.abs(he-Yn.value)<=1||(Yn.value=he,po())}function Gs(O,J,he){return Math.min(Math.max(O,J),he)}function wb(O=Ue.value.length){const J=st();return!Number.isInteger(J)||J<0?O:Gs(J,0,O)}function Cb(O){return O?.firstElementChild}function TS(O,J){var he;return O?(he=O.matches)!=null&&he.call(O,J)?O:O.querySelector(J):null}function YZ(O,J){O<1||O>6||(j[O]=J)}function ES(){if(!fi.value)return void(Q.value=0);const O=Qt("updateExperimentContainerWidth.clientWidth",()=>{var J,he;return(he=(J=$.value)==null?void 0:J.clientWidth)!=null?he:0});Q.value=O>0?O:0}let um=null;function Ab(){um?.disconnect(),um=null}const LS=dg("ViewportDeferredMarkdownCodeBlockNode",Cu({loader:()=>ro(null,null,function*(){return(yield Jo(()=>import("./index5-CfzaNIoE.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:l4,delay:0,suspensible:!1}),l4);function NS(O){return O===LS}const DS=D(()=>m.value==="pre"?sl:m.value==="shiki"?LS:y8);function FS(){var O;return((O=M.codeBlockProps)==null?void 0:O.showHeader)!==!1}function BS(O,J,he){const me=Y[J],Le=typeof me=="number"&&me>0;if(no.value&&!Le&&!(function($e){return!!wi.value.paragraph&&($e.type==="paragraph"||$e.type==="list_item"||$e.type==="list")})(O)){const $e=EH(O,he,te.value);if($e)return $e}if(Bn.value&&O.type==="code_block"){const $e=(function(Ze){if(Ze.type!=="code_block")return null;const et=h_(Ze,Jv(Ze));return NS(et)?"markdown":et===sl?"pre":et===DS.value||et===y8?"monaco":null})(O);if($e==="monaco"||$e==="markdown"||$e==="pre")return(function(Ze,et){var mt,tt,ut;if(!Ze||Ze.type!=="code_block")return null;const pt=et.rendererKind,Ge=pt!=="pre"&&et.showHeader!==!1,ct=!!Ze.diff;let xt=0,vt=500;if(pt==="monaco"){const It=(mt=et.monacoOptions)!=null?mt:{},en=M8(Ze,It,et.width),cn=(function(vn){const An=typeof vn?.fontSize=="number"&&vn.fontSize>0?vn.fontSize:12;return typeof vn?.lineHeight=="number"&&vn.lineHeight>0?vn.lineHeight:Math.round(1.5*An)})(It),Cn=(function(vn,An){var zn,Jn;const Wi=typeof((zn=vn?.padding)==null?void 0:zn.top)=="number"?vn.padding.top:An?0:8,Qs=typeof((Jn=vn?.padding)==null?void 0:Jn.bottom)=="number"?vn.padding.bottom:An?0:8;return Math.max(0,Wi)+Math.max(0,Qs)})(It,ct);vt=typeof It.MAX_HEIGHT=="number"&&It.MAX_HEIGHT>0?It.MAX_HEIGHT:500,xt=Math.round(en*cn+Cn)}else if(pt==="markdown"){const It=M8(Ze);xt=Math.round(21*It+32)}else{const It=M8(Ze);xt=Math.round(28*It),vt=Number.POSITIVE_INFINITY}const Wt=Math.max(1,Math.min(xt,vt));return Nt({kind:"code-block",height:Math.round(Wt+(Ge?40:0)),contentHeight:Wt,rendererKind:pt},ct&&pt==="monaco"?{diffInline:S7((tt=et.monacoOptions)!=null?tt:{},(ut=et.width)!=null?ut:0)}:{})})(O,{rendererKind:$e,monacoOptions:M.codeBlockMonacoOptions,showHeader:FS(),width:he})}return null}p0(()=>{if(Al.value,Yr>0)return;const O=Ue.value,J=In();if(!O.length||!Bt.value)return $o=[],ko=[],Bs=-1,ks.clear(),void(Vs.value=cr);const he=Q.value||Qt("estimatedNodeHeights.clientWidth",()=>{var tt;return((tt=$.value)==null?void 0:tt.clientWidth)||0});if(!Number.isFinite(he)||he<=0)return $o=[],ko=[],Bs=-1,ks.clear(),void(Vs.value=cr);const me=(function(tt){return[Math.round(tt),no.value,Bn.value,te.value,M.codeBlockMonacoOptions,FS(),m.value,wi.value,x8.value]})(he),Le=$o.length<=O.length&&(Ze=me,($e=ko).length===Ze.length&&$e.every((tt,ut)=>Object.is(tt,Ze[ut])));var $e,Ze;const et=Le&&Bs===J?O.length:Le?wb(O.length):0,mt=Le?Array.from(ks):[];$o.length=O.length;for(let tt=et;tt=0&&ttVs.value);Tr=(function(O){let J=!0,he=[0],me="";function Le(ut){var pt;const Ge=O.nodeHeights[ut];if(Number.isFinite(Ge)&&Ge>0)return Ge;const ct=O.parsedNodes.value[ut],xt=ct?.type,vt=!!((pt=O.hasCustomParagraphComponent)!=null&&pt.call(O)),Wt=O.estimatedNodeHeights.value[ut],It=Wt?.height;if(!(function(cn,Cn,vn){return!!(vn&&Cn?.kind==="simple-text"&&(cn==="paragraph"||cn==="list_item"||cn==="list"))})(xt,Wt,vt)&&Number.isFinite(It)&&It>0)return It;const en=x9e(ct,O.getContainerWidth()||640);return xt==="heading"||xt==="paragraph"&&en<=28&&(function(cn,Cn){if(Cn)return!1;const vn=cn.children;return!Array.isArray(vn)||!vn.length||vn.every(NH)})(ct,vt)?en:Math.max(O.averageNodeHeight.value,en)}function $e(){var ut;const pt=O.parsedNodes.value.length,Ge=O.getPrefixCacheKeyParts().join(":");if(!J&&me===Ge)return he;const ct=new Array(pt+1);ct[0]=0;for(let xt=0;xt=((pt=xt[ct])!=null?pt:0))return ct-1;let vt=0,Wt=ct-1,It=ct-1;for(;vt<=Wt;){const en=vt+Wt>>1;((Ge=xt[en+1])!=null?Ge:0)>=ut?(It=en,Wt=en-1):vt=en+1}return It}function et(ut,pt){var Ge,ct;if(ut>=pt)return 0;if(O.heightEstimationActive.value)return(function(Wt,It){var en,cn;const Cn=O.parsedNodes.value.length,vn=XL(Math.trunc(Wt),0,Cn),An=XL(Math.trunc(It),vn,Cn);if(vn>=An)return 0;const zn=$e();return((en=zn[An])!=null?en:0)-((cn=zn[vn])!=null?cn:0)})(ut,pt);if(O.heightTreeSize.value!==O.parsedNodes.value.length){let Wt=0;for(let It=ut;Itvn<=0?0:O.fenwickRangeSum(vt,0,vn)+(vn-O.fenwickRangeSum(Wt,0,vn))*xt;let en=0,cn=Ge.length-1,Cn=Ge.length-1;for(;en<=cn;){const vn=en+cn>>1;It(vn+1)>=ut?(Cn=vn,cn=vn-1):en=vn+1}return Cn}let ct=ut;for(let xt=0;xt0||ut++}return ut}return{markFallbackHeightPrefixDirty:function(){J=!0},getFallbackNodeHeight:Le,estimateHeightRange:et,estimateIndexForOffset:mt,estimateIndexForOffsetFromEnd:function(ut){var pt,Ge;const ct=O.parsedNodes.value;if(!ct.length)return 0;if(ut<=0)return Math.max(0,ct.length-1);if(O.heightEstimationActive.value){const vt=(pt=$e()[ct.length])!=null?pt:0;return Ze(Math.max(0,vt-ut))}if(O.heightTreeSize.value===ct.length){const vt=et(0,ct.length);return mt(Math.max(0,vt-ut))}let xt=ut;for(let vt=ct.length-1;vt>=0;vt--){const Wt=(Ge=O.nodeHeights[vt])!=null?Ge:O.averageNodeHeight.value;if(xt<=Wt)return vt;xt-=Wt}return 0},getEstimatedNodeHeightCount:tt,buildVirtualHeightSummary:function(ut){var pt;const Ge=O.parsedNodes.value.length;return{totalNodes:Ge,measuredCount:O.heightStats.count,estimatedCount:tt(),averageNodeHeight:O.averageNodeHeight.value,topSpacerHeight:ut.topSpacerHeight,bottomSpacerHeight:ut.bottomSpacerHeight,estimatedTotalHeight:et(0,Ge),width:(pt=ut.width)!=null?pt:O.getContainerWidth()}}}})({parsedNodes:Ue,nodeHeights:Y,heightStats:ge,heightTreeSize:Be,heightSumTree:He,heightKnownTree:Qe,averageNodeHeight:Xe,heightEstimationActive:fi,estimatedNodeHeights:Qh,getContainerWidth:Ko,hasCustomParagraphComponent:()=>!!wi.value.paragraph,getPrefixCacheKeyParts:()=>{var O;const J=Hm(Q.value||Qt("getFallbackHeightPrefix.clientWidth",()=>{var me;return((me=$.value)==null?void 0:me.clientWidth)||0})),he=((O=i.virtualScroll)==null?void 0:O.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Ue.value.length,ge.count,Math.round(ge.total),Math.round(100*Xe.value),he,J,fi.value?1:0,x8.value,W.value,wi.value.paragraph?1:0]},fenwickRangeSum:fn}),We(()=>Ue.value.length,O=>{var J;bo(),O<=0?hr():(ORt(J))),O!==Be.value&&Kt(O))},{immediate:!0});const JZ=D(()=>{if(!_n.value)return Ue.value.map((me,Le)=>({node:me,index:Le}));const O=Ue.value.length,J=Gs(jn.start,0,O),he=Gs(jn.end,J,O);return Ue.value.slice(J,he).map((me,Le)=>({node:me,index:J+Le}))}),xb=D(()=>_n.value?Rs(0,Math.min(jn.start,Ue.value.length)):0),Sb=D(()=>{if(!_n.value)return 0;const O=Ue.value.length;return Rs(Math.min(jn.end,O),O)});function RS(){return Tr.buildVirtualHeightSummary({topSpacerHeight:xb.value,bottomSpacerHeight:Sb.value,width:vf()})}function XZ(){const O=Ue.value,J=RS();return Fn(Nt({},J),{probe:{paragraphReady:!!te.value.paragraph,listItemReady:!!te.value.listItem,listWrapperOverhead:te.value.listWrapperOverhead,headingReadyLevels:Object.entries(te.value.headings).filter(([,he])=>!!he).map(([he])=>Number(he))},nodes:O.map((he,me)=>{var Le,$e,Ze,et,mt,tt,ut,pt,Ge;return{index:me,type:he.type,estimateKind:($e=(Le=Qh.value[me])==null?void 0:Le.kind)!=null?$e:null,rendererKind:(et=(Ze=Qh.value[me])==null?void 0:Ze.rendererKind)!=null?et:null,estimatedHeight:(tt=(mt=Qh.value[me])==null?void 0:mt.height)!=null?tt:null,estimatedContentHeight:(pt=(ut=Qh.value[me])==null?void 0:ut.contentHeight)!=null?pt:null,measuredHeight:(Ge=Y[me])!=null?Ge:null}})})}function _b(){return i.indexKey!=null?String(i.indexKey):fo.value?`virtual-${wo()}`:"markdown-renderer"}function OS(O){const J=String(O),he=`${_b()}-`;if(!J.startsWith(he))return null;const me=J.slice(he.length).match(/^(\d+)(?:$|-)/);if(!me)return null;const Le=Number(me[1]);return!Number.isInteger(Le)||Le<0||Le>=Ue.value.length?null:Le}function wo(){var O,J,he;const me=(O=i.virtualScroll)==null?void 0:O.sessionKey;return String(me!=null&&me!==""?me:(he=(J=i.indexKey)!=null?J:M.customId)!=null?he:ei)}function es(){var O;const J=(O=i.virtualScroll)==null?void 0:O.threadKey;return J==null||J===""?void 0:String(J)}const eG=D(()=>{var O,J,he;return(he=es())!=null?he:String((J=(O=i.indexKey)!=null?O:M.customId)!=null?J:ei)});function Mb(O){var J;return(O??"")===((J=es())!=null?J:"")}function Wu(){var O,J,he;return J=(O=i.virtualScroll)==null?void 0:O.measurementKey,he=(function(){const me=m.value;return(function(Le){var $e,Ze;const et=Le.renderer,mt=et==="monaco"?Le.codeBlockMonacoOptions:void 0,tt=Le.codeBlockProps,ut=et==="shiki";return[Le.isDark?"dark":"light",et==="monaco"?"code-rich":et==="pre"?"code-pre":"code-shiki",Le.codeBlockStream===!1?"code-static":"code-stream",$s(Le.codeBlockMinWidth),$s(Le.codeBlockMaxWidth),...ut?[mve(($e=tt?.themes)!=null?$e:Le.themes,(Ze=tt?.langs)!=null?Ze:Le.langs)]:[],$s(mt?.fontSize),$s(mt?.lineHeight),$s(mt?.fontFamily),$s(mt?.tabSize),$s(mt?.MAX_HEIGHT),$s(mt?.wordWrap),$s(mt?.wrappingIndent),$s(mt?.padding),$s(tt?.showHeader),$s(tt?.showCopyButton),$s(tt?.showExpandButton),$s(tt?.showPreviewButton),$s(tt?.showCollapseButton),$s(tt?.showFontSizeButtons)].join("\0")})({renderer:me,isDark:M.isDark,codeBlockStream:M.codeBlockStream,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockMonacoOptions:me==="monaco"?M.codeBlockMonacoOptions:void 0,codeBlockProps:M.codeBlockProps,themes:me==="shiki"?M.themes:void 0,langs:me==="shiki"?M.langs:void 0})})(),[J==null?"":String(J),he].join("\0")}function vf(){return Ko()}const Wv=D(()=>Hm(vf())),El=D(()=>[Wu(),Wv.value].join("\0")),tG=D(()=>{var O;return fo.value?["virtual",(O=es())!=null?O:"",wo(),El.value].join("\0"):i.indexKey});function Yh(){jv.value+=1}function Ib(O){return!(!O||!Number.isInteger(O.index)||O.index<0||O.index>=Ue.value.length||O.sessionKey!==wo()||O.threadKey!==es()||O.layoutEpochKey!==El.value)}function $S(O){const J=String(O),he=Ks.get(J);return he?Ib(he)?he.index:null:OS(J)}function PS(O="async-node"){(Er.size||Ks.size)&&(Er.clear(),Ks.clear(),Yh(),oo(O))}const Jh=Yt(yC,null),Tb={reportHeight(O,J){if(!qn.value)return;const he=$S(O);if(he==null)return;const me=ws.get(he);if(!me)return;const Le=Number(J),$e=Tl(he,me);(function(Ze,et,mt={}){Ci(()=>Jl(Ze,et,mt))})(he,Number.isFinite(Le)&&Le>0?Math.max(Le,$e||0):$e)},markPending(O){if(!qn.value)return;const J=OS(O);J!=null&&(function(he,me){var Le;const $e=Ks.get(he);if($e&&Ib($e))return Er.set(he,Math.max(0,(Le=Er.get(he))!=null?Le:0)+1),Yh(),void oo("async-node");Er.set(he,1),Ks.set(he,(function(Ze){return{index:Ze,sessionKey:wo(),threadKey:es(),layoutEpochKey:El.value}})(me)),Yh(),oo("async-node")})(String(O),J)},markSettled(O){if(!qn.value)return;const J=String(O),he=$S(O);(he!=null||(function(me){return Er.has(String(me))})(J))&&(function(me){var Le;const $e=(Le=Er.get(me))!=null?Le:0;return!($e<=0||($e<=1?(Er.delete(me),Ks.delete(me)):Er.set(me,$e-1),Yh(),$e===1&&oo("async-node"),0))})(J)&&he!=null&&qu()}};function nG(){let O=0;for(const J of ws.values())O+=Qt("getVisibleDomHeight.offsetHeight",()=>{var he;return(he=J?.offsetHeight)!=null?he:0});return Math.ceil(Math.max(0,O))}ii(yC,{reportHeight(O,J){Tb.reportHeight(O,J),Jh?.reportHeight(O,J)},markPending(O){Tb.markPending(O),Jh?.markPending(O)},markSettled(O){Tb.markSettled(O),Jh?.markSettled(O)}});let Eb,Lb=null,Xh=null;function qv(O){return O!==!1&&O!=null&&O!==""}function zS(){return _n.value?(function(){if(!_n.value)return!0;const O=Ue.value.length,J=Gs(jn.start,0,O),he=Gs(jn.end,J,O);if(J>=he)return!0;for(let me=J;me=gf.value}function Nb(){return ht.value===!0&&!_t.value&&Gh.value===0&&iu.size===0&&ea.size===0&&Lr==null&&zS()}function jS(){var O,J;if(((O=i.virtualScroll)==null?void 0:O.settleMode)!=="manual"||Lb===wo()&&Eb===es())return!0;const he=(J=i.virtualScroll)==null?void 0:J.settledToken;return!!qv(he)&&Xh===Am(he)}function Db(){return Nb()&&jS()}function iG(O,J){return J.totalNodes<=0?O==="final"?"final":"estimate":J.measuredCount>=J.totalNodes?O==="final"?"final":"measured":J.measuredCount>0||J.estimatedCount>0?"mixed":"estimate"}function yf(O="manual",J){const he=RS(),me=(function(Le){return Le||(ht.value!==!0?Ue.value.length>0?"streaming":"estimating":!zS()||ea.size>0||Lr!=null?"measuring":Db()?"settled":"settling")})(J);return{sessionKey:wo(),threadKey:es(),phase:me,nodeCount:he.totalNodes,liveRange:{start:jn.start,end:jn.end},renderedCount:ti.value,measuredCount:he.measuredCount,estimatedCount:he.estimatedCount,averageNodeHeight:he.averageNodeHeight,topSpacerHeight:he.topSpacerHeight,bottomSpacerHeight:he.bottomSpacerHeight,visibleDomHeight:nG(),totalHeight:HS(),width:he.width,final:ht.value===!0,stable:Db(),confidence:iG(me,he),reason:O}}function cm(){const O=Gl.value||Ae(),J=$.value;if(!O||!J)return null;const he=O.ownerDocument||J.ownerDocument||document,me=O===he.documentElement||O===he.body||O===he.scrollingElement,Le=Qt("getScrollBox.scrollTop",()=>fe(O,he,me)),$e=Qt("getScrollBox.scrollHeight",()=>{var et,mt,tt,ut,pt;return me?Math.max((mt=(et=he.documentElement)==null?void 0:et.scrollHeight)!=null?mt:0,(ut=(tt=he.body)==null?void 0:tt.scrollHeight)!=null?ut:0,(pt=O.scrollHeight)!=null?pt:0):O.scrollHeight}),Ze=Qt("getScrollBox.clientHeight",()=>{var et;return me?((et=he.documentElement)==null?void 0:et.clientHeight)||O.clientHeight||0:O.clientHeight});return{root:O,doc:he,isViewportRoot:me,scrollTop:Le,scrollHeight:$e,clientHeight:Ze}}function HS(){const O=Ue.value.length,J=Math.max(0,Rs(0,O)),he=Qt("getRendererLogicalHeight.offsetHeight",()=>{var Le,$e;return($e=(Le=$.value)==null?void 0:Le.offsetHeight)!=null?$e:0}),me=Math.max(0,he>0?he:Qt("getRendererLogicalHeight.scrollHeight",()=>{var Le,$e;return($e=(Le=$.value)==null?void 0:Le.scrollHeight)!=null?$e:0}));return O<=0?Math.ceil(he):_n.value?J>0?Math.max(1,Math.ceil(J),(function(){let Le=xb.value+Sb.value;for(const $e of ci.values())$e&&(Le+=Math.max(0,Qt("getVirtualizedDomLogicalHeight.offsetHeight",()=>$e.offsetHeight||0)));return Math.ceil(Math.max(0,Le))})(),(function(Le,$e){return Le<=0||$e<=0?0:$e<=Le+Math.max(512,.05*Le)?Math.ceil($e):0})(J,me)):Math.max(1,Math.ceil(me)):qn.value?J>0||ge.count>0||Tr.getEstimatedNodeHeightCount()>0?(Xi.value&&ti.value,Math.max(1,Math.ceil(me),Math.ceil(J))):Math.ceil(me):Math.max(1,Math.ceil(me),Math.ceil(J))}function WS(O){const J=$.value;if(!J)return null;const he=Qt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>J.getBoundingClientRect());return(function(Le){return Le.isViewportRoot?Le.clientHeight:Qt("getViewportBottomInRoot.getBoundingClientRect",()=>Le.root.getBoundingClientRect().bottom)})(O)-he.bottom}function oG(O={}){const J=O.requireViewport!==!1,he=(function($e=64){const Ze=cm(),et=$.value;if(!Ze||!et)return!1;const mt=(function(ut){if(ut.isViewportRoot)return{top:0,bottom:ut.clientHeight};const pt=Qt("getVirtualViewportRect.getBoundingClientRect",()=>ut.root.getBoundingClientRect());return{top:pt.top,bottom:pt.bottom}})(Ze),tt=Qt("isRendererNearVirtualViewport.getBoundingClientRect",()=>et.getBoundingClientRect());return tt.bottom>=mt.top-$e&&tt.top<=mt.bottom+$e})();if(J&&!he)return null;const me=(function(){const $e=cm(),Ze=$.value;if(!$e||!Ze||Math.max(0,$e.scrollHeight-$e.scrollTop-$e.clientHeight)>64)return null;const et=WS($e);return et==null?null:et>=-8&&et<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,et)}:null})();if(me)return{anchor:me,captured:!0};const Le=nu();if(Le)return{anchor:{type:"node",nodeIndex:Le.nodeIndex,offsetWithinNodePx:Le.offsetWithinNodePx},captured:he};if(O.allowFallback===!0){const $e=(function(){const Ze=Ue.value.length;return Ze<=0?null:{type:"node",nodeIndex:Gs(Yn.value,0,Math.max(0,Ze-1)),offsetWithinNodePx:0}})();return $e?{anchor:$e,captured:!1}:null}return null}function Fb(O){let J=2166136261;for(let he=0;he>>0).toString(36)}function sG(O,J){let he=O;for(let me=0;me8192?`${me.slice(0,8192)}...${me.length}`:me;return`${me.length}:${Fb(Le)}`})(O)}`;if(typeof O=="function")return"fn";if(typeof O!="object")return typeof O;if(J.has(O))return"cycle";if(he>=6)return"max-depth";J.add(O);try{if(Array.isArray(O)){if(O.length<=160){const tt=[];for(let ut=0;ut=et&&Ze.push(ut)}return[`a:${O.length}`,`h=${$e.join(",")}`,`t=${Ze.join(",")}`,`all=${(mt>>>0).toString(36)}`].join(":")}const me=O,Le=Object.keys(me).filter($e=>{const Ze=me[$e];return $e!=="parent"&&$e!=="el"&&$e!=="component"&&(Ze==null||typeof Ze=="string"||typeof Ze=="number"||typeof Ze=="boolean"||rG.has($e))}).sort();return`o:${Le.length}:${Le.map($e=>`${$e}=${Uv(me[$e],J,he+1)}`).join(";")}`}finally{J.delete(O)}}let Bb=-1,Rb="",kf=[2166136261];function dm(O){const J=Ue.value[O];return J?Fb(Uv(J)):""}function lG(O,J){let he=O;for(let me=0;me>>0}function Ob(){var O,J;const he=W.value;if(Bb===he)return Rb;const me=Ue.value.length;let Le=wb(me);(Bb!==he-1||Le>me||kf.length>>0).toString(36),Bb=he,Rb}function ep(O,J={}){var he;const me=J.includeHeightCache===!0,Le=(he=J.includeContentHash)!=null?he:me,$e=me?(function(et){const mt=(function(){var vt,Wt;const It=Number((Wt=(vt=i.virtualScroll)==null?void 0:vt.heightCacheLimit)!=null?Wt:5e3);return!Number.isFinite(It)||It<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(It))})();if(!Number.isFinite(mt)||et.length<=mt)return et;const tt=new Map,ut=vt=>{!vt||tt.size>=mt||tt.set(vt.index,vt)},pt=Ue.value.length,Ge=Gs(jn.start-2*Ni.value,0,pt),ct=Gs(jn.end+2*Ni.value,Ge,pt);for(const vt of et)vt.index>=Ge&&vt.index=0&&tt.sizevt.index-Wt.index).slice(0,mt)})(Un().map(et=>{var mt;const tt=Ue.value[et.index];return tt?Fn(Nt({},et),{nodeType:String((mt=tt.type)!=null?mt:""),signature:dm(et.index)}):null}).filter(et=>!!et)):[],Ze=oG({allowFallback:J.allowAnchorFallback===!0,requireViewport:J.requireViewport});return Ze||$e.length||J.includeEmptyState===!0?Fn(Nt({sessionKey:O.sessionKey,threadKey:O.threadKey},Ze?{anchor:Ze.anchor,anchorCaptured:Ze.captured}:{anchorCaptured:!1}),{metrics:O,width:O.width,contentHash:Le?Ob():void 0,measurementKey:Wu()||void 0,heightCache:$e.length?$e:void 0}):null}function $b(O){var J,he;const me=cm();if(!me)return;const Le=(function(et){const mt=$.value;if(!mt)return null;const tt=ie(mt,et.root),ut=Ue.value.length,pt=Qt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>mt.offsetHeight||0),Ge=Math.max(0,pt>0?pt:ut>0?Qt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>mt.scrollHeight||0):0),ct=HS();return tt+Math.max(Ge,ct)})(me);if(Le==null)return;const $e=Math.max(0,O.distanceFromBottomPx),Ze=Math.max(0,Le-me.clientHeight-$e);(function(et){tu=gm()+120,xl=et})(Ze),me.isViewportRoot?(he=(J=me.doc.defaultView)==null?void 0:J.scrollTo)==null||he.call(J,0,Ze):QL(me.root,me.doc,Ze,{isReverseFlexScrollRoot:Me,getNormalizedScrollTop:fe})}const Pb=[];function qS(){if(K)for(dr!=null&&($i?.(dr),dr=null);Pb.length;){const O=Pb.pop();O!=null&&window.clearTimeout(O)}}function tp(O){const J=!!Zo.value;Zo.value=null,tu=0,xl=null,qS(),J&&O&&oo(O)}function np(){if(!Zo.value||!K||dr!=null)return;const O=()=>{dr=null;const J=Zo.value;J&&$b(J)};dr=Oi?Oi(O):null,dr==null&&O()}function US(O,J={}){const he=Ue.value.length;return he<=0?[]:O.filter(me=>!(!Number.isInteger(me.index)||me.index<0||me.index>=he)&&!(!Number.isFinite(me.height)||me.height<=0)&&!(J.requireSignature&&!me.signature)&&!(J.requireCompatibilityMetadata&&!me.nodeType&&!me.signature)&&(function(Le){var $e;const Ze=Ue.value[Le.index];return!(!Ze||Le.nodeType&&Le.nodeType!==String(($e=Ze.type)!=null?$e:"")||Le.signature&&Le.signature!==dm(Le.index))})(me))}function VS(O){const J=Hm(vf()),he=Hm(O);return J!==-1&&he!==-1&&J===he}function zb(O){var J;const he=Number(O?.width);if(Number.isFinite(he)&&he>0)return he;const me=Number((J=O?.metrics)==null?void 0:J.width);return Number.isFinite(me)&&me>0?me:null}function KS(O){var J;return O.sessionKey===wo()&&!!Mb(O.threadKey)&&((J=O.measurementKey)!=null?J:"")===Wu()&&!!VS(zb(O))&&!!(function(he){const me=he.heightCache;return!!me?.length&&(ZS(he)?me.some(Le=>!!(Le.nodeType||Le.signature)):me.some(Le=>!!Le.signature))})(O)}function ZS(O){return!!(O.contentHash&&O.contentHash===Ob())}function aG(O){return!ZS(O)}let bf=null,wf=null,Vv=null,fm=null,hm=null;function jb(O){var J;const he=O.map(Le=>{var $e,Ze;return[Le.index,Math.round(10*Le.height),($e=Le.nodeType)!=null?$e:"",(Ze=Le.signature)!=null?Ze:""].join("")}).join(""),me=Hm(vf());return[(J=es())!=null?J:"",wo(),Wu(),Ue.value.length,me,O.length,Fb(he)].join(":")}function GS(O=(J=>(J=i.virtualScroll)==null?void 0:J.heightCache)()){if(!qn.value||!O?.length||Ue.value.length<=0||!VS((J=i.virtualScroll)==null?void 0:J.heightCacheWidth))return!1;var J;const he=US(O,{requireSignature:!0});if(!he.length)return!1;const me=jb(he);return me===bf?(wf="standalone",!0):(Ie(he,{mode:"merge"}),bo(),bf=me,wf="standalone",ym(),oo("restore"),!0)}function Hb(O,J={}){var he,me,Le;if(!qn.value||!O||O.sessionKey!==wo()||!Mb(O.threadKey)||Ue.value.length<=0)return!1;const $e=!!((he=O.heightCache)!=null&&he.length)&&!Kv(),Ze=!O.anchor||O.anchorCaptured===!1&&J.allowUncapturedAnchor!==!0?null:O.anchor,et=J.restoreAnchor===!0&&!!Ze&&!Kv()&&Number(zb(O))>0;let mt=!1;if((me=O.heightCache)!=null&&me.length&&KS(O)){const ut=US(O.heightCache,{requireCompatibilityMetadata:!O.contentHash,requireSignature:aG(O)});ut.length&&(Ie(ut,{mode:"merge"}),bo(),bf=jb(ut),wf="restore",ym(),mt=!0)}if($e||et)return!1;if(!J.restoreAnchor||!Ze)return mt&&oo("restore"),!0;const tt=(function(ut,pt){var Ge;const ct=ut.anchor,xt=ct?ct.type==="bottom"?`bottom:${Math.round(ct.distanceFromBottomPx)}`:`node:${ct.nodeIndex}:${Math.round(ct.offsetWithinNodePx)}`:"none";return[(Ge=es())!=null?Ge:"",wo(),Wu(),Wv.value,pt,xt].join(":")})(O,(Le=J.restoreToken)!=null?Le:"imperative");return Vv===tt?(mt&&oo("restore"),!0):(Vv=tt,(function(ut){const pt=()=>{if(ut.type==="node")return tp(),void Yl({nodeIndex:ut.nodeIndex,offsetWithinNodePx:ut.offsetWithinNodePx});if(Il(),ho.value=null,Zo.value=ut,qS(),$b(ut),K)for(const Ge of[0,120,280,480])Pb.push(window.setTimeout(()=>{const ct=Zo.value;ct&&$b(ct)},Ge))};(function(Ge){if(!_n.value)return!1;const ct=Ue.value.length;return!(ct<=0||(Yn.value=Ge.type==="node"?Gs(Ge.nodeIndex,0,ct-1):ct-1,po(),0))})(ut)?ft(pt):pt()})(Ze),oo("restore"),!0)}function Kv(){const O=vf();return Number.isFinite(O)&&O>0}function QS(O){var J;return O.sessionKey===wo()&&!!Mb(O.threadKey)&&(Ue.value.length<=0||!(!((J=O.heightCache)!=null&&J.length)||Kv())||!(!(O.anchor&&Number(zb(O))>0)||Kv()))}function Wb(){gi.clear();for(const O of Object.keys(Y)){const J=Number(O);Number.isInteger(J)&&J>=0&&J{let J=!1,he=null;const me=()=>{J||(J=!0,he!=null&&window.clearTimeout(he),O())};if(Oi)return Oi(me),void(he=window.setTimeout(me,50));he=window.setTimeout(me,0)})}function qb(O,J=es(),he=El.value){return wo()===O&&es()===J&&El.value===he}function Ub(){return ro(this,arguments,function*(O={}){var J,he,me,Le,$e;const Ze=wo(),et=es(),mt=El.value,tt=(J=O.frames)!=null?J:2,ut=(he=O.timeoutMs)!=null?he:120,pt=(me=O.reason)!=null?me:"manual",Ge=O.expectedSettledTokenKey,ct=O.flushPendingTimers===!0,xt=yf(pt),vt=()=>Fn(Nt({},xt),{phase:xt.final?"settling":xt.phase,stable:!1,confidence:xt.confidence==="final"?"mixed":xt.confidence,reason:pt}),Wt=()=>qb(Ze,et,mt)&&(Ge==null||vm()===Ge);for(let Cn=0;Cnwindow.setTimeout(vn,Cn))})(ut),!Wt()||(ct&&bt(),qu(),pm(),!Wt()))return vt();const It=Nb();It&&(Lb=Ze,Eb=et,((Le=i.virtualScroll)==null?void 0:Le.settleMode)==="manual"&&Ge!=null&&qv(($e=i.virtualScroll)==null?void 0:$e.settledToken)&&vm()===Ge&&(Xh=Am(i.virtualScroll.settledToken)));const en=Wt()&&It&&jS(),cn=yf(pt,en?"final":void 0);return Qb(cn,!0),cn})}let Vb="content",Cf=null,Af=null,Kb=0,mm=null,ip=null,Zb=null,Gb=null;function gm(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function JS(O){var J,he;const me=mm;if(!me)return!0;const Le=(he=(J=i.virtualScroll)==null?void 0:J.heightDiffThresholdPx)!=null?he:1;return Math.abs(O.totalHeight-me.totalHeight)>Le||O.sessionKey!==me.sessionKey||O.phase!==me.phase||O.stable!==me.stable||O.final!==me.final||O.threadKey!==me.threadKey||O.nodeCount!==me.nodeCount||O.measuredCount!==me.measuredCount||O.width!==me.width}function vm(O=(J=>(J=i.virtualScroll)==null?void 0:J.settledToken)()){return $s(O)}function XS(O,J){var he,me;return[O,J.sessionKey,(he=J.threadKey)!=null?he:"",Wu(),Ob(),$s((me=i.virtualScroll)==null?void 0:me.settledToken),Math.round(J.totalHeight),Math.round(J.width)].join("\0")}function ym(){Zb=null,Gb=null,ip=null}function uG(O){const J=O.heightCache;return J?.length?jb(J):""}function km(O){var J,he,me;const Le=O.metrics,$e=O.anchor?(Ze=O.anchor).type==="bottom"?`bottom:${Math.round(Ze.distanceFromBottomPx)}`:`node:${Ze.nodeIndex}:${Math.round(Ze.offsetWithinNodePx)}`:"none";var Ze;return[O.sessionKey,(J=O.threadKey)!=null?J:"",(he=O.measurementKey)!=null?he:Wu(),(me=O.contentHash)!=null?me:"",uG(O),$e,O.anchorCaptured?1:0,Le.liveRange.start,Le.liveRange.end,Le.renderedCount,Le.nodeCount,Math.round(Le.totalHeight),Math.round(Le.width),Le.phase,Le.stable?1:0].join("\0")}function Qb(O,J=!1){if(!qn.value||(function(Ze=!1){return!Ze&&fo.value&&!to.value})(J))return;const he=J||JS(O),me=(function(Ze,et=!1){return et||Ze.stable||Ze.phase==="final"?{state:ep(Ze,{includeHeightCache:!0})}:{state:ep(Ze)}})(O,J),Le=me.state,$e=!!(Le&&(he||(function(Ze,et=!1){return!!et||km(Ze)!==ip})(Le,J)));if(he&&(R(O),mm=O,Kb=gm()),Le&&$e&&(q(Le),Le.anchor&&z(Le.anchor),ip=km(Le)),O.stable){const Ze=XS("settled",O);if(Ze!==Zb){Zb=Ze;const et=ep(O,{includeHeightCache:!0});et&&(q(et),ip=km(et)),(function(mt){o("render-settled",mt)})(O)}}if(O.phase==="final"){const Ze=XS("final",O);if(Ze!==Gb){Gb=Ze;const et=ep(O,{includeHeightCache:!0});et&&(q(et),ip=km(et)),(function(mt){o("render-final",mt)})(O)}}}function Yb(){Cf!=null&&($i?.(Cf),Cf=null),Af!=null&&K&&(window.clearTimeout(Af),Af=null)}function e_(){Cf=null,Af=null,(function(O){if(ea.size>0||Lr!=null)return!0;switch(O){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Vb)&&(qu(),pm()),Qb(yf(Vb))}function oo(O){var J,he;if(!qn.value||(Vb=O,Cf!=null||Af!=null))return;const me=Math.max(0,(he=(J=i.virtualScroll)==null?void 0:J.emitIntervalMs)!=null?he:32),Le=Math.max(0,me-(gm()-Kb)),$e=()=>{Af=null,Cf=Oi?Oi(e_):null,Cf==null&&e_()};K&&Le>0?Af=window.setTimeout($e,Le):$e()}function t_(){Zl.value+=1}function Zv(O){if(Xi.value&&O>=ti.value){const J=Ue.value[O],he=ze.value===!0&&ht.value!==!0&&O>=Ue.value.length-2,me=J?.type==="code_block"||J?.type==="image"||J?.type==="mermaid"||J?.type==="infographic";if(!he||me)return!1}return!Ne.value||O=pe.value&&(G.value||(G.value=!0,bb()),!ln.value||!Ji))return op(O),void(J&&Jr(O,!0));if(O{if(Ia.delete($e),!Ne.value||eo.value.has($e))return;const mt=ci.get($e);if(!mt)return;const tt=Ae(mt),ut=mt.ownerDocument||document,pt=ut.defaultView||window,Ge=!tt||tt===ut.documentElement||tt===ut.body,ct=!Ge&&tt?Qt("nodeVisibilityFallback.root.getBoundingClientRect",()=>tt.getBoundingClientRect()):null,xt=Ge?0:ct.top,vt=Ge?Qt("nodeVisibilityFallback.clientHeight",()=>{var It,en;return(en=(It=pt.innerHeight)!=null?It:tt?.clientHeight)!=null?en:0}):ct.bottom,Wt=Qt("nodeVisibilityFallback.node.getBoundingClientRect",()=>mt.getBoundingClientRect());Wt.bottom>=xt-500&&Wt.top<=vt+500&&Jr($e,!0)},1800+Ze);Ia.set($e,et)})(O);let Le=null;Le=We(()=>me.isVisible.value,$e=>{if($e){ta(O),Jr(O,!0),Le?.(),Zs.delete(O),Cs.get(O)===me&&Cs.delete(O);try{me.destroy()}catch{}}},{immediate:!0}),Zs.set(O,Le),_n.value&&pn()}function Jb(){Lr=null,Ci(()=>{let O=!1;for(const[J,he]of ea)ea.delete(J),ws.get(J)===he.el&&Xl.get(J)===he.version&&(O=Jl(J,he.height,{allowShrink:he.allowShrink})||O);return O})}function sp(){Lr!=null&&($i?.(Lr),Lr=null),ea.clear()}function Qv(O,J){(function(he,me,Le){var $e;if(!Number.isFinite(Le)||Le<=0||ws.get(he)!==me)return;const Ze=Xl.get(he);if(Ze==null)return;const et=Ue.value[he],mt=_t.value&&ht.value!==!0&&!(($e=i.nodes)!=null&&$e.length)&&he>=Ue.value.length-2,tt=!(et?.loading===!0||mt),ut=ea.get(he),pt=ut?ut.allowShrink&&tt:tt,Ge=ut&&!pt?Math.max(ut.height,Le):Le;ea.set(he,{height:Ge,allowShrink:pt,version:Ze,el:me}),Lr==null&&(Lr=Oi?Oi(Jb):null,Lr==null&&Jb())})(O,J,Tl(O,J))}function qu(){for(const[O,J]of ws)J&&Qv(O,J)}function n_(){ni?.disconnect(),ni=null,Ro.clear()}function Xb(){for(;pf.length;)Ke(pf.pop())}We(to,O=>{O&&oo("content")},{flush:"post"}),t({getVirtualMetrics:yf,captureVirtualState:function(O={}){var J;return ep(yf("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:O.allowFallbackAnchor===!0,requireViewport:O.requireViewport===!0,includeEmptyState:(J=O.includeEmptyState)==null||J})},restoreVirtualState:function(O,J={}){const he=J.restoreAnchor===!0,me=J.restoreToken==null?"imperative":String(J.restoreToken);fm=O,hm={restoreAnchor:he,restoreToken:me,allowUncapturedAnchor:J.allowUncapturedAnchor===!0},!Hb(O,{restoreAnchor:he,restoreToken:me,allowUncapturedAnchor:J.allowUncapturedAnchor===!0})&&QS(O)||(fm=null,hm=null)},forceMeasure:function(O="manual"){return ro(this,null,function*(){yield ft(),yield YS(),qu(),pm(),yield ft();const J=yf(O);return Qb(J,!0),J})},settle:Ub,scrollToNode:function(O,J="start"){tp(),Il();const he=Ue.value.length;if(he<=0)return;const me=Gs(O,0,he-1),Le=()=>{var $e;const Ze=Ql({nodeIndex:me,offsetWithinNodePx:0}),et=Sl(me),mt=cm(),tt=($e=mt?.clientHeight)!=null?$e:0,ut=_l();let pt=Ze;if(J==="center")pt=Ze-tt/2+et/2;else if(J==="end")pt=Ze-tt+et;else if(J==="nearest"&&ut!=null){if(Ze>=ut&&Ze+et<=ut+tt)return;pt=Zegs.value,O=>{if(!O){n_();for(const J of Ma.values())for(const he of J)Ke(he);Ma.clear(),Xl.clear(),Xb(),sp()}},{immediate:!0}),We(ht,O=>{O&&(function(){if(K&&ht.value&&ws.size){Xb();for(const J of[80,240,640]){const he=at(J,()=>{for(const[me,Le]of ws)Le&&Qv(me,Le)},"final");he!=null&&pf.push(he)}}})(),oo(O?"final":"content")});const cG=YL(()=>oo("content"),16),dG=YL(()=>oo("batch"),16);We([()=>Ue.value.length,()=>ti.value],()=>{Zo.value&&np(),cG()},{flush:"post",immediate:!0}),We([()=>jn.start,()=>jn.end],()=>{dG()},{flush:"post"});const{cleanupBatchScheduler:fG}=(function(O){const{props:J,isClient:he,isTestEnv:me,parsedNodesIdentity:Le,parsedNodeCount:$e,desiredRenderedCount:Ze,datasetKey:et,batchingEnabled:mt,incrementalRenderingActive:tt,resolvedBatchSize:ut,resolvedInitialBatch:pt,renderedCount:Ge,adaptiveBatchSize:ct,previousRenderContext:xt,previousBatchConfig:vt,requestFrame:Wt,cancelFrame:It,hasIdleCallback:en,cleanupNodeVisibility:cn,onDatasetKeyChanged:Cn,onDatasetChanged:vn}=O;let An=null,zn="raf",Jn=null,Wi=0,Qs=!1,Os=!1;const Ta=new Set,ou=new Set;function Im(){if(he){An!=null&&(zn==="raf"&&It?It(An):zn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(An):zn==="timeout"&&window.clearTimeout(An),An=null),Wi+=1;for(const pr of Ta)It&&It(pr);for(const pr of ou)window.clearTimeout(pr);Ta.clear(),ou.clear(),Jn=null,Qs=!1,Os=!1}}function s2(){return typeof performance<"u"?performance.now():Date.now()}function b_(pr){(function(Uu){var Rc;if(!tt.value)return;const Vu=Math.max(2,(Rc=J.renderBatchBudgetMs)!=null?Rc:6),Ku=Math.max(1,ut.value||1),Ea=Math.max(1,Math.floor(Ku/4));Uu>1.5*Vu?ct.value=Math.max(Ea,Math.floor(.8*ct.value)):Uu<.6*Vu&&ct.value=Vu)return;const Ku=Math.max(1,pr),Ea=()=>{const ap=s2();An=null;const Tm=Jn??Ku;Jn=null;const up=s2();Ge.value=Math.min(Vu,Ge.value+Tm),cn(Ge.value),(function(r3,r2){if(!he)return void b_(r2);Qs=!0;const x_=++Wi;ft().then(()=>{var S_;if(x_!==Wi)return;const DG=s2(),FG=Math.max(r2,DG-r3),__=()=>{x_===Wi&&b_(FG)};if(Wt){let Sf=null,cp=null,I_=!1;const T_=()=>{I_||(I_=!0,Sf!==null&&(Ta.delete(Sf),Sf=null),cp!==null&&(ou.delete(cp),window.clearTimeout(cp),cp=null),__())};return Sf=Wt(()=>{T_()}),Ta.add(Sf),cp=window.setTimeout(()=>{Sf!==null&&It&&It(Sf),T_()},Math.max(32,(S_=J.renderBatchIdleTimeoutMs)!=null?S_:120)),void ou.add(cp)}const M_=window.setTimeout(()=>{ou.delete(M_),__()},0);ou.add(M_)})})(ap,s2()-up)};if(!he||el.immediate)return void Ea();const Oc=Math.max(0,(Uu=J.renderBatchDelay)!=null?Uu:16);if(Jn=Jn!=null?Math.max(Jn,Ku):Ku,An==null){if(!me&&en&&window.requestIdleCallback){const ap=Math.max(0,(Rc=J.renderBatchIdleTimeoutMs)!=null?Rc:120);return zn="idle",void(An=window.requestIdleCallback(()=>Ea(),{timeout:ap}))}if(Wt&&!me)return zn="raf",void(An=Wt(()=>{Oc===0?Ea():(zn="timeout",An=window.setTimeout(()=>Ea(),Oc))}));zn="timeout",An=window.setTimeout(()=>Ea(),Oc)}}function C_(pr,el={}){Qs?Os=!0:pr==null?A_():w_(pr,el)}function A_(){tt.value&&w_(mt.value?Math.max(1,Math.round(ct.value)):Math.max(1,ut.value))}return We([Le,$e,et,tt,ut,pt,()=>J.renderBatchDelay],()=>{var pr;const el=$e.value,Uu=xt.value,Rc=et.value,Vu=!Object.is(Rc,Uu.key),Ku=el!==Uu.total,Ea=Vu||Ku;xt.value={key:Rc,total:el};const Oc=vt.value,ap=(pr=J.renderBatchDelay)!=null?pr:16,Tm=Oc.batchSize!==ut.value||Oc.initial!==pt.value||Oc.delay!==ap||Oc.enabled!==tt.value;vt.value={batchSize:ut.value,initial:pt.value,delay:ap,enabled:tt.value},Vu&&Cn(el),(Ea||Tm||!tt.value)&&Im(),(Ea||Tm)&&(ct.value=Math.max(1,ut.value||1)),Ea&&vn();const up=Ze.value;if(!el)return Ge.value=0,void cn(0);if(!tt.value)return Ge.value=up,void cn(Ge.value);const r3=Vu||Uu.total===0;Ge.value=r3||Tm?Math.min(up,pt.value):Math.min(Ge.value,up);const r2=Math.max(1,pt.value||ut.value||el);Ge.value{tt.value&&(typeof el=="number"&&pr<=el||pr>Ge.value&&C_())}),{cleanupBatchScheduler:Im}})({props:M,isClient:K,isTestEnv:Se,parsedNodesIdentity:ui,parsedNodeCount:_o,desiredRenderedCount:gf,datasetKey:tG,batchingEnabled:Gn,incrementalRenderingActive:Xi,resolvedBatchSize:on,resolvedInitialBatch:Zn,renderedCount:ti,adaptiveBatchSize:ys,previousRenderContext:vs,previousBatchConfig:Je,requestFrame:Oi,cancelFrame:$i,hasIdleCallback:je,cleanupNodeVisibility:GZ,onDatasetKeyChanged:O=>{sp(),hr(),bo(),ym(),O>0&&Kt(O)},onDatasetChanged:()=>{_n.value&&pn({immediate:!0})}});We([Dn,_n,()=>$.value,()=>Z()],([O,J])=>{if(!O)return IS(),void Vn();QZ(),J?pn({immediate:!0}):Vn()},{flush:"post",immediate:!0}),We([()=>Ue.value.length,()=>_n.value],O=>ro(null,[O],function*([J,he]){he&&J&&K&&(yield ft(),pn({immediate:!0}))}),{flush:"post"}),We(fi,O=>{O&&(function(){var J;if(co.value&&Ns.value&&Ds.value&&((J=Fs.value)!=null&&J[1]))return;const he=Et({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),me=Et({type:"list_item",children:[he],raw:"- Probe paragraph text"}),Le=Et({type:"list",ordered:!1,items:[me],raw:"- Probe paragraph text"});co.value=he,Ns.value=me,Ds.value=Le;const $e={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ze=1;Ze<=6;Ze++)$e[Ze]=Et({type:"heading",level:Ze,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ze)} Probe heading`});Fs.value=$e})()},{immediate:!0}),We([()=>$.value,fi],()=>{if(!fi.value)return Ab(),void(Q.value=0);ES(),Ab(),fi.value&&$.value&&typeof ResizeObserver<"u"&&(um=new ResizeObserver(()=>{ES(),ho.value&&fr(),Zo.value&&np(),oo("resize")}),um.observe($.value))},{immediate:!0}),We([fi,ri,El],()=>ro(null,null,function*(){if(!fi.value)return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void bo();yield ft(),(function(){if(!fi.value||typeof window>"u")return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void bo();const O={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},J=TS(Cb(B.value),".paragraph-node");O.paragraph=I8(B.value,J,"pre-wrap");const he=Cb(P.value),me=he?.querySelector(".paragraph-node");O.listItem=I8(P.value,me,"pre-wrap");const Le=Qt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ze,et;return(et=(Ze=H.value)==null?void 0:Ze.offsetHeight)!=null?et:0}),$e=Qt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ze,et;return(et=(Ze=P.value)==null?void 0:Ze.offsetHeight)!=null?et:0});O.listWrapperOverhead=Math.max(0,Le-$e);for(let Ze=1;Ze<=6;Ze++){const et=TS(Cb(j[Ze]),`h${Ze}`);O.headings[Ze]=I8(j[Ze],et,"pre-wrap")}te.value=O,bo()})()}),{flush:"post",immediate:!0}),We(()=>Ue.value.length,()=>{_n.value&&pn({immediate:!0})}),We([fi,Q],()=>{bo(),_n.value&&pn({immediate:!0}),ho.value&&fr(),Zo.value&&np(),oo("resize")},{immediate:!1}),We(()=>Ne.value,O=>{if(O)for(const[J,he]of ci)Gv(J,he);else if(bb(),_n.value)pn({immediate:!0});else for(const[J,he]of ci)he&&Jr(J,!0)},{immediate:!1}),We([se,pe,()=>Z()],()=>{var O;(O=Ji.refresh)==null||O.call(Ji);for(const[J,he]of ci)Gv(J,he)},{immediate:!1}),We([()=>M.viewportPriority,()=>Ue.value.length,pe],([O,J,he])=>{if(O!==!1){if(G.value&&(J<=200||J<=he)){G.value=!1;for(const[me,Le]of ci)Gv(me,Le)}}else G.value=!1}),We(()=>ti.value,()=>{_n.value&&pn({immediate:!0})}),We([Yn,Mi,Ni,()=>Ue.value.length,_n],()=>{po()},{immediate:!0});let bm=null,wm=!1,rp=null;function Cm(){bm=null,Lb=null,Eb=void 0,Xh=null,ym()}function e3(){sp(),hr(),bo(),gi.clear();const O=Ue.value.length;O>0&&Kt(O),Wb()}function t3(){Yb(),bt(),mm=null,bf=null,wf=null,Vv=null,fm=null,hm=null,wm=!1,Cm(),PS("restore"),Il(),tp()}function Am(O){var J;return[(J=es())!=null?J:"",wo(),Wu(),Wv.value,vm(O),Ue.value.length,Math.round(Rs(0,Ue.value.length)),Math.round(vf()),ge.count,Math.round(ge.total)].join(":")}function i_(){return ro(this,null,function*(){var O,J,he,me;const Le=(O=i.virtualScroll)==null?void 0:O.settledToken,$e=vm(Le),Ze=wo(),et=es(),mt=El.value;if(qn.value&&((J=i.virtualScroll)==null?void 0:J.settleMode)==="manual"&&qv(Le))if(Nb()){if(Am(Le)!==Xh&&!wm){wm=!0;try{const tt=yield Ub({reason:"manual",expectedSettledTokenKey:$e}),ut=vm()===$e;qb(Ze,et,mt)&&tt.sessionKey===Ze&&tt.threadKey===et&&ut&&tt.stable&&tt.phase==="final"&&(Xh=Am((he=i.virtualScroll)==null?void 0:he.settledToken))}finally{wm=!1,yield ft();const tt=(me=i.virtualScroll)==null?void 0:me.settledToken,ut=qv(tt)?Am(tt):"";qb(Ze,et,mt)&&ut&&Xh!==ut&&i_()}}}else oo("manual")})}We(qn,(O,J)=>{if(O!==J){if(!O)return t3(),void Yb();t3(),e3(),rp=El.value,oo("content")}},{flush:"post"}),We([qn,El],([O,J])=>{O?rp!=null?rp!==J&&(rp=J,(function(he="resize"){sp(),hr(),bo(),gi.clear();const me=Ue.value.length;me>0&&Kt(me),Wb(),bf=null,wf=null,Vv=null,mm=null,wm=!1,Cm(),GS(),ft(()=>{qu(),ho.value&&fr(),Zo.value&&np(),oo(he)})})("resize")):rp=J:rp=null},{flush:"post",immediate:!0}),We([qn,()=>wo(),()=>es()],([O])=>{O&&(t3(),e3(),PS("content"),oo("content"))}),We([qn,()=>wo(),()=>es(),El,()=>Ue.value.length],([O])=>{O&&(function(J="async-node"){let he=!1;for(const[me,Le]of Array.from(Ks.entries()))Ib(Le)||(Ks.delete(me),Er.delete(me),he=!0);he&&(Yh(),oo(J))})("async-node")},{flush:"post"}),We([qn,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.sessionKey},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.measurementKey},()=>i.indexKey,()=>W.value],([O])=>{O&&(ym(),(function(J="content"){if(!qn.value)return;const he=[],me=Ue.value.length,Le=wb(me);for(const $e of Array.from(gi.keys())){if($e>=me){he.push($e);continue}if($e=me&&gi.delete($e);he.length&&((function($e,Ze={}){const et=Array.from($e,Number);On(et);let mt=0;if(Ci(()=>(mt=Sn(et,Ze),mt>0)),mt>0)(function(tt){for(const ut of tt)gi.delete(ut)})(et);else for(const tt of et)ks.delete(tt)})(he,{notify:!1}),bo(),Cm(),ho.value&&fr(),Zo.value&&np(),oo(J))})("content"))},{flush:"post",immediate:!0}),We([qn,()=>Ue.value.length,()=>wo(),()=>es()],([O,J,he,me],[Le,$e,Ze,et])=>{O&&Le&&he===Ze&&me===et&&J!==$e&&Cm()},{flush:"post"}),We([qn,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.heightCache},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.heightCacheWidth},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.restoreState},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.measurementKey},()=>Ue.value.length,()=>wo(),Q],()=>{GS()},{flush:"post",immediate:!0}),We([qn,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.restoreState},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.restoreAnchor},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.measurementKey},()=>Ue.value.length,()=>wo(),Q],O=>ro(null,[O],function*([J,he]){if(!J||!he)return;yield ft();const me=(function(){var Le;const $e=(Le=i.virtualScroll)==null?void 0:Le.restoreAnchor;return $e==null||$e===!1?null:$e===!0?"true":String($e)})();Hb(he,{restoreAnchor:me!=null,restoreToken:me??void 0})}),{flush:"post",immediate:!0}),We([qn,Q,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.restoreState},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.measurementKey}],([O])=>{var J;if(!O)return;const he=(J=i.virtualScroll)==null?void 0:J.restoreState;he&&bf&&wf==="restore"&&(KS(he)||(e3(),bf=null,wf=null,oo("resize")))},{flush:"post"}),We([qn,()=>Ue.value.length,()=>wo(),Q],O=>ro(null,[O],function*([J]){var he;const me=fm,Le=hm;J&&me&&(yield ft(),!Hb(me,{restoreAnchor:Le?.restoreAnchor===!0,restoreToken:(he=Le?.restoreToken)!=null?he:"imperative",allowUncapturedAnchor:Le?.allowUncapturedAnchor===!0})&&QS(me)||(fm=null,hm=null))}),{flush:"post",immediate:!0}),We([qn,ht,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.settleMode},()=>wo(),()=>es(),El,Gh,Hu,()=>ti.value,gf,()=>ge.count,()=>ge.total],([O,J,he])=>{if(!O||J!==!0||he==="manual"||!Db())return;const me=(function(){var Le;const $e=Ue.value.length;return[(Le=es())!=null?Le:"",wo(),Wu(),Wv.value,$e,Math.round(Rs(0,$e)),Math.round(vf()),ge.count,Math.round(ge.total)].join(":")})();bm!==me&&(bm=me,Ub({reason:"final"}).then(Le=>{Le.stable||bm!==me||(bm=null)}))},{flush:"post",immediate:!0}),We([qn,ht,()=>{var O;return(O=i.virtualScroll)==null?void 0:O.settleMode},()=>{var O;return(O=i.virtualScroll)==null?void 0:O.settledToken},()=>wo(),()=>es(),El,Gh,Hu,()=>ti.value,gf,()=>Ue.value.length,()=>ge.count,()=>ge.total],()=>{i_()},{flush:"post",immediate:!0}),We([()=>Ue.value.length,_n,Mi,Ni,()=>jn.start,()=>jn.end],([O,J,he,me,Le,$e])=>{we.value&&Ft("virtualization",{nodes:O,virtualization:J,maxLiveNodes:he,buffer:me,focusIndex:Yn.value,scroll:J?(()=>{const Ze=Gl.value||Ae();return Ze?{reverse:Me(Ze),scrollTop:Math.round(Ze.scrollTop),scrollTopAbs:Math.round(Math.abs(Ze.scrollTop)),scrollHeight:Math.round(Ze.scrollHeight),clientHeight:Math.round(Ze.clientHeight)}:null})():null,liveRange:{start:Le,end:$e},rendered:ti.value})}),We([()=>M.customId],([O],J,he)=>{if(!O||Fo)return;const me=(function(Le,$e){return Le?(As.controllers[Le]=$e,()=>{As.controllers[Le]===$e&&delete As.controllers[Le]}):()=>{}})(O,{captureRestoreAnchor:nu,restoreAnchor:Yl,getAnchorDrift:ju,getReport:XZ});he(()=>{me()})},{immediate:!0}),Xn(()=>{(function(){if(qn.value)try{qu(),pm();const O=yf("manual");JS(O)&&(R(O),mm=O,Kb=gm());const J=ep(O,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});J&&(q(J),J.anchor&&z(J.anchor),ip=km(J))}catch{}})(),fG(),bb(),Ve(),n_();for(const O of Ma.values())for(const J of O)Ke(J);Ma.clear(),Xl.clear(),gi.clear(),Xb(),sp(),Ab(),Il(),tp(),Yb(),IS(),Vn()});const hG=dg("ViewportDeferredMermaidBlockNode",Cu({loader:()=>ro(null,null,function*(){try{return(yield Jo(()=>import("./index11-ChlZyGAH.js"),__vite__mapDeps([7,5]))).default}catch(O){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',O),sl}}),loadingComponent:dN,delay:0}),dN),pG=dg("ViewportDeferredInfographicBlockNode",Cu({loader:()=>ro(null,null,function*(){try{return(yield Jo(()=>import("./index10-DGuREUB3.js"),[])).default}catch(O){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',O),sl}}),loadingComponent:cN,delay:0}),cN),mG=dg("ViewportDeferredD2BlockNode",Cu(()=>ro(null,null,function*(){try{return(yield Jo(()=>import("./index8-6GF_RzW4.js"),[])).default}catch(O){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',O),sl}})),sl),o_={text:qo,paragraph:vh,heading:zk,code_block:y8,list:u1,list_item:a1,blockquote:zy,table:Gg,definition_list:jy,footnote:Hy,footnote_reference:Pl,footnote_anchor:Kg,admonition:Vy,vmr_container:qy,hardbreak:_d,link:Ur,image:Sd,thematic_break:Wy,math_inline:Ja,math_block:_H,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:jl,insert:pl,subscript:hl,superscript:fl,emoji:dl,checkbox:$l,checkbox_input:$l,inline_code:Ar,html_inline:zl,reference:Hr,html_block:Zg},gG=D(()=>_b()),s_=D(()=>GL(M.codeBlockProps)),vG=D(()=>GL(M.codeBlockProps,{omit:["langs"]})),r_=D(()=>Nt(Nt({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,monacoOptions:M.codeBlockMonacoOptions,themes:M.themes,langs:m.value==="shiki"?M.langs:void 0,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),vG.value)),l_=D(()=>Nt(Fn(Nt({},r_.value),{langs:M.langs}),s_.value));function a_(O){return typeof O=="boolean"?O:void 0}const yG=D(()=>{const O=M.codeBlockProps||{},J={},he=a_(O.showLineNumbers);he!==void 0&&(J.showLineNumbers=he);const me=a_(O.diffInline);me!==void 0&&(J.diffInline=me);const Le=(function($e){const Ze=Number($e);return Number.isFinite(Ze)&&Ze>0?Ze:void 0})(O.reservedHeightPx);return Le!==void 0&&(J.reservedHeightPx=Le),J}),kG=D(()=>Nt(Nt({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,themes:M.themes,langs:M.langs,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),s_.value)),bG=D(()=>Nt({},M.mermaidProps||{})),u_=D(()=>Nt({},M.d2Props||{})),wG=D(()=>Nt({},M.infographicProps||{})),xm=D(()=>({typewriter:f.value,fade:M.fade,customHtmlTags:ot.value.customHtmlTags})),CG=D(()=>Nt(Nt({},xm.value),typeof be.value=="boolean"?{showTooltip:be.value}:{})),AG=D(()=>Nt(Nt({},xm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),xG=D(()=>Nt(Nt({},xm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),SG=D(()=>Nt(Nt({},xm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{}));function _G(O){return Array.isArray(O.children)&&O.children.length>0}const Yv=D(()=>JZ.value.map(O=>{var J,he,me,Le,$e,Ze,et,mt;let tt=(function(It){var en,cn,Cn,vn,An,zn,Jn;if(It.type!=="code_block")return It;const Wi=It,Qs=[String((en=Wi.language)!=null?en:""),String((cn=Wi.loading)!=null?cn:""),String((Cn=Wi.diff)!=null?Cn:""),String((vn=Wi.code)!=null?vn:""),String((An=Wi.originalCode)!=null?An:""),String((zn=Wi.updatedCode)!=null?zn:""),String((Jn=Wi.raw)!=null?Jn:"")].join("\0"),Os=Oo.get(Wi);if(Os&&Os.signature===Qs)return Os.node;const Ta=Nt({},Wi);return Oo.set(Wi,{signature:Qs,node:Ta}),Ta})(O.node);const ut=Jv(tt);let pt=h_(tt,ut);if((tt.type==="html_block"||tt.type==="html_inline")&&pt===o_[tt.type]){const It=tt,en=String((J=It.tag)!=null?J:"").trim().toLowerCase()||Yz(It.content);if(en){const cn=wi.value[en];if(Vo.value.has(en)&&cn)pt=cn,tt=Fn(Nt({},It),{type:en,tag:en,content:Rhe(It.content,en)});else if(Jz((he=It.content)!=null?he:It.raw,en)){const Cn=String((Le=(me=It.content)!=null?me:It.raw)!=null?Le:"");tt.type==="html_inline"?(pt=qo,tt={type:"text",content:Cn,raw:Cn}):(pt=vh,tt={type:"paragraph",children:[{type:"text",content:Cn,raw:Cn}],raw:Cn})}}}const Ge=tt.type==="code_block"&&m.value==="pre"&&pt===sl&&!n3(wi.value,ut);let ct=Nt({},(function(It,en,cn){const Cn=en??Jv(It);if(It.type==="code_block"){const vn=Cn?n3(wi.value,Cn):void 0;if(cn&&m.value==="pre"&&!vn&&cn===sl)return yG.value;if(cn&&Cn&&cn===vn)return Cn==="mermaid"?d_(It):Cn==="infographic"?f_(It):Cn==="d2"||Cn==="d2lang"?u_.value:l_.value;if(cn&&cn===wi.value.code_block)return l_.value;if(NS(cn))return kG.value}return Cn==="mermaid"?d_(It):Cn==="infographic"?f_(It):Cn==="d2"||Cn==="d2lang"?u_.value:It.type==="link"?CG.value:It.type==="list"?AG.value:It.type==="blockquote"?xG.value:It.type==="table"?SG.value:It.type==="code_block"?r_.value:xm.value})(tt,ut,pt));const xt=fi.value?Qh.value[O.index]:null;tt.type==="code_block"&&xt?.kind==="code-block"&&(ct=Fn(Nt({},ct),Ge?{reservedHeightPx:($e=xt.height)!=null?$e:xt.contentHeight}:{estimatedHeightPx:xt.height,estimatedContentHeightPx:xt.contentHeight,estimatedDiffInline:xt.diffInline})),Ge||tt.type!=="code_block"||ut!=="mermaid"||jp(ct.estimatedPreviewHeightPx)!=null||(ct=Fn(Nt({},ct),{estimatedPreviewHeightPx:i4(t4(String((Ze=tt.code)!=null?Ze:"")))})),Ge||tt.type!=="code_block"||ut!=="infographic"||jp(ct.estimatedPreviewHeightPx)!=null||(ct=Fn(Nt({},ct),{estimatedPreviewHeightPx:o4(n4(String((et=tt.code)!=null?et:"")))})),tt.type==="math_block"&&(ct=Fn(Nt({},ct),{cacheScope:Hi}));const vt=(function(It,en){const cn=String(It.type);return!Av(cn)&&wi.value[cn]===en})(tt,pt),Wt=vt?w7(tt,ke.value):void 0;return Fn(Nt({},O),{node:tt,component:pt,bindings:ct,customBindings:Nt(Nt({},Wt??{}),ct),rendersCustomNode:vt,hasSlotChildren:_G(tt),slotContent:String((mt=tt.content)!=null?mt:""),isCodeBlock:tt.type==="code_block",indexKey:`${gG.value}-${O.index}`,vnodeKey:`${eG.value}\0${O.index}\0${tt.type}`})}));function Jv(O){var J;return O?.type==="code_block"?String((J=O.language)!=null?J:"").trim().toLowerCase():""}function n3(O,J){const he=J.trim().toLowerCase();if(he)for(const me of[he,Ok(he),aH(he)]){const Le=me&&O[me];if(Le)return Le}}function c_(O,J,he,me){var Le,$e;const Ze=Nt({},O.value);return jp(Ze.estimatedPreviewHeightPx)==null&&(Ze.estimatedPreviewHeightPx=me(he(String((Le=J?.code)!=null?Le:"")),void 0,Ze.maxHeight==="none"?null:($e=jp(Ze.maxHeight))!=null?$e:void 0)),Ze}function d_(O){return c_(bG,O,t4,i4)}function f_(O){return c_(wG,O,n4,o4)}function h_(O,J){if(!O)return EC;const he=wi.value,me=he[String(O.type)];if(O.type==="code_block"){const Le=J??Jv(O),$e=Le?n3(he,Le):void 0;return $e||(m.value==="pre"?he.code_block||sl:Le==="mermaid"?he.mermaid||hG:Le==="infographic"?he.infographic||pG:Le==="d2"||Le==="d2lang"?he.d2||mG:me||he.code_block||DS.value)}return me||o_[String(O.type)]||EC}function i3(O){o("click",O)}function MG(O){var J;(J=O.target)!=null&&J.closest("[data-node-index]")&&o("mouseover",O)}function IG(O){var J;(J=O.target)!=null&&J.closest("[data-node-index]")&&o("mouseout",O)}function p_(O){o("mouseover",O)}function m_(O){o("mouseout",O)}const xf=V(null),Xr=V(!1),Sm=V(null),TG=D(()=>!(M.domMode!=="minimal"||re.value||M.fade!==!1||f.value||Xr.value||Ye.value||_n.value||Ir.value||Mo.value||vo.value||Object.keys(wi.value).length!==0));let _m,lp=null,o3=0,Xv=0,e2=0;const g_=["code_block","admonition","table","math_block","html_block","image","thematic_break"],EG=new Set(g_),v_=[".typewriter-cursor",".height-estimation-probes",...g_.map(O=>`[data-node-type="${O}"]`),"script","style"].join(",");function y_(O){if(!O||typeof O!="object")return!1;const J=O.type;return typeof J=="string"&&EG.has(J)}function t2(O){var J,he;if(!O||typeof O!="object")return 0;const me=O,Le=(he=(J=me.raw)!=null?J:me.content)!=null?he:me.code;if(typeof Le=="string")return Le.length;const $e=me.children;if(Array.isArray($e))return $e.reduce((et,mt)=>et+t2(mt),0);const Ze=me.items;return Array.isArray(Ze)?Ze.reduce((et,mt)=>et+t2(mt),0):0}function n2(){_m&&(clearTimeout(_m),_m=void 0)}function s3(){o3+=1,lp!=null&&($i?.(lp),lp=null)}function Mm(){s3(),Bc(),xf.value&&(xf.value.style.visibility="hidden")}function LG(O){var J;if(O.nodeType!==Node.TEXT_NODE||!((J=O.textContent)!=null?J:"").trim())return!1;const he=O.parentElement;return!!he&&!he.closest(v_)}function NG(O){let J=O.lastChild;for(;J;){if(LG(J))return J;if(J.nodeType===Node.ELEMENT_NODE){const he=J;if(!he.matches(v_)&&he.lastChild){J=he.lastChild;continue}}for(;J&&J!==O&&!J.previousSibling;)J=J.parentNode;if(!J||J===O)break;J=J.previousSibling}return null}function k_(){const O=Yv.value;for(let J=O.length-1;J>=0;J--){const he=O[J];if(!he||y_(he.node)||!Zv(he.index))continue;const me=ci.get(he.index);if(!me)continue;const Le=NG(me);if(Le)return Le}return null}function Bc(){Sm.value&&(Sm.value.classList.remove(fN),Sm.value=null)}function i2(){if(d.value!=="simple"||!K||!Xr.value||!$.value)return void Bc();const O=k_(),J=O?(function(he){var me;const Le=(me=he.parentElement)==null?void 0:me.closest(".text-node");return Le instanceof HTMLElement?Le:he.parentElement})(O):null;J!==Sm.value&&(Bc(),J&&(J.classList.add(fN),Sm.value=J))}function o2(){if(d.value!=="precise"||!K||!Xr.value||lp!=null)return;const O=o3,J=()=>{lp=null,O===o3&&(function(){var he,me;if(d.value!=="precise"||!(K&&Xr.value&&$.value&&xf.value))return;const Le=$.value,$e=xf.value;$e.style.visibility="hidden";const Ze=k_();if(!Ze)return;let et=0,mt=0,tt=20,ut=!1;if(Ze?.textContent){const pt=Ze.textContent.length,Ge=document.createRange();Ge.setStart(Ze,Math.max(0,pt-1)),Ge.setEnd(Ze,pt);const ct=typeof Ge.getClientRects=="function"?Ge.getClientRects():void 0,xt=(me=ct?.[ct.length-1])!=null?me:(he=Ze.parentElement)==null?void 0:he.getBoundingClientRect();if(xt){const vt=Qt("typewriterCursor.root.getBoundingClientRect",()=>Le.getBoundingClientRect());et=xt.right-vt.left+Le.scrollLeft,mt=xt.top-vt.top+Le.scrollTop,tt=xt.height||tt,ut=!0}Ge.detach()}ut&&($e.style.transform=`translate(${Math.max(0,et)}px, ${Math.max(0,mt)}px)`,$e.style.height=`${tt}px`,$e.style.visibility="visible")})()};Oi?lp=Oi(J):J()}return We([qe,()=>i.content,()=>i.nodes,()=>M.typewriter,ht],()=>ro(null,null,function*(){var O,J;if(!K||re.value||!le.value)return;if(ht.value)return Xr.value=!1,n2(),void Mm();if((O=i.nodes)!=null&&O.length)return Xr.value=!1,n2(),Mm(),Xv=((J=i.content)!=null?J:"").length,void(e2=qe.value.length);const he=(function(){var et,mt;return(et=i.nodes)!=null&&et.length?i.nodes.reduce((tt,ut)=>tt+t2(ut),0):((mt=i.content)!=null?mt:"").length})(),me=(function(){var et;return(et=i.nodes)!=null&&et.length?i.nodes.reduce((mt,tt)=>mt+t2(tt),0):qe.value.length})(),Le=!y_(Ue.value[Ue.value.length-1]),$e=he>Xv,Ze=me>e2;if(!f.value||!Le||!$e&&!Ze)return f.value&&Le||(Xr.value=!1,Mm()),Xv=he,void(e2=me);Xv=he,e2=me,Xr.value=!0,d.value==="precise"&&xf.value&&(xf.value.style.visibility="hidden"),n2(),yield ft(),d.value==="simple"?i2():(Bc(),o2()),_m=setTimeout(()=>{_m=void 0,Xr.value=!1},3e3)}),{flush:"post",immediate:!0}),We(Xr,O=>ro(null,null,function*(){O?(yield ft(),d.value!=="simple"?(Bc(),d.value==="precise"&&o2()):i2()):Mm()}),{flush:"post"}),We(d,()=>ro(null,null,function*(){if(K&&!re.value&&le.value&&Xr.value){if(yield ft(),d.value==="simple")return s3(),void i2();Bc(),d.value!=="precise"?Mm():o2()}}),{flush:"post"}),We([()=>ti.value,()=>jn.start,()=>jn.end],()=>ro(null,null,function*(){K&&!re.value&&le.value&&Xr.value&&(yield ft(),d.value!=="simple"?(Bc(),d.value==="precise"&&o2()):i2())}),{flush:"post"}),Xn(()=>{n2(),s3(),Bc(),mi.clear()}),(O,J)=>{const he=uY("NodeRenderer",!0);return p(re)?(k(!0),L(De,{key:0},Ct(Yv.value,me=>(k(),L(De,{key:me.vnodeKey},[me.rendersCustomNode?(k(),de(zo(me.component),di({key:0,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onClick:i3,onMouseover:p_,onMouseout:m_,onCopy:J[0]||(J[0]=Le=>s(Le)),onHandleArtifactClick:J[1]||(J[1]=Le=>o("handleArtifactClick",Le))}),{default:ue(()=>[me.hasSlotChildren?(k(),de(he,di({key:0,ref_for:!0},kt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,di({key:1,ref_for:!0},kt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(zo(me.component),di({key:1,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onClick:i3,onMouseover:p_,onMouseout:m_,onCopy:J[2]||(J[2]=Le=>s(Le)),onHandleArtifactClick:J[3]||(J[3]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),L("div",{key:1,ref_key:"containerRef",ref:$,class:Re(["markstream-vue markdown-renderer",[{dark:M.isDark},{virtualized:_n.value},{"virtual-scroll-coordinated":to.value},{"stable-layout":Pt.value},{"typewriter-simple-cursor":Xr.value&&d.value==="simple"}]]),"data-custom-id":M.customId,onClick:i3,onMouseover:MG,onMouseout:IG},[Zi.value||_n.value?(k(),L(De,{key:0},[Zi.value?(k(),de(W9e,{key:0,width:ri.value,"flow-root":_n.value||to.value,"paragraph-node":co.value,"list-item-node":Ns.value,"list-node":Ds.value,"heading-nodes":Fs.value,"set-paragraph-wrapper":Jt,"set-list-item-wrapper":gn,"set-list-wrapper":En,"set-heading-wrapper":YZ},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),_n.value?(k(),L("div",{key:1,class:"node-spacer",style:sn({height:`${xb.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),TG.value?(k(!0),L(De,{key:1},Ct(Yv.value,me=>(k(),L(De,{key:me.vnodeKey},[Zv(me.index)?(k(),de(zo(me.component),di({key:0,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onMouseover:J[4]||(J[4]=Le=>o("mouseover",Le)),onMouseout:J[5]||(J[5]=Le=>o("mouseout",Le)),onCopy:J[6]||(J[6]=Le=>s(Le)),onHandleArtifactClick:J[7]||(J[7]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(k(!0),L(De,{key:2},Ct(Yv.value,me=>(k(),L("div",{key:me.vnodeKey,ref_for:!0,ref:Le=>Gv(me.index,Le),class:"node-slot","data-node-index":me.index,"data-node-type":me.node.type},[Zv(me.index)?(k(),L("div",{key:0,ref_for:!0,ref:Le=>(function($e,Ze){var et;Ze||(function(pt){const Ge=`${_b()}-${pt}`;let ct=!1;for(const xt of Array.from(Er.keys())){const vt=Ks.get(xt);(vt?.index===pt||xt===Ge||xt.startsWith(`${Ge}-`))&&(Er.delete(xt),Ks.delete(xt),ct=!0)}ct&&(Yh(),oo("async-node"))})($e),ea.delete($e),(function(pt){var Ge;const ct=((Ge=Xl.get(pt))!=null?Ge:0)+1;Xl.set(pt,ct)})($e);const mt=Ma.get($e);if(mt){for(const pt of mt)Ke(pt);Ma.delete($e)}if((function(pt){const Ge=Ro.get(pt);Ge&&(ni?.unobserve(Ge),yo.delete(Ge),Ro.delete(pt))})($e),!Ze||!gs.value)return ws.delete($e),void Xl.delete($e);ws.set($e,Ze);const tt=()=>{Qv($e,Ze)};queueMicrotask(tt);const ut=(ni||typeof ResizeObserver>"u"||(ni=new ResizeObserver(pt=>{if(pt.length)for(const Ge of pt){const ct=yo.get(Ge.target),xt=Ro.get(ct??-1);ct!=null&&xt&&Qv(ct,xt)}else qu()})),ni);if(ut&&(Ro.set($e,Ze),yo.set(Ze,$e),ut.observe(Ze)),typeof window<"u"){const pt=((et=Ue.value[$e])==null?void 0:et.type)==="code_block"?[16,80,240,800]:ht.value?[80]:[];if(pt.length){const Ge=pt.map(ct=>at(ct,tt,"node-resize")).filter(ct=>ct!=null);Ge.length&&Ma.set($e,Ge)}}})(me.index,Le),class:"node-content"},[me.isCodeBlock?me.rendersCustomNode?(k(),de(zo(me.component),di({key:1,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[12]||(J[12]=Le=>s(Le)),onHandleArtifactClick:J[13]||(J[13]=Le=>o("handleArtifactClick",Le))}),{default:ue(()=>[me.hasSlotChildren?(k(),de(he,di({key:0,ref_for:!0},kt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,di({key:1,ref_for:!0},kt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(zo(me.component),di({key:2,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[14]||(J[14]=Le=>s(Le)),onHandleArtifactClick:J[15]||(J[15]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),de(mo,{key:0,name:"fade",css:M.fade!==!1,appear:M.fade!==!1},{default:ue(()=>[me.rendersCustomNode?(k(),de(zo(me.component),di({key:0,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[8]||(J[8]=Le=>s(Le)),onHandleArtifactClick:J[9]||(J[9]=Le=>o("handleArtifactClick",Le))}),{default:ue(()=>[me.hasSlotChildren?(k(),de(he,di({key:0,ref_for:!0},kt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,di({key:1,ref_for:!0},kt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(zo(me.component),di({key:1,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[10]||(J[10]=Le=>s(Le)),onHandleArtifactClick:J[11]||(J[11]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),L("div",{key:1,class:"node-placeholder",style:sn({height:`${Sl(me.index)}px`})},null,4))],8,V9e))),128)),Xr.value&&d.value==="precise"?(k(),L("span",{key:3,ref_key:"typewriterCursorRef",ref:xf,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),_n.value?(k(),L("div",{key:4,class:"node-spacer",style:sn({height:`${Sb.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,U9e))}}})),[["__scopeId","data-v-a9489508"]]),ml=zH;ml.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",ml.__name,ml.name].filter(n=>!!n));for(const n of t)e.component(n,zH)};const B7=Object.freeze(Object.defineProperty({__proto__:null,default:ml},Symbol.toStringTag,{value:"Module"})),K9e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Z9e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},G9e={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Q9e={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Y9e={class:"admonition-title"},J9e=["aria-expanded","aria-controls"],X9e=["id"],Vy=Ri(rt({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=V(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),L("div",{class:Re(["admonition",[`admonition-${i.node.kind}`]])},[A("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),L("svg",K9e,[...c[1]||(c[1]=[A("circle",{cx:"12",cy:"12",r:"10"},null,-1),A("path",{d:"M12 16v-4"},null,-1),A("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),L("svg",Z9e,[...c[2]||(c[2]=[A("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),A("path",{d:"M9 18h6"},null,-1),A("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),L("svg",G9e,[...c[3]||(c[3]=[A("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),A("path",{d:"M12 9v4"},null,-1),A("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),L("svg",Q9e,[...c[4]||(c[4]=[A("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),A("path",{d:"M12 8v4"},null,-1),A("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),A("span",Y9e,F(s.value),1),i.node.collapsible?(k(),L("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),L("svg",{style:sn({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[A("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,J9e)):ee("",!0)]),ai(A("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[U(p(ml),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,X9e),[[Qo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Vy.install=e=>{e.component(Vy.__name,Vy)};const BC=()=>Jo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let H2=null,W2=BC,q2=null,hN=!1,pN=!1;function h9t(){return ro(this,null,function*(){if(H2)return H2;const e=W2;return e?e===BC&&hN?null:q2||(q2=ro(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===BC)return e===W2&&(hN=!0,(function(i){pN||(pN=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===W2&&(q2=null)}return e!==W2?null:t?(H2=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),H2):null}),q2):null})}let U2=null,jH=null,V2=null;function p9t(){return typeof jH=="function"}function m9t(){return ro(this,null,function*(){if(U2)return U2;const e=jH;return e?V2||(V2=ro(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(U2=n,U2):null}).finally(()=>{V2=null}),V2):null})}const g9t=Symbol("markstreamLanguageIconResolver");function e4e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function t4e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let mN=!1;function HH(){mN||typeof Worker>"u"||(mN=!0,Nve(new e4e),Uve(new t4e))}HH();function fd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function gN(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const R7={},h4=Symbol("resolveImage");class bu extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class la extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class O7 extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function qi(e){return e instanceof bu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Hk(e){return e instanceof la||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function n4e(e){return Hk(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function i4e(e){return e instanceof O7||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const o4e=41301,s4e=40922;function vN(e){return qi(e)&&e.code===s4e}const Ju=3e4,K2=5*6e4,yN=5*6e4,WH="0123456789ABCDEFGHJKMNPQRSTVWXYZ",RC=500,qH=40101;function kN(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function Z2(e=Ju){try{return AbortSignal.timeout(e)}catch{return}}function r4e(e,t){let n="",i=e;for(let o=0;oWH[n%32]).join("")}function Wm(){return`${r4e(Date.now(),10)}${l4e(16)}`}function bN(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function T8(e){try{const t=await e.text();return t?t.length>RC?`${t.slice(0,RC)}...`:t:void 0}catch{return}}class wN{constructor(t){this.opts=t,this.tracer=t.tracer??R7}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=fd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;kN(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=Wm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:Z2()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new la({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ju,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new O7({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new bu({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i?.allowCodes,i?.timeoutMs)}async postZip(t,n,i){const o="POST",s=fd(this.opts.origin,t,this.opts.restBasePath),r=Wm(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:Z2(K2)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new la({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:K2,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const v=h?.code??u.status,y=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:v,msg:y,envelopeRequestId:h?.request_id}),new bu({code:v,msg:y,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new la({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:K2,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await T8(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new la({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:K2,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=fd(this.opts.origin,t,this.opts.restBasePath),s=Wm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:bN(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:Z2()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new la({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ju,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new la({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Ju,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await T8(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new bu({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=fd(this.opts.origin,t,this.opts.restBasePath),s=Wm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:bN(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=Ju;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new la({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ju,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new la({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ju,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new la({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Ju,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,RC),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new bu({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s=[],r=Ju){let l=fd(this.opts.origin,n,this.opts.restBasePath);if(o){const m=new URLSearchParams;kN(m,o);const g=m.toString();g&&(l=`${l}?${g}`)}const a=Wm(),u={"X-Request-Id":a};this.addClientHeaders(u),i!==void 0&&(u["Content-Type"]="application/json; charset=utf-8");const c=Date.now();this.tracer.restRequest?.({method:t,path:n,url:l,requestId:a,body:i});let d;try{d=await fetch(l,{method:t,headers:u,body:i!==void 0?JSON.stringify(i):void 0,signal:Z2(r)})}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"fetch",durationMs:Date.now()-c,error:m}),new la({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"fetch",timeoutMs:r,timestamp:Date.now(),durationMs:Date.now()-c})}let f;const h=d.clone();try{const m=await d.text();f=d.status===204&&m===""?{code:0,msg:"",data:null,request_id:a}:JSON.parse(m)}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"parse",durationMs:Date.now()-c,status:d.status,error:m}),new la({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"parse",timeoutMs:r,status:d.status,statusText:d.statusText,contentType:d.headers.get("content-type")??void 0,bodyPreview:await T8(h),timestamp:Date.now(),durationMs:Date.now()-c})}if(this.tracer.restResponse?.({method:t,path:n,requestId:a,status:d.status,durationMs:Date.now()-c,code:f.code,msg:f.msg,envelopeRequestId:f.request_id,data:f.data}),this.checkAuthRequired(d,f.code),f.code!==0&&!s.includes(f.code))throw new bu({code:typeof f.code=="number"?f.code:d.status,msg:typeof f.msg=="string"&&f.msg.length>0?f.msg:`HTTP ${d.status}${d.statusText?` ${d.statusText}`:""}`,requestId:f.request_id??a,details:f.details,timestamp:Date.now(),durationMs:Date.now()-c});return f.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===qH)&&this.opts.credentialStore?.markAuthRequired?.()}}function UH(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function CN(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function hu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:UH(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function G2(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function Yg(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function AN(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function $7(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:AN(e.source)};case"video":return{type:"video",source:AN(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function VH(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map($7),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function KH(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function a4e(e){return{content:e.content.map(KH),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function u4e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function c4e(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function d4e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function f4e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(d4e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function h4e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(f4e),createdAt:e.created_at}}function p4e(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function m4e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=p4e(i);return{answers:t,method:e.method,note:e.note}}function OC(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function xN(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Vc(e,t){const n=e[t];return typeof n=="string"?n:void 0}function yp(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ia(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ZH(e){if(!e||typeof e!="object")return null;const t=e,n=Vc(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:Vc(t,"goalId")??Vc(t,"goal_id")??"goal",objective:Vc(t,"objective")??"",completionCriterion:Vc(t,"completionCriterion")??Vc(t,"completion_criterion"),status:n,turnsUsed:yp(t,"turnsUsed")??yp(t,"turns_used")??0,tokensUsed:yp(t,"tokensUsed")??yp(t,"tokens_used")??0,wallClockMs:yp(t,"wallClockMs")??yp(t,"wall_clock_ms")??0,terminalReason:Vc(t,"terminalReason")??Vc(t,"terminal_reason"),budget:{tokenBudget:ia(o,"tokenBudget")??ia(o,"token_budget"),remainingTokens:ia(o,"remainingTokens")??ia(o,"remaining_tokens"),turnBudget:ia(o,"turnBudget")??ia(o,"turn_budget"),remainingTurns:ia(o,"remainingTurns")??ia(o,"remaining_turns"),wallClockBudgetMs:ia(o,"wallClockBudgetMs")??ia(o,"wall_clock_budget_ms"),remainingWallClockMs:ia(o,"remainingWallClockMs")??ia(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function g4e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:hu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:hu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:Yg(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Yg(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:UH(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=ZH(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:VH(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map($7),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:c4e(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:h4e(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:OC(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:$C(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function v4e(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function kp(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function SN(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function $C(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function y4e(e){return e.session_id}function k4e(e){return e.seq}function b4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function _N(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const w4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function C4e(e,t){switch(t.op){case"reset":return A4e(e,t);case"turn.upsert":return S4e(e,t.turn);case"step.upsert":return M4e(e,t.turnId,t.step);case"frame.upsert":return T4e(e,t);case"append":return L4e(e,t);case"marker.upsert":return IN(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return IN(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return F4e(e,t.task);case"interaction.upsert":return B4e(e,t.interaction);case"attachment.upsert":return O4e(e,t.attachment);case"todo.upsert":return P4e(e,t.todo);case"prompt.upsert":return j4e(e,t.prompt);case"meta.merge":return q4e(e,t.meta);case"items.remove":return D4e(e,t.ids)}}function A4e(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function MN(e,t){return{...e,kind:"turn",steps:[...t]}}function GH(e){return{kind:"turn",turnId:e,ordinal:b4e(e),state:"running",origin:{kind:"other"},steps:[]}}function x4e(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function M1(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function P7(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function Wk(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function S4e(e,t){const n=M1(e,t.turnId);return n?_4e(n,t)?{state:e,changed:!1}:{state:{...e,items:Wk(e.items,t.turnId,i=>MN(t,i.steps))},changed:!0}:{state:{...e,items:P7(e.items,MN(t,[]))},changed:!0}}function _4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function M4e(e,t,n){const i=M1(e,t)??GH(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&I4e(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=M1(e,t)?Wk(e.items,t,()=>l):P7(e.items,l);return{state:{...e,items:a},changed:!0}}function I4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function T4e(e,t){const n=M1(e,t.turnId)??GH(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??x4e(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&E4e(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=M1(e,t.turnId)?Wk(e.items,t.turnId,()=>a):P7(e.items,a);return{state:{...e,items:u},changed:!0}}function E4e(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function L4e(e,t){if(t.target.type==="task")return N4e(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=M1(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=QH(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:Wk(e.items,n,()=>d)},changed:!0}}function N4e(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=QH(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function QH(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function IN(e,t,n,i){if(e.items.some(s=>PC(s)===n)){let s=!1;const r=e.items.map(l=>PC(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function PC(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function D4e(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(PC(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function F4e(e,t){const n=e.tasks.get(t.taskId);if(n&&W4e(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function B4e(e,t){const n=e.interactions.get(t.interactionId);if(n&&R4e(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function R4e(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function O4e(e,t){const n=e.attachments.get(t.attachmentId);if(n&&$4e(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function $4e(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function P4e(e,t){const n=e.todos.get(t.todoId);if(n&&z4e(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function z4e(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function j4e(e,t){const n=e.prompts.get(t.promptId);if(n&&H4e(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function H4e(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function W4e(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function q4e(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class U4e{constructor(t){this.agentId=t}#e=w4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=C4e(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Mt(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class c1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class YH extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const JH={};function Wd(e){return JH}function XH(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function zC(e,t){return typeof t=="bigint"?t.toString():t}function qk(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function z7(e){return e==null}function j7(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function V4e(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const TN=Symbol("evaluating");function ji(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==TN)return i===void 0&&(i=TN,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Vh(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function EN(e){return JSON.stringify(e)}function K4e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eW="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function R0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Z4e=qk(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function I1(e){if(R0(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(R0(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tW(e){return I1(e)?{...e}:Array.isArray(e)?[...e]:e}const G4e=new Set(["string","number","symbol"]);function T1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Mn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Q4e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Y4e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function J4e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=sf(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return Vh(this,"shape",r),r},checks:[]});return rf(e,s)}function X4e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=sf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return Vh(this,"shape",r),r},checks:[]});return rf(e,s)}function eke(e,t){if(!I1(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=sf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Vh(this,"shape",s),s}});return rf(e,o)}function tke(e,t){if(!I1(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=sf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Vh(this,"shape",i),i}});return rf(e,n)}function nke(e,t){const n=sf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Vh(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return rf(e,n)}function ike(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=sf(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return Vh(this,"shape",a),a},checks:[]});return rf(t,r)}function oke(e,t,n){const i=sf(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return Vh(this,"shape",s),s}});return rf(t,i)}function Wp(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Q2(e){return typeof e=="string"?e:e?.message}function qd(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Q2(e.inst?._zod.def?.error?.(e))??Q2(t?.error?.(e))??Q2(n.customError?.(e))??Q2(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function H7(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function O0(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const nW=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zC,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iW=Mt("$ZodError",nW),oW=Mt("$ZodError",nW,{Parent:Error});function ske(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function rke(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new c1;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>qd(a,s,Wd())));throw eW(l,o?.callee),l}return r.value},q7=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>qd(a,s,Wd())));throw eW(l,o?.callee),l}return r.value},Uk=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new c1;return s.issues.length?{success:!1,error:new(e??iW)(s.issues.map(r=>qd(r,o,Wd())))}:{success:!0,data:s.value}},lke=Uk(oW),Vk=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>qd(r,o,Wd())))}:{success:!0,data:s.value}},ake=Vk(oW),uke=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return W7(e)(t,n,o)},cke=e=>(t,n,i)=>W7(e)(t,n,i),dke=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return q7(e)(t,n,o)},fke=e=>async(t,n,i)=>q7(e)(t,n,i),hke=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Uk(e)(t,n,o)},pke=e=>(t,n,i)=>Uk(e)(t,n,i),mke=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Vk(e)(t,n,o)},gke=e=>async(t,n,i)=>Vk(e)(t,n,i),vke=/^[cC][^\s-]{8,}$/,yke=/^[0-9a-z]+$/,kke=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bke=/^[0-9a-vA-V]{20}$/,wke=/^[A-Za-z0-9]{27}$/,Cke=/^[a-zA-Z0-9_-]{21}$/,Ake=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xke=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,LN=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ske=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_ke="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Mke(){return new RegExp(_ke,"u")}const Ike=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Eke=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nke=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sW=/^[A-Za-z0-9_-]*$/,Dke=/^\+[1-9]\d{6,14}$/,rW="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Fke=new RegExp(`^${rW}$`);function lW(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Bke(e){return new RegExp(`^${lW(e)}$`)}function Rke(e){const t=lW({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${rW}T(?:${i})$`)}const Oke=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$ke=/^-?\d+$/,aW=/^-?\d+(?:\.\d+)?$/,Pke=/^(?:true|false)$/i,zke=/^[^A-Z]*$/,jke=/^[^a-z]*$/,wl=Mt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uW={number:"number",bigint:"bigint",object:"date"},cW=Mt("$ZodCheckLessThan",(e,t)=>{wl.init(e,t);const n=uW[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{wl.init(e,t);const n=uW[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hke=Mt("$ZodCheckMultipleOf",(e,t)=>{wl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):V4e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wke=Mt("$ZodCheckNumberFormat",(e,t)=>{wl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=Y4e[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=$ke)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),qke=Mt("$ZodCheckMaxLength",(e,t)=>{var n;wl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!z7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=H7(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Uke=Mt("$ZodCheckMinLength",(e,t)=>{var n;wl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!z7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=H7(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Vke=Mt("$ZodCheckLengthEquals",(e,t)=>{var n;wl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!z7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=H7(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Kk=Mt("$ZodCheckStringFormat",(e,t)=>{var n,i;wl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Kke=Mt("$ZodCheckRegex",(e,t)=>{Kk.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Zke=Mt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=zke),Kk.init(e,t)}),Gke=Mt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jke),Kk.init(e,t)}),Qke=Mt("$ZodCheckIncludes",(e,t)=>{wl.init(e,t);const n=T1(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Yke=Mt("$ZodCheckStartsWith",(e,t)=>{wl.init(e,t);const n=new RegExp(`^${T1(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Jke=Mt("$ZodCheckEndsWith",(e,t)=>{wl.init(e,t);const n=new RegExp(`.*${T1(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),Xke=Mt("$ZodCheckOverwrite",(e,t)=>{wl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ebe{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` -`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` -`))}}const tbe={major:4,minor:3,patch:6},Lo=Mt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tbe;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=Wp(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new c1;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=Wp(r,f)))});else{if(r.issues.length===f)continue;u||(u=Wp(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(Wp(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new c1;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new c1;return a.then(u=>o(u,i,l))}return o(a,i,l)}}ji(e,"~standard",()=>({validate:o=>{try{const s=lke(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ake(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),U7=Mt("$ZodString",(e,t)=>{Lo.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Oke(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),So=Mt("$ZodStringFormat",(e,t)=>{Kk.init(e,t),U7.init(e,t)}),nbe=Mt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xke),So.init(e,t)}),ibe=Mt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=LN(i))}else t.pattern??(t.pattern=LN());So.init(e,t)}),obe=Mt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ske),So.init(e,t)}),sbe=Mt("$ZodURL",(e,t)=>{So.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),rbe=Mt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Mke()),So.init(e,t)}),lbe=Mt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Cke),So.init(e,t)}),abe=Mt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vke),So.init(e,t)}),ube=Mt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yke),So.init(e,t)}),cbe=Mt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=kke),So.init(e,t)}),dbe=Mt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bke),So.init(e,t)}),fbe=Mt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wke),So.init(e,t)}),hbe=Mt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Rke(t)),So.init(e,t)}),pbe=Mt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Fke),So.init(e,t)}),mbe=Mt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Bke(t)),So.init(e,t)}),gbe=Mt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ake),So.init(e,t)}),vbe=Mt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ike),So.init(e,t),e._zod.bag.format="ipv4"}),ybe=Mt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Tke),So.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),kbe=Mt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Eke),So.init(e,t)}),bbe=Mt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Lke),So.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fW(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wbe=Mt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Nke),So.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fW(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Cbe(e){if(!sW.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fW(n)}const Abe=Mt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sW),So.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Cbe(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),xbe=Mt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Dke),So.init(e,t)});function Sbe(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const _be=Mt("$ZodJWT",(e,t)=>{So.init(e,t),e._zod.check=n=>{Sbe(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hW=Mt("$ZodNumber",(e,t)=>{Lo.init(e,t),e._zod.pattern=e._zod.bag.pattern??aW,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Mbe=Mt("$ZodNumberFormat",(e,t)=>{Wke.init(e,t),hW.init(e,t)}),Ibe=Mt("$ZodBoolean",(e,t)=>{Lo.init(e,t),e._zod.pattern=Pke,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Tbe=Mt("$ZodUnknown",(e,t)=>{Lo.init(e,t),e._zod.parse=n=>n}),Ebe=Mt("$ZodNever",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function NN(e,t,n){e.issues.length&&t.issues.push(...qp(n,e.issues)),t.value[n]=e.value}const Lbe=Mt("$ZodArray",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rNN(u,n,r))):NN(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function p4(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...qp(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pW(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Q4e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function mW(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>p4(h,n,d,t,c))):p4(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Nbe=Mt("$ZodObject",(e,t)=>{if(Lo.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=qk(()=>pW(t));ji(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=R0,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(v=>p4(v,l,f,u,m))):p4(g,l,f,u,m)}return s?mW(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),Dbe=Mt("$ZodObjectJIT",(e,t)=>{Nbe.init(e,t);const n=e._zod.parse,i=qk(()=>pW(t)),o=f=>{const h=new ebe(["shape","payload","ctx"]),m=i.value,g=w=>{const C=EN(w);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const w of m.keys)v[w]=`key_${y++}`;h.write("const newResult = {};");for(const w of m.keys){const C=v[w],T=EN(w),I=f[w]?._zod?.optout==="optional";h.write(`const ${C} = ${g(w)};`),I?h.write(` - if (${C}.issues.length) { - if (${T} in input) { - payload.issues = payload.issues.concat(${C}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${T}, ...iss.path] : [${T}] - }))); - } - } - - if (${C}.value === undefined) { - if (${T} in input) { - newResult[${T}] = undefined; - } - } else { - newResult[${T}] = ${C}.value; - } - - `):h.write(` - if (${C}.issues.length) { - payload.issues = payload.issues.concat(${C}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${T}, ...iss.path] : [${T}] - }))); - } - - if (${C}.value === undefined) { - if (${T} in input) { - newResult[${T}] = undefined; - } - } else { - newResult[${T}] = ${C}.value; - } - - `)}h.write("payload.value = newResult;"),h.write("return payload;");const b=h.compile();return(w,C)=>b(f,w,C)};let s;const r=R0,l=!JH.jitless,u=l&&Z4e.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?mW([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function DN(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Wp(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>qd(r,i,Wd())))}),t)}const gW=Mt("$ZodUnion",(e,t)=>{Lo.init(e,t),ji(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ji(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ji(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ji(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>j7(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>DN(a,o,e,s)):DN(l,o,e,s)}}),Fbe=Mt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gW.init(e,t);const n=e._zod.parse;ji(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=qk(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!R0(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),Bbe=Mt("$ZodIntersection",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>FN(n,a,u)):FN(n,s,r)}});function jC(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(I1(e)&&I1(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=jC(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),Wp(e))return e;const r=jC(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Rbe=Mt("$ZodRecord",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!I1(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...qp(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...qp(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&aW.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>qd(d,i,Wd())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...qp(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...qp(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Obe=Mt("$ZodEnum",(e,t)=>{Lo.init(e,t);const n=XH(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>G4e.has(typeof o)).map(o=>typeof o=="string"?T1(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),$be=Mt("$ZodLiteral",(e,t)=>{if(Lo.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?T1(i):i?T1(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),Pbe=Mt("$ZodTransform",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new YH(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new c1;return n.value=o,n}});function BN(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vW=Mt("$ZodOptional",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ji(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ji(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${j7(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>BN(s,n.value)):BN(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),zbe=Mt("$ZodExactOptional",(e,t)=>{vW.init(e,t),ji(e._zod,"values",()=>t.innerType._zod.values),ji(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),jbe=Mt("$ZodNullable",(e,t)=>{Lo.init(e,t),ji(e._zod,"optin",()=>t.innerType._zod.optin),ji(e._zod,"optout",()=>t.innerType._zod.optout),ji(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${j7(n.source)}|null)$`):void 0}),ji(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),Hbe=Mt("$ZodDefault",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",ji(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>RN(s,t)):RN(o,t)}});function RN(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Wbe=Mt("$ZodPrefault",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",ji(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),qbe=Mt("$ZodNonOptional",(e,t)=>{Lo.init(e,t),ji(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>ON(s,e)):ON(o,e)}});function ON(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ube=Mt("$ZodCatch",(e,t)=>{Lo.init(e,t),ji(e._zod,"optin",()=>t.innerType._zod.optin),ji(e._zod,"optout",()=>t.innerType._zod.optout),ji(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>qd(r,i,Wd()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>qd(s,i,Wd()))},input:n.value}),n.issues=[]),n)}}),Vbe=Mt("$ZodPipe",(e,t)=>{Lo.init(e,t),ji(e._zod,"values",()=>t.in._zod.values),ji(e._zod,"optin",()=>t.in._zod.optin),ji(e._zod,"optout",()=>t.out._zod.optout),ji(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>Y2(r,t.in,i)):Y2(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Y2(s,t.out,i)):Y2(o,t.out,i)}});function Y2(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Kbe=Mt("$ZodReadonly",(e,t)=>{Lo.init(e,t),ji(e._zod,"propValues",()=>t.innerType._zod.propValues),ji(e._zod,"values",()=>t.innerType._zod.values),ji(e._zod,"optin",()=>t.innerType?._zod?.optin),ji(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then($N):$N(o)}});function $N(e){return e.value=Object.freeze(e.value),e}const Zbe=Mt("$ZodCustom",(e,t)=>{wl.init(e,t),Lo.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>PN(s,n,i,e));PN(o,n,i,e)}});function PN(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(O0(o))}}var zN;class Gbe{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Qbe(){return new Gbe}(zN=globalThis).__zod_globalRegistry??(zN.__zod_globalRegistry=Qbe());const fg=globalThis.__zod_globalRegistry;function Ybe(e,t){return new e({type:"string",...Mn(t)})}function Jbe(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Mn(t)})}function jN(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Mn(t)})}function Xbe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Mn(t)})}function e3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Mn(t)})}function t3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Mn(t)})}function n3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Mn(t)})}function i3e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Mn(t)})}function o3e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Mn(t)})}function s3e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Mn(t)})}function r3e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Mn(t)})}function l3e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Mn(t)})}function a3e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Mn(t)})}function u3e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Mn(t)})}function c3e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Mn(t)})}function d3e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Mn(t)})}function f3e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Mn(t)})}function h3e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Mn(t)})}function p3e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Mn(t)})}function m3e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Mn(t)})}function g3e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Mn(t)})}function v3e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Mn(t)})}function y3e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Mn(t)})}function k3e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Mn(t)})}function b3e(e,t){return new e({type:"string",format:"date",check:"string_format",...Mn(t)})}function w3e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Mn(t)})}function C3e(e,t){return new e({type:"string",format:"duration",check:"string_format",...Mn(t)})}function A3e(e,t){return new e({type:"number",checks:[],...Mn(t)})}function x3e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Mn(t)})}function S3e(e,t){return new e({type:"boolean",...Mn(t)})}function _3e(e){return new e({type:"unknown"})}function M3e(e,t){return new e({type:"never",...Mn(t)})}function HN(e,t){return new cW({check:"less_than",...Mn(t),value:e,inclusive:!1})}function E8(e,t){return new cW({check:"less_than",...Mn(t),value:e,inclusive:!0})}function WN(e,t){return new dW({check:"greater_than",...Mn(t),value:e,inclusive:!1})}function L8(e,t){return new dW({check:"greater_than",...Mn(t),value:e,inclusive:!0})}function qN(e,t){return new Hke({check:"multiple_of",...Mn(t),value:e})}function yW(e,t){return new qke({check:"max_length",...Mn(t),maximum:e})}function m4(e,t){return new Uke({check:"min_length",...Mn(t),minimum:e})}function kW(e,t){return new Vke({check:"length_equals",...Mn(t),length:e})}function I3e(e,t){return new Kke({check:"string_format",format:"regex",...Mn(t),pattern:e})}function T3e(e){return new Zke({check:"string_format",format:"lowercase",...Mn(e)})}function E3e(e){return new Gke({check:"string_format",format:"uppercase",...Mn(e)})}function L3e(e,t){return new Qke({check:"string_format",format:"includes",...Mn(t),includes:e})}function N3e(e,t){return new Yke({check:"string_format",format:"starts_with",...Mn(t),prefix:e})}function D3e(e,t){return new Jke({check:"string_format",format:"ends_with",...Mn(t),suffix:e})}function J1(e){return new Xke({check:"overwrite",tx:e})}function F3e(e){return J1(t=>t.normalize(e))}function B3e(){return J1(e=>e.trim())}function R3e(){return J1(e=>e.toLowerCase())}function O3e(){return J1(e=>e.toUpperCase())}function $3e(){return J1(e=>K4e(e))}function P3e(e,t,n){return new e({type:"array",element:t,...Mn(n)})}function z3e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Mn(n)})}function j3e(e){const t=H3e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(O0(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(O0(o))}},e(n.value,n)));return t}function H3e(e,t){const n=new wl({check:"custom",...Mn(t)});return n._zod.check=e,n}function bW(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??fg,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function fs(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),fs(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Dr(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function wW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function CW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:g4(t,"input",e.processors),output:g4(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Dr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Dr(i.element,n);if(i.type==="set")return Dr(i.valueType,n);if(i.type==="lazy")return Dr(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Dr(i.innerType,n);if(i.type==="intersection")return Dr(i.left,n)||Dr(i.right,n);if(i.type==="record"||i.type==="map")return Dr(i.keyType,n)||Dr(i.valueType,n);if(i.type==="pipe")return Dr(i.in,n)||Dr(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Dr(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Dr(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Dr(o,n))return!0;return!!(i.rest&&Dr(i.rest,n))}return!1}const W3e=(e,t={})=>n=>{const i=bW({...n,processors:t});return fs(e,i),wW(i,e),CW(i,e)},g4=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=bW({...o??{},target:s,io:t,processors:n});return fs(e,r),wW(r,e),CW(r,e)},q3e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},U3e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=q3e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},V3e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},K3e=(e,t,n,i)=>{n.type="boolean"},Z3e=(e,t,n,i)=>{n.not={}},G3e=(e,t,n,i)=>{},Q3e=(e,t,n,i)=>{const o=e._zod.def,s=XH(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},Y3e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},J3e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},X3e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},e8e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=fs(s.element,t,{...i,path:[...i.path,"items"]})},t8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=fs(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=fs(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},n8e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>fs(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},i8e=(e,t,n,i)=>{const o=e._zod.def,s=fs(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=fs(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},o8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=fs(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=fs(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=fs(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},s8e=(e,t,n,i)=>{const o=e._zod.def,s=fs(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},r8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},l8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},a8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},u8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},c8e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;fs(s,t,i);const r=t.seen.get(e);r.ref=s},d8e=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},AW=(e,t,n,i)=>{const o=e._zod.def;fs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},f8e=Mt("ZodISODateTime",(e,t)=>{hbe.init(e,t),Do.init(e,t)});function h8e(e){return k3e(f8e,e)}const p8e=Mt("ZodISODate",(e,t)=>{pbe.init(e,t),Do.init(e,t)});function m8e(e){return b3e(p8e,e)}const g8e=Mt("ZodISOTime",(e,t)=>{mbe.init(e,t),Do.init(e,t)});function v8e(e){return w3e(g8e,e)}const y8e=Mt("ZodISODuration",(e,t)=>{gbe.init(e,t),Do.init(e,t)});function k8e(e){return C3e(y8e,e)}const b8e=(e,t)=>{iW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>rke(e,n)},flatten:{value:n=>ske(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,zC,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,zC,2)}},isEmpty:{get(){return e.issues.length===0}}})},Aa=Mt("ZodError",b8e,{Parent:Error}),w8e=W7(Aa),C8e=q7(Aa),A8e=Uk(Aa),x8e=Vk(Aa),S8e=uke(Aa),_8e=cke(Aa),M8e=dke(Aa),I8e=fke(Aa),T8e=hke(Aa),E8e=pke(Aa),L8e=mke(Aa),N8e=gke(Aa),No=Mt("ZodType",(e,t)=>(Lo.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:g4(e,"input"),output:g4(e,"output")}}),e.toJSONSchema=W3e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(sf(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>rf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>w8e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>A8e(e,n,i),e.parseAsync=async(n,i)=>C8e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>x8e(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>S8e(e,n,i),e.decode=(n,i)=>_8e(e,n,i),e.encodeAsync=async(n,i)=>M8e(e,n,i),e.decodeAsync=async(n,i)=>I8e(e,n,i),e.safeEncode=(n,i)=>T8e(e,n,i),e.safeDecode=(n,i)=>E8e(e,n,i),e.safeEncodeAsync=async(n,i)=>L8e(e,n,i),e.safeDecodeAsync=async(n,i)=>N8e(e,n,i),e.refine=(n,i)=>e.check(_5e(n,i)),e.superRefine=n=>e.check(M5e(n)),e.overwrite=n=>e.check(J1(n)),e.optional=()=>KN(e),e.exactOptional=()=>h5e(e),e.nullable=()=>ZN(e),e.nullish=()=>KN(ZN(e)),e.nonoptional=n=>k5e(e,n),e.array=()=>_i(e),e.or=n=>o5e([e,n]),e.and=n=>l5e(e,n),e.transform=n=>GN(e,d5e(n)),e.default=n=>g5e(e,n),e.prefault=n=>y5e(e,n),e.catch=n=>w5e(e,n),e.pipe=n=>GN(e,n),e.readonly=()=>x5e(e),e.describe=n=>{const i=e.clone();return fg.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return fg.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return fg.get(e);const i=e.clone();return fg.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xW=Mt("_ZodString",(e,t)=>{U7.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>U3e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(I3e(...i)),e.includes=(...i)=>e.check(L3e(...i)),e.startsWith=(...i)=>e.check(N3e(...i)),e.endsWith=(...i)=>e.check(D3e(...i)),e.min=(...i)=>e.check(m4(...i)),e.max=(...i)=>e.check(yW(...i)),e.length=(...i)=>e.check(kW(...i)),e.nonempty=(...i)=>e.check(m4(1,...i)),e.lowercase=i=>e.check(T3e(i)),e.uppercase=i=>e.check(E3e(i)),e.trim=()=>e.check(B3e()),e.normalize=(...i)=>e.check(F3e(...i)),e.toLowerCase=()=>e.check(R3e()),e.toUpperCase=()=>e.check(O3e()),e.slugify=()=>e.check($3e())}),D8e=Mt("ZodString",(e,t)=>{U7.init(e,t),xW.init(e,t),e.email=n=>e.check(Jbe(F8e,n)),e.url=n=>e.check(i3e(B8e,n)),e.jwt=n=>e.check(y3e(Q8e,n)),e.emoji=n=>e.check(o3e(R8e,n)),e.guid=n=>e.check(jN(UN,n)),e.uuid=n=>e.check(Xbe(J2,n)),e.uuidv4=n=>e.check(e3e(J2,n)),e.uuidv6=n=>e.check(t3e(J2,n)),e.uuidv7=n=>e.check(n3e(J2,n)),e.nanoid=n=>e.check(s3e(O8e,n)),e.guid=n=>e.check(jN(UN,n)),e.cuid=n=>e.check(r3e($8e,n)),e.cuid2=n=>e.check(l3e(P8e,n)),e.ulid=n=>e.check(a3e(z8e,n)),e.base64=n=>e.check(m3e(K8e,n)),e.base64url=n=>e.check(g3e(Z8e,n)),e.xid=n=>e.check(u3e(j8e,n)),e.ksuid=n=>e.check(c3e(H8e,n)),e.ipv4=n=>e.check(d3e(W8e,n)),e.ipv6=n=>e.check(f3e(q8e,n)),e.cidrv4=n=>e.check(h3e(U8e,n)),e.cidrv6=n=>e.check(p3e(V8e,n)),e.e164=n=>e.check(v3e(G8e,n)),e.datetime=n=>e.check(h8e(n)),e.date=n=>e.check(m8e(n)),e.time=n=>e.check(v8e(n)),e.duration=n=>e.check(k8e(n))});function Ot(e){return Ybe(D8e,e)}const Do=Mt("ZodStringFormat",(e,t)=>{So.init(e,t),xW.init(e,t)}),F8e=Mt("ZodEmail",(e,t)=>{obe.init(e,t),Do.init(e,t)}),UN=Mt("ZodGUID",(e,t)=>{nbe.init(e,t),Do.init(e,t)}),J2=Mt("ZodUUID",(e,t)=>{ibe.init(e,t),Do.init(e,t)}),B8e=Mt("ZodURL",(e,t)=>{sbe.init(e,t),Do.init(e,t)}),R8e=Mt("ZodEmoji",(e,t)=>{rbe.init(e,t),Do.init(e,t)}),O8e=Mt("ZodNanoID",(e,t)=>{lbe.init(e,t),Do.init(e,t)}),$8e=Mt("ZodCUID",(e,t)=>{abe.init(e,t),Do.init(e,t)}),P8e=Mt("ZodCUID2",(e,t)=>{ube.init(e,t),Do.init(e,t)}),z8e=Mt("ZodULID",(e,t)=>{cbe.init(e,t),Do.init(e,t)}),j8e=Mt("ZodXID",(e,t)=>{dbe.init(e,t),Do.init(e,t)}),H8e=Mt("ZodKSUID",(e,t)=>{fbe.init(e,t),Do.init(e,t)}),W8e=Mt("ZodIPv4",(e,t)=>{vbe.init(e,t),Do.init(e,t)}),q8e=Mt("ZodIPv6",(e,t)=>{ybe.init(e,t),Do.init(e,t)}),U8e=Mt("ZodCIDRv4",(e,t)=>{kbe.init(e,t),Do.init(e,t)}),V8e=Mt("ZodCIDRv6",(e,t)=>{bbe.init(e,t),Do.init(e,t)}),K8e=Mt("ZodBase64",(e,t)=>{wbe.init(e,t),Do.init(e,t)}),Z8e=Mt("ZodBase64URL",(e,t)=>{Abe.init(e,t),Do.init(e,t)}),G8e=Mt("ZodE164",(e,t)=>{xbe.init(e,t),Do.init(e,t)}),Q8e=Mt("ZodJWT",(e,t)=>{_be.init(e,t),Do.init(e,t)}),SW=Mt("ZodNumber",(e,t)=>{hW.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>V3e(e,i,o),e.gt=(i,o)=>e.check(WN(i,o)),e.gte=(i,o)=>e.check(L8(i,o)),e.min=(i,o)=>e.check(L8(i,o)),e.lt=(i,o)=>e.check(HN(i,o)),e.lte=(i,o)=>e.check(E8(i,o)),e.max=(i,o)=>e.check(E8(i,o)),e.int=i=>e.check(VN(i)),e.safe=i=>e.check(VN(i)),e.positive=i=>e.check(WN(0,i)),e.nonnegative=i=>e.check(L8(0,i)),e.negative=i=>e.check(HN(0,i)),e.nonpositive=i=>e.check(E8(0,i)),e.multipleOf=(i,o)=>e.check(qN(i,o)),e.step=(i,o)=>e.check(qN(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function yn(e){return A3e(SW,e)}const Y8e=Mt("ZodNumberFormat",(e,t)=>{Mbe.init(e,t),SW.init(e,t)});function VN(e){return x3e(Y8e,e)}const J8e=Mt("ZodBoolean",(e,t)=>{Ibe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>K3e(e,n,i)});function xv(e){return S3e(J8e,e)}const X8e=Mt("ZodUnknown",(e,t)=>{Tbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>G3e()});function _s(){return _3e(X8e)}const e5e=Mt("ZodNever",(e,t)=>{Ebe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Z3e(e,n,i)});function t5e(e){return M3e(e5e,e)}const n5e=Mt("ZodArray",(e,t)=>{Lbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>e8e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(m4(n,i)),e.nonempty=n=>e.check(m4(1,n)),e.max=(n,i)=>e.check(yW(n,i)),e.length=(n,i)=>e.check(kW(n,i)),e.unwrap=()=>e.element});function _i(e,t){return P3e(n5e,e,t)}const i5e=Mt("ZodObject",(e,t)=>{Dbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>t8e(e,n,i,o),ji(e,"shape",()=>t.shape),e.keyof=()=>xo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_s()}),e.loose=()=>e.clone({...e._zod.def,catchall:_s()}),e.strict=()=>e.clone({...e._zod.def,catchall:t5e()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>eke(e,n),e.safeExtend=n=>tke(e,n),e.merge=n=>nke(e,n),e.pick=n=>J4e(e,n),e.omit=n=>X4e(e,n),e.partial=(...n)=>ike(MW,e,n[0]),e.required=(...n)=>oke(IW,e,n[0])});function Gt(e,t){const n={type:"object",shape:e??{},...Mn(t)};return new i5e(n)}const _W=Mt("ZodUnion",(e,t)=>{gW.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>n8e(e,n,i,o),e.options=t.options});function o5e(e,t){return new _W({type:"union",options:e,...Mn(t)})}const s5e=Mt("ZodDiscriminatedUnion",(e,t)=>{_W.init(e,t),Fbe.init(e,t)});function lf(e,t,n){return new s5e({type:"union",options:t,discriminator:e,...Mn(n)})}const r5e=Mt("ZodIntersection",(e,t)=>{Bbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>i8e(e,n,i,o)});function l5e(e,t){return new r5e({type:"intersection",left:e,right:t})}const a5e=Mt("ZodRecord",(e,t)=>{Rbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>o8e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function V7(e,t,n){return new a5e({type:"record",keyType:e,valueType:t,...Mn(n)})}const HC=Mt("ZodEnum",(e,t)=>{Obe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>Q3e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new HC({...t,checks:[],...Mn(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new HC({...t,checks:[],...Mn(o),entries:s})}});function xo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new HC({type:"enum",entries:n,...Mn(t)})}const u5e=Mt("ZodLiteral",(e,t)=>{$be.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Y3e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Hn(e,t){return new u5e({type:"literal",values:Array.isArray(e)?e:[e],...Mn(t)})}const c5e=Mt("ZodTransform",(e,t)=>{Pbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>X3e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new YH(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(O0(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(O0(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function d5e(e){return new c5e({type:"transform",transform:e})}const MW=Mt("ZodOptional",(e,t)=>{vW.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function KN(e){return new MW({type:"optional",innerType:e})}const f5e=Mt("ZodExactOptional",(e,t)=>{zbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function h5e(e){return new f5e({type:"optional",innerType:e})}const p5e=Mt("ZodNullable",(e,t)=>{jbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>s8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ZN(e){return new p5e({type:"nullable",innerType:e})}const m5e=Mt("ZodDefault",(e,t)=>{Hbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>l8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function g5e(e,t){return new m5e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tW(t)}})}const v5e=Mt("ZodPrefault",(e,t)=>{Wbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>a8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function y5e(e,t){return new v5e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tW(t)}})}const IW=Mt("ZodNonOptional",(e,t)=>{qbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>r8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function k5e(e,t){return new IW({type:"nonoptional",innerType:e,...Mn(t)})}const b5e=Mt("ZodCatch",(e,t)=>{Ube.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>u8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function w5e(e,t){return new b5e({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const C5e=Mt("ZodPipe",(e,t)=>{Vbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>c8e(e,n,i,o),e.in=t.in,e.out=t.out});function GN(e,t){return new C5e({type:"pipe",in:e,out:t})}const A5e=Mt("ZodReadonly",(e,t)=>{Kbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>d8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function x5e(e){return new A5e({type:"readonly",innerType:e})}const S5e=Mt("ZodCustom",(e,t)=>{Zbe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>J3e(e,n)});function _5e(e,t={}){return z3e(S5e,e,t)}function M5e(e){return j3e(e)}const Dh=Ot().min(1),K7=Ot().min(1),Sv=Ot().min(1),Fh=Ot().min(1),Kl=Ot().min(1),I5e=/^[A-Za-z0-9._-]{1,128}$/;function T5e(e){return I5e.test(e)&&e!=="."&&e!==".."}const TW=lf("kind",[Gt({kind:Hn("user"),payload:_s().optional()}),Gt({kind:Hn("cron"),taskId:Fh.optional(),payload:_s().optional()}),Gt({kind:Hn("task"),taskId:Fh,payload:_s().optional()}),Gt({kind:Hn("hook"),payload:_s().optional()}),Gt({kind:Hn("compaction"),payload:_s().optional()}),Gt({kind:Hn("side"),payload:_s().optional()}),Gt({kind:Hn("other"),payload:_s().optional()})]),E5e=Gt({inputTokens:yn().optional(),outputTokens:yn().optional(),cachedTokens:yn().optional(),cost:yn().optional()}),Jg=Gt({inputOther:yn(),output:yn(),inputCacheRead:yn(),inputCacheCreation:yn()}),L5e=Gt({llmFirstTokenLatencyMs:yn().optional(),llmStreamDurationMs:yn().optional(),llmRequestBuildMs:yn().optional(),llmServerFirstTokenMs:yn().optional(),llmServerDecodeMs:yn().optional(),llmClientConsumeMs:yn().optional()}),N5e=Gt({failedAttempt:yn(),nextAttempt:yn(),maxAttempts:yn(),delayMs:yn(),errorName:Ot(),errorMessage:Ot(),statusCode:yn().optional()}),EW=xo(["queued","running","completed","failed","cancelled"]),D5e=xo(["running","completed","interrupted","failed"]),F5e=Gt({kind:Hn("text"),frameId:Sv,role:xo(["assistant","user"]),text:Ot(),attachmentIds:_i(Ot()).optional(),taskId:Fh.optional(),promptIds:_i(Ot()).optional()}),B5e=Gt({kind:Hn("thinking"),frameId:Sv,text:Ot()}),R5e=Gt({agentId:Kl,role:xo(["child","member"]).optional()}),O5e=Gt({kind:xo(["stdout","stderr","progress","status","custom"]),text:Ot().optional(),percent:yn().optional(),customKind:Ot().optional(),customData:_s().optional()}),$5e=Gt({kind:Hn("tool"),frameId:Sv,toolCallId:Ot(),name:Ot(),view:Ot().optional(),state:xo(["running","done","error"]),input:_s().optional(),output:_s().optional(),display:_s().optional(),error:Ot().optional(),inputText:Ot().optional(),progress:O5e.optional(),taskId:Fh.optional(),approvalId:Ot().optional(),todoId:Ot().optional(),agentRefs:_i(R5e).optional()}),Z7=Gt({interactionId:Ot(),interactionKind:xo(["approval","question"]),toolCallId:Ot().optional(),state:xo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:_s().optional(),response:_s().optional()}),P5e=Gt({kind:Hn("notice"),frameId:Sv,level:xo(["error","warning","info"]),source:Ot().optional(),message:Ot(),detail:_s().optional()}),LW=lf("kind",[F5e,B5e,$5e,P5e]),NW=Gt({kind:Hn("step"),stepId:K7,turnId:Dh,ordinal:yn().int(),state:D5e,frames:_i(LW),startedAt:Ot().optional(),endedAt:Ot().optional(),usage:Jg.optional(),finishReason:Ot().optional(),timing:L5e.optional(),retry:N5e.optional(),endReason:Ot().optional(),endMessage:Ot().optional()}),DW=Gt({kind:Hn("turn"),turnId:Dh,ordinal:yn().int(),state:EW,origin:TW,prompt:Ot().optional(),attachmentIds:_i(Ot()).optional(),steps:_i(NW),startedAt:Ot().optional(),endedAt:Ot().optional(),usage:E5e.optional(),durationMs:yn().optional(),error:Ot().optional()}),FW=Gt({kind:Hn("marker"),markerId:Ot(),marker:Ot(),payload:_s().optional(),at:Ot().optional()}),BW=Gt({kind:Hn("taskref"),refId:Ot(),taskId:Fh,at:Ot().optional()}),RW=lf("kind",[DW,FW,BW]),G7=Gt({taskId:Fh,kind:xo(["shell","subagent","tool","other"]),state:xo(["running","completed","failed","timed_out","killed","lost"]),detached:xv(),description:Ot().optional(),agentId:Kl.optional(),outputTail:Ot(),startedAt:Ot().optional(),endedAt:Ot().optional(),resultSummary:Ot().optional(),error:Ot().optional(),stateReason:Ot().optional(),usage:Jg.optional(),model:Ot().optional(),thinkingEffort:Ot().optional()}),OW=Gt({objective:Ot(),status:xo(["active","paused","blocked","complete"]),completionCriterion:Ot().optional(),budgetUsed:yn().optional(),budgetLimit:yn().optional()}),z5e=Gt({plan:Gt({reviewPath:Ot().optional(),version:yn().optional()}).optional(),swarm:Gt({trigger:Ot().optional()}).optional(),tower:Gt({}).optional()}),j5e=Gt({plan:Gt({reviewPath:Ot().optional(),version:yn().optional()}).nullable().optional(),swarm:Gt({trigger:Ot().optional()}).nullable().optional(),tower:Gt({}).nullable().optional()}),H5e=lf("kind",[Gt({kind:Hn("idle")}),Gt({kind:Hn("running"),turnId:yn(),step:yn(),stepId:Ot(),since:yn()}),Gt({kind:Hn("streaming"),turnId:yn(),step:yn(),stepId:Ot(),stream:xo(["assistant","thinking","tool_call"]),toolCallId:Ot().optional(),toolName:Ot().optional(),since:yn()}),Gt({kind:Hn("tool_call"),turnId:yn(),step:yn(),toolCallId:Ot(),name:Ot(),since:yn()}),Gt({kind:Hn("retrying"),turnId:yn(),step:yn(),stepId:Ot(),failedAttempt:yn(),nextAttempt:yn(),maxAttempts:yn(),delayMs:yn(),errorName:Ot().optional(),statusCode:yn().optional(),since:yn()}),Gt({kind:Hn("awaiting_approval"),turnId:yn(),step:yn().optional(),approval:_s().optional(),since:yn()}),Gt({kind:Hn("interrupted"),turnId:yn(),step:yn().optional(),reason:xo(["aborted","max_steps","error"]),message:Ot().optional(),at:yn()}),Gt({kind:Hn("ended"),turnId:yn(),reason:xo(["completed","cancelled","failed","blocked"]),durationMs:yn().optional(),at:yn()})]),W5e=Gt({byModel:V7(Ot(),Jg).optional(),currentTurn:Jg.optional(),total:Jg.optional()}),q5e=Gt({model:Ot().optional(),thinkingEffort:Ot().optional(),usage:W5e.optional(),contextTokens:yn().optional(),maxContextTokens:yn().optional(),contextUsage:yn().optional(),permission:xo(["manual","yolo","auto"]).optional(),phase:H5e.optional()}),Q7=Gt({goal:OW.optional(),modes:z5e.optional(),activity:xo(["idle","turn","disposing","unknown"]).optional(),agent:q5e.optional()}),U5e=Q7.extend({goal:OW.nullable().optional(),modes:j5e.optional()}),Zk=Gt({attachmentId:Ot(),mediaType:Ot(),name:Ot().optional(),size:yn().optional(),source:lf("kind",[Gt({kind:Hn("url"),url:Ot()}),Gt({kind:Hn("file"),fileId:Ot()}),Gt({kind:Hn("session_media"),fileId:Ot()})]).optional(),placeholder:Ot().optional()}),V5e=Gt({title:Ot(),status:xo(["pending","in_progress","done"])}),Y7=Gt({todoId:Ot(),items:_i(V5e),updatedAt:Ot().optional()}),J7=Gt({promptId:Ot(),status:xo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:Ot().optional(),content:_s().optional(),createdAt:Ot(),finishedAt:Ot().optional(),steeredAt:Ot().optional()}),$W=Gt({items:_i(RW),tasks:_i(G7),interactions:_i(Z7).default([]),attachments:_i(Zk).default([]),todos:_i(Y7).default([]),prompts:_i(J7).default([]),meta:Q7,hasMoreOlder:xv().optional()}),K5e=DW.omit({steps:!0}),Z5e=NW.omit({frames:!0}),G5e=lf("type",[Gt({type:Hn("frame"),turnId:Dh,stepId:K7,frameId:Sv}),Gt({type:Hn("task"),taskId:Fh})]),X7=lf("op",[Gt({op:Hn("reset"),agentId:Kl,snapshot:$W}),Gt({op:Hn("turn.upsert"),turn:K5e}),Gt({op:Hn("step.upsert"),turnId:Dh,step:Z5e}),Gt({op:Hn("frame.upsert"),turnId:Dh,stepId:K7,frame:LW}),Gt({op:Hn("append"),target:G5e,offset:yn().int().nonnegative(),text:Ot()}),Gt({op:Hn("marker.upsert"),item:FW,beforeTurn:yn().int().optional()}),Gt({op:Hn("taskref.upsert"),item:BW,beforeTurn:yn().int().optional()}),Gt({op:Hn("task.upsert"),task:G7}),Gt({op:Hn("interaction.upsert"),interaction:Z7}),Gt({op:Hn("attachment.upsert"),attachment:Zk}),Gt({op:Hn("todo.upsert"),todo:Y7}),Gt({op:Hn("prompt.upsert"),prompt:J7}),Gt({op:Hn("meta.merge"),meta:U5e}),Gt({op:Hn("items.remove"),ids:_i(Ot())})]);Gt({agentId:Kl,ops:_i(X7)});const Q5e=xo(["off","turn","block","delta"]),E1=yn().int().nonnegative(),Y5e=V7(Ot(),Q5e);Gt({session_id:Ot().min(1),transcript:Y5e,transcript_since:V7(Ot(),E1).optional()});Gt({agent_id:Kl,before_turn:Ot().min(1).optional(),after_turn:Ot().min(1).optional(),page_size:yn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),T5e(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const J5e=Gt({agentId:Kl,type:xo(["main","sub","independent"]).optional(),parentAgentId:Kl.optional(),label:Ot().optional(),createdAt:Ot().optional(),disposedAt:Ot().optional()}),X5e=Gt({agent_id:Kl,items:_i(RW),has_more:xv(),tasks:_i(G7),interactions:_i(Z7).default([]),attachments:_i(Zk).default([]),todos:_i(Y7).default([]),prompts:_i(J7).default([]),meta:Q7,agents:_i(J5e),pending_interactions:_i(Ot()),seq:E1.optional()});Gt({agent_id:Kl,batches:_i(Gt({seq:E1,ops:_i(X7)})),latest_seq:E1,complete:xv()});const ewe=Gt({turn_id:Dh,ordinal:yn().int(),state:EW,origin:TW,prompt:Ot(),attachment_ids:_i(Ot()).optional(),started_at:Ot().optional()});Gt({agents:_i(Gt({agent_id:Kl,messages:_i(ewe),attachments:_i(Zk).default([])}))});const twe=Gt({state:xo(["pending","approved","rejected","cancelled"]),selected_option:Ot().optional(),feedback:Ot().optional()}),nwe=Gt({tool_call_id:Ot(),turn_id:Dh,source:xo(["interaction","display","output"]),plan:Ot(),path:Ot().optional(),options:_i(Gt({label:Ot(),description:Ot().optional()})).optional(),review:twe.optional()});Gt({agent_id:Kl,plans:_i(nwe)});const iwe=Gt({agent_id:Kl,snapshot:$W,has_more_older:xv(),seq:E1.optional()}),owe=Gt({agent_id:Kl,ops:_i(X7),seq:E1.optional()}),PW=iwe.extend({type:Hn("transcript.reset")}),zW=owe.extend({type:Hn("transcript.ops")});lf("type",[PW,zW]);const QN=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),swe=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),rwe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),lwe=new Set(["assistant.delta","thinking.delta"]);function awe(e,t){if(rwe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return lwe.has(i)?uwe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?swe.has(i)?{route:"protocol"}:QN.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:QN.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function uwe(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const cwe="kimi-code.bearer.",dwe=3e4;class YN{constructor(t){this.opts=t,this.tracer=t.tracer??R7}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${cwe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=X2(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(X2(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(X2(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,dwe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=PW.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=zW.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=X2(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=awe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function X2(e,t){return`${e}\0${t}`}async function fwe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=X5e.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const N8=10485760,hwe=5e3,JN=40001;function pwe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function mwe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function D8(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function XN(e){return e==="auto_compact"||e==="manual_compact"}class gwe{constructor(t){this.opts=t,this.tracer=t.tracer??R7,this.http=new wN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new wN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(hu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return hu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return hu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return hu(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return ZH(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return hu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(VH),hasMore:o.has_more}}async getSessionTranscript(t,n){return fwe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` -`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&qi(d)&&d.code===JN)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:pwe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,a4e(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...mwe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:yN});return hu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:yN});return hu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(hu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,u4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,m4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>OC(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return OC(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(D8)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return D8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return D8(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(KH));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(xN)])):void 0;return{items:o.items.map(xN),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:search",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async suggestFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:suggest",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return fd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Yg)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return Yg(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Yg(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(v4e)}async listProviders(){return(await this.http.get("/providers")).items.map(kp)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=kp(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return kp(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:kp(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(SN)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return SN(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:kp(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(kp),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return F8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return F8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return F8(t)}async getConfig(){const t=await this.http.get("/config");return $C(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return $C(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&qi(i)&&i.code===JN)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),hwe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return fd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return fd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:N8});if(n.size>N8)throw new O7({size:n.size,limit:N8});const i=n.type,o=!vwe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await ywe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=gN(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new YN({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=y4e(s),l=k4e(s),a=g4e(s);a.type==="historyCompacted"&&!XN(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!XN(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new YN({wsUrl:gN(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function F8(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function vwe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function ywe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const kwe="main",bwe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function B8(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function wwe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function eD(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function yr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Js(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function oa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Cwe(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=yr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=yr(t,"goalId")??yr(t,"goal_id")??"goal",r=yr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:yr(t,"completionCriterion")??yr(t,"completion_criterion"),status:o,turnsUsed:Js(t,"turnsUsed")??Js(t,"turns_used")??0,tokensUsed:Js(t,"tokensUsed")??Js(t,"tokens_used")??0,wallClockMs:Js(t,"wallClockMs")??Js(t,"wall_clock_ms")??0,terminalReason:yr(t,"terminalReason")??yr(t,"terminal_reason"),budget:{tokenBudget:oa(i,"tokenBudget")??oa(i,"token_budget"),remainingTokens:oa(i,"remainingTokens")??oa(i,"remaining_tokens"),turnBudget:oa(i,"turnBudget")??oa(i,"turn_budget"),remainingTurns:oa(i,"remainingTurns")??oa(i,"remaining_turns"),wallClockBudgetMs:oa(i,"wallClockBudgetMs")??oa(i,"wall_clock_budget_ms"),remainingWallClockMs:oa(i,"remainingWallClockMs")??oa(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function nd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function Awe(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=yr(n,"name")??yr(n,"toolName")??"tool",o=R$(e,xwe(i)),s=Swe(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=yr(i,"text");if(s)return R8(s);const r=yr(i,"message");if(r)return R8(r)}const o=yr(n,"message");if(o)return R8(o)}return null}function xwe(e){return e.replace(/_\d+$/,"")}const tD=2e3;function R8(e){return e.length>tD?`${e.slice(0,tD)}…`:e}function Swe(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return S6(e,t,i)}function _we(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=yr(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=nd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),v=[];return g&&v.push({type:"taskCreated",sessionId:n,task:g}),v.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),v}const l=Awe(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=nd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function Mwe(e){return Array.isArray(e)?e.map(t=>$7(t)):[]}function Iwe(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const Twe=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function Ewe(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=Cwe(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function Lwe(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=eD(),n.set(f,h)),h}function s(f){n.set(f,eD())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(v){return yu("[agentProjector] Error projecting event:",f,v instanceof Error?v.message:v),[]}}function d(f,h,m,g){if(Twe.has(f))return Ewe(f,h,m);const v=o(m),y=h,b=[],w=y?.agentId;if(typeof w=="string"&&w!==kwe){const C=i.has(w);if(f==="prompt.submitted"){if(!C)return[];const T=y?.promptId,N=y?.userMessageId;if(!T||!N)return[];const I=Mwe(y?.content);return I.length===0?[]:[{type:"messageCreated",agentId:w,message:{id:N,sessionId:m,role:"user",content:I,createdAt:typeof y?.createdAt=="string"?y.createdAt:new Date().toISOString(),promptId:T}}]}if(C&&(f==="thinking.delta"||f==="assistant.delta")){const T=y?.delta??"";return T?[{type:"agentDelta",sessionId:m,agentId:w,delta:{[f==="thinking.delta"?"thinking":"text"]:T}}]:[]}if(C&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:w,reason:y?.reason}];if(bwe.has(f))return _we(t,v,m,w,f,y??{},i)}switch(f){case"turn.started":{const C=y?.turnId,T=v.currentPromptId??B8("pr_");v.currentPromptId=T,C!==void 0&&v.turnPromptId.set(C,T),b.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const C=wwe(y?.usage);v.totalInput+=C.input,v.totalOutput+=C.output,v.totalCacheRead+=C.cacheRead,v.totalCacheCreate+=C.cacheCreate;break}case"agent.status.updated":{y?.model&&(v.model=y.model),y?.contextTokens!==void 0&&(v.contextTokens=y.contextTokens),y?.maxContextTokens!==void 0&&(v.contextLimit=y.maxContextTokens);const C=y?.phase;C!=null&&C.kind==="retrying"?(v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Js(C,"failedAttempt")??0,nextAttempt:Js(C,"nextAttempt")??0,maxAttempts:Js(C,"maxAttempts")??0,delayMs:Js(C,"delayMs")??0,errorName:yr(C,"errorName"),statusCode:Js(C,"statusCode"),turnId:Js(C,"turnId")}})):v.retryActive&&C!==void 0&&C!==null&&typeof C.kind=="string"&&(v.retryActive=!1,b.push({type:"turnRetry",sessionId:m,retry:void 0})),b.push({type:"sessionUsageUpdated",sessionId:m,usage:Iwe(v),model:v.model||void 0,swarmMode:y?.swarmMode===!0?!0:y?.swarmMode===!1?!1:void 0,planMode:y?.planMode===!0?!0:y?.planMode===!1?!1:void 0,thinking:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:void 0});break}case"turn.ended":{const C=y?.turnId,T=(C!==void 0?v.turnPromptId.get(C):void 0)??v.currentPromptId;b.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:y?.reason,promptId:T}),v.turnCount++,v.currentPromptId=void 0;break}case"prompt.completed":{const C=y?.promptId;typeof C=="string"&&C.length>0&&b.push({type:"promptCompleted",sessionId:m,promptId:C,reason:y?.reason??"completed"});break}case"prompt.aborted":{const C=y?.promptId;typeof C=="string"&&C.length>0&&b.push({type:"promptAborted",sessionId:m,promptId:C});break}case"turn.step.retrying":{v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Js(y??{},"failedAttempt")??0,nextAttempt:Js(y??{},"nextAttempt")??0,maxAttempts:Js(y??{},"maxAttempts")??0,delayMs:Js(y??{},"delayMs")??0,errorName:yr(y??{},"errorName"),statusCode:Js(y??{},"statusCode"),turnId:typeof y?.turnId=="number"?y.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const C=typeof y?.subagentId=="string"&&y.subagentId.length>0?y.subagentId:B8("task_"),T=typeof y?.taskId=="string"&&y.taskId.length>0?y.taskId:void 0,N=T!==void 0&&T!==C?v.subagentMeta.get(T):void 0,I=v.subagentMeta.get(C);N!==void 0&&v.subagentMeta.delete(T),T!==void 0&&!v.registrationOrderByKey.has(T)&&v.registrationOrderByKey.set(T,++v.registrationSeq);const S=I===void 0||N===void 0?I??N:{...I,createdAt:N.createdAt,startedAt:N.startedAt??I.startedAt,runInBackground:!0,backgroundTaskId:I.backgroundTaskId??T},_=S?.backgroundTaskId??(S!==void 0&&T!==void 0&&S.id===T?T:void 0),x=T!==void 0?v.registrationOrderByKey.get(T):void 0,E=_!==void 0?v.registrationOrderByKey.get(_):void 0,M=v.retiredBindings.has(T??"")||x!==void 0&&E!==void 0&&x0?y.model:S?.model,thinkingEffort:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:S?.thinkingEffort,parentToolCallId:typeof y?.parentToolCallId=="string"?y.parentToolCallId:S?.parentToolCallId,swarmIndex:typeof y?.swarmIndex=="number"?y.swarmIndex:S?.swarmIndex,runInBackground:R?y?.runInBackground===!0||y?.runInBackground===void 0&&S?.runInBackground===!0:y?.runInBackground===!0||S?.runInBackground===!0,outputPreview:R?void 0:S?.outputPreview,outputBytes:R?void 0:S?.outputBytes,outputLines:R?void 0:S?.outputLines,suspendedReason:R?void 0:S?.suspendedReason,text:R?void 0:S?.text,backgroundTaskId:M?S?.backgroundTaskId:R?T:T??S?.backgroundTaskId};v.subagentMeta.set(z.id,z),b.push({type:"taskCreated",sessionId:m,task:z});break}case"subagent.started":{const C=typeof y?.subagentId=="string"?y.subagentId:void 0,T=C!==void 0&&(v.subagentMeta.get(C)?.status!==void 0&&v.subagentMeta.get(C).status!=="running"||v.settledByKernel.has(C));T&&v.settledByKernel.delete(C);const N=nd(t,v,m,y?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...T?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});T&&C!==void 0&&v.restartedThisRun.add(C),N&&b.push({type:"taskCreated",sessionId:m,task:N});break}case"subagent.suspended":{const C=nd(t,v,m,y?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof y?.reason=="string"?y.reason:void 0});C&&b.push({type:"taskCreated",sessionId:m,task:C});break}case"subagent.completed":{const C=typeof y?.resultSummary=="string"?y.resultSummary:void 0,T=nd(t,v,m,y?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:C});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"completed",outputPreview:C});break}case"subagent.failed":{const C=typeof y?.error=="string"?y.error:void 0,T=nd(t,v,m,y?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:C});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"failed",outputPreview:C});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:y?.code,message:y?.message,name:y?.name,details:y?.details,retryable:y?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:y?.message}});break}case"task.started":case"background.task.started":{const C=y?.info??{},T=typeof C.startedAt=="number"?new Date(C.startedAt).toISOString():void 0,N=typeof C.taskId=="string"?C.taskId:typeof C.taskId=="number"?String(C.taskId):B8("task_"),I=typeof C.description=="string"?C.description:typeof C.command=="string"?C.command:t("tasks.defaultDescription");if(C.kind==="agent"){const _=typeof C.agentId=="string"&&C.agentId.length>0?C.agentId:void 0;if(_!==void 0){const x=v.subagentMeta.get(_),E=v.registrationOrderByKey.get(N),M=x?.backgroundTaskId!==void 0?v.registrationOrderByKey.get(x.backgroundTaskId):void 0;if(v.retiredBindings.has(N)||E!==void 0&&M!==void 0&&EM.backgroundTaskId===N);if(x===void 0&&(v.retiredBindings.has(N)||v.registrationOrderByKey.has(N)&&v.registrationOrderByKey.get(N)0&&v.settledByKernel.add(C.agentId),b.push({type:"taskCompleted",sessionId:m,taskId:typeof C.taskId=="string"?C.taskId:typeof C.taskId=="number"?String(C.taskId):"",status:C.status==="killed"?"cancelled":T?"failed":"completed"});break}}return b}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function Nwe(e){return new gwe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>Lwe({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const Dwe={t:e=>e},nD="Sub Agent";function Fwe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function Bwe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Rwe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function ey(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const Owe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function WC(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?Owe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function $we(e,t,n,i=Dwe){const o=Bwe(e);switch(Rwe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!ey(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),v=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),y=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,b=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:v?g.status:t.task.status,subagentPhase:v?g.subagentPhase:t.task.subagentPhase,completedAt:v?g.completedAt:b?h.completedAt:t.task.completedAt,completedAtEstimated:v?g.completedAtEstimated:b?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:v?g.outputLines:y?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:v?g.text:y?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:v?g.outputPreview:t.task.outputPreview??(y?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:v?g.outputBytes:t.task.outputBytes??(y?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===nD&&h.description!==nD?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:y?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:y?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!ey(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!ey(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(ey(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,WC(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function Pwe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,jwe=/([\w-]+)="([^"]*)"/g,Hwe=/]*)>[\s\S]*?<\/output-file>/,Wwe=/]*)>([\s\S]*?)<\/output-preview>/,qwe=/^Title: (.*)$/m,Uwe=/^Severity: (.*)$/m;function Ky(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function O8(e){const t={};for(const n of e.matchAll(jwe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=Ky(n[2]));return t}function Vwe(e,t,n){const i=O8(e),o=qwe.exec(t)?.[1]?.trim()??"",s=Uwe.exec(t)?.[1]?.trim()??"";let r=t.split(` -`).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` -`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=Hwe.exec(t),u=a?(()=>{const f=O8(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=Wwe.exec(t),d=c?(()=>{const f=O8(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` -`),g=Ky(m===-1?"":h.slice(m+1)).replace(/\n$/,""),v=Number(f.bytes),y=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(v)?v:void 0,totalBytes:Number.isFinite(y)?y:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:Ky(o),severity:s,body:Ky(r),outputFile:u,outputPreview:d,raw:n}}function Kwe(e){if(!e.includes("iD||s>iD||(o+1)*(s+1)>Qwe)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const oD=500;function sD(e,t){const n=[],i=Ru(e),o=Ru(t),s=Math.min(i.length,oD),r=Math.min(o.length,oD);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function WW(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}const Ywe=/^read[_-]?media(?:file)?$/i,Jwe=/^data:([^;]+);base64,(.*)$/s,Xwe=/^<(image|video|audio)\s+path="([^"]+)">$/,eCe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,tCe=/Mime type:\s*([^.\s]+)/i,nCe=/Size:\s*(\d+)\s*bytes/i,iCe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,oCe="Image compressed to fit model limits:",sCe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function rCe(e){return e.includes(oCe)?e.replace(sCe,""):e}function lCe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function rD(e){const t=eCe.exec(e.trim());return t?{kind:t[1],path:lCe(t[2])}:null}const qW=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,aCe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function UC(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return qW.test(i)?i:void 0}const uCe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function lD(e){const t=uCe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",i=aCe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:i!==void 0&&qW.test(i)?i:void 0}}const cCe=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function UW(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function kCe(e,t){if(_r(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function bCe(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function VW(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=v4(o,s)??sD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=v4(t.before,t.after)??sD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:ore(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function KW(e){const t=` -`,n=` -`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):wCe(e)}function wCe(e){const t=e.split(` -`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` -`):e}function CCe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function ACe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` -`);return KW(t)}function xCe(e,t){const n=e.metadata?.origin??{},i=ACe(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function SCe(e,t,n){const{text:i,cron:o}=xCe(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function _Ce(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function MCe(e){return e.metadata?.origin?.kind==="compaction_summary"}function ICe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function TCe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function ECe(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function Gk(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const v=d;if(d=null,!g&&v.blocks.length===0&&v.textParts.length===0&&v.thinkingParts.length===0&&v.tools.length===0)return;if(!g||!i)for(let b=0;bN.kind==="tool"&&N.tool.id===C.id);T&&T.kind==="tool"&&(T.tool=C)}const y={id:v.id,role:"assistant",no:a++,text:v.textParts.join(` -`),thinking:v.thinkingParts.length>0?v.thinkingParts.join(` -`):void 0,tools:v.tools.length>0?v.tools:void 0,blocks:v.blocks.length>0?v.blocks:void 0,approval:v.approval,approvalId:v.approvalId,durationMs:v.durationMs,createdAt:v.createdAt,endedAt:v.endedAt,goalContinuation:v.goalContinuation};l.push(y),u?.(y,v.sources)}function h(g,v){let y=null;for(const b of v)if(b.type==="text"){if(b.text){y==="text"?g.textParts[g.textParts.length-1]+=b.text:g.textParts.push(b.text);const w=g.blocks.at(-1);w&&w.kind==="text"?w.text+=(y==="text"?"":` -`)+b.text:g.blocks.push({kind:"text",text:b.text}),y="text"}}else if(b.type==="thinking"){if(b.thinking){y==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=b.thinking:g.thinkingParts.push(b.thinking);const w=g.blocks.at(-1);if(w&&w.kind==="thinking"){w.thinking+=(y==="thinking"?"":` -`)+b.thinking;const C=[w.startedAt,b.startedAt].filter(I=>I!==void 0).sort()[0],T=w.startedAt!==void 0&&w.durationMs===void 0||b.startedAt!==void 0&&b.durationMs===void 0,N=[w,b].flatMap(I=>I.startedAt!==void 0&&I.durationMs!==void 0?[Date.parse(I.startedAt)+I.durationMs]:[]);w.startedAt=C,w.durationMs=!T&&C!==void 0&&N.length>0?Math.max(...N)-Date.parse(C):void 0}else g.blocks.push({kind:"thinking",thinking:b.thinking,startedAt:b.startedAt,durationMs:b.durationMs});y="thinking"}}else if(b.type==="toolUse"){y=null;const w=c.get(b.toolCallId),C=b.toolName==="ExitPlanMode"?s[b.toolCallId]:void 0,T={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),agentId:_r(b.toolName)==="task"?b.agentRefs?.find(N=>N.role!=="member")?.agentId??b.agentRefs?.[0]?.agentId:void 0,status:"running",output:b.outputLines,plan:C,planPath:b.toolName==="ExitPlanMode"?C?.path??o[b.toolCallId]?.path:void 0};g.tools.push(T),g.blocks.push({kind:"tool",tool:T}),w&&(g.approval=VW(w),g.approvalId=w.approvalId)}else if(b.type==="toolResult"){y=null;const w=g.tools.findIndex(C=>C.id===b.toolCallId);if(w!==-1){const C=g.tools[w],T=ex(b.output),N={...C,status:b.isError?"error":"ok",output:T,media:b.isError?void 0:yCe(C.name,b.output),agentId:C.agentId??kCe(C.name,T)};N.name==="ExitPlanMode"&&!N.planPath&&(N.planPath=TCe(N.output)),g.tools[w]=N;const I=g.blocks.find(S=>S.kind==="tool"&&S.tool.id===b.toolCallId);I&&I.kind==="tool"&&(I.tool=N)}}else y=null}function m(g,v){if(g.type==="image"||g.type==="video"){const y=g.type,b=g.source;if(b.kind==="url")return{url:b.url,kind:y};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:y};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:y,fileId:b.fileId};if(b.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(v,b.fileId)??"",kind:y,fileId:b.fileId,sessionId:v}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(MCe(g)){f();const C=g.metadata?.[jW],T={id:g.id,role:"compaction",no:a,text:g.content.filter(N=>N.type==="text").map(N=>N.text).join(` -`),compaction:{trigger:C?.trigger,tokensBefore:C?.tokensBefore,tokensAfter:C?.tokensAfter}};l.push(T),u?.(T,[g]);continue}if(g.role==="user"){const C=CCe(g),T=g.metadata?.origin?.kind,N=T==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(C===void 0&&(T==="injection"||N))continue;if(C===void 0&&(T==="task"||T==="background_task"||T==="task_notification")){const Q=g.content.filter(ve=>ve.type==="text").map(ve=>ve.text).join(` -`),te=Zwe(g.metadata),X=te!==void 0?[te]:Kwe(Q);if(X.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ve of X)d.blocks.push({kind:"notification",notification:{...ve,createdAt:g.createdAt}})}continue}if(f(),C!==void 0){const Q=SCe(g,a++,C);l.push(Q),u?.(Q,[g]);continue}if(T==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!_Ce(g))continue;const I=g.metadata?.origin,S=I?.kind==="skill_activation"&&I?.trigger==="user-slash",_=I?.kind==="plugin_command"&&I?.trigger==="user-slash",x=[],E=[];for(const Q of g.content){if(Q.type==="text")if(S){const X=rD(Q.text);if(X&&(X.kind==="video"||X.kind==="image")&&n){const ce=UC(X.path);if(ce){E.push({url:n(ce),kind:X.kind,fileId:ce});continue}}const ve=lD(Q.text);ve&&E.push({kind:"file",url:ve.fileId&&n?n(ve.fileId):"",fileId:ve.fileId,name:ve.name,mediaType:ve.mediaType,size:ve.size})}else if(_)x.push(I.commandArgs??"");else{const X=rD(Q.text);if(X&&(X.kind==="video"||X.kind==="image")&&n){const se=UC(X.path);if(se){E.push({url:n(se),kind:X.kind,fileId:se});continue}}const ve=lD(Q.text);if(ve){E.push({kind:"file",url:ve.fileId&&n?n(ve.fileId):"",fileId:ve.fileId,name:ve.name,mediaType:ve.mediaType,size:ve.size});continue}const ce=rCe(Q.text);if(ce!==Q.text&&ce.trim().length===0)continue;x.push(ce)}const te=m(Q,g.sessionId);if(te){E.push({url:te.url,kind:te.kind,name:Q.type==="file"?Q.name:void 0,fileId:te.fileId,sessionId:te.sessionId});continue}Q.type==="file"&&n&&E.push({kind:"file",url:n(Q.fileId),fileId:Q.fileId,name:Q.name,mediaType:Q.mediaType||void 0,size:Q.size})}const M=S?I?.skillArgs??"":x.join(` -`),R=hCe(M),q=pCe(M),z=E.filter(Q=>Q.kind==="file"),$=E.filter(Q=>Q.kind==="image"||Q.kind==="video"),B=[...R].some(Q=>Q<=z.length),P=[...q].some(Q=>Q<=$.length),H=B||P?E:[];let j=0,G=0;const ne=E.filter(Q=>Q.kind==="file"?(j+=1,!(B&&R.has(j))):Q.kind==="image"||Q.kind==="video"?(G+=1,!(P&&q.has(G))):!0),W={id:g.id,role:"user",no:a++,text:M,attachments:ne.length>0?ne:void 0,inlineAttachments:H.length>0?H:void 0,skillActivation:S?{name:I.skillName,args:I.skillArgs}:void 0,pluginCommand:_?{pluginId:I.pluginId,commandName:I.commandName,args:I.commandArgs}:void 0,createdAt:g.createdAt};l.push(W),u?.(W,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const v=g.promptId;ICe(d,v)?d!==null&&d.promptId===void 0&&v!==void 0&&(d.promptId=v):(f(),d={id:g.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const b=d;if(b===null)continue;const w=ECe(g.content);b.promptId!==void 0&&b.seenSigs.has(w)||(b.seenSigs.add(w),b.sources.push(g),g.durationMs!==void 0&&(b.durationMs=g.durationMs),h(b,g.content),g.endedAt!==void 0?b.endedAt=g.endedAt:g.id!==b.id&&(b.endedAt=g.createdAt))}return f(!0),l}function ZW(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function LCe(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||ZW(a,c,u)||(d.settledAt=i)}}}function NCe(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function DCe(e,t,n,i){const o=e.items.filter(d=>d.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(d=>[d.taskId,d])),a=new Map(e.prompts.map(d=>[d.promptId,d])),u=e.items.flatMap(d=>d.kind==="turn"?tx(d,e.attachments,l,d.turnId===s?n?.createdAt:void 0,d.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a}):[]),c=e.meta.activity==="turn";return Gk(u,[],t,c,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(BCe)}function tx(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(v=>[v.attachmentId,v])),u=VC([e.startedAt,...e.steps.map(v=>v.startedAt),i])??"",c=aD(e.endedAt)??aD(o),d=e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h){const v=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const y of e.attachmentIds??[]){const b=uD(a.get(y));b!==void 0&&v.push(b)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:v,createdAt:u,promptId:d,metadata:r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(y.text.length===0&&!b)continue;if(y.role==="user"){if(y.taskId!==void 0){const T=FCe(y.taskId,y.text,n.get(y.taskId));l.push({id:y.frameId,sessionId:"",role:"user",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:y.taskId},[HW]:T}});continue}const w=y.text.length>0?[{type:"text",text:y.text}]:[];for(const T of y.attachmentIds??[]){const N=uD(a.get(T));N!==void 0&&w.push(N)}const C=y.promptIds?.map(T=>r?.promptById?.get(T)).find(T=>T!==void 0);l.push({id:y.frameId,sessionId:s,role:"user",content:w,createdAt:C?.createdAt??v.startedAt??u,promptId:d});continue}l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d})}else if(y.kind==="thinking"){if(y.text.length===0)continue;const b=r?.pendingInteractionAtByStepId?.get(v.stepId),w=ZW(v,y,b!==void 0),C=r?.thinkingTiming,T=C?.get(y.frameId);let N,I;if(T!==void 0)T.settledAt===void 0&&!w&&(T.settledAt=new Date().toISOString()),N=T.startedAt,I=$8(T.startedAt,T.settledAt);else if(C!==void 0&&w){const S=new Date().toISOString();C.set(y.frameId,{startedAt:S}),N=S}else N=v.startedAt,I=$8(v.startedAt,VC([v.endedAt,b]));l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"thinking",thinking:y.text,startedAt:N,durationMs:I}],createdAt:v.startedAt??u,promptId:d})}else y.kind==="tool"&&(l.push({id:`${y.frameId}:call`,sessionId:"",role:"assistant",content:[{type:"toolUse",toolCallId:y.toolCallId,toolName:y.name,input:y.input??y.display??{},outputLines:y.state==="running"?ex(y.output):void 0,agentRefs:y.agentRefs}],createdAt:v.startedAt??u,promptId:d}),y.state!=="running"&&l.push({id:`${y.frameId}:result`,sessionId:"",role:"tool",content:[{type:"toolResult",toolCallId:y.toolCallId,output:y.output??y.error??"",isError:y.state==="error"}],createdAt:v.endedAt??v.startedAt??u,promptId:d}));const m=e.durationMs??$8(u||void 0,c),g=l.findLastIndex(v=>v.role==="assistant");return g>=0&&(m!==void 0||c!==void 0)&&(l[g]={...l[g],durationMs:m,endedAt:c??l[g].endedAt}),l}function FCe(e,t,n){const[i="",...o]=t.split(` -`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` -`).trim(),raw:t}}function BCe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function VC(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const cD=6e3,KC=256*1024,RCe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function dD(e,t){return t===0?e:e-1}function OCe(e,t){const n=Ru(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=RCe.exec(s.text);if(!r)return null;const l=dD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=dD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oKC||Ru(n).length>cD)return null;const i=OCe(e,n);return i===null||i.length>KC||Ru(i).length>cD?null:{before:i,after:n}}const PCe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function zCe(e){return PCe.has(e.type)}const jCe=50,HCe=100,ZC=32*1024,WCe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,jCe)},cancelTask(e){clearTimeout(e)}};function qCe(e,t,n={}){const i=n.scheduler??WCe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??HCe)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const y=++u,b=()=>{y===u&&m()};l=i.requestFrame(b),a=i.requestTask(b)};m=()=>{f();let y=0;for(;!c&&y{if(!c){if(t(y)){const b=s.length>r?s.at(-1):void 0,w=b===void 0?void 0:n.coalesce?.(b,y);w===void 0?s.push(y):s[s.length-1]=w,g();return}if(d()===0){e(y);return}s.push(y),m()}});return v.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let b=r;for(let w=r;w{c||(c=!0,f(),s.length=0,r=0)},v}function GC(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function UCe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=GC(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=ZC)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function VCe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=GC(e.appEvent),s=GC(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>ZC)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function KCe(e,t){const i=e.items.filter(d=>d.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(d=>[d.taskId,d])),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=d=>d.kind==="turn"?d.origin.payload??d.origin:void 0,l=new Set,a=e.items.flatMap((d,f)=>{if(d.kind==="turn"){const h=d.startedAt!==void 0||d.steps.some(m=>m.startedAt!==void 0);return ZCe(d,e.attachments,o,d.turnId===i&&!h&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s)}if(d.kind==="marker"&&d.marker==="compaction"){const h=GCe(d.payload,d.at,t.sessionId,d.markerId,YCe(e.items,f));return h===void 0?[]:[h]}if(d.kind==="marker"&&d.marker==="cron.fired"){const h=d.payload,m=h?.origin?.jobId,g=typeof h?.prompt=="string"?h.prompt:void 0,v=e.items.slice(f+1).find(b=>{if(b.kind!=="turn"||l.has(b.turnId))return!1;const w=r(b);return w?.kind==="cron_job"&&(m===void 0||w.jobId===m)&&(g===void 0||b.kind==="turn"&&KW(b.prompt??"")===g)});if(v!==void 0&&v.kind==="turn")return l.add(v.turnId),[];const y=QCe(d.payload,d.at,t.sessionId,d.markerId);return y===void 0?[]:[y]}return[]}),u=e.interactions.map(d=>Lp(d,t.sessionId)).filter(d=>d!==void 0),c=e.meta.activity==="turn";return Gk(a,u,t.getFileUrl,c,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(eAe)}function ZCe(e,t,n,i,o,s,r,l,a){const u=e.origin.payload??e.origin,c=u?.kind;return[...e.prompt===void 0&&c==="system_trigger"?[{id:`${e.turnId}:origin`,sessionId:s,role:"user",content:[],createdAt:VC([e.startedAt,...e.steps.map(f=>f.startedAt),i])??"",promptId:e.turnId,metadata:{origin:u}}]:[],...tx(e,t,n,i,o,s,{includeOrigin:!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a})]}function GCe(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[jW]:l}}}function QCe(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function YCe(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function Lp(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function qm(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(JCe),createdAt:""}}function JCe(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(XCe),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function XCe(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function eAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function tAe(){let e=[];const t=(n,i)=>{const s=KCe(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function nAe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function iAe(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` -`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&nAe(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function fD(e){return e?e.split(` -`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function oAe(e){return e.suspendedReason||fD(e.text)||fD(e.outputLines?.join(` -`))||e.summary||""}function sAe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` -`):e.summary??""}function rAe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function hD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` -`)[0]??"",phase:rAe(e.outcome),body:e.body}}function lAe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function aAe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:oAe(o),phase:o.phase,body:sAe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>lAe(s,o))).map((o,s)=>hD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>hD(o,s))}const uAe=["queued","working","suspended","completed","failed","cancelled"];function GW(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function cAe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function dAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:GW(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=cAe();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function fAe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of uAe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function hAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:GW(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function nx(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function QW(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const hg=100*1024;function YW(e){const t=_r(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=nx(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>hg||a.length>hg?null:v4(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>hg||c.length>hg)return null;const d=v4(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=Ru(u).length,r+=Ru(c).length}return o}const pAe=5e3;function mAe(e){if(_r(e.name)!=="write")return null;const t=nx(e.arg);return!t||typeof t.content!="string"||t.content.length>hg||t.content.split(` -`).length>pAe?null:{content:t.content,path:QW(t)}}function pD(e){const t=nx(e.arg);return t?QW(t):void 0}function gAe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function vAe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function yAe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function kAe(e){return JW(e).parents}function JW(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function bAe(e,t,n){const i=JW(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=gAe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:yAe(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?vAe(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function wAe(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(S,_)=>l.set(S,_);let v=n!==null;if(v){const S=n,_=Object.keys(h);v=_.length===Object.keys(S).length&&_.every(x=>h[x]===S[x])}let y=i!==null;if(y){const S=i,_=Object.keys(m);y=_.length===Object.keys(S).length&&_.every(x=>m[x]===S[x])}const b=e.length>0&&d===t&&v&&y&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let w=0,C=0,T=1;if(b){let S=-1;for(let _=e.length-1;_>=0;_--)if(e[_].role==="assistant"){S=_;break}for(let _=0;_0?[...e.slice(0,w),...N]:N;return e=I,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,I};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function CAe(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&(n++,t.set(o.id,n))}return t}const XW=["light","dark","system"],AAe=["small","medium","large","xlarge"],P8="medium",eq="kimi-web.color-scheme",QC="kimi-web.font-scale",mD="kimi-web.ui-font-size";function YC(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ix(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function xAe(e){try{globalThis.localStorage.removeItem(e)}catch{}}function SAe(){const e=YC(eq);return e&&XW.includes(e)?e:"system"}const ty={light:"#ffffff",dark:"#121212"};function _Ae(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?ty.dark:e==="light"?ty.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?ty.dark:ty.light;i.setAttribute("content",n??s)})}function tq(e){return AAe.includes(e)}function MAe(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function IAe(){const e=YC(QC);if(e==="xxlarge")return"xlarge";if(e!==null)return tq(e)?e:P8;const t=YC(mD);if(t===null)return P8;const n=Number(t),i=Number.isFinite(n)?MAe(n):P8;return ix(QC,i),xAe(mD),i}function TAe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const ox=V(SAe()),sx=V(IAe());let gD=!1;function EAe(){gD||(gD=!0,We(ox,_Ae,{immediate:!0}),We(sx,TAe,{immediate:!0}))}function LAe(e){XW.includes(e)&&(ox.value=e,ix(eq,e))}function NAe(e){tq(e)&&(sx.value=e,ix(QC,e))}function X1(){return EAe(),{colorScheme:ox,fontScale:sx,setColorScheme:LAe,setFontScale:NAe}}const ny=V(!1);let vD=!1;function z8(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Qk(){return!vD&&typeof window<"u"&&typeof document<"u"&&(vD=!0,ny.value=z8(),new MutationObserver(()=>{ny.value=z8()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ny.value=z8()})),ny}const nq="kimi-web.sidebar-multi-tab";function DAe(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function FAe(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function BAe(){return DAe(nq)==="1"}const iq=V(BAe());function RAe(e){iq.value=e,FAe(nq,e?"1":"0")}function em(){return{sidebarTabs:iq,setSidebarTabs:RAe}}const yD=document.createElement("i");function OAe(e){const t="&"+e+";";yD.innerHTML=t;const n=yD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ou(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(Ou(e,e.length,0,t),e):t}const kD={}.hasOwnProperty;function $Ae(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function lo(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Fi(a)?(e.enter(n),l(a)):t(a)}function l(a){return Fi(a)&&s++r))return;const I=t.events.length;let S=I,_,x;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(_){x=t.events[S][1].end;break}_=!0}for(y(i),N=I;Nw;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=w}function b(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function QAe(e,t,n){return lo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wD(e){if(e===null||gl(e)||UAe(e))return 1;if(qAe(e))return 2}function lx(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};CD(d,-a),CD(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=fa(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=fa(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=fa(u,lx(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=fa(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=fa(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Ou(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Fi(N)?lo(e,b,"linePrefix",s+1)(N):b(N)}function b(N){return N===null||Pn(N)?e.check(AD,g,C)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||Pn(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),w)}function C(N){return e.exit("codeFenced"),t(N)}function T(N,I,S){let _=0;return x;function x(z){return N.enter("lineEnding"),N.consume(z),N.exit("lineEnding"),E}function E(z){return N.enter("codeFencedFence"),Fi(z)?lo(N,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):M(z)}function M(z){return z===l?(N.enter("codeFencedFenceSequence"),R(z)):S(z)}function R(z){return z===l?(_++,N.consume(z),R):_>=r?(N.exit("codeFencedFenceSequence"),Fi(z)?lo(N,q,"whitespace")(z):q(z)):S(z)}function q(z){return z===null||Pn(z)?(N.exit("codeFencedFence"),I(z)):S(z)}}}function a6e(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const j8={name:"codeIndented",tokenize:c6e},u6e={partial:!0,tokenize:d6e};function c6e(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),lo(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Pn(u)?e.attempt(u6e,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Pn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function d6e(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):lo(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Pn(r)?o(r):n(r)}}const f6e={name:"codeText",previous:p6e,resolve:h6e,tokenize:m6e};function h6e(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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 tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Um(this.left,i),s.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),Um(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Um(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=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function aq(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||JC(y)?n(y):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||Pn(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function g(y){return!c&&(y===null||y===41||gl(y))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(y)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Pn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Pn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Fi(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function cq(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):Pn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),lo(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Pn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function Xg(e,t){let n;return i;function i(o){return Pn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Fi(o)?lo(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const A6e={name:"definition",tokenize:S6e},x6e={partial:!0,tokenize:_6e};function S6e(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return uq.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=rx(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return gl(h)?Xg(e,u)(h):u(h)}function u(h){return aq(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(x6e,d,d)(h)}function d(h){return Fi(h)?lo(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Pn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function _6e(e,t,n){return i;function i(l){return gl(l)?Xg(e,o)(l):n(l)}function o(l){return cq(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Fi(l)?lo(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Pn(l)?t(l):n(l)}}const M6e={name:"hardBreakEscape",tokenize:I6e};function I6e(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Pn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const T6e={name:"headingAtx",resolve:E6e,tokenize:L6e};function E6e(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Ou(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function L6e(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||gl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Pn(c)?(e.exit("atxHeading"),t(c)):Fi(c)?lo(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||gl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const N6e=["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"],SD=["pre","script","style","textarea"],D6e={concrete:!0,name:"htmlFlow",resolveTo:R6e,tokenize:O6e},F6e={partial:!0,tokenize:P6e},B6e={partial:!0,tokenize:$6e};function R6e(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 O6e(e,t,n){const i=this;let o,s,r,l,a;return u;function u(W){return c(W)}function c(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),d}function d(W){return W===33?(e.consume(W),f):W===47?(e.consume(W),s=!0,g):W===63?(e.consume(W),o=3,i.interrupt?t:j):wu(W)?(e.consume(W),r=String.fromCharCode(W),v):n(W)}function f(W){return W===45?(e.consume(W),o=2,h):W===91?(e.consume(W),o=5,l=0,m):wu(W)?(e.consume(W),o=4,i.interrupt?t:j):n(W)}function h(W){return W===45?(e.consume(W),i.interrupt?t:j):n(W)}function m(W){const Q="CDATA[";return W===Q.charCodeAt(l++)?(e.consume(W),l===Q.length?i.interrupt?t:M:m):n(W)}function g(W){return wu(W)?(e.consume(W),r=String.fromCharCode(W),v):n(W)}function v(W){if(W===null||W===47||W===62||gl(W)){const Q=W===47,te=r.toLowerCase();return!Q&&!s&&SD.includes(te)?(o=1,i.interrupt?t(W):M(W)):N6e.includes(r.toLowerCase())?(o=6,Q?(e.consume(W),y):i.interrupt?t(W):M(W)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(W):s?b(W):w(W))}return W===45||Ha(W)?(e.consume(W),r+=String.fromCharCode(W),v):n(W)}function y(W){return W===62?(e.consume(W),i.interrupt?t:M):n(W)}function b(W){return Fi(W)?(e.consume(W),b):x(W)}function w(W){return W===47?(e.consume(W),x):W===58||W===95||wu(W)?(e.consume(W),C):Fi(W)?(e.consume(W),w):x(W)}function C(W){return W===45||W===46||W===58||W===95||Ha(W)?(e.consume(W),C):T(W)}function T(W){return W===61?(e.consume(W),N):Fi(W)?(e.consume(W),T):w(W)}function N(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),a=W,I):Fi(W)?(e.consume(W),N):S(W)}function I(W){return W===a?(e.consume(W),a=null,_):W===null||Pn(W)?n(W):(e.consume(W),I)}function S(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||gl(W)?T(W):(e.consume(W),S)}function _(W){return W===47||W===62||Fi(W)?w(W):n(W)}function x(W){return W===62?(e.consume(W),E):n(W)}function E(W){return W===null||Pn(W)?M(W):Fi(W)?(e.consume(W),E):n(W)}function M(W){return W===45&&o===2?(e.consume(W),$):W===60&&o===1?(e.consume(W),B):W===62&&o===4?(e.consume(W),G):W===63&&o===3?(e.consume(W),j):W===93&&o===5?(e.consume(W),H):Pn(W)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(F6e,ne,R)(W)):W===null||Pn(W)?(e.exit("htmlFlowData"),R(W)):(e.consume(W),M)}function R(W){return e.check(B6e,q,ne)(W)}function q(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),z}function z(W){return W===null||Pn(W)?R(W):(e.enter("htmlFlowData"),M(W))}function $(W){return W===45?(e.consume(W),j):M(W)}function B(W){return W===47?(e.consume(W),r="",P):M(W)}function P(W){if(W===62){const Q=r.toLowerCase();return SD.includes(Q)?(e.consume(W),G):M(W)}return wu(W)&&r.length<8?(e.consume(W),r+=String.fromCharCode(W),P):M(W)}function H(W){return W===93?(e.consume(W),j):M(W)}function j(W){return W===62?(e.consume(W),G):W===45&&o===2?(e.consume(W),j):M(W)}function G(W){return W===null||Pn(W)?(e.exit("htmlFlowData"),ne(W)):(e.consume(W),G)}function ne(W){return e.exit("htmlFlow"),t(W)}}function $6e(e,t,n){const i=this;return o;function o(r){return Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function P6e(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Yk,t,n)}}const z6e={name:"htmlText",tokenize:j6e};function j6e(e,t,n){const i=this;let o,s,r;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),a}function a(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),T):j===63?(e.consume(j),w):wu(j)?(e.consume(j),S):n(j)}function u(j){return j===45?(e.consume(j),c):j===91?(e.consume(j),s=0,m):wu(j)?(e.consume(j),b):n(j)}function c(j){return j===45?(e.consume(j),h):n(j)}function d(j){return j===null?n(j):j===45?(e.consume(j),f):Pn(j)?(r=d,B(j)):(e.consume(j),d)}function f(j){return j===45?(e.consume(j),h):d(j)}function h(j){return j===62?$(j):j===45?f(j):d(j)}function m(j){const G="CDATA[";return j===G.charCodeAt(s++)?(e.consume(j),s===G.length?g:m):n(j)}function g(j){return j===null?n(j):j===93?(e.consume(j),v):Pn(j)?(r=g,B(j)):(e.consume(j),g)}function v(j){return j===93?(e.consume(j),y):g(j)}function y(j){return j===62?$(j):j===93?(e.consume(j),y):g(j)}function b(j){return j===null||j===62?$(j):Pn(j)?(r=b,B(j)):(e.consume(j),b)}function w(j){return j===null?n(j):j===63?(e.consume(j),C):Pn(j)?(r=w,B(j)):(e.consume(j),w)}function C(j){return j===62?$(j):w(j)}function T(j){return wu(j)?(e.consume(j),N):n(j)}function N(j){return j===45||Ha(j)?(e.consume(j),N):I(j)}function I(j){return Pn(j)?(r=I,B(j)):Fi(j)?(e.consume(j),I):$(j)}function S(j){return j===45||Ha(j)?(e.consume(j),S):j===47||j===62||gl(j)?_(j):n(j)}function _(j){return j===47?(e.consume(j),$):j===58||j===95||wu(j)?(e.consume(j),x):Pn(j)?(r=_,B(j)):Fi(j)?(e.consume(j),_):$(j)}function x(j){return j===45||j===46||j===58||j===95||Ha(j)?(e.consume(j),x):E(j)}function E(j){return j===61?(e.consume(j),M):Pn(j)?(r=E,B(j)):Fi(j)?(e.consume(j),E):_(j)}function M(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,R):Pn(j)?(r=M,B(j)):Fi(j)?(e.consume(j),M):(e.consume(j),q)}function R(j){return j===o?(e.consume(j),o=void 0,z):j===null?n(j):Pn(j)?(r=R,B(j)):(e.consume(j),R)}function q(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||gl(j)?_(j):(e.consume(j),q)}function z(j){return j===47||j===62||gl(j)?_(j):n(j)}function $(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function B(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),P}function P(j){return Fi(j)?lo(e,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):H(j)}function H(j){return e.enter("htmlTextData"),r(j)}}const ax={name:"labelEnd",resolveAll:U6e,resolveTo:V6e,tokenize:K6e},H6e={tokenize:Z6e},W6e={tokenize:G6e},q6e={tokenize:Q6e};function U6e(e){let t=-1;const n=[];for(;++t=3&&(u===null||Pn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Fi(u)?lo(e,l,"whitespace")(u):l(u))}}const nl={continuation:{tokenize:r7e},exit:a7e,name:"list",tokenize:s7e},i7e={partial:!0,tokenize:u7e},o7e={partial:!0,tokenize:l7e};function s7e(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:XC(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Zy,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return XC(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(Yk,i.interrupt?n:c,e.attempt(i7e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Fi(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function r7e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Yk,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,lo(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Fi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(o7e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,lo(e,e.attempt(nl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function l7e(e,t,n){const i=this;return lo(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function a7e(e){e.exit(this.containerState.type)}function u7e(e,t,n){const i=this;return lo(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Fi(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const _D={name:"setextUnderline",resolveTo:c7e,tokenize:d7e};function c7e(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function d7e(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Fi(u)?lo(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Pn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const f7e={tokenize:h7e};function h7e(e){const t=this,n=e.attempt(Yk,i,e.attempt(this.parser.constructs.flowInitial,o,lo(e,e.attempt(this.parser.constructs.flow,o,e.attempt(y6e,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const p7e={resolveAll:fq()},m7e=dq("string"),g7e=dq("text");function dq(e){return{resolveAll:fq(e==="text"?v7e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function E7e(e,t){let n=-1;const i=[];let o;for(;++n>1}};Ys.from=function(e){if(e instanceof Ys)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ys(t)};function hq(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function gq(e){return e>=55296&&e<56320}class Xt{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new Xt(i,o)}cutByIndex(t,n){return t==n?Xt.empty:t==0&&n==this.content.length?this:new Xt(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new Xt(o,s)}addToStart(t){return new Xt([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Xt(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?iy(n+1,s):iy(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Xt.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return Xt.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Xt.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}zi.none=[];class $0 extends Error{}class hn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=yq(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new hn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new hn(vq(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return hn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new hn(Xt.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new hn(t,i,o)}}hn.empty=new hn(Xt.empty,0,0);function vq(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(vq(s.content,t-o-1,n-o-1)))}function yq(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=yq(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function F7e(e,t,n){if(n.openStart>e.depth)throw new $0("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new $0("Inconsistent open depths");return kq(e,t,n,0)}function kq(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function e0(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(yh(e.nodeAfter,i),s++));for(let l=s;lo&&tA(e,t,o+1),r=i.depth>o&&tA(n,i,o+1),l=[];return e0(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(bq(s,r),yh(kh(s,wq(e,t,n,i,o+1)),l)):(s&&yh(kh(s,k4(e,t,o+1)),l),e0(t,n,o,l),r&&yh(kh(r,k4(n,i,o+1)),l)),e0(i,null,o,l),new Xt(l)}function k4(e,t,n){let i=[];if(e0(null,e,n,i),e.depth>n){let o=tA(e,t,n+1);yh(kh(o,k4(e,t,n+1)),i)}return e0(t,null,n,i),new Xt(i)}function B7e(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(Xt.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class P0{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new $7e(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new P0(n,i,s)}static resolveCached(t,n){let i=ID.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Cq(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=Xt.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=Xt.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};bh.prototype.text=void 0;class b4 extends bh{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cq(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new b4(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new b4(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Cq(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Bh{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new z7e(t,n);if(i.next==null)return Bh.empty;let o=Aq(i);i.next&&i.err("Unexpected trailing text");let s=K7e(V7e(o));return Z7e(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` -`)}}Bh.empty=new Bh(!0);class z7e{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Aq(e){let t=[];do t.push(j7e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function j7e(e){let t=[];do t.push(H7e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function H7e(e){let t=U7e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=W7e(e,t);else break;return t}function TD(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function W7e(e,t){let n=TD(e),i=n;return e.eat(",")&&(e.next!="}"?i=TD(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function q7e(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function U7e(e){if(e.eat("(")){let t=Aq(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=q7e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function V7e(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Bh(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:_q(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new bh(this,this.computeAttrs(t),Xt.from(n),zi.setFrom(i))}createChecked(t=null,n,i){return n=Xt.from(n),this.checkContent(n),new bh(this,this.computeAttrs(t),n,zi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=Xt.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(Xt.empty,!0);return s?new bh(this,t,n.append(s),zi.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new Tq(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function G7e(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class Q7e{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?G7e(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Jk{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=Iq(t,o.attrs),this.excluded=null;let s=Sq(this.attrs);this.instance=s?new zi(this,s):null}create(t=null){return!t&&this.instance?this.instance:new zi(this,_q(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new Jk(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class Y7e{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Ys.from(t.nodes),n.marks=Ys.from(t.marks||{}),this.nodes=LD.compile(this.spec.nodes,this),this.marks=Jk.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Bh.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?ND(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:ND(this,r.split(" "))}this.nodeFromJSON=o=>bh.fromJSON(this,o),this.markFromJSON=o=>zi.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof LD){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new b4(i,i.defaultAttrs,t,zi.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function ND(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function J7e(e){return e.tag!=null}function X7e(e){return e.style!=null}let Eq=class iA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(J7e(o))this.tags.push(o);else if(X7e(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new FD(this,n,!1);return i.addAll(t,zi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new FD(this,n,!0);return i.addAll(t,zi.none,n.from,n.to),hn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=BD(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=BD(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new iA(t,iA.schemaRules(t)))}};const Lq={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},exe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Nq={ol:!0,ul:!0},z0=1,oA=2,t0=4;function DD(e,t,n){return t!=null?(t?z0:0)|(t==="full"?oA:0):e&&e.whitespace=="pre"?z0|oA:n&~t0}class oy{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=zi.none,this.match=s||(r&t0?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Xt.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&z0)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=Xt.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Xt.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Lq.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class FD{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=DD(null,n.preserveWhitespace,0)|(i?t0:0);o?s=new oy(o.type,o.attrs,zi.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new oy(null,null,zi.none,!0,null,r):s=new oy(t.schema.topNodeType,null,zi.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&oA?"full":this.localPreserveWS||(o.options&z0)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` -`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):RD(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new oy(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=z0)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function txe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&Nq.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function nxe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function BD(e){let t={};for(let n in e)t[n]=e[n];return t}function RD(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&Gy(sy(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:Gy(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Lu(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=OD(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return OD(t.marks)}}function OD(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function sy(e){return e.document||window.document}const $D=new WeakMap;function ixe(e){let t=$D.get(e);return t===void 0&&$D.set(e,t=oxe(e)),t}function oxe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=Gy(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Dq=65535,Fq=Math.pow(2,16);function sxe(e,t){return e+t*Fq}function PD(e){return e&Dq}function rxe(e){return(e-(e&Dq))/Fq}const Bq=1,Rq=2,Qy=4,Oq=8;class sA{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&Oq)>0}get deletedBefore(){return(this.delInfo&(Bq|Qy))>0}get deletedAfter(){return(this.delInfo&(Rq|Qy))>0}get deletedAcross(){return(this.delInfo&Qy)>0}}class Bl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Bl.empty)return Bl.empty}recover(t){let n=0,i=PD(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:sxe(l/3,t-a),g=t==a?Rq:t==d?Bq:Qy;return(n<0?t!=a:t!=d)&&(g|=Oq),new sA(h,g,m)}o+=c-u}return i?t+o:new sA(t+o,0,null)}touches(t,n){let i=0,o=PD(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new j0;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return as.fromReplace(t,this.from,this.to,s)}invert(){return new Su(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new gd(n.pos,i.pos,this.mark)}merge(t){return t instanceof gd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new gd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new gd(n.from,n.to,t.markFromJSON(n.mark))}}Mr.jsonID("addMark",gd);class Su extends Mr{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new hn(ux(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return as.fromReplace(t,this.from,this.to,i)}invert(){return new gd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Su(n.pos,i.pos,this.mark)}merge(t){return t instanceof Su&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Su(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Su(n.from,n.to,t.markFromJSON(n.mark))}}Mr.jsonID("removeMark",Su);class vd extends Mr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return as.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return as.fromReplace(t,this.pos,this.pos+1,new hn(Xt.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new Hl(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Hl(n.from,n.to,n.gapFrom,n.gapTo,hn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Mr.jsonID("replaceAround",Hl);function rA(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function lxe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function axe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof Jk){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new Su(r.from,r.to,r.style)))}function cx(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function uxe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function dx(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=Xt.from(i.node(m).copy(c)),d++):a--;let f=Xt.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Xt.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new Hl(o,s,o,s,new hn(i,0,0),n.length,!0))}function fxe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&hxe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&Pq(e,r,l,s),cx(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new Hl(d,f,d+1,f-1,new hn(Xt.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&$q(e,r,l,s),!1}})}function $q(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function Pq(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` -`))}})}function hxe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function pxe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Hl(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new hn(Xt.from(r),0,0),1,!0))}function Yy(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function mxe(e,t,n=1,i){let o=e.doc.resolve(t),s=Xt.empty,r=Xt.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=Xt.from(o.node(l).copy(s));let c=i&&i[u];r=Xt.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new js(t,t,new hn(s.append(r),n,n),!0))}function zq(e,t){let n=e.resolve(t),i=n.index();return vxe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function gxe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function fx(e,t,n=t,i=hn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return jq(o,s,i)?new js(t,n,i):new wxe(o,s,i).fit()}function jq(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class wxe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=Xt.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=Xt.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new hn(s,r,l);return t>-1?new Hl(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new js(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=U8(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(Xt.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=U8(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new hn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=U8(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new hn(pg(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new hn(pg(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=v,c.push(Hq(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=mg(this.placed,n,Xt.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=V8(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=mg(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=mg(this.placed,this.depth,Xt.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Xt.empty,!0);n.childCount&&(this.placed=mg(this.placed,this.frontier.length,n))}}function pg(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(pg(e.firstChild.content,t-1,n)))}function mg(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(mg(e.lastChild.content,t-1,n)))}function U8(e,t){for(let n=0;n1&&(i=i.replaceChild(0,Hq(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(Xt.empty,!0)))),e.copy(i)}function V8(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!Cxe(n,s.content,r)?l:null}function Cxe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=Axe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function Wq(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(Xt.empty,!0))}return e}function Sxe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=kxe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new hn(Xt.from(i),0,0))}function _xe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=qq(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function qq(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class d1 extends Mr{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return as.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return as.fromReplace(t,this.pos,this.pos+1,new hn(Xt.from(o),0,n.isLeaf?0:1))}getMap(){return Bl.empty}invert(t){return new d1(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new d1(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new d1(n.pos,n.attr,n.value)}}Mr.jsonID("attr",d1);class H0 extends Mr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return as.ok(i)}getMap(){return Bl.empty}invert(t){return new H0(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new H0(n.attr,n.value)}}Mr.jsonID("docAttr",H0);let L1=class extends Error{};L1=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};L1.prototype=Object.create(Error.prototype);L1.prototype.constructor=L1;L1.prototype.name="TransformError";class Mxe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new j0}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new L1(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=hn.empty){let o=fx(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new hn(Xt.from(i),0,0))}delete(t,n){return this.replace(t,n,hn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return xxe(this,t,n,i),this}replaceRangeWith(t,n,i){return Sxe(this,t,n,i),this}deleteRange(t,n){return _xe(this,t,n),this}lift(t,n){return cxe(this,t,n),this}join(t,n=1){return yxe(this,t,n),this}wrap(t,n){return dxe(this,t,n),this}setBlockType(t,n=t,i,o=null){return fxe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return pxe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new d1(t,n,i)),this}setDocAttribute(t,n){return this.step(new H0(t,n)),this}addNodeMark(t,n){return this.step(new vd(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof zi)n.isInSet(i.marks)&&this.step(new Rh(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Rh(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return mxe(this,t,n,i),this}addMark(t,n,i){return lxe(this,t,n,i),this}removeMark(t,n,i){return axe(this,t,n,i),this}clearIncompatible(t,n,i){return cx(this,t,n,i),this}}const K8=Object.create(null);class Vi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new Ixe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?Np(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):Np(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Wl(t.node(0))}static atStart(t){return Np(t,t,0,0,1)||new Wl(t)}static atEnd(t){return Np(t,t,t.content.size,t.childCount,-1)||new Wl(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=K8[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in K8)throw new RangeError("Duplicate use of selection JSON ID "+t);return K8[t]=n,n.prototype.jsonID=t,n}getBookmark(){return si.between(this.$anchor,this.$head).getBookmark()}}Vi.prototype.visible=!0;class Ixe{constructor(t,n){this.$from=t,this.$to=n}}let zD=!1;function jD(e){!zD&&!e.parent.inlineContent&&(zD=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class si extends Vi{constructor(t,n=t){jD(t),jD(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Vi.near(i);let o=t.resolve(n.map(this.anchor));return new si(o.parent.inlineContent?o:i,i)}replace(t,n=hn.empty){if(super.replace(t,n),n==hn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof si&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Xk(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new si(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Vi.findFrom(n,i,!0)||Vi.findFrom(n,-i,!0);if(s)n=s.$head;else return Vi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Vi.findFrom(t,-i,!0)||Vi.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Kn.isSelectable(l))return Kn.create(e,n-(o<0?l.nodeSize:0))}else{let a=Np(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function HD(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Vi.near(e.doc.resolve(r),n))}const WD=1,ry=2,qD=4;class Exe extends Mxe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ry,this}ensureMarks(t){return zi.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ry)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ry,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||zi.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Vi.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qD,this}get scrolledIntoView(){return(this.updated&qD)>0}}function UD(e,t){return!t||!e?e:e.bind(t)}class gg{constructor(t,n,i){this.name=t,this.init=UD(n.init,i),this.apply=UD(n.apply,i)}}const Lxe=[new gg("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new gg("selection",{init(e,t){return e.selection||Vi.atStart(t.doc)},apply(e){return e.selection}}),new gg("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new gg("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Z8{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Lxe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new gg(i.key,i.spec.state,i))})}}class ih{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Z8(t.schema,t.plugins),s=new ih(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=bh.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Vi.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function Uq(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=Uq(o,t,{})),n[i]=o}return n}class tm{constructor(t){this.spec=t,this.props={},t.props&&Uq(t.props,this,this.props),this.key=t.key?t.key.key:Vq("plugin")}getState(t){return t[this.key]}}const G8=Object.create(null);function Vq(e){return e in G8?e+"$"+ ++G8[e]:(G8[e]=0,e+"$")}class px{constructor(t="key"){this.key=Vq(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const lA=` - - - - -`,Kq=` - - - - -`,Zq='',Gq=` - - - -`,Qq=` - - -`,Yq='',Jq=` - - -`,Xq=` - - -`,eU=` - - -`,Nxe='',Dxe='',Fxe='',Bxe='',Rxe='',Oxe={sm:14,md:16,lg:20},$xe={file:lA,folder:Kq,skill:Zq,copy:Gq,check:Qq,"external-link":Yq,target:Jq,"file-edit":Xq,close:eU,attachment:Nxe,image:Dxe,video:Fxe,fullscreen:Bxe,quote:Rxe};function Kr(e,t="md"){const n=Oxe[t];return $xe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^